|
@@ -2,7 +2,6 @@
|
|
|
<el-drawer
|
|
|
:close-on-click-modal="false"
|
|
|
class="local-launch_drawer-wrap" :title="record.processName" :model-value="modelValue" size="760px" @update:model-value="updateModelValue">
|
|
|
- <!-- <div v-loading="loading" class="local_loading" element-loading-text="加载中..." element-loading-background="rgba(0, 0, 0, 0.1)" />-->
|
|
|
<div class="info-wrap">
|
|
|
<el-divider content-position="left">{{ record.processName }}表单</el-divider>
|
|
|
<FormCreate class="form-wrap" :option="formOption" :rule="formRule" />
|
|
@@ -41,15 +40,11 @@ import { ElMessage } from 'element-plus'
|
|
|
import { Plus } from '@element-plus/icons-vue'
|
|
|
import UseSelect from '@/components/scWorkflow/select.vue'
|
|
|
import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
|
|
|
-import user from '@/api/system/user'
|
|
|
type Props = {
|
|
|
modelValue: boolean
|
|
|
record: { processId: string; processName: string; [key: string]: any }
|
|
|
}
|
|
|
const props = defineProps<Props>()
|
|
|
-/*const props = withDefaults(defineProps<Props>(), {
|
|
|
- modelValue: false
|
|
|
-})*/
|
|
|
const emit = defineEmits<{
|
|
|
'update:modelValue': [bool: boolean] // 具名元组语法
|
|
|
update: [value: string]
|
|
@@ -65,7 +60,6 @@ const selectHandler = (name: string) => {
|
|
|
}
|
|
|
const FormCreate = viewForm.$form()
|
|
|
const formOption = ref({
|
|
|
- // resetBtn: { show: true },
|
|
|
onSubmit(formData) {
|
|
|
// console.error(formData, 'formData')
|
|
|
const processId = props.record.processId
|
|
@@ -97,25 +91,8 @@ const formOption = ref({
|
|
|
})
|
|
|
},
|
|
|
submitBtn: { loading: false }
|
|
|
- /*formData: {
|
|
|
- local_workflow: {},
|
|
|
- test_3: 'eeeee'
|
|
|
- }*/
|
|
|
})
|
|
|
-/*const formData = ref({
|
|
|
- local_workflow: {}
|
|
|
-})*/
|
|
|
-/*const workflowItem = computed(() => {
|
|
|
- return {
|
|
|
- type:'ScWorkflow',
|
|
|
- field: 'local_workflow'
|
|
|
- }
|
|
|
-})*/
|
|
|
-/*const workflowItem = {
|
|
|
- type: 'ScWorkflow',
|
|
|
- field: 'local_workflow'
|
|
|
-}
|
|
|
-const formRule = shallowRef([workflowItem])*/
|
|
|
+
|
|
|
// 当前form 表单数据字符串
|
|
|
let cur_processForm_str = '[]'
|
|
|
const formRule = shallowRef([])
|
|
@@ -131,9 +108,16 @@ const packageProcess = (data, list = []) => {
|
|
|
// console.log(config.name, 'name 普通节点名称', config)
|
|
|
if (!config.local_name) {
|
|
|
// 普通节点 展示 控制
|
|
|
- config.local_name = (config.nodeAssigneeList || []).map(x => x.name).join(',') || config.name
|
|
|
+ config.local_name = (config.nodeUserList || []).map(x => x.name).join(',') || config.name
|
|
|
+ }
|
|
|
+
|
|
|
+ // 默认用户
|
|
|
+ let assigneeList = config.nodeUserList
|
|
|
+ if (config.nodeRoleList) {
|
|
|
+ // 存在设置角色
|
|
|
+ assigneeList = config.nodeRoleList
|
|
|
}
|
|
|
- userMap.value.set(config.name, config.nodeAssigneeList)
|
|
|
+ userMap.value.set(config.name, assigneeList)
|
|
|
_list.push(config)
|
|
|
} else if (config.conditionNode === 1) {
|
|
|
// 自定义标识key
|
|
@@ -170,26 +154,18 @@ const processTimelineList = computed(() => {
|
|
|
})
|
|
|
|
|
|
model.processListNodeMapApi(props.record.processId).then(res => {
|
|
|
- // model.processListNodeMapApi('1747258191679991809').then((res: any[]) => {
|
|
|
localProcessData.value = res
|
|
|
- // console.error(localProcessData, 'res..... processListNodeMapApi')
|
|
|
})
|
|
|
model.processDetailApi(props.record.processId).then(res => {
|
|
|
- // model.processDetailApi('1747258191679991809').then(res => {
|
|
|
- // console.error(res, '详情 process....', props.record)
|
|
|
- // modelContent 审批流数据
|
|
|
let local_workflow = {}
|
|
|
try {
|
|
|
console.log(JSON.parse(res.modelContent))
|
|
|
const modelContent = JSON.parse(res.modelContent)
|
|
|
local_workflow = modelContent.nodeConfig ?? modelContent.childNode
|
|
|
} catch (e) {}
|
|
|
- // formOption.value.formData = { local_workflow, test_3: 'eeeee' }
|
|
|
cur_processForm_str = res.processForm || '[]'
|
|
|
// processForm 动态表单
|
|
|
formRule.value = [...JSON.parse(cur_processForm_str) /*, { ...workflowItem, value: local_workflow }*/ /*, { type: 'input', field: 'test_3' }*/]
|
|
|
- // loading.value = false
|
|
|
- // console.error(formData.value, 'formData.value')
|
|
|
})
|
|
|
</script>
|
|
|
<style lang="scss">
|