|
|
@ -16,6 +16,7 @@ |
|
|
|
@click="clearCode" |
|
|
|
@click="clearCode" |
|
|
|
>清屏</el-button> |
|
|
|
>清屏</el-button> |
|
|
|
<el-button |
|
|
|
<el-button |
|
|
|
|
|
|
|
v-if="modelIsShow" |
|
|
|
class="btn" |
|
|
|
class="btn" |
|
|
|
type="warning" |
|
|
|
type="warning" |
|
|
|
@click="importModel" |
|
|
|
@click="importModel" |
|
|
@ -63,10 +64,12 @@ |
|
|
|
<el-tree |
|
|
|
<el-tree |
|
|
|
:data="modelData" |
|
|
|
:data="modelData" |
|
|
|
ref="tree" |
|
|
|
ref="tree" |
|
|
|
|
|
|
|
default-expand-all |
|
|
|
@check-change="treeCheckChange" |
|
|
|
@check-change="treeCheckChange" |
|
|
|
show-checkbox |
|
|
|
show-checkbox |
|
|
|
:check-strictly="true" |
|
|
|
:check-strictly="true" |
|
|
|
node-key="id"> |
|
|
|
node-key="id" |
|
|
|
|
|
|
|
: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="typeVisible = false">取消</el-button> |
|
|
@ -124,7 +127,7 @@ import util from '@/util' |
|
|
|
import config from '@/config' |
|
|
|
import config from '@/config' |
|
|
|
const CANCEL_TOKEN = axios.CancelToken // 用于input中中断请求 |
|
|
|
const CANCEL_TOKEN = axios.CancelToken // 用于input中中断请求 |
|
|
|
export default { |
|
|
|
export default { |
|
|
|
props: ['judgmentId', 'code', 'codeId', 'projectId', 'retResult'], |
|
|
|
props: ['judgmentId', 'code', 'codeId', 'projectId', 'retResult', 'modelIsShow'], |
|
|
|
data() { |
|
|
|
data() { |
|
|
|
return { |
|
|
|
return { |
|
|
|
token: util.getCookie('admin-token'), |
|
|
|
token: util.getCookie('admin-token'), |
|
|
@ -172,57 +175,7 @@ export default { |
|
|
|
sourceCode: '', // 把input替换成exit函数后的代码 |
|
|
|
sourceCode: '', // 把input替换成exit函数后的代码 |
|
|
|
requestTimer: null, // 用于中断请求的定时器 |
|
|
|
requestTimer: null, // 用于中断请求的定时器 |
|
|
|
modelVisible: false, |
|
|
|
modelVisible: false, |
|
|
|
|
|
|
|
modelData: [] |
|
|
|
modelData: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 1, |
|
|
|
|
|
|
|
label: '品牌一', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 4, |
|
|
|
|
|
|
|
label: '华东区域', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 9, |
|
|
|
|
|
|
|
label: '上海' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 10, |
|
|
|
|
|
|
|
label: '昆山' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 2, |
|
|
|
|
|
|
|
label: '品牌二', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 5, |
|
|
|
|
|
|
|
label: '华东区域' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 6, |
|
|
|
|
|
|
|
label: '华南区域' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 3, |
|
|
|
|
|
|
|
label: '品牌三', |
|
|
|
|
|
|
|
children: [ |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 7, |
|
|
|
|
|
|
|
label: '华北区域' |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
id: 8, |
|
|
|
|
|
|
|
label: '华南区域' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
] |
|
|
|
|
|
|
|
}; |
|
|
|
}; |
|
|
|
}, |
|
|
|
}, |
|
|
|
components: { |
|
|
|
components: { |
|
|
@ -263,6 +216,37 @@ export default { |
|
|
|
// 导入模型 |
|
|
|
// 导入模型 |
|
|
|
importModel() { |
|
|
|
importModel() { |
|
|
|
this.modelVisible = true |
|
|
|
this.modelVisible = true |
|
|
|
|
|
|
|
// 查询源模型分类 |
|
|
|
|
|
|
|
this.$post(`${this.api.modelClassList}?systemId=${this.systemId}`).then(res => { |
|
|
|
|
|
|
|
const { data } = res |
|
|
|
|
|
|
|
const promises = [] |
|
|
|
|
|
|
|
const addType = list => { |
|
|
|
|
|
|
|
list.map(e => { |
|
|
|
|
|
|
|
// 用promise储存以添加完后更新数据 |
|
|
|
|
|
|
|
promises.push(new Promise((resolve,reject) => { |
|
|
|
|
|
|
|
this.$post(this.api.referenceDemoList, { |
|
|
|
|
|
|
|
pageNum: 1, |
|
|
|
|
|
|
|
pageSize: 10000, |
|
|
|
|
|
|
|
categoryId: e.id |
|
|
|
|
|
|
|
}).then(res => { |
|
|
|
|
|
|
|
const { records } = res.data |
|
|
|
|
|
|
|
records.map(n => { |
|
|
|
|
|
|
|
n.categoryName = n.modelName |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
e.children = [...e.children, ...records] |
|
|
|
|
|
|
|
resolve() |
|
|
|
|
|
|
|
}).catch(res => { |
|
|
|
|
|
|
|
reject() |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
})) |
|
|
|
|
|
|
|
e.children && e.children.length && addType(e.children) |
|
|
|
|
|
|
|
}) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
addType(data) |
|
|
|
|
|
|
|
Promise.all(promises).then(_ => { |
|
|
|
|
|
|
|
this.modelData = data |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 多选框选择回调 |
|
|
|
// 多选框选择回调 |
|
|
|
treeCheckChange(data, checked, indeterminate) { |
|
|
|
treeCheckChange(data, checked, indeterminate) { |
|
|
@ -275,9 +259,12 @@ export default { |
|
|
|
}, |
|
|
|
}, |
|
|
|
// 导入模型提交 |
|
|
|
// 导入模型提交 |
|
|
|
submit() { |
|
|
|
submit() { |
|
|
|
// this.$post(this.api.sourceModelClassification).then(res => { |
|
|
|
const id = this.$refs.tree.getCheckedKeys() |
|
|
|
|
|
|
|
if (!id.length) return this.$message.error('请选择模型!') |
|
|
|
// }).catch(res => {}) |
|
|
|
this.$post(`${this.api.referenceFindById}?id=${id[0]}`).then(res => { |
|
|
|
|
|
|
|
// this.codeVal = '' |
|
|
|
|
|
|
|
this.modelVisible = false |
|
|
|
|
|
|
|
}).catch(res => {}) |
|
|
|
}, |
|
|
|
}, |
|
|
|
/** |
|
|
|
/** |
|
|
|
* python代码里如果有input函数的话,是做了单独的处理的,原理是先把所有input函数都替换成exit函数,再在exit函数里加上特定标识,再通过接口传给后端去执行 |
|
|
|
* python代码里如果有input函数的话,是做了单独的处理的,原理是先把所有input函数都替换成exit函数,再在exit函数里加上特定标识,再通过接口传给后端去执行 |
|
|
|