query.vue 59 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645
  1. <template>
  2. <div id="carry-spot-checks-layout-target" class="hc-using-query-page">
  3. <div v-show="!isCarrySpotChecksDrawer" class="hc-query-card-box">
  4. <div v-if="isShowheader" class="hc-tag-flex-box">
  5. <div class="hc-arrow-icon">
  6. <HcIcon name="arrow-left-s" />
  7. </div>
  8. <div class="hc-tag-box">
  9. <el-scrollbar>
  10. <div class="scrollbar-content">
  11. <template v-for="(item, index) in tags" :key="index">
  12. <el-tag class="mx-1" closable effect="light" size="large" @close="deltag(item)">
  13. {{ item.name }}
  14. </el-tag>
  15. </template>
  16. </div>
  17. </el-scrollbar>
  18. </div>
  19. <div class="hc-arrow-icon">
  20. <HcIcon name="arrow-right-s" />
  21. </div>
  22. </div>
  23. <div class="hc-query-input-box">
  24. <el-input
  25. v-model="searchInput" clearable placeholder="可按关键字模糊搜索,多个关键字用“,” 隔开"
  26. @clear="clearinput"
  27. >
  28. <template #prepend>
  29. <div class="prepend-filtering" @click="filteringClick">
  30. <span class="name">条件筛选</span>
  31. <HcIcon v-if="filteringShow === 'show'" name="arrow-up-double" />
  32. <HcIcon v-else name="arrow-down-double" />
  33. </div>
  34. </template>
  35. <template #append>
  36. <div class="append-search-btn-box">
  37. <el-button class="search-btn" type="primary" @click="searchCaseClick('1')">
  38. 按案卷查询
  39. </el-button>
  40. <el-button class="search-btn" type="primary" @click="searchFileClick('2')">
  41. 按文件查询
  42. </el-button>
  43. </div>
  44. </template>
  45. </el-input>
  46. <HcMediaMic :loading="tableLoading" class="hc-query-mic" @change="mediaMicChange" />
  47. </div>
  48. <div class="hc-query-filtering-collapse-box">
  49. <div class="filtering-collapse">
  50. <el-collapse v-model="filteringShow" accordion @change="filteringChange">
  51. <el-collapse-item name="show">
  52. <div class="hc-search-hot-key">
  53. <span>热门搜索词汇:</span>
  54. <span
  55. v-for="item in hotInputlist" :key="item.name" class="ml-4"
  56. @click="clickHottitle(item)"
  57. >{{ item.name }}</span>
  58. </div>
  59. <div class="hc-search-screening-item">
  60. <div class="title">类别:</div>
  61. <template v-for="(item, index) in classess" :key="index">
  62. <div
  63. :class="isArrIndex(classes, 'key', item.key) ? 'cut' : ''"
  64. class="screening-key"
  65. @click="classesClick(item)"
  66. >
  67. {{ item.name }}
  68. </div>
  69. </template>
  70. </div>
  71. <div class="hc-search-screening-item">
  72. <div class="title">目录:</div>
  73. <el-button type="primary" @click="nodeTreeClick">
  74. <HcIcon :line="false" name="node-tree" />
  75. <span>目录树</span>
  76. </el-button>
  77. </div>
  78. <div class="hc-search-screening-item">
  79. <div class="title">年度:</div>
  80. <template v-for="(item, index) in annuals" :key="index">
  81. <div
  82. :class="isArrIndex(annual, 'key', item.key) ? 'cut' : ''" class="screening-key"
  83. @click="annualClick(item)"
  84. >
  85. {{ item.name }}
  86. </div>
  87. </template>
  88. </div>
  89. <div class="hc-search-screening-item">
  90. <div class="title">月份:</div>
  91. <template v-for="(item, index) in months" :key="index">
  92. <div
  93. :class="isArrIndex(month, 'key', item.key) ? 'cut' : ''" class="screening-key"
  94. @click="monthClick(item)"
  95. >
  96. {{ item.name }}
  97. </div>
  98. </template>
  99. </div>
  100. <div class="hc-search-screening-item">
  101. <div class="title">期限:</div>
  102. <template v-for="(item, index) in deadlines" :key="index">
  103. <div
  104. :class="isArrIndex(deadline, 'key', item.key) ? 'cut' : ''"
  105. class="screening-key"
  106. @click="deadlineClick(item)"
  107. >
  108. {{ item.name }}
  109. </div>
  110. </template>
  111. </div>
  112. <div class="hc-search-screening-item mb-4">
  113. <div class="title">密级:</div>
  114. <template v-for="(item, index) in securitys" :key="index">
  115. <div
  116. :class="isArrIndex(security, 'key', item.key) ? 'cut' : ''"
  117. class="screening-key"
  118. @click="securityClick(item)"
  119. >
  120. {{ item.name }}
  121. </div>
  122. </template>
  123. </div>
  124. </el-collapse-item>
  125. </el-collapse>
  126. </div>
  127. </div>
  128. <div class="hc-gather-card-box">
  129. <hc-body padding="0px">
  130. <hc-tab-card :tab-key="tabKey" :tabs="tabData" @change="tabChange">
  131. <template #extra>
  132. <el-button v-if="tabKey === 'tab1'" :loading="batchLoading" @click="batchClick">
  133. 下载
  134. </el-button>
  135. <HcNewSwitch
  136. v-if="tabKey === 'tab2'" :datas="tabGuiData" :keys="tabGuiKey" size="default"
  137. @change="tabGuiChange"
  138. />
  139. </template>
  140. <div
  141. v-if="tabKey === 'tab1'" :class="tableAllShow ? 'file-table' : ''"
  142. class="hc-gather-card-table"
  143. >
  144. <div class="hc-card-item-main">
  145. <hc-card-item>
  146. <hc-table
  147. ref="tableRef" :check-style="{ width: 29 }" :column="tableColumn" :datas="tableData"
  148. :index-style="{ width: 60 }" :loading="tableLoading" is-check is-current-row
  149. is-new
  150. @row-click="tableRowClick" @selection-change="tableSelection"
  151. >
  152. <template #action="{ row }">
  153. <el-link
  154. v-if="AppTheme === 'light'" class="mylink" type="primary"
  155. @click.stop="consultFileClick(row, 1)"
  156. >
  157. 查阅案卷
  158. </el-link>
  159. <el-button
  160. v-else size="small" type="primary"
  161. @click.stop="consultFileClick(row, 1)"
  162. >
  163. 查阅案卷
  164. </el-button>
  165. </template>
  166. </hc-table>
  167. <template #action>
  168. <hc-pages :pages="searchForm" @change="pageChange" />
  169. </template>
  170. </hc-card-item>
  171. </div>
  172. <div class="hc-card-item-file">
  173. <hc-card-item title="卷内文件">
  174. <template #extra>
  175. <div class="hc-icon-close text-hover" @click="tableFileCloseClick">
  176. <HcIcon name="close" />
  177. </div>
  178. </template>
  179. <hc-table
  180. ref="tableFileRef" :check-style="{ width: 29 }" :column="tableFileColumn"
  181. :datas="tableFileData"
  182. :index-style="{ width: 60 }" :loading="tableFileLoading" is-check is-new
  183. @selection-change="tableFileSelection"
  184. >
  185. <template #action="{ row }">
  186. <el-link type="primary" @click.stop="consultFileClick(row, 2)">
  187. 查阅文件
  188. </el-link>
  189. </template>
  190. </hc-table>
  191. </hc-card-item>
  192. </div>
  193. </div>
  194. <div v-if="tabKey === 'tab2'" :class="isMac ? 'is-mac' : ''" class="hc-gather-card-table gui">
  195. <div v-loading="tableLoading" class="hc-card-item-main">
  196. <el-carousel
  197. v-if="guiItemData.length > 0" :autoplay="false" :loop="false"
  198. class="hc-file-cabinet" indicator-position="none"
  199. >
  200. <el-carousel-item v-for="(item, index) in guiItemData" :key="index">
  201. <div :class="isVideoShow ? 'hidden' : ''" class="hc-file-cabinet-gui">
  202. <div
  203. v-for="(items, indexs) in item.children" :key="indexs"
  204. class="gui-item"
  205. >
  206. <el-popover
  207. :content="items.content" :hide-after="0" :offset="-10"
  208. :title="`${items.name}柜`"
  209. :width="200" effect="dark" placement="top"
  210. >
  211. <template #reference>
  212. <div class="gui-view" @click="guiItemClick(items)">
  213. <img :src="imageViewGui" alt="">
  214. <span class="num">{{ items.name }}</span>
  215. </div>
  216. </template>
  217. </el-popover>
  218. </div>
  219. </div>
  220. </el-carousel-item>
  221. </el-carousel>
  222. <hc-empty v-else />
  223. <div :class="[isVideoShow ? 'animate__zoomIn' : '']" class="hc-gui-video">
  224. <video ref="videoRef" muted>
  225. <source src="/gui.mp4" type="video/mp4">
  226. </video>
  227. </div>
  228. </div>
  229. </div>
  230. </hc-tab-card>
  231. </hc-body>
  232. </div>
  233. </div>
  234. <!-- 预加载视频 -->
  235. <video class="hc-preloaded-video" muted autoplay>
  236. <source src="/gui.mp4" type="video/mp4">
  237. </video>
  238. <!-- 柜子侧面 -->
  239. <HcDrawer
  240. v-model="isGuiInfoDrawer" direction="rtl" to-id="carry-spot-checks-layout-target"
  241. ui="hc-carry-spot-checks-target" @close="onCloseGuiInfoDrawer"
  242. >
  243. <template #header>
  244. <div class="w-96">
  245. <el-input v-model="searchForm.innerSearch" clearable placeholder="请输入关键词检索" size="large" />
  246. </div>
  247. <div class="ml-2">
  248. <el-button size="large" type="primary" @click="guiInfoSearch">
  249. <HcIcon name="search-2" />
  250. <span>搜索</span>
  251. </el-button>
  252. </div>
  253. </template>
  254. <div v-loading="guiInfoLoading" class="hc-gui-info-drawer">
  255. <div class="hc-gui-info-img">
  256. <div class="gui-info-img">
  257. <img :src="imageViewGui1" alt="">
  258. <div class="gui-file-item-box">
  259. <div v-for="(item, index) in guiInfoData" :key="index" class="gui-file-item">
  260. <template v-for="(items, indexs) in item.children" :key="indexs">
  261. <!-- query 为搜索后的结果进行选中,cur 为点击的选中 -->
  262. <div
  263. :class="[items.isSelect === 1 ? 'query' : '', guiInfoCurKey.id === items.id ? 'cur' : '']"
  264. class="item"
  265. @click="guiFileInfo(items)"
  266. >
  267. {{ items.sideNumber }}
  268. </div>
  269. </template>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. <div class="hc-gui-info-data">
  275. <div class="hc-gui-data-container">
  276. <img :src="imageViewGui2" alt="">
  277. <div class="hc-gui-info-item-box">
  278. <div class="hc-gui-info-item">
  279. <div class="info-item" style="top: 10px">
  280. <div class="title">
  281. <span>档</span>
  282. <span>号:</span>
  283. </div>
  284. <div class="text">{{ guiInfoCurKey.fileNumber }}</div>
  285. </div>
  286. <div class="info-item-name">{{ guiInfoCurKey.name }}</div>
  287. <div class="hc-info-item-bottom">
  288. <div class="info-item">
  289. <div class="title">立卷单位:</div>
  290. <div class="text">{{ guiInfoCurKey.unit }}</div>
  291. </div>
  292. <div class="info-item">
  293. <div class="title">起止日期:</div>
  294. <div
  295. v-if="guiInfoCurKey?.endDate !== null || guiInfoCurKey?.startDate !== null"
  296. class="text"
  297. >
  298. <div>{{ setTimeString(splitDate(guiInfoCurKey?.startDate)) }}~{{ setTimeString(splitDate(guiInfoCurKey?.endDate)) }}</div>
  299. </div>
  300. <div v-else class="text" />
  301. </div>
  302. <div class="info-item">
  303. <div class="title">保管期限:</div>
  304. <div class="text">{{ guiInfoCurKey.storageTimeValue }}</div>
  305. </div>
  306. <div class="info-item">
  307. <div class="title">
  308. <span>密</span>
  309. <span>级:</span>
  310. </div>
  311. <div class="text">{{ guiInfoCurKey.secretLevelValue }}</div>
  312. </div>
  313. </div>
  314. </div>
  315. </div>
  316. </div>
  317. <div class="btn-box">
  318. <el-button
  319. :disabled="guiInfoData.length <= 0" size="large" type="primary"
  320. @click="consultFileClick(guiInfoCurKey, 1)"
  321. >
  322. 打开案卷
  323. </el-button>
  324. <el-button size="large" @click="onCloseGuiInfoDrawer">
  325. <HcIcon name="close" />
  326. <span>关闭</span>
  327. </el-button>
  328. </div>
  329. </div>
  330. </div>
  331. </HcDrawer>
  332. <!-- 展开抽查 -->
  333. <HcDrawer
  334. v-model="isCarrySpotChecksDrawer" to-id="carry-spot-checks-layout-target"
  335. ui="hc-carry-spot-checks-target" @close="onCarrySpotChecksDrawerClose"
  336. >
  337. <div class="hc-carry-spot-checks-pdf">
  338. <!-- <HcPdf src="https://bladex-test-info.oss-cn-chengdu.aliyuncs.com//upload/20221212/ce9799c7d18efc03efefd6f242439f2e.pdf"/> -->
  339. <div v-loading="pdfLoading" class="relative h-full w-full">
  340. <hc-pdfs :url="pdfUrl" />
  341. </div>
  342. <el-tooltip :disabled="!isBubble" content="展开/收起 右侧目录" placement="top">
  343. <div class="hc-csc-pdf-btn" @click="onCarryDataShow">
  344. <HcIcon v-show="isCarryDataShow" name="arrow-right-s" />
  345. <HcIcon v-show="!isCarryDataShow" name="arrow-left-s" />
  346. </div>
  347. </el-tooltip>
  348. </div>
  349. <div v-show="isCarryDataShow" class="hc-carry-spot-checks-data">
  350. <div class="hc-csc-switch">
  351. <HcNewSwitch
  352. :datas="tabTypeTab" :keys="tabTypeKey" :round="false" size="default"
  353. @change="tabTypeChange"
  354. />
  355. </div>
  356. <div class="hc-csc-info-box">
  357. <el-scrollbar>
  358. <div class="hc-info-text-item">
  359. <div class="title">案卷题名:</div>
  360. <div class="content">{{ fileInfo.name }}</div>
  361. </div>
  362. <!-- <div class="hc-info-text-item">
  363. <div class="title">
  364. <span>密</span>
  365. <span class="ml-7">级:</span>
  366. </div>
  367. <div class="content">{{ fileInfo.secretLevelValue }}</div>
  368. </div> -->
  369. <div class="hc-info-text-item">
  370. <div class="title">保管期限:</div>
  371. <div class="content">{{ fileInfo.storageTimeValue }}</div>
  372. </div>
  373. <!-- <div class="hc-info-text-item">
  374. <div class="title">卷内文件:</div>
  375. <div class="content">{{ fileInfo.pageNumber }}</div>
  376. </div> -->
  377. <div class="hc-info-text-item">
  378. <div class="title">起止日期:</div>
  379. <div v-if="fileInfo?.endDate !== '' || fileInfo?.startDate !== ''" class="content">
  380. {{ `${splitDate(fileInfo?.startDate)}~${splitDate(fileInfo?.endDate)}` }}
  381. </div>
  382. <div v-else class="content" />
  383. </div>
  384. <div class="hc-info-text-item">
  385. <div class="title">立卷单位:</div>
  386. <div class="content">{{ fileInfo.unit }}</div>
  387. </div>
  388. </el-scrollbar>
  389. </div>
  390. <div class="hc-csc-data-box-height">
  391. <HcTable
  392. v-if="tabTypeKey === 'tab1'" :column="cscTableColumn1" :datas="cscTableData1"
  393. :is-arr-index="false" :loading="cscTableLoading" is-new
  394. >
  395. <template #name="{ row }">
  396. <div :class="row.id === checkId ? 'bg-orange-400' : 'text-hover'" @click="changePdf(row)">
  397. {{ row?.fileName }}
  398. </div>
  399. </template>
  400. </HcTable>
  401. <HcTable
  402. v-if="tabTypeKey === 'tab2'" :column="cscTableColumn2" :datas="cscTableData2"
  403. :is-arr-index="false" :loading="cscTableLoading" is-new
  404. >
  405. <template #name="{ row }">
  406. <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{ row?.name }}</div>
  407. </template>
  408. </HcTable>
  409. <HcTable
  410. v-if="tabTypeKey === 'tab3'" :column="cscTableColumn3" :datas="cscTableData3"
  411. :is-arr-index="false" :loading="cscTableLoading" is-new
  412. >
  413. <template #name="{ row }">
  414. <div :class="row.id === 2 ? 'text-link' : 'text-hover'">{{ row?.name }}</div>
  415. </template>
  416. </HcTable>
  417. <HcTable
  418. v-if="tabTypeKey === 'tab4'" :column="cscTableColumn4" :datas="cscTableData4"
  419. :is-arr-index="false" :loading="cscTableLoading" is-new
  420. >
  421. <template #name="{ row }">
  422. <div :class="row.id === 2 ? 'text-link' : 'text-hover'" class="hc-csc-associated-row">
  423. <el-tag effect="dark">{{ row?.tag }}</el-tag>
  424. <span class="ml-3">{{ row?.name }}</span>
  425. </div>
  426. </template>
  427. </HcTable>
  428. <MetaTable
  429. v-if="tabTypeKey === 'tab5'" :ishow-file="isFile === 1 ? false : true"
  430. :loading="cscTableLoading" :meta-data-table="cscmetaDataTabledata"
  431. />
  432. <HcTable
  433. v-if="tabTypeKey === 'tab6'" :column="cscTableColumn5" :datas="cscTableData5"
  434. :index-style="{ width: 60 }" :loading="cscTableLoading" is-new
  435. />
  436. <el-tooltip
  437. v-if="tabTypeKey === 'tab6' || tabTypeKey === 'tab5'" :disabled="!isBubble"
  438. content="使用弹窗查看数据" placement="top"
  439. >
  440. <div class="hc-table-info-btn" @click="cscTableDataModalShow">
  441. <HcIcon name="airplay" />
  442. </div>
  443. </el-tooltip>
  444. </div>
  445. <div class="hc-csc-action-box-height">
  446. <div class="btn-box">
  447. <el-button hc-btn size="large" style="height: 40px; padding: 0 15px;" type="warning" @click="onCarrySpotChecksDrawerClose">
  448. <HcIcon name="close" />
  449. <span>取消查阅</span>
  450. </el-button>
  451. </div>
  452. </div>
  453. </div>
  454. </HcDrawer>
  455. <!-- 使用弹窗查看数据 -->
  456. <hc-new-dialog
  457. v-model="cscTableDataModal" :footer="false" :title="cscTableDataTitle" is-table widths="1080px"
  458. @close="cscTableDataModalClose"
  459. >
  460. <MetaTable
  461. v-if="tabTypeKey === 'tab5'" :ishow-file="isFile === 1 ? false : true" :loading="cscTableLoading"
  462. :meta-data-table="cscmetaDataTabledata"
  463. />
  464. <HcTable
  465. v-if="tabTypeKey === 'tab6'" :column="cscTableColumn51" :datas="cscTableData5"
  466. :index-style="{ width: 60 }" :loading="cscTableLoading" is-new
  467. />
  468. </hc-new-dialog>
  469. <!-- 目录树 -->
  470. <hc-new-dialog
  471. v-model="nodeTreeModal" :is-close="false" is-table save-text="确认" widths="1080px"
  472. @close="nodeTreeModalClose" @save="nodeTreeModalSave"
  473. >
  474. <template #header>
  475. <div class="el-dialog__title" role="heading">
  476. <span class="mr-3">选择目录</span>
  477. <span class="text-sm text-orange">点击左侧黄色文件夹可展开下一级</span>
  478. </div>
  479. </template>
  480. <template #extra>
  481. <HcNewSwitch :datas="nodeTabData" :keys="nodeTabKey" :round="false" @change="nodeTabChange" />
  482. </template>
  483. <el-collapse
  484. v-model="activeName" v-loading="nodeTreeArrLoad" class="hc-node-tree-collapse"
  485. @change="collapseChange"
  486. >
  487. <template v-for="(item, index) in nodeTreeArr" :key="index">
  488. <el-collapse-item :disabled="item.notExsitChild === true" :name="item.id.toString()">
  489. <template #title>
  490. <div class="hc-collapse-item-title">
  491. <el-checkbox
  492. v-model="item.checkColId" style="font-size: 24px;"
  493. @change="changeCheckColId(item, index)" @click.stop.native="() => {}"
  494. />
  495. <HcIcon v-if="item.notExsitChild === true" class="icon" fill name="file" />
  496. <HcIcon v-else class="icon" fill name="folder-3" />
  497. <span class="title">{{ item.nodeName }}</span>
  498. </div>
  499. </template>
  500. <el-tree
  501. ref="nodetreeEl" v-loading="nodetreeElloading" :data="item.Nodetreedata" :load="loadNode"
  502. :props="defaultProps" class="col_tree" lazy node-key="id" show-checkbox
  503. >
  504. <template #default="{ node, data }">
  505. <span class="custom-tree-node">
  506. <HcIcon
  507. v-if="data.notExsitChild === true" class="icon" fill name="file"
  508. style="color: #FFAF2D;"
  509. />
  510. <HcIcon v-else class="icon" fill name="folder-3" style="color: #FFAF2D;" />
  511. <span>{{ node.label }}</span>
  512. </span>
  513. </template>
  514. </el-tree>
  515. </el-collapse-item>
  516. </template>
  517. </el-collapse>
  518. <hc-empty v-if="nodeTreeArr.length === 0" />
  519. </hc-new-dialog>
  520. </div>
  521. </template>
  522. <script setup>
  523. import { onMounted, ref, watch } from 'vue'
  524. import { useAppStore } from '~src/store'
  525. import { arrIndex, arrToId, downloadBlob, getArrValue, getObjValue, isArrIndex, isNullES } from 'js-fast-way'
  526. import MetaTable from '../transfer/components/meta-table.vue'
  527. import HcMediaMic from './components/media-mic/index.vue'
  528. import archiveQueryApi from '~api/using/query.js'
  529. import tuningApi from '~api/archiveConfig/tuning.js'
  530. import imageViewGui from '~src/assets/view/gui.png'
  531. import imageViewGui1 from '~src/assets/view/gui1.png'
  532. import imageViewGui2 from '~src/assets/view/gui2.png'
  533. import { setTimeString } from '~src/utils/tools'
  534. //变量
  535. const useAppState = useAppStore()
  536. const projectId = ref(useAppState.getProjectId)
  537. const contractId = ref(useAppState.getContractId)
  538. const contractInfo = ref(useAppState.getContractInfo)
  539. const isBubble = ref(useAppState.getBubble)
  540. const isShowheader = ref(false)
  541. const tags = ref([])
  542. const userAgent = navigator.userAgent
  543. const isMac = userAgent.indexOf('Mac') !== -1
  544. const AppTheme = ref(useAppState.getTheme)
  545. //监听
  546. watch(() => [useAppState.getBubble, tags.value, useAppState.getTheme], ([bubble, Tags, theme]) => {
  547. isBubble.value = bubble
  548. AppTheme.value = theme
  549. isShowheader.value = Tags.length !== 0
  550. })
  551. //渲染完成
  552. onMounted(() => {
  553. getCarrierTypeByDictdata()
  554. setAnnuals()
  555. setMonths()
  556. getTableData()
  557. })
  558. //截取日期
  559. const splitDate = (val) => {
  560. if (val) {
  561. return val?.substring(0, 10)
  562. } else {
  563. return ''
  564. }
  565. }
  566. //处理数据
  567. const rowsToArr = (rows) => {
  568. let newArr = []
  569. for (let i = 0; i < rows.length; i++) {
  570. newArr.push(rows[i]?.key)
  571. }
  572. return newArr.join(',')
  573. }
  574. const deltag = (item) => {
  575. tags.value = tags.value.filter((ele) => {
  576. if (item.name !== ele.name) {
  577. return item
  578. }
  579. })
  580. //设置年份
  581. annual.value = annual.value.filter((ele) => {
  582. if (item.name !== ele.name) {
  583. return item
  584. }
  585. })
  586. yeararr.value = yeararr.value.filter((ele) => {
  587. if (item.name !== ele.name) {
  588. return item
  589. }
  590. })
  591. searchForm.value.year = rowsToArr(annual.value)
  592. if (annual.value.length === 0) {
  593. annual.value = [{ key: 'all', name: '所有' }]
  594. }
  595. //设置月份
  596. month.value = month.value.filter((ele) => {
  597. if (item.name !== ele.name) {
  598. return item
  599. }
  600. })
  601. montharr.value = montharr.value.filter((ele) => {
  602. if (item.name !== ele.name) {
  603. return item
  604. }
  605. })
  606. searchForm.value.month = rowsToArr(month.value)
  607. if (month.value.length == 0) {
  608. month.value = [{ key: 'all', name: '所有' }]
  609. }
  610. //设置保管期限
  611. deadline.value = deadline.value.filter((ele) => {
  612. if (item.name !== ele.name) {
  613. return item
  614. }
  615. })
  616. deadlinearr.value = deadlinearr.value.filter((ele) => {
  617. if (item.name !== ele.name) {
  618. return item
  619. }
  620. })
  621. searchForm.value.storageTime = rowsToArr(deadline.value)
  622. if (deadline.value.length == 0) {
  623. deadline.value = [{ key: 'all', name: '所有' }]
  624. }
  625. //设置密级
  626. security.value = security.value.filter((ele) => {
  627. if (item.name !== ele.name) {
  628. return item
  629. }
  630. })
  631. securityarr.value = securityarr.value.filter((ele) => {
  632. if (item.name !== ele.name) {
  633. return item
  634. }
  635. })
  636. searchForm.value.secretLevel = rowsToArr(security.value)
  637. if (security.value.length == 0) {
  638. security.value = [{ key: 'all', name: '所有' }]
  639. }
  640. //设置类别
  641. classes.value = classes.value.filter((ele) => {
  642. if (item.name !== ele.name) {
  643. return item
  644. }
  645. })
  646. classesarr.value = classesarr.value.filter((ele) => {
  647. if (item.name !== ele.name) {
  648. return item
  649. }
  650. })
  651. searchForm.value.carrierType = rowsToArr(classes.value)
  652. if (classes.value.length == 0) {
  653. classes.value = [{ key: 'all', name: '所有' }]
  654. }
  655. }
  656. //搜索表单
  657. const searchForm = ref({
  658. current: 1, size: 20, total: 0, searchType: '1', listType: 1, archiveType: '', cabinetNumber: '', innerSearch: '',
  659. })
  660. //卷内文件
  661. const InsearchForm = ref({
  662. current: 1, size: 20, total: 0,
  663. })
  664. //热门搜索词汇
  665. const hotInputlist = ref([
  666. { name: '文件名' },
  667. { name: '案卷名' },
  668. { name: '档号' },
  669. { name: '单位' },
  670. ])
  671. const clickHottitle = (item) => {
  672. searchInput.value = item.name
  673. searchForm.value.queryValue = item.name
  674. }
  675. const clearinput = () => {
  676. searchForm.value.searchType = '1'
  677. getTableData()
  678. }
  679. //年度
  680. const annuals = ref([])
  681. const setAnnuals = () => {
  682. let annualArr = [{ key: 'all', name: '所有' }]
  683. const year = new Date().getFullYear()
  684. for (let i = 0; i < 8; i++) {
  685. const item = year - i + ''
  686. annualArr.push({
  687. key: item,
  688. name: item + '年',
  689. })
  690. }
  691. annuals.value = annualArr
  692. }
  693. //数组去重
  694. const some = (arr) => {
  695. let some = []
  696. arr.forEach(el => {
  697. if (!some.some(e => e.name == el.name)) {
  698. some.push(el)
  699. }
  700. })
  701. return some
  702. }
  703. const allarr = ref([])
  704. const montharr = ref([])
  705. const yeararr = ref([])
  706. const deadlinearr = ref([])
  707. const securityarr = ref([])
  708. const classesarr = ref([])
  709. const setTags = (val, type) => {
  710. let arr = []
  711. val.forEach((item) => {
  712. if (item.name !== '所有') {
  713. arr.push({ name: item.name })
  714. }
  715. })
  716. let filarr = some(arr)
  717. if (type === 'month') {
  718. montharr.value = some(filarr)
  719. if (montharr.value.length == 0) {
  720. month.value = [{ key: 'all', name: '所有' }]
  721. }
  722. } else if (type === 'year') {
  723. yeararr.value = some(filarr)
  724. if (yeararr.value.length == 0) {
  725. annual.value = [{ key: 'all', name: '所有' }]
  726. }
  727. } else if (type === 'deadline') {
  728. deadlinearr.value = some(filarr)
  729. if (deadlinearr.value.length == 0) {
  730. deadline.value = [{ key: 'all', name: '所有' }]
  731. }
  732. } else if (type === 'security') {
  733. securityarr.value = some(filarr)
  734. if (securityarr.value.length == 0) {
  735. security.value = [{ key: 'all', name: '所有' }]
  736. }
  737. } else if (type === 'classes') {
  738. classesarr.value = some(filarr)
  739. if (classesarr.value.length == 0) {
  740. classes.value = [{ key: 'all', name: '所有' }]
  741. }
  742. }
  743. let finalarr = []
  744. yeararr.value.forEach((item) => {
  745. finalarr.push({ name: item.name })
  746. })
  747. montharr.value.forEach((item) => {
  748. finalarr.push({ name: item.name })
  749. })
  750. deadlinearr.value.forEach((item) => {
  751. finalarr.push({ name: item.name })
  752. })
  753. securityarr.value.forEach((item) => {
  754. finalarr.push({ name: item.name })
  755. })
  756. classesarr.value.forEach((item) => {
  757. finalarr.push({ name: item.name })
  758. })
  759. tags.value = some(finalarr)
  760. }
  761. const annual = ref([{ key: 'all', name: '所有' }])
  762. const annualClick = (item) => {
  763. annual.value = setQueryFiltering(annual.value, item)
  764. setTags(annual.value, 'year')
  765. searchForm.value.year = item.name
  766. let arr = []
  767. annual.value.forEach((item) => {
  768. arr.push(item.key)
  769. })
  770. searchForm.value.year = arr + ''
  771. }
  772. //月份
  773. const months = ref([])
  774. const setMonths = () => {
  775. let monthArr = [{ key: 'all', name: '所有' }]
  776. for (let i = 0; i < 12; i++) {
  777. let item = (i + 1) + ''
  778. item.length === 1 && (item = item)
  779. monthArr.push({
  780. key: item,
  781. name: item + '月',
  782. })
  783. }
  784. months.value = monthArr
  785. }
  786. const month = ref([{ key: 'all', name: '所有' }])
  787. const monthClick = (item) => {
  788. month.value = setQueryFiltering(month.value, item)
  789. setTags(month.value, 'month')
  790. let arr = []
  791. month.value.forEach((item) => {
  792. arr.push(item.key)
  793. })
  794. searchForm.value.month = arr + ''
  795. }
  796. //期限
  797. const deadline = ref([{ key: 'all', name: '所有' }])
  798. const deadlines = ref([
  799. { key: 'all', name: '所有' },
  800. { key: '3', name: '永久' },
  801. { key: '2', name: '30年' },
  802. { key: '1', name: '10年' },
  803. ])
  804. const deadlineClick = (item) => {
  805. deadline.value = setQueryFiltering(deadline.value, item)
  806. setTags(deadline.value, 'deadline')
  807. let arr = []
  808. deadline.value.forEach((item) => {
  809. arr.push(item.key)
  810. })
  811. searchForm.value.storageTime = arr + ''
  812. }
  813. //密级
  814. const security = ref([{ key: 'all', name: '所有' }])
  815. const securitys = ref([
  816. { key: 'all', name: '所有' },
  817. { key: '1', name: '机密' },
  818. { key: '2', name: '绝密' },
  819. { key: '3', name: '秘密' },
  820. { key: '4', name: '公开' },
  821. ])
  822. const securityClick = (item) => {
  823. security.value = setQueryFiltering(security.value, item)
  824. setTags(security.value, 'security')
  825. let arr = []
  826. security.value.forEach((item) => {
  827. arr.push(item.key)
  828. })
  829. searchForm.value.secretLevel = arr + ''
  830. }
  831. //类别
  832. const classes = ref([{ key: 'all', name: '所有' }])
  833. const classess = ref([{ key: 'all', name: '所有' }])
  834. const getCarrierTypeByDictdata = async () => {
  835. const { error, code, data } = await archiveQueryApi.getCarrierTypeByDict()
  836. tableLoading.value = false
  837. if (!error && code === 200) {
  838. let arrdata = getArrValue(data)
  839. arrdata.forEach((ele) => {
  840. classess.value.push({ key: ele.dictKey, name: ele.dictValue })
  841. })
  842. }
  843. }
  844. const classesClick = (item) => {
  845. classes.value = setQueryFiltering(classes.value, item)
  846. setTags(classes.value, 'classes')
  847. let arr = []
  848. classes.value.forEach((item) => {
  849. arr.push(item.key)
  850. })
  851. searchForm.value.carrierType = arr + ''
  852. }
  853. //设置筛选条件
  854. const setQueryFiltering = (arr, { key, name }) => {
  855. if (key === 'all') {
  856. //如果选择所有,就删除其他
  857. arr = [{ key, name }]
  858. tags.value = tags.value.filter((item) => {
  859. if (item.name.indexOf === -1) {
  860. return item
  861. }
  862. })
  863. } else {
  864. //选中还是取消
  865. const index = arrIndex(arr, 'key', key)
  866. if (index !== -1) {
  867. arr.splice(index, 1)
  868. } else {
  869. arr.push({ key, name })
  870. }
  871. //如果存在所有,就删除所有。
  872. if (arr.length > 1) {
  873. const isAll = arrIndex(arr, 'key', 'all')
  874. if (isAll !== -1) {
  875. arr.splice(isAll, 1)
  876. }
  877. }
  878. }
  879. return arr
  880. }
  881. //目录树
  882. const nodeTreeClick = () => {
  883. nodeTreeModal.value = true
  884. getnodeTabData()
  885. }
  886. const nodeTreeModal = ref(false)
  887. const nodeTreeModalClose = () => {
  888. nodeTreeModal.value = false
  889. activeName.value = []
  890. }
  891. //确认
  892. const nodeTreeModalSave = () => {
  893. const allCheckIds = arrToId(nodeTreeArr.value.filter((item) => item.checkColId)).split(',')
  894. let halfKeys = []
  895. nodeTreeArr.value.forEach((ele, index) => {
  896. if (ele.checkColId === false) {
  897. let keys = nodetreeEl.value[index].getCheckedKeys()
  898. keys.forEach((ele) => {
  899. halfKeys.push(ele)
  900. })
  901. }
  902. })
  903. const ids = [...allCheckIds, ...halfKeys]
  904. searchForm.value.nodeIds = ids.join(',')
  905. nodeTreeModal.value = false
  906. activeName.value = []
  907. }
  908. //搜索筛选
  909. const filteringShow = ref('')
  910. const filteringChange = (name) => {
  911. filteringShow.value = name
  912. }
  913. //条件筛选
  914. const filteringClick = () => {
  915. if (filteringShow.value) {
  916. filteringShow.value = ''
  917. } else {
  918. filteringShow.value = 'show'
  919. }
  920. }
  921. const searchInput = ref('')
  922. //按文件查询
  923. const searchFileClick = (type) => {
  924. filteringShow.value = ''
  925. searchForm.value.searchType = type
  926. getTableData()
  927. }
  928. //按案卷查询
  929. const searchCaseClick = (type) => {
  930. filteringShow.value = ''
  931. searchForm.value.searchType = type
  932. getTableData()
  933. }
  934. //tab数据和相关处理
  935. const tabKey = ref('tab1')
  936. const tabData = ref([
  937. { key: 'tab1', name: '案卷列表' },
  938. { key: 'tab2', name: '档案柜' },
  939. ])
  940. const tabChange = ({ key }) => {
  941. tabKey.value = key
  942. searchForm.value.current = 1
  943. const { contractType } = contractInfo.value
  944. if (key === 'tab1') {
  945. searchForm.value.listType = 1
  946. searchForm.value.archiveType = ''
  947. }
  948. //档案柜
  949. if (key === 'tab2') {
  950. searchForm.value.listType = 2
  951. //1 施工,2监理,3业主
  952. if (Number(contractType) === 1) {
  953. tabGuiKey.value = '2'
  954. } else if (Number(contractType) === 2) {
  955. tabGuiKey.value = '3'
  956. } else if (Number(contractType) === 3) {
  957. tabGuiKey.value = '1'
  958. }
  959. searchForm.value.archiveType = tabGuiKey.value
  960. }
  961. getTableData()
  962. }
  963. //分页被点击
  964. const pageChange = ({ current, size }) => {
  965. searchForm.value.current = current
  966. searchForm.value.size = size
  967. getTableData()
  968. }
  969. //分页被点击
  970. const InpageChange = ({ current, size }) => {
  971. InsearchForm.value.current = current
  972. InsearchForm.value.size = size
  973. // getTableData()
  974. }
  975. //表头
  976. const tableRef = ref(null)
  977. const tableColumn = ref([
  978. { key: 'fileNumber', name: '档号', width: 160 },
  979. { key: 'name', name: '题名' },
  980. { key: 'secretLevelValue', name: '密级', width: 90, align: 'center' },
  981. { key: 'storageTimeValue', name: '保管期限', width: 100, align: 'center' },
  982. { key: 'pageN', name: '页数', width: 90, align: 'center' },
  983. { key: 'unit', name: '立卷单位', width: 160 },
  984. { key: 'action', name: '操作', width: 100, align: 'center', fixed: 'right' },
  985. ])
  986. const tableData = ref([])
  987. const pdfUrl = ref('')
  988. const pdfLoading = ref(false)
  989. const tableLoading = ref(false)
  990. const getTableData = async () => {
  991. guiItemData.value = []
  992. tableLoading.value = true
  993. searchForm.value.queryValue = searchInput.value
  994. for (let key in searchForm.value) {
  995. if (searchForm.value[key] === 'all' || searchForm.value[key] === '所有') {
  996. searchForm.value[key] = ''
  997. }
  998. }
  999. const { error, code, data } = await archiveQueryApi.getarchiveQueryPage({
  1000. ...searchForm.value,
  1001. projectId: projectId.value,
  1002. contractId: contractId.value,
  1003. })
  1004. tableLoading.value = false
  1005. if (!error && code === 200) {
  1006. if (tabKey.value === 'tab1') {
  1007. tableData.value = getArrValue(data['records'])
  1008. searchForm.value.total = data['total'] || 0
  1009. } else {
  1010. guiItemData.value = getArrValue(data)
  1011. }
  1012. } else {
  1013. if (tabKey.value === 'tab1') {
  1014. tableData.value = []
  1015. searchForm.value.total = 0
  1016. } else {
  1017. guiItemData.value = []
  1018. }
  1019. }
  1020. //案卷列表
  1021. if (tabKey.value === 'tab1') {
  1022. tableFileCloseClick()
  1023. if (searchForm.value.searchType === '2') {
  1024. if (tableData.value.length > 0 && tableData.value[0]?.approvalFileList.length > 0) {
  1025. // tableFileData.value =getArrValue( tableData.value[0]['approvalFileList'])
  1026. let searchinput = searchForm.value.queryValue
  1027. // let allarr=getArrValue( tableData.value[0]['approvalFileList'])
  1028. fileInfo.value.id = tableData.value[0]['id']
  1029. getArchiveFileListData().then()
  1030. let filterarr = allarr.value.filter((item) => {
  1031. if (item.fileName.indexOf(searchinput) !== -1) {
  1032. return item
  1033. }
  1034. })
  1035. tableFileData.value = getArrValue(filterarr)
  1036. tableAllShow.value = true
  1037. tableFileShow.value = true
  1038. }
  1039. }
  1040. }
  1041. }
  1042. //多选
  1043. const tableKeys = ref([])
  1044. const tableSelection = (rows) => {
  1045. tableKeys.value = rows
  1046. }
  1047. const tableAllShow = ref(false)
  1048. const tableAllShowClick = () => {
  1049. tableFileShow.value = false
  1050. tableAllShow.value = !tableAllShow.value
  1051. }
  1052. //表头
  1053. const tableFileRef = ref(null)
  1054. const tableFileColumn = ref([
  1055. { key: 'fileNumber', name: '文件编号', width: 180 },
  1056. { key: 'fileName', name: '文件题名' },
  1057. { key: 'fileTime', name: '文件日期', width: 120 },
  1058. { key: 'dutyUser', name: '责任者', width: 120 },
  1059. { key: 'filePage', name: '页数', width: 120 },
  1060. { key: 'action', name: '操作', width: 120 },
  1061. ])
  1062. const tableFileData = ref([])
  1063. //获取卷内文件数据
  1064. const getArchiveFileListData = async () => {
  1065. tableFileLoading.value = true
  1066. const { error, code, msg, data } = await archiveQueryApi.getArchiveFileList({
  1067. id: fileInfo.value.id, //案卷id
  1068. })
  1069. tableFileLoading.value = false
  1070. //处理返回数据
  1071. if (!error && code === 200) {
  1072. fileInfo.value.pageNumber = data.pageNumber
  1073. tableFileData.value = getArrValue(data['approvalFileList'])
  1074. cscTableData1.value = getArrValue(data['approvalFileList'])
  1075. pdfUrl.value = tableFileData.value[0]?.pdfFileUrl
  1076. checkId.value = tableFileData.value[0]?.id
  1077. } else {
  1078. tableFileData.value = []
  1079. cscTableData1.value = []
  1080. pdfUrl.value = ''
  1081. checkId.value = ''
  1082. }
  1083. }
  1084. const tableFileLoading = ref(false)
  1085. const tableFileSelection = (rows) => {
  1086. console.log(rows)
  1087. }
  1088. //表格行被点击
  1089. const tableFileShow = ref(false)
  1090. const tableRowClick = ({ row }) => {
  1091. tableAllShow.value = true
  1092. tableFileShow.value = true
  1093. fileInfo.value = row
  1094. getArchiveFileListData()
  1095. }
  1096. const tableFileCloseClick = () => {
  1097. tableAllShow.value = false
  1098. tableFileShow.value = false
  1099. }
  1100. const viewPdf = async (id, row) => {
  1101. // if (outUrl.indexOf(',') === -1) {
  1102. // return outUrl
  1103. // }
  1104. // window.$message?.info('预览案卷需要合并pdf,需要一点时间')
  1105. // pdfLoading.value = true
  1106. // const { error, code, data, msg } = await tuningApi.printArchive({
  1107. // id: id,
  1108. // })
  1109. // pdfLoading.value = false
  1110. // if (!error && code === 200) {
  1111. // if (data) {
  1112. // return data
  1113. // } else {
  1114. // window.$message?.warning('文件不存在')
  1115. // }
  1116. // }
  1117. //展示卷内文件的第一个
  1118. }
  1119. const isFile = ref('')//查阅案卷或者查阅文件
  1120. const checkId = ref('')
  1121. const consultFileClick = async (row, type) => {
  1122. if (type === 1) {
  1123. //查阅案卷
  1124. getArchivesAutoView(row.id)
  1125. fileInfo.value = row
  1126. await getArchiveFileListData()
  1127. isCarrySpotChecksDrawer.value = true
  1128. // const url = await viewPdf(row.id, row)
  1129. // pdfUrl.value = url
  1130. // checkId.value = ''
  1131. } else if (type == 2) {//查阅卷内文件
  1132. checkId.value = row.id
  1133. pdfUrl.value = row.pdfFileUrl
  1134. getmetaInfo(checkId.value)
  1135. isCarrySpotChecksDrawer.value = true
  1136. }
  1137. isFile.value = type
  1138. }
  1139. const isCarrySpotChecksDrawer = ref(false)
  1140. const fileInfo = ref({
  1141. name: '',
  1142. storageTimeValue: '',
  1143. secretLevelValue: '',
  1144. filePage: '',
  1145. unit: '',
  1146. time: '',
  1147. pageN: 0,
  1148. })//案卷信息
  1149. const changePdf = (row) => {
  1150. console.log(row, 'row')
  1151. if (pdfLoading.value === true) {
  1152. pdfLoading.value = false
  1153. }
  1154. pdfUrl.value = row['pdfFileUrl'] || ''
  1155. checkId.value = row.id
  1156. isFile.value = 2
  1157. getmetaInfo(checkId.value)
  1158. }
  1159. //类型tab数据和相关处理
  1160. const tabTypeKey = ref('tab1')
  1161. const tabTypeTab = ref([
  1162. { key: 'tab1', name: '卷内文件' },
  1163. { key: 'tab2', name: '竣工资料' },
  1164. { key: 'tab3', name: '计量资料' },
  1165. { key: 'tab4', name: '关联资料' },
  1166. { key: 'tab5', name: '元数据' },
  1167. { key: 'tab6', name: '验签包' },
  1168. ])
  1169. const tabTypeChange = ({ key }) => {
  1170. tabTypeKey.value = key
  1171. }
  1172. const cscTableLoading = ref(false)
  1173. //卷内目录
  1174. const cscTableColumn1 = [
  1175. { key: 'name', name: '卷内文件题名', align: 'center' },
  1176. ]
  1177. const cscTableData1 = ref([])
  1178. //竣工资料
  1179. const cscTableColumn2 = [
  1180. { key: 'name', name: '竣工图资料', align: 'center' },
  1181. ]
  1182. const cscTableData2 = ref([])
  1183. //计量资料
  1184. const cscTableColumn3 = [
  1185. { key: 'name', name: '计量资料', align: 'center' },
  1186. ]
  1187. const cscTableData3 = ref([
  1188. // {id: 1, name: 'ZB2-17.pdf'},
  1189. // {id: 2, name: 'ZB2-18.pdf'},
  1190. // {id: 3, name: 'ZB2-19.pdf'},
  1191. // {id: 4, name: 'ZB2-20.pdf'},
  1192. // {id: 5, name: 'ZB2-21.pdf'},
  1193. // {id: 6, name: 'ZB2-22.pdf'},
  1194. // {id: 7, name: 'ZB2-23.pdf'}
  1195. ])
  1196. //计量资料
  1197. const cscTableColumn4 = [
  1198. { key: 'name', name: '关联文件', align: 'center' },
  1199. ]
  1200. const cscTableData4 = ref([
  1201. // {id: 1, name: 'xxxxxxxxxxxxxxxxxxx.pdf', tag: '开工'},
  1202. // {id: 2, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '工序'},
  1203. // {id: 3, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '评定'},
  1204. // {id: 4, name: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx.pdf', tag: '交工'},
  1205. // {id: 5, name: '', tag: '抽检'},
  1206. // {id: 6, name: '', tag: '隐蔽'}
  1207. ])
  1208. //验签包
  1209. const cscTableColumn5 = [
  1210. { key: 'user', name: '签名者' },
  1211. { key: 'time', name: '签名时间' },
  1212. { key: 'val', name: '摘要' },
  1213. ]
  1214. const cscTableColumn51 = [
  1215. { key: 'user', name: '签名者', width: 300 },
  1216. { key: 'time', name: '签名时间', width: 200 },
  1217. { key: 'val', name: '摘要' },
  1218. ]
  1219. const cscTableData5 = ref([])
  1220. //抽检意见
  1221. const reform = ref({
  1222. type: false, content: '',
  1223. })
  1224. //显示右侧目录
  1225. const isCarryDataShow = ref(true)
  1226. const onCarryDataShow = () => {
  1227. isCarryDataShow.value = !isCarryDataShow.value
  1228. }
  1229. //使用弹窗查看数据
  1230. const cscTableDataModal = ref(false)
  1231. const cscTableDataTitle = ref('')
  1232. //显示弹窗
  1233. const cscTableDataModalShow = () => {
  1234. const key = tabTypeKey.value
  1235. if (key === 'tab5') {
  1236. cscTableDataTitle.value = '元数据'
  1237. if (isFile.value == 1) {
  1238. getArchivesAutoView(fileInfo.value.id)
  1239. } else {
  1240. getmetaInfo(checkId.value)
  1241. }
  1242. } else if (key === 'tab6') {
  1243. cscTableDataTitle.value = '验签包'
  1244. }
  1245. cscTableDataModal.value = true
  1246. }
  1247. //关闭弹窗
  1248. const cscTableDataModalClose = () => {
  1249. cscTableDataModal.value = false
  1250. }
  1251. //关闭抽查
  1252. const onCarrySpotChecksDrawerClose = () => {
  1253. isCarrySpotChecksDrawer.value = false
  1254. pdfUrl.value = ''
  1255. }
  1256. //tab数据和相关处理
  1257. const nodeTabKey = ref('1')
  1258. const nodeTabData = ref([
  1259. { key: '1', name: '业主档案' },
  1260. { key: '2', name: '施工档案' },
  1261. { key: '3', name: '监理档案' },
  1262. { key: '4', name: '文书档案' },
  1263. ])
  1264. const nodeTabChange = (item) => {
  1265. nodeTabKey.value = item?.key
  1266. getnodeTabData()
  1267. activeName.value = []
  1268. }
  1269. //获取目录树getArchiveTreeByNodeType
  1270. const checkColId = ref(false)
  1271. const checkNodeid = ref('')
  1272. const singleId = ref('')
  1273. // }
  1274. const changeCheckColId = async (item) => {
  1275. const ids = arrToId(Nodetreedata.value).split(',')
  1276. // if (item.checkColId) {
  1277. // nextTick(()=>{
  1278. // nodetreeEl?.value[treeIndex.value].setCheckedKeys(ids, true)
  1279. // })
  1280. // } else {
  1281. // nodetreeEl?.value[treeIndex.value].setCheckedKeys([], false)
  1282. // }
  1283. }
  1284. const nodeTreeArrLoad = ref(false)
  1285. const getnodeTabData = async () => {
  1286. nodeTreeArrLoad.value = true
  1287. const { error, code, data } = await archiveQueryApi.getArchiveTreeByNodeType({
  1288. nodeType: nodeTabKey.value,
  1289. projectId: projectId.value,
  1290. contractId: contractId.value,
  1291. })
  1292. if (!error && code === 200) {
  1293. console.log(data, 'mulushu')
  1294. nodeTreeArr.value = getArrValue(data)
  1295. nodeTreeArr.value.forEach((item) => {
  1296. item.checkColId = false
  1297. })
  1298. nodeTreeArrLoad.value = false
  1299. } else {
  1300. nodeTreeArr.value = []
  1301. nodeTreeArrLoad.value = false
  1302. }
  1303. }
  1304. const defaultProps = {
  1305. children: 'children',
  1306. label: 'nodeName',
  1307. isLeaf: 'notExsitChild',
  1308. }
  1309. const Nodetreedata = ref([])
  1310. const nodetreeEl = ref(null)
  1311. const activeName = ref('')
  1312. const nodeTreeArr = ref([])
  1313. const treeIndex = ref(0)
  1314. const collapseChange = async (key) => {
  1315. checkNodeid.value = key[key.length - 1]
  1316. await getNodetreedata()
  1317. }
  1318. const nodetreeElloading = ref(false)
  1319. const getNodetreedata = async () => {
  1320. nodetreeElloading.value = true
  1321. const { error, code, data } = await archiveQueryApi.getChildrenNodeByNodeId({
  1322. nodeId: checkNodeid.value,
  1323. })
  1324. nodetreeElloading.value = false
  1325. if (!error && code === 200) {
  1326. Nodetreedata.value = getArrValue(data)
  1327. } else {
  1328. Nodetreedata.value = []
  1329. }
  1330. nodeTreeArr.value.forEach((ele) => {
  1331. if (ele.id === checkNodeid.value) {
  1332. ele.Nodetreedata = Nodetreedata.value
  1333. }
  1334. })
  1335. }
  1336. const checkNodeids = ref([])
  1337. const loadNode = (tree, resolve) => {
  1338. archiveQueryApi.getChildrenNodeByNodeId({ nodeId: tree.data.id }).then((response) => {
  1339. let resdata = getArrValue(response.data)
  1340. resolve(resdata)
  1341. })
  1342. }
  1343. //档案柜的tab数据和相关处理
  1344. const tabGuiKey = ref('1')
  1345. const tabGuiData = ref([
  1346. { key: '1', name: '业主档案' },
  1347. { key: '2', name: '施工档案' },
  1348. { key: '3', name: '监理档案' },
  1349. ])
  1350. const tabGuiChange = async ({ key }) => {
  1351. const { error, code, msg } = await archiveQueryApi.getArchivesAuthByUser({
  1352. archiveType: key, //1业主2施工3监理
  1353. projectId: projectId.value,
  1354. contractId: contractId.value,
  1355. }, false)
  1356. //处理返回数据
  1357. if (!error && code === 200) {
  1358. tabGuiKey.value = key
  1359. searchForm.value.current = 1
  1360. searchForm.value.archiveType = tabGuiKey.value
  1361. getTableData().then()
  1362. } else {
  1363. window.$message.error(msg)
  1364. }
  1365. }
  1366. //测试档案柜的数据
  1367. const guiItemData = ref([])
  1368. const searchGuiId = ref('')
  1369. //柜子被点击
  1370. const guiInfoLoading = ref(false)
  1371. const isGuiInfoDrawer = ref(false)
  1372. const guiItemClick = (item) => {
  1373. //同步转异步
  1374. playVideo().then(res => {
  1375. isGuiInfoDrawer.value = res
  1376. })
  1377. //处理参数
  1378. guiInfoLoading.value = true
  1379. searchGuiId.value = item.id
  1380. searchForm.value.queryValue = searchInput.value
  1381. for (let key in searchForm.value) {
  1382. if (searchForm.value[key] === 'all' || searchForm.value[key] === '所有') {
  1383. searchForm.value[key] = ''
  1384. }
  1385. }
  1386. //发起请求, 同步转异步
  1387. archiveQueryApi.getarchiveQueryPage({
  1388. ...searchForm.value,
  1389. cabinetNumber: item.id,
  1390. projectId: projectId.value,
  1391. contractId: contractId.value,
  1392. }).then(({ error, code, data }) => {
  1393. //处理返回数据
  1394. if (!error && code === 200) {
  1395. const arrData = getArrValue(data)
  1396. guiInfoData.value = arrData
  1397. if (arrData.length > 0) {
  1398. const children = getArrValue(arrData[0]?.children)
  1399. guiInfoCurKey.value = children[0]
  1400. } else {
  1401. guiInfoCurKey.value = {}
  1402. }
  1403. guiInfoLoading.value = false
  1404. } else {
  1405. guiInfoLoading.value = false
  1406. guiInfoCurKey.value = {}
  1407. guiInfoData.value = []
  1408. }
  1409. })
  1410. }
  1411. //播放视频
  1412. const videoRef = ref(null)
  1413. const isVideoShow = ref(false)
  1414. const playVideo = () => {
  1415. return new Promise((resolve) => {
  1416. //播放视频
  1417. isVideoShow.value = true
  1418. videoRef.value?.play()
  1419. //播放结束
  1420. videoRef.value?.addEventListener('ended', () => {
  1421. setTimeout(() => {
  1422. isVideoShow.value = false
  1423. }, 2000)
  1424. resolve(true)
  1425. })
  1426. })
  1427. }
  1428. //柜子内部搜索
  1429. const guiInfoSearch = async () => {
  1430. guiInfoLoading.value = true
  1431. //处理参数
  1432. searchForm.value.queryValue = searchInput.value
  1433. for (let key in searchForm.value) {
  1434. if (searchForm.value[key] === 'all' || searchForm.value[key] === '所有') {
  1435. searchForm.value[key] = ''
  1436. }
  1437. }
  1438. //发起请求
  1439. const { error, code, data } = await archiveQueryApi.getarchiveQueryPage({
  1440. ...searchForm.value,
  1441. cabinetNumber: searchGuiId.value,
  1442. projectId: projectId.value,
  1443. contractId: contractId.value,
  1444. })
  1445. //处理返回数据
  1446. if (!error && code === 200) {
  1447. const arrData = getArrValue(data)
  1448. guiInfoData.value = arrData
  1449. if (arrData.length > 0) {
  1450. const children = getArrValue(arrData[0]?.children)
  1451. guiInfoCurKey.value = children[0]
  1452. } else {
  1453. guiInfoCurKey.value = {}
  1454. }
  1455. guiInfoLoading.value = false
  1456. } else {
  1457. guiInfoLoading.value = false
  1458. guiInfoCurKey.value = {}
  1459. guiInfoData.value = []
  1460. }
  1461. }
  1462. //关闭抽屉
  1463. const onCloseGuiInfoDrawer = () => {
  1464. isGuiInfoDrawer.value = false
  1465. searchForm.value.innerSearch = ''
  1466. }
  1467. //案卷文件数据
  1468. const guiInfoCurKey = ref({})
  1469. const guiInfoData = ref([])
  1470. //点击档案
  1471. const guiFileInfo = (item) => {
  1472. guiInfoCurKey.value = item
  1473. }
  1474. //获取元数据
  1475. const cscmetaTableLoading = ref(false)
  1476. const cscmetaDataTabledata = ref([])
  1477. //获取文件元数据信息
  1478. const getmetaInfo = async (fileId) => {
  1479. console.log(fileId, 'fileId')
  1480. cscmetaTableLoading.value = true
  1481. const { error, code, data } = await tuningApi.getMetadataFileByid({
  1482. fileId,
  1483. })
  1484. cscmetaTableLoading.value = false
  1485. if (!error && code === 200) {
  1486. cscmetaDataTabledata.value = getArrValue(data)
  1487. } else {
  1488. cscmetaDataTabledata.value = []
  1489. }
  1490. }
  1491. //获取案卷元数据信息
  1492. const getArchivesAutoView = async (fileId) => {
  1493. cscmetaTableLoading.value = true
  1494. const { error, code, data } = await tuningApi.getArchivesAutoView({
  1495. id: fileId,
  1496. })
  1497. cscmetaTableLoading.value = false
  1498. if (!error && code === 200) {
  1499. let obj = getObjValue(data)
  1500. cscmetaDataTabledata.value = [
  1501. { containerName: '题名', keyValue: '', isType: 3 },
  1502. { containerName: '档号', keyValue: obj?.fileNumber, isType: 2 },
  1503. { containerName: '文件件数', keyValue: obj?.fileN, isType: 2 },
  1504. { containerName: '移交时间', keyValue: '', isType: 2 },
  1505. ]
  1506. } else {
  1507. cscmetaDataTabledata.value = []
  1508. }
  1509. }
  1510. //语音搜索
  1511. const mediaMicChange = (data) => {
  1512. searchInput.value = data.queryValue
  1513. searchForm.value.searchType = 1
  1514. searchForm.value.current = 1
  1515. Object.keys(data).forEach(key => {
  1516. searchForm.value[key] = data[key]
  1517. })
  1518. getTableData()
  1519. }
  1520. //批量下载档案
  1521. const batchLoading = ref(false)
  1522. const batchClick = async () => {
  1523. const ids = arrToId(tableKeys.value)
  1524. batchLoading.value = true
  1525. const { res, msg, headers } = await archiveQueryApi.batchDownloadFileToZip(
  1526. { ids: ids },
  1527. )
  1528. batchLoading.value = false
  1529. if (res) {
  1530. downloadBlob(res, headers['content-disposition'], 'application/zip')
  1531. window.$message.success('下载成功')
  1532. }
  1533. }
  1534. </script>
  1535. <style lang="scss">
  1536. @import '~style/using/query.scss';
  1537. @import '~src/styles/theme/using/query.scss';
  1538. </style>