|
|
@@ -15,7 +15,11 @@
|
|
|
:highlight-current="true"
|
|
|
node-key="id"
|
|
|
@node-click="handleNodeClick"
|
|
|
- ></el-tree>
|
|
|
+ >
|
|
|
+ <span class="custom-tree-node" slot-scope="{ node, data }">
|
|
|
+ {{( isCode == 1 ? data.code : '' )+ ' ' + data.name }}
|
|
|
+ </span>
|
|
|
+ </el-tree>
|
|
|
</div>
|
|
|
|
|
|
<template v-slot:content>
|
|
|
@@ -64,7 +68,7 @@
|
|
|
<el-col v-bind="styleResponsive ? { sm: 6 } : { span: 6 }">
|
|
|
<el-form-item label="节点编码:">
|
|
|
<div class="ele-text-secondary">
|
|
|
- {{ current.code }}
|
|
|
+ {{ currentData.categoryLevelPathCode }}
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
</el-col>
|
|
|
@@ -129,6 +133,7 @@
|
|
|
|
|
|
import dictMixins from '@/mixins/dictMixins';
|
|
|
import { getTreeByGroup } from '@/api/classifyManage';
|
|
|
+ import { parameterGetByCode } from '@/api/system/dictionary/index.js';
|
|
|
|
|
|
import { getInfoById } from '@/api/classifyManage';
|
|
|
|
|
|
@@ -143,6 +148,7 @@
|
|
|
data() {
|
|
|
return {
|
|
|
loading: false,
|
|
|
+ isCode: 0,
|
|
|
current: {},
|
|
|
curNode: {},
|
|
|
treeList: [],
|
|
|
@@ -192,6 +198,14 @@
|
|
|
},
|
|
|
created() {
|
|
|
this.getTreeData();
|
|
|
+ //是否显示code
|
|
|
+ parameterGetByCode({
|
|
|
+ code: 'mian_product_code'
|
|
|
+ }).then((res) => {
|
|
|
+ if (res.value) {
|
|
|
+ this.isCode = res.value;
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
methods: {
|
|
|
async getTreeData() {
|
|
|
@@ -292,22 +306,28 @@
|
|
|
}
|
|
|
|
|
|
this.pathList.unshift(data);
|
|
|
+
|
|
|
const PathInfo = {
|
|
|
categoryLevelPath: '',
|
|
|
categoryLevelPathId: [],
|
|
|
- // rootCategoryLevelId: null,
|
|
|
+ categoryLevelPathCode: '',
|
|
|
categoryLevelId: '',
|
|
|
categoryLevelName: '',
|
|
|
ruleCode: ''
|
|
|
};
|
|
|
const pathName = [];
|
|
|
+ const pathCode = [];
|
|
|
+ console.log(this.pathList, 'this.pathList');
|
|
|
this.pathList.map((item) => {
|
|
|
pathName.unshift(item.name);
|
|
|
+ pathCode.unshift(item.code);
|
|
|
+
|
|
|
PathInfo.categoryLevelPathId.unshift(item.id);
|
|
|
// PathInfo.rootCategoryLevelId = item.rootCategoryLevelId;
|
|
|
});
|
|
|
PathInfo.categoryLevelPath = pathName.join('-');
|
|
|
PathInfo.categoryLevelPathId = PathInfo.categoryLevelPathId.join(',');
|
|
|
+ PathInfo.categoryLevelPathCode = pathCode.join('-');
|
|
|
PathInfo.categoryLevelId = data.id;
|
|
|
PathInfo.categoryLevelName = data.name;
|
|
|
PathInfo.ruleCode = ruleCode;
|