| | |
| | | <a-form-item label="使用车间"> |
| | | <a-tree-select v-model="queryParam.orgId" |
| | | style="width: 100%" |
| | | :tree-data="treeData" |
| | | :tree-data="treeDataAlias" |
| | | :dropdown-style="{ maxHeight: '400px', overflow: 'auto' }" |
| | | placeholder="请选择使用车间" |
| | | allow-clear |
| | |
| | | <span slot="mdcFlag" slot-scope="text"> |
| | | <lx-switch v-model="text" disabled checked-children="是" un-checked-children="否"/> |
| | | </span> |
| | | <span slot="processParametersFlag" slot-scope="text"> |
| | | <!-- <span slot="processParametersFlag" slot-scope="text"> |
| | | <lx-switch v-model="text" disabled checked-children="有" un-checked-children="无"/> |
| | | </span> |
| | | <span slot="precisionParametersFlag" slot-scope="text"> |
| | | </span>--> |
| | | <!-- <span slot="precisionParametersFlag" slot-scope="text"> |
| | | <lx-switch v-model="text" disabled checked-children="有" un-checked-children="无"/> |
| | | </span> |
| | | <span slot="specialEquipment" slot-scope="text"> |
| | | </span>--> |
| | | <!-- <span slot="specialEquipment" slot-scope="text"> |
| | | <lx-switch v-model="text" disabled checked-children="是" un-checked-children="否"/> |
| | | </span> |
| | | </span>--> |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click.stop="handleEdit(record)">编辑</a> |
| | | |
| | |
| | | dataIndex: 'mdcFlag', |
| | | scopedSlots: { customRender: 'mdcFlag' } |
| | | }, |
| | | { |
| | | title: '有无工艺参数', |
| | | align: 'center', |
| | | width: 120, |
| | | dataIndex: 'processParametersFlag', |
| | | scopedSlots: { customRender: 'processParametersFlag' } |
| | | }, |
| | | { |
| | | title: '有无精度参数', |
| | | align: 'center', |
| | | width: 120, |
| | | dataIndex: 'precisionParametersFlag', |
| | | scopedSlots: { customRender: 'precisionParametersFlag' } |
| | | }, |
| | | { |
| | | title: '是否为特种设备', |
| | | align: 'center', |
| | | width: 120, |
| | | dataIndex: 'specialEquipment', |
| | | scopedSlots: { customRender: 'specialEquipment' } |
| | | }, |
| | | { |
| | | title: '重量', |
| | | align: 'center', |
| | | dataIndex: 'equipmentWeight' |
| | | }, |
| | | { |
| | | title: '设备端口', |
| | | align: 'center', |
| | | dataIndex: 'equipmentPort' |
| | | }, |
| | | { |
| | | title: '坐标数量', |
| | | align: 'center', |
| | | dataIndex: 'coordinateNum' |
| | | }, |
| | | // { |
| | | // title: '有无工艺参数', |
| | | // align: 'center', |
| | | // width: 120, |
| | | // dataIndex: 'processParametersFlag', |
| | | // scopedSlots: { customRender: 'processParametersFlag' } |
| | | // }, |
| | | // { |
| | | // title: '有无精度参数', |
| | | // align: 'center', |
| | | // width: 120, |
| | | // dataIndex: 'precisionParametersFlag', |
| | | // scopedSlots: { customRender: 'precisionParametersFlag' } |
| | | // }, |
| | | // { |
| | | // title: '是否为特种设备', |
| | | // align: 'center', |
| | | // width: 120, |
| | | // dataIndex: 'specialEquipment', |
| | | // scopedSlots: { customRender: 'specialEquipment' } |
| | | // }, |
| | | // { |
| | | // title: '重量', |
| | | // align: 'center', |
| | | // dataIndex: 'equipmentWeight' |
| | | // }, |
| | | // { |
| | | // title: '设备端口', |
| | | // align: 'center', |
| | | // dataIndex: 'equipmentPort' |
| | | // }, |
| | | // { |
| | | // title: '坐标数量', |
| | | // align: 'center', |
| | | // dataIndex: 'coordinateNum' |
| | | // }, |
| | | { |
| | | title: '创建人', |
| | | align: 'center', |
| | |
| | | printedRows: [], |
| | | activeTabKey: 1, |
| | | appHomeUrl: '', |
| | | currentTableRowRecord: {} |
| | | currentTableRowRecord: {}, |
| | | treeDataAlias: [], |
| | | } |
| | | }, |
| | | computed: { |
| | |
| | | getAction(this.url.loadProductionOptions).then(res => { |
| | | if (res.success) { |
| | | this.treeData = [...res.result] |
| | | this.treeDataAlias = this.deepCopyAndModify(res.result) |
| | | console.info('treeDataAlias====', this.treeDataAlias) |
| | | } else { |
| | | that.$message.warning(res.message) |
| | | } |
| | |
| | | this.appHomeUrl = res.result.settingValue |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | deepCopyAndModify(arr) { |
| | | // 如果当前元素不是数组或对象,直接返回 |
| | | if (!Array.isArray(arr) && typeof arr !== 'object' || arr === null || arr.length === 0) { |
| | | return arr; |
| | | } |
| | | |
| | | // 如果是数组,创建一个新数组并递归处理每个元素 |
| | | if (Array.isArray(arr)) { |
| | | const newArray = []; |
| | | for (let i = 0; i < arr.length; i++) { |
| | | newArray.push(this.deepCopyAndModify(arr[i])); |
| | | } |
| | | return newArray; |
| | | } |
| | | |
| | | // 如果是对象,创建一个新对象并递归处理每个属性 |
| | | const newObj = {}; |
| | | for (const key in arr) { |
| | | if (arr.hasOwnProperty(key)) { |
| | | if(key === 'selectable') { |
| | | newObj[key] = true; |
| | | } else if(key === 'children') { |
| | | newObj[key] = this.deepCopyAndModify(arr[key]); |
| | | }else { |
| | | newObj[key] = arr[key]; |
| | | } |
| | | |
| | | } |
| | | } |
| | | return newObj; |
| | | }, |
| | | } |
| | | } |
| | | </script> |