Merge pull request 'feat : 添加表单设置页面' (#11) from clay into master
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/11
This commit is contained in:
@@ -1,16 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="margin-top: 15px">
|
<div style="margin-top: 15px">
|
||||||
<el-button @click="changPan('formDesign')">表单</el-button>
|
<el-button @click="changPan('processSetting')">流程设置</el-button>
|
||||||
<el-button @click="changPan('processDesign')">流程</el-button>
|
<el-button @click="changPan('formDesign')">表单</el-button>
|
||||||
<el-button @click="publishProcess">发布</el-button>
|
<el-button @click="changPan('processDesign')">流程</el-button>
|
||||||
<div class="layout-body" v-if="visible">
|
<el-button @click="publishProcess">发布</el-button>
|
||||||
<div v-show="activeSelect === 'processDesign'">
|
<div class="layout-body" v-if="visible">
|
||||||
<process-design ref="processDesign"/>
|
<div v-show="activeSelect === 'processSetting'">
|
||||||
|
<process-setting ref="processSetting"/>
|
||||||
|
</div>
|
||||||
|
<div v-show="activeSelect === 'processDesign'">
|
||||||
|
<process-design ref="processDesign"/>
|
||||||
|
</div>
|
||||||
|
<div v-show="activeSelect === 'formDesign'">
|
||||||
|
<form-design ref="formDesign"/>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div v-show="activeSelect === 'formDesign'" >
|
|
||||||
<form-design ref="formDesign"/>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<el-dialog v-model="validVisible" title="设置项检查">
|
<el-dialog v-model="validVisible" title="设置项检查">
|
||||||
@@ -33,7 +37,9 @@
|
|||||||
</ellipsis>
|
</ellipsis>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="validResult.finished && validResult.success">
|
<div v-if="validResult.finished && validResult.success">
|
||||||
<el-icon color="#67c23a" size="70"><CircleCheckFilled /></el-icon>
|
<el-icon color="#67c23a" size="70">
|
||||||
|
<CircleCheckFilled/>
|
||||||
|
</el-icon>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #extra>
|
<template #extra>
|
||||||
@@ -49,35 +55,39 @@
|
|||||||
import {getProcessDefinitionInfo, addProcessDefinition} from "@/api/workflow/process-definition.js";
|
import {getProcessDefinitionInfo, addProcessDefinition} from "@/api/workflow/process-definition.js";
|
||||||
import ProcessDesign from './ProcessDesign.vue'
|
import ProcessDesign from './ProcessDesign.vue'
|
||||||
import FormDesign from '../form/FormDesign.vue'
|
import FormDesign from '../form/FormDesign.vue'
|
||||||
|
import ProcessSetting from "./ProcessSetting.vue";
|
||||||
import Ellipsis from './common/Ellipsis.vue'
|
import Ellipsis from './common/Ellipsis.vue'
|
||||||
import {getCurrentInstance} from '@vue/runtime-core';
|
import {getCurrentInstance} from '@vue/runtime-core';
|
||||||
|
|
||||||
let {proxy} = getCurrentInstance();
|
let {proxy} = getCurrentInstance();
|
||||||
import {Loading,WarningFilled,CircleCheckFilled} from '@element-plus/icons-vue'
|
import {Loading, WarningFilled, CircleCheckFilled} from '@element-plus/icons-vue'
|
||||||
import {ref,computed} from 'vue'
|
import {ref, computed} from 'vue'
|
||||||
|
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const params = reactive(router.currentRoute.value.params)
|
const params = reactive(router.currentRoute.value.params)
|
||||||
import {useProcessStore} from '@/stores/processStore.js'
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
|
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
import {ElMessage, ElMessageBox} from "element-plus";
|
import {ElMessage, ElMessageBox} from "element-plus";
|
||||||
|
|
||||||
const processDesign = ref()
|
const processDesign = ref()
|
||||||
const visible = ref(false)
|
const visible = ref(false)
|
||||||
const timer = ref(null)
|
const timer = ref(null)
|
||||||
const validComponents = ref(['formDesign','processDesign'])
|
const validComponents = ref(['processSetting', 'formDesign', 'processDesign'])
|
||||||
// const activeSelect = ref('formDesign')
|
// const activeSelect = ref('formDesign')
|
||||||
const activeSelect = ref('processDesign')
|
const activeSelect = ref('processSetting')
|
||||||
const validVisible = ref(false)
|
const validVisible = ref(false)
|
||||||
const validStep = ref(0)
|
const validStep = ref(0)
|
||||||
const validResult = ref({})
|
const validResult = ref({})
|
||||||
const validOptions = ref([
|
const validOptions = ref([
|
||||||
{title: '基础信息', description: '', icon: '', status: ''},
|
{title: '基础信息', description: '', icon: '', status: ''},
|
||||||
{title: '审批表单', description: '', icon: '', status: ''},
|
{title: '审批表单', description: '', icon: '', status: ''},
|
||||||
// {title: '审批流程', description: '', icon: '', status: ''},
|
{title: '审批流程', description: '', icon: '', status: ''},
|
||||||
// {title: '扩展设置', description: '', icon: '', status: ''}
|
// {title: '扩展设置', description: '', icon: '', status: ''}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
|
||||||
const errTitle = computed(()=>{
|
const errTitle = computed(() => {
|
||||||
if (validResult.finished && !validResult.success) {
|
if (validResult.finished && !validResult.success) {
|
||||||
return validResult.title + ` (${validResult.errs.length}项错误) 😥`
|
return validResult.title + ` (${validResult.errs.length}项错误) 😥`
|
||||||
}
|
}
|
||||||
@@ -85,7 +95,7 @@ const errTitle = computed(()=>{
|
|||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
const validIcon = computed(()=>{
|
const validIcon = computed(() => {
|
||||||
if (!validResult.finished) {
|
if (!validResult.finished) {
|
||||||
return Loading
|
return Loading
|
||||||
} else if (validResult.success) {
|
} else if (validResult.success) {
|
||||||
@@ -97,9 +107,9 @@ const validIcon = computed(()=>{
|
|||||||
|
|
||||||
const init = () => {
|
const init = () => {
|
||||||
let deploymentId = params.deploymentId
|
let deploymentId = params.deploymentId
|
||||||
if (deploymentId === undefined){
|
if (deploymentId === undefined) {
|
||||||
loadInitFrom()
|
loadInitFrom()
|
||||||
}else {
|
} else {
|
||||||
getProcessInfo()
|
getProcessInfo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -145,7 +155,7 @@ const loadInitFrom = () => {
|
|||||||
}
|
}
|
||||||
processStore.setDesign(design)
|
processStore.setDesign(design)
|
||||||
visible.value = true
|
visible.value = true
|
||||||
nextTick(()=>{
|
nextTick(() => {
|
||||||
processDesign.value.initRender()
|
processDesign.value.initRender()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -166,7 +176,7 @@ const getProcessInfo = async () => {
|
|||||||
if (res.code === 1000) {
|
if (res.code === 1000) {
|
||||||
processStore.setDesign(res.data)
|
processStore.setDesign(res.data)
|
||||||
visible.value = true
|
visible.value = true
|
||||||
nextTick(()=>{
|
nextTick(() => {
|
||||||
processDesign.value.initRender()
|
processDesign.value.initRender()
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
@@ -203,10 +213,10 @@ const getDefaultValidErr = () => {
|
|||||||
return '请检查基础设置项';
|
return '请检查基础设置项';
|
||||||
case 1:
|
case 1:
|
||||||
return '请检查审批表单相关设置'
|
return '请检查审批表单相关设置'
|
||||||
// case 2:
|
// case 2:
|
||||||
// return '请检查审批流程,查看对应标注节点错误信息'
|
// return '请检查审批流程,查看对应标注节点错误信息'
|
||||||
// case 3:
|
// case 3:
|
||||||
// return '请检查扩展设置'
|
// return '请检查扩展设置'
|
||||||
default:
|
default:
|
||||||
return '未知错误'
|
return '未知错误'
|
||||||
}
|
}
|
||||||
@@ -271,17 +281,17 @@ const doPublish = () => {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
let design = processStore.getDesign()
|
let design = processStore.getDesign()
|
||||||
console.log(design)
|
console.log(design)
|
||||||
let template = {
|
let template = {
|
||||||
...design
|
...design
|
||||||
}
|
}
|
||||||
console.log(template)
|
console.log(template)
|
||||||
addProcessDefinition(template).then(res => {
|
addProcessDefinition(template).then(res => {
|
||||||
if (res.code === 1000){
|
if (res.code === 1000) {
|
||||||
ElMessage.success(res.msg)
|
ElMessage.success(res.msg)
|
||||||
// this.$router.push("/formsPanel")
|
// this.$router.push("/formsPanel")
|
||||||
}else {
|
} else {
|
||||||
ElMessage.error(res.msg)
|
ElMessage.error(res.msg)
|
||||||
}
|
}
|
||||||
}).catch(err => {
|
}).catch(err => {
|
||||||
|
|||||||
30
src/views/workflow/process/ProcessSetting.vue
Normal file
30
src/views/workflow/process/ProcessSetting.vue
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
<template>
|
||||||
|
<el-input v-model="processData.deploymentName" placeholder="请输入流程名称" />
|
||||||
|
流程设置{{ processData.deploymentName }}
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup>
|
||||||
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
|
import {computed, defineExpose} from "vue";
|
||||||
|
const processStore = useProcessStore()
|
||||||
|
console.log(processStore.getDesign)
|
||||||
|
|
||||||
|
const processData = computed(() => {
|
||||||
|
return processStore.getDesign()
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
const validate = () => {
|
||||||
|
console.log("validate")
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
|
||||||
|
defineExpose({
|
||||||
|
validate
|
||||||
|
})
|
||||||
|
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user