index-normalize-route.js 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. // 自动生成的文件,请勿修改
  2. import routerService from '@/common/services/router-service'
  3. import asyncComponent from '@/common/services/async-component'
  4. import flowService from '@/webflow/flow-service'
  5. import formService from '@/webform/form-service'
  6. import SdTable from '@/common/components/sd-table.vue'
  7. import routerReady from '@/common/router-ready'
  8. import axios from '@/common/services/axios-instance'
  9. import todoListService from '@/todo/todo-list-service'
  10. import { message } from '@/common/one-ui'
  11. // 隐藏系统内关联文件页签
  12. routerReady((router) => {
  13. router.beforeEach((to, from, next) => {
  14. // 如果是从自查离开,则去掉隐藏按钮样式样式
  15. if (from.fullPath.includes('cpm-check-self') || from.fullPath.includes('cpm-check-plan')) {
  16. const div = document.querySelector('.button_author_div')
  17. const parentDiv = div?.parentElement
  18. parentDiv?.removeChild(div)
  19. }
  20. import('@/application-manage/sd-task-list.vue').then(({ default: sdTaskList }) => {
  21. // @ts-ignore
  22. sdTaskList.methods.openTask = (record) => {
  23. if (record.instId === null) {
  24. message.warning('请先分配联系人', 3)
  25. return
  26. }
  27. if (!record.openLink) {
  28. record.openLink = '/api/framework/v1/task-form-process/done-pages'
  29. }
  30. todoListService.openTaskItem(record)
  31. }
  32. })
  33. // 首页或登录页不重定向,防止重复跳转
  34. if (to.path === '/' || to.path === '/sd-login') {
  35. next()
  36. return false
  37. }
  38. // 隐藏系统内关联文件页签
  39. import('@/webflow/sd-webflow.vue').then((sdWebflow) => {
  40. // @ts-ignore
  41. sdWebflow.default.props.removedTabs = {
  42. type: Array,
  43. default: () => ['sdRelatedDoc'],
  44. }
  45. })
  46. next()
  47. })
  48. })
  49. // @ts-ignore
  50. const oldColumnsComputed = SdTable.computed.columnsComputed
  51. // @ts-ignore
  52. SdTable.computed.columnsComputed = function () {
  53. const obj = oldColumnsComputed
  54. .bind(this)()
  55. .find((i) => i.title === '序号')
  56. if (
  57. obj ||
  58. this.$route?.path === '/risk-criteria-form' ||
  59. (this.$route?.path.indexOf('/sd-task-list') === -1 &&
  60. this.$route?.path.indexOf('/sd-business-list') === -1 &&
  61. this.$route?.path.indexOf('/cpm-project') === -1 &&
  62. this.$route?.path.indexOf('/law-dispute-search') === -1)
  63. ) {
  64. return [...oldColumnsComputed.bind(this)()]
  65. } else {
  66. const returnColumns = [...oldColumnsComputed.bind(this)()]
  67. if (returnColumns[0].scopedSlots?.customRender === 'id') {
  68. returnColumns.splice(1, 0, {
  69. dataIndex: 'xmindex',
  70. title: '序号',
  71. // @ts-ignore
  72. customRender: (text, record, index) => `${index + 1}`,
  73. width: '65px',
  74. show: true,
  75. })
  76. return returnColumns
  77. }
  78. return [
  79. {
  80. dataIndex: 'xmindex',
  81. title: '序号',
  82. // @ts-ignore
  83. customRender: (text, record, index) => `${index + 1}`,
  84. width: '65px',
  85. show: true,
  86. },
  87. ...oldColumnsComputed.bind(this)(),
  88. ]
  89. }
  90. }
  91. // 整改检查方案
  92. flowService.addFlowForm(
  93. 'onl:5d82a6c0eb3949fb9994156e4eeac6e1',
  94. asyncComponent(
  95. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './project/check-plan/cpm-check-plan-form.vue')
  96. )
  97. )
  98. // 整改检查通知
  99. flowService.addFlowForm(
  100. 'onl:395bd21f5bd74dae9d9451cfa24d9a05',
  101. asyncComponent(
  102. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './project/check-notice/cpm-check-notice-form.vue')
  103. )
  104. )
  105. // 问题整改反馈
  106. flowService.addFlowForm(
  107. 'onl:a5222825c6594c24b9a0b5c302edbfa2',
  108. asyncComponent(
  109. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './improve/feedback/cpm-improve-feedback-form.vue')
  110. )
  111. )
  112. // 合规举报
  113. flowService.addFlowForm(
  114. 'onl:19a222eb058041af8a4a866d34078496',
  115. asyncComponent(
  116. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './accusation/cpm-accusation-form.vue')
  117. )
  118. )
  119. // 问题确认单明细
  120. routerService.routeInFrame('cpm-confirm-detail', {
  121. component:asyncComponent(
  122. () => import(/* webpackChunkName: "product-iam-cpm" */ './project/confirm/cpm-confirm-detail-form.vue')
  123. ),
  124. })
  125. // 问题整改清单录入
  126. routerService.routeInFrame('cpm-improve-rect', {
  127. component:asyncComponent(
  128. () => import(/* webpackChunkName: "product-iam-cpm" */ './improve/rectProblem/cpm-improve-rect-problem-form.vue')
  129. ),
  130. })
  131. // 问题确认单
  132. flowService.addFlowForm(
  133. 'onl:fd31f3fb56224b7aa368d33ab4ea6519',
  134. asyncComponent(
  135. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './project/confirm/cpm-confirm-form.vue')
  136. )
  137. )
  138. // 问题整改要求
  139. flowService.addFlowForm(
  140. 'onl:7db756cfc7544a2bb5b12b2f310bac08',
  141. asyncComponent(
  142. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './improve/require/audit-cpm-improve-require-form.vue')
  143. )
  144. )
  145. // 合规项目
  146. routerService.routeInFrame('cpm-project-list', {
  147. component:asyncComponent(
  148. () => import(/* webpackChunkName: "product-iam-cpm" */ './project/cpm-project-list.vue')
  149. ),
  150. })
  151. // 合规检查立项
  152. flowService.addFlowForm(
  153. 'onl:8d8b353ab83b461a9f2b3a8e04894f71',
  154. asyncComponent(
  155. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './project/cpm-project-check.vue')
  156. )
  157. )
  158. // 整改提醒
  159. routerService.routeInFrame('cpm-remind-config', {
  160. component:asyncComponent(
  161. () => import(/* webpackChunkName: "product-iam-cpm" */ './improve/remind/cpm-improve-remind-config.vue')
  162. ),
  163. })
  164. // 工作底稿
  165. flowService.addFlowForm(
  166. 'onl:4d40a24f7eae43bba231b025ebf44f95',
  167. asyncComponent(
  168. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './project/work-paper/cpm-work-paper-form.vue')
  169. )
  170. )
  171. // 内控-测试
  172. routerService.route('/cpm-project/', {
  173. component:asyncComponent(
  174. () => import(/* webpackChunkName: "product-iam-cpm" */ './project/cpm-project.vue')
  175. ),
  176. children: [
  177. {
  178. path: 'cpm-check-plan',
  179. components: {
  180. rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
  181. },
  182. props: (route) => ({
  183. customValues: route.query.customValues,
  184. formListId: route.query.formListId,
  185. moduleId: route.query.moduleId,
  186. projectId: route.query.projectId,
  187. groupId: route.query.groupId,
  188. }),
  189. // @ts-ignore
  190. beforeEnter: (to, from, next) => {
  191. const mainIni = setInterval(() => {
  192. const mainDiv = document.querySelector('.header_cpm-project_product')
  193. if (mainDiv) {
  194. const div = document.createElement('div')
  195. div.className = 'button_author_div'
  196. div.style.display = 'none'
  197. const style = document.createElement('style')
  198. style.innerHTML = `.header_sd-data-table_common {
  199. display:none
  200. }`
  201. div.appendChild(style)
  202. mainDiv.appendChild(div)
  203. let projectId = to.query.groupId
  204. if (projectId.toString() === '1') {
  205. projectId = to.query.projectId
  206. }
  207. axios({
  208. method: 'get',
  209. url: `api/xcoa-mobile/v1/cpm-project-member/isProjectLeader?projectId=${projectId}`,
  210. }).then((res) => {
  211. // 如果不是组长,则隐藏新建按钮
  212. if (!res.data) {
  213. const btnIni = setInterval(() => {
  214. if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
  215. style.innerHTML = `.header_sd-data-table_common .ant-btn-primary{
  216. display:none
  217. }`
  218. clearInterval(btnIni)
  219. }
  220. })
  221. } else {
  222. style.innerHTML = ''
  223. }
  224. })
  225. clearInterval(mainIni)
  226. }
  227. }, 100)
  228. next()
  229. },
  230. },
  231. {
  232. path: 'cpm-check-notice',
  233. components: {
  234. rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
  235. },
  236. props: (route) => ({
  237. customValues: route.query.customValues,
  238. formListId: route.query.formListId,
  239. moduleId: route.query.moduleId,
  240. projectId: route.query.projectId,
  241. groupId: route.query.groupId,
  242. }),
  243. // @ts-ignore
  244. beforeEnter: (to, from, next) => {
  245. const mainIni = setInterval(() => {
  246. const mainDiv = document.querySelector('.header_cpm-project_product')
  247. if (mainDiv) {
  248. const div = document.createElement('div')
  249. div.className = 'button_author_div'
  250. div.style.display = 'none'
  251. const style = document.createElement('style')
  252. style.innerHTML = `.header_sd-data-table_common {
  253. display:none
  254. }`
  255. div.appendChild(style)
  256. mainDiv.appendChild(div)
  257. let projectId = to.query.groupId
  258. if (projectId.toString() === '1') {
  259. projectId = to.query.projectId
  260. }
  261. axios({
  262. method: 'get',
  263. url: `api/xcoa-mobile/v1/cpm-project-member/isProjectLeader?projectId=${projectId}`,
  264. }).then((res) => {
  265. // 如果不是组长,则隐藏新建按钮
  266. if (!res.data) {
  267. const btnIni = setInterval(() => {
  268. if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
  269. style.innerHTML = `.header_sd-data-table_common .ant-btn-primary{
  270. display:none
  271. }`
  272. clearInterval(btnIni)
  273. }
  274. })
  275. } else {
  276. style.innerHTML = ''
  277. }
  278. })
  279. clearInterval(mainIni)
  280. }
  281. }, 100)
  282. next()
  283. },
  284. },
  285. {
  286. path: 'cpm-check-self',
  287. components: {
  288. rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
  289. },
  290. props: (route) => ({
  291. customValues: route.query.customValues,
  292. formListId: route.query.formListId,
  293. moduleId: route.query.moduleId,
  294. projectId: route.query.projectId,
  295. groupId: route.query.groupId,
  296. }),
  297. // @ts-ignore
  298. beforeEnter: (to, from, next) => {
  299. const mainIni = setInterval(() => {
  300. const mainDiv = document.querySelector('.header_cpm-project_product')
  301. if (mainDiv) {
  302. const div = document.createElement('div')
  303. div.className = 'button_author_div'
  304. div.style.display = 'none'
  305. const style = document.createElement('style')
  306. style.innerHTML = `.header_sd-data-table_common {
  307. display:none
  308. }`
  309. div.appendChild(style)
  310. mainDiv.appendChild(div)
  311. let projectId = to.query.groupId
  312. if (projectId.toString() === '1') {
  313. projectId = to.query.projectId
  314. }
  315. axios({
  316. method: 'get',
  317. url: `api/xcoa-mobile/v1/cpm-project-member/isProjectLeader?projectId=${projectId}`,
  318. }).then((res) => {
  319. // 如果是组长,则去掉隐藏按钮的样式
  320. if (res.data) {
  321. const btnIni = setInterval(() => {
  322. if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
  323. style.innerHTML = `.header_sd-data-table_common .ant-btn-primary{
  324. display:none
  325. }
  326. .header_sd-data-table_common button[disabled='disabled']{
  327. display:none
  328. }`
  329. document
  330. .querySelectorAll('.header_sd-data-table_common button')
  331. .forEach((item) => {
  332. if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
  333. item.setAttribute('style', 'display:none')
  334. }
  335. })
  336. clearInterval(btnIni)
  337. }
  338. })
  339. } else {
  340. const btnIni = setInterval(() => {
  341. if (document.querySelectorAll('.header_sd-data-table_common button').length > 0) {
  342. style.innerHTML = `.header_sd-data-table_common button{
  343. display:none
  344. }
  345. .header_sd-data-table_common button[disabled='disabled']{
  346. display:none
  347. }`
  348. document
  349. .querySelectorAll('.header_sd-data-table_common button')
  350. .forEach((item) => {
  351. if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
  352. item.setAttribute('style', 'display:none')
  353. }
  354. })
  355. clearInterval(btnIni)
  356. }
  357. })
  358. }
  359. })
  360. clearInterval(mainIni)
  361. }
  362. }, 100)
  363. next()
  364. },
  365. },
  366. {
  367. path: 'cpm-work-papre',
  368. components: {
  369. rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
  370. },
  371. props: (route) => ({
  372. customValues: route.query.customValues,
  373. formListId: route.query.formListId,
  374. moduleId: route.query.moduleId,
  375. projectId: route.query.projectId,
  376. groupId: route.query.groupId,
  377. }),
  378. beforeEnter: (to, from, next) => {
  379. const mainIni = setInterval(() => {
  380. const mainDiv = document.querySelector('.header_cpm-project_product')
  381. if (mainDiv) {
  382. const div = mainDiv.getElementsByClassName('button_author_div')
  383. if (div && div.length > 0) {
  384. for (var s = 0; s < div.length; s++) {
  385. document
  386. .querySelector('.header_cpm-project_product')
  387. .getElementsByClassName('button_author_div')
  388. [s]?.remove()
  389. }
  390. }
  391. document.querySelectorAll('.header_sd-data-table_common button').forEach((item) => {
  392. if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
  393. item.setAttribute('style', '')
  394. }
  395. })
  396. clearInterval(mainIni)
  397. }
  398. }, 100)
  399. next()
  400. },
  401. },
  402. {
  403. path: 'cpm-work-report',
  404. components: {
  405. rightfrm: asyncComponent(() => import('../../../src/application-manage/sd-task-list.vue')),
  406. },
  407. props: (route) => ({
  408. customValues: route.query.customValues,
  409. formListId: route.query.formListId,
  410. moduleId: route.query.moduleId,
  411. projectId: route.query.projectId,
  412. groupId: route.query.groupId,
  413. }),
  414. beforeEnter: (to, from, next) => {
  415. const mainIni = setInterval(() => {
  416. const mainDiv = document.querySelector('.header_cpm-project_product')
  417. if (mainDiv) {
  418. const div = mainDiv.getElementsByClassName('button_author_div')
  419. if (div && div.length > 0) {
  420. for (var s = 0; s < div.length; s++) {
  421. document
  422. .querySelector('.header_cpm-project_product')
  423. .getElementsByClassName('button_author_div')
  424. [s]?.remove()
  425. }
  426. }
  427. document.querySelectorAll('.header_sd-data-table_common button').forEach((item) => {
  428. if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
  429. item.setAttribute('style', '')
  430. }
  431. })
  432. clearInterval(mainIni)
  433. }
  434. }, 100)
  435. next()
  436. },
  437. },
  438. {
  439. path: 'cpm-confirm-list',
  440. components: {
  441. rightfrm: asyncComponent(() => import('./project/confirm/cpm-confirm-list.vue')),
  442. },
  443. props: (route) => ({
  444. customValues: route.query.customValues,
  445. formListId: route.query.formListId,
  446. moduleId: route.query.moduleId,
  447. projectId: route.query.projectId,
  448. groupId: route.query.groupId,
  449. }),
  450. beforeEnter: (to, from, next) => {
  451. const mainIni = setInterval(() => {
  452. const mainDiv = document.querySelector('.header_cpm-project_product')
  453. if (mainDiv) {
  454. const div = mainDiv.getElementsByClassName('button_author_div')
  455. if (div && div.length > 0) {
  456. for (var s = 0; s < div.length; s++) {
  457. document
  458. .querySelector('.header_cpm-project_product')
  459. .getElementsByClassName('button_author_div')
  460. [s]?.remove()
  461. }
  462. }
  463. document.querySelectorAll('.header_sd-data-table_common button').forEach((item) => {
  464. if (item.innerHTML.replace(/\s/g, '').includes('删除')) {
  465. item.setAttribute('style', '')
  466. }
  467. })
  468. clearInterval(mainIni)
  469. }
  470. }, 100)
  471. next()
  472. },
  473. },
  474. {
  475. path: 'cpm-check-user',
  476. component: asyncComponent(() => import('./project/user/audit-cpm-project-user.vue')),
  477. props: (route) => ({
  478. pageId: route.query.pageId,
  479. projectId: route.query.projectId,
  480. }),
  481. },
  482. {
  483. path: 'cpm-check-group',
  484. component: asyncComponent(() => import('./project/group/audit-cpm-project-group.vue')),
  485. props: (route) => ({
  486. pageId: route.query.pageId,
  487. projectId: route.query.projectId,
  488. }),
  489. },
  490. ],
  491. })
  492. // 制度审查
  493. flowService.addFlowForm(
  494. 'onl:a68deaea1d024a439ff0ffecd1068830',
  495. asyncComponent(
  496. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './check/cpm-rule-check.vue')
  497. )
  498. )
  499. // 合同审查
  500. flowService.addFlowForm(
  501. 'onl:cfa055669fbe4afbafaefebdc4fdad70',
  502. asyncComponent(
  503. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './check/cpm-contract-check.vue')
  504. )
  505. )
  506. // 重大决策审查
  507. flowService.addFlowForm(
  508. 'onl:930ec02130ab4d8798e23ffa32216e05',
  509. asyncComponent(
  510. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './policycheck/cpm-policy-check.vue')
  511. )
  512. )
  513. // 合规检查报告
  514. flowService.addFlowForm(
  515. 'onl:e1e85d865d984f0383f238a5e0d11ab6',
  516. asyncComponent(
  517. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './project/report/cpm-project-report-form.vue')
  518. )
  519. )
  520. // 领导专题学习
  521. routerService.routeInFrame('cpm-leader-study', {
  522. component:asyncComponent(
  523. () => import(/* webpackChunkName: "product-iam-cpm" */ './cultural/cpm-leader-study-form.vue')
  524. ),
  525. })
  526. // 委员会专题纪要
  527. routerService.routeInFrame('cpm-committee', {
  528. component:asyncComponent(
  529. () => import(/* webpackChunkName: "product-iam-cpm" */ './cultural/cpm-committee-form.vue')
  530. ),
  531. })
  532. // 合规培训
  533. flowService.addFlowForm(
  534. 'onl:fdb6b6b593ba432b8e5932da76c0910d',
  535. asyncComponent(
  536. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './cultural/cpm-train-form.vue')
  537. )
  538. )
  539. // 宣传管理
  540. flowService.addFlowForm(
  541. 'onl:d531f98f303444a58e892e46b86c4ed9',
  542. asyncComponent(
  543. () => import(/* webpackChunkName: "product-iam-cpm-form" */ './cultural/cpm-billboard-form.vue')
  544. )
  545. )
  546. console.warn('路由 cpm-confirm-detail 不符合命名规则,应该以 iam 开头')
  547. console.warn('路由 cpm-improve-rect 不符合命名规则,应该以 iam 开头')
  548. console.warn('路由 cpm-project-list 不符合命名规则,应该以 iam 开头')
  549. console.warn('路由 cpm-remind-config 不符合命名规则,应该以 iam 开头')
  550. console.warn('路由 cpm-leader-study 不符合命名规则,应该以 iam 开头')
  551. console.warn('路由 cpm-committee 不符合命名规则,应该以 iam 开头')