|
@@ -0,0 +1,95 @@
|
|
|
+<template>
|
|
|
+ <van-collapse v-model="activeNames">
|
|
|
+ <van-collapse-item v-for="item in processList" :key="item.ID">
|
|
|
+ <template #title>
|
|
|
+ <van-text-ellipsis :content="item.processName" style="font-size: 0.45rem"/>
|
|
|
+ </template>
|
|
|
+ <template #value>
|
|
|
+ <van-switch
|
|
|
+ v-model="item.isUse"
|
|
|
+ @change="changeSwitch"
|
|
|
+ @click.stop
|
|
|
+ size="0.5rem"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ <van-row style="font-size: 0.36rem">
|
|
|
+ <van-col :span="15">
|
|
|
+ <van-text-ellipsis :content="flowType(item.processType)"/>
|
|
|
+ </van-col>
|
|
|
+ <van-col :span="9">
|
|
|
+ <van-text-ellipsis :content="nodeNumber(item.nodes.length)"/>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ <van-row style="margin-top: 20px">
|
|
|
+ <van-col :span="24">
|
|
|
+ <van-button
|
|
|
+ type="primary"
|
|
|
+ size="large"
|
|
|
+ round
|
|
|
+ @click="openStepsPopup(item.nodes)">
|
|
|
+ 效果图
|
|
|
+ </van-button>
|
|
|
+ </van-col>
|
|
|
+ </van-row>
|
|
|
+ </van-collapse-item>
|
|
|
+ </van-collapse>
|
|
|
+ <van-popup v-model:show="stepsShow" class="stepsPopup">
|
|
|
+ <van-steps :active="stepsActive" direction="vertical">
|
|
|
+ <van-step v-for="item in nodeList" :key="item.ID">
|
|
|
+ <h3>{{item.nodeName}}</h3>
|
|
|
+ <p>{{item.approver.nickName}}</p>
|
|
|
+ </van-step>
|
|
|
+ </van-steps>
|
|
|
+ </van-popup>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script setup>
|
|
|
+import { getProcessList } from "@/api/flow"
|
|
|
+defineOptions({
|
|
|
+ name: 'flowList',
|
|
|
+})
|
|
|
+const processPag = reactive({
|
|
|
+ page: 1,
|
|
|
+ pageSize: 1000
|
|
|
+})
|
|
|
+onMounted(() => {
|
|
|
+ queryProcessList()
|
|
|
+})
|
|
|
+const processList = reactive([])
|
|
|
+const nodeList = reactive([])
|
|
|
+const queryProcessList = () => {
|
|
|
+ getProcessList(processPag).then(res => {
|
|
|
+ if (res.code === 0) {
|
|
|
+ const list = res.data.list
|
|
|
+ processList.length = 0
|
|
|
+ processList.push(...list)
|
|
|
+ }
|
|
|
+ })
|
|
|
+}
|
|
|
+const activeNames = ref(['1'])
|
|
|
+const changeSwitch = (val) => {
|
|
|
+ console.log(val)
|
|
|
+}
|
|
|
+// 流程效果图
|
|
|
+const stepsShow = ref(false)
|
|
|
+const stepsActive = ref(1)
|
|
|
+const openStepsPopup = (item) => {
|
|
|
+ stepsShow.value = true
|
|
|
+ nodeList.length = 0
|
|
|
+ nodeList.push(...item)
|
|
|
+ stepsActive.value = item.length - 1
|
|
|
+}
|
|
|
+// 计算属性
|
|
|
+const flowType = computed(() => {
|
|
|
+ return (type) => "流程类型:" + type
|
|
|
+})
|
|
|
+const nodeNumber = computed(() => {
|
|
|
+ return (num) => "节点数量:" + num
|
|
|
+})
|
|
|
+</script>
|
|
|
+
|
|
|
+<style scoped lang="less">
|
|
|
+.stepsPopup{
|
|
|
+ width: 500px;
|
|
|
+}
|
|
|
+</style>
|