myRequest.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  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: 'subject', label: '事务名称1', 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. ActionUtils.handleListData(this, response.data)
  218. this.loading = false
  219. }).catch(() => {
  220. this.loading = false
  221. })
  222. },
  223. /**
  224. * 获取格式化参数
  225. */
  226. getFormatParams() {
  227. const params = this.$refs['crud'] ? this.$refs['crud'].getSearcFormData() : {}
  228. if (this.$utils.isNotEmpty(this.typeId)) {
  229. params['Q^TYPE_ID_^S'] = this.typeId
  230. }
  231. return ActionUtils.formatParams(
  232. params,
  233. this.pagination,
  234. this.sorts)
  235. },
  236. /**
  237. * 处理分页事件
  238. */
  239. handlePaginationChange(page) {
  240. ActionUtils.setPagination(this.pagination, page)
  241. this.loadData()
  242. },
  243. /**
  244. * 处理排序
  245. */
  246. handleSortChange(sort) {
  247. ActionUtils.setSorts(this.sorts, sort)
  248. this.loadData()
  249. },
  250. search() {
  251. this.loadData()
  252. },
  253. /**
  254. * 重置查询条件
  255. */
  256. reset() {
  257. this.$refs['crud'].handleReset()
  258. },
  259. /**
  260. * 点击表格
  261. */
  262. handleLinkClick(data) {
  263. this.instanceId = data.id || ''
  264. this.proInstId = ''
  265. this.defId = ''
  266. this.copyFlow = false
  267. this.dialogFormVisible = true
  268. },
  269. /**
  270. * 处理按钮事件
  271. */
  272. handleAction(command, position, selection, data) {
  273. switch (command) {
  274. case 'search':// 查询
  275. ActionUtils.setFirstPagination(this.pagination)
  276. this.search()
  277. break
  278. case 'copy':// 复制
  279. this.handleCopy(data)
  280. break
  281. case 'add':// 添加
  282. this.handleEdit()
  283. break
  284. case 'edit':// 编辑
  285. this.handleEdit(selection)
  286. break
  287. default:
  288. break
  289. }
  290. },
  291. /**
  292. * 编辑
  293. */
  294. handleEdit(id) {
  295. this.instanceId = id
  296. this.dialogFormVisible = true
  297. },
  298. handleNodeClick(typeId) {
  299. this.typeId = typeId
  300. this.loadData()
  301. },
  302. handleExpandCollapse(isExpand) {
  303. this.width = isExpand ? 230 : 30
  304. },
  305. handleCopy(data) {
  306. this.instanceId = ''
  307. this.proInstId = data.id || ''
  308. this.defId = data.procDefId || ''
  309. this.copyFlow = true
  310. this.dialogFormVisible = true
  311. }
  312. }
  313. }
  314. </script>
  315. <style scoped>
  316. .ibps-layout >>> .container-component{
  317. position: absolute;
  318. top: 0px;
  319. right: 0;
  320. bottom: 0px;
  321. left: 220px!important;}
  322. .ibps-card-list-container >>> .ibps-card-list--picture-card{display: block;}
  323. </style>