|
@@ -32,28 +32,28 @@
|
|
|
<span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
<span>{{ node.label }}</span>
|
|
|
<span style="padding-left: 10px;">
|
|
|
- <el-button type="text" size="mini" @click.stop.native="append(data, node)">
|
|
|
+ <el-button type="text" size="mini" @click.stop.native="nodeEvent(data, node,'append')">
|
|
|
<el-tooltip class="item" effect="dark" content="添加子级分类节点" placement="bottom-start">
|
|
|
<i class="el-icon-plus" style="font-size: 16px;"></i>
|
|
|
</el-tooltip>
|
|
|
</el-button>
|
|
|
</span>
|
|
|
<span style="padding-left: 10px;">
|
|
|
- <el-button type="text" size="mini" @click.stop.native="edit(data, node)">
|
|
|
+ <el-button type="text" size="mini" @click.stop.native="nodeEvent(data, node,'edit')">
|
|
|
<el-tooltip class="item" effect="dark" content="编辑分类节点" placement="bottom-start">
|
|
|
<i class="el-icon-edit-outline" style="font-size: 16px;"></i>
|
|
|
</el-tooltip>
|
|
|
</el-button>
|
|
|
</span>
|
|
|
<span style="padding-left: 10px;">
|
|
|
- <el-button type="text" size="mini" @click.stop.native="remove(data, node)">
|
|
|
+ <el-button type="text" size="mini" @click.stop.native="nodeEvent(data, node,'remove')">
|
|
|
<el-tooltip class="item" effect="dark" content="删除分类节点" placement="bottom-start">
|
|
|
<i class="el-icon-delete" style="font-size: 16px;"></i>
|
|
|
</el-tooltip>
|
|
|
</el-button>
|
|
|
</span>
|
|
|
<span style="padding-left: 10px;">
|
|
|
- <el-button type="text" size="mini" @click.stop.native="copy(data, node)">
|
|
|
+ <el-button type="text" size="mini" @click.stop.native="nodeEvent(data, node,'copy')">
|
|
|
<el-tooltip class="item" effect="dark" content="复制分类架构节点" placement="bottom-start">
|
|
|
<i class="el-icon-document-copy" style="font-size: 16px;"></i>
|
|
|
</el-tooltip>
|
|
@@ -206,7 +206,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 子组件传来的值
|
|
|
- handleOption({ val, row }) {
|
|
|
+ async handleOption({ val, row }) {
|
|
|
+ if(!(await this.$permission.producePermission(this.id,this.type))){
|
|
|
+ this.$showPermissionDialog()
|
|
|
+ return false
|
|
|
+ }
|
|
|
// console.log(val, row);
|
|
|
switch (val) {
|
|
|
case '0'://编辑
|
|
@@ -254,7 +258,11 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
// 按钮新增分类节点
|
|
|
- handleAppend() {
|
|
|
+ async handleAppend() {
|
|
|
+ if(!(await this.$permission.producePermission(this.id,this.type))){
|
|
|
+ this.$showPermissionDialog()
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.$refs.classifyNode.open(null, this.row)
|
|
|
},
|
|
|
// 根据产品名称查询产品
|
|
@@ -278,6 +286,13 @@ export default {
|
|
|
})
|
|
|
|
|
|
},
|
|
|
+ async nodeEvent(data, node,eventName){
|
|
|
+ if(!(await this.$permission.producePermission(this.id,this.type))){
|
|
|
+ this.$showPermissionDialog()
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ this[eventName](data,node)
|
|
|
+ },
|
|
|
// 树节点上的新增
|
|
|
append(data, node) {
|
|
|
this.$refs.classifyNode.open(null, this.row, data)
|
|
@@ -306,7 +321,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
// 按钮复制分类架构
|
|
|
- handleCopy() {
|
|
|
+ async handleCopy() {
|
|
|
+ if(!(await this.$permission.producePermission(this.id,this.type))){
|
|
|
+ this.$showPermissionDialog()
|
|
|
+ return false
|
|
|
+ }
|
|
|
this.nodeId = null
|
|
|
this.openNodeCopy()
|
|
|
},
|