1、产品结构树以及设备结构树中的列表增加行选中样式
2、产品结构树实现点击设备类出现设备类下挂载的NC程序列表
3、产品结构树实现在设备类中导入NC程序功能
| | |
| | | |
| | | <template v-else> |
| | | <a-tabs> |
| | | <a-tab-pane :key="1" tab="车é´å±æ§"> |
| | | <a-tab-pane :key="1" tab="屿§"> |
| | | <WorkshopInfo :currentLevelDetails="currentTreeNodeInfo" :size="containerSize"/> |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | |
| | | |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | |
| | | |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | |
| | | <template> |
| | | <a-descriptions bordered :size="size"> |
| | | <a-descriptions-item label="车é´åç§°">{{currentLevelDetails.title}}</a-descriptions-item> |
| | | <a-descriptions-item label="åç§°">{{currentLevelDetails.title}}</a-descriptions-item> |
| | | <a-descriptions-item label="夿³¨">{{currentLevelDetails.memo}}</a-descriptions-item> |
| | | </a-descriptions> |
| | | </template> |
| | |
| | | this.$nextTick(() => { |
| | | if (this.$refs.realForm) { |
| | | this.$refs.realForm.getWorkshopListByApi() |
| | | this.$refs.realForm.handleProductionChange() |
| | | this.$refs.realForm.handleProductionChange(tableRowInfo.productionId) |
| | | this.$refs.realForm.edit({ ...tableRowInfo }) |
| | | } |
| | | }) |
| | |
| | | }, |
| | | |
| | | // 车é´éæ©æ¹å忏
空设å¤ç±»éæ©å¹¶éæ°è·å设å¤ç±»å表 |
| | | handleProductionChange() { |
| | | handleProductionChange(value) { |
| | | if (this.model.deviceManagementId) delete this.model.deviceManagementId |
| | | if (this.model.deviceManagementId_dictText) delete this.model.deviceManagementId_dictText |
| | | dncApi.getDeviceCustomTypeListByProductionIdApi(this.model.productionId) |
| | | dncApi.getDeviceCustomTypeListByProductionIdApi(value) |
| | | .then(res => { |
| | | if (res.success) this.deviceCustomTypeList = res.result |
| | | }) |
| | |
| | | <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"> |
| | | :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="id" @change="handleTableChange"> |
| | | |
| | | </a-table> |
| | | </div> |
| | |
| | | |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedTypeInfo.id === record.id ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedTypeInfo) |
| | | }, |
| | | click: () => { |
| | | if (this.currentClickedTypeInfo.docId === record.docId) return |
| | | if (this.currentClickedTypeInfo.id === record.id) return |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | // this.$bus.$emit('sendCurrentClickedDocumentInfo', record) |
| | | this.$bus.$emit('sendCurrentClickedTypeInfo', record) |
| | | } |
| | | } |
| | | } |
| | |
| | | <template> |
| | | <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"> |
| | | :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> |
| | | |
| | | </a-table> |
| | | |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DocumentModal from '../../../../common/DocumentModal' |
| | | import NcDocumentAssignModal from './NcDocumentAssignModal' |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import DocumentModal from '../../../../common/DocumentModal' |
| | | import NcDocumentAssignModal from './NcDocumentAssignModal' |
| | | |
| | | export default { |
| | | name: 'NcDocumentTableList', |
| | | components: { NcDocumentAssignModal, DocumentModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentTreeNodeInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | export default { |
| | | name: 'NcDocumentTableList', |
| | | components: { NcDocumentAssignModal, DocumentModal }, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentNCDocumentAttributionInfo: { |
| | | type: Object |
| | | }, |
| | | 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: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | width: 300, |
| | | sorter: true |
| | | }, |
| | | { title: '代ç çæ¬', dataIndex: 'docAlias', align: 'center' }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ç¶ æ', |
| | | dataIndex: 'docStatus_dictText', |
| | | key: 'docStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: '设计', value: 1 }, |
| | | { text: 'åå¸', value: 2 }, |
| | | { text: '彿¡£', value: 3 } |
| | | ] |
| | | }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center', width: 200 }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 200, |
| | | sorter: true |
| | | 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 |
| | | } |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedDocumentInfo: {}, |
| | | currentClickedDocumentInfo: {}, |
| | | url: { |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | currentTreeNodeInfo: { |
| | | handler(value) { |
| | | this.currentClickedDocumentInfo = {} |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | width: 300, |
| | | sorter: true |
| | | }, |
| | | { title: '代ç çæ¬', dataIndex: 'docAlias', align: 'center' }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ç¶ æ', |
| | | dataIndex: 'docStatus_dictText', |
| | | key: 'docStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: '设计', value: 1 }, |
| | | { text: 'åå¸', value: 2 }, |
| | | { text: '彿¡£', value: 3 } |
| | | ] |
| | | }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center', width: 200 }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 200, |
| | | sorter: true |
| | | } |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) this.ipagination.current = 1 |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | params.attributionId = this.currentTreeNodeInfo.id |
| | | params.attributionType = this.currentTreeNodeInfo.type |
| | | params.docClassCode = 'NC' |
| | | if (!params) return false |
| | | this.dataSource = [] |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | customRow(record) { |
| | | return { |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedDocumentInfo = Object.assign({ param: 'NC' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedDocumentInfo) |
| | | }, |
| | | click: () => { |
| | | if (this.currentClickedDocumentInfo.docId === record.docId) return |
| | | this.currentClickedDocumentInfo = 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() |
| | | }, |
| | | |
| | | handleDocumentEdit(record, modalTitle) { |
| | | if (!this.$refs.modalForm) return |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = modalTitle |
| | | }, |
| | | |
| | | handleDocumentAssign(record, modalTitle) { |
| | | if (!this.$refs.documentAssignModalRef) return |
| | | this.$refs.documentAssignModalRef.title = modalTitle |
| | | this.$refs.documentAssignModalRef.visible = true |
| | | }, |
| | | |
| | | handleDelete() { |
| | | // æ¤å¤å½æ°ä¸ºå±è½mixinsä¸çåå彿°ï¼éç¨å½æ°åå¨ç¶çº§ä¸ |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'NC') this[methodName](tableRowInfo, modalTitle) |
| | | ], |
| | | dataSource: [], |
| | | currentRightClickedDocumentInfo: {}, |
| | | currentClickedDocumentInfo: {}, |
| | | url: { |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | currentNCDocumentAttributionInfo: { |
| | | handler(value) { |
| | | this.currentClickedDocumentInfo = {} |
| | | }, |
| | | immediate: true |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | loadData(arg) { |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | console.log('currentNCDocumentAttributionInfo', this.currentNCDocumentAttributionInfo) |
| | | const { attributionId, attributionType, docClassCode } = this.currentNCDocumentAttributionInfo |
| | | //å è½½æ°æ® è¥ä¼ å
¥åæ°1åå 载第ä¸é¡µçå
容 |
| | | if (arg === 1) this.ipagination.current = 1 |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | params.attributionId = attributionId |
| | | params.attributionType = attributionType |
| | | params.docClassCode = docClassCode |
| | | if (!params) return false |
| | | this.dataSource = [] |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else { |
| | | this.$message.warning(res.message) |
| | | } |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | | this.currentRightClickedDocumentInfo = Object.assign({ param: 'NC' }, record) |
| | | this.$emit('handleTableContextMenuOpen', this.currentRightClickedDocumentInfo) |
| | | }, |
| | | click: () => { |
| | | if (this.currentClickedDocumentInfo.docId === record.docId) return |
| | | this.currentClickedDocumentInfo = 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() |
| | | }, |
| | | |
| | | handleDocumentEdit(record, modalTitle) { |
| | | if (!this.$refs.modalForm) return |
| | | this.$refs.modalForm.edit(record) |
| | | this.$refs.modalForm.title = modalTitle |
| | | }, |
| | | |
| | | handleDocumentAssign(record, modalTitle) { |
| | | if (!this.$refs.documentAssignModalRef) return |
| | | this.$refs.documentAssignModalRef.title = modalTitle |
| | | this.$refs.documentAssignModalRef.visible = true |
| | | }, |
| | | |
| | | handleDelete() { |
| | | // æ¤å¤å½æ°ä¸ºå±è½mixinsä¸çåå彿°ï¼éç¨å½æ°åå¨ç¶çº§ä¸ |
| | | }, |
| | | |
| | | triggerCorrespondingMethod({ methodName, level, modalTitle, tableRowInfo }) { |
| | | if (this[methodName] && tableRowInfo.param === 'NC') this[methodName](tableRowInfo, modalTitle) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped> |
| | |
| | | <template> |
| | | <div> |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" |
| | | :scroll="{y:189}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> |
| | | :scroll="{y:265}" :customRow="customRow" :size="size" rowKey="docId" @change="handleTableChange"> |
| | | |
| | | </a-table> |
| | | |
| | |
| | | |
| | | customRow(record) { |
| | | return { |
| | | style: { |
| | | backgroundColor: this.currentClickedDocumentInfo.docId === record.docId ? '#BAE7FF' : 'transparent' |
| | | }, |
| | | on: { |
| | | contextmenu: event => { |
| | | event.preventDefault() |
| | |
| | | <ProcessStepInfo :currentLevelDetails="currentLevelInfo.entity" :size="containerSize"/> |
| | | </a-tab-pane> |
| | | |
| | | <a-tab-pane :key="1" tab="设å¤å表" v-if="currentLevelInfo.hasOwnProperty('deviceManagementId')"> |
| | | <!-- <ProcessStepInfo :currentLevelDetails="currentLevelInfo" :size="containerSize"/>--> |
| | | 设å¤å表 |
| | | </a-tab-pane> |
| | | |
| | | <!--ç³»ç»åæ°é
ç½®ä¸è¥åæ°ä¸º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')"> |
| | | <template v-if="currentLevelInfo.hasOwnProperty('docId')"> |
| | | <a-tab-pane :key="1" tab="ææ¡£å±æ§"> |
| | | <DocumentInfo :currentLevelDetails="currentLevelInfo" :size="containerSize"/> |
| | | </a-tab-pane> |
| | |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentClickedDocumentInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentLevelInfo) |
| | | this.$bus.$on('reloadMainBottomTableData', this.reloadMainBottomTableData) |
| | | this.getCutterListDisplayPermission('dnc_cutter_process', 'isProcessHasCutterList') |
| | |
| | | ref="deviceCustomTypeTableList" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" :currentTreeNodeInfo="currentTreeNodeInfo" |
| | | <NcDocumentTableList ref="ncDocumentTableListRef" |
| | | :currentNCDocumentAttributionInfo="currentNCDocumentAttributionInfo" |
| | | @handleTableContextMenuOpen="handleTableContextMenuOpen" :size="tableContainerSize"/> |
| | | </div> |
| | | </a-tab-pane> |
| | |
| | | isProcessStepHasDeviceTypeList: false, |
| | | currentRightClickedTableRowInfo: {}, |
| | | currentTreeNodeInfo: {}, |
| | | currentClickedTypeInfo: {}, |
| | | currentNCDocumentAttributionInfo: {},//å½åNCææ¡£çæå±çº§å³ç¶çº§ç详ç»ä¿¡æ¯ï¼å¼å
¥è®¾å¤ç±»åNCæè½½è³è®¾å¤ç±»ä¸åä¹åæè½½å¨å·¥åºåå·¥æ¥ä¸ï¼ |
| | | hasLoadedDataTabKeyArray: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('sendCurrentTreeNodeInfo', this.receiveCurrentTreeNodeInfo) |
| | | this.$bus.$on('sendCurrentClickedTypeInfo', this.receiveCurrentClickedTypeInfo) |
| | | this.$bus.$on('reloadDocumentListData', this.reloadDocumentListData) |
| | | this.$bus.$on('tableMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | this.getDeviceTypeListDisplayPermission('dnc_device_type_process', 'isProcessHasDeviceTypeList') |
| | |
| | | this.hasLoadedDataTabKeyArray.push(this.activeTabKey) |
| | | }, |
| | | |
| | | receiveCurrentClickedTypeInfo(record) { |
| | | const { id, attributionType } = record |
| | | this.currentClickedTypeInfo = Object.assign({}, record) |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { |
| | | attributionId: id, |
| | | attributionType, |
| | | docClassCode: 'NC' |
| | | }) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * æ§å¶å³é®èåå¼å¯ |
| | | * @param record å½åè¡¨æ ¼è¡ä¿¡æ¯ |
| | |
| | | /** |
| | | * ææ¡£ä»¥åNCç¨åºå¯¼å
¥/åºåº/å
¥åºæåå触åéæ°å è½½ææ¡£å表 |
| | | * @param docClassCode ææ¡£ç±»å« |
| | | * @param attributionId èç¹Id |
| | | * @param attributionType ææ¡£ç¶çº§typeç±»å |
| | | * @param attributionId ææ¡£ç¶çº§Id |
| | | */ |
| | | reloadDocumentListData({ docClassCode, attributionId }) { |
| | | // 妿ä¸ä¼ çææ¡£ä¸æ¯æå±äºå½åæå±ç¤ºèç¹çææ¡£åä¸éæ°è·åææ¡£å表 |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | reloadDocumentListData({ docClassCode, attributionType, attributionId }) { |
| | | console.log('docClassCode, attributionType, attributionId', docClassCode, attributionType, attributionId) |
| | | // 卿¤å¤è®¾å¤NCææ¡£ç¶çº§åæ°æ¯å¯æ¤æ¹æ³æ¯ç»ææ 以å设å¤ç±»ä¸¤ç§ä¸å导å
¥æ¹å¼çå
±ååºå£ |
| | | this.currentNCDocumentAttributionInfo = Object.assign({}, { docClassCode, attributionId, attributionType }) |
| | | // è¥å¼å
¥è®¾å¤ç±»ååªéè¦å¤æå½ååºç°çææ¡£æå±æ¯å¦æ¯å½åå·¦é®éä¸çææ¡£ï¼è¥ä¸æ¯å½åéä¸çææ¡£åä¸å·æ°ææ¡£å表(é¿å
æ æå·æ°) |
| | | if (this.currentRightClickedTableRowInfo.hasOwnProperty('deviceManagementId')) { |
| | | if (this.currentClickedTypeInfo.id !== attributionId) return |
| | | } else { |
| | | if (this.currentTreeNodeInfo.id !== attributionId) return |
| | | } |
| | | if (docClassCode === 'NC') { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | this.$nextTick(() => { |
| | | if (this.$refs.ncDocumentTableListRef) this.$refs.ncDocumentTableListRef.loadData(1) |
| | | }) |
| | | } else { |
| | | if (this.$refs.otherDocumentTableListRef) this.$refs.otherDocumentTableListRef.loadData(1) |
| | | } |
| | |
| | | |
| | | // å é¤å½åå³é®éä¸ææ¡£ |
| | | handleDelete() { |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | const that = this |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | } else { |
| | | that.$notification.warning({ |
| | | message: 'æ¶æ¯', |
| | |
| | | */ |
| | | handlePull(menuLabel) { |
| | | const that = this |
| | | const { docId, docName, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, docName, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | |
| | | .then(res => { |
| | | console.log('res------------------', res) |
| | | if (res.success) { |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | that.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: `${menuLabel}æå` |
| | |
| | | */ |
| | | handleCancelPull(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | |
| | | dncApi.documentCancelOutboundApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | |
| | | */ |
| | | handlePublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | |
| | | dncApi.documentPublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | this.$bus.$emit('reloadMainBottomTableData', 'documentVersion') |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | |
| | | */ |
| | | handleRepublish(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `确认${menuLabel}åï¼`, |
| | |
| | | dncApi.documentRepublishApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | |
| | | */ |
| | | handlePigeonhole(menuLabel) { |
| | | const that = this |
| | | const { docId, param, attributionId } = this.currentRightClickedTableRowInfo |
| | | const { docId, param, attributionId, attributionType } = this.currentRightClickedTableRowInfo |
| | | that.$confirm({ |
| | | title: 'æç¤º', |
| | | content: `${menuLabel}åä¸å¯åæ¶ï¼ç¡®è®¤${menuLabel}åï¼`, |
| | |
| | | dncApi.documentPigeonholeApi(docId) |
| | | .then(res => { |
| | | if (res.success) { |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId }) |
| | | this.reloadDocumentListData({ docClassCode: param, attributionId, attributionType }) |
| | | that.$notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | |
| | | </a-tooltip> |
| | | <a-button type="primary" v-has="'product_add'" icon="plus" style="margin-left: 8px" |
| | | @click="$refs.productModalFormRef.triggerCorrespondingMethod({modalTitle:'æ·»å 产å',methodName:'handleProductAdd'})"> |
| | | æ·»å 产å |
| | | 产å |
| | | </a-button> |
| | | <!-- <a-dropdown :trigger="['click']" placement="bottomCenter" style="margin: 0 8px">--> |
| | | <!-- <a-menu slot="overlay">--> |
| | |
| | | <a-table :columns="columns" :data-source="dataSource" bordered :pagination="ipagination" :loading="loading" |
| | | :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" @change="handleTableChange" |
| | | :scroll="{y:380}" :size="size" rowKey="docId" style="min-height: 480px"> |
| | | <span slot="docName" slot-scope="text">{{text}}</span> |
| | | <span slot="docName" slot-scope="text">{{ text }}</span> |
| | | </a-table> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import dncApi from '@/api/dnc' |
| | | import { getAction } from '@/api/manage' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import dncApi from '@/api/dnc' |
| | | |
| | | export default { |
| | | name: 'DocumentBatchDeleteModal', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentDocumentInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | export default { |
| | | name: 'DocumentBatchDeleteModal', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentDocumentInfo: { |
| | | type: Object |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | visible: false, |
| | | title: '', |
| | | date: [], |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | width: 300, |
| | | sorter: true |
| | | }, |
| | | { title: '设å¤ç¼å·', dataIndex: 'docCode', align: 'center' }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ç¶ æ', |
| | | dataIndex: 'docStatus_dictText', |
| | | key: 'docStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: '设计', value: 1 }, |
| | | { text: 'åå¸', value: 2 }, |
| | | { text: '彿¡£', value: 3 } |
| | | ] |
| | | }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center', width: 200 }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 200, |
| | | sorter: true |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | visible: false, |
| | | title: '', |
| | | date: [], |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 65, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | ], |
| | | spinning: false, |
| | | url: { |
| | | list: '/nc/doc/find/page' |
| | | }, |
| | | { |
| | | title: 'æä»¶åç§°', |
| | | dataIndex: 'docName', |
| | | key: 'docName', |
| | | align: 'center', |
| | | width: 300, |
| | | sorter: true |
| | | }, |
| | | { title: '设å¤ç¼å·', dataIndex: 'docCode', align: 'center' }, |
| | | { |
| | | title: 'åºåºç¶æ', |
| | | dataIndex: 'pullStatus_dictText', |
| | | key: 'pullStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: 'æªåºåº', value: 1 }, |
| | | { text: 'å·²åºåº', value: 2 } |
| | | ] |
| | | }, |
| | | { |
| | | title: 'ç¶ æ', |
| | | dataIndex: 'docStatus_dictText', |
| | | key: 'docStatus', |
| | | align: 'center', |
| | | filters: [ |
| | | { text: '设计', value: 1 }, |
| | | { text: 'åå¸', value: 2 }, |
| | | { text: '彿¡£', value: 3 } |
| | | ] |
| | | }, |
| | | { title: 'ç³»ç»æå®çæ¬', dataIndex: 'publishVersion', align: 'center', width: 200 }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 200, |
| | | sorter: true |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.resetData() |
| | | this.loadData() |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // è·åå½åå·¥åºæå·¥æ¥å¯¹åºææ¡£å表 |
| | | loadData() { |
| | | this.dataSource = [] |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | if (!params) return false |
| | | const { attributionType, attributionId, param } = this.currentDocumentInfo |
| | | params.attributionType = attributionType |
| | | params.attributionId = attributionId |
| | | params.docClassCode = param |
| | | console.log('params', params) |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } |
| | | else this.$message.warning(res.message) |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | |
| | | // æ¶é´éæ©å¨éæ©å®æå触å |
| | | handleDateChange(value) { |
| | | this.queryParam.startTime = value[0] |
| | | this.queryParam.endTime = value[1] |
| | | }, |
| | | |
| | | // 确认æ¹éå é¤ææ¡£ |
| | | confirmBatchDeleteDocument() { |
| | | const that = this |
| | | const { selectedRowKeys, $notification, $confirm, currentDocumentInfo: { param, attributionId, attributionType } } = that |
| | | |
| | | if (selectedRowKeys.length === 0) { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©ææ¡£' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | let hasRequestedSuccessCount = 0 |
| | | let hasRequestedCount = 0 |
| | | let method |
| | | let queryParam |
| | | selectedRowKeys.forEach(key => { |
| | | if (attributionType !== 4) { |
| | | method = dncApi.deleteDocumentApi |
| | | queryParam = key |
| | | } else { |
| | | method = dncApi.deleteDeviceRelativeDocumentApi |
| | | queryParam = { docId: key, attributionId } |
| | | } |
| | | method(queryParam) |
| | | .then(res => { |
| | | if (res.success) { |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | hasRequestedSuccessCount++ |
| | | } else { |
| | | $notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | hasRequestedCount++ |
| | | if (hasRequestedCount === selectedRowKeys.length && hasRequestedSuccessCount > 0) { |
| | | this.loadData() |
| | | this.$emit('reloadDocumentListData', { docClassCode: param, attributionId }) |
| | | } |
| | | }) |
| | | }) |
| | | that.$destroyAll() |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | |
| | | |
| | | }, |
| | | |
| | | resetData() { |
| | | this.queryParam = {} |
| | | this.selectedRowKeys = [] |
| | | ], |
| | | spinning: false, |
| | | url: { |
| | | list: '/nc/doc/find/page' |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.resetData() |
| | | this.loadData() |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | | // è·åå½åå·¥åºæå·¥æ¥å¯¹åºææ¡£å表 |
| | | loadData() { |
| | | this.dataSource = [] |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | if (!params) return false |
| | | const { attributionType, attributionId, param } = this.currentDocumentInfo |
| | | params.attributionType = attributionType |
| | | params.attributionId = attributionId |
| | | params.docClassCode = param |
| | | console.log('params', params) |
| | | this.loading = true |
| | | getAction(this.url.list + `/${this.ipagination.current}/${this.ipagination.pageSize}`, params).then((res) => { |
| | | if (res.success) { |
| | | this.dataSource = res.result.records |
| | | if (res.result.total) { |
| | | this.ipagination.total = res.result.total |
| | | } else { |
| | | this.ipagination.total = 0 |
| | | } |
| | | } else this.$message.warning(res.message) |
| | | }).finally(() => { |
| | | this.loading = false |
| | | }) |
| | | }, |
| | | |
| | | /** |
| | | * è¡¨æ ¼å页ãæåºæ¹åãçéæ¶è§¦å |
| | | * @param pagination å页å¨é项 |
| | | * @param filters çéé项 |
| | | * @param sorter æåºé项 |
| | | */ |
| | | handleTableChange(pagination, filters, sorter) { |
| | | if (sorter.order) { |
| | | this.isorter.column = sorter.field |
| | | this.isorter.order = sorter.order === 'ascend' ? 'asc' : 'desc' |
| | | } else { |
| | | this.isorter.column = 'createTime' |
| | | this.isorter.order = 'desc' |
| | | } |
| | | for (let key in filters) { |
| | | this.filters[key] = filters[key].join(',') |
| | | } |
| | | this.ipagination = pagination |
| | | this.loadData() |
| | | }, |
| | | |
| | | // æ¶é´éæ©å¨éæ©å®æå触å |
| | | handleDateChange(value) { |
| | | this.queryParam.startTime = value[0] |
| | | this.queryParam.endTime = value[1] |
| | | }, |
| | | |
| | | // 确认æ¹éå é¤ææ¡£ |
| | | confirmBatchDeleteDocument() { |
| | | const that = this |
| | | const { |
| | | selectedRowKeys, |
| | | $notification, |
| | | $confirm, |
| | | currentDocumentInfo: { param, attributionId, attributionType } |
| | | } = that |
| | | |
| | | if (selectedRowKeys.length === 0) { |
| | | $notification.warning({ |
| | | message: 'æ¶æ¯', |
| | | description: 'è¯·éæ©ææ¡£' |
| | | }) |
| | | return |
| | | } |
| | | |
| | | $confirm({ |
| | | title: 'æç¤º', |
| | | content: `å é¤åä¸å¯åæ¶ï¼ç¡®è®¤å é¤åï¼`, |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | let hasRequestedSuccessCount = 0 |
| | | let hasRequestedCount = 0 |
| | | let method |
| | | let queryParam |
| | | selectedRowKeys.forEach(key => { |
| | | if (attributionType !== 4) { |
| | | method = dncApi.deleteDocumentApi |
| | | queryParam = key |
| | | } else { |
| | | method = dncApi.deleteDeviceRelativeDocumentApi |
| | | queryParam = { docId: key, attributionId } |
| | | } |
| | | method(queryParam) |
| | | .then(res => { |
| | | if (res.success) { |
| | | $notification.success({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | hasRequestedSuccessCount++ |
| | | } else { |
| | | $notification.error({ |
| | | message: 'æ¶æ¯', |
| | | description: res.message |
| | | }) |
| | | } |
| | | }) |
| | | .finally(() => { |
| | | hasRequestedCount++ |
| | | if (hasRequestedCount === selectedRowKeys.length && hasRequestedSuccessCount > 0) { |
| | | this.loadData() |
| | | this.$emit('reloadDocumentListData', { docClassCode: param, attributionId, attributionType }) |
| | | } |
| | | }) |
| | | }) |
| | | that.$destroyAll() |
| | | }, |
| | | onCancel: () => { |
| | | that.$destroyAll() |
| | | } |
| | | }) |
| | | |
| | | |
| | | }, |
| | | |
| | | resetData() { |
| | | this.queryParam = {} |
| | | this.selectedRowKeys = [] |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | attributionType = treeNodeInfo.type |
| | | docClassCode = treeNodeInfo.param |
| | | } else { |
| | | attributionId = tableRowInfo.attributionId |
| | | // è¥å·¥åºåå·¥æ¥å±çº§ä¸æè®¾å¤ç±»æ¶å导å
¥NCçåæ°éè¦è°æ´ |
| | | attributionId = tableRowInfo.param==='deviceCustomType'?tableRowInfo.id:tableRowInfo.attributionId |
| | | attributionType = tableRowInfo.attributionType |
| | | docClassCode = tableRowInfo.param |
| | | docClassCode = tableRowInfo.param==='deviceCustomType'?'NC':tableRowInfo.param |
| | | } |
| | | this.setModalTitle(modalTitle, docClassCode) |
| | | this.uploadParams = Object.assign({}, { attributionId, attributionType, docClassCode }) |
| | |
| | | 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 }, |
| | | { label: '导å
¥NCç¨åº', code: 'type_import', subMenu: [], icon: 'import', isCommonMethod: true }, |
| | | ], |
| | | //NCææ¡£ |
| | | NC: [ |
| | |
| | | methodName = 'handle' + menuKeyArray.map(item => item[0].toUpperCase() + item.slice(1)).join('') |
| | | } |
| | | console.log('tableRowInfo---------------------------------------', this.tableRowInfo) |
| | | console.log('methodName---------------------------------------', methodName) |
| | | this.$bus.$emit('tableMenuItemMethodTrigger', { |
| | | methodName, |
| | | modalTitle, |