collection.vue 46 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344
  1. <template>
  2. <div class="hc-page-layout-box">
  3. <div class="hc-layout-left-box" :style="'width:' + leftWidth + 'px;'">
  4. <div class="hc-project-box">
  5. <div class="hc-project-icon-box">
  6. <HcIcon name="stack"/>
  7. </div>
  8. <div class="ml-2 project-name-box">
  9. <span class="text-xl text-cut project-alias">{{projectInfo['projectAlias']}}</span>
  10. <div class="text-xs text-cut project-name">{{projectInfo['name']}}</div>
  11. </div>
  12. </div>
  13. <div class="hc-tree-box" v-loading="treeLoading" element-loading-text="加载中...">
  14. <el-scrollbar>
  15. <HcTree :projectId="projectId" :contractId="contractId" @nodeTap="projectTreeClick" @nodeLoading="treeNodeLoading" ref="treeRef"/>
  16. </el-scrollbar>
  17. </div>
  18. <!--左右拖动-->
  19. <div class="horizontal-drag-line" @mousedown="onmousedown"/>
  20. </div>
  21. <div class="hc-page-content-box">
  22. <HcCard>
  23. <template #header>
  24. <HcTooltip keys="file_collection_btn_upload_scanned_files">
  25. <el-button type="primary" hc-btn @click="uploadModalClick">
  26. <HcIcon name="qr-scan"/>
  27. <span>上传扫描文件</span>
  28. </el-button>
  29. </HcTooltip>
  30. <HcTooltip keys="file_collection_btn_sorting">
  31. <el-button type="primary" hc-btn @click="sortingClick">
  32. <HcIcon name="archive"/>
  33. <span>分盒整理</span>
  34. </el-button>
  35. </HcTooltip>
  36. <HcTooltip keys="file_collection_btn_download">
  37. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0">
  38. <HcIcon name="download"/>
  39. <span>下载</span>
  40. </el-button>
  41. </HcTooltip>
  42. <HcTooltip keys="file_collection_btn_certified">
  43. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="certificationModalClick">
  44. <HcIcon name="vip-diamond"/>
  45. <span>认证</span>
  46. </el-button>
  47. </HcTooltip>
  48. <HcTooltip keys="file_collection_btn_report">
  49. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0">
  50. <HcIcon name="send-plane-2"/>
  51. <span>上报</span>
  52. </el-button>
  53. </HcTooltip>
  54. <HcTooltip keys="file_collection_btn_edit">
  55. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="batchEditClick">
  56. <HcIcon name="edit"/>
  57. <span>编辑</span>
  58. </el-button>
  59. </HcTooltip>
  60. <HcTooltip keys="file_collection_btn_repeal">
  61. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0">
  62. <HcIcon name="delete-back-2"/>
  63. <span>废除</span>
  64. </el-button>
  65. </HcTooltip>
  66. <HcTooltip keys="file_collection_btn_del">
  67. <el-button hc-btn :disabled="tableCheckedKeys.length <= 0" @click="delModalClick">
  68. <HcIcon name="delete-bin"/>
  69. <span>删除</span>
  70. </el-button>
  71. </HcTooltip>
  72. </template>
  73. <template #extra>
  74. <HcTooltip keys="file_collection_btn_moves">
  75. <el-button hc-btn @click="movesClick">
  76. <HcIcon type="primary" name="arrow-left-right"/>
  77. <span>跨目录移动</span>
  78. </el-button>
  79. </HcTooltip>
  80. </template>
  81. <template #search>
  82. <div class="w-40">
  83. <el-select v-model="searchForm.approval" placeholder="审批状态" clearable>
  84. <el-option v-for="item in approvalStatus" :key="item.value" :label="item['label']" :value="item['value']"/>
  85. </el-select>
  86. </div>
  87. <div class="w-40 ml-2">
  88. <el-select v-model="searchForm.certified" placeholder="认证状态" clearable>
  89. <el-option v-for="item in certifiedStatus" :key="item.value" :label="item['label']" :value="item['value']"/>
  90. </el-select>
  91. </div>
  92. <div class="w-64 ml-2">
  93. <el-input v-model="searchForm.queryValue" placeholder="请输入名称关键词检索" clearable @keyup="keyUpEvent"/>
  94. </div>
  95. <div class="ml-2">
  96. <el-button type="primary" @click="searchClick">
  97. <HcIcon name="search-2"/>
  98. <span>搜索</span>
  99. </el-button>
  100. </div>
  101. </template>
  102. <HcTable ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading" isCheck @selection-change="tableSelection">
  103. <template #table-column-header-num>
  104. <HcTooltip keys="file_collection_btn_sort">
  105. <span class="text-link text-lg" @click="tableSortClick">
  106. <HcIcon name="arrow-up-down"/>
  107. </span>
  108. </HcTooltip>
  109. </template>
  110. <template #fileName="{row}">
  111. <span class="text-link" @click="tableRowName(row)">{{row?.fileName}}</span>
  112. </template>
  113. </HcTable>
  114. <template #action>
  115. <HcPages :pages="searchForm" @change="pageChange"/>
  116. </template>
  117. </HcCard>
  118. </div>
  119. <!--预组卷整理-->
  120. <HcDialog :show="sortingModal" title="预组卷整理" widths="850px" isTable isRowFooter @close="sortingModalClose">
  121. <div class="hc-sorting-modal-collapse">
  122. <el-collapse v-model="sortingActiveKey">
  123. <template v-for="(item,index) in sortingItemData" :key="index">
  124. <el-collapse-item :name="`item-${index}`" disabled :id="`item-${index}`">
  125. <template #title>
  126. <div class="hc-collapse-item-header">
  127. <div class="item-index">盒{{index+1}}</div>
  128. <el-divider direction="vertical" />
  129. <div class="item-input">
  130. <el-input
  131. v-model="item.boxName"
  132. :class="item['isName'] ? 'is-error' : ''"
  133. placeholder="请输入案卷题名"
  134. @input="tableIsInput($event, item, 'isName')"
  135. @change="tableIsInput($event, item, 'isName')"
  136. />
  137. </div>
  138. <el-divider direction="vertical" />
  139. <div class="item-action">
  140. <el-button type="primary" @click="sortingSelectFile(item,index)">选择文件</el-button>
  141. <el-button type="danger" @click="sortingDelData(item,index)">删除</el-button>
  142. </div>
  143. </div>
  144. </template>
  145. <HcTable :column="sortingTableColumn" :datas="item.list" :loading="sortingTableLoading" isCheck @selection-change="rows => sortingTableSelection(rows,item.list)" ref="sorTableRef">
  146. <template #name="{row}">
  147. <span class="text-link">{{row?.fileName}}</span>
  148. </template>
  149. </HcTable>
  150. </el-collapse-item>
  151. </template>
  152. </el-collapse>
  153. </div>
  154. <template #leftRowFooter>
  155. <el-button type="primary" hc-btn @click="addSortingModalClick">
  156. <HcIcon name="add"/>
  157. <span>添加分盒</span>
  158. </el-button>
  159. </template>
  160. <template #rightRowFooter>
  161. <el-button hc-btn @click="sortingModalClose">
  162. <HcIcon name="close"/>
  163. <span>取消</span>
  164. </el-button>
  165. <el-button type="primary" hc-btn :loading="sortingModalLoading" @click="sortingModalSave">
  166. <HcIcon name="check"/>
  167. <span>确认</span>
  168. </el-button>
  169. </template>
  170. </HcDialog>
  171. <!--预组卷整理 无数据-->
  172. <HcDialog :show="sortingNoneModal" title="预组卷整理" widths="850px" isTable isRowFooter>
  173. <div class="flex-center">
  174. <i class="el-icon" data-v-029747aa="" style="font-size: 200px;color:#81b337;cursor: pointer;" @click="toSortingModal">
  175. <svg viewBox="0 0 1024 1024" xmlns="http://www.w3.org/2000/svg" data-v-029747aa="">
  176. <path fill="currentColor" d="M512 64a448 448 0 1 1 0 896 448 448 0 0 1 0-896zm-38.4 409.6H326.4a38.4 38.4 0 1 0 0 76.8h147.2v147.2a38.4 38.4 0 0 0 76.8 0V550.4h147.2a38.4 38.4 0 0 0 0-76.8H550.4V326.4a38.4 38.4 0 1 0-76.8 0v147.2z"></path>
  177. </svg>
  178. </i>
  179. <span>添加分盒</span>
  180. </div>
  181. </HcDialog>
  182. <!--跨目录移动-->
  183. <HcDialog :show="movesModal" title="跨目录移动" widths="990px" isTable @close="movesModalClose" @save="movesModalSave" :loading="movesModalLoading">
  184. <div class="hc-moves-transfer-box">
  185. <div class="hc-moves-transfer-panel">
  186. <div class="panel-header">
  187. <div class="panel-header-label">
  188. <el-checkbox class="size-xl space" v-model="movesCheckAll" :indeterminate="isIndeterminate" @change="handleCheckAllChange">选择需要迁移的文件</el-checkbox>
  189. </div>
  190. <div class="panel-header-extra">{{checkedMoves.length}}/{{fileDatasList.length}}</div>
  191. </div>
  192. <div class="panel-body">
  193. <el-scrollbar>
  194. <el-checkbox-group v-model="checkedMoves" @change="handleCheckedMovesChange">
  195. <div class="hc-file-checkbox" v-for="item in fileDatasList" :key="item.id">
  196. <el-checkbox class="size-xl space" :label="item.id">{{item.fileName}}</el-checkbox>
  197. </div>
  198. </el-checkbox-group>
  199. </el-scrollbar>
  200. </div>
  201. </div>
  202. <div class="hc-moves-transfer-buttons">
  203. <el-button hc-btn _icon size="small"
  204. :type="fileDatasList.length <= 0 || checkedMoves.length <= 0 ? '' : 'primary'"
  205. :disabled="fileDatasList.length <= 0 || checkedMoves.length <= 0">
  206. <HcIcon name="arrow-right"/>
  207. </el-button>
  208. </div>
  209. <div class="hc-moves-transfer-panel">
  210. <div class="panel-header">选择移动目录</div>
  211. <div class="panel-body" v-loading="treePanelLoading">
  212. <el-scrollbar>
  213. <HcTree idPrefix="hc-tree-moves-" :projectId="projectId" :contractId="contractId" isRadio @radioChange="radioChange" :showRadioFun="showRadioFun" @nodeLoading="panelTreeLoading"/>
  214. </el-scrollbar>
  215. </div>
  216. </div>
  217. </div>
  218. </HcDialog>
  219. <!--调整排序-->
  220. <HcDialog :show="sortModal" title="调整排序" widths="980px" isTable isRowFooter @close="sortModalClose">
  221. <el-alert title="可拖动排序,也可在后面点击图标,切换排序" type="error" :closable="false"/>
  222. <div class="hc-table-h">
  223. <HcTable ui="hc-table-row-drop" :column="sortTableColumn" :datas="sortTableData" :loading="sortTableLoading" isRowDrop @row-drop="sortTableRowDrop">
  224. <template #key2="{row}">
  225. <span class="text-link">{{row?.key2}}</span>
  226. </template>
  227. <template #action="{index}">
  228. <span class="text-link text-xl" @click="upSortClick(index)">
  229. <HcIcon name="arrow-up" fill/>
  230. </span>
  231. <span class="text-link text-xl ml-2" @click="downSortClick(index)">
  232. <HcIcon name="arrow-down" fill/>
  233. </span>
  234. </template>
  235. </HcTable>
  236. </div>
  237. <template #leftRowFooter>
  238. <el-button hc-btn @click="sortModalClose">
  239. <HcIcon name="close"/>
  240. <span>取消</span>
  241. </el-button>
  242. <el-button type="primary" hc-btn :loading="sortModalLoading" @click="sortModalSave">
  243. <HcIcon name="check"/>
  244. <span>确认</span>
  245. </el-button>
  246. </template>
  247. <template #rightRowFooter>
  248. <HcPages :pages="sortSearchForm" :sizes="[10, 20, 50, 100, 200, 300, 400, 500, 600]" @change="sortPageChange"/>
  249. </template>
  250. </HcDialog>
  251. <!--新增编辑文件-->
  252. <el-dialog v-model="showUploadModal" title="上传工程文件" width="80vw" class="hc-modal-border hc-modal-table">
  253. <HcTable ui="hc-form-table" :column="tableUploadColumn" :datas="tableUploadData" :loading="uploadSaveLoading">
  254. <template #fileNumber="{row}">
  255. <!-- <el-input v-model="row.fileNumber" :class="row['isFileNumber'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileNumber')"/> -->
  256. <el-input v-model="row.fileNumber"/>
  257. </template>
  258. <template #fileName="{row}">
  259. <el-input v-model="row.fileName" :class="row['isFileName'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileName')"/>
  260. </template>
  261. <template #fileTime="{row}">
  262. <el-date-picker v-model="row.fileTime" type="date" format="YYYYMMDD" value-format="YYYYMMDD" :clearable="false"/>
  263. <!-- <el-input v-model="row.fileTime" :class="row['isFileTime'] ? 'is-error' : ''" @input="tableIsInput($event, row, 'isFileTime')"/> -->
  264. </template>
  265. <template #sheetType="{row}" v-if="isBuiltDrawing === 1">
  266. <el-select v-model="row.sheetType">
  267. <el-option v-for="item in sheetType" :key="item['dictKey']" :label="item['dictValue']" :value="item['dictKey']"/>
  268. </el-select>
  269. </template>
  270. <template #sheetSource="{row}" v-if="isBuiltDrawing === 1">
  271. <el-select v-model="row.sheetSource">
  272. <el-option v-for="item in sheetSourceType" :key="item['dictKey']" :label="item['dictValue']" :value="item['dictKey']"/>
  273. </el-select>
  274. </template>
  275. <template #drawingNo="{row}" v-if="isBuiltDrawing === 1">
  276. <el-input v-model="row.drawingNo"/>
  277. </template>
  278. <template #citeChangeNumber="{row}" v-if="isBuiltDrawing === 1">
  279. <el-input v-model="row.citeChangeNumber"/>
  280. </template>
  281. <template #isApproval="{row}">
  282. <el-select v-model="row.isApproval">
  283. <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value"/>
  284. </el-select>
  285. </template>
  286. <template #isNeedCertification="{row}">
  287. <el-select v-model="row.isNeedCertification">
  288. <el-option v-for="item in whetherData" :key="item.value" :label="item.label" :value="item.value"/>
  289. </el-select>
  290. </template>
  291. <template #dutyUser="{row}">
  292. <el-input v-model="row.dutyUser"/>
  293. </template>
  294. <template #action="{row,index}">
  295. <el-button type="danger" plain size="small" :loading="row['delBtnLoading']" @click="delUploadData(row,index)">删除</el-button>
  296. </template>
  297. </HcTable>
  298. <template #footer>
  299. <div class="lr-dialog-footer">
  300. <div class="left flex items-center">
  301. <el-button type="primary" hc-btn @click="uploadFileClick">
  302. <HcIcon name="add-circle"/>
  303. <span>新增上传</span>
  304. </el-button>
  305. </div>
  306. <div class="right">
  307. <el-button size="large" @click="batchUploadCancel" :disabled="uploadsLoading">
  308. <HcIcon name="close"/>
  309. <span>取消</span>
  310. </el-button>
  311. <el-button type="primary" hc-btn :disabled="uploadsLoading" :loading="uploadSaveLoading" @click="batchUploadSave">
  312. <HcIcon name="save"/>
  313. <span>提交保存</span>
  314. </el-button>
  315. </div>
  316. </div>
  317. </template>
  318. </el-dialog>
  319. <!--批量认证-->
  320. <el-dialog v-model="showCertificationModal" title="批量认证" width="80vw" class="hc-modal-border hc-modal-table">
  321. <div class="hc-card-body-flex">
  322. <div class="flex-table">
  323. <HcTable ui="hc-form-table" :column="CertColumns" :datas="CertData" @row-click="CertRowClick">
  324. <template #action="{row,index}">
  325. <el-button type="primary" plain size="small" @click.stop="CertRowClick2(row)">预览</el-button>
  326. </template>
  327. </HcTable>
  328. </div>
  329. <div class="flex-iframe" v-if="CertPdf">
  330. <iframe allow="display-capture" width='100%' height='100%' frameborder='1' :src="CertPdf"></iframe>
  331. </div>
  332. <div class="flex-iframe hc-no-table-form" v-else>
  333. <div class="table-form-no">
  334. <img :src="notableform" alt=""/>
  335. <div class="desc">暂无 PDF 数据</div>
  336. </div>
  337. </div>
  338. </div>
  339. <template #footer>
  340. <div class="dialog-footer">
  341. <el-button size="large" @click="showCertificationModal = false">
  342. <HcIcon name="close"/>
  343. <span>取消</span>
  344. </el-button>
  345. <el-button type="primary" hc-btn :loading="CertLoading" @click="CertClick">
  346. <HcIcon name="save"/>
  347. <span>确认认证</span>
  348. </el-button>
  349. </div>
  350. </template>
  351. </el-dialog>
  352. <HcUploadFile ref="HcUploadFileRef"
  353. @fileProgress="HcUploadFileProgress"
  354. @fileSuccess="HcUploadFileSuccess"
  355. @filesChange="HcUploadFileChange"/>
  356. </div>
  357. </template>
  358. <script setup>
  359. import {useAppStore} from "~src/store";
  360. import {ref, watch, onMounted, nextTick } from "vue";
  361. import HcTree from "~src/components/tree/hc-tree.vue"
  362. import notableform from '~src/assets/view/notableform.svg';
  363. import {delMessage, rowsToId, rowsToIdNumArr} from "~uti/tools";
  364. import archiveFileApi from "~api/archiveFile/archiveFile";
  365. import {getArrValue, deepClone, getObjVal} from "js-fast-way"
  366. import tasksApi from '~api/tasks/data';
  367. import ossApi from "~api/oss";
  368. //变量
  369. const useAppState = useAppStore()
  370. const projectId = ref(useAppState.getProjectId);
  371. const contractId = ref(useAppState.getContractId);
  372. const projectInfo = ref(useAppState.getProjectInfo);
  373. const isCollapse = ref(useAppState.getCollapse)
  374. const HcUploadFileRef = ref(null)
  375. //上传进度
  376. const uploadsLoading = ref(false)
  377. //监听
  378. watch(() => [
  379. useAppState.getCollapse
  380. ], ([Collapse]) => {
  381. isCollapse.value = Collapse
  382. })
  383. //渲染完成
  384. onMounted(() => {
  385. treeLoading.value = true
  386. setTableColumns()
  387. })
  388. //打开文件选择框
  389. const uploadFileClick = () => {
  390. HcUploadFileRef?.value.btnUpload()
  391. }
  392. // 文件上传进度
  393. const HcUploadFileProgress = (res) => {
  394. uploadsLoading.value = res
  395. }
  396. // 文件上传成功的回调
  397. const HcUploadFileSuccess = (res) => {
  398. console.log('文件上传成功', res)
  399. uploadsChange(res)
  400. }
  401. // 文件全部上传成功
  402. const HcUploadFileChange = () => {
  403. console.log('文件全部上传成功')
  404. HcUploadFileRef?.value.close()
  405. }
  406. //树加载
  407. const treeLoading = ref(false)
  408. const treeNodeLoading = () => {
  409. treeLoading.value = false
  410. }
  411. const treePanelLoading = ref(false)
  412. const panelTreeLoading = () => {
  413. treePanelLoading.value = false
  414. }
  415. //审批状态
  416. const approvalStatus = ref([
  417. {label: '未上报', value: '1'},
  418. {label: '待审批', value: '2'},
  419. {label: '已审批', value: '3'}
  420. ])
  421. //认证状态
  422. const certifiedStatus = ref([
  423. {label: '已认证', value: '1'},
  424. {label: '未认证', value: '2'}
  425. ])
  426. //搜索表单
  427. const searchForm = ref({
  428. nodeIds:'',
  429. approval: null, certified: null, queryValue: null,
  430. current: 1, size: 20, total: 0
  431. })
  432. //树相关的变量
  433. const primaryKeyId = ref('')
  434. const isBuiltDrawing = ref(0)
  435. const isStorageNode = ref(0)
  436. const nodeIds = ref('')
  437. const projectTreeClick = ({node, data, keys, key}) => {
  438. nodeIds.value = data.id || '';
  439. isStorageNode.value = data['isStorageNode'] || 0;
  440. //设置搜索数据
  441. searchForm.value.current = 1;
  442. searchForm.value.nodeIds = data.id || '';
  443. sortSearchForm.value.nodeIds = data.id || '';
  444. getTableData()
  445. }
  446. //回车搜索
  447. const keyUpEvent = (e) => {
  448. if (e.key === "Enter") {
  449. searchForm.value.current = 1;
  450. getTableData()
  451. }
  452. }
  453. //搜索
  454. const searchClick = () => {
  455. searchForm.value.current = 1;
  456. getTableData()
  457. }
  458. //分页被点击
  459. const pageChange = ({current, size}) => {
  460. searchForm.value.current = current
  461. searchForm.value.size = size
  462. getTableData()
  463. }
  464. //表格数据
  465. const tableRef = ref(null)
  466. const tableColumn = ref([])
  467. //设置表头
  468. const setTableColumns = () => {
  469. if (isBuiltDrawing.value === 1) {
  470. tableColumn.value = [
  471. {key:'fileNumber', name: '文件编号', width: 160},
  472. {key:'fileName', name: '文件名称'},
  473. {key:'filePage', name: '文件页数', width: 120},
  474. {key:'sheetType', name: '图幅'},
  475. {key:'sheetSourceValue', name: '图表来源'},
  476. {key:'drawingNo', name: '图号'},
  477. {key:'citeChangeNumber', name: '引用变更令编号'},
  478. {key:'isCertificationValue', name: '认证状态', width: 160},
  479. {key:'isApprovalValue', name: '状态', width: 160},
  480. {key:'fileTime', name: '文件时间', width: 160},
  481. {key:'dutyUser', name: '责任者', width: 160}
  482. ]
  483. sheetTypeStatus()
  484. sheetSourceStatus()
  485. } else {
  486. tableColumn.value = [
  487. {key:'fileNumber', name: '文件编号', width: 160},
  488. {key:'fileName', name: '文件名称'},
  489. {key:'filePage', name: '文件页数', width: 100},
  490. {key:'isCertificationValue', name: '认证状态', width: 120},
  491. {key:'isApprovalValue', name: '状态', width: 120},
  492. {key:'fileTime', name: '文件时间', width: 180},
  493. {key:'dutyUser', name: '责任者', width: 180}
  494. ]
  495. }
  496. }
  497. const tableData = ref([])
  498. //获取数据
  499. const tableLoading = ref(false)
  500. const getTableData = async () => {
  501. tableLoading.value = true
  502. const { error, code, data } = await archiveFileApi.getarchiveFilePage({
  503. ...searchForm.value,
  504. projectId: projectId.value,
  505. contractId: contractId.value
  506. })
  507. tableLoading.value = false
  508. if (!error && code === 200) {
  509. tableData.value = getArrValue(data['records'])
  510. searchForm.value.total = data['total'] || 0
  511. } else {
  512. tableData.value = []
  513. searchForm.value.total = 0
  514. }
  515. }
  516. //多选
  517. const tableCheckedKeys = ref([]);
  518. const tableSelection = (rows) => {
  519. tableCheckedKeys.value = rows
  520. }
  521. //分盒整理
  522. const sortingModal = ref(false)
  523. const sortingClick = async() => {
  524. if (nodeIds.value && isStorageNode.value === 1) {
  525. const { error, code, data } = await archiveFileApi.getBoxNameAndBoxNumber({
  526. nodeId:nodeIds.value
  527. })
  528. if (!error && code === 200) {
  529. if(data.length > 0){
  530. sortingActiveKey.value = [];
  531. sortingModal.value = true
  532. sortingItemData.value = getArrValue(data)
  533. sortingOldData.value = deepClone(sortingItemData.value)
  534. }else{
  535. sortingNoneModal.value = true
  536. }
  537. }
  538. } else {
  539. window?.$message?.warning('请先选择一个子节点')
  540. }
  541. }
  542. const sortingNoneModal = ref(false)//无数据显示的弹窗
  543. const toSortingModal = ()=>{
  544. sortingNoneModal.value = false;
  545. sortingActiveKey.value = [];
  546. sortingModal.value = true
  547. }
  548. const sortingItemData = ref([])
  549. const sortingOldData = ref([])//旧数据,用来对比是否修改名字
  550. //获取数据
  551. const sortingItemLoading = ref(false)
  552. const getSortingItemData = () => {
  553. }
  554. //校验
  555. const tableIsInput = (val, row, key) => {
  556. //console.log(!val);
  557. //检测是否改过案卷名字
  558. if(key == 'isName'){
  559. row.isChange = true;
  560. }
  561. row[key] = !val;
  562. }
  563. //选择文件
  564. // const sortingActiveKey = ref('')
  565. // const sortingSelectFile = (row, index) => {
  566. // //取当前展开组的key
  567. // const key = sortingActiveKey.value;
  568. // const keys = key ? key.split('-') : [];
  569. // const active = keys.length > 0 ? keys[1]: -1;
  570. // if (Number(active) === index) {
  571. // sortingActiveKey.value = null;
  572. // } else {
  573. // sortingActiveKey.value = `item-${index}`;
  574. // }
  575. // }
  576. const sortingActiveKey = ref([])
  577. const sortingSelectFile = (row, index) => {
  578. const key = `item-${index}`;
  579. const indexNum = sortingActiveKey.value.indexOf(key);
  580. if(indexNum > -1){
  581. sortingActiveKey.value.splice(indexNum,1);
  582. }else{
  583. sortingActiveKey.value.push(key);
  584. if(!(row.list && row.list.length > 0)){
  585. getSortingTableData(row, index)
  586. }
  587. }
  588. }
  589. //表格
  590. const sortingTableColumn = [
  591. {key:'name', name: '文件名称'},
  592. ];
  593. const sortingTableData = ref([])
  594. //获取数据
  595. const sortingTableLoading = ref(false)
  596. const getSortingTableData = async(row, index) => {
  597. sortingTableLoading.value = true
  598. const { error, code, data } = await archiveFileApi.pageByBoxName({
  599. size: 99999,
  600. current: 1,
  601. projectId: projectId.value,
  602. contractId: contractId.value,
  603. nodeIds:nodeIds.value,
  604. boxName:row.boxName?row.boxName:''
  605. })
  606. sortingTableLoading.value = false
  607. if (!error && code === 200) {
  608. row.list = getArrValue(data['records'])
  609. setTableCheck(row, index)
  610. } else {
  611. row.list = []
  612. }
  613. }
  614. //表格ref
  615. const sorTableRef = ref([]);
  616. //回显勾选
  617. const setTableCheck = async(row, index) => {
  618. //console.log(row)
  619. if(row.ids){
  620. const keys = row.ids.split(',');
  621. row.list.forEach(async (item)=>{
  622. if(keys.indexOf(item.id) > -1){
  623. item.checked = true;
  624. await nextTick();
  625. sorTableRef.value[index].toggleRowSelection(item,true);
  626. }
  627. })
  628. }
  629. }
  630. //多选
  631. const sortingTableKeys = ref([]);
  632. const sortingTableSelection = (rows,list,event) => {
  633. //console.log(event)
  634. list.forEach(element => {
  635. element.checked = false;
  636. });
  637. rows.forEach((element)=>{
  638. element.checked = true;
  639. })
  640. }
  641. //删除
  642. const sortingDelData = (row,index) => {
  643. sortingItemData.value.splice(index,1);
  644. }
  645. //添加分盒
  646. const addSortingModalClick = () => {
  647. sortingItemData.value.push({
  648. boxName: ''
  649. })
  650. }
  651. //确认保存
  652. const sortingModalLoading = ref(false)
  653. const sortingModalSave = async() => {
  654. sortingModalLoading.value = true
  655. //检测案卷名是否重复
  656. let nameRes = await checkNames();
  657. //console.log(nameRes)
  658. //return;
  659. for (let i = 0; i < nameRes.length; i++) {
  660. if(typeof nameRes[i].data == 'string'){
  661. window.$message?.error(nameRes[i].data+',案卷名重复')
  662. sortingModalLoading.value = false
  663. return;
  664. }
  665. }
  666. //组装数据
  667. let rows = [];
  668. sortingItemData.value.forEach((item,index)=>{
  669. let obj = {
  670. ids:'',
  671. boxName:item.boxName,
  672. boxNumber:index+1,
  673. };
  674. let list = [];
  675. if(item.list){
  676. item.list.forEach((item2)=>{
  677. if(item2.checked){
  678. list.push(item2.id)
  679. }
  680. })
  681. obj.ids = list.join(',');
  682. }else{
  683. obj.ids = item.ids;
  684. }
  685. rows.push(obj)
  686. })
  687. const { error, code, data } = await archiveFileApi.allocation({
  688. list: rows
  689. })
  690. if (!error && code === 200) {
  691. window.$message?.success('保存成功')
  692. sortingModal.value = false
  693. } else {
  694. window.$message?.error('保存失败')
  695. }
  696. sortingModalLoading.value = false
  697. }
  698. const checkNames =() =>{
  699. const arr = [];
  700. sortingItemData.value.forEach((item)=>{
  701. if(item.boxNumber){
  702. if(item.isChange){
  703. //是否修改过
  704. //对比旧的数据,是否相同
  705. for (let i = 0; i < sortingOldData.value.length; i++) {
  706. if(sortingOldData.value[i].boxNumber == item.boxNumber){
  707. if(sortingOldData.value[i].boxName != item.boxName){
  708. arr.push(
  709. archiveFileApi.getIsBoxName({
  710. boxName:item.boxName
  711. })
  712. )
  713. }
  714. return;
  715. }
  716. }
  717. }
  718. }else{
  719. arr.push(
  720. archiveFileApi.getIsBoxName({
  721. boxName:item.boxName
  722. })
  723. )
  724. }
  725. })
  726. return Promise.all(arr);
  727. }
  728. //关闭
  729. const sortingModalClose = () => {
  730. sortingModal.value = false
  731. }
  732. //删除
  733. const delModalClick = async () => {
  734. const rows = tableCheckedKeys.value
  735. if(rows.length <= 0){
  736. window.$message?.error('请选择需要删除的数据')
  737. } else {
  738. delMessage(async () => {
  739. const keys = rowsToIdNumArr(rows);
  740. const { error, code } = await archiveFileApi.removeFile({
  741. ids: keys
  742. })
  743. if (!error && code === 200) {
  744. window.$message?.success('删除成功!')
  745. searchClick()
  746. }
  747. })
  748. }
  749. }
  750. //跨目录移动
  751. const movesModal = ref(false)
  752. const movesClick = async() => {
  753. movesModal.value = true
  754. treePanelLoading.value = true
  755. const { error, code, data } = await archiveFileApi.getarchiveFilePage({
  756. ...searchForm.value,
  757. size:9999,
  758. projectId: projectId.value,
  759. contractId: contractId.value
  760. })
  761. if (!error && code === 200) {
  762. fileDatasList.value = getArrValue(data['records'])
  763. } else {
  764. fileDatasList.value = []
  765. }
  766. }
  767. //选择需要迁移的文件
  768. const movesCheckAll = ref(false)
  769. const isIndeterminate = ref(true)
  770. const checkedMoves = ref([])
  771. //左侧待迁移文件
  772. const fileDatasList = ref([])
  773. //全选
  774. const handleCheckAllChange = (val) => {
  775. const checked = fileDatasList.value
  776. const keys = rowsToIdNumArr(checked);
  777. checkedMoves.value = val ? keys : []
  778. isIndeterminate.value = false
  779. }
  780. //勾选
  781. const handleCheckedMovesChange = (value) => {
  782. const keys = fileDatasList.value
  783. const checkedCount = value.length
  784. movesCheckAll.value = checkedCount === keys.length
  785. isIndeterminate.value = checkedCount > 0 && checkedCount < keys.length
  786. }
  787. //右侧radio
  788. let radioNodeId = ''
  789. const radioChange = (id)=>{
  790. //console.log(id)
  791. radioNodeId = id;
  792. }
  793. //只显示储存节点的单选
  794. const showRadioFun = (data)=>{
  795. if(data.isStorageNode == 1){
  796. return true;
  797. }else{
  798. return false;
  799. }
  800. }
  801. //保存
  802. const movesModalLoading = ref(false)
  803. const movesModalSave = async() => {
  804. let ids = checkedMoves.value.join(',')
  805. if(checkedMoves.value.length < 1){
  806. window.$message?.warning('请勾选需要迁移的文件')
  807. return;
  808. }
  809. if(radioNodeId == ''){
  810. window.$message?.warning('请选择要移动到的节点')
  811. return;
  812. }
  813. movesModalLoading.value = true;
  814. const { error, code, data } = await archiveFileApi.migrateFile({
  815. ids:ids,
  816. nodeId:radioNodeId
  817. })
  818. movesModalLoading.value = false
  819. if (!error && code === 200) {
  820. window.$message?.success('保存成功')
  821. movesModal.value = false
  822. getTableData()
  823. } else {
  824. window.$message?.error('保存失败')
  825. }
  826. }
  827. //关闭
  828. const movesModalClose = () => {
  829. movesModal.value = false
  830. }
  831. //表格排序
  832. const sortModal = ref(false)
  833. //显示
  834. const tableSortClick = () => {
  835. sortModal.value = true
  836. getSortTableData()
  837. }
  838. //搜索表单
  839. const sortSearchForm = ref({
  840. nodeIds:'',
  841. current: 1, size: 20, total: 0
  842. })
  843. //分页被点击
  844. const sortPageChange = ({current, size}) => {
  845. sortSearchForm.value.current = current
  846. sortSearchForm.value.size = size
  847. getSortTableData()
  848. }
  849. //表格数据
  850. const sortTableColumn = ref([
  851. {key:'fileNumber', name: '文件编号', width: 160},
  852. {key:'fileName', name: '文件名称'},
  853. {key:'action', name: '排序', width: 90},
  854. ])
  855. const sortTableData = ref([])
  856. const sortTableLoading = ref(false)
  857. const getSortTableData = async () => {
  858. sortTableLoading.value = true
  859. const { error, code, data } = await archiveFileApi.getarchiveFilePage({
  860. ...sortSearchForm.value,
  861. projectId: projectId.value,
  862. contractId: contractId.value
  863. })
  864. sortTableLoading.value = false
  865. if (!error && code === 200) {
  866. sortTableData.value = getArrValue(data['records'])
  867. sortSearchForm.value.total = data['total'] || 0
  868. } else {
  869. sortTableData.value = []
  870. sortSearchForm.value.total = 0
  871. }
  872. }
  873. //拖动完成
  874. const sortTableRowDrop = (rows) => {
  875. sortTableData.value = rows
  876. }
  877. //向下
  878. const downSortClick = (index) => {
  879. const indexs = index + 1
  880. const data = sortTableData.value
  881. if(indexs !== data.length) {
  882. const tmp = data.splice(indexs,1);
  883. sortTableData.value.splice(index,0,tmp[0]);
  884. } else {
  885. window?.$message?.warning('已经处于置底,无法下移')
  886. }
  887. }
  888. //向上
  889. const upSortClick = (index) => {
  890. const data = sortTableData.value || []
  891. if(index !== 0) {
  892. const tmp = data.splice(index - 1,1);
  893. sortTableData.value.splice(index,0,tmp[0]);
  894. } else {
  895. window?.$message?.warning('已经处于置顶,无法上移')
  896. }
  897. }
  898. //保存
  899. const sortModalLoading = ref(false)
  900. const sortModalSave = async() => {
  901. await batchEditSaveApi(sortTableData.value)
  902. sortModal.value = false
  903. }
  904. //关闭
  905. const sortModalClose = () => {
  906. sortModal.value = false
  907. }
  908. //获取认证状态
  909. const certificationType = ref([])
  910. const certificationStatus = async () => {
  911. const { error, code, data } = await tasksApi.queryTaskTypeStatus({
  912. typeOrStatus: 'certification_status'
  913. })
  914. //处理数据
  915. if (!error && code === 200) {
  916. certificationType.value = getArrValue(data)
  917. } else {
  918. certificationType.value = []
  919. }
  920. }
  921. //获取图幅类型
  922. const sheetType = ref([])
  923. const sheetTypeStatus = async () => {
  924. const { error, code, data } = await tasksApi.queryTaskTypeStatus({
  925. typeOrStatus: 'sheet_type'
  926. })
  927. //处理数据
  928. if (!error && code === 200) {
  929. sheetType.value = getArrValue(data)
  930. } else {
  931. sheetType.value = []
  932. }
  933. }
  934. //获取图表来源
  935. const sheetSourceType = ref([])
  936. const sheetSourceStatus = async () => {
  937. const { error, code, data } = await tasksApi.queryTaskTypeStatus({
  938. typeOrStatus: 'sheet_source'
  939. })
  940. //处理数据
  941. if (!error && code === 200) {
  942. sheetSourceType.value = getArrValue(data)
  943. } else {
  944. sheetSourceType.value = []
  945. }
  946. }
  947. //新增文件
  948. const tableUploadType = ref('add')
  949. const showUploadModal = ref(false)
  950. const uploadModalClick = () => {
  951. if (nodeIds.value && isStorageNode.value === 1) {
  952. tableUploadType.value = 'add'
  953. setTableUploadColumn()
  954. uploadSaveLoading.value = false
  955. tableUploadData.value = []
  956. showUploadModal.value = true
  957. } else {
  958. window?.$message?.warning('请先选择一个子节点')
  959. }
  960. }
  961. //设置文件表头
  962. const tableUploadColumn = ref([
  963. {key:'fileNumber', name: '文件编号'},
  964. {key:'fileName', name: '文件名称'},
  965. {key:'fileTime', name: '文件时间'},
  966. {key:'isApproval', name: '是否需要审批'},
  967. {key:'isNeedCertification', name: '是否需要认证'},
  968. {key:'dutyUser', name: '责任者'},
  969. {key:'action', name: '操作', width: 100}
  970. ])
  971. const setTableUploadColumn = () => {
  972. if (isBuiltDrawing.value === 1) {
  973. tableUploadColumn.value = [
  974. {key:'fileNumber', name: '文件编号'},
  975. {key:'fileName', name: '文件名称'},
  976. {key:'fileTime', name: '文件时间'},
  977. {key:'sheetType', name: '图幅'},
  978. {key:'sheetSource', name: '图表来源'},
  979. {key:'drawingNo', name: '图号'},
  980. {key:'citeChangeNumber', name: '引用变更令编号'},
  981. {key:'isApproval', name: '是否需要审批'},
  982. {key:'isNeedCertification', name: '是否需要认证'},
  983. {key:'dutyUser', name: '责任者'},
  984. {key:'action', name: '操作', width: 100}
  985. ]
  986. } else {
  987. tableUploadColumn.value = [
  988. {key:'fileNumber', name: '文件编号'},
  989. {key:'fileName', name: '文件名称'},
  990. {key:'fileTime', name: '文件时间'},
  991. {key:'isApproval', name: '是否需要审批'},
  992. {key:'isNeedCertification', name: '是否需要认证'},
  993. {key:'dutyUser', name: '责任者'},
  994. {key:'action', name: '操作', width: 100}
  995. ]
  996. }
  997. }
  998. const tableUploadData = ref([])
  999. //上传的文件结果
  1000. const uploadsChange = (item) => {
  1001. if (getObjVal(item)) {
  1002. let newArr = tableUploadData.value
  1003. const sheet = sheetType.value, source = sheetSourceType.value
  1004. let name = item['originalName'] || ''
  1005. let fileName = name.substring(0, name.lastIndexOf("."))
  1006. newArr.push({
  1007. projectId: projectId.value,
  1008. contractId: contractId.value,
  1009. nodeId: nodeIds.value,
  1010. fileNumber: '',
  1011. fileName: fileName,
  1012. ossFileName: item?.name || '',
  1013. fileTime: null,
  1014. fileUrl: item?.link || '',
  1015. sheetType: sheet.length > 0 ? sheet[0]['dictKey'] || '': '',
  1016. sheetSource: source.length > 0 ? source[0]['dictKey'] || '': '',
  1017. drawingNo: '',
  1018. citeChangeNumber: '',
  1019. isApproval: 0,
  1020. isNeedCertification: 0,
  1021. dutyUser: '',
  1022. pdfFileUrl: item?.pdfUrl || '',
  1023. filePage: item?.page || '',
  1024. })
  1025. tableUploadData.value = newArr
  1026. } else {
  1027. console.log(item)
  1028. }
  1029. }
  1030. //表单下拉数据
  1031. const whetherData = ref([
  1032. {label: "不需要", value: 0},
  1033. {label: "需要", value: 1}
  1034. ])
  1035. //删除
  1036. const delUploadData = async (row,index) => {
  1037. if (row['ossFileName']) {
  1038. row['delBtnLoading'] = true
  1039. await ossApi.removeFile({fileName: row['ossFileName']})
  1040. row['delBtnLoading'] = false
  1041. tableUploadData.value.splice(index,1);
  1042. } else {
  1043. tableUploadData.value.splice(index,1);
  1044. }
  1045. }
  1046. //批量上传保存
  1047. const uploadSaveLoading = ref(false)
  1048. const batchUploadSave = async () => {
  1049. const rows = tableUploadData.value
  1050. if (rows.length > 0) {
  1051. //验证表单数据
  1052. uploadSaveLoading.value = true
  1053. let isTableRows = false;
  1054. for (let i = 0; i < rows.length; i++) {
  1055. // if (!rows[i]['fileNumber']) {
  1056. // rows[i]['isFileNumber'] = true
  1057. // isTableRows = true
  1058. // } else if (!rows[i]['fileName']) {
  1059. // rows[i]['isFileName'] = true
  1060. // isTableRows = true
  1061. // }
  1062. if (!rows[i]['fileTime']) {
  1063. rows[i]['isFileTime'] = true
  1064. isTableRows = true
  1065. } else if (!rows[i]['fileName']) {
  1066. rows[i]['isFileName'] = true
  1067. isTableRows = true
  1068. }
  1069. }
  1070. //判断数据
  1071. if (isTableRows) {
  1072. uploadSaveLoading.value = false
  1073. window.$message?.warning('请先完善表单信息')
  1074. } else {
  1075. if (tableUploadType.value === 'add') {
  1076. await batchUploadSaveApi(rows)
  1077. } else {
  1078. await batchEditSaveApi(rows)
  1079. }
  1080. }
  1081. } else {
  1082. window.$message?.warning('请先上传文件')
  1083. }
  1084. }
  1085. //确认上传保存
  1086. const batchUploadSaveApi = async (rows) => {
  1087. uploadSaveLoading.value = true
  1088. const {error, code} = await archiveFileApi.batchUploadSave({
  1089. list: rows
  1090. },false)
  1091. //判断状态
  1092. uploadSaveLoading.value = false
  1093. if (!error && code === 200) {
  1094. window.$message?.success('保存成功')
  1095. batchUploadCancel()
  1096. getTableData()
  1097. } else {
  1098. window.$message?.error('保存失败')
  1099. }
  1100. }
  1101. //取消上传
  1102. const batchUploadCancel = () => {
  1103. tableUploadData.value = []
  1104. uploadSaveLoading.value = false
  1105. uploadsLoading.value = false
  1106. showUploadModal.value = false
  1107. }
  1108. //批量编辑
  1109. const batchEditClick = () => {
  1110. const rows = deepClone(tableCheckedKeys.value)
  1111. //判断是否满足条件
  1112. const result = rows.every(({status})=> {
  1113. return status !== 1 && status !== 2
  1114. })
  1115. //判断状态
  1116. if (result) {
  1117. tableUploadType.value = 'edit'
  1118. setTableUploadColumn()
  1119. uploadSaveLoading.value = false
  1120. tableUploadData.value = rows
  1121. showUploadModal.value = true
  1122. } else {
  1123. window.$message?.warning('已上报或已审批的文件不能编辑')
  1124. }
  1125. }
  1126. //确认编辑上传保存
  1127. const batchEditSaveApi = async (rows) => {
  1128. uploadSaveLoading.value = true
  1129. const {error, code} = await archiveFileApi.batchUpdateSort({
  1130. list: rows
  1131. },false)
  1132. //判断状态
  1133. uploadSaveLoading.value = false
  1134. if (!error && code === 200) {
  1135. window.$message?.success('保存成功')
  1136. batchUploadCancel()
  1137. getTableData()
  1138. } else {
  1139. window.$message?.error('保存失败')
  1140. }
  1141. }
  1142. //批量认证
  1143. const CertData = ref([])
  1144. const CertIds = ref([])
  1145. const CertPdf = ref('')
  1146. const CertColumns = [
  1147. {key:'fileName', name: '文件名称'},
  1148. {key:'action', name: '操作', width: 100}
  1149. ]
  1150. //批量认证弹窗
  1151. const showCertificationModal = ref(false)
  1152. const certificationModalClick = () => {
  1153. const rows = tableCheckedKeys.value;
  1154. CertData.value = rows
  1155. CertIds.value = rowsToId(rows)
  1156. CertPdf.value = rows[0]?.pdfFileUrl || ''
  1157. showCertificationModal.value = true
  1158. /*const result = rows.every(({isCertification})=> {
  1159. return isCertification === 0
  1160. })
  1161. if (result) {
  1162. CertData.value = rows
  1163. CertIds.value = rowsToId(rows)
  1164. CertPdf.value = rows[0]?.pdfFileUrl || ''
  1165. showCertificationModal.value = true
  1166. } else {
  1167. window.$message?.warning('已认证的文件不能再认证')
  1168. }*/
  1169. }
  1170. //认证行被点击
  1171. const CertRowClick = ({row}) => {
  1172. const pdfFileUrl = row?.pdfFileUrl || ''
  1173. if (CertPdf.value !== pdfFileUrl) {
  1174. CertPdf.value = pdfFileUrl
  1175. }
  1176. }
  1177. //认证预览被点击
  1178. const CertRowClick2 = ({pdfFileUrl}) => {
  1179. const pdfUrl = pdfFileUrl || ''
  1180. if (CertPdf.value !== pdfUrl) {
  1181. CertPdf.value = pdfUrl
  1182. }
  1183. }
  1184. //确认认证
  1185. const CertLoading = ref(false)
  1186. const CertClick = async () => {
  1187. /*CertLoading.value = true
  1188. const {error, code} = await projectScanningApi.batchCertification({
  1189. ids: CertIds.value
  1190. }, false)
  1191. //判断状态
  1192. CertLoading.value = false
  1193. if (!error && code === 200) {
  1194. window.$message?.success('认证成功')
  1195. showCertificationModal.value = false
  1196. getTableData()
  1197. } else {
  1198. window.$message?.error('认证失败')
  1199. }*/
  1200. }
  1201. //名称被点击
  1202. const tableRowName = (row) => {
  1203. if (row['pdfFileUrl']) {
  1204. window.open(row['pdfFileUrl'], '_blank')
  1205. } else {
  1206. window.$message?.warning('文件不存在')
  1207. }
  1208. }
  1209. //左右拖动,改变树形结构宽度
  1210. const leftWidth = ref(382);
  1211. const onmousedown = () => {
  1212. const leftNum = isCollapse.value ? 142 : 272
  1213. document.onmousemove = (ve) => {
  1214. let diffVal = ve.clientX - leftNum;
  1215. if(diffVal >= 310 && diffVal <= 900) {
  1216. leftWidth.value = diffVal;
  1217. }
  1218. }
  1219. document.onmouseup = () => {
  1220. document.onmousemove = null;
  1221. document.onmouseup = null;
  1222. }
  1223. }
  1224. </script>
  1225. <style lang="scss" scoped>
  1226. @import '~style/file/scoped/collection.scss';
  1227. .flex-center{
  1228. display: flex;
  1229. align-items: center;
  1230. justify-content: center;
  1231. height: 100%;
  1232. flex-direction: column;
  1233. }
  1234. </style>
  1235. <style lang="scss">
  1236. @import '~style/file/collection.scss';
  1237. </style>