From ba77fdc6a30c9ad0941e40319f8c4f6fe6fdf9f1 Mon Sep 17 00:00:00 2001
From: cuilei <ray_tsu1@163.com>
Date: 星期四, 07 八月 2025 10:30:42 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
src/views/mdc/base/modules/EquipmentList/UserModal.vue | 510 +++++++++++++++++++++++++++++++-------------------------
1 files changed, 284 insertions(+), 226 deletions(-)
diff --git a/src/views/mdc/base/modules/EquipmentList/UserModal.vue b/src/views/mdc/base/modules/EquipmentList/UserModal.vue
index 802ba97..d22bb6d 100644
--- a/src/views/mdc/base/modules/EquipmentList/UserModal.vue
+++ b/src/views/mdc/base/modules/EquipmentList/UserModal.vue
@@ -19,18 +19,19 @@
</template>
<a-spin :spinning="confirmLoading">
- <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules">
+ <a-form-model ref="form" :form="form" :model="model" :rules="validatorRules" :labelCol="labelCol"
+ :wrapperCol="wrapperCol">
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item label="缁熶竴缂栫爜" :labelCol="labelCol" :wrapperCol="wrapperCol" prop="equipmentId">
- <a-input-search :readOnly="true"
- v-model="model.equipmentId"
- :disabled="disSearch" @search="deviceSearch" enter-button placeholder='璇烽�夋嫨缁熶竴缂栫爜' />
+ <a-form-model-item label="缁熶竴缂栫爜" prop="equipmentId">
+ <a-input-search v-model="model.equipmentId" readOnly :disabled="disableSubmit" @search="deviceSearch"
+ enter-button
+ placeholder='璇烽�夋嫨缁熶竴缂栫爜'/>
</a-form-model-item>
</a-col>
<a-col :span="12">
- <a-form-model-item label="璁惧鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input :disabled="disSearch" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�"
+ <a-form-model-item label="璁惧鍚嶇О">
+ <a-input allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�"
v-model="model.equipmentName"/>
</a-form-model-item>
</a-col>
@@ -38,12 +39,15 @@
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item v-if="isDepartType == 0" label="閮ㄩ棬鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!departDisabled">
- <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false" @back="backDepartInfo" :backDepart="true" :treeOpera="true"></j-select-equipment-depart>
+ <a-form-model-item v-if="isDepartType == 0" label="閮ㄩ棬鍒嗛厤"
+ v-show="!departDisabled">
+ <j-select-equipment-depart :disabled="disableSubmit" v-model="model.selectedDeparts" :multi="false"
+ @back="backDepartInfo" :backDepart="true"
+ :treeOpera="true"></j-select-equipment-depart>
</a-form-model-item>
- <a-form-model-item v-if="isDepartType == -1" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷"
+ <a-form-model-item v-if="isDepartType == -1" label="璁惧绫诲瀷">
+ <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷"
:triggerChange="true"
v-model="model.equipmentType">
<a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
@@ -53,33 +57,36 @@
</a-form-model-item>
</a-col>
<a-col :span="12">
- <a-form-model-item label="杞﹂棿鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled" ref="selectedProduction" prop="selectedProduction">
+ <a-form-model-item label="杞﹂棿鍒嗛厤" v-show="!factoryDisabled"
+ ref="selectedFactory" prop="selectedFactory">
<!--<j-select-equipment-production v-decorator="['selectedProduction',{rules:[{required:true,message:'璇烽�夋嫨杞﹂棿!'}]}]" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>-->
- <j-select-equipment-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false" @back="backProductionInfo" :backProduction="true" :treeProductOpera="true"></j-select-equipment-production>
+ <j-select-equipment-factory :disabled="disableSubmit" v-model="model.selectedFactory" :multi="false"
+ @back="backFactoryInfo" :backFactory="true"
+ :treeProductOpera="true"></j-select-equipment-factory>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item v-if="isDepartType == -1" label="绯荤粺鐗堟湰鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ郴缁熺増鏈彿"
+ <a-form-model-item v-if="isDepartType == -1" label="绯荤粺鐗堟湰鍙�">
+ <a-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ郴缁熺増鏈彿"
v-model="model.systemVersion"/>
</a-form-model-item>
- <a-form-model-item v-if="isDepartType == 0" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷"
- :triggerChange="true"
- v-model="model.equipmentType">
- <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
- {{item.equipmentTypeName}}
- </a-select-option>
- </a-select>
+ <a-form-model-item v-if="isDepartType == 0" label="璁惧绫诲瀷">
+ <a-select :disabled="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷"
+ :triggerChange="true"
+ v-model="model.equipmentType">
+ <a-select-option v-for='item in selectList' :key='item.id' :value='item.equipmentTypeName'>
+ {{item.equipmentTypeName}}
+ </a-select-option>
+ </a-select>
</a-form-model-item>
</a-col>
<a-col :span="12">
- <a-form-model-item label="璁惧鍔熺巼(kw)" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧姛鐜�"
+ <a-form-model-item label="璁惧鍔熺巼(kw)">
+ <a-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧姛鐜�"
v-model="model.devicePower"/>
</a-form-model-item>
</a-col>
@@ -87,14 +94,14 @@
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item label="鏈哄簥IP" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input :disabled="true" :readOnly="disableSubmit" placeholder="璇疯緭鍏ユ満搴奍P"
+ <a-form-model-item label="鏈哄簥IP">
+ <a-input :disabled="true" placeholder="璇疯緭鍏ユ満搴奍P"
v-model="model.equipmentIp"/>
</a-form-model-item>
</a-col>
<a-col :span="12">
- <a-form-model-item label="鏈哄簥绔彛" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input :disabled="true" :readOnly="disableSubmit" placeholder="璇疯緭鍏ユ満搴婄鍙�"
+ <a-form-model-item label="鏈哄簥绔彛">
+ <a-input :disabled="true" placeholder="璇疯緭鍏ユ満搴婄鍙�"
v-model="model.dataPort"/>
</a-form-model-item>
</a-col>
@@ -102,50 +109,57 @@
<a-row :gutter="24">
<a-col :span="12">
- <a-form-model-item label="椹卞姩绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <j-dict-select-tag :disabled="true" :readOnly="disableSubmit" placeholder="璇烽�夋嫨椹卞姩绫诲瀷"
+ <a-form-model-item label="椹卞姩绫诲瀷">
+ <j-dict-select-tag :disabled="true" placeholder="璇烽�夋嫨椹卞姩绫诲瀷"
:triggerChange="true" dictCode="mdc_driveType"
v-model="model.driveType" allow-clear/>
</a-form-model-item>
</a-col>
<a-col :span="12">
- <a-form-model-item label="璁惧鍨嬪彿" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <a-input :disabled="true" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�"
+ <a-form-model-item label="璁惧鍨嬪彿">
+ <a-input :disabled="true" allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�"
v-model="model.equipmentModel"/>
</a-form-model-item>
</a-col>
</a-row>
<a-row :gutter="24">
+<!-- <a-col :span="12">-->
+<!-- <a-form-model-item label="绯荤粺绫诲瀷">-->
+<!-- <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type"-->
+<!-- :disabled="true"-->
+<!-- v-model="model.systemType" allow-clear/>-->
+<!-- </a-form-model-item>-->
+<!-- </a-col>-->
<a-col :span="12">
- <a-form-model-item label="绯荤粺绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type" v-model="model.systemType" allow-clear/>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="璁惧绾у埆" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="model.deviceLevel" allow-clear/>
- </a-form-model-item>
- </a-col>
- </a-row>
-
- <a-row :gutter="24">
- <a-col :span="12">
- <a-form-model-item label="璁惧绉嶇被" :labelCol="labelCol" :wrapperCol="wrapperCol">
- <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="model.deviceCategory" allow-clear/>
- </a-form-model-item>
- </a-col>
- <a-col :span="12">
- <a-form-model-item label="鎺掑簭" :labelCol="labelCol" :wrapperCol="wrapperCol">
+ <a-form-model-item label="鎺掑簭">
<a-input :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇疯緭鍏ユ帓搴�"
v-model="model.sortNo" style="width: 100%"/>
</a-form-model-item>
</a-col>
</a-row>
+<!-- <a-row :gutter="24">-->
+<!-- <a-col :span='12' v-if="systemType">-->
+<!-- <a-form-model-item label="绯荤粺绫诲瀷">-->
+<!-- <a-radio-group name="radioGroup" v-model="systemValue" :disabled="disableSubmit">-->
+<!-- <a-radio value="1">DNC</a-radio>-->
+<!-- <a-radio value="2">MDC</a-radio>-->
+<!-- <a-radio value="3">閫氱敤</a-radio>-->
+<!-- </a-radio-group>-->
+<!-- </a-form-model-item>-->
+<!-- </a-col>-->
+<!-- <a-col :span='12'>-->
+<!-- <a-form-model-item label="瀹夎浣嶇疆">-->
+<!-- <a-input v-model="model.equipmentAddress" allow-clear placeholder="璇疯緭鍏ュ畨瑁呬綅缃�" :disabled="disableSubmit"/>-->
+<!-- </a-form-model-item>-->
+<!-- </a-col>-->
+<!-- </a-row>-->
+
+
<a-row :gutter="24">
<a-col :span='12'>
- <a-form-model-item v-if="isDepartType == 0" label="绯荤粺鐗堟湰鍙�" :labelCol="labelCol" :wrapperCol="wrapperCol">
+ <a-form-model-item v-if="isDepartType == 0" label="绯荤粺鐗堟湰鍙�">
<a-input :disabled="disableSubmit" :readOnly="disableSubmit" allow-clear placeholder="璇疯緭鍏ョ郴缁熺増鏈彿"
v-model="model.systemVersion"/>
</a-form-model-item>
@@ -154,7 +168,7 @@
<a-row :gutter="24">
<a-col :span="24">
- <a-form-model-item :labelCol="{span:3}" :wrapperCol="{span:21}" label="澶囨敞">
+ <a-form-model-item :labelCol="labelColLong" :wrapperCol="wrapperColLong" label="澶囨敞">
<a-textarea :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇疯緭鍏ュ娉�"
v-model="model.remark"/>
</a-form-model-item>
@@ -179,116 +193,129 @@
import pick from 'lodash.pick'
import moment from 'moment'
import Vue from 'vue'
- import { ACCESS_TOKEN } from "@/store/mutation-types"
+ import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getAction } from '@/api/manage'
- import { addEquipment,editEquipment} from '@/api/api'
- import { disabledAuthFilter } from "@/utils/authFilter"
+ import { addEquipment, editEquipment } from '@/api/api'
+ import { disabledAuthFilter } from '@/utils/authFilter'
import { duplicateCheck } from '@/api/api'
- import JSelectEquipmentProduction from '../../../../../components/jeecgbiz/JSelectEquipmentProduction'
- import JSelectProduction from '../../../../../components/jeecgbiz/JSelectProduction'
+ import JSelectEquipmentFactory from '../../../../../components/jeecgbiz/JSelectEquipmentFactory'
+ import JSelectFactory from '../../../../../components/jeecgbiz/JSelectFactory'
import DeviceListModel from './DeviceListModal'
import JSelectEquipmentDepart from '../../../../../components/jeecgbiz/JSelectEquipmentDepart'
- import {mapActions} from 'vuex'
+ import { mapActions } from 'vuex'
+
export default {
- name: "UserModal",
+ name: 'UserModal',
components: {
- JSelectProduction,
+ JSelectFactory,
JSelectEquipmentDepart,
- JSelectEquipmentProduction,
+ JSelectEquipmentFactory,
DeviceListModel
},
- data () {
+ data() {
return {
- disSearch:false,
departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰
- productionDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰
+ factoryDisabled: false, //鏄惁鏄垜鐨勮溅闂磋皟鐢ㄨ椤甸潰
roleDisabled: false, //鏄惁鏄鑹茬淮鎶よ皟鐢ㄨ椤甸潰
- modalWidth:800,
- drawerWidth:700,
- modalToggleFlag:true,
+ modalWidth: 800,
+ drawerWidth: 700,
+ modalToggleFlag: true,
confirmDirty: false,
- userId:"", //淇濆瓨鐢ㄦ埛id
+ userId: '', //淇濆瓨鐢ㄦ埛id
// disableSubmit:false,
disableSubmit: true,
- dateFormat:"YYYY-MM-DD",
+ dateFormat: 'YYYY-MM-DD',
form: this.$form.createForm(this),
- validatorRules:{
+ validatorRules: {
// equipmentId: [{required: false, message: '璇烽�夋嫨璁惧缂栧彿!'}, {validator: this.validatequipmentId}],
equipmentId:
[
{
- required: true, message: '璇烽�夋嫨璁惧缂栧彿!'
- },
+ required: true, message: '璇烽�夋嫨璁惧缂栧彿锛�', trigger: 'change'
+ }
// {
// validator: this.validatequipmentId
// }
],
- // trigger: 'blur' // 瑙﹀彂鏂瑰紡
+ // trigger: 'blur' // 瑙﹀彂鏂瑰紡
- selectedProduction:
+ selectedFactory:
[
{
- required:true,message: '璇烽�夋嫨杞﹂棿'
+ required: true, message: '璇烽�夋嫨杞﹂棿锛�'
}
]
},
- departIdShow:false,
- title:"鎿嶄綔",
+ departIdShow: false,
+ title: '鎿嶄綔',
visible: false,
model: {
- equipmentId: "",
- equipmentName: "",
- equipmentModel: "",
- equipmentIp: "",
- dataPort: "",
- driveType: "",
- systemType: "",
- deviceLevel: "",
- deviceCategory: ""
+ equipmentId: '',
+ equipmentName: '',
+ equipmentModel: '',
+ equipmentIp: '',
+ dataPort: '',
+ driveType: '',
+ systemType: '',
+ deviceLevel: '',
+ deviceCategory: '',
+ deviceTypeDnc: '',
+ deviceTypeMdc: ''
},
labelCol: {
xs: { span: 24 },
- sm: { span: 8 },
+ sm: { span: 8 }
},
wrapperCol: {
xs: { span: 24 },
- sm: { span: 15 },
+ sm: { span: 14 }
},
- uploadLoading:false,
+ labelColLong: {
+ xs: { span: 24 },
+ sm: { span: 4 }
+ },
+ wrapperColLong: {
+ xs: { span: 24 },
+ sm: { span: 19 }
+ },
+ uploadLoading: false,
confirmLoading: false,
- headers:{},
+ headers: {},
+ systemType: false,
+ systemValue: '3',
url: {
- fileUpload: window._CONFIG['domianURL']+"/sys/common/upload",
- userWithDepart: "/mdc/mdcEquipment/equipmentDepartList", // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url
+ fileUpload: window._CONFIG['domianURL'] + '/sys/common/upload',
+ userWithDepart: '/mdc/mdcEquipment/equipmentDepartList', // 寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬮儴闂ㄤ俊鎭渶瑕佺殑url
//寮曞叆涓烘寚瀹氱敤鎴锋煡鐪嬭溅闂翠俊鎭渶瑕佺殑url
- userProductionList: '/mdc/mdcEquipment/equipmentProductionList',
- userId:"/sys/user/generateUserId", // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url
- syncUserByUserName:"/act/process/extActProcess/doSyncUserByUserName",//鍚屾鐢ㄦ埛鍒板伐浣滄祦
+ equipmentFactoryList: '/mdc/mdcEquipment/equipmentFactoryList',
+ userId: '/sys/user/generateUserId', // 寮曞叆鐢熸垚娣诲姞鐢ㄦ埛鎯呭喌涓嬬殑url
+ syncUserByUserName: '/act/process/extActProcess/doSyncUserByUserName',//鍚屾鐢ㄦ埛鍒板伐浣滄祦
queryTenantList: '/sys/tenant/queryList',
- check:'/sys/duplicate/check',
- queryEquipmentType:'/mdc/mdcEquipmentType/queryEquipmentType'
+ check: '/sys/duplicate/check',
+ queryEquipmentType: '/mdc/mdcEquipmentType/queryEquipmentType'
},
tenantsOptions: [],
- rolesOptions:[],
- nextDepartOptions:[],
- nextProductionOptions:[],
- selectList:[],
- isDepartType:''
+ rolesOptions: [],
+ nextDepartOptions: [],
+ nextProductionOptions: [],
+ selectList: [],
+ isDepartType: ''
}
},
- created () {
- const token = Vue.ls.get(ACCESS_TOKEN);
- this.headers = {"X-Access-Token":token}
+ created() {
+ const token = Vue.ls.get(ACCESS_TOKEN)
+ this.headers = { 'X-Access-Token': token }
this.queryGroup()
this.queryTreeData()
+ // this.getAppPlatformName()
// this.initRoleList()
// this.initTenantList()
},
- computed:{
- uploadAction:function () {
- return this.url.fileUpload;
+ computed: {
+ uploadAction: function() {
+ return this.url.fileUpload
}
},
methods: {
@@ -300,13 +327,20 @@
} else {
// this.$message.warn(res.message)
this.$notification.warning({
- message:'娑堟伅',
- description:res.message
- });
+ message: '娑堟伅',
+ description: res.message
+ })
}
- }).finally(() =>{
+ }).finally(() => {
})
},
+ // getAppPlatformName() {
+ // getAction(`/system/sysParams/query/by/settingKey?settingKey=system_type`).then(res => {
+ // if (res.success) {
+ // this.systemType = res.result.settingValue === '0'
+ // }
+ // })
+ // },
queryGroup() {
getAction(this.url.queryEquipmentType).then(res => {
if (res.success) {
@@ -317,9 +351,9 @@
} else {
// this.$message.warning(res.message)
this.$notification.warning({
- message:'娑堟伅',
- description:res.message
- });
+ message: '娑堟伅',
+ description: res.message
+ })
}
}).finally(() => {
this.loading = false
@@ -327,15 +361,16 @@
},
getDeviceRows(val) {
console.log(val)
- if(val.equipmentid ){
+ if (val.equipmentid) {
this.model.equipmentId = val.equipmentid
this.model.equipmentName = val.equipmentname
- this.model.equipmentModel = val.equipmentmodel
- this.model.equipmentIp = val.equipmentip
- this.model.dataPort = val.dataport
- this.model.driveType = val.drivetype
- this.model.controlSystem = val.controlsystem
- this.model.saveTableName = val.savetablename
+ this.model.equipmentModel = val.equipmentmodel
+ this.model.equipmentIp = val.equipmentip
+ this.model.dataPort = val.dataport
+ this.model.driveType = val.drivetype
+ this.model.controlSystem = val.controlsystem
+ this.model.saveTableName = val.savetablename
+ this.model.systemType = val.controlsystem
}
},
@@ -344,63 +379,79 @@
this.$refs.deviceListModel.title = '閫夋嫨璁惧'
this.$refs.deviceListModel.disableSubmit = false
},
- add () {
- this.refresh();
- this.edit({activitiSync:'1',userIdentity:1,equipmentId:"",equipmentName:"",equipmentModel:"",equipmentIp:'',dataPort:"",driveType:"",controlSystem:"",saveTableName:""});
+ add() {
+ this.refresh()
+ this.edit({
+ activitiSync: '1',
+ userIdentity: 1,
+ equipmentId: '',
+ equipmentName: '',
+ equipmentModel: '',
+ equipmentIp: '',
+ dataPort: '',
+ driveType: '',
+ controlSystem: '',
+ saveTableName: ''
+ })
},
- edit (record) {
- let that = this;
- that.visible = true;
+ edit(record) {
+ let that = this
+ that.visible = true
//鏍规嵁灞忓箷瀹藉害鑷�傚簲鎶藉眽瀹藉害
- this.resetScreenSize();
+ this.resetScreenSize()
// that.userId = record.id;
// console.log(record)
- that.model = Object.assign({}, record);
+ if (record.systemValue != null) {
+ this.systemValue = record.systemValue
+ } else {
+ this.systemValue = '3'
+ }
+ that.model = Object.assign({}, record)
// that.model = Object.assign({},{selectedroles:'',selectedProduction:''}, record);
// this.model = Object.assign({}, record)
this.$nextTick(() => {
- this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedProduction', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
- 'driveType', 'sortNo', 'remark','systemVersion','devicePower','controlSystem','saveTableName'))
+ this.form.setFieldsValue(pick(that.model, 'selectedDeparts', 'selectedFactory', 'equipmentId', 'equipmentName', 'equipmentModel', 'equipmentType', 'equipmentIp', 'dataPort',
+ 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue', 'equipmentAddress'))
})
- if(record.hasOwnProperty("id")){
+ if (record.hasOwnProperty('id')) {
// that.getUserRoles(record.id);
- that.getUserDeparts(record.id);
+ that.getUserDeparts(record.id)
}
// console.log('that.model=',that.model)
},
- isDisabledAuth(code){
- return disabledAuthFilter(code);
+ isDisabledAuth(code) {
+ return disabledAuthFilter(code)
},
//绐楀彛鏈�澶у寲鍒囨崲
- toggleScreen(){
- if(this.modalToggleFlag){
- this.modalWidth = window.innerWidth;
- }else{
- this.modalWidth = 800;
+ toggleScreen() {
+ if (this.modalToggleFlag) {
+ this.modalWidth = window.innerWidth
+ } else {
+ this.modalWidth = 800
}
- this.modalToggleFlag = !this.modalToggleFlag;
+ this.modalToggleFlag = !this.modalToggleFlag
},
// 鏍规嵁灞忓箷鍙樺寲,璁剧疆鎶藉眽灏哄
- resetScreenSize(){
- let screenWidth = document.body.clientWidth;
- if(screenWidth < 500){
- this.drawerWidth = screenWidth;
- }else{
- this.drawerWidth = 700;
+ resetScreenSize() {
+ let screenWidth = document.body.clientWidth
+ if (screenWidth < 500) {
+ this.drawerWidth = screenWidth
+ } else {
+ this.drawerWidth = 800
}
},
- getUserDeparts(userid){
- let that = this;
+ getUserDeparts(userid) {
+ let that = this
//閮ㄩ棬鐨剈rl
- getAction(that.url.userWithDepart,{equipmentId:userid}).then((res)=>{
- if(res.success){
+ getAction(that.url.userWithDepart, { equipmentId: userid }).then((res) => {
+ if (res.success) {
// console.log(res.result)
- let departOptions=[];
- let selectDepartKeys=[]
+ let departOptions = []
+ let selectDepartKeys = []
for (let i = 0; i < res.result.length; i++) {
- selectDepartKeys.push(res.result[i].key);
+ selectDepartKeys.push(res.result[i].key)
//鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗�
departOptions.push({
value: res.result[i].key,
@@ -408,32 +459,32 @@
})
}
- that.model.selectedDeparts = selectDepartKeys.join(",")
+ that.model.selectedDeparts = selectDepartKeys.join(',')
// that.model.selectedProduction = selectDepartKeys.join(",")
- that.nextDepartOptions=departOptions;
+ that.nextDepartOptions = departOptions
// console.log('that.nextDepartOptions=',that.nextDepartOptions)
}
})
- getAction(that.url.userProductionList,{equipmentId:userid}).then((res)=>{
- if(res.success){
+ getAction(that.url.equipmentFactoryList, { equipmentId: userid }).then((res) => {
+ if (res.success) {
// console.log(res.result)
- let ProductionOptions=[];
- let selectProductKeys=[]
+ let factoryOptions = []
+ let selectProductKeys = []
// console.log(res.result)
for (let i = 0; i < res.result.length; i++) {
- selectProductKeys.push(res.result[i].key);
+ selectProductKeys.push(res.result[i].key)
//鏂板璐熻矗閮ㄩ棬閫夋嫨涓嬫媺妗�
- ProductionOptions.push({
+ factoryOptions.push({
value: res.result[i].key,
label: res.result[i].title
})
}
- that.model.selectedProduction = selectProductKeys.join(",")
+ that.model.selectedFactory = selectProductKeys.join(',')
- that.nextProductionOptions=ProductionOptions;
+ that.nextProductionOptions = factoryOptions
// console.log('that.nextProductionOptions=',that.nextProductionOptions)
}
})
@@ -441,106 +492,113 @@
},
backDepartInfo(info) {
// console.log(info)
- this.model.departIds = this.model.selectedDeparts;
- this.nextDepartOptions = info.map((item,index,arr)=>{
- let c = {label:item.text, value: item.value+""}
- return c;
+ this.model.departIds = this.model.selectedDeparts
+ this.nextDepartOptions = info.map((item, index, arr) => {
+ let c = { label: item.text, value: item.value + '' }
+ return c
})
},
- backProductionInfo(info) {
+ backFactoryInfo(info) {
// console.log(info)
- this.model.productionIds = this.model.selectedProduction;
- this.nextProductionOptions = info.map((item,index,arr)=>{
- let c = {label:item.text, value: item.value+""}
- return c;
+ this.model.productionIds = this.model.selectedFactory
+ this.nextProductionOptions = info.map((item, index, arr) => {
+ let c = { label: item.text, value: item.value + '' }
+ return c
})
},
- refresh () {
- this.userId=""
- this.nextDepartOptions=[];
- this.nextProductionOptions = [];
- this.departIdShow=false;
- },
- close () {
- this.$emit('close');
- this.visible = false;
- this.disableSubmit = false;
- this.nextDepartOptions=[];
+ refresh() {
+ this.userId = ''
+ this.nextDepartOptions = []
this.nextProductionOptions = []
- this.departIdShow=false;
+ this.departIdShow = false
+ },
+ close() {
+ this.$emit('close')
+ this.visible = false
+ this.disableSubmit = false
+ this.nextDepartOptions = []
+ this.nextProductionOptions = []
+ this.departIdShow = false
// this.$refs.form.resetFields();
},
moment,
- handleSubmit () {
- const that = this;
+ handleSubmit() {
+ const that = this
// 瑙﹀彂琛ㄥ崟楠岃瘉
this.$refs.form.validate(valid => {
if (valid) {
- that.confirmLoading = true;
+ that.confirmLoading = true
//濡傛灉鏄笂绾ф嫨浼犲叆departIds,鍚﹀垯涓虹┖
// if(this.model.userIdentity!==2){
// this.model.departIds="";
// }
- let obj;
- if(!this.model.id){
- this.model.id = this.userId;
- obj=addEquipment(this.model);
- }else{
- obj=editEquipment(this.model,{
- id: this.model.id
- });
+ if (this.systemValue == null) {
+ this.$message.warning('璇烽�夋嫨绯荤粺绫诲瀷!')
+ return false
}
- obj.then((res)=>{
- if(res.success){
+ let obj
+ if (!this.model.id) {
+ this.model.id = this.userId
+ this.model.systemValue = this.systemValue
+ obj = addEquipment(this.model)
+ } else {
+ this.model.systemValue = this.systemValue
+ obj = editEquipment(this.model, {
+ id: this.model.id
+ })
+ }
+ obj.then((res) => {
+ if (res.success) {
that.$notification.success({
- message:'娑堟伅',
- description:res.message
- });
- that.$emit('ok');
- }else{
+ message: '娑堟伅',
+ description: res.message
+ })
+ that.$emit('ok')
+ } else {
that.$notification.warning({
- message:'娑堟伅',
- description:res.message
- });
+ message: '娑堟伅',
+ description: res.message
+ })
}
}).finally(() => {
- that.confirmLoading = false;
- that.close();
+ that.confirmLoading = false
+ that.close()
})
- }else{
- return false;
+ } else {
+ return false
}
})
},
handleConfirmBlur(e) {
- const value = e.target.value;
+ const value = e.target.value
this.confirmDirty = this.confirmDirty || !!value
},
- identityChange(e){
- if(e.target.value===1){
- this.departIdShow=false;
- }else{
- this.departIdShow=true;
+ identityChange(e) {
+ if (e.target.value === 1) {
+ this.departIdShow = false
+ } else {
+ this.departIdShow = true
}
},
/**
* 缂栬緫鎴栨煡鐪嬭鎯呮暟鎹椂娓呴櫎鎶藉眽琛ㄥ崟楠岃瘉
*/
- removeValidate(){
+ removeValidate() {
this.$refs.form.clearValidate()
}
- },
+ }
}
</script>
<style scoped>
.avatar-uploader > .ant-upload {
- width:104px;
- height:104px;
+ width: 104px;
+ height: 104px;
}
+
.ant-upload-select-picture-card i {
font-size: 49px;
color: #999;
@@ -551,9 +609,9 @@
color: #666;
}
- .ant-table-tbody .ant-table-row td{
- padding-top:10px;
- padding-bottom:10px;
+ .ant-table-tbody .ant-table-row td {
+ padding-top: 10px;
+ padding-bottom: 10px;
}
.drawer-bottom-button {
--
Gitblit v1.9.3