1
This commit is contained in:
parent
7a83471684
commit
60d2a7efb3
@ -7,6 +7,7 @@ import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.DlBaseEntity;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@ -21,6 +22,6 @@ public class BusiCategoryVO extends BusiCategory {
|
||||
/**
|
||||
* 子集
|
||||
*/
|
||||
private List<BusiCategory> children;
|
||||
private List<BusiCategory> children = new ArrayList<>();
|
||||
|
||||
}
|
||||
|
@ -52,6 +52,8 @@ export default {
|
||||
catgName:"",
|
||||
catgType:"",
|
||||
},
|
||||
//列表页入参
|
||||
query:{},
|
||||
//表单校验规则
|
||||
rules:{
|
||||
code: [
|
||||
@ -66,10 +68,20 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.query = this.$route.query
|
||||
},
|
||||
|
||||
methods:{
|
||||
|
||||
/**确定按钮*/
|
||||
submitForm(){
|
||||
if (this.query.catgLevel){
|
||||
this.form.catgLevel = this.query.catgLevel
|
||||
}
|
||||
if (this.query.parentId){
|
||||
this.form.parentId = this.query.parentId
|
||||
}
|
||||
addCategory(this.form).then((res) => {
|
||||
if (res.code == 200){
|
||||
this.$modal.msgSuccess("保存成功");
|
||||
|
@ -26,23 +26,36 @@
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
<el-table v-loading="loading" :data="categoryList" >
|
||||
<el-table-column label="栏目名称" align="center" prop="catgName" />
|
||||
<el-table-column label="栏目级别" align="center" prop="catgLevel" />
|
||||
<el-table
|
||||
row-key="id"
|
||||
border
|
||||
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"
|
||||
v-loading="loading" :data="categoryList" >
|
||||
<el-table-column label="栏目名称" align="left" prop="catgName" />
|
||||
<el-table-column label="栏目级别" align="center" prop="catgLevel">
|
||||
<template slot-scope="scope">
|
||||
{{scope.row.catgLevel}}级栏目
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="栏目类型" align="center" prop="catgType" >
|
||||
<template slot-scope="scope">
|
||||
<dict-tag :options="dict.type.category_type" :value="scope.row.catgType"/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="排序" align="center" prop="sort" />
|
||||
<el-table-column label="修改时间" align="center" prop="updateTime" />
|
||||
<el-table-column label="修改时间" align="center" prop="updateTime">
|
||||
<template slot-scope="scope">
|
||||
<span v-if="scope.row.updateTime == null">{{scope.row.createTime}}</span>
|
||||
<span v-else>{{scope.row.updateTime}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleChildAdd(scope.row)"
|
||||
v-hasPermi="['busi:category:edit']"
|
||||
>添加子栏目</el-button>
|
||||
<el-button
|
||||
@ -98,7 +111,7 @@ export default {
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listCategory(this.queryParams).then(response => {
|
||||
console.log(response)
|
||||
console.log(response.data)
|
||||
this.categoryList = response.data;
|
||||
this.loading = false;
|
||||
});
|
||||
@ -108,15 +121,23 @@ export default {
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
},
|
||||
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.resetForm("queryForm");
|
||||
this.handleQuery();
|
||||
},
|
||||
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.$router.push({path:'/category/categoryForm'})
|
||||
this.$router.push({path:'/category/categoryForm',query:{catgLevel:1}})
|
||||
},
|
||||
|
||||
/**添加子栏目*/
|
||||
handleChildAdd(row){
|
||||
this.$router.push({path:'/category/categoryForm',query:{catgLevel:row.catgLevel+1,parentId:row.id}})
|
||||
},
|
||||
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user