query.vue 56 KB

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