testing.vue 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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>26%</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">查看</el-link>
  122. </div>
  123. </div>
  124. <div class="statusboxitem_bottom">
  125. <span>开启检测</span>
  126. <el-switch
  127. v-model="openvalue"
  128. style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
  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">查看</el-link>
  147. </div>
  148. </div>
  149. <div class="statusboxitem_bottom">
  150. <span>开启检测</span>
  151. <el-switch
  152. v-model="openvalue"
  153. style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
  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">查看</el-link>
  172. </div>
  173. </div>
  174. <div class="statusboxitem_bottom">
  175. <span>检测范围</span>
  176. <el-switch
  177. v-model="openvalue"
  178. style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
  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">查看</el-link>
  197. </div>
  198. </div>
  199. <div class="statusboxitem_bottom">
  200. <span>开启检测</span>
  201. <el-switch
  202. v-model="openvalue"
  203. style="--el-switch-on-color: #13ce66; --el-switch-off-color: #ff4949"
  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 #key3="{row}">
  225. <i class="ri-checkbox-circle-fill" v-if="row.key3" 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. </div>
  233. </template>
  234. <script setup>
  235. import {ref, watch, onMounted} from "vue";
  236. import {useAppStore} from "~src/store";
  237. import bgColor from '~src/assets/view/bgcolor.svg';
  238. import testBgbig from '~src/assets/view/testBgbig.png';
  239. import testBgsamll from '~src/assets/view/testBgsamll.png';
  240. import HcCard1 from './components/hc-card1.vue'
  241. import HcTable1 from './components/hc-table1.vue'
  242. import reportApi from "~api/custody/testing.js";
  243. import {getArrValue, getObjValue, isArrIndex} from "js-fast-way"
  244. //变量
  245. const useAppState = useAppStore()
  246. const projectId = ref(useAppState.getProjectId);
  247. const contractId = ref(useAppState.getContractId);
  248. const projectInfo = ref(useAppState.getProjectInfo);
  249. const openvalue = ref(true);
  250. const isStatus = ref(true);
  251. const activeIndex = ref(2);
  252. //表头
  253. const tableRef = ref(null)
  254. const tableColumn = ref([
  255. {key:'key1', name: '检测项目'},
  256. {key:'key2', name: '不合格统计',width:150,align:'center'},
  257. {key:'key3', name: '检测结果',width:150,align:'center'},
  258. ])
  259. const tableData = ref([
  260. {
  261. id: 1,
  262. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  263. key2:3,
  264. key3: true,
  265. },
  266. {
  267. id: 1,
  268. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  269. key2:3,
  270. key3: true,
  271. },
  272. {
  273. id: 1,
  274. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  275. key2:3,
  276. key3: true,
  277. },
  278. {
  279. id: 1,
  280. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  281. key2:3,
  282. key3: true,
  283. },
  284. {
  285. id: 1,
  286. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  287. key2:3,
  288. key3: false,
  289. },
  290. ,
  291. {
  292. id: 1,
  293. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  294. key2:3,
  295. key3: false,
  296. },
  297. ,
  298. {
  299. id: 1,
  300. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  301. key2:3,
  302. key3: false,
  303. },
  304. ,
  305. {
  306. id: 1,
  307. key1: '初步设计外业验收有关文件、工程初步设计图纸、初步设计批复、初步设计审查咨询报告',
  308. key2:3,
  309. key3: false,
  310. },
  311. ])
  312. //获取数据
  313. const tableLoading = ref(false)
  314. //一键检测
  315. const reportId=ref(0)
  316. const detectionLoad=ref(false)
  317. const detection=async()=>{
  318. console.log('一键检测');
  319. detectionLoad.value=true
  320. const { error, code, data } = await reportApi.getExamining({
  321. projectId: projectId.value,
  322. reportId:reportId.value
  323. })
  324. detectionLoad.value=false
  325. if (!error && code === 200) {
  326. activeIndex.value=data['status']
  327. isStatus.value=false
  328. } else {
  329. }
  330. }
  331. //渲染完成
  332. onMounted(() => {
  333. getReportData()
  334. })
  335. //消息数量
  336. const props = defineProps(
  337. {
  338. msgCount: {
  339. // type: Object,
  340. // default: () => ({ })
  341. },
  342. }
  343. )
  344. const menumsgCount = ref(props.msgCount)
  345. //监听
  346. //监听
  347. watch(() => [
  348. props.msgCount,
  349. ], ([val]) => {
  350. console.log(val,'val');
  351. menumsgCount.value = val
  352. activeIndex.value=val.status
  353. }
  354. )
  355. //渲
  356. const stepClick = (index) => {
  357. activeIndex.value = index;
  358. if (index==0) {
  359. isStatus.value=true
  360. }
  361. }
  362. //历史报告
  363. const visible = ref(false)
  364. const showReport=()=>{
  365. visible.value=!visible.value
  366. }
  367. const historyRportlist=ref([])
  368. //获取历史报告列表
  369. const reportLoading = ref(false)
  370. const getReportData = async () => {
  371. reportLoading.value = true
  372. const { error, code, data } = await reportApi.getReportList({
  373. projectId: projectId.value,
  374. })
  375. reportLoading.value = false
  376. if (!error && code === 200) {
  377. historyRportlist.value = getArrValue(data)
  378. console.log(data,'data');
  379. } else {
  380. historyRportlist.value = []
  381. }
  382. }
  383. //查看历史报告
  384. const viewHpdf=(item)=>{
  385. if(item.reportPdfUrl){
  386. window.open(item.reportPdfUrl, '_blank')
  387. }else{
  388. window.$message.warning('暂无pdf')
  389. }
  390. }
  391. </script>
  392. <style lang="scss" scoped>
  393. .statusbox{
  394. margin-top: 30px;
  395. display: flex;
  396. justify-content: space-around;
  397. align-items:flex-end;
  398. min-height: 280px;
  399. // height: 28vh;
  400. // height: 350px;
  401. width: 80%;
  402. text-align: center;
  403. // border: 1px solid red;
  404. margin: 0 auto;
  405. .statusboxitem{
  406. width: 15%;
  407. background-size: 100% 100%;
  408. border-radius: 5px;
  409. font-size: 14px;
  410. padding: 10px;
  411. .statusboxitem_top{
  412. height: 85%;
  413. border-bottom: 2px solid white;
  414. .statusboxitem_top_first{
  415. height: 80%;
  416. display: flex;
  417. flex-direction: column;
  418. align-items: center;
  419. justify-content: center;
  420. .title{
  421. font-weight: bold;
  422. color:white;
  423. font-size: 1rem;
  424. }
  425. }
  426. .statusboxitem_top_second{
  427. display: flex;
  428. justify-content: space-between;
  429. align-items: center;
  430. line-height: 50px;
  431. color:black;
  432. }
  433. }
  434. .statusboxitem_bottom{
  435. display: flex;
  436. justify-content: space-between;
  437. align-items: center;
  438. // line-height: 50px;
  439. color:black;
  440. }
  441. }
  442. }
  443. .bannerbox{
  444. // height: 50vh;
  445. width: 100%;
  446. // border:1px solid red;
  447. background-size: 100% 100%;
  448. border-radius: 5px;
  449. aspect-ratio: 1993/597;
  450. // aspect-ratio: 619/150;
  451. padding: 20px;
  452. position: relative;
  453. margin-bottom: 30px;
  454. .infobox{
  455. width: 100%;
  456. // line-height: 30px;
  457. color: white;
  458. font-weight: bold;
  459. // position: absolute;
  460. }
  461. .circlebox{
  462. position: absolute;
  463. top: 31%;
  464. left:42.2%;
  465. width:17.5%;
  466. height: 58.4%;
  467. // width: 27.5vh;
  468. // height: 27.5vh;
  469. z-index: 67;
  470. border: 2px solid white;
  471. border-radius: 50%;
  472. box-shadow: 0 0 10px 15px rgba(255, 255, 255, 0.9);
  473. margin: 0 auto;
  474. display: flex;
  475. justify-content: center;
  476. align-items: center;
  477. color: white;
  478. font-weight: bolder;
  479. font-size: 30px;
  480. cursor: pointer;
  481. box-sizing: border-box;
  482. }
  483. .circlebox1{
  484. top: 38%;
  485. left:45.5%;
  486. // width: 20vh;
  487. // height: 20vh;
  488. font-size: 2.55rem;
  489. width: 12%;
  490. height: 51.1%;
  491. background-color: rgb(189, 49, 36);
  492. }
  493. .circlebox2{
  494. background: rgb(129, 179, 55);
  495. top: 38%;
  496. left:45.5%;
  497. // width: 20vh;
  498. // height: 20vh;
  499. width: 12%;
  500. height: 51.1%;
  501. }
  502. }
  503. .hc-card-box.el-card:not(.is-header) .el-card__body {
  504. height: 100%;
  505. background-color: white !important;
  506. }
  507. .progress{
  508. height: 40vh;
  509. .progressbox{
  510. width: 100%;
  511. display: flex;
  512. }
  513. .tablebox{
  514. padding: 20px;
  515. margin-top: 30px;
  516. height: 90%;
  517. }
  518. }
  519. .hc-steps-view .el-steps {
  520. .el-step.is-horizontal .el-step__line {
  521. height: 4px;
  522. top: 14px;
  523. }
  524. .el-step__line-inner {
  525. border-width: 2px !important;
  526. }
  527. .el-step__icon {
  528. width: 32px;
  529. height: 32px;
  530. font-size: 18px;
  531. }
  532. .el-step__icon.is-text {
  533. border: 3px solid;
  534. }
  535. .el-step__head.is-finish {
  536. color: #1ECC95;
  537. border-color: #1ECC95;
  538. }
  539. .el-step__title.is-finish {
  540. color: #1ECC95;
  541. }
  542. }
  543. .history_box{
  544. display: flex;
  545. justify-content: space-between;
  546. align-items: center;
  547. border-bottom: 1px solid gray;
  548. height: 30px;
  549. line-height: 30px;
  550. }
  551. .m15{
  552. margin-left: 15px;
  553. }
  554. .reportPop{
  555. max-height: 280px !important;
  556. overflow-y: auto;
  557. }
  558. </style>