|
|
@ -76,9 +76,41 @@ |
|
|
|
<el-dialog title="请选择要导入的模型" |
|
|
|
<el-dialog title="请选择要导入的模型" |
|
|
|
:visible.sync="modelVisible" |
|
|
|
:visible.sync="modelVisible" |
|
|
|
width="400px" |
|
|
|
width="400px" |
|
|
|
:close-on-click-modal="false"> |
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
|
|
custom-class="model-dia"> |
|
|
|
|
|
|
|
<el-select class="w-100" |
|
|
|
|
|
|
|
v-model="modelType" |
|
|
|
|
|
|
|
size="mini"> |
|
|
|
|
|
|
|
<el-option v-for="item in modelOp" |
|
|
|
|
|
|
|
:key="item.id" |
|
|
|
|
|
|
|
:label="item.name" |
|
|
|
|
|
|
|
:value="item.id"> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
|
|
|
|
</el-select> |
|
|
|
|
|
|
|
<!-- <el-radio-group v-model="modelType" |
|
|
|
|
|
|
|
@change="changeModelType"> |
|
|
|
|
|
|
|
<div style="margin-bottom: 10px;"> |
|
|
|
|
|
|
|
<el-radio :label="0">本校模型</el-radio> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
|
|
|
|
|
<el-radio :label="1">内置模型</el-radio> |
|
|
|
|
|
|
|
</div> |
|
|
|
|
|
|
|
</el-radio-group> --> |
|
|
|
|
|
|
|
<!-- <el-divider></el-divider> --> |
|
|
|
<div class="model-wrap"> |
|
|
|
<div class="model-wrap"> |
|
|
|
<el-tree :data="modelData" |
|
|
|
<el-tree v-if="!modelType" |
|
|
|
|
|
|
|
:data="schoolModel" |
|
|
|
|
|
|
|
ref="tree" |
|
|
|
|
|
|
|
default-expand-all |
|
|
|
|
|
|
|
@check-change="treeCheckChange" |
|
|
|
|
|
|
|
show-checkbox |
|
|
|
|
|
|
|
:check-strictly="true" |
|
|
|
|
|
|
|
node-key="id" |
|
|
|
|
|
|
|
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}" |
|
|
|
|
|
|
|
v-loading="modelLoading"> |
|
|
|
|
|
|
|
</el-tree> |
|
|
|
|
|
|
|
<el-tree v-if="modelType" |
|
|
|
|
|
|
|
:data="systemModel" |
|
|
|
ref="tree" |
|
|
|
ref="tree" |
|
|
|
default-expand-all |
|
|
|
default-expand-all |
|
|
|
@check-change="treeCheckChange" |
|
|
|
@check-change="treeCheckChange" |
|
|
@ -200,7 +232,19 @@ export default { |
|
|
|
modelVisible: false, |
|
|
|
modelVisible: false, |
|
|
|
modelLoading: false, |
|
|
|
modelLoading: false, |
|
|
|
modelImporting: false, |
|
|
|
modelImporting: false, |
|
|
|
modelData: [] |
|
|
|
schoolModel: [], |
|
|
|
|
|
|
|
systemModel: [], |
|
|
|
|
|
|
|
modelType: 1, |
|
|
|
|
|
|
|
modelOp: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 0, |
|
|
|
|
|
|
|
name: '本校模型' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
name: '内置模型' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
] |
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
@ -252,14 +296,15 @@ export default { |
|
|
|
this.modelLoading = true |
|
|
|
this.modelLoading = true |
|
|
|
this.modelVisible = true |
|
|
|
this.modelVisible = true |
|
|
|
// 查询源模型分类 |
|
|
|
// 查询源模型分类 |
|
|
|
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}&founder=1`).then(({ data }) => { |
|
|
|
this.$post(`${this.api.modelClassListByStudent}?systemId=${this.systemId}&founder=1`).then(res => { |
|
|
|
const promises = [] |
|
|
|
const promises = [] |
|
|
|
const addType = list => { |
|
|
|
const addType = (list, system) => { |
|
|
|
list.map(e => { |
|
|
|
list.map(e => { |
|
|
|
e.disabled = true |
|
|
|
e.disabled = true |
|
|
|
// 用promise储存以添加完后更新数据 |
|
|
|
// 用promise储存以添加完后更新数据 |
|
|
|
promises.push(new Promise((resolve, reject) => { |
|
|
|
promises.push(new Promise((resolve, reject) => { |
|
|
|
this.$post(this.api.studentModelList, { |
|
|
|
// 系统内置跟本校的模型接口不一样 |
|
|
|
|
|
|
|
this.$post(this.api[system ? 'studentModelListBySystem' : 'studentModelList'], { |
|
|
|
categoryId: e.id, |
|
|
|
categoryId: e.id, |
|
|
|
pageNum: 1, |
|
|
|
pageNum: 1, |
|
|
|
pageSize: 10000, |
|
|
|
pageSize: 10000, |
|
|
@ -277,16 +322,22 @@ export default { |
|
|
|
reject() |
|
|
|
reject() |
|
|
|
}) |
|
|
|
}) |
|
|
|
})) |
|
|
|
})) |
|
|
|
e.children && e.children.length && addType(e.children) |
|
|
|
e.children && e.children.length && addType(e.children, system) |
|
|
|
}) |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
addType(data) |
|
|
|
addType(res.schoolClassification) |
|
|
|
|
|
|
|
addType(res.systemBuiltInClassification, 1) |
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
this.modelData = data |
|
|
|
this.schoolModel = res.schoolClassification |
|
|
|
|
|
|
|
this.systemModel = res.systemBuiltInClassification |
|
|
|
this.modelLoading = false |
|
|
|
this.modelLoading = false |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}).catch(res => { }) |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
// 分类类型选择回调 |
|
|
|
|
|
|
|
changeModelType (val) { |
|
|
|
|
|
|
|
// this.getType() |
|
|
|
|
|
|
|
}, |
|
|
|
// 多选框选择回调 |
|
|
|
// 多选框选择回调 |
|
|
|
treeCheckChange (data, checked, indeterminate) { |
|
|
|
treeCheckChange (data, checked, indeterminate) { |
|
|
|
const checkKey = this.$refs.tree.getCheckedKeys() |
|
|
|
const checkKey = this.$refs.tree.getCheckedKeys() |
|
|
@ -754,6 +805,14 @@ export default { |
|
|
|
max-width: 100%; |
|
|
|
max-width: 100%; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/deep/.model-dia { |
|
|
|
|
|
|
|
.el-dialog__body { |
|
|
|
|
|
|
|
padding: 0 20px; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
.el-divider--horizontal { |
|
|
|
|
|
|
|
margin: 15px 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
.model-wrap { |
|
|
|
.model-wrap { |
|
|
|
max-height: 400px; |
|
|
|
max-height: 400px; |
|
|
|
overflow: auto; |
|
|
|
overflow: auto; |
|
|
|