综合办公系统
Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341
  1. <!--
  2. * @Author: ysh
  3. * @Date: 2025-02-19 15:36:34
  4. * @LastEditors: Please set LastEditors
  5. * @LastEditTime: 2025-03-26 15:35:31
  6. -->
  7. <template>
  8. <view class="page-container">
  9. <!-- 搜索框 -->
  10. <view class="search-box">
  11. <uni-search-bar radius="34" placeholder="请输入流程名称" @confirm="search" @input="inputChange"
  12. v-model="queryParams.procDefName" />
  13. </view>
  14. <!-- 流程列表 -->
  15. <mescroll-uni ref="mescrollRef" @init="mescrollInit" @down="downCallback" @up="upCallback" :fixed="false" :top="10">
  16. <uni-list>
  17. <uni-list-item v-for="(item, index) in list" :key="index" clickable>
  18. <template v-slot:body>
  19. <view class="list-item">
  20. <!-- 状态与标题行 -->
  21. <view class="header-line">
  22. <uni-tag :text="item.finishTime ? '已完成' : '进行中'" :type="item.finishTime ? 'success' : 'warning'"
  23. size="small" class="status-tag" />
  24. <text class="proc-name">{{ item.procDefName }}</text>
  25. </view>
  26. <!-- 主要内容 -->
  27. <view class="content-box">
  28. <!-- 标题 -->
  29. <view class="title-box">
  30. <uni-icons type="info" size="16" color="#666" class="title-icon"></uni-icons>
  31. <text class="title-text">{{ item.title }}</text>
  32. </view>
  33. <!-- 信息分割线 -->
  34. <uv-divider :dashed="true" margin="10rpx 0"></uv-divider>
  35. <!-- 详细信息 -->
  36. <view class="detail-grid">
  37. <view class="detail-item">
  38. <uni-icons type="calendar" size="14" color="#999"></uni-icons>
  39. <text class="detail-text">{{ item.createTime }}</text>
  40. </view>
  41. <view class="detail-item">
  42. <uni-icons type="clock" size="14" color="#999"></uni-icons>
  43. <text class="detail-text">{{ item.duration }}</text>
  44. </view>
  45. <view class="detail-item">
  46. <uni-icons type="location" size="14" color="#999"></uni-icons>
  47. <text class="detail-text">{{ item.taskName }}</text>
  48. </view>
  49. <view class="detail-item">
  50. <uni-icons type="person" size="14" color="#999"></uni-icons>
  51. <text class="detail-text">{{ item.assigneeName || '暂无待办人' }}</text>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- 操作按钮 -->
  56. <view class="action-box">
  57. <text class="view-detail">查看详情</text>
  58. <uni-icons type="more-filled" size="20" color="#666" @click="showAction(item)"
  59. class="action-icon"></uni-icons>
  60. </view>
  61. </view>
  62. </template>
  63. </uni-list-item>
  64. </uni-list>
  65. </mescroll-uni>
  66. <!-- 操作菜单 -->
  67. <uni-popup ref="actionPopup" type="bottom">
  68. <view class="action-menu">
  69. <view class="menu-item" @click="handleFlowRecord(selectedItem)">
  70. <text>办理进度</text>
  71. </view>
  72. <view class="menu-item" @click="handleFlowNote(selectedItem)">
  73. <text>表单信息</text>
  74. </view>
  75. <view class="menu-item danger" @click="handleDelete(selectedItem)"
  76. :class="{ disabled: !beDeleted(selectedItem) }">
  77. <text>取消流程</text>
  78. </view>
  79. </view>
  80. </uni-popup>
  81. <!-- 菜单抽屉 -->
  82. <uni-drawer ref="drawer" mode="right" :width="300">
  83. <flow-record :rows="selectedItem" v-if="active == 'record'"></flow-record>
  84. </uni-drawer>
  85. </view>
  86. </template>
  87. <script>
  88. import { debounce } from 'lodash-es';
  89. import MescrollMixin from '@/uni_modules/mescroll/components/mescroll-uni/mescroll-mixins.js'
  90. import { myProcessList, stopProcess } from "@/api/flowable/process";
  91. import FlowRecord from '../../components/flowable/FlowRecord.vue';
  92. export default {
  93. components: { FlowRecord },
  94. mixins: [MescrollMixin],
  95. data() {
  96. return {
  97. // 我发起的流程列表数据
  98. myProcessList: [],
  99. list: [], // 列表数据
  100. queryParams: {
  101. keyword: '',
  102. pageNum: 1,
  103. pageSize: 10
  104. },
  105. selectedItem: null, // 当前选中项
  106. debounceSearch: null, // 初始化防抖方法
  107. clickRow: {},
  108. active: 'record'
  109. }
  110. },
  111. created() {
  112. // 在生命周期中创建防抖方法
  113. this.debounceSearch = debounce(() => {
  114. this.search()
  115. }, 500)
  116. },
  117. methods: {
  118. // mescroll下拉刷新回调
  119. async downCallback() {
  120. this.queryParams.pageNum = 1
  121. const res = await this.loadData()
  122. this.list = res.data.list;
  123. this.mescroll.endSuccess(res.data.length)
  124. this.mescroll.endErr()
  125. },
  126. // mescroll上拉加载回调
  127. async upCallback(page) {
  128. this.queryParams.pageNum = page.num
  129. const res = await this.loadData()
  130. this.list = this.list.concat(res.data.list)
  131. this.mescroll.endSuccess(res.data.list.length, res.data.hasNextPage)
  132. },
  133. // 加载数据
  134. async loadData() {
  135. try {
  136. const res = await myProcessList(this.queryParams)
  137. return {
  138. data: {
  139. list: res.data.records,
  140. hasNextPage: res.hasNextPage
  141. }
  142. }
  143. } catch (e) {
  144. this.mescroll.endErr()
  145. return { data: { list: [], hasNextPage: false } }
  146. }
  147. },
  148. // 显示操作菜单
  149. showAction(item) {
  150. this.selectedItem = item
  151. this.$refs.actionPopup.open()
  152. },
  153. // 输入变化处理
  154. inputChange() {
  155. this.debounceSearch()
  156. },
  157. // 执行搜索
  158. search() {
  159. this.loadData()
  160. this.mescroll.resetUpScroll()
  161. },
  162. handleFlowRecord(row) {
  163. console.log(row);
  164. this.active = 'record';
  165. this.$refs.drawer.open();
  166. },
  167. handleFlowNote(row) {
  168. console.log(row);
  169. const query = {
  170. procInsId: row.procInsId,
  171. executionId: row.executionId,
  172. deployId: row.deployId,
  173. taskId: row.taskId,
  174. taskName: '',
  175. startUserName: row.startUserName,
  176. procDefName: row.procDefName
  177. }
  178. const encodedParams = encodeURIComponent(JSON.stringify(query));
  179. uni.navigateTo({
  180. url: `/pages/message/apply/detail?params=${encodedParams}`
  181. })
  182. },
  183. handleDelete(row) { /* ... */ },
  184. beDeleted(row) { /* ... */ },
  185. },
  186. }
  187. </script>
  188. <style lang="scss" scoped>
  189. .list-item {
  190. padding: 24rpx;
  191. background: #fff;
  192. border-radius: 16rpx;
  193. margin: 16rpx 24rpx;
  194. box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.08);
  195. width: 100%;
  196. }
  197. /* 头部状态行 */
  198. .header-line {
  199. display: flex;
  200. align-items: center;
  201. margin-bottom: 20rpx;
  202. }
  203. .proc-name {
  204. font-size: 30rpx;
  205. color: #333;
  206. font-weight: 500;
  207. margin-left: 16rpx;
  208. }
  209. .status-tag {
  210. transform: translateY(-2rpx);
  211. }
  212. /* 内容区域 */
  213. .content-box {
  214. padding: 12rpx 0;
  215. }
  216. .title-box {
  217. display: flex;
  218. align-items: center;
  219. margin-bottom: 16rpx;
  220. }
  221. .title-icon {
  222. margin-right: 8rpx;
  223. }
  224. .title-text {
  225. font-size: 28rpx;
  226. color: #333;
  227. font-weight: 600;
  228. }
  229. /* 详细信息网格 */
  230. .detail-grid {
  231. display: grid;
  232. grid-template-columns: repeat(2, 1fr);
  233. gap: 16rpx 24rpx;
  234. margin-top: 20rpx;
  235. }
  236. .detail-item {
  237. display: flex;
  238. align-items: center;
  239. }
  240. .detail-text {
  241. font-size: 24rpx;
  242. color: #666;
  243. margin-left: 8rpx;
  244. overflow: hidden;
  245. text-overflow: ellipsis;
  246. }
  247. /* 操作区域 */
  248. .action-box {
  249. display: flex;
  250. justify-content: space-between;
  251. align-items: center;
  252. margin-top: 24rpx;
  253. padding-top: 16rpx;
  254. border-top: 1rpx solid #eee;
  255. }
  256. .view-detail {
  257. color: #2979FF;
  258. font-size: 26rpx;
  259. padding: 8rpx 16rpx;
  260. border-radius: 8rpx;
  261. background: #f5f7fa;
  262. }
  263. .action-icon {
  264. padding: 8rpx;
  265. }
  266. /* 添加点击态效果 */
  267. .action-box:active {
  268. background: #f8f8f8;
  269. transform: scale(0.98);
  270. transition: all 0.2s;
  271. }
  272. /* 状态标签增强 */
  273. .status-tag {
  274. padding: 4rpx 12rpx !important;
  275. border-radius: 8rpx !important;
  276. }
  277. /* 颜色增强 */
  278. .proc-name {
  279. color: #1a1a1a;
  280. }
  281. .title-text {
  282. color: #2d2d2d;
  283. }
  284. /* 图标颜色统一 */
  285. .detail-item uni-icons {
  286. color: #909399 !important;
  287. }
  288. .action-menu {
  289. background: #fff;
  290. border-radius: 16rpx 16rpx 0 0;
  291. padding: 30rpx;
  292. }
  293. .menu-item {
  294. padding: 30rpx;
  295. border-bottom: 1rpx solid #eee;
  296. }
  297. .menu-item.danger {
  298. color: #f56c6c;
  299. }
  300. .menu-item.disabled {
  301. color: #c0c4cc;
  302. pointer-events: none;
  303. }
  304. </style>