records.vue 45 KB

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