模型完善

dev_2022-03-03
Jo 3 years ago
parent 094121935b
commit 2f06f6ab7d
  1. 8
      src/components/codemirror.vue

@ -71,7 +71,7 @@
:props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}"> :props="{children: 'children', label: 'categoryName', isLeaf: 'leaf'}">
</el-tree> </el-tree>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button size="small" @click="typeVisible = false">取消</el-button> <el-button size="small" @click="modelVisible = false">取消</el-button>
<el-button size="small" type="primary" @click="submit">导入</el-button> <el-button size="small" type="primary" @click="submit">导入</el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -229,10 +229,12 @@ export default {
pageSize: 10000, pageSize: 10000,
categoryId: e.id categoryId: e.id
}).then(res => { }).then(res => {
const { records } = res.data let { records } = res.data
records = records.filter(e => !e.isOpen) //
records.map(n => { records.map(n => {
n.categoryName = n.modelName n.categoryName = n.modelName
}) })
console.log(records)
e.children = [...e.children, ...records] e.children = [...e.children, ...records]
resolve() resolve()
}).catch(res => { }).catch(res => {
@ -262,7 +264,7 @@ export default {
const id = this.$refs.tree.getCheckedKeys() const id = this.$refs.tree.getCheckedKeys()
if (!id.length) return this.$message.error('请选择模型!') if (!id.length) return this.$message.error('请选择模型!')
this.$post(`${this.api.referenceFindById}?id=${id[0]}`).then(res => { this.$post(`${this.api.referenceFindById}?id=${id[0]}`).then(res => {
this.codeVal += '\n' + res.data.modelDemo this.codeVal += '\n\n' + res.data.modelDemo
this.modelVisible = false this.modelVisible = false
}).catch(res => {}) }).catch(res => {})
}, },

Loading…
Cancel
Save