scada节点配置工序单元修改为下拉可输入

This commit is contained in:
wu
2022-08-20 17:02:26 +08:00
parent 6cdeaf1c31
commit 7926287dd8
2 changed files with 30 additions and 3 deletions

View File

@@ -41,12 +41,14 @@
<script>
import tips from './tips.md'
import jschardet from 'jschardet'
import { assign, each, pick, pickBy, startsWith, includes, every } from 'lodash'
import { assign, each, map, pick, pickBy, startsWith, includes, every } from 'lodash'
//import { getWorkingsubclassAll } from '@/api/basic/device'
export default {
data () {
return {
tips,
choosable: process.env.VUE_APP_CHOOSABLE,
columns: [
{
title: '序号',
@@ -176,7 +178,14 @@ export default {
}
},
working_subclass: {
title: '工序单元'
title: '工序单元',
component: {
name: 'el-select',
filterable: true,
allowCreate: true,
options: this.WorkingsubclassData,
span: 12
}
},
note: {
title: '备注'
@@ -225,6 +234,10 @@ export default {
},
// 普通的新增
addRow () {
this.$nextTick(() => {
this.$refs.d2Crud.handleFormTemplateMode('working_subclass').component.options = this.WorkingsubclassData
this.$refs.d2Crud.$forceUpdate()
})
this.$refs.d2Crud.showDialog({
mode: 'add'
})
@@ -313,9 +326,19 @@ export default {
type: 'warning'
})
done()
},
getWorkingsubclassAll () {
// getWorkingsubclassAll().then(res=>{
// this.WorkingsubclassData = map(res.data, (o) => {
// return { value: o.code, label: o.name }
// })
// })
}
},
mounted () {
if (this.choosable === 'true') {
this.getWorkingsubclassAll()
}
this.getNodes()
}
}