Explorar el Código

优化创建流程

hubin hace 1 año
padre
commit
32e213abbe

+ 1 - 0
src/components/scWorkflow/nodes/approver.vue

@@ -211,6 +211,7 @@ export default {
 			})
 			this.form = JSON.parse(JSON.stringify(this.nodeConfig))
 			console.log('===this.form===', this.form)
+			console.log('===this.form===', initOperateTable)
 			if (!this.form.extendConfig) {
 				this.form.extendConfig = { formConfig: initOperateTable }
 			}

+ 1 - 2
src/store/modules/flow.ts

@@ -6,8 +6,7 @@ export const useFlowStore = defineStore({
 	state: () => {
 		return {
 			storeInfoName: '',
-			flowProcessId: '',
-
+			processId: '',
 			processKey: '', // 唯一标识
 			processName: '', // 流程定义名称
 			processIcon: 'approval', // 流程图标

+ 4 - 18
src/views/flow/create/components/BasicInfo.vue

@@ -1,6 +1,6 @@
 <script setup name="BasicInfo">
 import useFlowStore from '@/store/modules/flow'
-import { ref, nextTick, onMounted, computed, watch } from 'vue'
+import { ref, nextTick, onMounted, computed } from 'vue'
 import UseSelect from '@/components/scWorkflow/select'
 import group from '@/api/flow/group'
 import { useRoute } from 'vue-router'
@@ -42,7 +42,7 @@ const rules = {
 		}
 	]
 }
-const imgsArr = ref([
+const imgArr = ref([
 	'approval',
 	'bank-card',
 	'bell',
@@ -144,26 +144,12 @@ const getGroupList = async () => {
 
 // icon图标点击保存
 const chooseIconEv = item => {
-	value.processIcon = item
+	flowInfo.processIcon = item
 	visiblePopover.value = !visiblePopover.value
 }
 
-// 当前是否是编辑
-const queryObj = computed(() => route.query)
-
-// 流程名称变化
-// watch(
-// 	() => flowInfo.value.processName,
-// 	newVal => {
-// 		flowName.value = newVal
-// 	}
-// )
-
-// ----- 缓存相关 end ------
-
 onMounted(() => {
 	getGroupList()
-	// flowStore.$reset() // 重置缓存
 })
 
 defineExpose({
@@ -184,7 +170,7 @@ defineExpose({
 					<el-popover placement="right-end" :width="450" trigger="focus" class="base-popover" :visible="visiblePopover">
 						<div class="icon-selector__dialog__content">
 							<div class="icon-selector-list">
-								<div v-for="item in imgsArr" :key="item" class="icon-selector-item" @click="chooseIconEv(item)">
+								<div v-for="item in imgArr" :key="item" class="icon-selector-item" @click="chooseIconEv(item)">
 									<LeIcon class="icon" :icon-class="`${flowIconPrefix}${item}`" />
 								</div>
 							</div>

+ 0 - 1
src/views/flow/create/components/FlowDesign.vue

@@ -17,7 +17,6 @@ const flowStore = useFlowStore()
 const { modelContent } = storeToRefs(flowStore)
 const formRef = ref()
 let form = ref({
-	// "name": "请假审批",
 	processConfig: {
 		nodeName: '发起人',
 		type: 0,

+ 3 - 3
src/views/flow/create/index.vue

@@ -45,7 +45,7 @@ import process from '@/api/flow/process'
 
 const route = useRoute()
 const flowStore = useFlowStore()
-const { categoryId, flowProcessId, processKey, processName, remark, modelContent, processForm, processSetting } = storeToRefs(flowStore)
+const { categoryId, processId, processKey, processName, remark, modelContent, processForm, processSetting } = storeToRefs(flowStore)
 
 const dyncComponent = ref() // 实例化子组件
 const componentsArr = [
@@ -87,7 +87,7 @@ const submitHandler = async () => {
 		processKey: processKey.value,
 		processName: processName.value,
 		remark: remark.value,
-		processId: flowProcessId.value,
+		processId: processId.value,
 		processForm: processForm.value,
 		modelContent: modelContent.value,
 		processSetting: processSetting.value
@@ -118,7 +118,7 @@ const currentComponent = computed(() => {
 const queryObj = computed(() => route.query)
 const getCurrentProcessDetailEv = () => {
 	process.processDetailApi(queryObj.value.id).then(res => {
-		console.log('===res===res====res==', res)
+		processId.value = res.processId
 		categoryId.value = res.categoryId
 		processKey.value = res.processKey
 		processName.value = res.processName