|
|
@ -4,7 +4,7 @@ |
|
|
@ 备注: 表单编辑页面 |
|
|
@ 备注: 表单编辑页面 |
|
|
--> |
|
|
--> |
|
|
<script lang='ts' setup> |
|
|
<script lang='ts' setup> |
|
|
import { FormData, formStruct, DrawerStruct, VideoMsg } from "@/api/DesignForm/types"; |
|
|
import { formStruct, DrawerStruct } from "@/api/DesignForm/types"; |
|
|
import { |
|
|
import { |
|
|
json2string, |
|
|
json2string, |
|
|
objToStringify, |
|
|
objToStringify, |
|
|
@ -12,26 +12,23 @@ import { |
|
|
stringToObj, |
|
|
stringToObj, |
|
|
} from "@/utils/DesignForm/form"; |
|
|
} from "@/utils/DesignForm/form"; |
|
|
import { |
|
|
import { |
|
|
saveProductionForm, |
|
|
|
|
|
asfHandle, |
|
|
|
|
|
getOneProductionForm, |
|
|
|
|
|
haveCustomerFormVersion, |
|
|
|
|
|
editCustomerFormInfo, |
|
|
|
|
|
saveAsNewVersion, |
|
|
|
|
|
enableVersion, |
|
|
|
|
|
judgeSubmitCancel, |
|
|
|
|
|
createAppForm, |
|
|
createAppForm, |
|
|
editAppPageInfo, |
|
|
editAppPageInfo, |
|
|
saveOtherVersion, |
|
|
getOneProductionForm, |
|
|
|
|
|
haveCustomerFormVersion, |
|
|
previewAppFormVersion, |
|
|
previewAppFormVersion, |
|
|
|
|
|
saveOtherVersion, |
|
|
} from "@/api/DesignForm/requestapi"; |
|
|
} from "@/api/DesignForm/requestapi"; |
|
|
import { afterResponse, beforeRequest, onChange } from '@/api/DesignForm/utils' |
|
|
import { afterResponse, beforeRequest, onChange } from '@/api/DesignForm/utils' |
|
|
|
|
|
|
|
|
import Control from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/control.vue"; |
|
|
import Control from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/control.vue"; |
|
|
import Design from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/design.vue"; |
|
|
import Design from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/design.vue"; |
|
|
import Attribute from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue"; |
|
|
import Attribute from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue"; |
|
|
import { customerFormVersionCont } from "@/api/DesignForm/type"; |
|
|
import { customerFormVersionCont, treeStruct } from "@/api/DesignForm/type"; |
|
|
import { useRoute } from "vue-router"; |
|
|
import { useRoute } from "vue-router"; |
|
|
|
|
|
import { useDesignFormStore } from "@/store/DesignForm/designForm"; |
|
|
|
|
|
|
|
|
|
|
|
import PreviewPage from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/previewPage.vue"; |
|
|
|
|
|
|
|
|
const props = defineProps({ |
|
|
const props = defineProps({ |
|
|
appCont: { |
|
|
appCont: { |
|
|
@ -67,9 +64,28 @@ const props = defineProps({ |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
state: { |
|
|
state: { |
|
|
type: Object, |
|
|
type: Object as () => formStruct, |
|
|
default() { |
|
|
default() { |
|
|
return {}; |
|
|
return { |
|
|
|
|
|
tooltip: {}, |
|
|
|
|
|
isSearch: false, |
|
|
|
|
|
formData: { |
|
|
|
|
|
list: [], |
|
|
|
|
|
form: {}, |
|
|
|
|
|
config: {}, |
|
|
|
|
|
styles: {}, |
|
|
|
|
|
purview: [], |
|
|
|
|
|
aiConfig: [], |
|
|
|
|
|
}, |
|
|
|
|
|
editor: {}, |
|
|
|
|
|
loading: false, |
|
|
|
|
|
formDataPreview: {}, |
|
|
|
|
|
previewVisible: false, |
|
|
|
|
|
designType: '', |
|
|
|
|
|
formDict: {}, |
|
|
|
|
|
formOtherData: {}, |
|
|
|
|
|
echatsViews: [], |
|
|
|
|
|
}; |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
@ -97,6 +113,20 @@ const state = computed({ |
|
|
emits("update:state", val); |
|
|
emits("update:state", val); |
|
|
}, |
|
|
}, |
|
|
}); |
|
|
}); |
|
|
|
|
|
const appFormKeyVal = computed({ |
|
|
|
|
|
get() { |
|
|
|
|
|
return props.formKey; |
|
|
|
|
|
}, |
|
|
|
|
|
set(val: string) { |
|
|
|
|
|
emits("update:formKey", val); |
|
|
|
|
|
}, |
|
|
|
|
|
}); |
|
|
|
|
|
const controlData = computed(() => { |
|
|
|
|
|
// console.log("注册自定义事件----------------->",props.formInfo) |
|
|
|
|
|
// console.log("注册自定义事件--------1--------->",store.controlAttr) |
|
|
|
|
|
// console.log("注册自定义事件---------3-------->",controlData.value.customRules) |
|
|
|
|
|
return store.controlAttr; |
|
|
|
|
|
}); |
|
|
const formFieldAry = ref<string[]>([]); |
|
|
const formFieldAry = ref<string[]>([]); |
|
|
const sunFormFieldAry = ref<string[]>([]); |
|
|
const sunFormFieldAry = ref<string[]>([]); |
|
|
|
|
|
|
|
|
@ -108,7 +138,7 @@ const drawer = reactive<DrawerStruct>({ |
|
|
direction: undefined, //弹出方向rtl / ltr |
|
|
direction: undefined, //弹出方向rtl / ltr |
|
|
callback: "", |
|
|
callback: "", |
|
|
}); |
|
|
}); |
|
|
|
|
|
const store = useDesignFormStore() as any; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2026-02-24 13:39:25 |
|
|
@ 时间: 2026-02-24 13:39:25 |
|
|
@ -270,7 +300,178 @@ function optionsValue3Get3(data: any, fieldName: string) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
/** |
|
|
|
|
|
@ 作者: 秦东 |
|
|
|
|
|
@ 时间: 2024-05-15 14:07:39 |
|
|
|
|
|
@ 功能: 编辑App自定义表单 |
|
|
|
|
|
*/ |
|
|
|
|
|
interface AsfRelation { |
|
|
|
|
|
bgldbdId: string; |
|
|
|
|
|
asfByTablekey: string; |
|
|
|
|
|
glbdzjm: string; |
|
|
|
|
|
} |
|
|
|
|
|
function saveRefreshFormControlAttr1() { |
|
|
|
|
|
formControlAttrEl.value.saveRefreshFormControlAttr();// |
|
|
|
|
|
} |
|
|
|
|
|
const asfHandler = () => { |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
relationArr |
|
|
|
|
|
当relationArr不为空时,说明本表单关联了其他表单,可以获取到所有被关联的表单id |
|
|
|
|
|
1.按照被关联的表单id更新asf_relation表,用glbdzjm和asf_by_tablekey可以唯一确定一个关联关系,如果没有该关联关系,则新增,如果有,则update |
|
|
|
|
|
2.按照被关联的表单id更新asf_config表,若无该id对应记录,则新增 |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
asf_config.datatitle #################### |
|
|
|
|
|
因为当前保存的表单并不是以被关联表单身份提供的datatitle,而数据库表中的datatitle是被关联表单身份的 |
|
|
|
|
|
所以把这个datatitle传到后端,并查询asf_config表中是否已存在本表,若已存在,则更新相应的数据标题记录 |
|
|
|
|
|
|
|
|
|
|
|
asf_config.all_fields #################### |
|
|
|
|
|
表单的所有字段标识数组,以["a","b","c"]的形式存储 |
|
|
|
|
|
|
|
|
|
|
|
注意:即使保存的表单没有关联其他表单,也应执行上述操作 |
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
let configDataTitle_arr = state.value.formData.form.dataTitle |
|
|
|
|
|
let configDataTitle = configDataTitle_arr.join(','); |
|
|
|
|
|
// console.log("config数据标题----->"+configDataTitle_arr) |
|
|
|
|
|
|
|
|
|
|
|
let relationArr: AsfRelation[] = [] |
|
|
|
|
|
|
|
|
|
|
|
let configAllFields_arr:String[] = [] |
|
|
|
|
|
state.value.formData.list.forEach((element:any) => { |
|
|
|
|
|
if(element.type=="associatedForms"){ |
|
|
|
|
|
let obj:AsfRelation = { |
|
|
|
|
|
bgldbdId: element.control.formid, |
|
|
|
|
|
asfByTablekey: element.control.glbbddbd, |
|
|
|
|
|
glbdzjm: element.name, |
|
|
|
|
|
} |
|
|
|
|
|
relationArr.push(obj) |
|
|
|
|
|
} |
|
|
|
|
|
configAllFields_arr.push(element.name) |
|
|
|
|
|
}); |
|
|
|
|
|
let configAllFields = configAllFields_arr.join(','); |
|
|
|
|
|
// console.log("config所有控件名----->"+configAllFields_arr) |
|
|
|
|
|
let configBgldbdtableKey = state.value.formData.form.name |
|
|
|
|
|
// console.log("config被关联的表单tablekey----->"+configBgldbdtableKey) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(relationArr) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
|
|
|
当state.value.formData.list中存在state.value.formData.list[i].type=="associatedForms"时 |
|
|
|
|
|
对每个符合条件的元素进行条件拼装,成为一个对象数组 |
|
|
|
|
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
// console.log(state.value.formData) |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
const editAppFormTable = () => { |
|
|
|
|
|
|
|
|
|
|
|
asfHandler() |
|
|
|
|
|
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列表 |
|
|
|
|
|
dict: json2string(state.value.formDict), |
|
|
|
|
|
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; |
|
|
|
|
|
saveRefreshFormControlAttr1(); |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
|
|
|
/** |
|
|
|
|
|
@ 作者: 秦东 |
|
|
|
|
|
@ 时间: 2024-05-15 13:58:21 |
|
|
|
|
|
@ 功能: 写入自建应用App表单 |
|
|
|
|
|
*/ |
|
|
|
|
|
const saveAppFormData = () => { |
|
|
|
|
|
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; |
|
|
|
|
|
// console.log("写入自建应用App表单",sendData) |
|
|
|
|
|
createAppForm(sendData) |
|
|
|
|
|
.then((data: any) => { |
|
|
|
|
|
state.value.loading = false; |
|
|
|
|
|
// console.log("写入自建应用App表单--->",data) |
|
|
|
|
|
// appPageKey.value = data.data.customerFormCont.id |
|
|
|
|
|
// appPageKey.set(data.data.customerFormCont.id.toString()) |
|
|
|
|
|
versionId.value = data.data.formVersion.id.toString(); |
|
|
|
|
|
emits("update:formVersion", data.data.formVersion.id.toString()); |
|
|
|
|
|
emits("update:appPageKey", data.data.customerFormCont.id.toString()); |
|
|
|
|
|
// emits('update:formVersion', data.data.version.toString()) |
|
|
|
|
|
// console.log("写入自建应用App表单-11111-->",data.data.customerFormCont.id) |
|
|
|
|
|
// console.log("写入自建应用App表单-2222-->",props.appPageKey) |
|
|
|
|
|
// emits('update:appPageKey', data.data.customerFormCont.id.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; |
|
|
|
|
|
}); |
|
|
|
|
|
}; |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ 时间: 2026-02-25 10:51:57 |
|
|
@ 时间: 2026-02-25 10:51:57 |
|
|
@ -278,6 +479,51 @@ function optionsValue3Get3(data: any, fieldName: string) { |
|
|
*/ |
|
|
*/ |
|
|
const buttonCallbackEvent = (type: string) => { |
|
|
const buttonCallbackEvent = (type: string) => { |
|
|
console.log("执行哪个按钮的操作",type); |
|
|
console.log("执行哪个按钮的操作",type); |
|
|
|
|
|
switch (type) { |
|
|
|
|
|
case "del": //清空 |
|
|
|
|
|
state.value.formData.list = []; |
|
|
|
|
|
store.setActiveKey(""); |
|
|
|
|
|
store.setControlAttr({}); |
|
|
|
|
|
break; |
|
|
|
|
|
case "eye": //预览 |
|
|
|
|
|
store.setActiveKey(""); |
|
|
|
|
|
store.setControlAttr({}); |
|
|
|
|
|
let stringPreview = objToStringify(state.value.formData); // 防止预览窗口数据修改影响 |
|
|
|
|
|
const formName = state.value.formData.form.name; |
|
|
|
|
|
const reg = new RegExp(`get${formName}ControlByName`, "g"); |
|
|
|
|
|
stringPreview = stringPreview.replace(reg, `getPreview${formName}ControlByName`); |
|
|
|
|
|
state.value.formDataPreview = stringToObj(stringPreview); |
|
|
|
|
|
state.value.formDataPreview.form.name = `Preview${formName}`; // 修改下表单名 |
|
|
|
|
|
// console.log("预览数据",state.value.formDataPreview); |
|
|
|
|
|
state.value.previewVisible = true; |
|
|
|
|
|
break; |
|
|
|
|
|
case "json": //生成脚本预览 |
|
|
|
|
|
openAceEditDrawer({ |
|
|
|
|
|
direction: "rtl", |
|
|
|
|
|
content: state.value.formData, |
|
|
|
|
|
title: "可编辑修改或将已生成的脚本粘贴进来", |
|
|
|
|
|
}); |
|
|
|
|
|
break; |
|
|
|
|
|
case "save": //保存 |
|
|
|
|
|
if (props.appPageKey && props.appPageKey != "") { |
|
|
|
|
|
//存在,进行编辑操作 |
|
|
|
|
|
editAppFormTable(); |
|
|
|
|
|
} else { |
|
|
|
|
|
//不存在,进行新增操作 |
|
|
|
|
|
saveAppFormData(); |
|
|
|
|
|
} |
|
|
|
|
|
break; |
|
|
|
|
|
case "branch": //另存为新版 |
|
|
|
|
|
saveOtherVersionIng(); |
|
|
|
|
|
case "monitor": |
|
|
|
|
|
isWeb.value = false; |
|
|
|
|
|
// console.log("monitor",isWeb); // |
|
|
|
|
|
break; |
|
|
|
|
|
case "iphone": |
|
|
|
|
|
isWeb.value = true; |
|
|
|
|
|
// console.log("iphone",isWeb); // |
|
|
|
|
|
break; |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
/** |
|
|
/** |
|
|
@ 作者: 秦东 |
|
|
@ 作者: 秦东 |
|
|
@ -401,7 +647,110 @@ const formNameChanged = (param1: any) => { |
|
|
// type: 'warning', |
|
|
// type: 'warning', |
|
|
// }) |
|
|
// }) |
|
|
}; |
|
|
}; |
|
|
|
|
|
/** |
|
|
|
|
|
@ 作者: 秦东 |
|
|
|
|
|
@ 时间: 2024-05-15 13:14:40 |
|
|
|
|
|
@ 功能: 关闭预览 |
|
|
|
|
|
*/ |
|
|
|
|
|
const closePreviewPage = () => { |
|
|
|
|
|
// console.log("关闭预览") |
|
|
|
|
|
state.value.previewVisible = false; |
|
|
|
|
|
}; |
|
|
|
|
|
/** |
|
|
|
|
|
@ 作者: 秦东 |
|
|
|
|
|
@ 时间: 2024-05-15 13:28:57 |
|
|
|
|
|
@ 功能: 关闭脚本预览窗,并初始化脚本预览参数 |
|
|
|
|
|
*/ |
|
|
|
|
|
const dialogCancel = () => { |
|
|
|
|
|
drawer.visible = false; |
|
|
|
|
|
drawer.type = ""; |
|
|
|
|
|
drawer.title = ""; |
|
|
|
|
|
drawer.codeType = ""; |
|
|
|
|
|
drawer.callback = ""; |
|
|
|
|
|
drawer.content = ""; |
|
|
|
|
|
}; |
|
|
|
|
|
// 弹窗确认3174.15 2924.57 3326.15 3119.33 |
|
|
|
|
|
const dialogConfirm = (editVal: string) => { |
|
|
|
|
|
// 生成脚本预览和导入json,都是将编辑器内容更新至state.formData |
|
|
|
|
|
// console.log("生成脚本预览和导入", editVal); |
|
|
|
|
|
// console.log( |
|
|
|
|
|
// "生成脚本预览和导入----->", |
|
|
|
|
|
// drawer.type, |
|
|
|
|
|
// "==========", |
|
|
|
|
|
// drawer.callback, |
|
|
|
|
|
// "==========", |
|
|
|
|
|
// drawer |
|
|
|
|
|
// ); |
|
|
|
|
|
// console.log("生成脚本预览和导入===========>", state.value.formData); |
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
if (typeof drawer.callback === "function") { |
|
|
|
|
|
// console.log("1======2========>", drawer.codeType, stringToObj(editVal)); |
|
|
|
|
|
// callback |
|
|
|
|
|
const newObj = |
|
|
|
|
|
drawer.codeType === "json" ? string2json(editVal) : stringToObj(editVal); |
|
|
|
|
|
drawer.callback(newObj); |
|
|
|
|
|
// console.log("1==============>"); |
|
|
|
|
|
} else { |
|
|
|
|
|
switch (drawer.type) { |
|
|
|
|
|
case "css": |
|
|
|
|
|
// 表单属性-编辑表单样式 |
|
|
|
|
|
if (!state.value.formData.config) { |
|
|
|
|
|
state.value.formData.config = {}; |
|
|
|
|
|
} |
|
|
|
|
|
state.value.formData.config.style = editVal; |
|
|
|
|
|
// console.log("2==============>"); |
|
|
|
|
|
break; |
|
|
|
|
|
case "dict": |
|
|
|
|
|
state.value.formDict = string2json(editVal); |
|
|
|
|
|
break; |
|
|
|
|
|
case "beforeRequest": |
|
|
|
|
|
case "beforeSubmit": |
|
|
|
|
|
case "afterResponse": |
|
|
|
|
|
case "afterSubmit": |
|
|
|
|
|
case "closeSubmit": |
|
|
|
|
|
case "change": |
|
|
|
|
|
if (!state.value.formData.events) { |
|
|
|
|
|
state.value.formData.events = {}; |
|
|
|
|
|
} |
|
|
|
|
|
state.value.formData.events[drawer.type] = stringToObj(editVal); |
|
|
|
|
|
// console.log("3==============>"); |
|
|
|
|
|
break; |
|
|
|
|
|
default: |
|
|
|
|
|
state.value.formData = stringToObj(editVal); |
|
|
|
|
|
// console.log("4==============>"); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
dialogCancel(); |
|
|
|
|
|
} catch (res:any) { |
|
|
|
|
|
// console.log(res.message) |
|
|
|
|
|
ElMessage.error(res.message); |
|
|
|
|
|
} |
|
|
|
|
|
}; |
|
|
|
|
|
/** |
|
|
|
|
|
@ 作者: 秦东 |
|
|
|
|
|
@ 时间: 2024-09-27 16:53:30 |
|
|
|
|
|
@ 功能: 级联选择与树 |
|
|
|
|
|
*/ |
|
|
|
|
|
const dialogConfirmTree = (content: string) => { |
|
|
|
|
|
// console.log("级联选择与树", content); |
|
|
|
|
|
try { |
|
|
|
|
|
const newObj = drawer.codeType === 'json' ? string2json(content) : stringToObj(content); |
|
|
|
|
|
// console.log("级联选择与树--->", controlData); |
|
|
|
|
|
|
|
|
|
|
|
if (typeof drawer.callback === "function") { |
|
|
|
|
|
drawer.callback(newObj); |
|
|
|
|
|
} else { |
|
|
|
|
|
// 暂时保留原逻辑结构 |
|
|
|
|
|
// 根据实际情况处理newObj |
|
|
|
|
|
controlData.value.control = {}; |
|
|
|
|
|
Object.assign(controlData.value.control, newObj); |
|
|
|
|
|
} |
|
|
|
|
|
} catch (error) { |
|
|
|
|
|
console.error("处理树选择数据失败:", error); |
|
|
|
|
|
} |
|
|
|
|
|
drawer.visible = false; |
|
|
|
|
|
}; |
|
|
defineExpose({ |
|
|
defineExpose({ |
|
|
gainTableForm, |
|
|
gainTableForm, |
|
|
}); |
|
|
}); |
|
|
@ -413,6 +762,18 @@ onMounted(() => { |
|
|
}); |
|
|
}); |
|
|
</script> |
|
|
</script> |
|
|
<template> |
|
|
<template> |
|
|
|
|
|
<ace-drawer |
|
|
|
|
|
v-model="drawer.visible" |
|
|
|
|
|
:title="drawer.title" |
|
|
|
|
|
:direction="drawer.direction" |
|
|
|
|
|
:content="drawer.content" |
|
|
|
|
|
:code-type="drawer.codeType" |
|
|
|
|
|
:data="drawer" |
|
|
|
|
|
@before-close="dialogCancel" |
|
|
|
|
|
@confirm="dialogConfirm" |
|
|
|
|
|
@confirm-tree="dialogConfirmTree" |
|
|
|
|
|
/> |
|
|
|
|
|
<PreviewPage v-model:state="state" :is-web="isWeb" @click-close="closePreviewPage" /> |
|
|
<div class="form-content"> |
|
|
<div class="form-content"> |
|
|
<Control |
|
|
<Control |
|
|
:table-key="state.formData.form.name" |
|
|
:table-key="state.formData.form.name" |
|
|
@ -453,6 +814,7 @@ onMounted(() => { |
|
|
grid-template-rows: auto; |
|
|
grid-template-rows: auto; |
|
|
gap: 10px; |
|
|
gap: 10px; |
|
|
padding: 10px 10px 0 10px; |
|
|
padding: 10px 10px 0 10px; |
|
|
|
|
|
height: calc(100vh - 50px); |
|
|
:deep .el-tabs--border-card{ |
|
|
:deep .el-tabs--border-card{ |
|
|
border: 0; |
|
|
border: 0; |
|
|
} |
|
|
} |
|
|
@ -466,7 +828,7 @@ onMounted(() => { |
|
|
} |
|
|
} |
|
|
:deep .el-tabs__header{ |
|
|
:deep .el-tabs__header{ |
|
|
justify-content: space-between; |
|
|
justify-content: space-between; |
|
|
width: 100%; |
|
|
// width: 100%; |
|
|
} |
|
|
} |
|
|
:deep .is-active{ |
|
|
:deep .is-active{ |
|
|
border-bottom: 1px solid var(--el-color-primary); |
|
|
border-bottom: 1px solid var(--el-color-primary); |
|
|
|