myRequest.vue 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330
  1. <template>
  2. <ibps-layout ref="layout">
  3. <div slot="west">
  4. <ibps-type-tree
  5. :width="width"
  6. :height="height"
  7. title="流程分类"
  8. category-key="FLOW_TYPE"
  9. @node-click="handleNodeClick"
  10. @expand-collapse="handleExpandCollapse"
  11. />
  12. </div>
  13. <ibps-crud
  14. ref="crud"
  15. :height="height"
  16. :data="listData"
  17. :toolbars="listConfig.toolbars"
  18. :search-form="listConfig.searchForm"
  19. :pk-key="pkKey"
  20. :columns="listConfig.columns"
  21. :row-handle="listConfig.rowHandle"
  22. :pagination="pagination"
  23. :loading="loading"
  24. :selection-row="false"
  25. :index-row="false"
  26. @action-event="handleAction"
  27. @sort-change="handleSortChange"
  28. @column-link-click="handleLinkClick"
  29. @pagination-change="handlePaginationChange"
  30. >
  31. <template slot="statusCloum" slot-scope="scope">
  32. <el-tag>{{ scope.row.status|optionsFilter(stautusOptions,'value','key') }}</el-tag>
  33. </template>
  34. </ibps-crud>
  35. <bpmn-formrender
  36. :visible="dialogFormVisible"
  37. :instance-id="instanceId"
  38. :pro-inst-id="proInstId"
  39. :def-id="defId"
  40. :copy-flow="copyFlow"
  41. @callback="search"
  42. @close="visible => dialogFormVisible = visible"
  43. />
  44. </ibps-layout>
  45. <!-- <div>
  46. <ibps-layout ref="layout">
  47. <div slot="west">
  48. <ibps-type-tree
  49. :width="width"
  50. :height="height"
  51. title="任务分类"
  52. category-key="FLOW_TYPE"
  53. @node-click="handleNodeClick"
  54. @expand-collapse="handleExpandCollapse"
  55. />
  56. </div>
  57. <ibps-card-list
  58. ref="crud"
  59. :title="title"
  60. :height="height"
  61. :data="listData"
  62. :pagination="pagination"
  63. :pk-key="pkKey"
  64. :toolbars="listConfig.toolbars"
  65. :search-form="listConfig.searchForm"
  66. :columns="listConfig.columns"
  67. :loading="loading"
  68. :index-row="false"
  69. @action-event="handleAction"
  70. @sort-change="handleSortChange"
  71. @pagination-change="handlePaginationChange"
  72. >
  73. <template slot="item-symbol">
  74. <p style="width:60px;height:60px;border: 2px solid #409eff;border-radius: 100%;font-size: 48px;color:#409eff;font-size:30px;line-height: 60px;">启动</p>
  75. </template>
  76. <template slot="item-detail-name">
  77. <span></span>
  78. </template>
  79. <template slot="item-detail-partyTypeName">
  80. <span></span>
  81. </template>
  82. <template slot="item-detail-createTime">
  83. <span></span>
  84. </template>
  85. <template slot="item-detail-taskName">
  86. <span></span>
  87. </template>
  88. <template slot="item-detail-completeTime">
  89. <span></span>
  90. </template>
  91. <template slot="item-detail-curNode">
  92. <span></span>
  93. </template>
  94. <template slot="item-detail-status">
  95. <span></span>
  96. </template>
  97. </ibps-card-list>
  98. <bpmn-formrender
  99. :visible="dialogFormVisible"
  100. :instance-id="instanceId"
  101. :pro-inst-id="proInstId"
  102. :def-id="defId"
  103. :copy-flow="copyFlow"
  104. @callback="search"
  105. @close="visible => dialogFormVisible = visible"
  106. />
  107. </ibps-layout> -->
  108. </div>
  109. </template>
  110. <script>
  111. import { myRequested } from '@/api/platform/office/bpmInitiated'
  112. import { findProcInstStatus } from '@/api/platform/bpmn/bpmInfo'
  113. import ActionUtils from '@/utils/action'
  114. import FixHeight from '@/mixins/height'
  115. import IbpsTypeTree from '@/business/platform/cat/type/tree'
  116. import BpmnFormrender from '@/business/platform/bpmn/form/dialog'
  117. export default {
  118. components: {
  119. IbpsTypeTree,
  120. BpmnFormrender,
  121. /* 'ibps-type-tree': () => import('@/business/platform/cat/type/tree'),
  122. 'ibps-card-list': () => import('@/components/ibps-card-list/list'),
  123. 'form-rights': () => import('@/business/platform/form/form-rights'),
  124. 'form-builder': () => import('@/business/platform/form/formbuilder/dialog'),
  125. 'formrender-preview': () => import('@/business/platform/form/formrender/preview/index') */
  126. },
  127. mixins: [FixHeight],
  128. data() {
  129. return {
  130. width: 220,
  131. height: 500,
  132. // height: document.clientHeight,
  133. title: '我启动的流程',
  134. createText: '创建表单',
  135. query: '',
  136. typeId: '',
  137. pkKey: 'id', // 主键 如果主键不是pk需要传主键
  138. loading: false,
  139. copyDialogFormVisible: false,
  140. rightsDialogFormVisible: false,
  141. formbuilderDialogVisible: false,
  142. formrenderDialogVisible: false,
  143. importFormVisible: false,
  144. formPrintDialogVisible: false,
  145. defId: '',
  146. statusOptions: [],
  147. editId: '',
  148. formKey: '',
  149. searchField: '',
  150. searchName: 'Q^subject_^SL',
  151. listData: [],
  152. dialogFormVisible: false, // 弹窗
  153. instanceId: '', // 编辑dialog需要使用
  154. proInstId: '', // 编辑dialog需要使用
  155. defId: '', // 编辑dialog需要使用
  156. copyFlow: false,
  157. stautusOptions: [],
  158. listConfig: {
  159. // 工具栏
  160. toolbars: [
  161. { key: 'search' }
  162. ],
  163. // 查询条件
  164. searchForm: {
  165. forms: [
  166. { prop: 'Q^subject_^SL', label: '事务名称' , labelWidth: 80, itemWidth: 150},
  167. { prop: 'Q^proc_def_name_^SL', label: '事务类型', labelWidth: 80, itemWidth: 150},
  168. {
  169. prop: ['Q^create_time_^DL', 'Q^create_time_^DG'],
  170. label: '创建时间',
  171. fieldType: 'daterange',
  172. labelWidth: 80,
  173. itemWidth: 200
  174. }
  175. ]
  176. },
  177. // 表格字段配置
  178. columns: [
  179. { prop: 'taskSubjectName', label: '事务名称', link: 'dialog' },
  180. { prop: 'procDefName', label: '事务类型', width: 120 },
  181. { prop: 'createTime', label: '创建时间', width: 140 },
  182. // { prop: 'status', label: '状态', slotName: 'statusCloum', width: 150 }
  183. ],
  184. // 管理列
  185. rowHandle: {
  186. effect: 'display',
  187. width: '110px',
  188. actions: [
  189. {
  190. key: 'copy',
  191. label: '编制查看',
  192. icon: 'el-icon-setting'
  193. }
  194. ]
  195. }
  196. },
  197. pagination: {},
  198. sorts: {}
  199. }
  200. },
  201. created() {
  202. this.loadData()
  203. this.findProcInstStatus()
  204. },
  205. methods: {
  206. findProcInstStatus() {
  207. findProcInstStatus().then(response => {
  208. this.stautusOptions = response.data
  209. })
  210. },
  211. /**
  212. * 加载数据
  213. */
  214. loadData() {
  215. this.loading = true
  216. myRequested(this.getFormatParams()).then(response => {
  217. response.data.dataResult.forEach((item) => {
  218. const taskSubject = item.subject.split('#')
  219. this.$set(item, 'taskSubjectName', taskSubject[0] +'#'+ taskSubject[1]+'#')
  220. })
  221. ActionUtils.handleListData(this, response.data)
  222. this.loading = false
  223. }).catch(() => {
  224. this.loading = false
  225. })
  226. },
  227. /**
  228. * 获取格式化参数
  229. */
  230. getFormatParams() {
  231. const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
  232. if (this.$utils.isNotEmpty(this.typeId)) {
  233. params['Q^TYPE_ID_^S'] = this.typeId
  234. }
  235. return ActionUtils.formatParams(
  236. params,
  237. this.pagination,
  238. this.sorts)
  239. },
  240. /**
  241. * 处理分页事件
  242. */
  243. handlePaginationChange(page) {
  244. ActionUtils.setPagination(this.pagination, page)
  245. this.loadData()
  246. },
  247. /**
  248. * 处理排序
  249. */
  250. handleSortChange(sort) {
  251. ActionUtils.setSorts(this.sorts, sort)
  252. this.loadData()
  253. },
  254. search() {
  255. this.loadData()
  256. },
  257. /**
  258. * 重置查询条件
  259. */
  260. reset() {
  261. this.$refs['crud'].handleReset()
  262. },
  263. /**
  264. * 点击表格
  265. */
  266. handleLinkClick(data) {
  267. this.instanceId = data.id || ''
  268. this.proInstId = ''
  269. this.defId = ''
  270. this.copyFlow = false
  271. this.dialogFormVisible = true
  272. },
  273. /**
  274. * 处理按钮事件
  275. */
  276. handleAction(command, position, selection, data) {
  277. switch (command) {
  278. case 'search':// 查询
  279. ActionUtils.setFirstPagination(this.pagination)
  280. this.search()
  281. break
  282. case 'copy':// 复制
  283. this.handleCopy(data)
  284. break
  285. case 'add':// 添加
  286. this.handleEdit()
  287. break
  288. case 'edit':// 编辑
  289. this.handleEdit(selection)
  290. break
  291. default:
  292. break
  293. }
  294. },
  295. /**
  296. * 编辑
  297. */
  298. handleEdit(id) {
  299. this.instanceId = id
  300. this.dialogFormVisible = true
  301. },
  302. handleNodeClick(typeId) {
  303. this.typeId = typeId
  304. this.loadData()
  305. },
  306. handleExpandCollapse(isExpand) {
  307. this.width = isExpand ? 230 : 30
  308. },
  309. handleCopy(data) {
  310. this.instanceId = ''
  311. this.proInstId = data.id || ''
  312. this.defId = data.procDefId || ''
  313. this.copyFlow = true
  314. this.dialogFormVisible = true
  315. }
  316. }
  317. }
  318. </script>
  319. <style scoped>
  320. .ibps-layout >>> .container-component{
  321. position: absolute;
  322. top: 0px;
  323. right: 0;
  324. bottom: 0px;
  325. left: 220px!important;}
  326. .ibps-card-list-container >>> .ibps-card-list--picture-card{display: block;}
  327. </style>