产品结构树引用(借用)部件前端页面
修改原有删除文档接口
| | |
| | | // ä¸è½½ææ¡£ |
| | | downloadDocumentApi: ({ docId, docName }) => requestGetDownLoad(`/nc/doc/download/${docId}`, docName), |
| | | // å é¤ææ¡£ |
| | | deleteDocumentApi: docId => deleteAction(`/nc/doc/delete?id=${docId}`), |
| | | deleteDocumentApi: ({ docId,attributionType, attributionId}) => deleteAction(`/nc/doc/delete/${docId}/${attributionType}/${attributionId}`), |
| | | // ææ¡£åºåº |
| | | documentOutboundApi: ({ docId, docName }) => requestGetDownLoad(`/nc/doc/pull/${docId}`, docName), |
| | | // ææ¡£åæ¶åºåº |
| | |
| | | <a-descriptions-item label="å¤çç±»å ">{{currentLevelDetails.processType}}</a-descriptions-item> |
| | | <a-descriptions-item label="æè´¨">{{currentLevelDetails.structureType}}</a-descriptions-item> |
| | | <a-descriptions-item label="éé" >{{currentLevelDetails.componentWeight}}</a-descriptions-item> |
| | | <a-descriptions-item label="å¼ç¨é¨ä»¶" >{{currentLevelDetails.borrowId>0?'æ¯':'å¦'}}</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> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | Description: å¼ç¨é¨ä»¶List |
| | | Author: ä½è
liuyh |
| | | Date: 2025-02-27 |
| | | --> |
| | | <template> |
| | | <a-modal width="75%" :title="title" :visible="visible" @cancel="visible=false" :maskClosable="false" centered |
| | | @ok="confirmBatchDeleteDocument"> |
| | | <div style="width: 100%"> |
| | | <a-tabs> |
| | | <a-tab-pane tab="å¯å¼ç¨é¨ä»¶å表"> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="é¨ä»¶åç§°"> |
| | | <a-input placeholder="请è¾å
¥é¨ä»¶åç§°" v-model="queryParam.componentName" allow-clear></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="é¨ä»¶ä»£å·"> |
| | | <a-input placeholder="请è¾å
¥é¨ä»¶ä»£å·" v-model="queryParam.componentCode" allow-clear></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="é¨ä»¶åå·"> |
| | | <a-input placeholder="请è¾å
¥é¨ä»¶åå·" v-model="queryParam.componentModel" allow-clear></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="è§æ ¼"> |
| | | <a-input placeholder="请è¾å
¥è§æ ¼" v-model="queryParam.componentScale" allow-clear></a-input> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :md="7" :sm="7"> |
| | | <a-form-item label="æè´¨"> |
| | | <a-input placeholder="请è¾å
¥æè´¨" v-model="queryParam.structureType" allow-clear></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> |
| | | |
| | | <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="componentId" style="min-height: 480px"> |
| | | <span slot="docName" slot-scope="text">{{ text }}</span> |
| | | </a-table> |
| | | |
| | | </a-tab-pane> |
| | | </a-tabs> |
| | | </div> |
| | | </a-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | import { deleteAction, getAction } from '@/api/manage' |
| | | import dncApi from '@/api/dnc' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | |
| | | export default { |
| | | name: 'NcComponentBorrowModal', |
| | | components: {}, |
| | | mixins: [JeecgListMixin], |
| | | props: { |
| | | currentBorrowInfo: { |
| | | type: Object |
| | | }, |
| | | size: { |
| | | type: String |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | disableMixinCreated: true, |
| | | visible: false, |
| | | title: '', |
| | | columns: [ |
| | | { |
| | | title: 'åºå·', |
| | | dataIndex: 'rowIndex', |
| | | key: 'rowIndex', |
| | | width: 50, |
| | | align: 'center', |
| | | customRender: function(t, r, index) { |
| | | return parseInt(index) + 1 |
| | | } |
| | | }, |
| | | { |
| | | title: 'é¨ä»¶åç§°', |
| | | dataIndex: 'componentName', |
| | | align: 'center', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'é¨ä»¶ä»£å·', |
| | | dataIndex: 'componentCode', |
| | | align: 'center', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'é¨ä»¶åå·', |
| | | dataIndex: 'componentModel', |
| | | align: 'center', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'ç©æç¼ç ', |
| | | dataIndex: 'materielCode', |
| | | align: 'center', |
| | | width: 100, |
| | | }, |
| | | { |
| | | title: 'è§æ ¼', |
| | | dataIndex: 'componentScale', |
| | | align: 'center', |
| | | width: 60, |
| | | }, |
| | | { |
| | | title: 'ææ', |
| | | dataIndex: 'structureType', |
| | | align: 'center', |
| | | width: 60, |
| | | }, |
| | | { |
| | | title: 'å建æ¶é´', |
| | | dataIndex: 'createTime', |
| | | align: 'center', |
| | | width: 150, |
| | | }, |
| | | { |
| | | title: 'å建人', |
| | | dataIndex: 'createBy_dictText', |
| | | align: 'center', |
| | | width: 100, |
| | | } |
| | | ], |
| | | searchValue: '', |
| | | searchInput: '', |
| | | spinning: false, |
| | | allTreeKeys: [], |
| | | checkedKeys: [], |
| | | expandedKeys: [], |
| | | autoExpandParent: true, |
| | | isExpandAllTreeNode: true, |
| | | date: [], |
| | | url: { |
| | | list: '/nc/component/getByComponentId', |
| | | borrow: '/nc/component/borrow', |
| | | } |
| | | } |
| | | }, |
| | | watch: { |
| | | visible: { |
| | | handler(value) { |
| | | if (value) { |
| | | this.resetData() |
| | | this.loadData() |
| | | } |
| | | } |
| | | }, |
| | | isExpandAllTreeNode: { |
| | | handler(value) { |
| | | if (value) this.expandedKeys = this.allTreeKeys |
| | | else this.expandedKeys = [] |
| | | } |
| | | } |
| | | }, |
| | | created() { |
| | | this.$bus.$on('treeMenuItemMethodTrigger', this.triggerCorrespondingMethod) |
| | | }, |
| | | methods: { |
| | | handleComponentBorrow() { |
| | | if (this.currentBorrowInfo.entity.borrowId){ |
| | | this.$message.warning('该é¨ä»¶ä¸ºå¼ç¨é¨ä»¶ï¼æ æ³å¼ç¨') |
| | | this.visible=false |
| | | }else { |
| | | this.visible = true |
| | | } |
| | | }, |
| | | // è·åå½åå¯å¼ç¨é¨ä»¶ |
| | | loadData() { |
| | | this.dataSource = [] |
| | | if (!this.url.list) { |
| | | this.$message.error('请设置url.list屿§!') |
| | | return |
| | | } |
| | | var params = this.getQueryParams()//æ¥è¯¢æ¡ä»¶ |
| | | if (!params) return false |
| | | params.componentId = this.currentBorrowInfo.key |
| | | this.loading = true |
| | | getAction(this.url.list, 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.loadData() |
| | | }, |
| | | |
| | | resetData() { |
| | | this.searchInput = '' |
| | | this.expandedKeys = [] |
| | | this.selectedRowKeys = [] |
| | | this.selectionRows = {} |
| | | this.checkedKeys = [] |
| | | this.filters = {} |
| | | this.isorter = Object.assign({}, this.defaultSorter) |
| | | }, |
| | | triggerCorrespondingMethod({ methodName, modalTitle }) { |
| | | if (this[methodName]) { |
| | | this[methodName]() |
| | | this.title = modalTitle |
| | | } |
| | | }, |
| | | // 确认æ¹éå é¤ææ¡£ |
| | | confirmBatchDeleteDocument() { |
| | | |
| | | if (this.selectedRowKeys.length <= 0) { |
| | | // this.$message.warning('è¯·éæ©ä¸æ¡è®°å½ï¼'); |
| | | this.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:"è¯·éæ©ä¸ä¸ªé¨ä»¶" |
| | | }); |
| | | return; |
| | | } else { |
| | | var ids = ""; |
| | | for (var a = 0; a < this.selectedRowKeys.length; a++) { |
| | | ids += this.selectedRowKeys[a] + ","; |
| | | } |
| | | var that = this; |
| | | this.$confirm({ |
| | | title: "确认å¼ç¨", |
| | | content: "æ¯å¦å¼ç¨é䏿°æ®?", |
| | | onOk: function () { |
| | | that.loading = true; |
| | | var queryParam = { |
| | | newIds: ids, |
| | | oldId: that.currentBorrowInfo.key |
| | | } |
| | | getAction(that.url.borrow,queryParam).then((res) => { |
| | | if (res.success) { |
| | | //éæ°è®¡ç®å页é®é¢ |
| | | that.reCalculatePage(that.selectedRowKeys.length) |
| | | // that.$message.success(res.message); |
| | | that.$notification.success({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | that.loadData(); |
| | | that.onClearSelected(); |
| | | that.$emit('submitSuccess') |
| | | } else { |
| | | // that.$message.warning(res.message); |
| | | that.$notification.warning({ |
| | | message:'æ¶æ¯', |
| | | description:res.message |
| | | }); |
| | | } |
| | | }).finally(() => { |
| | | that.loading = false; |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style scoped lang="less"> |
| | | /deep/ .ant-modal { |
| | | .tabs-container { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .replaceSearch { |
| | | color: #40a9ff; |
| | | font-weight: bold; |
| | | background-color: rgb(204, 204, 204); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | ::-webkit-scrollbar { |
| | | width: 8px; |
| | | } |
| | | </style> |
| | |
| | | <!-- |
| | | Description: æ£ç´¢çµåæ ·æ¿List |
| | | Author: ä½è
liuyh |
| | | Date: 2025-02-27 |
| | | --> |
| | | <template> |
| | | <a-modal width="75%" :title="title" :visible="visible" @cancel="visible=false" :maskClosable="false" centered |
| | | @ok="handleAssignDocumentToDevice"> |
| | |
| | | okText: '确认', |
| | | cancelText: 'åæ¶', |
| | | onOk: () => { |
| | | dncApi.deleteDocumentApi(docId) |
| | | dncApi.deleteDocumentApi({docId,attributionType,attributionId}) |
| | | .then((res) => { |
| | | if (res.success) { |
| | | that.$notification.success({ |
| | |
| | | <div style="display: flex;flex-direction: column;height: 100%"> |
| | | <div style="display: flex;justify-content: space-between"> |
| | | <a-input placeholder="è¾å
¥å
³é®åè¿è¡æç´¢" allowClear v-model="searchInput" |
| | | @change="handleSearchInputChange"/> |
| | | @change="handleSearchInputChange" /> |
| | | <!-- <a-tooltip title="å·æ°">--> |
| | | <!-- <a-button icon="reload" @click="handleTreeReload" style="width: 18%;margin-left: 8px"></a-button>--> |
| | | <!-- </a-tooltip>--> |
| | |
| | | @select="handleTreeSelect" @expand="handleTreeExpand" @rightClick="handleTreeRightClick"> |
| | | <template slot="title" slot-scope="{ label, parentId, key:treeKey,type}"> |
| | | <ProductStructureTreeContextMenu ref="contextMenuRef" |
| | | :treeParams="{label,treeKey,searchValue,type}"/> |
| | | :treeParams="{label,treeKey,searchValue,type}" /> |
| | | </template> |
| | | |
| | | <a-icon slot="switcherIcon" type="down"/> |
| | | <a-icon slot="product" type="shopping"/> |
| | | <a-icon slot="component" type="camera"/> |
| | | <a-icon slot="part" type="hdd"/> |
| | | <a-icon slot="processSpecVersion" type="tag"/> |
| | | <a-icon slot="process" type="apartment"/> |
| | | <a-icon slot="processStep" type="tool"/> |
| | | <a-icon slot="switcherIcon" type="down" /> |
| | | <a-icon slot="product" type="shopping" /> |
| | | <a-icon slot="component" type="camera" /> |
| | | <a-icon slot="part" type="hdd" /> |
| | | <a-icon slot="processSpecVersion" type="tag" /> |
| | | <a-icon slot="process" type="apartment" /> |
| | | <a-icon slot="processStep" type="tool" /> |
| | | </a-tree> |
| | | </div> |
| | | </div> |
| | |
| | | |
| | | <!--产åå¼¹çª--> |
| | | <ProductModal ref="productModalFormRef" :currentTreeNodeInfo="rightClickSelected" |
| | | @submitSuccess="getTreeDataByApi"/> |
| | | @submitSuccess="getTreeDataByApi" /> |
| | | <!--é¨ä»¶å¼¹çª--> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <ComponentModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--é¶ä»¶å¼¹çª--> |
| | | <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <PartModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--å·¥èºè§ç¨çæ¬å¼¹çª--> |
| | | <ProcessSpecVersionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <ProcessSpecVersionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--å·¥åºå¼¹çª--> |
| | | <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <ProcessModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--å·¥æ¥å¼¹çª--> |
| | | <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <ProcessStepModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--æéé
置弹çª--> |
| | | <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <AssignPermissionModal :currentTreeNodeInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--æ£ç´¢çµå模æ¿å¼¹çª--> |
| | | <NcDocumentSearchModal :currentDocumentInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess"/> |
| | | <NcDocumentSearchModal :currentDocumentInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--å¼ç¨é¨ä»¶--> |
| | | <NcComponentBorrowModal :currentBorrowInfo="rightClickSelected" @submitSuccess="modalFormSubmitSuccess" /> |
| | | <!--产åç»ææ åºæ¬å³é®èå(空ç½å¤è§¦å)--> |
| | | <ProductStructureBaseContextMenu ref="baseContextmenuRef"/> |
| | | <ProductStructureBaseContextMenu ref="baseContextmenuRef" /> |
| | | </a-card> |
| | | </template> |
| | | |
| | |
| | | import ProcessStepModal from './ProcessStep/ProcessStepModal' |
| | | import AssignPermissionModal from './Permission/AssignPermissionModal' |
| | | import DeviceCustomTypeModal from '@views/dnc/base/modules/ProductStructure/DeviceCustomType/DeviceCustomTypeModal.vue' |
| | | import ProductStructureBaseContextMenu from '@views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue' |
| | | import ProductStructureBaseContextMenu |
| | | from '@views/dnc/base/modules/ProductStructure/ProductStructureBaseContextMenu.vue' |
| | | import NcDocumentSearchModal from '@views/dnc/base/modules/ProductStructure/Document/NcDocumentSearchModal.vue' |
| | | import NcComponentBorrowModal from '@views/dnc/base/modules/ProductStructure/Document/NcComponentBorrowModal.vue' |
| | | |
| | | export default { |
| | | name: 'ProductStructureTree', |
| | |
| | | ComponentModal, |
| | | ProductModal, |
| | | ProductStructureTreeContextMenu, |
| | | NcDocumentSearchModal |
| | | NcDocumentSearchModal, |
| | | NcComponentBorrowModal |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | // { label: 'å¯¼åºææ¡£', code: 'component_export', icon: 'export', isCommonMethod: true }, |
| | | { label: '导å
¥å
¶ä»ææ¡£', code: 'component_import', icon: 'import', isCommonMethod: true }, |
| | | { label: 'æ£ç´¢çµåæ ·æ¿', code: 'component_search', icon: 'search', isCommonMethod: true }, |
| | | { label: 'å¼ç¨é¨ä»¶',code: 'component_borrow',icon: 'plus',isCommonMethod: false}, |
| | | { label: 'å é¤', code: 'component_delete', icon: 'delete', isCommonMethod: true }, |
| | | { label: 'æéé
ç½®', code: 'public_assign_permission', icon: 'idcard', isCommonMethod: true } |
| | | ], |
| | |
| | | selectedRowKeys.forEach(key => { |
| | | if (attributionType !== 4) { |
| | | method = dncApi.deleteDocumentApi |
| | | queryParam = key |
| | | queryParam = { docId: key,attrType:attributionType,attrId:attributionId } |
| | | } else { |
| | | method = dncApi.deleteDeviceRelativeDocumentApi |
| | | queryParam = { docId: key, attributionId } |