From 08e52db54ce1e7563f1efe402a3f6c3931188013 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期五, 14 二月 2025 10:47:53 +0800 Subject: [PATCH] 产品结构树: 1、实现文档批量删除功能 2、实现文档列表的排序以及筛选功能 设备结构树: 1、新增权限配置弹窗,提交后由后端测试 --- src/views/dnc/base/modules/DeviceStructure/Permission/UserPermissionTransfer.vue | 110 +++++ src/views/dnc/common/DocumentBatchDeleteModal.vue | 242 ++++++++++ src/views/dnc/base/modules/DeviceStructure/Permission/AssignPermissionModal.vue | 100 ++++ src/views/dnc/common/TableContextMenu.vue | 8 src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue | 65 ++ src/mixins/JeecgListMixin.js | 5 src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue | 6 src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue | 63 ++ src/api/dnc.js | 14 src/views/mdc/base/modules/EquipmentList/UserModal.vue | 451 ++++++++++--------- src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue | 137 ++++- src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue | 12 src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue | 53 -- src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue | 6 14 files changed, 947 insertions(+), 325 deletions(-) diff --git a/src/api/dnc.js b/src/api/dnc.js index e25ffbd..58366f3 100644 --- a/src/api/dnc.js +++ b/src/api/dnc.js @@ -69,12 +69,22 @@ assignPermissionToUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { return postAction(`/nc/product/assign/add/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) }, - // 绉婚櫎閮ㄩ棬鏉冮檺 + // 绉婚櫎鐢ㄦ埛鏉冮檺 removePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { return postAction(`/nc/product/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) }, //-------------------------璁惧缁撴瀯鏍�------------------------------------------------ // 鍒犻櫎鏂囨。 - deleteDeviceRelativeDocumentApi: ({ docId, attributionId }) => deleteAction(`doc/relative/delete/device/${docId}/${attributionId}`) + deleteDeviceRelativeDocumentApi: ({ docId, attributionId }) => deleteAction(`doc/relative/delete/device/${docId}/${attributionId}`), + // 鑾峰彇鏈夋潈闄愮殑鐢ㄦ埛鍒楄〃 + getDeviceTreeHasPermissionUserApi: ({ type, key }) => getAction(`/nc/device/get/perm/user/${type}/${key}`), + // 鍒嗛厤鐢ㄦ埗鏉冮檺 + assignDeviceDeviceTreePermissionToUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { + return postAction(`/nc/device/assign/add/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) + }, + // 绉婚櫎鐢ㄦ埛鏉冮檺 + removeDeviceTreePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { + return postAction(`/nc/device/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) + }, } \ No newline at end of file diff --git a/src/mixins/JeecgListMixin.js b/src/mixins/JeecgListMixin.js index 16d8a8c..161c3a6 100644 --- a/src/mixins/JeecgListMixin.js +++ b/src/mixins/JeecgListMixin.js @@ -33,6 +33,10 @@ column: 'createTime', order: 'desc', }, + defaultSorter:{ + column: 'createTime', + order: 'desc', + }, /* 绛涢�夊弬鏁� */ filters: {}, /* table鍔犺浇鐘舵�� */ @@ -84,7 +88,6 @@ this.ipagination.current = 1; } var params = this.getQueryParams();//鏌ヨ鏉′欢 - console.log('params',params) if(!params){ return false; } diff --git a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue index f2bb570..1b86a5b 100644 --- a/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue +++ b/src/views/dnc/base/modules/DeviceStructure/DeviceStructureTree.vue @@ -34,6 +34,9 @@ </div> </div> </a-spin> + + <!--鏉冮檺閰嶇疆寮圭獥--> + <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="getTreeDataByApi"/> </a-card> </template> @@ -41,10 +44,12 @@ import { mapActions } from 'vuex' import { deleteAction } from '@/api/manage' import DeviceStructureTreeContextMenu from './DeviceStructureTreeContextMenu' + import AssignPermissionModal from './Permission/AssignPermissionModal' export default { name: 'DeviceStructureTree', components: { + AssignPermissionModal, DeviceStructureTreeContextMenu }, data() { @@ -124,54 +129,6 @@ // 鑻ュ彸閿椂褰撳墠鍙充晶灞曠ず灞傜骇涓鸿澶囧眰绾т笖褰撳墠鍙抽敭鏍戝眰绾у悓涓鸿澶囧眰绾ф椂鍒欏湪瑙﹀彂鍙抽敭鑿滃崟鍔熻兘鏃跺悓鏃惰Е鍙戝乏閿�変腑鍔熻兘 if (this.currentSelected.type === 2 && record.type === 2) this.handleTreeSelect([record.key], { node }) this.rightClickSelected = Object.assign({}, record) - }, - - // 鏍戣妭鐐瑰彸閿崟鍑昏彍鍗曚腑鍒犻櫎鎸夐挳鏃惰Е鍙� - handleDelete() { - const that = this - that.$confirm({ - title: '鎻愮ず', - content: '纭鍒犻櫎姝ゆ潯璁板綍鍚楋紵', - okText: '纭', - okType: 'danger', - cancelText: '鍙栨秷', - onOk: () => { - if (!this.url.delete) { - this.$message.error('璇疯缃畊rl.delete灞炴��!') - return - } - deleteAction(that.url.delete, { id: this.rightClickSelected.id }) - .then((res) => { - if (res.success) { - that.getTreeDataByApi() - that.$notification.success({ - message: '娑堟伅', - description: res.message - }) - } else { - that.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - .finally(() => { - that.$destroyAll() - }) - }, - onCancel: () => { - that.$destroyAll() - } - }) - }, - - /** - * 鑷姩灞曞紑娣诲姞涓嬬骇鑺傜偣鐨勭埗鑺傜偣 - */ - modalFormSubmitSuccess(isAddNextLevel) { - // 鍒ゆ柇鏄惁涓烘坊鍔犱笅绾у苟涓斿垽鏂埗鑺傜偣鏄惁灞曞紑 - if (isAddNextLevel && !this.expandedKeys.includes(this.rightClickSelected.id)) this.expandedKeys.push(this.rightClickSelected.id) - this.getTreeDataByApi() }, /** diff --git a/src/views/dnc/base/modules/DeviceStructure/Permission/AssignPermissionModal.vue b/src/views/dnc/base/modules/DeviceStructure/Permission/AssignPermissionModal.vue new file mode 100644 index 0000000..69b115e --- /dev/null +++ b/src/views/dnc/base/modules/DeviceStructure/Permission/AssignPermissionModal.vue @@ -0,0 +1,100 @@ +<template> + <a-modal :visible="visible" :title="title" width="50%" :maskClosable="false" @cancel="handleModalClose" + :footer="null"> + <a-form-model layout="inline"> + <a-form-item label="鍚嶇О"> + <a-input readOnly :value="currentTreeNodeInfo.title"></a-input> + </a-form-item> + <a-form-item label="鏄惁鍚屾椂閰嶇疆瀛愯妭鐐�" v-if="currentTreeNodeInfo.type!==2"> + <a-switch v-model="isAssignSonNode"></a-switch> + </a-form-item> + </a-form-model> + + <a-tabs v-model="activeTabKey"> + <a-tab-pane :key="1" tab="鍒嗛厤鐢ㄦ埛"> + <UserPermissionTransfer ref="userPermissionTransferRef" :currentTreeNodeInfo="currentTreeNodeInfo" + :dataSource="allUsersList" :isAssignSonNode="isAssignSonNode"/> + </a-tab-pane> + </a-tabs> + </a-modal> +</template> + +<script> + import dncApi from '@/api/dnc' + import UserPermissionTransfer from './UserPermissionTransfer' + import { queryProductionTreeList } from '@/api/api' + + export default { + name: 'AssignPermissionModal', + components: { UserPermissionTransfer }, + props: { + currentTreeNodeInfo: { + type: Object + } + }, + data() { + return { + visible: false, + title: '', + isAssignSonNode: true, + activeTabKey: 1, + allDepartmentsList: [], + allUsersList: [], + allTreeKeys: [], + hasLoadedDataTabKeyArray: [] + } + }, + watch: { + visible: { + handler(value) { + if (value) { + if (this.currentTreeNodeInfo.type === 1) this.isAssignSonNode = true + else this.isAssignSonNode = false + this.getAllUsersListByApi() + } + } + } + }, + created() { + this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) + }, + methods: { + // 鐐瑰嚮鏍戣妭鐐瑰彸閿彍鍗曟潈闄愰厤缃寜閽悗瑙﹀彂 + handleAssignPermission() { + this.visible = true + }, + + // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夌敤鎴峰垪琛� + getAllUsersListByApi() { + dncApi.getAllUsersListApi() + .then(res => { + if (res.success) { + this.allUsersList = res.result.records.map(item => { + return { + ...item, + disabled: item.username === 'admin' + } + }) + this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi()) + } + }) + }, + + // 鎺у埗寮圭獥鍏抽棴 + handleModalClose() { + this.visible = false + }, + + triggerCorrespondingMethod({ methodName, modalTitle }) { + if (this[methodName]) { + this[methodName]() + this.title = modalTitle + } + } + } + } +</script> + +<style scoped> + +</style> \ No newline at end of file diff --git a/src/views/dnc/base/modules/DeviceStructure/Permission/UserPermissionTransfer.vue b/src/views/dnc/base/modules/DeviceStructure/Permission/UserPermissionTransfer.vue new file mode 100644 index 0000000..3697384 --- /dev/null +++ b/src/views/dnc/base/modules/DeviceStructure/Permission/UserPermissionTransfer.vue @@ -0,0 +1,110 @@ +<template> + <a-spin :spinning="spinning"> + <a-transfer + class="transfer-container" + :data-source="dataSource" + show-search + :list-style="{flex:1,height: '500px'}" + :titles="['鏈垎閰嶇敤鎴�', '宸插垎閰嶇敤鎴�']" + :operations="['鍒嗛厤鐢ㄦ埛', '绉婚櫎鐢ㄦ埛']" + :target-keys="targetKeys" + :render="item => `${item.realname}`" + @change="handleChange" + :rowKey="record => record.id" + > + <span slot="notFoundContent">鏆傛棤鏁版嵁</span> + </a-transfer> + </a-spin> +</template> + +<script> + import dncApi from '@/api/dnc' + + export default { + name: 'UserPermissionTransfer', + components: {}, + props: { + currentTreeNodeInfo: { + type: Object + }, + dataSource: { + type: Array + }, + isAssignSonNode: { + type: Boolean + } + }, + data() { + return { + targetKeys: [], + spinning: false + } + }, + methods: { + // 鑾峰彇鏈夋潈闄愮殑鐢ㄦ埛鍒楄〃 + getHasPermissionUserByApi() { + const that = this + that.spinning = true + that.targetKeys = [] + dncApi.getDeviceTreeHasPermissionUserApi(this.currentTreeNodeInfo) + .then(res => { + if (res.success) this.targetKeys = res.list.map(item => item.id) + }) + .finally(() => { + that.spinning = false + }) + }, + + handleChange(targetKeys, direction, moveKeys) { + const { currentTreeNodeInfo: { type, key }, isAssignSonNode, $notification, dataSource } = this + const that = this + let method + const params = { + treeNodeType: type, + treeNodeId: key, + isAssignSonNode: isAssignSonNode ? 1 : 2, + userIdArray: moveKeys + } + console.log('params--------------------------', params) + console.log(targetKeys, direction, moveKeys) + if (direction === 'right') { + method = dncApi.assignPermissionToUser + } else { + method = dncApi.removePermissionFromUser + } + that.spinning = true + method(params) + .then(res => { + if (res.success) { + $notification.success({ + message: '娑堟伅', + description: res.message + }) + this.targetKeys = targetKeys + } else { + $notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .catch(err => { + $notification.error({ + message: '娑堟伅', + description: err.message + }) + }) + .finally(() => { + that.spinning = false + }) + } + } + } +</script> + +<style scoped lang="less"> + .transfer-container { + display: flex; + align-items: center; + } +</style> \ No newline at end of file diff --git a/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue b/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue index 492ec83..26a68a1 100644 --- a/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue +++ b/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue @@ -10,13 +10,14 @@ <a-row :gutter="24"> <a-col :md="7" :sm="7"> <a-form-item label="鏂囦欢鍚嶇О"> - <a-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="queryParam.docName"></a-input> + <a-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="queryParam.docName" allow-clear></a-input> </a-form-item> </a-col> <a-col :md="11" :sm="11"> <a-form-item label="涓婁紶鏃堕棿"> - <a-range-picker v-model="queryParam.collectTime"></a-range-picker> + <a-range-picker v-model="date" value-format="YYYY-MM-DD" + @change="handleDateChange" allow-clear></a-range-picker> </a-form-item> </a-col> @@ -30,6 +31,7 @@ <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :loading="loading" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + @change="handleTableChange" :scroll="{y:456}" :size="size" rowKey="docId"> </a-table> @@ -55,10 +57,10 @@ <a-tree blockNode checkable :checkedKeys="checkedKeys" :expandedKeys.sync="expandedKeys" :autoExpandParent="autoExpandParent" @select="handleTreeNodeSelect" :treeData="treeDataSource" @check="handleTreeNodeCheck" @expand="handleTreeNodeExpand"> - <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}"> - <span v-if="label.indexOf(searchValue) > -1">{{ label.substr(0, label.indexOf(searchValue)) }}<span - class="replaceSearch">{{ searchValue }}</span>{{ label.substr(label.indexOf(searchValue) + searchValue.length) }}</span> - <span v-else>{{ label }}</span> + <template slot="title" slot-scope="{ title, parentId, entity, key:treeKey,type}"> + <span v-if="title.indexOf(searchValue) > -1">{{ title.substr(0, title.indexOf(searchValue)) }}<span + class="replaceSearch">{{ searchValue }}</span>{{ title.substr(title.indexOf(searchValue) + searchValue.length) }}</span> + <span v-else>{{ title }}</span> </template> </a-tree> </div> @@ -83,6 +85,7 @@ import { getAction } from '@/api/manage' import dncApi from '@/api/dnc' import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import { mapActions } from 'vuex' export default { name: 'NcDocumentAssignModal', @@ -112,11 +115,43 @@ return parseInt(index) + 1 } }, - { title: '鏂囦欢鍚嶇О', dataIndex: 'docName', align: 'center', width: 300 }, + { + title: '鏂囦欢鍚嶇О', + dataIndex: 'docName', + key: 'docName', + align: 'center', + width: 300, + sorter: true + }, { title: '璁惧缂栧彿', dataIndex: 'docCode', align: 'center' }, - { title: '鍑哄簱鐘舵��', dataIndex: 'pullStatus_dictText', align: 'center' }, - { title: '鐘� 鎬�', dataIndex: 'docStatus_dictText', align: 'center' }, - { title: '涓婁紶鏃堕棿', dataIndex: 'createTime', align: 'center', width: 200 } + { + title: '鍑哄簱鐘舵��', + dataIndex: 'pullStatus_dictText', + key: 'pullStatus', + align: 'center', + filters: [ + { text: '鏈嚭搴�', value: 1 }, + { text: '宸插嚭搴�', value: 2 } + ] + }, + { + title: '鐘� 鎬�', + dataIndex: 'docStatus_dictText', + key: 'docStatus', + align: 'center', + filters: [ + { text: '璁捐', value: 1 }, + { text: '鍙戝竷', value: 2 }, + { text: '褰掓。', value: 3 } + ] + }, + { + title: '鍒涘缓鏃堕棿', + dataIndex: 'createTime', + align: 'center', + width: 200, + sorter: true + } ], searchValue: '', searchInput: '', @@ -127,6 +162,7 @@ expandedKeys: [], autoExpandParent: true, isExpandAllTreeNode: false, + date: [], url: { list: '/nc/doc/find/list' } @@ -150,6 +186,9 @@ } }, methods: { + ...mapActions(['QueryProduction']), + + // 鑾峰彇褰撳墠宸ュ簭鎴栧伐姝ュ搴旀枃妗e垪琛� loadData() { this.dataSource = [] if (!this.url.list) { @@ -157,14 +196,11 @@ return } var params = this.getQueryParams()//鏌ヨ鏉′欢 - if (!params) { - return false - } + if (!params) return false const { attributionType, attributionId, param } = this.currentDocumentInfo params.attributionType = attributionType params.attributionId = attributionId params.docClassCode = param - console.log('params', params) this.loading = true getAction(this.url.list, params).then((res) => { if (res.success) this.dataSource = res.result @@ -174,16 +210,18 @@ }) }, + // 鑾峰彇DNC璁惧鏍� getDocumentAssignDeviceTreeByApi() { this.spinning = true this.treeDataSource = [] - dncApi.getDocumentAssignDeviceTreeApi(this.currentDocumentInfo) + this.QueryProduction('DNC') .then(res => { if (res.success) { this.dataList = [] this.allTreeKeys = [] - this.treeDataSource = res.list + this.treeDataSource = res.result this.generateList(this.treeDataSource) + this.expandedKeys = this.allTreeKeys } else { this.$message.warn(res.message) } @@ -193,15 +231,42 @@ }) }, + // 鏃堕棿閫夋嫨鍣ㄩ�夋嫨瀹屾垚鍚庤Е鍙� + handleDateChange(value) { + this.queryParam.startTime = value[0] + this.queryParam.endTime = value[1] + }, + + /** + * 琛ㄦ牸鍒嗛〉銆佹帓搴忔敼鍙樸�佺瓫閫夋椂瑙﹀彂 + * @param pagination 鍒嗛〉鍣ㄩ�夐」 + * @param filters 绛涢�夐�夐」 + * @param sorter 鎺掑簭閫夐」 + */ + handleTableChange(pagination, filters, sorter) { + if (sorter.order) { + this.isorter.column = sorter.field + this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' + } else { + this.isorter.column = 'createTime' + this.isorter.order = 'desc' + } + for (let key in filters) { + this.filters[key] = filters[key].join(',') + } + this.loadData() + }, + + // 鎸囨淳鍒拌澶囩獥鍙g偣鍑荤‘瀹氭寚娲捐澶囧悗瑙﹀彂 handleAssignDocumentToDevice() { - const { checkedKeys, selectedRowKeys, dataList, $confirm, $notification, currentDocumentInfo, queryParam: { applyReason }, $set } = this - const { publishFileId, attributionId } = currentDocumentInfo + const { checkedKeys, selectedRowKeys, dataList, $confirm, $notification, currentDocumentInfo, queryParam: { applyReason }, $destroyAll, $bus } = this + const { publishFileId, attributionId, attributionType } = currentDocumentInfo const paramsArray = [] - // 杩囨护鍒嗙粍Id浠呮斁鍏ヨ澶嘔d + // 杩囨护杞﹂棿key浠呮斁鍏ヨ澶噆ey const treeCheckedDeviceKeys = [] checkedKeys.forEach(checkedKey => { - const deviceId = dataList.find(item => item.key === checkedKey && item.type === 2) - if (deviceId) treeCheckedDeviceKeys.push(deviceId.key) + const device = dataList.find(item => item.key === checkedKey && item.type === 2) + if (device) treeCheckedDeviceKeys.push(device.key) }) if (treeCheckedDeviceKeys.length === 0 || selectedRowKeys.length === 0) { @@ -218,13 +283,15 @@ okText: '纭', cancelText: '鍙栨秷', onOk: () => { + // 鍙岄噸寰幆纭畾姣忎竴缁勮澶囦笌鏂囨。鐨勫弬鏁� treeCheckedDeviceKeys.forEach(deviceId => { selectedRowKeys.forEach(docId => { paramsArray.push({ docId, deviceId, fileId: publishFileId, - processId: attributionId, + attributionId, + attributionType, applyReason }) }) @@ -234,7 +301,7 @@ dncApi.assignDocumentToDeviceApi(item) .then(res => { if (res.success) { - this.$bus.$emit('reloadMainBottomTableData', 'useDocumentEquipment') + $bus.$emit('reloadMainBottomTableData', 'useDocumentEquipment') $notification.success({ message: '娑堟伅', description: res.message @@ -252,13 +319,15 @@ description: err.message }) }) + .finally(() => { + $destroyAll() + }) }) - console.log('paramsArray', paramsArray) + }, + onCancel: () => { + $destroyAll() } }) - // console.log('table', this.selectedRowKeys) - // console.log('treeCheckedDeviceKeys', treeCheckedDeviceKeys) - // console.log('currentDocumentInfo', this.currentDocumentInfo) }, /* 杈撳叆鏌ヨ鍐呭鍙樺寲鏃惰Е鍙� */ @@ -302,6 +371,11 @@ this.checkedKeys = checkedKeys }, + /** + * 鏍戣妭鐐归�変腑鏃惰Е鍙戯紙妯℃嫙鏍戣妭鐐瑰閫夋閫変腑鏃剁殑鏁堟灉锛� + * @param selectedKeys 閫変腑鑺傜偣key + * @param {node} node 鑺傜偣瀵硅薄 + */ handleTreeNodeSelect(selectedKeys, { node }) { node.$el.childNodes[1].click() }, @@ -330,14 +404,13 @@ /** * 閫掑綊鑾峰緱鎵�鏈夋爲鑺傜偣key - * @param data + * @param data 璁惧鏍戞暟鎹� */ generateList(data) { for (let i = 0; i < data.length; i++) { - data[i].key = data[i].id const node = data[i] - const key = node.id - const title = node.label + const key = node.key + const title = node.title const type = node.type this.dataList.push({ key, title, type }) this.allTreeKeys.push(key) @@ -350,6 +423,8 @@ this.expandedKeys = [] this.selectedRowKeys = [] this.checkedKeys = [] + this.filters = {} + this.isorter = Object.assign({}, this.defaultSorter) } } } diff --git a/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue b/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue index ab19d41..5381b00 100644 --- a/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue +++ b/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentTableList.vue @@ -44,12 +44,44 @@ return parseInt(index) + 1 } }, - { title: '鏂囦欢鍚嶇О', dataIndex: 'docName', align: 'center' }, + { + title: '鏂囦欢鍚嶇О', + dataIndex: 'docName', + key: 'docName', + align: 'center', + width: 300, + sorter: true + }, { title: '浠g爜鐗堟湰', dataIndex: 'docAlias', align: 'center' }, - { title: '鍑哄簱鐘舵��', dataIndex: 'pullStatus_dictText', align: 'center' }, - { title: '鐘� 鎬�', dataIndex: 'docStatus_dictText', align: 'center' }, - { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center' }, - { title: '涓婁紶鏃堕棿', dataIndex: 'createTime', align: 'center' } + { + title: '鍑哄簱鐘舵��', + dataIndex: 'pullStatus_dictText', + key: 'pullStatus', + align: 'center', + filters: [ + { text: '鏈嚭搴�', value: 1 }, + { text: '宸插嚭搴�', value: 2 } + ] + }, + { + title: '鐘� 鎬�', + dataIndex: 'docStatus_dictText', + key: 'docStatus', + align: 'center', + filters: [ + { text: '璁捐', value: 1 }, + { text: '鍙戝竷', value: 2 }, + { text: '褰掓。', value: 3 } + ] + }, + { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center', width: 200 }, + { + title: '鍒涘缓鏃堕棿', + dataIndex: 'createTime', + align: 'center', + width: 200, + sorter: true + } ], dataSource: [], currentRightClickedDocumentInfo: {}, @@ -79,7 +111,6 @@ //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 if (arg === 1) this.ipagination.current = 1 var params = this.getQueryParams()//鏌ヨ鏉′欢 - console.log('currentTreeNodeInfo', this.currentTreeNodeInfo) params.attributionId = this.currentTreeNodeInfo.id params.attributionType = this.currentTreeNodeInfo.type params.docClassCode = 'NC' @@ -119,12 +150,34 @@ } }, + /** + * 琛ㄦ牸鍒嗛〉銆佹帓搴忔敼鍙樸�佺瓫閫夋椂瑙﹀彂 + * @param pagination 鍒嗛〉鍣ㄩ�夐」 + * @param filters 绛涢�夐�夐」 + * @param sorter 鎺掑簭閫夐」 + */ + handleTableChange(pagination, filters, sorter) { + if (sorter.order) { + this.isorter.column = sorter.field + this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' + } else { + this.isorter.column = 'createTime' + this.isorter.order = 'desc' + } + for (let key in filters) { + this.filters[key] = filters[key].join(',') + } + this.ipagination = pagination + this.loadData() + }, + handleDocumentEdit(record, modalTitle) { this.$refs.modalForm.edit(record) this.$refs.modalForm.title = modalTitle }, handleDocumentAssign(record, modalTitle) { + if (!this.$refs.documentAssignModalRef) return this.$refs.documentAssignModalRef.title = modalTitle this.$refs.documentAssignModalRef.visible = true }, diff --git a/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue b/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue index e73697e..a8fe89d 100644 --- a/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue +++ b/src/views/dnc/base/modules/ProductStructure/Document/OtherDocumentTableList.vue @@ -40,12 +40,44 @@ return parseInt(index) + 1 } }, - { title: '鏂囦欢鍚嶇О', dataIndex: 'docName', align: 'center' }, + { + title: '鏂囦欢鍚嶇О', + dataIndex: 'docName', + key: 'docName', + align: 'center', + width: 300, + sorter: true + }, { title: '璁惧缂栧彿', dataIndex: 'docCode', align: 'center' }, - { title: '鍑哄簱鐘舵��', dataIndex: 'pullStatus_dictText', align: 'center' }, - { title: '鐘� 鎬�', dataIndex: 'docStatus_dictText', align: 'center' }, - { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center' }, - { title: '涓婁紶鏃堕棿', dataIndex: 'createTime', align: 'center' } + { + title: '鍑哄簱鐘舵��', + dataIndex: 'pullStatus_dictText', + key: 'pullStatus', + align: 'center', + filters: [ + { text: '鏈嚭搴�', value: 1 }, + { text: '宸插嚭搴�', value: 2 } + ] + }, + { + title: '鐘� 鎬�', + dataIndex: 'docStatus_dictText', + key: 'docStatus', + align: 'center', + filters: [ + { text: '璁捐', value: 1 }, + { text: '鍙戝竷', value: 2 }, + { text: '褰掓。', value: 3 } + ] + }, + { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center', width: 200 }, + { + title: '鍒涘缓鏃堕棿', + dataIndex: 'createTime', + align: 'center', + width: 200, + sorter: true + } ], dataSource: [], currentClickedDocumentInfo: {}, @@ -113,6 +145,27 @@ } }, + /** + * 琛ㄦ牸鍒嗛〉銆佹帓搴忔敼鍙樸�佺瓫閫夋椂瑙﹀彂 + * @param pagination 鍒嗛〉鍣ㄩ�夐」 + * @param filters 绛涢�夐�夐」 + * @param sorter 鎺掑簭閫夐」 + */ + handleTableChange(pagination, filters, sorter) { + if (sorter.order) { + this.isorter.column = sorter.field + this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' + } else { + this.isorter.column = 'createTime' + this.isorter.order = 'desc' + } + for (let key in filters) { + this.filters[key] = filters[key].join(',') + } + this.ipagination = pagination + this.loadData() + }, + handleDocumentEdit(record, modalTitle) { this.$refs.modalForm.edit(record) this.$refs.modalForm.title = modalTitle diff --git a/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue b/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue index 0de6856..58c9705 100644 --- a/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue +++ b/src/views/dnc/base/modules/ProductStructure/Permission/AssignPermissionModal.vue @@ -11,7 +11,7 @@ </a-form-model> <a-tabs v-model="activeTabKey"> - <a-tab-pane :key="1" tab="鍒嗛厤閮ㄩ棬"> + <a-tab-pane :key="1" tab="鍒嗛厤杞﹂棿"> <DepartPermissionTransfer ref="departPermissionTransferRef" :currentTreeNodeInfo="currentTreeNodeInfo" :treeDataProps="allDepartmentsList" :allTreeKeys="allTreeKeys" :isAssignSonNode="isAssignSonNode"/> @@ -78,7 +78,7 @@ this.visible = true }, - // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夐儴闂ㄥ垪琛� + // 璋冪敤鎺ュ彛鑾峰彇鎵�鏈夎溅闂村垪琛� getAllDepartmentsListByApi() { this.allTreeKeys = [] queryProductionTreeList() @@ -92,7 +92,7 @@ this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList))) }) - // 鍙湁涓婃閫�鍑烘椂鍦ㄩ儴闂ㄥ垎閰峵ab鐣岄潰鎵嶄細杩涘叆姝ゅ垽鏂� + // 鍙湁涓婃閫�鍑烘椂鍦ㄨ溅闂村垎閰峵ab鐣岄潰鎵嶄細杩涘叆姝ゅ垽鏂� // 鑻ヤ笂娆¢��鍑烘椂鍦ㄧ敤鎴峰垎閰峵ab鐣岄潰鍒欏啀娆¤繘鍏ユ椂key鐢�2鍙樹负1鏃朵細瑙﹀彂watch鐩戞祴activeTabKey鍙樺寲鍒欎細灏唊ey:1鍔犲叆hasLoadedDataTabKeyArray锛屽洜姝ゆ棤闇�鍐嶆鍔犲叆key:1 if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey) } diff --git a/src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue b/src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue index 89345b1..7b7ee3d 100644 --- a/src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue +++ b/src/views/dnc/base/modules/ProductStructure/Permission/DepartPermissionTransfer.vue @@ -5,8 +5,8 @@ :data-source="dataSource" show-search :list-style="{flex:1,height: '500px'}" - :titles="['鏈垎閰嶉儴闂�', '宸插垎閰嶉儴闂�']" - :operations="['鍒嗛厤閮ㄩ棬', '绉婚櫎閮ㄩ棬']" + :titles="['鏈垎閰嶈溅闂�', '宸插垎閰嶈溅闂�']" + :operations="['鍒嗛厤杞﹂棿', '绉婚櫎杞﹂棿']" :target-keys="targetKeys" :render="item => `${item.title}`" @change="handleChange" @@ -92,7 +92,7 @@ } }, methods: { - // 璋冪敤鎺ュ彛鑾峰彇鏈夋潈闄愮殑閮ㄩ棬鍒楄〃 + // 璋冪敤鎺ュ彛鑾峰彇鏈夋潈闄愮殑杞﹂棿鍒楄〃 getHasPermissionDepartByApi() { const that = this that.spinning = true diff --git a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue index 151b5d4..b0fecf4 100644 --- a/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue +++ b/src/views/dnc/base/modules/ProductStructure/ProductStructureMainTop.vue @@ -12,6 +12,9 @@ </a-tab-pane> <TableContextMenu :tableRowInfo="currentRightClickedTableRowInfo" ref="tableContextMenuRef"/> + + <DocumentBatchDeleteModal :currentDocumentInfo="currentRightClickedTableRowInfo" :size="tableContainerSize" + @reloadDocumentListData="reloadDocumentListData" ref="documentBatchDeleteModalRef"/> </a-tabs> </template> @@ -20,10 +23,11 @@ import NcDocumentTableList from './Document/NcDocumentTableList' import OtherDocumentTableList from './Document/OtherDocumentTableList' import TableContextMenu from '../../../common/TableContextMenu' + import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' export default { name: 'ProductStructureMainTop', - components: { TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, + components: { DocumentBatchDeleteModal, TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, data() { return { activeTabKey: 1, @@ -142,6 +146,12 @@ }) }, + handleBatchRemove(modalTitle) { + if (!this.$refs.documentBatchDeleteModalRef) return + this.$refs.documentBatchDeleteModalRef.title = modalTitle + this.$refs.documentBatchDeleteModalRef.visible = true + }, + /** * 鍑哄簱褰撳墠鍙抽敭閫変腑鏂囨。 * @param menuLabel diff --git a/src/views/dnc/common/DocumentBatchDeleteModal.vue b/src/views/dnc/common/DocumentBatchDeleteModal.vue index 6d307fe..36180b6 100644 --- a/src/views/dnc/common/DocumentBatchDeleteModal.vue +++ b/src/views/dnc/common/DocumentBatchDeleteModal.vue @@ -1,20 +1,244 @@ <template> - <div> + <a-modal width="65%" :title="title" :visible="visible" @cancel="visible=false" :maskClosable="false" centered + @ok="confirmBatchDeleteDocument"> + <div class="table-page-search-wrapper"> + <a-form layout="inline" @keyup.enter.native="searchQuery"> + <a-row :gutter="24"> + <a-col :md="6" :sm="6"> + <a-form-item label="鏂囦欢鍚嶇О"> + <a-input placeholder="璇疯緭鍏ユ枃浠跺悕绉�" v-model="queryParam.docName" allow-clear></a-input> + </a-form-item> + </a-col> + <a-col :md="8" :sm="8"> + <a-form-item label="鍒涘缓鏃堕棿"> + <a-range-picker v-model="date" value-format="YYYY-MM-DD" @change="handleDateChange" + allow-clear></a-range-picker> + </a-form-item> + </a-col> + + <a-col :md="4" :sm="4"> + <a-button type="primary" @click="searchQuery" icon="search">鏌ヨ</a-button> + </a-col> + </a-row> + </a-form> </div> + + <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange" + :scroll="{y:380}" :size="size" rowKey="docId" style="min-height: 480px"> + <span slot="docName" slot-scope="text">{{text}}</span> + </a-table> + </a-modal> </template> <script> + import { getAction } from '@/api/manage' + import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import dncApi from '@/api/dnc' + export default { name: 'DocumentBatchDeleteModal', components: {}, - data() { - return {} + mixins: [JeecgListMixin], + props: { + currentDocumentInfo: { + type: Object + }, + size: { + type: String + } }, - methods: {} + data() { + return { + disableMixinCreated: true, + visible: false, + title: '', + date: [], + columns: [ + { + title: '搴忓彿', + dataIndex: 'rowIndex', + key: 'rowIndex', + width: 65, + align: 'center', + customRender: function(t, r, index) { + return parseInt(index) + 1 + } + }, + { + title: '鏂囦欢鍚嶇О', + dataIndex: 'docName', + key: 'docName', + align: 'center', + width: 300, + sorter: true + }, + { title: '璁惧缂栧彿', dataIndex: 'docCode', align: 'center' }, + { + title: '鍑哄簱鐘舵��', + dataIndex: 'pullStatus_dictText', + key: 'pullStatus', + align: 'center', + filters: [ + { text: '鏈嚭搴�', value: 1 }, + { text: '宸插嚭搴�', value: 2 } + ], + }, + { + title: '鐘� 鎬�', + dataIndex: 'docStatus_dictText', + key: 'docStatus', + align: 'center', + filters: [ + { text: '璁捐', value: 1 }, + { text: '鍙戝竷', value: 2 }, + { text: '褰掓。', value: 3 } + ], + }, + { title: '绯荤粺鎸囧畾鐗堟湰', dataIndex: 'publishVersion', align: 'center', width: 200 }, + { + title: '鍒涘缓鏃堕棿', + dataIndex: 'createTime', + align: 'center', + width: 200, + sorter: true + } + ], + spinning: false, + url: { + list: '/nc/doc/find/page' + } + } + }, + watch: { + visible: { + handler(value) { + if (value) { + this.resetData() + this.loadData() + } + } + } + }, + methods: { + // 鑾峰彇褰撳墠宸ュ簭鎴栧伐姝ュ搴旀枃妗e垪琛� + loadData() { + this.dataSource = [] + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + + var params = this.getQueryParams()//鏌ヨ鏉′欢 + if (!params) return false + const { attributionType, attributionId, param } = this.currentDocumentInfo + params.attributionType = attributionType + params.attributionId = attributionId + params.docClassCode = param + console.log('params', params) + this.loading = true + getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { + if (res.success) { + this.dataSource = res.result.records + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } + else this.$message.warning(res.message) + }).finally(() => { + this.loading = false + }) + }, + + /** + * 琛ㄦ牸鍒嗛〉銆佹帓搴忔敼鍙樸�佺瓫閫夋椂瑙﹀彂 + * @param pagination 鍒嗛〉鍣ㄩ�夐」 + * @param filters 绛涢�夐�夐」 + * @param sorter 鎺掑簭閫夐」 + */ + handleTableChange(pagination, filters, sorter) { + if (sorter.order) { + this.isorter.column = sorter.field + this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' + } else { + this.isorter.column = 'createTime' + this.isorter.order = 'desc' + } + for (let key in filters) { + this.filters[key] = filters[key].join(',') + } + this.ipagination = pagination + this.loadData() + }, + + // 鏃堕棿閫夋嫨鍣ㄩ�夋嫨瀹屾垚鍚庤Е鍙� + handleDateChange(value) { + this.queryParam.startTime = value[0] + this.queryParam.endTime = value[1] + }, + + // 纭鎵归噺鍒犻櫎鏂囨。 + confirmBatchDeleteDocument() { + const that = this + const { selectedRowKeys, $notification, $confirm, currentDocumentInfo: { param, attributionId } } = that + + if (selectedRowKeys.length === 0) { + $notification.warning({ + message: '娑堟伅', + description: '璇烽�夋嫨鏂囨。' + }) + return + } + + $confirm({ + title: '鎻愮ず', + content: `鍒犻櫎鍚庝笉鍙彇娑堬紝纭鍒犻櫎鍚楋紵`, + okText: '纭', + cancelText: '鍙栨秷', + onOk: () => { + let hasRequestedSuccessCount = 0 + let hasRequestedCount = 0 + selectedRowKeys.forEach(key => { + dncApi.deleteDocumentApi(key) + .then(res => { + if (res.success) { + $notification.success({ + message: '娑堟伅', + description: res.message + }) + hasRequestedSuccessCount++ + } else { + $notification.error({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + hasRequestedCount++ + if (hasRequestedCount === selectedRowKeys.length && hasRequestedSuccessCount > 0) { + this.loadData() + this.$emit('reloadDocumentListData', { docClassCode: param, attributionId }) + } + }) + }) + that.$destroyAll() + }, + onCancel: () => { + that.$destroyAll() + } + }) + + + }, + + resetData() { + this.queryParam = {} + this.selectedRowKeys = [] + } + } } -</script> - -<style scoped> - -</style> \ No newline at end of file +</script> \ No newline at end of file diff --git a/src/views/dnc/common/TableContextMenu.vue b/src/views/dnc/common/TableContextMenu.vue index 9e5b1ec..7635a07 100644 --- a/src/views/dnc/common/TableContextMenu.vue +++ b/src/views/dnc/common/TableContextMenu.vue @@ -48,7 +48,7 @@ { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, - { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false }, + { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鐢熷懡鍛ㄦ湡', subMenu: [ @@ -68,7 +68,7 @@ { label: '瀵煎叆鏂囨。', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, - { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false }, + { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鐢熷懡鍛ㄦ湡', subMenu: [ @@ -88,7 +88,7 @@ { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, - { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false }, + { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鐢熷懡鍛ㄦ湡', subMenu: [ @@ -108,7 +108,7 @@ { label: '瀵煎叆NC绋嬪簭', code: 'document_import', subMenu: [], icon: 'import', isCommonMethod: true }, { label: '涓嬭浇', code: 'document_download', subMenu: [], icon: 'download', isCommonMethod: true }, { label: '鍒犻櫎', code: 'document_delete', subMenu: [], icon: 'delete', isCommonMethod: true }, - { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: false }, + { label: '鎵归噺鍒犻櫎', code: 'document_batch_remove', subMenu: [], icon: 'delete', isCommonMethod: true }, { label: '鐢熷懡鍛ㄦ湡', subMenu: [ diff --git a/src/views/mdc/base/modules/EquipmentList/UserModal.vue b/src/views/mdc/base/modules/EquipmentList/UserModal.vue index 449364a..5a817ca 100644 --- a/src/views/mdc/base/modules/EquipmentList/UserModal.vue +++ b/src/views/mdc/base/modules/EquipmentList/UserModal.vue @@ -23,14 +23,13 @@ <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-input-search v-model="model.equipmentId" :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-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧悕绉�" v-model="model.equipmentName"/> </a-form-model-item> </a-col> @@ -38,12 +37,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="閮ㄩ棬鍒嗛厤" :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> <a-form-model-item v-if="isDepartType == -1" label="璁惧绫诲瀷" :labelCol="labelCol" :wrapperCol="wrapperCol"> - <a-select :disabled="disableSubmit" :readOnly="disableSubmit" placeholder="璇烽�夋嫨璁惧绫诲瀷" + <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,9 +55,12 @@ </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="杞﹂棿鍒嗛厤" :labelCol="labelCol" :wrapperCol="wrapperCol" v-show="!productionDisabled" + ref="selectedProduction" prop="selectedProduction"> <!--<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-production :disabled="disableSubmit" v-model="model.selectedProduction" :multi="false" + @back="backProductionInfo" :backProduction="true" + :treeProductOpera="true"></j-select-equipment-production> </a-form-model-item> </a-col> @@ -63,23 +68,23 @@ <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-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-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-input :disabled="disableSubmit" allow-clear placeholder="璇疯緭鍏ヨ澶囧姛鐜�" v-model="model.devicePower"/> </a-form-model-item> </a-col> @@ -88,13 +93,13 @@ <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-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-input :disabled="true" placeholder="璇疯緭鍏ユ満搴婄鍙�" v-model="model.dataPort"/> </a-form-model-item> </a-col> @@ -103,14 +108,14 @@ <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="璇烽�夋嫨椹卞姩绫诲瀷" + <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-input :disabled="true" allow-clear placeholder="璇疯緭鍏ヨ澶囧瀷鍙�" v-model="model.equipmentModel"/> </a-form-model-item> </a-col> @@ -119,12 +124,13 @@ <a-row :gutter="24"> <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/> + <j-dict-select-tag placeholder="璇烽�夋嫨绯荤粺绫诲瀷" :triggerChange="true" dictCode="system_type" :disabled="disableSubmit" + 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/> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绾у埆" dictCode="device_level" v-model="model.deviceLevel" :disabled="disableSubmit" allow-clear/> </a-form-model-item> </a-col> </a-row> @@ -132,7 +138,8 @@ <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/> + <j-dict-select-tag placeholder="璇烽�夋嫨璁惧绉嶇被" dictCode="device_category" v-model="model.deviceCategory" :disabled="disableSubmit" + allow-clear/> </a-form-model-item> </a-col> <a-col :span="12"> @@ -144,15 +151,15 @@ </a-row> <a-row :gutter="24" v-if="systemType"> - <a-col :span='24'> - <a-form-model-item label="绯荤粺绫诲瀷" :labelCol="{span:3}" :wrapperCol="{span:21}"> - <a-radio-group name="radioGroup" v-model="systemValue"> - <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='24'> + <a-form-model-item label="绯荤粺绫诲瀷" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> + <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-row> @@ -167,7 +174,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> @@ -192,121 +199,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 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, JSelectEquipmentDepart, JSelectEquipmentProduction, DeviceListModel }, - data () { + data() { return { - disSearch:false, departDisabled: false, //鏄惁鏄垜鐨勯儴闂ㄨ皟鐢ㄨ椤甸潰 productionDisabled: 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: '璇烽�夋嫨璁惧缂栧彿!' + } // { // validator: this.validatequipmentId // } ], - // trigger: 'blur' // 瑙﹀彂鏂瑰紡 + // trigger: 'blur' // 瑙﹀彂鏂瑰紡 selectedProduction: [ { - required:true,message: '璇烽�夋嫨杞﹂棿' + required: true, message: '璇烽�夋嫨杞﹂棿' } ] }, - departIdShow:false, - title:"鎿嶄綔", + departIdShow: false, + title: '鎿嶄綔', visible: false, model: { - equipmentId: "", - equipmentName: "", - equipmentModel: "", - equipmentIp: "", - dataPort: "", - driveType: "", - systemType: "", - deviceLevel: "", - deviceCategory: "", - deviceTypeDnc:"", - deviceTypeMdc:"", + 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:{}, - systemType:false, - systemValue:"3", + 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",//鍚屾鐢ㄦ埛鍒板伐浣滄祦 + 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.getAppPlatformName() // this.initRoleList() // this.initTenantList() }, - computed:{ - uploadAction:function () { - return this.url.fileUpload; + computed: { + uploadAction: function() { + return this.url.fileUpload } }, methods: { @@ -318,17 +333,17 @@ } 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'; + getAppPlatformName() { + getAction(`/system/sysParams/query/by/settingKey?settingKey=system_type`).then(res => { + if (res.success) { + this.systemType = res.result.settingValue === '0' } }) }, @@ -342,9 +357,9 @@ } else { // this.$message.warning(res.message) this.$notification.warning({ - message:'娑堟伅', - description:res.message - }); + message: '娑堟伅', + description: res.message + }) } }).finally(() => { this.loading = false @@ -352,15 +367,15 @@ }, 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 } }, @@ -369,68 +384,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) - if (record.systemValue!=null){ - this.systemValue=record.systemValue; - }else { - this.systemValue="3" + if (record.systemValue != null) { + this.systemValue = record.systemValue + } else { + this.systemValue = '3' } - that.model = Object.assign({}, record); + 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','systemValue')) + 'driveType', 'sortNo', 'remark', 'systemVersion', 'devicePower', 'controlSystem', 'saveTableName', 'systemValue')) }) - 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 = 700 } }, - 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, @@ -438,22 +464,22 @@ }) } - 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.userProductionList, { equipmentId: userid }).then((res) => { + if (res.success) { // console.log(res.result) - let ProductionOptions=[]; - let selectProductKeys=[] + let ProductionOptions = [] + 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({ value: res.result[i].key, @@ -461,9 +487,9 @@ }) } - that.model.selectedProduction = selectProductKeys.join(",") + that.model.selectedProduction = selectProductKeys.join(',') - that.nextProductionOptions=ProductionOptions; + that.nextProductionOptions = ProductionOptions // console.log('that.nextProductionOptions=',that.nextProductionOptions) } }) @@ -471,108 +497,109 @@ }, 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) { // 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.selectedProduction + 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; - this.model.systemValue=this.systemValue; - obj=addEquipment(this.model); - }else{ - this.model.systemValue=this.systemValue; - obj=editEquipment(this.model,{ - id: this.model.id - }); + 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){ + 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; @@ -583,9 +610,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