|
@@ -27,8 +27,9 @@
|
|
|
<div v-if="!IS_NONE_SET" class="struct-box">
|
|
|
<div v-if="isClassify" class="struct-folder">
|
|
|
<el-tree
|
|
|
+ ref="folderTree"
|
|
|
class="folder-tree"
|
|
|
- :data="folderTree"
|
|
|
+ :data="classifyTree"
|
|
|
node-key="id"
|
|
|
default-expand-all
|
|
|
:expand-on-click-node="false"
|
|
@@ -137,8 +138,8 @@ export default {
|
|
|
isProperty: false,
|
|
|
checkedSet: [],
|
|
|
selectedFolderIds: [],
|
|
|
- folderTree,
|
|
|
- // folderTree: [],
|
|
|
+ classifyTree: folderTree,
|
|
|
+ // classifyTree: [],
|
|
|
treeProps: {
|
|
|
label: "name",
|
|
|
},
|
|
@@ -195,6 +196,10 @@ export default {
|
|
|
this.buildDataList();
|
|
|
},
|
|
|
async getOriginList() {
|
|
|
+ if (this.isClassify && !this.selectedFolderIds.length) {
|
|
|
+ this.$message.error("请选择选择文件夹!");
|
|
|
+ return;
|
|
|
+ }
|
|
|
let data = {
|
|
|
...this.filterData,
|
|
|
isDifficult: this.isDifficult,
|
|
@@ -271,9 +276,10 @@ export default {
|
|
|
return classifyData;
|
|
|
}
|
|
|
|
|
|
- classifyData.propertyDistributeInfo = curCourseProp.distributeInfo.map(
|
|
|
- (item) => parsePropertyData(item)
|
|
|
- );
|
|
|
+ classifyData.propertyDistributeInfo =
|
|
|
+ curCourseProp.propertyDistributeInfo.map((item) =>
|
|
|
+ parsePropertyData(item, classifyData.id)
|
|
|
+ );
|
|
|
|
|
|
return classifyData;
|
|
|
}
|
|
@@ -289,9 +295,9 @@ export default {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- function parsePropertyData(data) {
|
|
|
+ function parsePropertyData(data, parentId) {
|
|
|
let propData = {
|
|
|
- id: data.propertyId,
|
|
|
+ id: `${parentId}_${data.propertyId}`,
|
|
|
name: data.propertyName,
|
|
|
propertyId: data.propertyId,
|
|
|
propertyName: data.propertyName,
|
|
@@ -310,7 +316,7 @@ export default {
|
|
|
|
|
|
if (data.propertyDistributeInfo && data.propertyDistributeInfo.length) {
|
|
|
propData.propertyDistributeInfo = data.propertyDistributeInfo.map(
|
|
|
- (item) => parsePropertyData(item)
|
|
|
+ (item) => parsePropertyData(item, propData.id)
|
|
|
);
|
|
|
}
|
|
|
return propData;
|