xm-spic-problem-list.vue 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934
  1. <template>
  2. <div :class="$style.wrapHeight">
  3. <div :class="$style.rowHeight">
  4. <audit-tree
  5. ref="problemTree"
  6. :checkable="false"
  7. :draggable="false"
  8. :is-search="false"
  9. :show-line="true"
  10. :top-node-text="'审计案例'"
  11. :treeparams="{
  12. configId: 111,
  13. }"
  14. :default-expanded-keys="['0']"
  15. :is-select-dep="true"
  16. manager-type="view"
  17. @treeSelect="treeSelectd"
  18. >
  19. </audit-tree>
  20. <div :class="$style.rightcard">
  21. <a-card>
  22. <div :class="$style.wrapper">
  23. <div :class="[$style.btns]">
  24. <audit-advanced-import
  25. ref="import"
  26. :config-id="'161'"
  27. :table-id="'oaTable'"
  28. :relevant-column="importTreeId"
  29. :v-if="false"
  30. >
  31. </audit-advanced-import>
  32. </div>
  33. <audit-advanced-query
  34. :expand="expand"
  35. :search-data="formData"
  36. :ref-name="'searchform'"
  37. :search-style="{ height: '125px', left: '20px', top: '64px', width: '100%' }"
  38. :search-fun="handleSearch"
  39. @searchedClick="searchedClick"
  40. >
  41. <template>
  42. <a-col :span="8">
  43. <a-form-model-item :label="'案例名称'" prop="title">
  44. <a-input v-model="formData.title" allow-clear />
  45. </a-form-model-item>
  46. </a-col>
  47. <a-col :span="8">
  48. <a-form-model-item :label="'状态'" prop="state">
  49. <sd-select
  50. v-model="formData.state"
  51. :allow-clear="true"
  52. :options="stateOptions"
  53. />
  54. </a-form-model-item>
  55. </a-col>
  56. <a-col :span="8">
  57. <a-form-model-item :label="'维护人员'" prop="cUser">
  58. <a-input v-model="formData.cUser" allow-clear />
  59. </a-form-model-item>
  60. </a-col>
  61. </template>
  62. </audit-advanced-query>
  63. <sd-data-table-ex
  64. ref="oaTable"
  65. :editnode="editnode"
  66. :form-id="formId"
  67. :columns="columns"
  68. :actions="this.isShowAction === true ? adminActions : auditActions"
  69. :filter-expressions="expressions"
  70. :show-selection="true"
  71. :data-url="dataUrl"
  72. :show-advance-query="true"
  73. :search-fields="['docTitle']"
  74. :row-selection="{ type: 'radio' }"
  75. @recordsDeleted="onRecordsDeleted"
  76. @searchbtnClick="searchbtnClick"
  77. >
  78. <a
  79. slot="fldSubject"
  80. slot-scope="text, record"
  81. :title="text"
  82. @click="fnReadDoc(record)"
  83. >{{ text }}</a
  84. >
  85. <a slot="opt" slot-scope="text, record" @click="fnEditDoc(record)">编辑</a>
  86. </sd-data-table-ex>
  87. <!-- 选择审计问题 -->
  88. <a-modal
  89. title="请选择审计问题"
  90. width="1200px"
  91. :visible="showFindVisible"
  92. :confirm-loading="findConfirmLoading"
  93. destroy-on-close
  94. @ok="handleOk"
  95. @cancel="
  96. () => {
  97. showFindVisible = false
  98. }
  99. "
  100. >
  101. <sd-data-table-ex
  102. ref="findTable"
  103. data-url="api/xcoa-mobile/v1/spicproblem/findQuestionList"
  104. form-id="iamAuditReportFind"
  105. :columns="findListColumns"
  106. :row-key="'findTitle'"
  107. :filter-expressions="findExpressions"
  108. :search-fields="['findTitle', 'findCode']"
  109. show-selection
  110. >
  111. <template slot="findType" slot-scope="text">
  112. {{ JSON.parse(text).text }}
  113. </template>
  114. </sd-data-table-ex>
  115. </a-modal>
  116. <!-- 导入弹窗 -->
  117. <xm-spic-problem-import-modal
  118. :parent-id="typeId + ''"
  119. :visible="importVisible"
  120. ></xm-spic-problem-import-modal>
  121. </div>
  122. </a-card>
  123. </div>
  124. </div>
  125. </div>
  126. </template>
  127. <script>
  128. import { message, Modal } from 'ant-design-vue'
  129. import PageService from '@/common/services/page-service'
  130. import { getUserInfo, getUserPerms } from '@/common/store-mixin'
  131. import axios from '@/common/services/axios-instance'
  132. import TableActionTypes from '@/common/services/table-action-types'
  133. import TableColumnTypes from '@/common/services/table-column-types'
  134. import crossWindowWatcher from '@/common/services/cross-window-watcher'
  135. import openAsTrustId from '@/common/services/open-as-trust-id'
  136. import download from '@/common/services/download'
  137. import auditAdvancedImport from '@product/iam/components/audit-advanced-import.vue'
  138. import auditAdvancedQueryMixins from '@product/iam/components/audit-advanced-query-mixins'
  139. import auditAdvancedQuery from '@product/iam/components/audit-advanced-query.vue'
  140. import auditTree from '@product/iam/components/audit-tree.vue'
  141. import xmSpicProblemImportModal from './xm-spic-problem-import-modal.vue'
  142. import problemService from './xm-spic-problem-service.js'
  143. import components from './_import-components/xm-spic-problem-list-import'
  144. export default {
  145. name: 'XmSpicProblemList',
  146. metaInfo: {
  147. title: '审计案例',
  148. },
  149. components: {
  150. auditTree,
  151. auditAdvancedQuery,
  152. auditAdvancedImport,
  153. xmSpicProblemImportModal,
  154. ...components,
  155. },
  156. mixins: [auditAdvancedQueryMixins],
  157. props: {
  158. // 是不是用于选择知识
  159. isSelectd: {
  160. type: Boolean,
  161. default: false,
  162. },
  163. },
  164. data() {
  165. return {
  166. showFindVisible: false,
  167. findConfirmLoading: false,
  168. stateOptions: [
  169. {
  170. id: '暂存',
  171. name: '暂存',
  172. },
  173. {
  174. id: '已发布',
  175. name: '已发布',
  176. },
  177. ],
  178. importVisible: false, // 导入弹窗
  179. editnode: true,
  180. formData: {
  181. title: '',
  182. label: '',
  183. state: '',
  184. cUser: '',
  185. },
  186. dataUrl: 'api/xcoa-mobile/v1/spicproblem/all-list',
  187. expand: false,
  188. // 左侧树用,用于创建对应分类数据
  189. parentId: 0,
  190. importTreeId: 0,
  191. categorys: [],
  192. activeKey: 'textlist',
  193. isKmAdmin: false,
  194. expressions: [],
  195. columns: [
  196. {
  197. title: '序号',
  198. dataIndex: 'sortNumber',
  199. width: '80px',
  200. customRender: (text, record, index) => `${index + 1}`,
  201. },
  202. {
  203. title: '案例名称',
  204. dataIndex: 'docTitle',
  205. scopedSlots: { customRender: 'fldSubject' },
  206. width: '30%',
  207. },
  208. {
  209. title: '案例编号',
  210. dataIndex: 'problemNumber',
  211. // defaultSortOrder: 'asc',
  212. },
  213. {
  214. title: '状态',
  215. dataIndex: 'state',
  216. },
  217. {
  218. title: '维护人员',
  219. dataIndex: 'creatorName',
  220. },
  221. {
  222. title: '维护人员账号',
  223. sdHidden: true,
  224. dataIndex: 'creatorAccount',
  225. },
  226. {
  227. title: '维护日期',
  228. dataIndex: 'creationTime',
  229. sdRender: TableColumnTypes.date,
  230. sorter: true,
  231. defaultSortOrder: 'desc',
  232. },
  233. ],
  234. findListColumns: [
  235. {
  236. title: '序号',
  237. dataIndex: 'sortNumber',
  238. customRender: (text, record, index) => `${index + 1}`,
  239. width: '80px',
  240. },
  241. {
  242. title: '问题Id',
  243. dataIndex: 'id',
  244. width: '80px',
  245. sdHidden: true,
  246. },
  247. { dataIndex: 'findTitle', title: '问题名称', width: '40%' },
  248. { dataIndex: 'findCode', title: '问题编号' },
  249. {
  250. dataIndex: 'auditedUnitNames',
  251. title: '被审计单位',
  252. scopedSlots: { customRender: 'auditedUnitNames' },
  253. },
  254. ],
  255. findExpressions: [
  256. // {
  257. // dataType: 'long',
  258. // name: 'projectId',
  259. // op: 'eq',
  260. // longValue: this.$root.$route.query.projectId,
  261. // },
  262. ],
  263. auditActions: [
  264. {
  265. label: '选择',
  266. permission: null,
  267. id: 'find',
  268. type: null,
  269. callback: () => {
  270. this.showFindVisible = true
  271. },
  272. },
  273. {
  274. label: '删除',
  275. id: 'delete',
  276. permission: null, // 纯前端操作,不需要权限控制
  277. // type: TableActionTypes.batch,
  278. // type: TableActionTypes.oa.delete, // 删除按钮,不需要回调,会自动处理
  279. // callback: this.deleteRows,
  280. callback: () => {
  281. this.deleteRows()
  282. },
  283. },
  284. {
  285. label: '新建',
  286. id: 'create', // 没写type,一般按钮
  287. permission: null, // 纯前端操作,不需要权限控制
  288. type: TableActionTypes.primary,
  289. callback: () => {
  290. this.fnCreatDoc()
  291. },
  292. },
  293. {
  294. label: '导出',
  295. id: 'exportProblem',
  296. permission: null,
  297. callback: this.exportProblem, // 纯前端操作,不需要权限控制
  298. },
  299. ],
  300. adminActions: [
  301. {
  302. label: '选择',
  303. permission: null,
  304. id: 'find',
  305. type: null,
  306. callback: () => {
  307. this.showFindVisible = true
  308. },
  309. },
  310. {
  311. label: '删除',
  312. id: 'delete',
  313. permission: null, // 纯前端操作,不需要权限控制
  314. callback: () => {
  315. this.deleteRows()
  316. },
  317. },
  318. {
  319. label: '新建',
  320. id: 'create', // 没写type,一般按钮
  321. permission: null, // 纯前端操作,不需要权限控制
  322. type: TableActionTypes.primary,
  323. callback: () => {
  324. this.fnCreatDoc()
  325. },
  326. },
  327. {
  328. label: '分类配置',
  329. id: 'auditMattersCatalog',
  330. permission: null,
  331. callback: () => {
  332. const url = '/sd-frame/xm-spic-problem-category' // 新页面要打开的路由地址
  333. openAsTrustId(url, null)
  334. },
  335. },
  336. {
  337. label: '导出',
  338. id: 'exportProblem',
  339. permission: null,
  340. callback: this.exportProblem, // 纯前端操作,不需要权限控制
  341. },
  342. ],
  343. businessTypeId: null,
  344. typeId: null,
  345. typeName: '',
  346. isApplicationAdmin: false,
  347. isShowAction: false,
  348. formId: 'spicProblem',
  349. // 图文列表参数
  350. showCreateBtn: false,
  351. showDeleteBtn: false,
  352. pictureData: [],
  353. pagination: {
  354. onChange: (page) => {
  355. this.paginationChange(page)
  356. },
  357. current: 1,
  358. pageSize: 8,
  359. showTotal(total) {
  360. return `共${total}条`
  361. },
  362. },
  363. loading: false, // 图文列表数据的loading
  364. orderType: 'creationTime',
  365. creationTimeDesc: true,
  366. pictureRowSelection: [],
  367. searchText: '',
  368. picList: '',
  369. }
  370. },
  371. // 图文列表参数变化更新数据
  372. watch: {
  373. orderType() {
  374. this.pictureListRefresh()
  375. },
  376. creationTimeDesc() {
  377. this.pictureListRefresh()
  378. },
  379. },
  380. created() {
  381. if (getUserInfo().roles.findIndex((item) => item.code === 'KM_ADMIN') !== -1) {
  382. this.isKmAdmin = true
  383. }
  384. // 图文列表获取数据
  385. this.treeSelectd({}, { id: 0 })
  386. },
  387. mounted() {
  388. // 初始化权限
  389. this.initJurisdiction()
  390. },
  391. methods: {
  392. // 初始化权限
  393. initJurisdiction() {
  394. // debugger
  395. // 校验权限查询当前用户是否是审计案例库管理员角色(是否为模块管理员)
  396. problemService.checkSpicProblemPermission().then((res) => {
  397. this.isApplicationAdmin = res.data.isHasPermission
  398. })
  399. // 判断是否是模块管理员 或者 是否是审计人员(角色)
  400. problemService.checkSpicAuditPermission().then((res) => {
  401. this.isShowAction = res.data.isHasPermission
  402. console.log(this.isShowAction, '----------------')
  403. })
  404. },
  405. // 显示导入弹窗
  406. showImportModal() {
  407. this.importVisible = !this.importVisible
  408. },
  409. searchedClick() {
  410. this.expand = false
  411. },
  412. // 查询
  413. handleSearch() {
  414. this.expressions = [
  415. {
  416. dataType: 'str',
  417. name: 'parentId',
  418. op: 'eq',
  419. stringValue: this.typeId,
  420. },
  421. ]
  422. // 资料名称
  423. if (this.formData.title) {
  424. this.expressions.push({
  425. dataType: 'str',
  426. name: 'docTitle',
  427. op: 'like',
  428. stringValue: `%${this.formData.title}%`,
  429. })
  430. }
  431. // 状态
  432. if (this.formData.state[0]) {
  433. this.expressions.push({
  434. dataType: 'str',
  435. name: 'state',
  436. op: 'like',
  437. stringValue: `%${this.formData.state[0].id}%`,
  438. })
  439. }
  440. if (this.formData.cUser) {
  441. this.expressions.push({
  442. dataType: 'str',
  443. name: 'creatorName',
  444. op: 'like',
  445. stringValue: `%${this.formData.cUser}%`,
  446. })
  447. }
  448. },
  449. // 树选择节点后获取列表数据
  450. treeSelectd(key, item) {
  451. if (item.selectedNodes?.length > 0) {
  452. let parentId = ''
  453. let parentName = ''
  454. if (item.id !== undefined) {
  455. parentId = item.id
  456. parentName = item.text
  457. } else {
  458. parentId = item.selectedNodes[0].data.props.id
  459. parentName = item.selectedNodes[0].data.props.text
  460. this.editnode = item.selectedNodes[0].data.props.edit
  461. }
  462. this.typeId = parentId
  463. this.importTreeId = parentId
  464. this.typeName = parentName
  465. this.selectdParentName = parentName
  466. const filter = [
  467. {
  468. dataType: 'str',
  469. name: 'parentId',
  470. op: 'eq',
  471. stringValue: this.typeId,
  472. },
  473. ]
  474. this.expressions = filter
  475. } else {
  476. const filter = {
  477. dataType: 'str',
  478. name: 'parentId',
  479. op: 'eq',
  480. stringValue: -1,
  481. }
  482. this.expressions = [filter]
  483. this.editnode = false
  484. }
  485. },
  486. // 获取businessTypeId,选中的节点要是没有businessTypeId就向上找,直至找到根节点,如果没有就返回null
  487. fnGetBusinessTypeId(item) {
  488. let businessTypeId
  489. if (item === null) {
  490. // 如果找到根节点都没找到flowId就返回null
  491. businessTypeId = null
  492. } else {
  493. if (item.selectedNodes && item.selectedNodes[0].data.props.props.businessTypeId) {
  494. businessTypeId = item.selectedNodes[0].data.props.props.businessTypeId
  495. } else if (item.props && item.props.businessTypeId) {
  496. businessTypeId = item.props.businessTypeId
  497. } else {
  498. const key = item.id ? item.id : item.selectedNodes[0].data.key
  499. const parentNode = this.getParentNode(key, this.$refs.tree.treeData)
  500. businessTypeId = this.fnGetBusinessTypeId(parentNode)
  501. }
  502. }
  503. return businessTypeId
  504. },
  505. // 查找父节点
  506. getParentNode(key, tree) {
  507. let parentNode = null
  508. for (let i = 0; i < tree.length; i++) {
  509. const node = tree[i]
  510. if (node.children) {
  511. if (node.children.some((item) => item.id === key)) {
  512. parentNode = node
  513. } else if (this.getParentNode(key, node.children)) {
  514. parentNode = this.getParentNode(key, node.children)
  515. }
  516. }
  517. }
  518. return parentNode
  519. },
  520. // 知识投稿
  521. fnCreatDoc() {
  522. var url =
  523. '/xm-spic-problem-form?' +
  524. '&typeId=' +
  525. this.typeId +
  526. '&typeName=' +
  527. this.typeName +
  528. '&orgId=' +
  529. this.$refs.problemTree.depvalue
  530. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  531. if (refreshFlag) {
  532. return this.$refs.oaTable.refresh(true)
  533. }
  534. })
  535. },
  536. fnEditDoc(record) {
  537. setTimeout(() => {
  538. this.$refs.oaTable.refresh()
  539. this.loadData()
  540. }, 5000)
  541. var url = `/km-knowledage-form?&typeId=${this.typeId}&typeName=${this.typeName}&record=${record.id}`
  542. crossWindowWatcher.waitForChanged(url).then((refreshFlag) => {
  543. if (refreshFlag) {
  544. return this.$refs.oaTable.refresh(true)
  545. }
  546. })
  547. },
  548. // 查看知识
  549. fnReadDoc(record) {
  550. setTimeout(() => {
  551. this.$refs.oaTable.refresh()
  552. this.loadData()
  553. }, 5000)
  554. const curuser = getUserInfo().account
  555. if (record.creatorAccount === curuser && record.state !== '已发布') {
  556. window.open(`#/xm-spic-problem-form?id=${record.id}&title=${record.docTitle}`, '_blank')
  557. } else {
  558. window.open(
  559. `#/xm-spic-problem-form?id=${record.id}&title=${record.docTitle}&mode=${'VIEW'}`,
  560. '_blank'
  561. )
  562. }
  563. },
  564. // 图片列表页面翻页
  565. paginationChange(page) {
  566. this.pagination.current = page
  567. this.loadData()
  568. },
  569. pictureListRefresh(toFirstPage) {
  570. if (toFirstPage) this.pagination.current = 1
  571. if (!this.isSelectd) {
  572. return this.loadData()
  573. }
  574. },
  575. // 列表删除数据时刷新一下
  576. onRecordsDeleted() {
  577. this.$refs.tree.refresh() // 刷新树
  578. },
  579. // 列表删除数据
  580. deleteRows() {
  581. // debugger
  582. const selectedRowKeys = this.$refs.oaTable.getSelectedRowKeys()
  583. const curuser = getUserInfo().account
  584. if (selectedRowKeys.length === 0) {
  585. Modal.info({
  586. content: '请选择需要删除的文件',
  587. })
  588. return
  589. }
  590. if (selectedRowKeys.length === 0) {
  591. this.$refs.oaTable.clearSelection()
  592. this.$refs.oaTable.refresh()
  593. } else {
  594. return new Promise((resolve) => {
  595. let flag = true
  596. const rows = this.$refs.oaTable.getSelectedRows()
  597. rows.forEach((r) => {
  598. if (r.creatorAccount) {
  599. if (r.creatorAccount !== curuser) {
  600. flag = false
  601. }
  602. }
  603. })
  604. if (!flag) {
  605. Modal.error({
  606. title: '不允许删除非本人创建的数据',
  607. })
  608. resolve()
  609. } else {
  610. Modal.confirm({
  611. title: '您确定删除这项内容吗?',
  612. content: '删除这条数据后,就无法恢复初始的状态。',
  613. okText: '删除',
  614. okType: 'danger',
  615. onOk: () => {
  616. this.loading = true
  617. const params = {
  618. ids: selectedRowKeys.join(','),
  619. }
  620. PageService.delete(params, this.formId).then((res) => {
  621. if (res.status === 200) {
  622. this.$refs.oaTable.clearSelection()
  623. this.$refs.oaTable.refresh()
  624. this.loading = false
  625. message.success('删除成功')
  626. }
  627. })
  628. },
  629. onCancel: () => {
  630. resolve()
  631. },
  632. })
  633. }
  634. })
  635. }
  636. // 暂存的数据本人可查看/编辑/修改及删除,本单位模块管理员可修改删除
  637. // const curuser = getUserInfo().account
  638. // const isTrue = this.isApplicationAdmin // 判断是不是模块管理员
  639. // if (!isTrue) {
  640. // if (selectedRowKeys.length === 0) {
  641. // this.$refs.oaTable.clearSelection()
  642. // this.$refs.oaTable.refresh()
  643. // } else {
  644. // return new Promise((resolve) => {
  645. // let flag = true
  646. // const rows = this.$refs.oaTable.getSelectedRows()
  647. // rows.forEach((r) => {
  648. // if (r.creatorAccount) {
  649. // if (r.creatorAccount !== curuser) {
  650. // flag = false
  651. // }
  652. // }
  653. // if (r.state) {
  654. // if (r.state === '已发布') {
  655. // flag = false
  656. // }
  657. // }
  658. // })
  659. // if (!flag) {
  660. // Modal.error({
  661. // title: '不允许删除非本人创建或已发布的数据',
  662. // })
  663. // resolve()
  664. // } else {
  665. // Modal.confirm({
  666. // title: '您确定删除这项内容吗?',
  667. // content: '删除这条数据后,就无法恢复初始的状态。',
  668. // okText: '删除',
  669. // okType: 'danger',
  670. // onOk: () => {
  671. // this.loading = true
  672. // const params = {
  673. // ids: selectedRowKeys.join(','),
  674. // }
  675. // PageService.delete(params, this.formId).then((res) => {
  676. // if (res.status === 200) {
  677. // this.$refs.oaTable.clearSelection()
  678. // this.$refs.oaTable.refresh()
  679. // this.loading = false
  680. // message.success('删除成功')
  681. // }
  682. // })
  683. // },
  684. // onCancel: () => {
  685. // resolve()
  686. // },
  687. // })
  688. // }
  689. // })
  690. // }
  691. // } else {
  692. // // 是管理员
  693. // if (selectedRowKeys.length === 0) {
  694. // this.$refs.oaTable.clearSelection()
  695. // this.$refs.oaTable.refresh()
  696. // } else {
  697. // return new Promise((resolve) => {
  698. // let flag = true
  699. // const rows = this.$refs.oaTable.getSelectedRows()
  700. // rows.forEach((r) => {
  701. // if (r.state) {
  702. // if (r.state === '已发布') {
  703. // flag = false
  704. // }
  705. // }
  706. // })
  707. // if (!flag) {
  708. // Modal.error({
  709. // title: '不允许删除已发布的数据',
  710. // })
  711. // resolve()
  712. // } else {
  713. // Modal.confirm({
  714. // title: '您确定删除这项内容吗?',
  715. // content: '删除这条数据后,就无法恢复初始的状态。',
  716. // okText: '删除',
  717. // okType: 'danger',
  718. // onOk: () => {
  719. // this.loading = true
  720. // const params = {
  721. // ids: selectedRowKeys.join(','),
  722. // }
  723. // PageService.delete(params, this.formId).then((res) => {
  724. // if (res.status === 200) {
  725. // this.$refs.oaTable.clearSelection()
  726. // this.$refs.oaTable.refresh()
  727. // this.loading = false
  728. // message.success('删除成功')
  729. // }
  730. // })
  731. // },
  732. // onCancel: () => {
  733. // resolve()
  734. // },
  735. // })
  736. // }
  737. // })
  738. // }
  739. // }
  740. // Modal.confirm({
  741. // title: '你确定删除这项内容吗?',
  742. // content: '删除这条数据后,就无法恢复初始的状态。',
  743. // okText: '删除',
  744. // okType: 'danger',
  745. // onOk: () => {
  746. // this.loading = true
  747. // const params = {
  748. // ids: selectedRowKeys.join(','),
  749. // }
  750. // PageService.delete(params, this.formId).then((res) => {
  751. // if (res.status === 200) {
  752. // this.$refs.oaTable.clearSelection()
  753. // this.$refs.oaTable.refresh()
  754. // this.loading = false
  755. // message.success('删除成功')
  756. // }
  757. // })
  758. // },
  759. // })
  760. },
  761. handleOk() {
  762. const selectInfo = this.$refs.findTable.getSelectedRows()
  763. const parentId = this.typeId
  764. if (selectInfo.length) {
  765. const arr = []
  766. selectInfo.forEach((item) => {
  767. arr.push(item.id)
  768. })
  769. this.findConfirmLoading = true
  770. axios
  771. .get(`api/xcoa-mobile/v1/spicproblem/find-save?ids=${arr.join(',')}&parentId=${parentId}`)
  772. .then((res) => {
  773. if (res.data.code === 200) {
  774. this.showFindVisible = false
  775. this.findConfirmLoading = false
  776. message.success('添加成功!')
  777. this.$refs.oaTable.refresh()
  778. }
  779. })
  780. } else {
  781. message.error('请选择审计问题!')
  782. return false
  783. }
  784. },
  785. onSearchChange(text) {
  786. if (this.searchText === text) return
  787. this.searchText = text.trim()
  788. const pagination = this.pagination
  789. pagination.current = 1
  790. this.localPagination = { ...pagination }
  791. this.loadData()
  792. },
  793. // 导出
  794. exportProblem() {
  795. // debugger
  796. const rootId = this.$refs.problemTree.depvalue
  797. const id = this.typeId
  798. // let arrId = this.$refs.oaTable.getSelectedRowKeys()
  799. let arrId = this.$refs.oaTable.getSelectedRowKeys().join(',')
  800. if (arrId === undefined || arrId.length === 0) {
  801. arrId = ''
  802. }
  803. problemService.exportProblem(id, rootId, arrId).then((res) => {
  804. if (res.status === 200) {
  805. const url = URL.createObjectURL(res.data)
  806. const filename = res.headers['content-disposition']
  807. const fname = filename.substring(filename.indexOf('filename=') + 9, filename.length)
  808. download(url, decodeURI(fname))
  809. } else {
  810. Modal.warning({
  811. title: '提示',
  812. content: '导出报错,请联系管理员!',
  813. })
  814. return false
  815. }
  816. })
  817. },
  818. },
  819. }
  820. </script>
  821. <style module lang="scss">
  822. @use '@/common/design' as *;
  823. .wrap-height {
  824. height: 100%;
  825. .row-height {
  826. display: flex;
  827. flex: auto;
  828. height: 100%;
  829. .rightcard {
  830. flex: 1;
  831. width: calc(100% - 20%);
  832. height: 100%;
  833. }
  834. }
  835. }
  836. .sider-content {
  837. padding: 0 0;
  838. .sider-title {
  839. position: relative;
  840. margin-left: 23px;
  841. i {
  842. position: absolute;
  843. top: 3px;
  844. left: -27px;
  845. font-size: 18px;
  846. color: #1890ff;
  847. }
  848. font-weight: bold;
  849. }
  850. .sider-li {
  851. :global(.ant-timeline-item-content) {
  852. margin: 0 0 0 23px;
  853. }
  854. :global(.ant-timeline-item-head-blue) {
  855. color: #9f9f9f;
  856. border-color: #9f9f9f;
  857. }
  858. :global(.ant-timeline-item-tail) {
  859. height: calc(100% - -18px);
  860. border-left: 2px solid #f5f5f5;
  861. }
  862. }
  863. .sider-title-div-first {
  864. padding: 0 0 10px 20px;
  865. margin-bottom: 10px;
  866. border-bottom: 3px solid #e8e8e8;
  867. }
  868. .sider-title-div {
  869. padding: 10px 0 10px 20px;
  870. margin-bottom: 20px;
  871. border-top: 3px solid #e8e8e8;
  872. border-bottom: 3px solid #e8e8e8;
  873. }
  874. ul {
  875. margin-bottom: 30px;
  876. margin-left: 0;
  877. }
  878. .sider-ul-div {
  879. width: 90%;
  880. padding: 13px 0 0 5px;
  881. margin: 10px auto;
  882. cursor: pointer;
  883. border-radius: 5px;
  884. :global(.ant-timeline-item) {
  885. padding: 0;
  886. margin-left: 3px;
  887. }
  888. }
  889. :global(.checked) {
  890. color: #fff;
  891. background: linear-gradient(to right, #13c2c2, #2db7f5);
  892. :global(.ant-timeline-item-head-blue) {
  893. background-color: #13c2c2;
  894. border-color: #fff !important;
  895. }
  896. }
  897. :global(.ant-timeline-item-last .ant-timeline-item-tail) {
  898. display: none;
  899. }
  900. }
  901. </style>