index.vue 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. <template>
  2. <div class="progressLc">
  3. <div class="search-box">
  4. <a-form :model="formSearch" layout="inline" :label-col="labelCol">
  5. <a-form-item label="流程名称:">
  6. <a-input style="width:240px" placeholder="请输入..." v-model:value="formSearch.name" />
  7. </a-form-item>
  8. <a-form-item label="标识Key:">
  9. <a-input style="width:240px" placeholder="请输入..." v-model:value="formSearch.key" />
  10. </a-form-item>
  11. <a-form-item label="">
  12. <a-button style="margin-right:10px" type="primary"
  13. preIcon="ant-design:search-outlined">查询</a-button>
  14. <a-button type="primary">重置</a-button>
  15. </a-form-item>
  16. </a-form>
  17. </div>
  18. <div class="content-box">
  19. <a-table size="small" :dataSource="dataSource" :columns="columns" :scroll="{ y: 730 }"
  20. :pagination="pagination">
  21. <template #action="{ record }">
  22. <a-button type="link" style="color:#3DF6FF" @click="getClick({ event: 'gq', row: record })">
  23. 挂起
  24. </a-button>
  25. <a-button type="link" style="color:#3DF6FF" @click="getClick({ event: 'sp', row: record })">
  26. 审批详情
  27. </a-button>
  28. <a-button type="link" style="color:#3DF6FF">
  29. 表单数据
  30. </a-button>
  31. <a-button type="link" style="color:#3DF6FF">
  32. 删除
  33. </a-button>
  34. </template>
  35. </a-table>
  36. </div>
  37. <!-- 审批详情弹窗 -->
  38. <a-modal v-model:visible="visibleSp" width="1000px" :title="titleSp" centered destroyOnClose>
  39. <HistorySp :historySpList="historySpList"></HistorySp>
  40. </a-modal>
  41. </div>
  42. </template>
  43. <script setup lang="ts">
  44. import { ref, reactive, onMounted, createVNode } from 'vue'
  45. import HistorySp from './common/HistorySp.vue'
  46. import { Modal } from 'ant-design-vue';
  47. import { ExclamationCircleOutlined } from '@ant-design/icons-vue';
  48. import { columns } from './progressLc.data'
  49. import { getRunningProcess,getHistoricFlow } from './progressLc.api'
  50. const labelCol = { style: { width: '80px' } };
  51. //查询参数
  52. let formSearch = reactive({
  53. name: '',
  54. key: ''
  55. })
  56. //数据列表
  57. let dataSource = ref<any[]>([])
  58. //分页参数配置
  59. let pagination = reactive({
  60. current: 1, // 当前页码
  61. pageSize: 10, // 每页显示条数
  62. total: 0, // 总条目数,后端返回
  63. // showTotal: (total, range) => `${range[0]}-${range[1]} 条,总共 ${total} 条`, // 分页右下角显示信息
  64. showSizeChanger: true, // 是否可改变每页显示条数
  65. pageSizeOptions: ['10', '20', '50',], // 可选的每页显示条数
  66. })
  67. //审批详情弹窗数据
  68. let visibleSp = ref(false)
  69. let titleSp = ref('审批历史')
  70. //审批详情历史数据
  71. let historySpList=reactive<any[]>([])
  72. //审批详情-审批历史列表
  73. async function getHistoricFlowList(){
  74. let res=await getHistoricFlow()
  75. console.log(res,'审批历史---------------------')
  76. if(res.length!=0){
  77. historySpList.length=0
  78. res.forEach(el=>{
  79. historySpList.push({name:el.name})
  80. })
  81. }
  82. }
  83. //获取列表
  84. async function getRunningProcessList() {
  85. let res = await getRunningProcess({ name: formSearch.name, key: formSearch.key, pageNumber: pagination.current, pageSize: pagination.pageSize })
  86. console.log(res, 'tableList--------------')
  87. if (res.length != 0) {
  88. res.forEach(el => {
  89. el.versionC = 'v.1'
  90. el.isSuspended = el.isSuspended ? '未激活' : '已激活'
  91. })
  92. dataSource.value = res
  93. }
  94. }
  95. //table操作
  96. function getClick(data) {
  97. console.log(data, 'data------------------')
  98. switch (data.event) {
  99. case 'gq':
  100. Modal.confirm({
  101. title: '确认暂停挂起',
  102. centered: true,
  103. icon: createVNode(ExclamationCircleOutlined),
  104. content: createVNode('div', { style: 'color:#fff' }, `您确认要暂停挂起流程实例${data.row.name}`),
  105. okText: '确认',
  106. cancelText: '取消',
  107. onOk: () => {
  108. Modal.destroyAll();
  109. },
  110. });
  111. break;
  112. case 'sp':
  113. visibleSp.value = true
  114. break;
  115. }
  116. }
  117. onMounted(() => {
  118. getRunningProcessList()
  119. getHistoricFlowList()
  120. })
  121. </script>
  122. <style lang="less" scoped>
  123. .progressLc {
  124. position: relative;
  125. width: 100%;
  126. height: 100%;
  127. padding: 15px;
  128. box-sizing: border-box;
  129. .search-box {
  130. height: 50px;
  131. }
  132. .content-box {
  133. height: calc(100% - 40px);
  134. }
  135. }
  136. :deep(.zxm-form-item-label > label) {
  137. color: #fff;
  138. }
  139. :deep(.zxm-input) {
  140. color: #fff;
  141. background-color: #ffffff00;
  142. border: 1px solid #3ad8ff77 !important;
  143. }
  144. </style>