|
|
|
@ -35,6 +35,7 @@
|
|
|
|
|
:tree-props="{children: 'children', hasChildren: 'hasChildren'}"> |
|
|
|
|
<el-table-column prop="id" label="id" sortable width="180"></el-table-column> |
|
|
|
|
<el-table-column prop="name" label="名" sortable width="180"></el-table-column> |
|
|
|
|
<el-table-column prop="unit" label="单位" sortable width="180"></el-table-column> |
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> |
|
|
|
|
<template slot-scope="scope"> |
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span> |
|
|
|
@ -71,6 +72,9 @@
|
|
|
|
|
<el-form-item label="分类名称" prop="name"> |
|
|
|
|
<el-input v-model="form.name" placeholder="请输入" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
<el-form-item label="任务单位" prop="unit"> |
|
|
|
|
<el-input v-model="form.unit" placeholder="请输入" /> |
|
|
|
|
</el-form-item> |
|
|
|
|
</el-form> |
|
|
|
|
<div slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button type="primary" @click="submitForm">确 定</el-button> |
|
|
|
@ -144,17 +148,17 @@ export default {
|
|
|
|
|
if(filterList.length == 0){ |
|
|
|
|
//没有上级 |
|
|
|
|
this.list.forEach(t => { |
|
|
|
|
oneList.push({id:one.id, name:one.name, createTime:one.createTime, children:twoList}); |
|
|
|
|
oneList.push({id:one.id, name:one.name, unit:one.unit, createTime:one.createTime, children:twoList}); |
|
|
|
|
}) |
|
|
|
|
}else{ |
|
|
|
|
filterList.forEach((one) => { |
|
|
|
|
let twoList = []; |
|
|
|
|
this.list.forEach((two) => { |
|
|
|
|
if(one.id == two.parentId){ |
|
|
|
|
twoList.push({id:two.id, name:two.name, createTime:two.createTime}) |
|
|
|
|
twoList.push({id:two.id, name:two.name, unit:two.unit, createTime:two.createTime}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
oneList.push({id:one.id, name:one.name, createTime:one.createTime, children:twoList}); |
|
|
|
|
oneList.push({id:one.id, name:one.name, unit:one.unit, createTime:one.createTime, children:twoList}); |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|