testing.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <template>
  2. <div class="hc-page-box" style="backgroundcolor:white">
  3. <HcCard1 scrollbar >
  4. <div class="bannerbox" :style="`background-image: url(${testBgbig});`" v-if="isStatus">
  5. <div class="infobox">
  6. <el-row>
  7. <el-col :span="20">
  8. <div >
  9. [1]文书档案检测一般要求:DA/T 70-2018
  10. </div>
  11. </el-col>
  12. <!-- <el-col :span="3" :offset="1"><div style="text-align:right">历史报告</div></el-col> -->
  13. <el-col :span="3" :offset="1">
  14. <div style="text-align:right">
  15. <el-tooltip :visible="visible" effect="light" >
  16. <template #content >
  17. <div class="reportPop" v-if="historyRportlist.length>0" v-loading="reportLoading">
  18. <div class="history_box" v-for="item in historyRportlist">
  19. <el-link type="primary" @click="viewHpdf(item)">{{ item.reportName }}</el-link>
  20. <span class="m15">{{ item.examiningTime }}</span>
  21. </div>
  22. </div>
  23. <div v-else>暂无数据</div>
  24. </template>
  25. <el-button type="primary" @click="showReport">
  26. 历史报告
  27. </el-button>
  28. </el-tooltip>
  29. </div>
  30. </el-col>
  31. </el-row>
  32. <el-row>
  33. <el-col :span="24">
  34. <div >
  35. [2]电子档案"四性"检测要求及其实现方法[j].浙江档案
  36. </div>
  37. </el-col>
  38. </el-row>
  39. <el-row>
  40. <el-col :span="24">
  41. <div >
  42. 制定系统电子文件归档真实性、完整性、可用性、安全性检测服务
  43. </div>
  44. </el-col>
  45. </el-row>
  46. </div>
  47. <div class="circlebox" @click="detection" >
  48. <span v-loading="detectionLoad"> 一键检测</span>
  49. </div>
  50. </div>
  51. <div class="bannerbox " :style="`background-image: url(${testBgsamll}); aspect-ratio: 1993/468;`" v-if="!isStatus">
  52. <div class="infobox">
  53. <el-row >
  54. <el-col :span="20">
  55. <div >
  56. [1]文书档案检测一般要求:DA/T 70-2018
  57. </div>
  58. </el-col>
  59. <el-col :span="3" :offset="1">
  60. <div style="text-align:right">
  61. <el-tooltip :visible="visible" effect="light" >
  62. <template #content >
  63. <div class="reportPop" v-if="historyRportlist.length>0" v-loading="reportLoading">
  64. <div class="history_box" v-for="item in historyRportlist">
  65. <el-link type="primary" @click="viewHpdf(item)">{{ item.reportName }}</el-link>
  66. <span class="m15">{{ item.examiningTime }}</span>
  67. </div>
  68. </div>
  69. <div v-else>暂无数据</div>
  70. </template>
  71. <el-button type="primary" @click="showReport">
  72. 历史报告
  73. </el-button>
  74. </el-tooltip>
  75. </div>
  76. </el-col>
  77. </el-row>
  78. <el-row>
  79. <el-col :span="24">
  80. <div >
  81. [2]电子档案"四性"检测要求及其实现方法[j].浙江档案
  82. </div>
  83. </el-col>
  84. </el-row>
  85. <el-row>
  86. <el-col :span="24">
  87. <div >
  88. 制定系统电子文件归档真实性、完整性、可用性、安全性检测服务
  89. </div>
  90. </el-col>
  91. </el-row>
  92. </div>
  93. <el-tooltip
  94. class="box-item"
  95. effect="light"
  96. content="系统正在检测运行中,请勿终止操作"
  97. placement="right-start"
  98. :visible="activeIndex==2||activeIndex==3"
  99. >
  100. <div class="circlebox circlebox2" v-if="activeIndex===4">
  101. <span>100%</span>
  102. </div>
  103. <div class="circlebox circlebox1" v-else>
  104. <span>{{ statusPercent }}</span>
  105. </div>
  106. </el-tooltip>
  107. </div>
  108. <div class="statusbox" v-if="isStatus">
  109. <div class="statusboxitem" :style="`background-image: url(${bgColor});`">
  110. <div class="statusboxitem_top">
  111. <div class="statusboxitem_top_first">
  112. <div style=" font-size: 5.25rem;color :white;">
  113. <i class="ri-checkbox-multiple-line"></i>
  114. </div>
  115. <div class="title">
  116. 真实性检测
  117. </div>
  118. </div>
  119. <div class="statusboxitem_top_second">
  120. <span>检测范围</span>
  121. <el-link type="success" :underline="false" @click="viewDialogTrue(1)">查看</el-link>
  122. </div>
  123. </div>
  124. <div class="statusboxitem_bottom">
  125. <span>开启检测</span>
  126. <el-switch
  127. v-model="openTruevalue"
  128. style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66"
  129. active-value="100"
  130. inactive-value="0"
  131. />
  132. </div>
  133. </div>
  134. <div class="statusboxitem" :style="`background-image: url(${bgColor});`">
  135. <div class="statusboxitem_top">
  136. <div class="statusboxitem_top_first">
  137. <div style=" font-size: 5.25rem;color :white;">
  138. <i class="ri-radio-button-line"></i>
  139. </div>
  140. <div class="title">
  141. 完整性检测
  142. </div>
  143. </div>
  144. <div class="statusboxitem_top_second">
  145. <span>检测范围</span>
  146. <el-link type="success" :underline="false" @click="viewDialogTrue(2)">查看</el-link>
  147. </div>
  148. </div>
  149. <div class="statusboxitem_bottom">
  150. <span>开启检测</span>
  151. <el-switch
  152. v-model="openFullvalue"
  153. style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66"
  154. active-value="100"
  155. inactive-value="0"
  156. />
  157. </div>
  158. </div>
  159. <div class="statusboxitem" :style="`background-image: url(${bgColor});`">
  160. <div class="statusboxitem_top">
  161. <div class="statusboxitem_top_first">
  162. <div style=" font-size: 5.25rem;color :white;">
  163. <i class="ri-chat-upload-fill"></i>
  164. </div>
  165. <div class="title">
  166. 可用性检测
  167. </div>
  168. </div>
  169. <div class="statusboxitem_top_second">
  170. <span>检测范围</span>
  171. <el-link type="success" :underline="false" @click="viewDialogTrue(3)">查看</el-link>
  172. </div>
  173. </div>
  174. <div class="statusboxitem_bottom">
  175. <span>检测范围</span>
  176. <el-switch
  177. v-model="openUsevalue"
  178. style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66"
  179. active-value="100"
  180. inactive-value="0"
  181. />
  182. </div>
  183. </div>
  184. <div class="statusboxitem" :style="`background-image: url(${bgColor});`">
  185. <div class="statusboxitem_top">
  186. <div class="statusboxitem_top_first">
  187. <div style=" font-size: 5.25rem;color :white;">
  188. <i class="ri-shield-cross-line"></i>
  189. </div>
  190. <div class="title">
  191. 安全性检测
  192. </div>
  193. </div>
  194. <div class="statusboxitem_top_second">
  195. <span>检测范围</span>
  196. <el-link type="success" :underline="false" @click="viewDialogTrue(4)">查看</el-link>
  197. </div>
  198. </div>
  199. <div class="statusboxitem_bottom">
  200. <span>开启检测</span>
  201. <el-switch
  202. v-model="openSafevalue"
  203. style="--el-switch-on-color: #ff4949; --el-switch-off-color: #13ce66"
  204. active-value="100"
  205. inactive-value="0"
  206. />
  207. </div>
  208. </div>
  209. </div>
  210. <div class="progress" v-else>
  211. <div class="progressbox">
  212. <div class="hc-steps-view" style="width:100%;display:flex">
  213. <el-steps :active="activeIndex" align-center style="width:90%">
  214. <el-step title="初始化" @click="stepClick(1)"/>
  215. <el-step title="检测中" @click="stepClick(2)"/>
  216. <el-step title="生成报告" @click="stepClick(3)"/>
  217. <el-step title="完成" @click="stepClick(4)"/>
  218. </el-steps>
  219. <el-button type="success" v-if="activeIndex===4">查看报告</el-button>
  220. </div>
  221. </div>
  222. <div class="tablebox">
  223. <HcTable1 ref="tableRef" :column="tableColumn" :datas="tableData" :loading="tableLoading">
  224. <template #examiningResult="{row}">
  225. <i class="ri-checkbox-circle-fill" v-if="row.examiningResult===0" style="color:green"> </i>
  226. <i class="ri-error-warning-fill" v-else style="color:rgb(189, 49, 36);"></i>
  227. </template>
  228. </HcTable1>
  229. </div>
  230. </div>
  231. </HcCard1>
  232. <!-- 查看弹窗 -->
  233. <HcDialog :show="imageDialog" :title="imageTitle" widths="990px" :footer="false" @close="imageDialogClose">
  234. <div >
  235. <el-image style="width: 100%; height: 100%" :src="Imageurl" />
  236. </div>
  237. </HcDialog>
  238. </div>
  239. </template>
  240. <script setup>
  241. import {ref, watch, onMounted} from "vue";
  242. import {useAppStore} from "~src/store";
  243. import bgColor from '~src/assets/view/bgcolor.svg';
  244. import testBgbig from '~src/assets/view/testBgbig.png';
  245. import testBgsamll from '~src/assets/view/testBgsamll.png';
  246. import HcCard1 from './components/hc-card1.vue'
  247. import HcTable1 from './components/hc-table1.vue'
  248. import reportApi from "~api/custody/testing.js";
  249. import {getArrValue, toParse, getObjValue, isArrIndex} from "js-fast-way"
  250. import truePng from '~src/assets/testphoto/true.png';
  251. import fullPng from '~src/assets/testphoto/full.png';
  252. import usePng from '~src/assets/testphoto/use.png';
  253. import safePng from '~src/assets/testphoto/safe.png';
  254. //变量
  255. const useAppState = useAppStore()
  256. const projectId = ref(useAppState.getProjectId);
  257. const contractId = ref(useAppState.getContractId);
  258. const projectInfo = ref(useAppState.getProjectInfo);
  259. const openTruevalue = ref(false);
  260. const openFullvalue = ref(true);
  261. const openUsevalue = ref(true);
  262. const openSafevalue = ref(true);
  263. const isStatus = ref(true);
  264. const activeIndex = ref(0);
  265. //表头
  266. const tableRef = ref(null)
  267. const tableColumn = ref([
  268. {key:'examiningItem', name: '检测项目'},
  269. {key:'unqualifiedCount', name: '不合格统计',width:150,align:'center'},
  270. {key:'examiningResult', name: '检测结果',width:150,align:'center'},
  271. ])
  272. const tableData = ref([])
  273. //获取数据
  274. const tableLoading = ref(false)
  275. //一键检测
  276. const reportId=ref(0)
  277. const detectionLoad=ref(false)
  278. const detection=async()=>{
  279. detectionLoad.value=true
  280. const { error, code, data } = await reportApi.getExamining({
  281. projectId: projectId.value,
  282. reportId:reportId.value
  283. })
  284. detectionLoad.value=false
  285. if (!error && code === 200) {
  286. activeIndex.value=data['status']
  287. reportId.value=data['id']
  288. isStatus.value=false
  289. } else {
  290. window?.$message?.error('操作失败')
  291. }
  292. }
  293. //渲染完成
  294. onMounted(() => {
  295. getReportData()
  296. getReportStatusdata()
  297. })
  298. //获取检测报告状态
  299. const getReportStatusdata=async()=>{
  300. const { error, code, data } = await reportApi.getReportStatus({
  301. projectId: projectId.value,
  302. })
  303. if (!error && code === 200) {
  304. console.log(data,'data');
  305. if(data===-1){
  306. activeIndex.value=0
  307. }else{
  308. reportId.value=data
  309. isStatus.value=false
  310. // reportId.value=data
  311. }
  312. }
  313. }
  314. //消息数量
  315. const props = defineProps(
  316. {
  317. msgCount: {
  318. // type: Object,
  319. // default: () => ({ })
  320. },
  321. }
  322. )
  323. //检测百分比
  324. const statusPercent=ref('25%')
  325. //监听
  326. watch(() => [
  327. props.msgCount,
  328. activeIndex
  329. ], ([val,index]) => {
  330. const res = toParse(val)
  331. // console.log(val,'val消息信息');
  332. if(res) {
  333. activeIndex.value = res.status;
  334. tableData.value=res.detailList
  335. }
  336. console.log(index.value,'index');
  337. if(index.value===1){
  338. statusPercent.value='25%'
  339. }else if(index.value===2){
  340. statusPercent.value='50%'
  341. }else if(index.value===3){
  342. statusPercent.value='75%'
  343. }else if(index.value===4){
  344. statusPercent.value='100%'
  345. }
  346. }
  347. )
  348. //渲
  349. const stepClick = (index) => {
  350. // activeIndex.value = index;
  351. // if (index==0) {
  352. // isStatus.value=true
  353. // }
  354. }
  355. //历史报告
  356. const visible = ref(false)
  357. const showReport=()=>{
  358. visible.value=!visible.value
  359. }
  360. const historyRportlist=ref([])
  361. //获取历史报告列表
  362. const reportLoading = ref(false)
  363. const getReportData = async () => {
  364. reportLoading.value = true
  365. const { error, code, data } = await reportApi.getReportList({
  366. projectId: projectId.value,
  367. })
  368. reportLoading.value = false
  369. if (!error && code === 200) {
  370. historyRportlist.value = getArrValue(data)
  371. console.log(data,'data');
  372. } else {
  373. historyRportlist.value = []
  374. }
  375. }
  376. //查看历史报告
  377. const viewHpdf=(item)=>{
  378. console.log(item,'item');
  379. if(item.reportPdfUrl){
  380. window.open(item.reportPdfUrl, '_blank')
  381. }else{
  382. window.$message.warning('暂无pdf')
  383. }
  384. }
  385. //查看真实图片
  386. const imageDialog=ref(false)
  387. const Imageurl=ref('')
  388. const imageTitle=ref('')
  389. const viewDialogTrue=(type)=>{
  390. imageDialog.value=true
  391. if(type===1){
  392. Imageurl.value=truePng
  393. imageTitle.value='真实性检测范围'
  394. }else if(type===2){
  395. Imageurl.value=fullPng
  396. imageTitle.value='完整性检测范围'
  397. }else if(type===3){
  398. Imageurl.value=usePng
  399. imageTitle.value='可以性检测范围'
  400. }else{
  401. Imageurl.value=safePng
  402. imageTitle.value='安全性检测范围'
  403. }
  404. }
  405. const imageDialogClose=()=>{
  406. imageDialog.value=false
  407. }
  408. </script>
  409. <style lang="scss" scoped>
  410. .statusbox{
  411. margin-top: 30px;
  412. display: flex;
  413. justify-content: space-around;
  414. align-items:flex-end;
  415. min-height: 280px;
  416. // height: 28vh;
  417. // height: 350px;
  418. width: 80%;
  419. text-align: center;
  420. // border: 1px solid red;
  421. margin: 0 auto;
  422. .statusboxitem{
  423. width: 15%;
  424. background-size: 100% 100%;
  425. border-radius: 5px;
  426. font-size: 14px;
  427. padding: 10px;
  428. .statusboxitem_top{
  429. height: 85%;
  430. border-bottom: 2px solid white;
  431. .statusboxitem_top_first{
  432. height: 80%;
  433. display: flex;
  434. flex-direction: column;
  435. align-items: center;
  436. justify-content: center;
  437. .title{
  438. font-weight: bold;
  439. color:white;
  440. font-size: 1rem;
  441. }
  442. }
  443. .statusboxitem_top_second{
  444. display: flex;
  445. justify-content: space-between;
  446. align-items: center;
  447. line-height: 50px;
  448. color:black;
  449. }
  450. }
  451. .statusboxitem_bottom{
  452. display: flex;
  453. justify-content: space-between;
  454. align-items: center;
  455. // line-height: 50px;
  456. color:black;
  457. }
  458. }
  459. }
  460. .bannerbox{
  461. // height: 50vh;
  462. width: 100%;
  463. // border:1px solid red;
  464. background-size: 100% 100%;
  465. border-radius: 5px;
  466. aspect-ratio: 1993/597;
  467. // aspect-ratio: 619/150;
  468. padding: 20px;
  469. position: relative;
  470. margin-bottom: 30px;
  471. .infobox{
  472. width: 100%;
  473. // line-height: 30px;
  474. color: white;
  475. font-weight: bold;
  476. // position: absolute;
  477. }
  478. .circlebox{
  479. position: absolute;
  480. top: 31%;
  481. left:42.2%;
  482. width:17.5%;
  483. height: 58.4%;
  484. // width: 27.5vh;
  485. // height: 27.5vh;
  486. z-index: 67;
  487. border: 2px solid white;
  488. border-radius: 50%;
  489. box-shadow: 0 0 10px 15px rgba(255, 255, 255, 0.9);
  490. margin: 0 auto;
  491. display: flex;
  492. justify-content: center;
  493. align-items: center;
  494. color: white;
  495. font-weight: bolder;
  496. font-size: 30px;
  497. cursor: pointer;
  498. box-sizing: border-box;
  499. }
  500. .circlebox1{
  501. top: 38%;
  502. left:45.5%;
  503. // width: 20vh;
  504. // height: 20vh;
  505. font-size: 2.55rem;
  506. width: 12%;
  507. height: 51.1%;
  508. background-color: rgb(189, 49, 36);
  509. }
  510. .circlebox2{
  511. background: rgb(129, 179, 55);
  512. top: 38%;
  513. left:45.5%;
  514. // width: 20vh;
  515. // height: 20vh;
  516. width: 12%;
  517. height: 51.1%;
  518. }
  519. }
  520. .hc-card-box.el-card:not(.is-header) .el-card__body {
  521. height: 100%;
  522. background-color: white !important;
  523. }
  524. .progress{
  525. height: 40vh;
  526. .progressbox{
  527. width: 100%;
  528. display: flex;
  529. }
  530. .tablebox{
  531. padding: 20px;
  532. margin-top: 30px;
  533. height: 90%;
  534. }
  535. }
  536. .hc-steps-view .el-steps {
  537. .el-step.is-horizontal .el-step__line {
  538. height: 4px;
  539. top: 14px;
  540. }
  541. .el-step__line-inner {
  542. border-width: 2px !important;
  543. }
  544. .el-step__icon {
  545. width: 32px;
  546. height: 32px;
  547. font-size: 18px;
  548. }
  549. .el-step__icon.is-text {
  550. border: 3px solid;
  551. }
  552. .el-step__head.is-finish {
  553. color: #1ECC95;
  554. border-color: #1ECC95;
  555. }
  556. .el-step__title.is-finish {
  557. color: #1ECC95;
  558. }
  559. }
  560. .history_box{
  561. display: flex;
  562. justify-content: space-between;
  563. align-items: center;
  564. border-bottom: 1px solid gray;
  565. height: 30px;
  566. line-height: 30px;
  567. }
  568. .m15{
  569. margin-left: 15px;
  570. }
  571. .reportPop{
  572. max-height: 280px !important;
  573. overflow-y: auto;
  574. }
  575. </style>