From 7713e63365e74047c08f3416b5a95108fdee7002 Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期一, 20 一月 2025 10:53:02 +0800 Subject: [PATCH] 产品结构树: 1、工序和工步层级新增加工设备型号和加工设备类型字段 2、各层级详细信息调整创建人及修改人字段 3、指派到设备窗口布局完成100% --- src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue | 943 +++++++++++++--------------------------------------------- 1 files changed, 223 insertions(+), 720 deletions(-) diff --git a/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue b/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue index 01a4e69..f00bfda 100644 --- a/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue +++ b/src/views/dnc/base/modules/ProductStructure/Document/NcDocumentAssignModal.vue @@ -1,5 +1,6 @@ <template> - <a-modal width="75%" :title="title" :visible="visible" @cancel="visible=false" :maskClosable="false" centered> + <a-modal width="75%" :title="title" :visible="visible" @cancel="visible=false" :maskClosable="false" centered + @ok="handleAssignDocumentToDevice"> <div class="tabs-container"> <div style="width: 72%"> <a-tabs> @@ -27,8 +28,9 @@ </div> - <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" - :scroll="{y:440}" :size="size" rowKey="docId"> + <a-table :columns="columns" :data-source="dataSource" bordered :pagination="false" :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + :scroll="{y:456}" :size="size" rowKey="docId"> </a-table> </a-tab-pane> @@ -38,7 +40,44 @@ <div style="width: 25%"> <a-tabs> <a-tab-pane tab="璁惧鍒楄〃"> + <a-spin :spinning="spinning"> + <div style="display: flex;flex-direction: column;"> + <div style="display: flex"> + <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 = []">鍚堝苟鎵�鏈�</a-menu-item> + </a-menu> + <a-button> + <a-icon type="bars"/> + </a-button> + </a-dropdown> + </div> + <!--浜у搧缁撴瀯鏍�--> + <div style="overflow:auto;margin-top: 10px;height: 400px"> + <a-tree ref="tree" checkable :checkedKeys="checkedKeys" :expandedKeys.sync="expandedKeys" + :autoExpandParent="autoExpandParent" + :treeData="treeDataSource" @check="handleTreeNodeCheck" @expand="handleTreeExpand"> + <template slot="title" slot-scope="{ label, parentId, entity, key:treeKey,type}"> + <span v-if="label.indexOf(searchValue) > -1">{{ label.substr(0, label.indexOf(searchValue)) }}<span + class="replaceSearch">{{ searchValue }}</span>{{ label.substr(label.indexOf(searchValue) + searchValue.length) }}</span> + <span v-else>{{ label }}</span> + </template> + </a-tree> + </div> + + <div> + <a-form> + <a-form-item label="鎸囨淳鍘熷洜"> + <a-textarea v-model="queryParam.applyReason" rows="3" style="resize: none"></a-textarea> + </a-form-item> + </a-form> + </div> + </div> + </a-spin> </a-tab-pane> </a-tabs> </div> @@ -47,13 +86,19 @@ </template> <script> + import { getAction } from '@/api/manage' + import dncApi from '@/api/dnc' import { JeecgListMixin } from '@/mixins/JeecgListMixin' + import ATextarea from 'ant-design-vue/es/input/TextArea' export default { name: 'NcDocumentAssignModal', - components: {}, + components: { ATextarea }, mixins: [JeecgListMixin], props: { + currentDocumentInfo: { + type: Object + }, size: { type: String } @@ -76,736 +121,194 @@ }, { title: '鏂囦欢鍚嶇О', dataIndex: 'docName', align: 'center', width: 300 }, { title: '璁惧缂栧彿', dataIndex: 'docCode', align: 'center' }, - { title: '鍑哄簱鐘舵��', dataIndex: 'pullStatus', align: 'center' }, - { title: '鐘� 鎬�', dataIndex: 'docStatus', align: 'center' }, + { title: '鍑哄簱鐘舵��', dataIndex: 'pullStatus_dictText', align: 'center' }, + { title: '鐘� 鎬�', dataIndex: 'docStatus_dictText', align: 'center' }, { title: '涓婁紶鏃堕棿', dataIndex: 'createTime', align: 'center', width: 200 } ], - dataSource: [ - { - 'docId': '1872116579179859971', - 'docName': 'api-ms-win-core-heap-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116579423129601', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116579179859972', - 'docName': 'api-ms-win-core-libraryloader-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116579423129606', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116581352509442', - 'docName': 'api-ms-win-core-processthreads-l1-1-1.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116581453172737', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116581352509441', - 'docName': 'api-ms-win-core-profile-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116581453172738', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116581398646787', - 'docName': 'api-ms-win-core-processenvironment-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116581499310083', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116581394452482', - 'docName': 'api-ms-win-core-processthreads-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116581499310082', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116581398646786', - 'docName': 'api-ms-win-core-namedpipe-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116581503504385', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116581398646791', - 'docName': 'api-ms-win-core-rtlsupport-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116581503504386', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116583265112065', - 'docName': 'api-ms-win-core-synch-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116583357386754', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116583298666502', - 'docName': 'api-ms-win-core-timezone-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116583386746881', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116583298666498', - 'docName': 'api-ms-win-core-sysinfo-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116583399329795', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116583298666499', - 'docName': 'api-ms-win-core-util-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116583399329794', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:50', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116585123188739', - 'docName': 'api-ms-win-crt-convert-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116585219657730', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116585123188738', - 'docName': 'api-ms-win-crt-heap-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116585219657729', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116585131577347', - 'docName': 'api-ms-win-crt-environment-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116585223852035', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116585131577350', - 'docName': 'api-ms-win-crt-conio-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116585223852036', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116585131577346', - 'docName': 'api-ms-win-crt-locale-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116585223852034', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116585139965954', - 'docName': 'api-ms-win-crt-filesystem-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116585232240641', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116587392307203', - 'docName': 'api-ms-win-crt-stdio-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116587505553412', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116587392307207', - 'docName': 'api-ms-win-crt-process-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116587505553409', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116587379724289', - 'docName': 'api-ms-win-crt-multibyte-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116587497164802', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116587388112901', - 'docName': 'api-ms-win-crt-private-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116587497164801', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116587388112899', - 'docName': 'api-ms-win-crt-runtime-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116587505553410', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116587392307205', - 'docName': 'api-ms-win-crt-math-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116587505553411', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:51', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116589451710466', - 'docName': 'api-ms-win-crt-string-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116589644648450', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116589472681986', - 'docName': 'api-ms-win-crt-time-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116589653037060', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116589472681987', - 'docName': 'api-ms-win-crt-utility-l1-1-0.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116589653037058', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116589472681985', - 'docName': 'chrome_100_qq.pak', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'pak', - 'docStatus': 1, - 'publishFileId': '1872116589653037059', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116589787254785', - 'docName': 'chrome_200_qq.pak', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'pak', - 'docStatus': 1, - 'publishFileId': '1872116589896306690', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116590152159233', - 'docName': 'd3dcompiler_47.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116590277988354', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1872116591695663106', - 'docName': 'ffmpeg.dll', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'dll', - 'docStatus': 1, - 'publishFileId': '1872116591783743489', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2024-12-26 11:05:52', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - }, - { - 'docId': '1878649744767254529', - 'docName': 'avatar2.jpg', - 'docAlias': null, - 'docCode': null, - 'docSuffix': 'jpg', - 'docStatus': 1, - 'publishFileId': '1878649744901472258', - 'publishVersion': 'a.1', - 'description': null, - 'createTime': '2025-01-13 11:46:18', - 'updateTime': null, - 'createUser': '1254966905669160962', - 'updateUser': null, - 'docClassCode': null, - 'pullStatus': 1, - 'pullUser': null, - 'attributionType': 5, - 'attributionId': '1327523708556668930', - 'classificationId': '1257965381181095938', - 'syncStatus': null - } - ], - queryParam: {}, + searchValue: '', + searchInput: '', + spinning: false, + treeDataSource: [], + allTreeKeys: [], + checkedKeys: [], + expandedKeys: [], + autoExpandParent: true, url: { - list: '' + list: '/nc/doc/find/list' } } }, watch: { visible: { handler(value) { - if (value) this.loadData(1) + if (value) { + this.resetData() + this.loadData() + this.getDocumentAssignDeviceTreeByApi() + } } } }, - methods: {} + methods: { + loadData() { + this.dataSource = [] + if (!this.url.list) { + this.$message.error('璇疯缃畊rl.list灞炴��!') + return + } + var params = this.getQueryParams()//鏌ヨ鏉′欢 + if (!params) { + return false + } + const { attributionType, attributionId, param } = this.currentDocumentInfo + console.log('currentDocumentInfo', this.currentDocumentInfo) + params.attributionType = attributionType + params.attributionId = attributionId + params.docClassCode = param + console.log('params', params) + this.loading = true + getAction(this.url.list, params).then((res) => { + if (res.success) this.dataSource = res.result + else this.$message.warning(res.message) + }).finally(() => { + this.loading = false + }) + }, + + getDocumentAssignDeviceTreeByApi() { + this.spinning = true + this.treeDataSource = [] + dncApi.getDocumentAssignDeviceTreeApi(this.currentDocumentInfo) + .then(res => { + if (res.success) { + this.dataList = [] + this.allTreeKeys = [] + this.treeDataSource = res.list + this.generateList(this.treeDataSource) + } else { + this.$message.warn(res.message) + } + }) + .finally(() => { + this.spinning = false + }) + }, + + handleAssignDocumentToDevice() { + const param = {} + console.log('table', this.selectedRowKeys) + const treeCheckedDeviceKeys = [] + this.checkedKeys.forEach(checkedKey => { + const deviceId = this.dataList.find(item => item.key === checkedKey && item.type === 2) + if (deviceId) treeCheckedDeviceKeys.push(deviceId.key) + }) + + console.log('treeCheckedDeviceKeys', treeCheckedDeviceKeys) + }, + + /* 杈撳叆鏌ヨ鍐呭鍙樺寲鏃惰Е鍙� */ + handleSearchInputChange() { + let search = this.searchInput + console.log('data', this.dataList) + console.log('search', search) + let expandedKeys = this.dataList + .map(item => { + if (item.title != null) { + if (item.title.indexOf(search) > -1) { + return this.getParentKey(item.key, this.treeDataSource) + } + return null + } + }) + .filter((item, i, self) => item && self.indexOf(item) === i) + Object.assign(this, { + expandedKeys, + searchValue: search, + autoExpandParent: true + }) + }, + + /** + * 鏍戣妭鐐瑰睍寮�鍚堝苟鏃惰Е鍙� + * @param expandedKeys 灞曞紑椤筴ey + */ + handleTreeExpand(expandedKeys) { + this.expandedKeys = expandedKeys + this.autoExpandParent = false + }, + + /** + * 鏍戣妭鐐瑰閫夋閫変腑鏃惰Е鍙� + * @param selectedKeys 閫変腑鑺傜偣key + * @param {node} node 鑺傜偣瀵硅薄 + */ + handleTreeNodeCheck(checkedKeys, { node }) { + let record = node.dataRef + this.checkedKeys = checkedKeys + }, + + /** + * 閫掑綊鑾峰緱杈撳叆椤圭殑鐖剁骇key + * @param key 瀛愰」key + * @param tree 瀛愰」 + */ + getParentKey(key, tree) { + let parentKey + for (let i = 0; i < tree.length; i++) { + const node = tree[i] + if (node.children) { + if (node.children.some(item => item.key === key)) { + parentKey = node.key + console.log('parentKey', parentKey) + } else if ( + this.getParentKey(key, node.children)) { + parentKey = this.getParentKey(key, node.children) + } + } + } + return parentKey + }, + + /** + * 閫掑綊鑾峰緱鎵�鏈夋爲鑺傜偣key + * @param data + */ + generateList(data) { + for (let i = 0; i < data.length; i++) { + data[i].key = data[i].id + const node = data[i] + const key = node.id + const title = node.label + const type = node.type + this.dataList.push({ key, title, type }) + this.allTreeKeys.push(key) + if (node.children) this.generateList(node.children) + } + }, + + resetData() { + this.searchInput = '' + this.expandedKeys = [] + this.selectedRowKeys = [] + this.checkedKeys = [] + } + } } </script> -<style scoped> - .tabs-container { - display: flex; - justify-content: space-between; +<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); + } + } + } + </style> \ No newline at end of file -- Gitblit v1.9.3