diff --git a/src/api/DesignForm/requestapi.ts b/src/api/DesignForm/requestapi.ts index 75983c970..2316bcd84 100644 --- a/src/api/DesignForm/requestapi.ts +++ b/src/api/DesignForm/requestapi.ts @@ -424,3 +424,35 @@ export function createAppForm(data: any) { data: data }); } +//获取app页面综合信息 +export function gainAppPageInfo(data: any) { + return request({ + url: '/systemapi/app/gainAppPageInfo', + method: 'post', + data: data + }); +} +//编辑App表单数据 +export function editAppPageInfo(data: any) { + return request({ + url: '/systemapi/app/editAppPageInfo', + method: 'post', + data: data + }); +} +//保存新版本 +export function saveOtherVersion(data: any) { + return request({ + url: '/systemapi/app/saveOtherVersion', + method: 'post', + data: data + }); +} +//预览App多版本表单页面 +export function previewAppFormVersion(data: any) { + return request({ + url: '/systemapi/app/previewAppFormVersion', + method: 'post', + data: data + }); +} diff --git a/src/api/date/type.ts b/src/api/date/type.ts index 12c679d6b..3fa1ded1b 100644 --- a/src/api/date/type.ts +++ b/src/api/date/type.ts @@ -193,3 +193,97 @@ export let threeShiyanData = [ ] } ]; + +//初始化App表单数据查看 +export interface appPageDataInit { + appFlow:boolean; + appForm?:appFormInfo; + page:boolean; + pageList:boolean; + workFlow?:appWorkFlow; +} +//App表单结构 +export interface appFormInfo{ + authorizationRoles: string; + authorizedOrg: string; + authorizedPersonnel: string; + authorizedPosition: string; + cfid: number; + classify: number; + creater: number; + dict: string; + editTime: number; + flowIsOpen: number; + flowkey: number; + groupid: number; + icon: string; + id: number; + listPage: string; + listjson: string; + mastesform: string; + mastesformjson: string; + name: string; + permit: string; + permitstr: string; + postpermit: string; + powerstr: string; + signCode: number; + status: number; + table_structure: string; + tablekey: string; + time: number; + userpermit: string; + version: number; + visibility: number; +} +//app工作流结构 +export interface appWorkFlow{ + directorMaxLevel: number; + flowPermission: appFlowPermission[]; + nodeConfig: appNodeConfig; + tableId: string; +} +//节点操作人结构 +export interface appFlowPermission{ + icon: string; + iconToBase64: string; + name: string; + targetId: string; + type: number; +} +//app流程节点结构 +export interface appNodeConfig{ + attribute: number; + ccSelfSelectFlag: number; + childNode: appNodeConfig; + conditionList: string; + conditionNodes: string; + customNode: string; + directorLevel: number; + error: false + examineEndDirectorLevel: number; + examineMode: number; + executionaddress: string; + fromNode: string; + gotoNode: string[]; + matrix: appMatrix; + noHanderAction: number; + nodeName: string; + nodeNumber: string; + nodeUserList: string; + priorityLevel: number; + selectMode: number; + selectRange: number; + sendBackNode: string; + settype: number; + type: number; +} +//app工作流附件 +export interface appMatrix{ + factorName: string; + factorid: number; + matrixName: string; + matrixid: number; + outcomeName: string; + outcomeid: number; +} diff --git a/src/components/DesignForm/dragControlApp.vue b/src/components/DesignForm/dragControlApp.vue index c68f84d61..5414cd498 100644 --- a/src/components/DesignForm/dragControlApp.vue +++ b/src/components/DesignForm/dragControlApp.vue @@ -21,6 +21,9 @@ const props = withDefaults( {} ) const designType = inject('formDesignType') as string //注入一个由祖先组件或整个应用 (通过 app.provide()) 提供的值。 +const isSearch = computed(() => { + return designType === 'search' +}) // 默认搜索允许显示的字段 const searchField = [ 'input', @@ -62,6 +65,7 @@ const tableVersion = ref() //版本显示器 const emits = defineEmits<{ (e: 'versionUpdateForm', value: string): void + (e: 'versionPreviewPage', value: string): void }>() /** @ 作者: 秦东 @@ -74,6 +78,14 @@ const enableOrDisable = (val?:any) =>{ } /** @ 作者: 秦东 +@ 时间: 2024-05-21 09:05:20 +@ 功能: 预览版本 +*/ +const previewPage = (val?:any) =>{ + emits('versionPreviewPage', val) +} +/** +@ 作者: 秦东 @ 时间: 2024-05-09 11:40:15 @ 功能: 打开版本选择页面 */ @@ -106,10 +118,11 @@ const clone = (origin: any) => { diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue new file mode 100644 index 000000000..8ef247a31 --- /dev/null +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue @@ -0,0 +1,360 @@ + + + + diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue index fcd177aaf..cf66bc961 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue @@ -4,14 +4,655 @@ @ 备注: 表单流程 --> diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue index af09f0e04..7aa2fc2ab 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue @@ -9,7 +9,7 @@ import { useRoute, useRouter } from 'vue-router' import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form' import { customerFormVersionCont } from '@/api/DesignForm/type' import { FormData,formStruct,DrawerStruct, VideoMsg } from '@/api/DesignForm/types' -import { saveProductionForm,getOneProductionForm,haveCustomerFormVersion,editCustomerFormInfo,saveAsNewVersion,enableVersion,judgeSubmitCancel,createAppForm } from '@/api/DesignForm/requestapi' +import { saveProductionForm,getOneProductionForm,haveCustomerFormVersion,editCustomerFormInfo,saveAsNewVersion,enableVersion,judgeSubmitCancel,createAppForm,editAppPageInfo,saveOtherVersion,previewAppFormVersion } from '@/api/DesignForm/requestapi' //引入页面 @@ -62,6 +62,7 @@ const props = defineProps({ const emits = defineEmits<{ (e: 'update:state', val: formStruct): void (e: 'update:formKey', val: string): void + (e: 'update:appPageKey', val: string): void (e: 'update:formVersion', val: string): void (e: 'judgeFormIsEdit', val: boolean): void (e: 'runNextWindows', val: number): void @@ -86,6 +87,19 @@ const appFormKeyVal = computed({ emits('update:formKey', val) } }); + + +const appPageKeyStr = computed({ + get() { + return props.appPageKey + }, + set(val: string) { + emits('update:appPageKey', val) + } +}); + + +const isEdit = ref(false) const route: any = useRoute().query || {} const versionCont = ref([]) //版本内容列表 const tableKey = ref("") @@ -99,6 +113,7 @@ const drawer = reactive({ direction: undefined, //弹出方向rtl / ltr callback: '' }) +const formFieldAry = ref([]) // 搜索设计时左侧快速添加字段 const searchCheckField = (data: FormData) => { state.value.formData.list.push(data) @@ -221,12 +236,13 @@ const buttonCallbackEvent = (type: string) => { break case 'save': //保存 if(props.appPageKey && props.appPageKey != ""){ //存在,进行编辑操作 - + editAppFormTable() }else{ //不存在,进行新增操作 saveAppFormData(); } break case 'branch': //另存为新版 + saveOtherVersionIng(); break } } @@ -238,12 +254,14 @@ const buttonCallbackEvent = (type: string) => { */ const gainTableForm = () => { if(props.appPageKey){ + isEdit.value = true; state.value.loading = true getOneProductionForm({id: props.appPageKey.toString()}) .then((res:any) => { if(res.code == 0){ const result = res.data console.log("初始设计搜索时--1--->",result) + formFieldAry.value = result.formField // 初始设计搜索时res.data='' if (result.mastesform) { state.value.formData = stringToObj(result.mastesform) @@ -274,7 +292,7 @@ const gainTableForm = () => { }else{ emits('judgeFormIsEdit', false,true) } - + emits('update:formVersion', result.id.toString()) }else{ ElMessage.error(res.msg || '加载异常') } @@ -314,10 +332,10 @@ onMounted(() => { @ 功能: 根据启用版本进行加载页面 */ const versionUpdateForm = (val:string) => { - console.log("加载异常-------111------->",val) + // console.log("加载异常-------111------->",val) versionId.value = val - - getInitData() + gainTableForm() + // getInitData() } /** @ 作者: 秦东 @@ -346,10 +364,19 @@ const saveAppFormData = () => { menuId:props.menuId, appSignCode:props.formconfigcont.signCode } + state.value.loading = true console.log("写入自建应用App表单",sendData) createAppForm(sendData) .then((data:any) => { + state.value.loading = false console.log("写入自建应用App表单--->",data) + appPageKeyStr.value = data.data.customerFormCont.id.toString() + emits('update:formVersion', data.data.formVersion.id.toString()) + // emits('update:appPageKey', data.data.customerFormCont.id.toString()) + gainTableForm() + }) + .finally(() => { + state.value.loading=false; }) } /** @@ -363,14 +390,112 @@ const editAppFormTable = () => { data: objToStringify(state.value.formData), source: state.value.formOtherData.source, // 数据源允许在表单属性设置里修改的 name: state.value.formOtherData.formName, // 表单名称,用于在显示所有已创建的表单列表里显示 - type: 1, // 1表单 2列表 + type: 4, // 1表单 2列表 dict: json2string(state.value.formDict), - appKey:appFormKeyVal, + appKey:appFormKeyVal.value, groupKey:props.groupKey, id:props.appPageKey.toString(), version:versionId.value.toString(), + menuId:props.menuId, } + state.value.loading = true console.log("编辑App自定义表单",sendData) + editAppPageInfo(sendData) + .then((data:any) => { + state.value.loading = false + console.log("编辑App自定义表单--->",data) + emits('update:formVersion', versionId.value.toString()) + gainTableForm() + }) + .finally(() => { + state.value.loading=false; + }) +} +/** +@ 作者: 秦东 +@ 时间: 2024-05-20 16:24:23 +@ 功能: 保存为其他版本 +*/ +const saveOtherVersionIng = () =>{ + let sendData: any = { + jsondata:JSON.stringify(state.value.formData), + data: objToStringify(state.value.formData), + source: state.value.formOtherData.source, // 数据源允许在表单属性设置里修改的 + name: state.value.formOtherData.formName, // 表单名称,用于在显示所有已创建的表单列表里显示 + type: 4, // 1表单 2列表 3:app 4:app表单 + dict: json2string(state.value.formDict), + appKey:appFormKeyVal.value, + groupKey:props.groupKey, + menuId:props.menuId, + appSignCode:props.formconfigcont.signCode + } + state.value.loading = true + saveOtherVersion(sendData) + .then((data:any) => { + state.value.loading = false + console.log("保存为其他版本--->",data) + emits('update:formVersion', data.data.version.toString()) + gainTableForm() + }) + .finally(() => { + state.value.loading=false; + }) +} +defineExpose({ + gainTableForm +}) +/** +@ 作者: 秦东 +@ 时间: 2024-05-21 09:01:30 +@ 功能: 预览版本 +*/ +const versionPreviewPage = (val:string) => { + if(val){ + versionId.value = val + previewAppFormVersion({id:val}) + .then((res:any) => { + if(res.code == 0){ + const result = res.data + // console.log("初始设计搜索时--1--->",result) + formFieldAry.value = result.formField + // 初始设计搜索时res.data='' + if (result.mastesform) { + state.value.formData = stringToObj(result.mastesform) + } + // console.log("初始设计搜索时",state.value.formData) + if(result.mastesformjson){ + let kjdkjksd = string2json(result.mastesformjson) + // console.log("初始设计搜索时-begin-->",state.value.formData.purview) + state.value.formData.purview=kjdkjksd.purview + // console.log("初始设计搜索时--->",kjdkjksd) + } + state.value.formData.config.groupKey = result.groupKey + // console.log("初始设计搜索时--end->",state.value.formData) + state.value.formDict = string2json(result.dict) + // 恢复表单名称 + state.value.formOtherData.source = result.source + state.value.formOtherData.formName = result.name + + state.value.formOtherData.formName = result.name + state.value.formData.form.name = result.tablekey + state.value.formData.form.formName = result.name + if (result.source && state.value.designType !== 'search') { + // 加载属性侧边栏的字段标识,搜索时不需要请求 + formControlAttrEl.value.getFormFieldBySource(result.source) + } + if(result.flowIsOpen != 1){ + emits('judgeFormIsEdit', false,false) + }else{ + emits('judgeFormIsEdit', false,true) + } + + }else{ + ElMessage.error(res.msg || '加载异常') + } + state.value.loading = false + }) + } + }