index.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912
  1. <template>
  2. <div class="ele-body">
  3. <el-card
  4. class="card_box"
  5. :body-style="{
  6. display: 'flex',
  7. flexDirection: 'column',
  8. alignItems: 'flex-start'
  9. }"
  10. shadow="never"
  11. >
  12. <ele-split-layout
  13. width="252px"
  14. allow-collapse
  15. :right-style="{ overflow: 'hidden' }"
  16. >
  17. <div class="ele-border-lighter split-layout-right-content">
  18. <!-- 动态表单配置-->
  19. <div class="content-box">
  20. <div
  21. v-for="category in Object.keys(templateList)"
  22. :key="category"
  23. class="category_box"
  24. >
  25. <div class="category_box_title">{{
  26. getDictV('collaborative_type', category)
  27. }}</div>
  28. <div class="category_box_content">
  29. <div
  30. v-for="v in templateList[category]"
  31. :key="v.id"
  32. class="category_content"
  33. :title="v.name"
  34. @click="handleStartProcess(v)"
  35. >
  36. <svg-icon
  37. style="width: 1.5em; height: 1.5em"
  38. :icon-class="v.icon"
  39. className="svg-icon-set"
  40. ></svg-icon>
  41. <span>
  42. {{
  43. v.name.length > 3
  44. ? v.name[0] + v.name[1] + v.name[2] + '...'
  45. : v.name
  46. }}
  47. </span>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. </div>
  53. <!-- 表格 -->
  54. <template v-slot:content>
  55. <div class="tab-box el-form-box">
  56. <el-tabs @tab-click="tabClick" v-model="activeName">
  57. <el-tab-pane
  58. v-for="tab in tabOptions"
  59. :key="tab.name"
  60. :label="tab.label"
  61. :name="tab.name"
  62. v-if="!tab.permission || $hasPermission(tab.permission)"
  63. >
  64. </el-tab-pane>
  65. </el-tabs>
  66. <!-- 共用查询条件(采用"全部记录"的查询项) -->
  67. <div class="filter-container">
  68. <el-form
  69. class="ele-form-search"
  70. @keyup.enter.native="handleSearch"
  71. @submit.native.prevent
  72. >
  73. <el-row :gutter="15" style="display: flex; align-items: center">
  74. <el-col v-bind="{ span: 4 }">
  75. <el-form-item
  76. label="关键字:"
  77. prop="keyword"
  78. label-width="70px"
  79. >
  80. <el-input placeholder="请输入" v-model="params.keyword"></el-input>
  81. </el-form-item>
  82. </el-col>
  83. <el-col v-bind="{ span: 4 }">
  84. <el-form-item label="分类:" label-width="60px">
  85. <el-select
  86. v-model="params.dictType"
  87. @change="changeDictTypeChange"
  88. clearable
  89. >
  90. <el-option
  91. v-for="(item, index) in dictList[
  92. 'collaborative_type'
  93. ]"
  94. :key="index"
  95. :value="item.value"
  96. :label="item.label"
  97. ></el-option>
  98. </el-select>
  99. </el-form-item>
  100. </el-col>
  101. <el-col v-bind="{ span: 4 }">
  102. <el-form-item label="单据:" label-width="60px">
  103. <el-select
  104. v-model="params.formId"
  105. @change="changeFormIdChange"
  106. clearable
  107. >
  108. <el-option
  109. v-for="(item, index) in templateList[params.dictType]"
  110. :key="index"
  111. :value="item.id"
  112. :label="item.name"
  113. ></el-option>
  114. </el-select>
  115. </el-form-item>
  116. </el-col>
  117. <el-col v-bind="{ span: 4 }">
  118. <el-form-item
  119. label="结果:"
  120. prop="result"
  121. label-width="60px"
  122. >
  123. <DictSelection
  124. dictName="流程实例的结果"
  125. clearable
  126. v-model="params.result"
  127. >
  128. </DictSelection>
  129. </el-form-item>
  130. </el-col>
  131. <el-col v-bind="{ span: 4 }">
  132. <el-form-item
  133. label="发起人:"
  134. prop="startUserName"
  135. label-width="70px"
  136. >
  137. <el-input
  138. v-model="params.startUserName"
  139. clearable
  140. ></el-input>
  141. </el-form-item>
  142. </el-col>
  143. <el-col v-bind="{ span: 6 }">
  144. <el-form-item
  145. label="创建时间:"
  146. prop="createTime1"
  147. label-width="90px"
  148. >
  149. <el-date-picker
  150. v-model="createTime1"
  151. style="width: 100%"
  152. value-format="yyyy-MM-dd HH:mm:ss"
  153. type="daterange"
  154. clearable
  155. range-separator="-"
  156. start-placeholder="开始日期"
  157. end-placeholder="结束日期"
  158. :default-time="['00:00:00', '23:59:59']"
  159. />
  160. </el-form-item>
  161. </el-col>
  162. <el-col v-bind="{ span: 4 }">
  163. <el-form-item
  164. label=""
  165. prop="createTime1"
  166. label-width="90px"
  167. >
  168. <div class="ele-form-actions">
  169. <el-button
  170. type="primary"
  171. icon="el-icon-search"
  172. class="ele-btn-icon"
  173. @click="handleSearch"
  174. >
  175. 查询
  176. </el-button>
  177. <el-button @click="handleReset">重置</el-button>
  178. </div>
  179. </el-form-item>
  180. </el-col>
  181. </el-row>
  182. </el-form>
  183. </div>
  184. <!-- 共用表格 -->
  185. <ele-pro-table
  186. ref="table"
  187. height="calc(100vh - 450px)"
  188. :columns="columns"
  189. :datasource="datasource"
  190. :init-load="false"
  191. :cache-key="cacheKeyUrl"
  192. :page-size="20"
  193. :selection.sync="selection"
  194. @columns-change="handleColumnChange"
  195. >
  196. <!-- 表头工具栏 -->
  197. <template v-slot:toolbar>
  198. <el-button
  199. type="primary"
  200. class="el-icon-printer"
  201. size="small"
  202. @click="handlePrint"
  203. >
  204. 打印
  205. </el-button>
  206. </template>
  207. <template v-slot:formName="{ row }">
  208. <el-link
  209. type="primary"
  210. :underline="false"
  211. @click="handleDetail(row)"
  212. >
  213. {{ row.formName }}
  214. </el-link>
  215. </template>
  216. <template v-slot:result="{ row }">
  217. <el-tag
  218. size="medium"
  219. :type="
  220. getTimelineItemType(
  221. getDictValue('流程实例的结果', row.result)
  222. )
  223. "
  224. >
  225. {{ getDictValue('流程实例的结果', row.result) }}
  226. </el-tag>
  227. </template>
  228. <template v-slot:dictType="{ row }">
  229. {{ getDictV('collaborative_type', row.dictType) }}
  230. </template>
  231. <template v-slot:durationInMillis="{ row }">
  232. {{ getDateTime(row.durationInMillis) }}
  233. </template>
  234. <template v-slot:listName="{ row }">
  235. <el-link
  236. type="primary"
  237. :underline="false"
  238. @click="handleDetail(row)"
  239. >
  240. {{ row.listName }}
  241. </el-link>
  242. </template>
  243. <template v-slot:remark="{ row }">
  244. <div
  245. style="
  246. max-height: 180px;
  247. overflow: hidden;
  248. padding: 5px;
  249. overflow-y: auto;
  250. "
  251. >
  252. <template
  253. v-if="row?.formJson?.makingJson"
  254. v-for="(item, index) in JSON.parse(
  255. row?.formJson?.makingJson
  256. )?.list.filter(
  257. (val) =>
  258. ![
  259. 'grid',
  260. 'blank',
  261. 'report',
  262. 'component',
  263. 'card',
  264. 'collapse',
  265. 'tabs',
  266. 'inline',
  267. 'divider',
  268. 'alert',
  269. 'table',
  270. 'subform',
  271. 'dialog'
  272. ].includes(val.type)
  273. )"
  274. >
  275. <div style="display: flex">
  276. <div>{{ item.name }}:</div>
  277. <div v-if="item.type == 'imgupload'">
  278. <el-image
  279. v-if="row[item.model].length"
  280. style="width: 100px; height: 100px"
  281. :src="row[item.model][0].url"
  282. :preview-src-list="row[item.model].map((i) => i.url)"
  283. >
  284. </el-image>
  285. </div>
  286. <div v-else-if="item.type == 'fileupload'">
  287. <fileMain
  288. v-if="row[item.model]?.length"
  289. type="view"
  290. v-model="row[item.model]"
  291. ></fileMain>
  292. </div>
  293. <div
  294. v-else-if="
  295. [
  296. 'deptCascader',
  297. 'deptAndUserCascader',
  298. 'userSelect'
  299. ].includes(item.type)
  300. "
  301. >
  302. <div
  303. style="white-space: initial"
  304. v-if="
  305. item.options.remoteDataSource == 'getGroupUserTree'
  306. "
  307. >
  308. {{ getDeptUserName(row[item.model]) }}
  309. </div>
  310. <div
  311. style="white-space: initial"
  312. v-else-if="
  313. item.options.remoteDataSource == 'getUserPage'
  314. "
  315. >
  316. {{ getUserName(row[item.model]) }}
  317. </div>
  318. <div style="white-space: initial" v-else>
  319. {{ getDeptName(row[item.model]) }}</div
  320. >
  321. </div>
  322. <div v-else>
  323. {{ formatValue(row[item.model]) }}
  324. </div>
  325. </div>
  326. </template>
  327. </div>
  328. </template>
  329. </ele-pro-table>
  330. </div>
  331. </template>
  332. </ele-split-layout>
  333. </el-card>
  334. <process-submit-dialog
  335. :process-submit-dialog-flag.sync="processSubmitDialogFlag"
  336. v-if="processSubmitDialogFlag"
  337. ref="processSubmitDialogRef"
  338. @reload="reload"
  339. ></process-submit-dialog>
  340. <detail ref="detailRef"></detail>
  341. <formDetail
  342. v-if="formDetailDialogFlag"
  343. :view="true"
  344. ref="formDetailDialogRef"
  345. :form-detail-dialog-flag.sync="formDetailDialogFlag"
  346. ></formDetail>
  347. <!-- 隐藏的打印服务实例:复用 detail 的 printRows 批量打印 -->
  348. <formDetail ref="printService" v-show="false"></formDetail>
  349. </div>
  350. </template>
  351. <script>
  352. import {
  353. getBpmCustomFormList,
  354. getProcessInstanceDeptPage,
  355. getProcessInstanceNoticePage,
  356. getProcessInstancePage,
  357. getProcessInstanceAllPage
  358. } from '@/api/bpm/task';
  359. import { getDate } from '@/utils/dateUtils';
  360. import dictMixins from '@/mixins/dictMixins';
  361. import detail from '@/views/bpm/processInstance/detail.vue';
  362. import formDetail from './detail.vue';
  363. import { getByCode } from '@/api/system/dictionary-data';
  364. import { getFile } from '@/api/system/file';
  365. import { getUserPage } from '@/api/tickets';
  366. import { listOrganizations } from '@/api/system/organization';
  367. import tabMixins from '@/mixins/tableColumnsMixin';
  368. import { getGroupUserTree } from '@/api/main';
  369. // 默认表单数据
  370. const defaultParams = {
  371. dictType: '',
  372. status: '',
  373. name: '',
  374. formId: '',
  375. keyword: ''
  376. };
  377. export default {
  378. name: 'index',
  379. components: {
  380. detail,
  381. formDetail
  382. },
  383. mixins: [dictMixins, tabMixins],
  384. data() {
  385. return {
  386. currentDictType: '',
  387. currentFormId: '',
  388. cacheKeyUrl: 'wt-202608101035-eaf1548b-collaborative',
  389. configFormDialogFlag: false,
  390. processSubmitDialogFlag: false,
  391. formDetailDialogFlag: false,
  392. templateList: {},
  393. dictList: {},
  394. defaultTemplateList: [],
  395. userList: [],
  396. deptList: [],
  397. groupUserTree: [],
  398. params: { ...defaultParams },
  399. statusList: [],
  400. formColumnList: [],
  401. createTime1: [],
  402. selection: [],
  403. // 个人 / 部门 / 通知我的
  404. activeName: 'user',
  405. tabOptions: [
  406. {
  407. label: '个人记录',
  408. name: 'user'
  409. },
  410. {
  411. label: '部门记录',
  412. name: 'dept',
  413. permission: 'wt:collaborative:department'
  414. },
  415. {
  416. label: '通知我的记录',
  417. name: 'notice'
  418. },
  419. {
  420. label: '全部记录',
  421. name: 'all',
  422. permission: 'wt:collaborative:all'
  423. }
  424. ],
  425. // 当前 tab 对应的接口方法映射
  426. apiMap: {
  427. user: 'getProcessInstancePage',
  428. dept: 'getProcessInstanceDeptPage',
  429. notice: 'getProcessInstanceNoticePage',
  430. all: 'getProcessInstanceAllPage'
  431. }
  432. };
  433. },
  434. computed: {
  435. // 是否开启响应式布局
  436. styleResponsive() {
  437. return this.$store.state.theme.styleResponsive;
  438. },
  439. columns() {
  440. return [
  441. {
  442. width: 45,
  443. type: 'selection',
  444. columnKey: 'selection',
  445. align: 'center'
  446. },
  447. {
  448. columnKey: 'index',
  449. label: '序号',
  450. type: 'index',
  451. width: 55,
  452. align: 'center',
  453. showOverflowTooltip: true,
  454. fixed: 'left'
  455. },
  456. {
  457. prop: 'dictType',
  458. label: '分类',
  459. align: 'center',
  460. slot: 'dictType',
  461. showOverflowTooltip: true,
  462. width: 80
  463. },
  464. {
  465. prop: 'formName',
  466. label: '单据',
  467. align: 'center',
  468. slot: 'formName',
  469. showOverflowTooltip: true,
  470. minWidth: 120
  471. },
  472. {
  473. prop: 'remark',
  474. label: '摘要',
  475. align: 'center',
  476. slot: 'remark',
  477. minWidth: 300
  478. },
  479. {
  480. prop: 'listName',
  481. label: '名称',
  482. align: 'center',
  483. slot: 'listName',
  484. showOverflowTooltip: true,
  485. minWidth: 120
  486. },
  487. {
  488. prop: 'startUserName',
  489. label: '发起人',
  490. align: 'center',
  491. showOverflowTooltip: true,
  492. width: 120
  493. },
  494. // ...list,
  495. {
  496. prop: 'result',
  497. slot: 'result',
  498. label: '结果',
  499. align: 'center',
  500. showOverflowTooltip: true,
  501. width: 80
  502. },
  503. {
  504. prop: 'endTime',
  505. label: '审批时间',
  506. align: 'center',
  507. showOverflowTooltip: true,
  508. width: 160
  509. },
  510. {
  511. prop: 'createTime',
  512. label: '创建时间',
  513. align: 'center',
  514. showOverflowTooltip: true,
  515. width: 160
  516. }
  517. ];
  518. },
  519. getUserName() {
  520. return (id) => {
  521. if (!id) return '';
  522. let find = this.userList.find((item) => item.id == id) || {};
  523. return find.name;
  524. };
  525. },
  526. getDeptUserName() {
  527. return (id = []) => {
  528. if (!id.length) return '';
  529. return id
  530. .map((pathArr) => {
  531. const names = this.getNodeNamesByPath(
  532. this.groupUserTree,
  533. pathArr
  534. );
  535. return names.join('/');
  536. })
  537. .join(',');
  538. };
  539. },
  540. getDeptName() {
  541. return (id = []) => {
  542. if (!id.length) return '';
  543. id = Array.isArray(id) ? id : [id];
  544. let find =
  545. this.deptList.find((item) => item.id == id[id.length - 1]) || {};
  546. return find.name;
  547. };
  548. }
  549. },
  550. watch: {
  551. // currentFormId: {
  552. // handler(val) {
  553. // this.params.formId = this.params.dictType ? this.templateList[val][0].id : '';
  554. // this.currentFormId = this.templateList[this.currentDictType][0].id;
  555. // this.allReload();
  556. // this.reload();
  557. // this.deptReload();
  558. // this.noticeReload();
  559. // }
  560. // },
  561. // currentDictType: {
  562. // handler(val) {
  563. // this.params.formId = this.templateList[val][0].id;
  564. // this.currentFormId = this.templateList[val][0].id;
  565. // this.allReload();
  566. // this.reload();
  567. // this.deptReload();
  568. // this.noticeReload();
  569. // }
  570. // }
  571. },
  572. async created() {
  573. await this.getDictList('collaborative_type');
  574. await this.getTemplateList();
  575. await this.getUserList();
  576. await this.getDeptList();
  577. await this.getGroupUserTree();
  578. // 默认进入页面显示个人记录并加载其数据
  579. this.activeName = 'user';
  580. this.handleSearch();
  581. },
  582. methods: {
  583. formatValue(value) {
  584. if (value === null || value === undefined) {
  585. return ''; // 空值处理
  586. }
  587. if (typeof value === 'object' && value !== null) {
  588. if ('id' in value && 'code' in value && 'name' in value) {
  589. return value.code;
  590. } else {
  591. return JSON.stringify(value, null, 2);
  592. }
  593. }
  594. return value;
  595. },
  596. getDictV(code, val) {
  597. if (!this.dictList[code]) return '';
  598. return this.dictList[code].find((item) => item.value == val)?.label;
  599. },
  600. async getDictList(code) {
  601. let { data: res } = await getByCode(code);
  602. this.dictList[code] = res.map((item) => {
  603. let values = Object.keys(item);
  604. return {
  605. value: values[0],
  606. label: item[values[0]]
  607. };
  608. });
  609. },
  610. //获取人员数据
  611. async getUserList() {
  612. let params = { pageNum: 1, size: -1 };
  613. let { list } = await getUserPage(params);
  614. this.userList = list;
  615. },
  616. //获取部门数据
  617. async getDeptList() {
  618. this.deptList = await listOrganizations();
  619. },
  620. async getGroupUserTree() {
  621. this.groupUserTree = await getGroupUserTree();
  622. },
  623. // 根据路径数组从树形结构中递归获取节点名称
  624. getNodeNamesByPath(tree, pathArr) {
  625. const names = [];
  626. let nodes = tree;
  627. for (const id of pathArr) {
  628. const node = nodes.find((item) => item.id == id);
  629. console.log(node, 'node');
  630. if (node) {
  631. if (node.type == '1') {
  632. names.push(node.name);
  633. }
  634. nodes = node.children || [];
  635. } else {
  636. break;
  637. }
  638. }
  639. return names;
  640. },
  641. getFiles(row = []) {
  642. row.forEach((item) => {
  643. getFile({ objectName: item.storePath }, item.name);
  644. });
  645. },
  646. async getTemplateList() {
  647. this.defaultTemplateList = await getBpmCustomFormList({ status: 1 });
  648. this.templateList = _.groupBy(this.defaultTemplateList, 'dictType');
  649. // this.params.dictType = this.dictList['collaborative_type'][0].value;
  650. this.currentDictType = this.dictList['collaborative_type'][0].value;
  651. this.currentFormId = this.templateList[this.currentDictType][0]?.id;
  652. // this.params.formId = this.templateList[this.currentDictType][0]?.id;
  653. let makingJson =
  654. JSON.parse(this.defaultTemplateList?.[0]?.formJson?.makingJson) || {};
  655. console.log('makingJson~~~', makingJson);
  656. // this.formColumnList = makingJson.list;
  657. console.log(
  658. // this.formColumnList,
  659. this.templateList[this.currentDictType]
  660. );
  661. },
  662. handleStartProcess(i) {
  663. this.processSubmitDialogFlag = true;
  664. this.$nextTick(() => {
  665. this.$refs.processSubmitDialogRef.init(i);
  666. });
  667. },
  668. /* 表格数据源:根据当前 tab 切换不同接口 */
  669. async datasource({ page, limit, where, order }) {
  670. let [createTimeBegin, createTimeEnd] = this.createTime1 || [];
  671. let apiName = this.apiMap[this.activeName] || 'getProcessInstancePage';
  672. let data = await this.callApi(
  673. apiName,
  674. page,
  675. limit,
  676. createTimeBegin,
  677. createTimeEnd
  678. );
  679. console.log(data.list, 'data~~~');
  680. return {
  681. count: data.count,
  682. list: data.list.map((item) => {
  683. return {
  684. ...item,
  685. listName: item.name,
  686. ...item.valueJson
  687. };
  688. })
  689. };
  690. },
  691. // 调用对应接口
  692. async callApi(apiName, page, limit, createTimeBegin, createTimeEnd) {
  693. const apiMap = {
  694. getProcessInstancePage,
  695. getProcessInstanceDeptPage,
  696. getProcessInstanceNoticePage,
  697. getProcessInstanceAllPage
  698. };
  699. return await apiMap[apiName]({
  700. pageNo: page,
  701. pageSize: limit,
  702. ...this.params,
  703. processType: '1',
  704. createTimeBegin,
  705. createTimeEnd
  706. });
  707. },
  708. /* 刷新表格:根据当前选中的 tab 刷新 */
  709. handleSearch(where) {
  710. let find =
  711. this.defaultTemplateList.find(
  712. (item) => item.id == this.currentFormId
  713. ) || {};
  714. let makingJson = find.formJson?.makingJson
  715. ? JSON.parse(find.formJson.makingJson) || {}
  716. : {};
  717. console.log(makingJson, 'makingJson');
  718. // this.formColumnList = makingJson.list;
  719. this.$nextTick(() => {
  720. this.$refs.table.reload({ page: 1, where });
  721. });
  722. },
  723. /* 重置 */
  724. handleReset() {
  725. this.params = { ...defaultParams };
  726. this.createTime1 = [];
  727. // this.params.dictType = '';
  728. // this.params.formId = '';
  729. // this.currentDictType = this.dictList['collaborative_type'][0].value;
  730. // this.currentFormId = this.templateList[this.currentDictType][0]?.id;
  731. this.handleSearch();
  732. },
  733. /* 勾选记录批量打印:复用 detail 组件的 printRows */
  734. handlePrint() {
  735. if (!this.selection || this.selection.length === 0) {
  736. this.$message.warning('请先勾选需要打印的记录');
  737. return;
  738. }
  739. if (!this.$refs.printService) {
  740. this.$message.error('打印组件未就绪');
  741. return;
  742. }
  743. this.$refs.printService.printRows(this.selection);
  744. },
  745. /** */
  746. handleAudit(row) {
  747. this.$refs.detailRef.open(row.id);
  748. },
  749. /** */
  750. handleDetail(row) {
  751. this.formDetailDialogFlag = true;
  752. this.$nextTick(() => {
  753. this.$refs.formDetailDialogRef.open(row);
  754. });
  755. },
  756. getTimelineItemType(result) {
  757. if (result === '通过') {
  758. return 'success';
  759. }
  760. if (result === '不通过') {
  761. return 'danger';
  762. }
  763. if (result === '取消') {
  764. return 'info';
  765. }
  766. if (result === '处理中') {
  767. return 'warning';
  768. }
  769. return '';
  770. },
  771. getDateTime(ms) {
  772. return getDate(ms);
  773. },
  774. tabClick() {
  775. // 切换 tab 时按当前 tab 查询条件重新加载
  776. // this.handleSearch();
  777. this.handleReset();
  778. },
  779. changeDictTypeChange(v) {
  780. // this.currentDictType = v;
  781. this.params.formId = '';
  782. // this.currentFormId = this.templateList[v][0]?.id;
  783. this.handleSearch();
  784. },
  785. changeFormIdChange(v) {
  786. // this.currentFormId = v;
  787. this.handleSearch();
  788. }
  789. }
  790. };
  791. </script>
  792. <style scoped lang="scss">
  793. .ele-body {
  794. padding: 15px;
  795. }
  796. .ele-split-panel {
  797. width: 100%;
  798. }
  799. .filter-container {
  800. margin-bottom: 10px;
  801. margin-top: 10px;
  802. }
  803. .content-box {
  804. width: 100%;
  805. //max-width: 273px;
  806. //min-width: 90px;
  807. // margin-right: 10px;
  808. display: flex;
  809. flex-direction: row;
  810. flex-wrap: wrap;
  811. //justify-content: space-between;
  812. .category_box {
  813. border-left: 1px solid #e1e1e1;
  814. border-bottom: 1px solid #e1e1e1;
  815. border-radius: 1px;
  816. // flex: 1 0 25%;
  817. margin-top: 5px;
  818. overflow: auto;
  819. width: 100%;
  820. .category_box_title {
  821. font-size: 14px;
  822. font-weight: bold;
  823. color: #fff8f8;
  824. height: 39px;
  825. display: flex;
  826. padding: 5px 20px;
  827. align-items: center;
  828. background: #1890ffd6;
  829. border-bottom: 1px solid #e1e1e1;
  830. }
  831. .category_box_content {
  832. display: flex;
  833. flex-direction: row;
  834. flex-wrap: wrap;
  835. // height: 60px;
  836. overflow: auto;
  837. .category_content {
  838. min-width: 33%;
  839. min-height: 60px;
  840. //flex: 1 1 0;
  841. display: flex;
  842. flex-direction: column;
  843. border-right: 1px solid #e1e1e1;
  844. border-bottom: 1px solid #e1e1e1;
  845. align-items: center;
  846. justify-content: center;
  847. // font-weight: bold;
  848. &:nth-child(n) {
  849. span:nth-child(1) {
  850. transform: scale(2);
  851. }
  852. span:nth-child(2) {
  853. padding-top: 5px;
  854. }
  855. }
  856. }
  857. .category_content:hover {
  858. cursor: pointer;
  859. background-color: rgba(135, 181, 243, 0.29);
  860. }
  861. }
  862. }
  863. .category_box:last-child {
  864. border-right: 1px solid #e1e1e1;
  865. }
  866. }
  867. .tab-box {
  868. // width: calc(100vw - 552px);
  869. //max-width: 1100px;
  870. //min-width: 600px;
  871. margin-top: 6px;
  872. height: 98%;
  873. .el-tabs--border-card {
  874. height: 100%;
  875. }
  876. }
  877. ::v-deep .card_box {
  878. .el-card__body {
  879. padding: 10px;
  880. height: 86vh;
  881. }
  882. }
  883. ::v-deep .ele-table-tool {
  884. display: flex;
  885. flex-direction: row;
  886. flex-wrap: nowrap !important;
  887. }
  888. </style>