query.vue 57 KB

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