query.vue 56 KB

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