risk-tasks-work.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664
  1. <template>
  2. <a-layout :class="$style.page">
  3. <a-layout-header :class="$style.header">
  4. <div :class="$style.headerTitle" :title="taskName">{{ taskName }}</div>
  5. <a-menu
  6. v-if="loadShow"
  7. mode="horizontal"
  8. :default-selected-keys="defaultselectedkey"
  9. :style="{
  10. lineHeight: '48px',
  11. background: 'transparent',
  12. color: '#FFFFFF',
  13. }"
  14. @click="menuClick"
  15. >
  16. <a-menu-item key="1"> 风险任务</a-menu-item>
  17. <a-menu-item key="2"> 任务概况</a-menu-item>
  18. <a-menu-item key="3"> 任务人员</a-menu-item>
  19. </a-menu>
  20. <!-- <div>
  21. <a-icon type="close" :class="$style.closeBtn" @click="close"></a-icon>
  22. </div> -->
  23. </a-layout-header>
  24. <a-layout
  25. v-if="!iframeTag"
  26. :style="menuId !== '3' ? 'padding:20px;background: #fff;' : 'background: #fff;'"
  27. class="sd-has-table"
  28. >
  29. <!-- <iframe ref="mainfrm" :class="$style.rightfrm" frameborder="0"></iframe>-->
  30. <router-view></router-view>
  31. </a-layout>
  32. <a-layout v-if="iframeTag" style="padding:20px 20px 20px 0">
  33. <a-layout-sider
  34. theme="light"
  35. width="200"
  36. :class="[
  37. fold ? $style.leftSiderHidden : null,
  38. $style.leftSider,
  39. { [$style.leftOver]: !fold },
  40. ]"
  41. style="padding:0;background: #fff;"
  42. >
  43. <div v-if="firstNodes.length > 0" :class="$style.siderContent">
  44. <div :class="$style.siderTitleDivFirst">
  45. <div :class="$style.siderTitle">
  46. <a-icon type="file-search" style="color:#7c7c7c" />
  47. 风险识别
  48. </div>
  49. </div>
  50. <a-spin :spinning="spinning">
  51. <a-timeline :class="[spinning ? $style.timeline : '']">
  52. <div
  53. v-for="node in firstNodes"
  54. :key="node.id"
  55. :class="[
  56. $style.siderUlDiv,
  57. { checked: checkedId === node.nodePeriod + '-' + node.id },
  58. ]"
  59. @click="setChecked(node.nodePeriod + '-' + node.id, node.nodeUrl)"
  60. >
  61. <a-timeline-item :class="$style.siderLi">{{ node.nodeName }}</a-timeline-item>
  62. </div>
  63. </a-timeline>
  64. </a-spin>
  65. </div>
  66. <div v-if="secondNodes.length > 1" :class="$style.siderContent">
  67. <div :class="$style.siderTitleDivFirst">
  68. <div :class="$style.siderTitle">
  69. <a-icon type="file-done" style="color:#7c7c7c" />
  70. 风险评估
  71. </div>
  72. </div>
  73. <a-spin :spinning="spinning">
  74. <a-timeline :class="[spinning ? $style.timeline : '']">
  75. <div
  76. v-for="node in secondNodes"
  77. :key="node.id"
  78. :class="[
  79. $style.siderUlDiv,
  80. { checked: checkedId === node.nodePeriod + '-' + node.id },
  81. ]"
  82. @click="setChecked(node.nodePeriod + '-' + node.id, node.nodeUrl)"
  83. >
  84. <a-timeline-item :class="$style.siderLi">{{ node.nodeName }}</a-timeline-item>
  85. </div>
  86. </a-timeline>
  87. </a-spin>
  88. </div>
  89. <div v-if="threeNodes.length > 0" :class="$style.siderContent">
  90. <div :class="$style.siderTitleDiv">
  91. <div :class="$style.siderTitle">
  92. <a-icon type="file-protect" style="color:#7c7c7c" />
  93. 风险应对
  94. <a-icon
  95. v-show="projectStage === 1 && showChangeStatus"
  96. type="swap"
  97. :class="$style.changeStatus"
  98. @click="changeStatus('effect')"
  99. />
  100. </div>
  101. </div>
  102. <a-spin :spinning="spinning">
  103. <a-timeline :class="[spinning ? $style.timeline : '']">
  104. <div
  105. v-for="node in threeNodes"
  106. :key="node.id"
  107. :class="[
  108. $style.siderUlDiv,
  109. { checked: checkedId === node.nodePeriod + '-' + node.id },
  110. ]"
  111. @click="setChecked(node.nodePeriod + '-' + node.id, node.nodeUrl)"
  112. >
  113. <a-timeline-item :class="$style.siderLi">{{ node.nodeName }}</a-timeline-item>
  114. </div>
  115. </a-timeline>
  116. </a-spin>
  117. </div>
  118. <div :class="$style.siderContent">
  119. <div :class="$style.siderTitleDiv">
  120. <div :class="$style.siderTitle">
  121. <a-icon type="file-text" style="color:#7c7c7c" />
  122. 风险任务报告
  123. <a-icon
  124. v-show="projectStage === 2 && showChangeStatus"
  125. type="swap"
  126. :class="$style.changeStatus"
  127. @click="changeStatus('report')"
  128. />
  129. </div>
  130. </div>
  131. <a-spin :spinning="spinning">
  132. <a-timeline>
  133. <div
  134. v-for="node in fourNodes"
  135. :key="node.id"
  136. :class="[
  137. $style.siderUlDiv,
  138. { checked: checkedId === node.nodePeriod + '-' + node.id },
  139. ]"
  140. @click="setChecked(node.nodePeriod + '-' + node.id, node.nodeUrl)"
  141. >
  142. <a-timeline-item :class="$style.siderLi">{{ node.nodeName }}</a-timeline-item>
  143. </div>
  144. </a-timeline>
  145. </a-spin>
  146. </div>
  147. </a-layout-sider>
  148. <a-layout-sider width="20" style="background: #f0f2f5">
  149. <a-button type="primary" :class="$style.fold" @click="foldClick">
  150. <a-icon :type="fold ? 'right' : 'left'" />
  151. </a-button>
  152. </a-layout-sider>
  153. <a-layout style="padding:20px;background: #fff;" class="sd-has-table">
  154. <!-- <iframe ref="rightfrm" :class="$style.rightfrm" frameborder="0"></iframe> -->
  155. <router-view name="rightfrm"></router-view>
  156. </a-layout>
  157. </a-layout>
  158. </a-layout>
  159. </template>
  160. <script>
  161. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  162. import components from './_import-components/risk-tasks-work-import'
  163. import riskTasksService from './risk-tasks-service'
  164. export default {
  165. name: 'RiskTasksWork',
  166. metaInfo: {
  167. title: '风险任务',
  168. },
  169. components: {
  170. ...components,
  171. },
  172. mixins: [],
  173. data() {
  174. return {
  175. menuId: '',
  176. defaultselectedkey: ['1'],
  177. fold: false,
  178. spinning: true, // 左侧节点加载状态
  179. iframeTag: true,
  180. taskId: '',
  181. projectStatus: '',
  182. checkedId: '', // 默认选中节点id
  183. firstNodes: [], // 任务识别
  184. secondNodes: [], // 风险评估
  185. threeNodes: [], // 风险应对
  186. fourNodes: [
  187. {
  188. id: 1,
  189. nodePeriod: 'report',
  190. nodeUrl: 'risk-task-report-list',
  191. nodeName: '风险任务报告',
  192. },
  193. ], // 报告
  194. projectStage: 1, // 项目阶段1准备2实施3报告
  195. taskName: '', // 项目名称,
  196. currentUserType: [], // 当前登录人所在项目角色
  197. loadShow: true,
  198. showChangeStatus: false, // 切换阶段按钮显示
  199. type: '',
  200. }
  201. },
  202. created() {
  203. const taskId = this.$route.query.taskId
  204. if (
  205. this.$route.path.indexOf('risk-eventuser-list') > -1 ||
  206. this.$route.path.indexOf('ic-evaluation-overview') > -1
  207. ) {
  208. this.iframeTag = false
  209. if (this.$route.path.indexOf('ic-evaluation-overview') > -1) {
  210. this.defaultselectedkey = ['2']
  211. this.menuId = '2'
  212. } else if (this.$route.path.indexOf('risk-eventuser-list') > -1) {
  213. this.defaultselectedkey = ['3']
  214. this.menuId = '3'
  215. }
  216. }
  217. },
  218. mounted() {
  219. const taskId = this.$route.query.taskId
  220. if (taskId) {
  221. this.taskId = taskId
  222. }
  223. // 获取风险任务信息
  224. riskTasksService.getRiskTaskInfo(taskId).then((res) => {
  225. this.spinning = !this.spinning
  226. // 任务名称
  227. const title = res.data.pageFormData.pageFieldInfos.find((i) => i.name === 'dutieName').value
  228. // 任务类型
  229. const type = res.data.pageFormData.pageFieldInfos.find((i) => i.name === 'dutieType').value
  230. this.taskName = title
  231. this.type = type
  232. // 风险识别
  233. if (this.type.indexOf('RISK_DISTINGUISH') > -1) {
  234. this.firstNodes.push({
  235. id: 1,
  236. nodePeriod: 'identification',
  237. nodeUrl: 'risk-identification-list',
  238. nodeName: '风险识别',
  239. })
  240. }
  241. // 风险评估
  242. if (this.type.indexOf('RISK_ASSESSMENT') > -1) {
  243. this.secondNodes.push({
  244. id: 1,
  245. nodePeriod: 'assessment',
  246. nodeUrl: 'risk-assessment-list',
  247. nodeName: '风险评估',
  248. })
  249. }
  250. this.secondNodes.push({
  251. id: 2,
  252. nodePeriod: 'map',
  253. nodeUrl: 'risk-assessment-map',
  254. nodeName: '风险图谱',
  255. })
  256. // 风险识别
  257. if (this.type.indexOf('RISK_RESPONSE') > -1) {
  258. this.threeNodes.push({
  259. id: 1,
  260. nodePeriod: 'response',
  261. nodeUrl: 'risk-response-list',
  262. nodeName: '风险应对',
  263. })
  264. }
  265. var arr = []
  266. arr = arr.concat(this.firstNodes)
  267. if (this.secondNodes.length > 1) {
  268. arr = arr.concat(this.secondNodes)
  269. }
  270. arr = arr.concat(this.threeNodes)
  271. this.allTaskNodes = arr
  272. // 跳转
  273. this.setChecked(arr[0].nodePeriod + '-' + arr[0].id, arr[0].nodeUrl)
  274. })
  275. },
  276. destroyed() {
  277. window.removeEventListener('hasLeaderAuthority', this.hasLeaderAuthority)
  278. },
  279. methods: {
  280. // 隐藏左侧节点
  281. foldClick() {
  282. this.fold = !this.fold
  283. },
  284. // 是否拥有项目组长和项目副组长的权限
  285. hasLeaderAuthority() {
  286. if (this.currentUserType.indexOf('01') > -1 || this.currentUserType.indexOf('05') > -1) {
  287. return true
  288. }
  289. return false
  290. },
  291. setChecked(val, url) {
  292. url = url + '?taskId=' + this.taskId
  293. this.checkedId = val
  294. this.$router.push('/risk-tasks/' + url)
  295. },
  296. close() {
  297. crossWindowWatcher.notifyChange(true)
  298. window.close()
  299. },
  300. menuClick(val) {
  301. this.menuId = val.key
  302. if (val.key === '1') {
  303. // 评价作业
  304. this.iframeTag = true
  305. setTimeout(() => {
  306. // 调整左侧节点选中状态
  307. this.checkedId = this.allTaskNodes[0].nodePeriod + '-' + this.allTaskNodes[0].id
  308. // 修改跳转路由
  309. this.$router.push(
  310. '/risk-tasks/' + this.allTaskNodes[0].nodeUrl + '?taskId=' + this.taskId
  311. )
  312. }, 0)
  313. }
  314. if (val.key === '2') {
  315. // 概况
  316. this.iframeTag = false
  317. setTimeout(() => {
  318. this.$router.push(
  319. '/risk-tasks/risk-task-overview?taskId=' + this.taskId // 新页面要打开的路由地址
  320. )
  321. }, 0)
  322. }
  323. if (val.key === '3') {
  324. // 评价人员
  325. this.iframeTag = false
  326. setTimeout(() => {
  327. this.$router.push(
  328. '/risk-tasks/risk-eventuser-list?taskId=' + this.taskId // 新页面要打开的路由地址
  329. )
  330. }, 0)
  331. }
  332. },
  333. },
  334. }
  335. </script>
  336. <style module lang="scss">
  337. @use '@/common/design' as *;
  338. .fold {
  339. position: absolute;
  340. top: calc(50% - 30px);
  341. right: 5px;
  342. z-index: 2;
  343. width: 15px;
  344. height: 75px;
  345. padding: 0;
  346. border-radius: 0 10px 10px 0;
  347. }
  348. .audit-table {
  349. :global(.sd-readonly) {
  350. margin-bottom: 24px;
  351. }
  352. }
  353. .close-btn {
  354. font-size: 15px;
  355. color: #ffffff;
  356. position: absolute;
  357. right: 15px;
  358. top: 25px;
  359. cursor: pointer;
  360. }
  361. $link-icon-size: 22px;
  362. $line-height-theme: 66px;
  363. $theme-check: #fff;
  364. $icon-size: 15px;
  365. .page {
  366. // 表格样式
  367. :global(div.sd-has-table) {
  368. :global(.ant-table-wrapper) {
  369. margin-top: -8px;
  370. }
  371. :global(.ant-card-body) {
  372. padding: 0;
  373. :global(.ant-table-wrapper) {
  374. margin-top: -8px;
  375. }
  376. }
  377. }
  378. :global(.sd-has-table) {
  379. :global(.ant-table-wrapper) {
  380. margin-top: -8px;
  381. }
  382. }
  383. height: 100%;
  384. .left-sider {
  385. overflow: hidden;
  386. white-space: nowrap;
  387. :global(.ant-layout-sider-children) {
  388. overflow: auto;
  389. }
  390. }
  391. .left-sider-hidden {
  392. flex: 0 0 0 !important;
  393. max-width: 0 !important;
  394. min-width: 0 !important;
  395. width: 0 !important;
  396. padding: 0px;
  397. background: rgb(255, 255, 255);
  398. :global(.ant-layout-sider-children) {
  399. overflow: hidden;
  400. }
  401. }
  402. .left-over {
  403. margin-left: 20px;
  404. }
  405. .trigger {
  406. display: inline-block;
  407. padding: 0 15px;
  408. vertical-align: top;
  409. cursor: pointer;
  410. transition: color 0.3s;
  411. &:hover {
  412. color: $text-color-inverse;
  413. }
  414. }
  415. aside {
  416. overflow: auto;
  417. }
  418. :global(.sd-frame-main) {
  419. height: 100%;
  420. padding: $padding-lg;
  421. overflow: auto;
  422. }
  423. :global(sd-readonly) {
  424. margin-bottom: 24px;
  425. }
  426. }
  427. .title {
  428. display: inline-block;
  429. margin-left: -35px;
  430. font-weight: 600;
  431. line-height: inherit;
  432. text-align: center;
  433. vertical-align: top;
  434. > i {
  435. // 固定大小的logo
  436. /* stylelint-disable-next-line */
  437. font-size: 20px;
  438. transform: scale(10);
  439. }
  440. }
  441. // 主内容区的Card白色背景要占满
  442. :global .sd-frame-main > .ant-card {
  443. min-height: 100%;
  444. }
  445. .header {
  446. background: linear-gradient(to right, #3f9bff, #0e7df6);
  447. height: 48px;
  448. line-height: 48px;
  449. padding: 0 20px 0 20px;
  450. :global .ant-menu {
  451. float: right;
  452. }
  453. :global(.ant-menu-item-selected) {
  454. color: #ffffff;
  455. background: #1366c1;
  456. border-bottom: 0 !important;
  457. top: 0;
  458. }
  459. :global(.ant-menu-item) {
  460. border-bottom: 2px solid #ffffff;
  461. border-bottom: 0 !important;
  462. top: 0;
  463. }
  464. :global(.ant-menu-item-active) {
  465. color: #ffffff !important;
  466. background: #1366c1 !important;
  467. border-bottom: 0 !important;
  468. top: 0;
  469. }
  470. .header-title {
  471. color: #ffffff;
  472. font-size: 25px;
  473. font-weight: 400;
  474. display: inline-block;
  475. width: 40%;
  476. overflow: hidden;
  477. text-overflow: ellipsis;
  478. white-space: nowrap;
  479. }
  480. }
  481. .header > div:last-child {
  482. width: calc(100% - 200px);
  483. }
  484. .links {
  485. display: flex;
  486. align-items: center;
  487. margin: 0 $link-icon-size / 2;
  488. li:global(.ant-menu-item) {
  489. padding: 0;
  490. }
  491. i:global(.anticon) {
  492. padding: 0 $link-icon-size / 2;
  493. margin: 0;
  494. font-size: $link-icon-size;
  495. line-height: $layout-header-height;
  496. vertical-align: middle;
  497. &:hover {
  498. // 悬浮的颜色,与主题无关
  499. /* stylelint-disable-next-line */
  500. background-color: rgba(0, 0, 0, 0.2);
  501. }
  502. }
  503. }
  504. .tools {
  505. display: flex;
  506. float: right;
  507. }
  508. .headerbadge {
  509. bottom: $line-height-theme / 6;
  510. left: -$link-icon-size / 2 - 5;
  511. }
  512. .sider-content {
  513. padding: 0 0;
  514. .sider-title {
  515. position: relative;
  516. margin-left: 23px;
  517. i {
  518. color: #1890ff;
  519. position: absolute;
  520. font-size: 18px;
  521. left: -27px;
  522. top: 3px;
  523. }
  524. font-weight: bold;
  525. }
  526. .sider-li {
  527. :global(.ant-timeline-item-content) {
  528. margin: 0 0 0 15px;
  529. }
  530. :global(.ant-timeline-item-head-blue) {
  531. color: #9f9f9f;
  532. border-color: #9f9f9f;
  533. background-color: #9f9f9f;
  534. top: 4px;
  535. left: 3px;
  536. width: 3px;
  537. height: 3px;
  538. }
  539. :global(.ant-timeline-item-tail) {
  540. height: calc(100% - -18px);
  541. border-left: 2px solid #f5f5f5;
  542. display: none;
  543. }
  544. }
  545. .sider-title-div-first {
  546. padding: 10px 0 10px 20px;
  547. margin-bottom: 10px;
  548. border-bottom: 2px solid #e8e8e8;
  549. }
  550. .sider-title-div {
  551. padding: 10px 0 10px 20px;
  552. margin-bottom: 10px;
  553. border-top: 2px solid #e8e8e8;
  554. border-bottom: 2px solid #e8e8e8;
  555. }
  556. ul {
  557. margin-left: 0;
  558. padding-bottom: 5px;
  559. }
  560. .sider-ul-div {
  561. padding: 13px 0px 0px 12px;
  562. width: 100%;
  563. margin: 3px auto;
  564. border-radius: 0px;
  565. cursor: pointer;
  566. :global(.ant-timeline-item) {
  567. padding: 0;
  568. margin-left: 3px;
  569. }
  570. }
  571. .node-readonly {
  572. cursor: normal;
  573. color: #b6b6b6;
  574. }
  575. :global(.checked) {
  576. background: linear-gradient(to right, #13c2c2, #2db7f5);
  577. color: #fff;
  578. :global(.ant-timeline-item-head-blue) {
  579. background-color: #ffffff;
  580. border-color: #ffffff !important;
  581. top: 4px;
  582. left: 3px;
  583. width: 3px;
  584. height: 3px;
  585. }
  586. }
  587. :global(.ant-timeline-item-last .ant-timeline-item-tail) {
  588. display: none;
  589. }
  590. .timeline {
  591. min-height: 150px;
  592. }
  593. }
  594. :global(.ant-tabs) {
  595. overflow-y: auto;
  596. }
  597. .rightfrm {
  598. height: 100%;
  599. width: 100%;
  600. }
  601. .change-status {
  602. margin-left: 150px;
  603. font-size: 20px !important;
  604. color: #28baeb !important;
  605. cursor: pointer;
  606. }
  607. </style>