Revert "1、设备类管理页面完成增删改查功能"
This reverts commit bc55e59f49229ffa77d2b32dd9fd0a9b6049b9b8.
| | |
| | | // è·å产åç»ææ |
| | | getProductStructureTreeApi: () => getAction('/nc/product/getTree'), |
| | | // è·å产åç»ææ èç¹å®ä½ä¿¡æ¯ |
| | | getProductStructureTreeNodeEntityApi:params=> getAction('/nc/product/getTreeById',params), |
| | | getProductStructureTreeNodeEntityApi: params => getAction('/nc/product/getTreeById', params), |
| | | // è·åææè®¾å¤çå表 |
| | | getAllDeviceListApi: (type) => getAction('/nc/device/list/all'), |
| | | // 导å
¥NCç¨åº/ææ¡£ |
| | |
| | | appointCurrentDocumentVersionApi: fileId => putAction(`/nc/file/assign/version/${fileId}`), |
| | | // ææ¡£æ¯å¯¹ |
| | | fileCompareApi: fileIdArray => getAction(`/nc/file/comparison/${fileIdArray[0]}/${fileIdArray[1]}`), |
| | | // è·åææé¨é¨å表 |
| | | getAllDepartmentsListApi: () => getAction('/ucenter/depart/list/all'), |
| | | // è·åææç¨æ·å表 |
| | | // æéé
置弹çªä¸è·åææè½¦é´å表 |
| | | getAllDepartmentsListApi: () => getAction('/mdc/mdcProduction/queryTreeListByConfig'), |
| | | // æéé
置弹çªä¸è·åææç¨æ·å表 |
| | | getAllUsersListApi: () => getAction('/sys/user/list'), |
| | | // è·åææéçé¨é¨å表 |
| | | // æéé
置弹çªä¸è·åææéçé¨é¨å表 |
| | | getHasPermissionDepartApi: ({ type, id }) => getAction(`/nc/product/get/perm/depart/${type}/${id}`), |
| | | // è·åææéçç¨æ·å表 |
| | | // æéé
置弹çªä¸è·åææéçç¨æ·å表 |
| | | getHasPermissionUserApi: ({ type, id }) => getAction(`/nc/product/get/perm/user/${type}/${id}`), |
| | | // åé
é¨é¨æé |
| | | // æéé
置弹çªä¸åé
é¨é¨æé |
| | | assignPermissionToDepart: ({ treeNodeType, treeNodeId, isAssignSonNode, departIdArray }) => { |
| | | return postAction(`/nc/product/assign/add/department/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, departIdArray) |
| | | }, |
| | | // ç§»é¤é¨é¨æé |
| | | // æéé
置弹çªä¸ç§»é¤é¨é¨æé |
| | | removePermissionFromDepart: ({ treeNodeType, treeNodeId, isAssignSonNode, departIdArray }) => { |
| | | return postAction(`/nc/product/assign/remove/department/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, departIdArray) |
| | | }, |
| | | // åé
ç¨æ¶æé |
| | | // æéé
置弹çªä¸åé
ç¨æ¶æé |
| | | 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) |
| | | }, |
| | | // éè¿è½¦é´IDè·å设å¤ç±»å表 |
| | | getDeviceCustomTypeListByProductionIdApi: productionId => getAction('/nc/deviceManagement/getDeviceManagementListByProductionId', { productionId }), |
| | | |
| | | //-------------------------设å¤ç»ææ ------------------------------------------------ |
| | | // è·åè®¾å¤æ |
| | |
| | | // ç§»é¤ç¨æ·æé |
| | | removeDeviceTreePermissionFromUser: ({ treeNodeType, treeNodeId, isAssignSonNode, userIdArray }) => { |
| | | return postAction(`/nc/device/assign/remove/user/${treeNodeType}/${treeNodeId}/${isAssignSonNode}`, userIdArray) |
| | | } |
| | | }, |
| | | //-------------------------设å¤ç±»ç®¡ç------------------------------------------------ |
| | | // è·åææéçè½¦é´æ å表 |
| | | getHasPermissionWorkshopTreeApi: () => getAction('/nc/deviceManagement/getProductionIdsByUserId') |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="车é´"> |
| | | <a-select v-model="queryParam.productionId" placeholder="è¯·éæ©è½¦é´"> |
| | | <a-select-option v-for="item in workshopTreeData" :key="item.id"> |
| | | {{ item.productionName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-form-item label="设å¤ç±»åç§°"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç±»åç§°" v-model="queryParam.deviceManagementName"></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <div class="table-operator" style="border-top: 5px"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ·»å 设å¤ç±»</a-button> |
| | | <!-- <a-button type="primary" icon="download" @click="handleExportXls('设å¤ç±»ä¿¡æ¯')">导åº</a-button>--> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay" @click="handleMenuClick"> |
| | | <a-menu-item key="1"> |
| | | <a-icon type="delete" @click="batchDel"/> |
| | | å é¤ |
| | | </a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> |
| | | æ¹éæä½ |
| | | <a-icon type="down"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i>已鿩 <a style="font-weight: 600">{{ |
| | | selectedRowKeys.length |
| | | }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | bordered |
| | | size="middle" |
| | | rowKey="id" |
| | | :scroll="{y:465}" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" |
| | | @change="handleTableChange"> |
| | | <template slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </template> |
| | | </a-table> |
| | | </div> |
| | | <!-- tableåºå-end --> |
| | | |
| | | <DeviceCustomTypeManagementModal ref="modalForm" :workshopTreeData="workshopTreeData" @ok="loadData"/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import dncApi from '@/api/dnc' |
| | | import DeviceCustomTypeManagementModal |
| | | from '@views/dnc/base/modules/DeviceCustomTypeManagement/DeviceCustomTypeManagementModal.vue' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeManagement', |
| | | mixins: [JeecgListMixin], |
| | | components: { |
| | | DeviceCustomTypeManagementModal |
| | | }, |
| | | data() { |
| | | return { |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key: 'rowIndex', |
| | | width: 60, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: '车é´', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'productionId_dictText' |
| | | }, |
| | | { |
| | | title: '设å¤ç±»', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'deviceManagementCode' |
| | | }, |
| | | { |
| | | title: '设å¤ç±»åç§°', |
| | | align: 'center', |
| | | width: 200, |
| | | dataIndex: 'deviceManagementName' |
| | | }, |
| | | { |
| | | title: '设å¤ç»ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentIds', |
| | | width: 400, |
| | | ellipsis: true |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | scopedSlots: { customRender: 'action' }, |
| | | align: 'center', |
| | | width: 80 |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/nc/deviceManagement/query', |
| | | delete: '/nc/deviceManagement/delete', |
| | | deleteBatch: '/nc/deviceManagement/deleteBatch' |
| | | }, |
| | | workshopTreeData: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getWorkshopListByApi() |
| | | }, |
| | | methods: { |
| | | // è°ç¨æ¥å£è·åæ¥è¯¢åºåè½¦é´æ å表 |
| | | getWorkshopListByApi() { |
| | | dncApi.getHasPermissionWorkshopTreeApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.workshopTreeData = res.result |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleAdd: function() { |
| | | this.$refs.modalForm.add() |
| | | this.$refs.modalForm.title = 'æ°å¢' |
| | | this.$refs.modalForm.disabledEdit = false |
| | | }, |
| | | |
| | | handleEdit: function(record) { |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = 'ç¼è¾' |
| | | this.$refs.modalForm.disabledEdit = true |
| | | }, |
| | | |
| | | handleMenuClick(e) { |
| | | if (e.key == 1) { |
| | | this.batchDel() |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | |
| | | <!--导å
¥æä»¶å
Œ
±å¼¹çª--> |
| | | <ImportFileModal/> |
| | | |
| | | <!--æ°å¢æç¼è¾è®¾å¤ç±»å
Œ
±å¼¹çª--> |
| | | <DeviceCustomTypeModal/> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | import ProductStructureTree from './modules/ProductStructure/ProductStructureTree' |
| | | import ProductStructureMain from './modules/ProductStructure/ProductStructureMain' |
| | | import ImportFileModal from '../common/ImportFileModal' |
| | | import ProductStructureTree from './modules/ProductStructure/ProductStructureTree' |
| | | import ProductStructureMain from './modules/ProductStructure/ProductStructureMain' |
| | | import ImportFileModal from '../common/ImportFileModal' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | |
| | | export default { |
| | | name: 'ProductStructure', |
| | | components: { |
| | | ProductStructureTree, |
| | | ProductStructureMain, |
| | | ImportFileModal |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | export default { |
| | | name: 'ProductStructure', |
| | | components: { |
| | | DeviceCustomTypeModal, |
| | | ProductStructureTree, |
| | | ProductStructureMain, |
| | | ImportFileModal |
| | | }, |
| | | data() { |
| | | return {} |
| | | }, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-card-body { |
| | | padding: 8px; |
| | | } |
| | | /deep/ .ant-card-body { |
| | | padding: 8px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal |
| | | :title="title" |
| | | :width="700" |
| | | @cancel="close" |
| | | :visible="visible" |
| | | :footer="null" |
| | | style="height: 100%;overflow: auto;padding-bottom: 53px;"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <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="车é´åé
" prop="productionId"> |
| | | <a-select v-model="model.productionId" placeholder="è¯·éæ©è½¦é´" @change="handleSelectChange" |
| | | :disabled="disabledEdit"> |
| | | <a-select-option v-for="item in workshopTreeData" :key="item.id"> |
| | | {{ item.productionName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设å¤ç±»" prop="deviceManagementCode"> |
| | | <a-input allow-clear placeholder="请è¾å
¥è®¾å¤ç±»" :readOnly="disabledEdit" |
| | | v-model="model.deviceManagementCode"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设å¤ç±»åç§°" prop="deviceManagementName"> |
| | | <a-input allow-clear placeholder="请è¾å
¥è®¾å¤ç±»åç§°" :readOnly="disabledEdit" |
| | | v-model="model.deviceManagementName"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row :gutter="24"> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="设å¤ç»ç¼å·" :labelCol="labelColLong" :wrapperCol="wrapperColLong" |
| | | prop="equipmentIds"> |
| | | <a-input-search v-model="model.equipmentIds" :disabled="!model.productionId" @search="deviceSearch" |
| | | enter-button :placeholder='!model.productionId?"è¯·éæ©è½¦é´":"è¯·éæ©è®¾å¤ç»ç¼å·"'/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | |
| | | |
| | | <div class="drawer-bottom-button"> |
| | | <a-space> |
| | | <a-button @click="close">åæ¶</a-button> |
| | | <a-button @click="handleSubmit" type="primary" :loading="confirmLoading">æäº¤</a-button> |
| | | </a-space> |
| | | </div> |
| | | |
| | | <workshop-device-list-modal :productionId="model.productionId" ref="deviceListModel" |
| | | @sendSelectedRowKeys="getDeviceRowKeys"/> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import WorkshopDeviceListModal from '@views/dnc/base/modules/DeviceCustomTypeManagement/WorkshopDeviceListModal.vue' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeManagementModal', |
| | | components: { WorkshopDeviceListModal }, |
| | | props: { |
| | | workshopTreeData: { |
| | | type: Array |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | form: this.$form.createForm(this), |
| | | validatorRules: { |
| | | productionId: [ |
| | | { |
| | | required: true, message: 'è¯·éæ©è½¦é´!' |
| | | } |
| | | ], |
| | | deviceManagementCode: [ |
| | | { |
| | | required: true, message: '请è¾å
¥è®¾å¤ç±»!' |
| | | } |
| | | ], |
| | | deviceManagementName: [ |
| | | { |
| | | required: true, message: '请è¾å
¥è®¾å¤ç±»åç§°!' |
| | | } |
| | | ], |
| | | equipmentIds: [ |
| | | { |
| | | required: true, message: 'è¯·éæ©è®¾å¤ç¼å·!' |
| | | } |
| | | ] |
| | | }, |
| | | visible: false, |
| | | disabledEdit: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | }, |
| | | labelColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 4 } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 19 } |
| | | }, |
| | | confirmLoading: false, |
| | | url: { |
| | | add: '/nc/deviceManagement/add', |
| | | edit: '/nc/deviceManagement/edit' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // 车é´éæ©å¨å¼åçæ¹åæ¶è§¦åæ¸
ç©ºå·²éæ©ç设å¤ç¼å·ç» |
| | | handleSelectChange() { |
| | | if (this.model.equipmentIds) delete this.model.equipmentIds |
| | | }, |
| | | |
| | | /** |
| | | * å½è®¾å¤éæ©å®æåæäº¤å°å·²éæ©ç设å¤ç¼å·å表以éå·é弿åå°åæ°ä¸ |
| | | * @param selectedRowKeys |
| | | */ |
| | | getDeviceRowKeys(selectedRowKeys) { |
| | | if (selectedRowKeys.length === 0) return |
| | | this.$set(this.model, 'equipmentIds', selectedRowKeys.join(',')) |
| | | this.$refs.form.clearValidate() |
| | | }, |
| | | |
| | | deviceSearch() { |
| | | this.$refs.deviceListModel.openPage() |
| | | this.$refs.deviceListModel.title = 'éæ©è®¾å¤' |
| | | this.$refs.deviceListModel.disableSubmit = false |
| | | }, |
| | | |
| | | add() { |
| | | this.edit({}) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.visible = true |
| | | this.model = Object.assign({}, record) |
| | | }, |
| | | |
| | | handleSubmit() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let apiUrl, method |
| | | if (!this.model.id) { |
| | | apiUrl = this.url.add |
| | | method = 'post' |
| | | } else { |
| | | apiUrl = this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(apiUrl, this.model, method) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | that.close() |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } else { |
| | | return false |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | this.$refs.form.clearValidate() |
| | | } |
| | | } |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .drawer-bottom-button { |
| | | position: absolute; |
| | | bottom: -40px; |
| | | width: 100%; |
| | | border-top: 1px solid #e8e8e8; |
| | | padding: 10px 16px; |
| | | text-align: right; |
| | | left: 0; |
| | | background: #fff; |
| | | border-radius: 0 0 2px 2px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-modal :title="title" :width="1000" :visible="visible" :maskClosable="false" @ok="handleOk" @cancel="close" |
| | | cancelText="å
³é"> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="8" :sm="8"> |
| | | <a-form-item label="设å¤ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤ç¼å·" v-model="queryParam.equipmentId"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="8" :sm="8"> |
| | | <a-form-item label="设å¤åç§°"> |
| | | <a-input placeholder="请è¾å
¥è®¾å¤åç§°" v-model="queryParam.equipmentName"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="3" :sm="3"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="searchReset" icon="reload">éç½®</a-button> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <a-table ref="table" size="middle" bordered rowKey="equipmentId" :scroll="{y: 300}" :columns="columns" |
| | | :dataSource="dataSource" :pagination="ipagination" :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange, type:'checkbox'}" |
| | | @change="handleTableChange"> |
| | | </a-table> |
| | | <!-- tableåºå-end --> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'WorkshopDeviceListModal', |
| | | mixins: [JeecgListMixin], |
| | | components: {}, |
| | | props: { |
| | | productionId: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | visible: false, |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: '设å¤ç¼å·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentId' |
| | | }, |
| | | { |
| | | title: '设å¤åç§°', |
| | | align: 'center', |
| | | dataIndex: 'equipmentName' |
| | | }, |
| | | { |
| | | title: '设å¤åå·', |
| | | align: 'center', |
| | | dataIndex: 'equipmentModel' |
| | | }, |
| | | { |
| | | title: 'æºåºIP', |
| | | align: 'center', |
| | | dataIndex: 'equipmentIp' |
| | | }, |
| | | { |
| | | title: '驱å¨ç±»å', |
| | | align: 'center', |
| | | dataIndex: 'driveType' |
| | | }, |
| | | { |
| | | title: '端å£', |
| | | align: 'center', |
| | | dataIndex: 'dataPort' |
| | | }, |
| | | { |
| | | title: 'æ°æ§ç³»ç»', |
| | | align: 'center', |
| | | dataIndex: 'controlSystem' |
| | | } |
| | | ], |
| | | url: { |
| | | list: '/nc/deviceManagement/getEquipmentListByProductionId' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | openPage() { |
| | | this.visible = true |
| | | this.onClearSelected() |
| | | this.dataSource = [] |
| | | this.queryParam = Object.assign({}, { productionId: this.productionId }) |
| | | this.loadData() |
| | | }, |
| | | searchQuery() { |
| | | this.loadData() |
| | | this.onClearSelected() |
| | | }, |
| | | searchReset() { |
| | | this.queryParam = Object.assign({}, { productionId: this.productionId }) |
| | | this.loadData() |
| | | this.onClearSelected() |
| | | }, |
| | | close() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | }, |
| | | handleOk() { |
| | | this.$emit('sendSelectedRowKeys', this.selectedRowKeys) |
| | | this.close() |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div> |
| | | <a-tabs v-model="activeTabKey" @change="handleTabChange"> |
| | | <div style="height: 100%"> |
| | | <a-tabs style="height: 100%" v-model="activeTabKey" @change="handleTabChange"> |
| | | <a-tab-pane :key="1" tab="设å¤å±æ§" v-if="currentTreeNodeInfo.type===2&&!currentDocumentInfo.docId"> |
| | | <DeviceInfo :currentLevelDetails="currentTreeNodeInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.treeDataSource = [] |
| | | dncApi.getDeviceTreeDataApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="åç§°">{{currentLevelDetails.componentName}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="åç§°" :span="2">{{currentLevelDetails.componentName}}</a-descriptions-item> |
| | | <a-descriptions-item label="代å·">{{currentLevelDetails.componentCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="åå· ">{{currentLevelDetails.componentModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç©æç¼ç ">{{currentLevelDetails.materielCode}}</a-descriptions-item> |
| | |
| | | <a-descriptions-item label="ç产类å">{{currentLevelDetails.produceType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç»æç±»å ">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" :span="2">{{currentLevelDetails.componentWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" >{{currentLevelDetails.componentWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" |
| | | cancelText="å
³é"> |
| | | <CutterModalForm ref="realForm" @ok="submitCallback" :disableSubmit="disableSubmit"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import CutterModalForm from './CutterModalForm.vue' |
| | | |
| | | export default { |
| | | name: 'CutterModal', |
| | | components: { |
| | | CutterModalForm |
| | | }, |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 700, |
| | | visible: false, |
| | | disableSubmit: false |
| | | } |
| | | }, |
| | | methods: { |
| | | // æ·»å æç¨åå
· |
| | | handleCutterAdd() { |
| | | const { id, type } = this.currentTreeNodeInfo |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | if (this.$refs.realForm) { |
| | | this.$refs.realForm.add({ |
| | | attributionId: id, |
| | | attributionType: type |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¼è¾åå
·ä¿¡æ¯ |
| | | handleCutterEdit(record) { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | if (this.$refs.realForm) { |
| | | this.$refs.realForm.edit({ ...record }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | |
| | | submitCallback() { |
| | | this.$emit('submitSuccess') |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.$emit('close') |
| | | this.visible = false |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå
·ç¼å·" prop="cutterCode"> |
| | | <a-input v-model="model.cutterCode" placeholder="请è¾å
¥åå
·ç¼å·" :readOnly="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå
·åç§°" prop="cutterName"> |
| | | <a-input v-model="model.cutterName" placeholder="请è¾å
¥åå
·åç§°" :readOnly="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå
፱Ȍ"> |
| | | <j-dict-select-tag v-model="model.cutterType" placeholder="è¯·éæ©åå
፱Ȍ" dictCode="cutter_type" |
| | | :disabled="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="é¢å®å¯¿å½"> |
| | | <a-input-number v-model="model.lifetime" :min="0" placeholder="请è¾å
¥é¢å®å¯¿å½" style="width: 100%" |
| | | :disabled="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åä½"> |
| | | <a-input v-model="model.cutterSpacing" placeholder="请è¾å
¥åä½" :readOnly="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="åå
·æ°é"> |
| | | <a-input-number v-model="model.quantity" placeholder="请è¾å
¥åå
·æ°é" :min="1" style="width: 100%" |
| | | :disabled="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="24"> |
| | | <a-form-model-item label="æè¿°" :labelCol="labelColLong" :wrapperCol="wrapperColLong"> |
| | | <a-textarea v-model="model.description" placeholder="请è¾å
¥æè¿°" :readOnly="disableSubmit"/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'CutterModalForm', |
| | | components: {}, |
| | | props: { |
| | | disableSubmit: { |
| | | type: Boolean |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | model: { |
| | | quantity: 1 |
| | | }, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 8 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 14 } |
| | | }, |
| | | labelColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 4 } |
| | | }, |
| | | wrapperColLong: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 19 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | cutterCode: [ |
| | | { required: true, message: '请è¾å
¥åå
·ç¼å·!' } |
| | | ], |
| | | cutterName: [ |
| | | { required: true, message: '请è¾å
¥åå
·åç§°!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/nc/cutter/add', |
| | | edit: '/nc/cutter/edit' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | add(params) { |
| | | this.edit({ ...this.modelDefault, ...params }) |
| | | }, |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | console.log('model', this.model) |
| | | }, |
| | | submitForm() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl, method |
| | | if (!this.model.id) { |
| | | httpUrl = this.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpUrl = this.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpUrl, this.model, method).then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="åå
·ç¼å·"> |
| | | <a-input placeholder="请è¾å
¥åå
·ç¼å·" v-model="queryParam.cutterCode" allow-clear/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="5" :sm="5"> |
| | | <a-form-item label="åå
·åç§°"> |
| | | <a-input placeholder="请è¾å
¥åå
·åç§°" v-model="queryParam.cutterName" allow-clear/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="4" :sm="4"> |
| | | <a-space> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | <a-button type="primary" @click="handleAdd" icon="plus" v-has="'cutter_add'">æ°å¢</a-button> |
| | | <a-button type="primary" @click="handleExportXls('åå
·å表')" icon="export">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" |
| | | :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | </a-space> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :size="size" rowKey="id" |
| | | @change="handleTableChange" :scroll="{y:189}"> |
| | | <template slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <a-divider type="vertical"/> |
| | | |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link"> |
| | | æ´å¤ |
| | | <a-icon type="down"/> |
| | | </a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a href="javascript:;" @click="handleDetail(record)">详æ
</a> |
| | | </a-menu-item> |
| | | |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> |
| | | </template> |
| | | </a-table> |
| | | |
| | | <CutterModal ref="cutterModalRef" :currentTreeNodeInfo="currentLevelInfo" @submitSuccess="loadData"/> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import CutterModal from '@views/dnc/base/modules/ProductStructure/Cutter/CutterModal.vue' |
| | | |
| | | export default { |
| | | name: 'CutterTableList', |
| | | components: { CutterModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentLevelInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { title: 'åå
·ç¼å·', dataIndex: 'cutterCode', align: 'center' }, |
| | | { title: 'åå
·åç§°', dataIndex: 'cutterName', align: 'center' }, |
| | | { title: 'åå
፱Ȍ', dataIndex: 'cutterType_dictText', align: 'center' }, |
| | | { title: 'é¢å®å¯¿å½', dataIndex: 'lifetime', width: 150, align: 'center' }, |
| | | { title: 'åä½', dataIndex: 'cutterSpacing', width: 150, align: 'center' }, |
| | | { title: 'åå
·æ°é', dataIndex: 'quantity', width: 150, align: 'center' }, |
| | | { title: 'æä½', dataIndex: 'action', scopedSlots: { customRender: 'action' }, align: 'center', width: 150 } |
| | | ], |
| | | url: { |
| | | list: '/nc/cutter/getByBusinessId', |
| | | delete: '/nc/cutter/delete', |
| | | exportXlsUrl: '/nc/cutter/exportXls', |
| | | importExcelUrl: '/nc/cutter/importExcel' |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function() { |
| | | return `${window._CONFIG['domianURL']}${this.url.importExcelUrl}` |
| | | } |
| | | }, |
| | | methods: { |
| | | setQueryParamAndLoadData(pageNo = 1) { |
| | | const { id, type } = this.currentLevelInfo |
| | | this.queryParam = Object.assign({}, { attributionId: id, attributionType: type }) |
| | | this.loadData(pageNo) |
| | | }, |
| | | |
| | | handleAdd() { |
| | | if (!this.$refs.cutterModalRef) return |
| | | this.$refs.cutterModalRef.title = 'æ·»å åå
·' |
| | | this.$refs.cutterModalRef.disableSubmit = false |
| | | this.$refs.cutterModalRef.handleCutterAdd() |
| | | }, |
| | | |
| | | /** |
| | | * ç¼è¾è¡¨æ ¼è¡ä¿¡æ¯ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleEdit(record) { |
| | | if (!this.$refs.cutterModalRef) return |
| | | this.$refs.cutterModalRef.title = 'ç¼è¾åå
·ä¿¡æ¯' |
| | | this.$refs.cutterModalRef.disableSubmit = false |
| | | this.$refs.cutterModalRef.handleCutterEdit(record) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥çè¡¨æ ¼å®æ´è¡ä¿¡æ¯ |
| | | * @param record è¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleDetail: function(record) { |
| | | if (!this.$refs.cutterModalRef) return |
| | | this.$refs.cutterModalRef.title = 'åå
·è¯¦æ
' |
| | | this.$refs.cutterModalRef.disableSubmit = true |
| | | this.$refs.cutterModalRef.handleCutterEdit(record) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | switchFullscreen |
| | | :maskClosable="false" |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <DeviceCustomTypeModalForm ref="realForm" @ok="handleCancel"/> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import DeviceCustomTypeModalForm from './DeviceCustomTypeModalForm' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeModal', |
| | | components: { |
| | | DeviceCustomTypeModalForm |
| | | }, |
| | | data() { |
| | | return { |
| | | title: '', |
| | | width: 700, |
| | | visible: false |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | // ç¹å»æ·»å 设å¤ç±»æ°å¢å·¥åºæå·¥æ¥ä¸è®¾å¤ç±» |
| | | handleAddType(treeNodeInfo) { |
| | | this.visible = true |
| | | const { treeKey, type } = treeNodeInfo |
| | | console.log('treeNodeInfo', treeNodeInfo) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.realForm) { |
| | | this.$refs.realForm.add({ |
| | | attributionId: treeKey, |
| | | attributionType: type |
| | | }) |
| | | this.$refs.realForm.getWorkshopListByApi() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // ç¼è¾è®¾å¤ç±»ä¿¡æ¯ |
| | | handleTypeEdit(_, tableRowInfo) { |
| | | this.visible = true |
| | | this.$nextTick(() => { |
| | | if (this.$refs.realForm) { |
| | | this.$refs.realForm.getWorkshopListByApi() |
| | | this.$refs.realForm.handleProductionChange() |
| | | this.$refs.realForm.edit({ ...tableRowInfo }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleCancel() { |
| | | this.visible = false |
| | | }, |
| | | |
| | | handleOk() { |
| | | this.$refs.realForm.submitForm() |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle, treeNodeInfo, tableRowInfo }) { |
| | | console.log('触åå³é®èå') |
| | | if (this[methodName]) { |
| | | this.title = modalTitle |
| | | this[methodName](treeNodeInfo, tableRowInfo) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form-model ref="form" :model="model" :rules="validatorRules" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="车é´" prop="productionId"> |
| | | <a-select v-model="model.productionId" placeholder="è¯·éæ©è½¦é´" @change="handleProductionChange"> |
| | | <a-select-option v-for="item in workshopTreeData" :key="item.id"> |
| | | {{ item.productionName }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设å¤ç±»" prop="deviceManagementId"> |
| | | <a-select v-model="model.deviceManagementId" placeholder="è¯·éæ©è®¾å¤ç±»" :disabled="!model.productionId" |
| | | @change="handleCodeSelectChange"> |
| | | <a-select-option v-for="item in deviceCustomTypeList" :key="item.id"> |
| | | {{ item.deviceManagementCode }} |
| | | </a-select-option> |
| | | </a-select> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | |
| | | <a-row> |
| | | <a-col :span="12"> |
| | | <a-form-model-item label="设å¤ç±»åç§°"> |
| | | <a-input v-model="model.deviceManagementId_dictText" placeholder="è¯·éæ©è®¾å¤ç±»" readOnly/> |
| | | </a-form-model-item> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form-model> |
| | | </a-spin> |
| | | </template> |
| | | |
| | | <script> |
| | | import { httpAction } from '@/api/manage' |
| | | import dncApi from '@/api/dnc' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeModalForm', |
| | | components: {}, |
| | | data() { |
| | | return { |
| | | model: {}, |
| | | workshopTreeData: [], |
| | | deviceCustomTypeList: [], |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 6 } |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 17 } |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | productionId: [ |
| | | { required: true, message: 'è¯·éæ©è½¦é´!' } |
| | | ], |
| | | deviceManagementId: [ |
| | | { required: true, message: 'è¯·éæ©è®¾å¤ç±»!' } |
| | | ] |
| | | }, |
| | | url: { |
| | | add: '/nc/deviceType/add', |
| | | edit: '/nc/deviceType/edit' |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | }, |
| | | methods: { |
| | | // è°ç¨æ¥å£è·åæ¥è¯¢åºåè½¦é´æ å表 |
| | | getWorkshopListByApi() { |
| | | dncApi.getHasPermissionWorkshopTreeApi() |
| | | .then(res => { |
| | | if (res.success) this.workshopTreeData = res.result |
| | | }) |
| | | }, |
| | | |
| | | // 车é´éæ©æ¹å忏
空设å¤ç±»éæ©å¹¶éæ°è·å设å¤ç±»å表 |
| | | handleProductionChange() { |
| | | if (this.model.deviceManagementId) delete this.model.deviceManagementId |
| | | if (this.model.deviceManagementId_dictText) delete this.model.deviceManagementId_dictText |
| | | dncApi.getDeviceCustomTypeListByProductionIdApi(this.model.productionId) |
| | | .then(res => { |
| | | if (res.success) this.deviceCustomTypeList = res.result |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * 设å¤ç±»éæ©æ¹åå触åå¡«å
设å¤ç±»å¯¹åºè®¾å¤ç±»åç§° |
| | | * @param value |
| | | */ |
| | | handleCodeSelectChange(value) { |
| | | this.$set(this.model, 'deviceManagementId_dictText', this.deviceCustomTypeList.find(item => item.id === value).deviceManagementName) |
| | | }, |
| | | |
| | | add(params) { |
| | | this.edit({ ...this.modelDefault, ...params }) |
| | | }, |
| | | |
| | | edit(record) { |
| | | this.model = Object.assign({}, record) |
| | | }, |
| | | |
| | | submitForm() { |
| | | const that = this |
| | | // 触å表åéªè¯ |
| | | this.$refs.form.validate(valid => { |
| | | if (valid) { |
| | | that.confirmLoading = true |
| | | let httpUrl, method |
| | | if (!this.model.id) { |
| | | httpUrl = that.url.add |
| | | method = 'post' |
| | | } else { |
| | | httpUrl = that.url.edit |
| | | method = 'put' |
| | | } |
| | | httpAction(httpUrl, that.model, method) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.$bus.$emit('deviceCustomTypeAddSubmitSuccess') |
| | | that.$emit('ok') |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.confirmLoading = false |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div style="flex: 0.25;margin-right: 10px"> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" |
| | | :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="id" @change="handleTableChange"> |
| | | |
| | | </a-table> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import { deleteAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'DeviceCustomTypeTableList', |
| | | components: { DeviceCustomTypeModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | columns: [ |
| | | // { |
| | | // title: '车é´', |
| | | // dataIndex: 'productionId_dictText', |
| | | // align: 'center' |
| | | // }, |
| | | { |
| | | title: '设å¤ç±»', |
| | | dataIndex: 'deviceManagementCode_dictText', |
| | | align: 'center' |
| | | }, |
| | | { |
| | | title: '设å¤ç±»åç§°', |
| | | dataIndex: 'deviceManagementId_dictText', |
| | | align: 'center' |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedTypeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | url: { |
| | | list: '/nc/deviceType/getByBusinessId', |
| | | delete: '/nc/deviceType/delete' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | currentTreeNodeInfo: { |
| | | handler(value) { |
| | | this.currentClickedTypeInfo = {} |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.$bus.$on('deviceCustomTypeAddSubmitSuccess', this.loadData) |
| | | }, |
| | | methods: { |
| | | setQueryParamAndLoadData() { |
| | | console.log('currentLevelInfo', this.currentTreeNodeInfo) |
| | | const { id, type } = this.currentTreeNodeInfo |
| | | this.queryParam = Object.assign({}, { attributionId: id, attributionType: type }) |
| | | this.loadData() |
| | | }, |
| | | |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedTypeInfo = Object.assign({ param: 'deviceCustomType' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedTypeInfo) |
| | | }, |
| | | click: () => { |
| | | if (this.currentClickedTypeInfo.docId === record.docId) return |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | // this.$bus.$emit('sendCurrentClickedDocumentInfo', record) |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @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() |
| | | }, |
| | | |
| | | /** |
| | | * å é¤å·¥åºæå·¥æ¥å±çº§æ·»å ç设å¤ç±» |
| | | * @param tableRowInfo |
| | | */ |
| | | handleTypeDelete(tableRowInfo) { |
| | | const { id } = tableRowInfo |
| | | const { $confirm, url, loadData, $notification, $destroyAll } = this |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: '确认å 餿¤æ¡è®°å½åï¼', |
| | | okText: '确认', |
| | | okType: 'danger', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | if (!url.delete) { |
| | | this.$message.error('请设置url.delete屿§!') |
| | | return |
| | | } |
| | | |
| | | deleteAction(url.delete, { id: id }) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | loadData() |
| | | } else { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | $destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | $destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'deviceCustomType') this[methodName](tableRowInfo, modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <div style="flex: 1"> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" |
| | | :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> |
| | | |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="é¶ä»¶åç§°">{{currentLevelDetails.partsName}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="é¶ä»¶åç§°" :span="2">{{currentLevelDetails.partsName}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¶ä»¶ä»£å·">{{currentLevelDetails.partsCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="é¶ä»¶åå· ">{{currentLevelDetails.partsModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç©æç¼ç ">{{currentLevelDetails.materielCode}}</a-descriptions-item> |
| | |
| | | <a-descriptions-item label="ç产类å">{{currentLevelDetails.produceType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="ç»æç±»å ">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" :span="2">{{currentLevelDetails.partsWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé">{{currentLevelDetails.partsWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import dncApi from '@/api/dnc' |
| | | import DepartPermissionTransfer from './DepartPermissionTransfer' |
| | | import UserPermissionTransfer from './UserPermissionTransfer' |
| | | import { queryProductionTreeList } from '@/api/api' |
| | | import dncApi from '@/api/dnc' |
| | | import DepartPermissionTransfer from './DepartPermissionTransfer' |
| | | import UserPermissionTransfer from './UserPermissionTransfer' |
| | | |
| | | export default { |
| | | name: 'AssignPermissionModal', |
| | | components: { UserPermissionTransfer, DepartPermissionTransfer }, |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | title: '', |
| | | isAssignSonNode: true, |
| | | activeTabKey: 1, |
| | | allDepartmentsList: [], |
| | | allUsersList: [], |
| | | allTreeKeys: [], |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.activeTabKey = 1 |
| | | this.isAssignSonNode = true |
| | | this.getAllDepartmentsListByApi() |
| | | } |
| | | } |
| | | }, |
| | | activeTabKey: { |
| | | handler(value) { |
| | | if (this.hasLoadedDataTabKeyArray.includes(value)) return |
| | | if (value === 2) this.getAllUsersListByApi() |
| | | this.hasLoadedDataTabKeyArray.push(value) |
| | | export default { |
| | | name: 'AssignPermissionModal', |
| | | components: { UserPermissionTransfer, DepartPermissionTransfer }, |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | visible: false, |
| | | title: '', |
| | | isAssignSonNode: true, |
| | | activeTabKey: 1, |
| | | allDepartmentsList: [], |
| | | allUsersList: [], |
| | | allTreeKeys: [], |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.activeTabKey = 1 |
| | | this.isAssignSonNode = true |
| | | this.getAllDepartmentsListByApi() |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | activeTabKey: { |
| | | handler(value) { |
| | | if (this.hasLoadedDataTabKeyArray.includes(value)) return |
| | | if (value === 2) this.getAllUsersListByApi() |
| | | this.hasLoadedDataTabKeyArray.push(value) |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | // ç¹å»æ èç¹å³é®èåæéé
ç½®æé®å触å |
| | | handleAssignPermission() { |
| | | this.visible = true |
| | | }, |
| | | methods: { |
| | | // ç¹å»æ èç¹å³é®èåæéé
ç½®æé®å触å |
| | | handleAssignPermission() { |
| | | this.visible = true |
| | | }, |
| | | |
| | | // è°ç¨æ¥å£è·åææè½¦é´å表 |
| | | getAllDepartmentsListByApi() { |
| | | this.allTreeKeys = [] |
| | | queryProductionTreeList() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.allDepartmentsList = res.result |
| | | this.generateList(this.allDepartmentsList) |
| | | this.$nextTick(() => { |
| | | this.$refs.departPermissionTransferRef.getHasPermissionDepartByApi() |
| | | this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys |
| | | this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList))) |
| | | }) |
| | | // åªæä¸æ¬¡éåºæ¶å¨è½¦é´åé
tabç颿ä¼è¿å
¥æ¤å¤æ |
| | | // è¥ä¸æ¬¡éåºæ¶å¨ç¨æ·åé
tabçé¢å忬¡è¿å
¥æ¶keyç±2å为1æ¶ä¼è§¦åwatchçæµactiveTabKeyåååä¼å°key:1å å
¥hasLoadedDataTabKeyArrayï¼å æ¤æ é忬¡å å
¥key:1 |
| | | if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | const node = data[i] |
| | | const key = node.key |
| | | this.allTreeKeys.push(key) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | |
| | | // è°ç¨æ¥å£è·åææç¨æ·å表 |
| | | getAllUsersListByApi() { |
| | | dncApi.getAllUsersListApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.allUsersList = res.result.records |
| | | this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi()) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | setAdminDisabled() { |
| | | this.allUsersList = this.allUsersList.map(item => { |
| | | return { |
| | | ...item, |
| | | disabled: item.username === 'admin' |
| | | // è°ç¨æ¥å£è·åææè½¦é´å表 |
| | | getAllDepartmentsListByApi() { |
| | | this.allTreeKeys = [] |
| | | dncApi.getAllDepartmentsListApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.allDepartmentsList = res.result |
| | | this.generateList(this.allDepartmentsList) |
| | | this.$nextTick(() => { |
| | | this.$refs.departPermissionTransferRef.getHasPermissionDepartByApi() |
| | | this.$refs.departPermissionTransferRef.expandedKeys = this.allTreeKeys |
| | | this.$refs.departPermissionTransferRef.flatten(JSON.parse(JSON.stringify(this.allDepartmentsList))) |
| | | }) |
| | | // åªæä¸æ¬¡éåºæ¶å¨è½¦é´åé
tabç颿ä¼è¿å
¥æ¤å¤æ |
| | | // è¥ä¸æ¬¡éåºæ¶å¨ç¨æ·åé
tabçé¢å忬¡è¿å
¥æ¶keyç±2å为1æ¶ä¼è§¦åwatchçæµactiveTabKeyåååä¼å°key:1å å
¥hasLoadedDataTabKeyArrayï¼å æ¤æ é忬¡å å
¥key:1 |
| | | if (!this.hasLoadedDataTabKeyArray.includes(this.activeTabKey)) this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | handleModalClose() { |
| | | this.visible = false |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | }, |
| | | /** |
| | | * éå½è·å¾æææ èç¹key |
| | | * @param data |
| | | */ |
| | | generateList(data) { |
| | | for (let i = 0; i < data.length; i++) { |
| | | const node = data[i] |
| | | const key = node.key |
| | | this.allTreeKeys.push(key) |
| | | if (node.children) this.generateList(node.children) |
| | | } |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) { |
| | | this[methodName]() |
| | | this.title = modalTitle |
| | | // è°ç¨æ¥å£è·åææç¨æ·å表 |
| | | getAllUsersListByApi() { |
| | | dncApi.getAllUsersListApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.allUsersList = res.result.records |
| | | this.$nextTick(() => this.$refs.userPermissionTransferRef.getHasPermissionUserByApi()) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | setAdminDisabled() { |
| | | this.allUsersList = this.allUsersList.map(item => { |
| | | return { |
| | | ...item, |
| | | disabled: item.username === 'admin' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | handleModalClose() { |
| | | this.visible = false |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) { |
| | | this[methodName]() |
| | | this.title = modalTitle |
| | | } |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="å·¥åºåç§°">{{currentLevelDetails.processName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºå·">{{currentLevelDetails.processCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥èºç¼å· ">{{currentLevelDetails.craftNo}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="å·¥åºåç§°" :span="2">{{currentLevelDetails.processName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºå·" :span="2">{{currentLevelDetails.processCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥èºç¼å·" :span="2">{{currentLevelDetails.craftNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥åºç±»å">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤åå·">{{currentLevelDetails.processingEquipmentModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç±»å">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç¼å·">{{currentLevelDetails.processingEquipmentCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
ç¼å·">{{currentLevelDetails.assembleStep}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§° ">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§°">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | created() { |
| | | //å¤ä»½modelåå§å¼ |
| | | this.modelDefault = JSON.parse(JSON.stringify(this.model)) |
| | | this.$bus.$on('sendAllDeviceList', deviceList => this.deviceList = deviceList) |
| | | }, |
| | | methods: { |
| | | add(params) { |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="å·¥æ¥åç§°">{{currentLevelDetails.stepName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥æ¥å·">{{currentLevelDetails.stepCode}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥æ¥ç±»å">{{currentLevelDetails.stepType}}</a-descriptions-item> |
| | |
| | | <a-descriptions-item label="å 工设å¤ç±»å">{{currentLevelDetails.processingEquipmentOs}}</a-descriptions-item> |
| | | <a-descriptions-item label="å 工设å¤ç¼å·">{{currentLevelDetails.deviceNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
ç¼å·">{{currentLevelDetails.assembleStep}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§° " :span="2">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="3">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | <a-descriptions-item label="å·¥è£
åç§°">{{currentLevelDetails.assembleName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè¿°" :span="4">{{currentLevelDetails.description}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="åç§°">{{currentLevelDetails.productName}}</a-descriptions-item> |
| | | <a-descriptions bordered :size="size" :column="4"> |
| | | <a-descriptions-item label="åç§°" :span="2">{{currentLevelDetails.productName}}</a-descriptions-item> |
| | | <a-descriptions-item label="åå·">{{currentLevelDetails.productModel}}</a-descriptions-item> |
| | | <a-descriptions-item label="代ç ">{{currentLevelDetails.productNo}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createName}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´" :span="2">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateName}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´" :span="2">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建人">{{currentLevelDetails.createBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="å建æ¶é´">{{currentLevelDetails.createTime}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹äºº">{{currentLevelDetails.updateBy_dictText}}</a-descriptions-item> |
| | | <a-descriptions-item label="ä¿®æ¹æ¶é´">{{currentLevelDetails.updateTime}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | | |
| | |
| | | <template> |
| | | <div style="height: 100%;max-height: 748px"> |
| | | <!--产åç»ææ å³ä¾§é¡¶é¨åºå--> |
| | | <div style="height: 45%;overflow: hidden"> |
| | | <div style="height: 55%;overflow: hidden"> |
| | | <ProductStructureMainTop :size="tabContainerSize"/> |
| | | </div> |
| | | |
| | | <!--产åç»ææ å³ä¾§åºé¨åºå--> |
| | | <div style="height: 55%;overflow: hidden"> |
| | | <div style="height: 45%;overflow: hidden"> |
| | | <ProductStructureMainBottom :size="tabContainerSize"/> |
| | | </div> |
| | | </div> |
| | |
| | | <template> |
| | | <div v-if="currentLevelInfo.type!==4"> |
| | | <a-tabs v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0" @change="handleTabChange"> |
| | | <div v-if="+currentLevelInfo.type!==4" style="height: 100%"> |
| | | <a-tabs style="height: 100%" v-model="activeTabKey" v-if="Object.keys(currentLevelInfo).length>0" |
| | | @change="handleTabChange"> |
| | | <a-tab-pane :key="1" tab="屿§ä¿¡æ¯" v-if="+currentLevelInfo.type===1"> |
| | | <ProductInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | |
| | | <ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="2" tab="åå
·ä¿¡æ¯" v-if="+currentLevelInfo.type===5||+currentLevelInfo.type===6"> |
| | | <CutterInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | <!--ç³»ç»åæ°é
ç½®ä¸è¥åæ°ä¸º1æ¶æå±ç¤ºå¯¹åºå±çº§çåå
·å表--> |
| | | <a-tab-pane :key="2" tab="åå
·å表" |
| | | v-if="+currentLevelInfo.type===5&&isProcessHasCutterList||+currentLevelInfo.type===6&&isProcessStepHasCutterList"> |
| | | <CutterTableList ref="cutterTableListRef" :currentLevelInfo="currentLevelInfo" :size="containerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <template v-if="currentLevelInfo.hasOwnProperty('attributionType')"> |
| | |
| | | import ComponentInfo from './Component/ComponentInfo' |
| | | import PartInfo from './Part/PartInfo' |
| | | import ProcessInfo from './Process/ProcessInfo' |
| | | import ProcessStepInfo from './ProcessStep/ProcessStepInfo' |
| | | import CutterTableList from './Cutter/CutterTableList' |
| | | import DocumentInfo from '../../../common/DocumentInfo' |
| | | import DocumentVersionTableList from '../../../common/DocumentVersionTableList' |
| | | import UseDocumentEquipmentTableList from './Document/UseNcDocumentEquipmentTableList' |
| | | import ProcessStepInfo from './ProcessStep/ProcessStepInfo' |
| | | import FilePreview from '../../../common/FilePreview' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import CutterInfo from '@views/dnc/base/modules/ProductStructure/Cutter/CutterInfo.vue' |
| | | import dncApi from '@/api/dnc' |
| | | import { getAction } from '@/api/manage' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainBottom', |
| | | components: { |
| | | CutterInfo, |
| | | CutterTableList, |
| | | TableContextMenu, |
| | | FilePreview, |
| | | ProcessStepInfo, |
| | |
| | | return { |
| | | activeTabKey: 1, |
| | | containerSize: 'small', |
| | | isProcessHasCutterList: false, |
| | | isProcessStepHasCutterList: false, |
| | | currentLevelInfo: {}, |
| | | currentRightClickedTableRowInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | |
| | | this.$bus.$on('sendCurrentClickedDocumentInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('reloadMainBottomTableData', this.reloadMainBottomTableData) |
| | | this.getCutterListDisplayPermission('dnc_cutter_process', 'isProcessHasCutterList') |
| | | this.getCutterListDisplayPermission('dnc_cutter_step', 'isProcessStepHasCutterList') |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·ååå
·å表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | | * @param settingKey åå±çº§å±ç¤ºæékey |
| | | * @param dataProperty ç»ä»¶dataä¸ç屿§å¼ç¨æ¥æ§å¶æ¯å¦å±ç¤º |
| | | */ |
| | | getCutterListDisplayPermission(settingKey, dataProperty) { |
| | | getAction(`/system/sysParams/query/by/settingKey?settingKey=${settingKey}`).then(res => { |
| | | if (res.success) { |
| | | this[dataProperty] = res.result.settingValue === '1' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä»¥åè¡¨æ ¼ä¼ æ¥çå½åé䏿ç¹å»çé¡¹ä¿¡æ¯ |
| | | * @param levelInfo å½åå±çº§ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentLevelInfo(levelInfo) { |
| | | const { id, type } = levelInfo |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | console.log('res-------------', res) |
| | | this.currentLevelInfo = Object.assign(levelInfo, { entity: res.result[0] }) |
| | | } |
| | | }) |
| | | this.currentLevelInfo = levelInfo |
| | | this.activeTabKey = 1 |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey å½åæ¿æ´»çtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | switch (activeTabKey) { |
| | | case 2: |
| | | this.$nextTick(() => this.$refs.filePreviewRef.getFilePreviewByApi()) |
| | | if (this.currentLevelInfo.hasOwnProperty('attributionType')) { |
| | | console.log('ref', this.$refs.filePreviewRef) |
| | | this.$nextTick(() => this.$refs.filePreviewRef.getFilePreviewByApi()) |
| | | } else { |
| | | this.$nextTick(() => this.$refs.cutterTableListRef.setQueryParamAndLoadData(1)) |
| | | } |
| | | break |
| | | case 3: |
| | | this.$nextTick(() => this.$refs.documentVersionTableRef.loadData()) |
| | |
| | | } |
| | | |
| | | /deep/ .ant-tabs-tabpane { |
| | | overflow: auto; |
| | | overflow: hidden auto; |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div v-if="currentTreeNodeInfo.type!==4"> |
| | | <div v-if="+currentTreeNodeInfo.type!==4"> |
| | | <a-tabs v-model="activeTabKey" @contextmenu.native="e=>e.preventDefault()" @change="handleTabChange" |
| | | v-if="Object.keys(currentTreeNodeInfo).length!==0"> |
| | | <a-tab-pane :key="1" tab="NCææ¡£" v-if="currentTreeNodeInfo.type===5||currentTreeNodeInfo.type===6"> |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | <a-tab-pane :key="1" tab="NC管ç" v-if="+currentTreeNodeInfo.type===5||+currentTreeNodeInfo.type===6"> |
| | | <div style="display: flex;"> |
| | | <!--ç³»ç»åæ°é
ç½®ä¸è¥åæ°ä¸º1æ¶æå±ç¤ºå¯¹åºå±çº§ç设å¤ç±»å表--> |
| | | <DeviceCustomTypeTableList |
| | | v-if="+currentTreeNodeInfo.type===5&&isProcessHasDeviceTypeList||+currentTreeNodeInfo.type===6&&isProcessStepHasDeviceTypeList" |
| | | ref="deviceCustomTypeTableList" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </div> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="2" tab="å
¶ä»ææ¡£"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import dncApi from '@/api/dnc' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | import dncApi from '@/api/dnc' |
| | | import NcDocumentTableList from './Document/NcDocumentTableList' |
| | | import OtherDocumentTableList from './Document/OtherDocumentTableList' |
| | | import TableContextMenu from '../../../common/TableContextMenu' |
| | | import DocumentBatchDeleteModal from '../../../common/DocumentBatchDeleteModal' |
| | | import DeviceCustomTypeTableList |
| | | from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeTableList.vue' |
| | | import { getAction } from '@api/manage' |
| | | |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { DocumentBatchDeleteModal, TableContextMenu, OtherDocumentTableList, NcDocumentTableList }, |
| | | data() { |
| | | return { |
| | | activeTabKey: 2, |
| | | tableContainerSize: 'small', |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | | export default { |
| | | name: 'ProductStructureMainTop', |
| | | components: { |
| | | DeviceCustomTypeTableList, |
| | | DocumentBatchDeleteModal, |
| | | TableContextMenu, |
| | | OtherDocumentTableList, |
| | | NcDocumentTableList |
| | | }, |
| | | data() { |
| | | return { |
| | | activeTabKey: 2, |
| | | tableContainerSize: 'small', |
| | | isProcessHasDeviceTypeList: false, |
| | | isProcessStepHasDeviceTypeList: false, |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_step', 'isProcessStepHasDeviceTypeList') |
| | | }, |
| | | methods: { |
| | | /** |
| | | * è·å设å¤ç±»åå表å¨å·¥åºåå·¥æ¥å±çº§çå±ç¤ºæé |
| | | * @param settingKey åå±çº§å±ç¤ºæékey |
| | | * @param dataProperty ç»ä»¶dataä¸ç屿§å¼ç¨æ¥æ§å¶æ¯å¦å±ç¤º |
| | | */ |
| | | getDeviceTypeListDisplayPermission(settingKey, dataProperty) { |
| | | getAction(`/system/sysParams/query/by/settingKey?settingKey=${settingKey}`).then(res => { |
| | | if (res.success) { |
| | | this[dataProperty] = res.result.settingValue === '1' |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | console.log('treeNodeInfo', treeNodeInfo) |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶ |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | // æ¸
空ä¸ä¸èç¹å·²ç»å è½½è¿å¾ææ¡£å表tabKey |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | if (+treeNodeInfo.type === 5 || +treeNodeInfo.type === 6) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.deviceCustomTypeTableList) this.$refs.deviceCustomTypeTableList.setQueryParamAndLoadData() |
| | | else if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | } |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentRightClickedTableRowInfo = Object.assign({}, record) |
| | | console.log('currentRightClickedTableRowInfo', this.currentRightClickedTableRowInfo) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey 忢åçtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | // 黿¢æ¥å£å¨åä¸ææ¡£ä¸æ¬¡ç¹å»å
夿¬¡è§¦å |
| | | this.hasLoadedDataTabKeyArray.push(activeTabKey) |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åºæåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | if (docClassCode === 'NC') { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | | }, |
| | | methods: { |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | | */ |
| | | handleTableContextMenuOpen(record) { |
| | | this.currentRightClickedTableRowInfo = Object.assign({}, record) |
| | | console.log('currentRightClickedTableRowInfo', this.currentRightClickedTableRowInfo) |
| | | this.$refs.tableContextMenuRef.currentMenuLevel = record.param |
| | | this.$refs.tableContextMenuRef.menuStyle.top = event.clientY + 'px' |
| | | this.$refs.tableContextMenuRef.menuStyle.left = event.clientX + 'px' |
| | | this.$refs.tableContextMenuRef.menuVisible = true |
| | | document.body.addEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | /** |
| | | * æ¥æ¶æ ç»ä»¶ä¼ æ¥çå½åéä¸çæ èç¹ä¿¡æ¯ |
| | | * @param treeNodeInfo æ èç¹ä¿¡æ¯ |
| | | */ |
| | | receiveCurrentTreeNodeInfo(treeNodeInfo) { |
| | | // 仿 ç»ä»¶æ¥åæ èç¹ä¿¡æ¯åä»ç¶ç»ä»¶æµå
¥åç»ä»¶ |
| | | this.currentTreeNodeInfo = treeNodeInfo |
| | | // æ¸
空ä¸ä¸èç¹å·²ç»å è½½è¿å¾ææ¡£å表tabKey |
| | | this.hasLoadedDataTabKeyArray = [] |
| | | if (treeNodeInfo.type === 5 || treeNodeInfo.type === 6) { |
| | | this.activeTabKey = 1 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | this.activeTabKey = 2 |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | } |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | /** |
| | | * tabæ 忢æ¶è§¦å |
| | | * @param activeTabKey 忢åçtabKey |
| | | */ |
| | | handleTabChange(activeTabKey) { |
| | | if (!this.hasLoadedDataTabKeyArray.includes(activeTabKey)) { |
| | | this.$nextTick(() => { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | }) |
| | | // 黿¢æ¥å£å¨åä¸ææ¡£ä¸æ¬¡ç¹å»å
夿¬¡è§¦å |
| | | this.hasLoadedDataTabKeyArray.push(activeTabKey) |
| | | } |
| | | }, |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åºæåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | if (docClassCode === 'NC') { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | | }, |
| | | |
| | | // ä¸è½½å½åå³é®éä¸ææ¡£ |
| | | handleDownload() { |
| | | const that = this |
| | | const { docId, docName } = this.currentRightClickedTableRowInfo |
| | | dncApi.downloadDocumentApi({ docId, docName }) |
| | | .then(res => { |
| | | if (res && !res.success) { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | // ä¸è½½å½åå³é®éä¸ææ¡£ |
| | | handleDownload() { |
| | | const that = this |
| | | const { docId, docName } = this.currentRightClickedTableRowInfo |
| | | dncApi.downloadDocumentApi({ docId, docName }) |
| | | .then(res => { |
| | | if (res && !res.success) { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | }, |
| | | |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi(docId) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }, |
| | | |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | | */ |
| | | handleBatchRemove(modalTitle) { |
| | | if (!this.$refs.documentBatchDeleteModalRef) return |
| | | this.$refs.documentBatchDeleteModalRef.title = modalTitle |
| | | this.$refs.documentBatchDeleteModalRef.visible = true |
| | | }, |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi(docId) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | /** |
| | | * ç¹å»æ¹éå é¤ååºç°å¼¹çª |
| | | * @param modalTitle å¼¹çªæ é¢ |
| | | */ |
| | | handleBatchRemove(modalTitle) { |
| | | if (!this.$refs.documentBatchDeleteModalRef) return |
| | | this.$refs.documentBatchDeleteModalRef.title = modalTitle |
| | | this.$refs.documentBatchDeleteModalRef.visible = true |
| | | }, |
| | | |
| | | /** |
| | | * åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentOutboundApi({ docId, docName }) |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åæ¶åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | /** |
| | | * åæ¶åºåºå½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * åå¸å½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | /** |
| | | * åå¸å½åå³é®éä¸ææ¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * éæ°åå¸å½åå³é®éä¸ææ¡£å¹¶éæ°åå¸éåä¸ä¸ææ¡£çæ¬ |
| | | * @param menuLabel |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | /** |
| | | * éæ°åå¸å½åå³é®éä¸ææ¡£å¹¶éæ°åå¸éåä¸ä¸ææ¡£çæ¬ |
| | | * @param menuLabel |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * é彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | /** |
| | | * é彿¡£å½åå³é®éä¸ææ¡£ä¸åç»æ æ³ç»§ç»å叿彿¡£ |
| | | * @param menuLabel |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: err.message |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | }) |
| | | .finally(() => { |
| | | that.$destroyAll() |
| | | }) |
| | | }, |
| | | onCancel() { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ§å¶å³é®èåå
³é |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | }, |
| | | // æ§å¶å³é®èåå
³é |
| | | handleMenuClose() { |
| | | this.$refs.tableContextMenuRef.menuVisible = false |
| | | document.body.removeEventListener('click', this.handleMenuClose) |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) this[methodName](modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | /deep/ .ant-table-tbody .ant-table-row { |
| | | cursor: pointer; |
| | | } |
| | | </style> |
| | |
| | | <a-card class="tree_con" :loading="cardLoading" :bordered="false" @contextmenu.native="e=>e.preventDefault()"> |
| | | <a-spin :spinning="loading"> |
| | | <div style="display: flex;flex-direction: column;height: 100%"> |
| | | <div style="display: flex"> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <a-input placeholder="è¾å
¥å
³é®åè¿è¡æç´¢" allowClear v-model="searchInput" |
| | | @change="handleSearchInputChange"/> |
| | | <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="expandedKeys = allTreeKeys">å±å¼ææ</a-menu-item> |
| | | <a-menu-item key="2" @click="expandedKeys = ['-1']">åå¹¶ææ</a-menu-item> |
| | | <a-menu-item key="3" @click="getTreeDataByApi">å·æ°</a-menu-item> |
| | | </a-menu> |
| | | <a-button> |
| | | <a-icon type="bars"/> |
| | | </a-button> |
| | | </a-dropdown> |
| | | <a-button type="primary" v-has="'product_add'" |
| | | <a-tooltip title="å·æ°"> |
| | | <a-button icon="reload" @click="getTreeDataByApi" style="width: 18%;margin-left: 8px"></a-button> |
| | | </a-tooltip> |
| | | <a-button type="primary" v-has="'product_add'" icon="plus" style="margin-left: 8px" |
| | | @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'æ·»å 产å',methodName:'handleProductAdd'})"> |
| | | <a-icon type="plus"></a-icon> |
| | | 产å |
| | | æ·»å 产å |
| | | </a-button> |
| | | <!-- <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">--> |
| | | <!-- <a-menu slot="overlay">--> |
| | | <!-- <a-menu-item key="1" @click="expandedKeys = allTreeKeys">å±å¼ææ</a-menu-item>--> |
| | | <!-- <a-menu-item key="2" @click="expandedKeys = ['-1']">åå¹¶ææ</a-menu-item>--> |
| | | <!-- <a-menu-item key="3" @click="getTreeDataByApi">å·æ°</a-menu-item>--> |
| | | <!-- </a-menu>--> |
| | | <!-- <a-button>--> |
| | | <!-- <a-icon type="bars"/>--> |
| | | <!-- </a-button>--> |
| | | <!-- </a-dropdown>--> |
| | | </div> |
| | | |
| | | <!--产åç»ææ --> |
| | |
| | | <a-tree blockNode show-icon :expandedKeys.sync="expandedKeys" |
| | | :selectedKeys="selectedKeys" :treeData="treeDataSource" :autoExpandParent="autoExpandParent" |
| | | @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick"> |
| | | <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}"> |
| | | <template slot="title" slot-scope="{ label, parentId, key:treeKey,type}"> |
| | | <ProductStructureTreeContextMenu ref="contextMenuRef" |
| | | :treeParams="{label,treeKey,searchValue,type,entity}"/> |
| | | :treeParams="{label,treeKey,searchValue,type}"/> |
| | | </template> |
| | | |
| | | <a-icon slot="switcherIcon" type="down"/> |
| | |
| | | import ProcessModal from './Process/ProcessModal' |
| | | import ProcessStepModal from './ProcessStep/ProcessStepModal' |
| | | import AssignPermissionModal from './Permission/AssignPermissionModal' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | |
| | | export default { |
| | | name: 'ProductStructureTree', |
| | | components: { |
| | | DeviceCustomTypeModal, |
| | | AssignPermissionModal, |
| | | ProcessStepModal, |
| | | ProcessModal, |
| | |
| | | autoExpandParent: true, |
| | | checkStrictly: true, |
| | | allTreeKeys: [], |
| | | currentSelected: {}, |
| | | rightClickSelected: {}, |
| | | url: { |
| | | delete: '/nc/product/delete' |
| | |
| | | getTreeDataByApi() { |
| | | this.loading = true |
| | | this.cardLoading = true |
| | | this.treeDataSource = [] |
| | | dncApi.getProductStructureTreeApi() |
| | | .then(res => { |
| | | if (res.success) { |
| | | console.log('res=================', res) |
| | | this.dataList = [] |
| | | this.allTreeKeys = [] |
| | | this.treeDataSource = res.result |
| | |
| | | * @param {node} node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeSelect(selectedKeys, { node }) { |
| | | const that = this |
| | | let record = node.dataRef |
| | | this.currentSelected = Object.assign({}, record) |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', this.currentSelected) |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | let currentSelectedNodeInfo |
| | | if (res.result.length > 0) { |
| | | currentSelectedNodeInfo = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | currentSelectedNodeInfo = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | // åå³ä¾§ç¶çº§ç»ä»¶åéå½åé䏿 èç¹ä¿¡æ¯ |
| | | this.$bus.$emit('sendCurrentTreeNodeInfo', currentSelectedNodeInfo) |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | if (selectedKeys.length === 0) return |
| | | this.selectedKeys = selectedKeys |
| | | }, |
| | | |
| | | /** |
| | | * æ èç¹å³é®åå»èç¹æ¶è§¦å |
| | | * @param event äºä»¶å¯¹è±¡ |
| | | * @param node èç¹å¯¹è±¡ |
| | | */ |
| | | handleTreeRightClick({ event, node }) { |
| | | handleTreeRightClick({ node }) { |
| | | const that = this |
| | | const record = node.dataRef |
| | | this.rightClickSelected = Object.assign({}, record) |
| | | const { id, type } = record |
| | | dncApi.getProductStructureTreeNodeEntityApi({ id, type }) |
| | | .then(res => { |
| | | if (res.success) { |
| | | if (res.result.length > 0) { |
| | | that.rightClickSelected = Object.assign({}, record, { entity: res.result[0] }) |
| | | } else { |
| | | that.rightClickSelected = {} |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'ææ è¯¥èç¹è¯¦ç»ä¿¡æ¯' |
| | | }) |
| | | } |
| | | } else { |
| | | that.$notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | |
| | | // æ èç¹å³é®åå»èåä¸å 餿鮿¶è§¦å |
| | |
| | | this.autoExpandParent = false |
| | | }, |
| | | |
| | | /* è¾å
¥æ¥è¯¢å
容ååæ¶è§¦å */ |
| | | // è¾å
¥æ¥è¯¢å
容ååæ¶è§¦åï¼å¢å 鲿æºå¶ï¼ |
| | | handleSearchInputChange() { |
| | | const that = this |
| | | let timer |
| | | if (timer) clearTimeout(timer) |
| | | timer = setTimeout(function() { |
| | | that.searchAndExpandTreeNode() // å å°æ¬å·è°ç¨å½æ° |
| | | }, 1000) |
| | | }, |
| | | |
| | | // 鲿彿°ä¸è§¦åæç´¢å¹¶å±å¼æ èç¹ |
| | | searchAndExpandTreeNode() { |
| | | let search = this.searchInput |
| | | let expandedKeys |
| | | let autoExpandParent |
| | |
| | | expandedKeys = this.beforeSearchExpandedKeys |
| | | autoExpandParent = false |
| | | } |
| | | |
| | | Object.assign(this, { |
| | | expandedKeys, |
| | | searchValue: search, |
| | |
| | | * @param treeNode |
| | | */ |
| | | setTreeNodeIcon(treeNode) { |
| | | switch (treeNode.type) { |
| | | switch (+treeNode.type) { |
| | | case 1: |
| | | treeNode.slots = { icon: 'product' } |
| | | break |
| | |
| | | <template> |
| | | <a-dropdown :trigger="['contextmenu']"> |
| | | <span v-if="treeParams.label.indexOf(treeParams.searchValue) > -1">{{ treeParams.label.substr(0, treeParams.label.indexOf(treeParams.searchValue)) }}<span |
| | | class="replaceSearch">{{ treeParams.searchValue }}</span>{{ treeParams.label.substr(treeParams.label.indexOf(treeParams.searchValue) + treeParams.searchValue.length) }}</span> |
| | | <span v-if="treeParams.label.indexOf(treeParams.searchValue) > -1">{{ |
| | | treeParams.label.substr(0, treeParams.label.indexOf(treeParams.searchValue)) |
| | | }}<span |
| | | class="replaceSearch">{{ |
| | | treeParams.searchValue |
| | | }}</span>{{ |
| | | treeParams.label.substr(treeParams.label.indexOf(treeParams.searchValue) + treeParams.searchValue.length) |
| | | }}</span> |
| | | <span v-else>{{ treeParams.label }}</span> |
| | | <template #overlay> |
| | | <a-menu @click="({ key: menuKey }) => onContextMenuClick(treeParams.treeKey, menuKey)" |
| | | @contextmenu="event=>event.preventDefault()"> |
| | | <a-menu-item v-for="item in defaultContextMenuList[getCurrentMenuLevel]" :key="item.code" v-has="item.code"> |
| | | <a-icon :type="item.icon"/> |
| | | {{item.label}} |
| | | {{ item.label }} |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </template> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | name: 'ProductStructureTreeContextMenu', |
| | | components: {}, |
| | | props: { |
| | | treeParams: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | defaultContextMenuList: { |
| | | //产å |
| | | product: [ |
| | | { label: 'æ·»å 产å', code: 'product_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¨ä»¶', code: 'product_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾äº§åä¿¡æ¯', code: 'product_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'product_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'product_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'product_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¨ä»¶ |
| | | component: [ |
| | | { label: 'æ·»å åé¨ä»¶', code: 'component_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¶ä»¶', code: 'component_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'component_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¨ä»¶ä¿¡æ¯', code: 'component_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'component_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'component_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'component_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¶ä»¶ |
| | | part: [ |
| | | { label: 'æ·»å é¶ä»¶', code: 'parts_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | // { label: 'å建工åº', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¶ä»¶ä¿¡æ¯', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'parts_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'parts_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥èºè§ç¨çæ¬ |
| | | processSpecVersion: [ |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'version_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'version_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥èºè§ç¨çæ¬ä¿¡æ¯', code: 'version_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'version_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥åº |
| | | process: [ |
| | | { label: 'å建工åº', code: 'process_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工æ¥', code: 'process_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥åºä¿¡æ¯', code: 'process_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'process_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'process_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'process_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥æ¥ |
| | | processStep: [ |
| | | { label: 'å建工æ¥', code: 'processStep_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥æ¥ä¿¡æ¯', code: 'processStep_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'processStep_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'processStep_export', icon: 'import', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'processStep_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | getCurrentMenuLevel() { |
| | | switch (this.treeParams.type) { |
| | | case 1: |
| | | return 'product' |
| | | case 2: |
| | | return 'component' |
| | | case 3: |
| | | return 'part' |
| | | case 4: |
| | | return 'processSpecVersion' |
| | | case 5: |
| | | return 'process' |
| | | case 6: |
| | | return 'processStep' |
| | | } |
| | | }, |
| | | getCurrentDocClassCode() { |
| | | switch (this.treeParams.type) { |
| | | case 1: |
| | | return 'OTHER' |
| | | case 2: |
| | | return 'OTHER' |
| | | case 3: |
| | | return 'OTHER' |
| | | case 5: |
| | | return 'NC' |
| | | case 6: |
| | | return 'NC' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | onContextMenuClick(treeKey, menuKey) { |
| | | const level = this.getCurrentMenuLevel |
| | | const param = this.getCurrentDocClassCode |
| | | console.log('level---------------------', level) |
| | | console.log('param---------------------', param) |
| | | const treeNodeInfo = Object.assign({}, this.treeParams, { param }) |
| | | console.log('treeNodeInfo******************', treeNodeInfo) |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触å对åºç»ä»¶äºä»¶ |
| | | let methodName |
| | | // 夿æ¯å¦ä¸ºå
Œ
±æ¹æ³ï¼å¦æä¸ºå
Œ
±æ¹æ³åæªå䏿屿§product/component/part/processçåæ®µ |
| | | if (isCommonMethod) { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('') |
| | | } else { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | } |
| | | const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo }) |
| | | export default { |
| | | name: 'ProductStructureTreeContextMenu', |
| | | components: {}, |
| | | props: { |
| | | treeParams: { |
| | | type: Object |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | defaultContextMenuList: { |
| | | //产å |
| | | product: [ |
| | | { label: 'æ·»å 产å', code: 'product_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¨ä»¶', code: 'product_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾äº§åä¿¡æ¯', code: 'product_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'product_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'product_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'product_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¨ä»¶ |
| | | component: [ |
| | | { label: 'æ·»å åé¨ä»¶', code: 'component_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å é¶ä»¶', code: 'component_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'component_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¨ä»¶ä¿¡æ¯', code: 'component_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'component_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'component_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'component_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //é¶ä»¶ |
| | | part: [ |
| | | { label: 'æ·»å é¶ä»¶', code: 'parts_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | // { label: 'å建工åº', code: 'parts_add_relative', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾é¶ä»¶ä¿¡æ¯', code: 'parts_edit', icon: 'edit', isCommonMethod: false }, |
| | | // { label: 'å¯¼åºææ¡£', code: 'parts_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'parts_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'parts_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥èºè§ç¨çæ¬ |
| | | processSpecVersion: [ |
| | | { label: 'å建工èºè§ç¨çæ¬', code: 'version_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工åº', code: 'version_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥èºè§ç¨çæ¬ä¿¡æ¯', code: 'version_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'version_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥åº |
| | | process: [ |
| | | { label: 'å建工åº', code: 'process_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'å建工æ¥', code: 'process_add_child', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'æ·»å 设å¤ç±»', code: 'process_add_type', icon: 'plus', isCommonMethod: true }, |
| | | { label: 'ç¼è¾å·¥åºä¿¡æ¯', code: 'process_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'process_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'process_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'process_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | | //å·¥æ¥ |
| | | processStep: [ |
| | | { label: 'å建工æ¥', code: 'processStep_add', icon: 'plus', isCommonMethod: false }, |
| | | { label: 'ç¼è¾å·¥æ¥ä¿¡æ¯', code: 'processStep_edit', icon: 'edit', isCommonMethod: false }, |
| | | { label: 'æ·»å 设å¤ç±»', code: 'processStep_add_type', icon: 'plus', isCommonMethod: true }, |
| | | { label: 'å é¤', code: 'processStep_delete', icon: 'delete', isCommonMethod: true }, |
| | | // { label: '导åºNCç¨åº', code: 'processStep_export', icon: 'import', isCommonMethod: true }, |
| | | { label: '导å
¥NCç¨åº', code: 'processStep_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ] |
| | | } |
| | | } |
| | | }, |
| | | computed: { |
| | | getCurrentMenuLevel() { |
| | | switch (+this.treeParams.type) { |
| | | case 1: |
| | | return 'product' |
| | | case 2: |
| | | return 'component' |
| | | case 3: |
| | | return 'part' |
| | | case 4: |
| | | return 'processSpecVersion' |
| | | case 5: |
| | | return 'process' |
| | | case 6: |
| | | return 'processStep' |
| | | } |
| | | }, |
| | | getCurrentDocClassCode() { |
| | | switch (+this.treeParams.type) { |
| | | case 1: |
| | | return 'OTHER' |
| | | case 2: |
| | | return 'OTHER' |
| | | case 3: |
| | | return 'OTHER' |
| | | case 5: |
| | | return 'NC' |
| | | case 6: |
| | | return 'NC' |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | onContextMenuClick(treeKey, menuKey) { |
| | | const level = this.getCurrentMenuLevel |
| | | const param = this.getCurrentDocClassCode |
| | | console.log('level---------------------', level) |
| | | console.log('param---------------------', param) |
| | | const treeNodeInfo = Object.assign({}, this.treeParams, { param }) |
| | | console.log('treeNodeInfo******************', treeNodeInfo) |
| | | const menuKeyArray = menuKey.split('_') |
| | | const isCommonMethod = this.defaultContextMenuList[level].find(item => item.code === menuKey).isCommonMethod |
| | | // product_add => handleAdd 触å对åºç»ä»¶äºä»¶ |
| | | let methodName |
| | | // 夿æ¯å¦ä¸ºå
Œ
±æ¹æ³ï¼å¦æä¸ºå
Œ
±æ¹æ³åæªå䏿屿§product/component/part/processçåæ®µ |
| | | if (isCommonMethod) { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).slice(1).join('') |
| | | } else { |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | } |
| | | console.log('methodName', methodName) |
| | | const modalTitle = this.defaultContextMenuList[level].find(item => item.code === menuKey).label |
| | | this.$bus.$emit('treeMenuItemMethodTrigger', { methodName, modalTitle, treeNodeInfo }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | |
| | | </style> |
| | |
| | | }, |
| | | currentMenuLevel: '', |
| | | defaultContextMenuList: { |
| | | //设å¤ç±» |
| | | deviceCustomType:[ |
| | | { label: 'ç¼è¾è®¾å¤ç±»ä¿¡æ¯', code: 'type_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, |
| | | { label: 'å é¤', code: 'type_delete', subMenu: [], icon: 'delete', isCommonMethod: false }, |
| | | { label: '导å
¥NCç¨åº', code: 'type_document_import', subMenu: [], icon: 'import', isCommonMethod: true }, |
| | | ], |
| | | //NCææ¡£ |
| | | NC: [ |
| | | { label: 'ç¼è¾ææ¡£ä¿¡æ¯', code: 'document_edit', subMenu: [], icon: 'edit', isCommonMethod: false }, |
| | |
| | | validatorRules: { |
| | | username: [{ required: true, message: '请è¾å
¥ç¨æ·è´¦å·!' }, |
| | | { validator: this.validateUsername }], |
| | | password: [{ |
| | | required: true, |
| | | pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | message: 'å¯ç ç±8使°åã大å°å忝åç¹æ®ç¬¦å·ç»æ!' |
| | | }, |
| | | password: [ |
| | | // { |
| | | // required: true, |
| | | // pattern: /^(?=.*[a-zA-Z])(?=.*\d)(?=.*[~!@#$%^&*()_+`\-={}:";'<>?,./]).{8,}$/, |
| | | // message: 'å¯ç ç±8使°åã大å°å忝åç¹æ®ç¬¦å·ç»æ!' |
| | | // }, |
| | | { validator: this.validateToNextPassword, trigger: 'change' }], |
| | | confirmpassword: [{ required: true, message: 'è¯·éæ°è¾å
¥ç»å½å¯ç !' }, |
| | | { validator: this.compareToFirstPassword }], |