Browse Source

模版样式修改完毕

qin_s4
herenshan112 3 weeks ago
parent
commit
cf0fa9ce02
  1. 7
      src/api/DesignForm/types.ts
  2. 125
      src/api/javaRequest.ts
  3. 4
      src/components/DesignForm/formControlPropertiNew.vue
  4. 2
      src/components/DesignForm/public/expand/rangedUserTree.vue
  5. 53
      src/components/DesignForm/validateText.ts
  6. 2
      src/views/dashboard/components/allorgyear.vue
  7. 392
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFormNew.vue
  8. 7329
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue
  9. 3455
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/design.vue
  10. 215
      vite.config.ts.timestamp-1772586397203-879cadf7fb034.mjs

7
src/api/DesignForm/types.ts

@ -52,6 +52,11 @@ export interface FormData {
beforeSubmit?: Function
afterSubmit?: Function
change?: Function
saveEditFormInfo?: Function
saveDraftPage?: Function
sendDraftSubmit?: Function
submitEdit?: Function
anewSubmit?: Function
}
styles:{
divStyle:{},
@ -153,6 +158,8 @@ export interface formOtherData{
}
//表单结构体
export interface formStruct{
tooltip: any
isSearch: any
formData:formData;
editor: any;
loading: boolean;

125
src/api/javaRequest.ts

@ -0,0 +1,125 @@
import request from "@/utils/request";
const getAssociatedFormsCurrentFieldTree = (data:any) => {
return request({
url: "/javasys/lowCode/AssociatedForms/getFieldTree",
method: "post",
data: {
//cfid:'13'
cfid: data,
},
});
}
const getAssociatedFormsOrgAndManTree = () => {
return request({
url: "/javasys/lowCode/transfer/getOrgAndManTree",
method: "post",
});
}
const getCustomerFormList = () => {
return request({
url: "/javasys/lowCode/AssociatedForms/getCustomerFormList",
method: "post",
});
}
const getAssociatedFormsRoleTree = () => {
return request({
url: "/javasys/lowCode/AssociatedForms/getRoleList",
method: "post",
});
}
const getAsfasfFieldTree = (data:any) => {
return request({
url: "/javasys/lowCode/AssociatedForms/getFieldTree",
method: "post",
data: {
//cfid:'13'
cfid: data,
},
});
}
const getAsfasfFieldTreeOptionsValue3 = (data:any) => {
return request({
url: "/javasys/lowCode/AssociatedForms/getFieldTree",
method: "post",
data: {
//cfid:'13'
cfid: data,
},
});
}
const getQrCodeImgInside = (data:any) => {
return request({
url: "/javasys/lowCode/QrCode/getQrCodeImgInside",
method: "post",
data: {
cfid: data,
},
});
}
const getAllRole = () => {
return request({
url: "/javasys/lowCode/manCont/getAllRole",
method: "get",
});
}
const getPersonByRoleId = (id:any,pageNum:any,pageSize:any,number:any,names:any) => {
return request({
url: "/javasys/lowCode/manCont/getPersonByRoleId",
method: "post",
data: {
id: id,
pageNum: pageNum,
pageSize: pageSize,
number:number,
name:names
},
});
}
const queryIfOrgOrPerson = (obj: { left: string; operator: string; right: string }) => {
return request({
url: "/javasys/lowCode/AssociatedForms/queryIfOrgOrPerson",
method: "post",
data: obj,
});
}
const queryHideRoleCondition = (obj: { left: string; operator: string; right: string }) => {
return request({
url: "/javasys/lowCode/AssociatedForms/queryHideRoleCondition",
method: "post",
data: obj,
});
}
const getMainOrgByWorkNumber = (obj: { workNumber: string}) => {
return request({
url: "/javasys/lowCode/manCont/getMainOrgByWorkNumber",
method: "post",
data: obj,
});
}
const treeUrl = '/javasys/lowCode/transfer/getOrgAndManTree'
const getOrgAndManTree = () => {
return request({
url: treeUrl,
method: 'post',
});
}
export {
getAssociatedFormsCurrentFieldTree,
getAssociatedFormsOrgAndManTree,
getCustomerFormList,
getAssociatedFormsRoleTree,
getAsfasfFieldTree,
getAsfasfFieldTreeOptionsValue3,
getQrCodeImgInside,
getAllRole,
getPersonByRoleId,
queryIfOrgOrPerson,
queryHideRoleCondition,
getMainOrgByWorkNumber,
getOrgAndManTree
}

4
src/components/DesignForm/formControlPropertiNew.vue

@ -8,7 +8,7 @@ import { reactive, computed, toRefs, ref, watch, inject, onBeforeMount, onMounte
import { getRequest } from "@/api/DesignForm";
import { useDesignFormStore } from "@/store/DesignForm/designForm";
import validate from "./validate";
import validateText from "./validateText";
import { validateTextConfig } from "./validateText";
import validateInt from "./validateInt";
import { ValidateTextTypes } from "@/components/DesignForm/validateText";
import { ElMessage } from "element-plus";
@ -180,7 +180,7 @@ const ValidateText = reactive<ValidateTextTypes>({
*/
const radioVerify = reactive<ValidateTextTypes>({});
const textUinrVerfy = reactive([...validateText]);
const textUinrVerfy = reactive([...validateTextConfig]);
const numberUinrVerfy = reactive([...validateInt]);
const formAttr = computed(() => {

2
src/components/DesignForm/public/expand/rangedUserTree.vue

@ -25,7 +25,7 @@ const treeData = ref([]) // 存储懒加载的数据
const isDataLoaded = ref(false) //
const loading = ref(false) //
const treeSelectRef = ref() //
const { location, updateLocation } = inject('location')
// const { location, updateLocation } = inject('location')
//
const lastSelectedValue = ref(null)

53
src/components/DesignForm/validateText.ts

@ -57,4 +57,55 @@ const validateTextConfig: ValidateTextTypes[] = [
}
]
export default validateTextConfig
const transferDataSourceOptions = [
{
value: "数据源",
label: "数据源",
},
{
value: "固定选项",
label: "固定选项",
},
];
const locationLevelOptions = [
{
value: "省级",
label: "省级",
},
{
value: "市级",
label: "市级",
},
{
value: "区县级",
label: "区县级",
},
{
value: "详细地址",
label: "详细地址",
},
]
const scanTypes = [
{
value: "QrCode",
label: "二维码",
},
{
value: "OCR",
label: "光学字符识别",
},
];
const optionsCss = [
{ label: "无样式", value: "" },
{ label: "每行两列", value: "form-row-2" },
{ label: "每行三列", value: "form-row-3" },
{ label: "每行四列", value: "form-row-4" },
];
export {
transferDataSourceOptions,
locationLevelOptions,
validateTextConfig,
scanTypes,
optionsCss
}

2
src/views/dashboard/components/allorgyear.vue

@ -38,7 +38,7 @@ const orgChartDrowData = () => {
yearsInfo.value = timeYears;
let sendInfo = {
orgid: curreorgId.value.toString(),
years: timeYears
years: timeYears.toString()
};
orgTargetAnnualStatistics(sendInfo).then((data: any) => {
// console.log(" props.dlyear.data", data)

392
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFormNew.vue

@ -4,7 +4,7 @@
@ 备注: 表单编辑页面
-->
<script lang='ts' setup>
import { FormData, formStruct, DrawerStruct, VideoMsg } from "@/api/DesignForm/types";
import { formStruct, DrawerStruct } from "@/api/DesignForm/types";
import {
json2string,
objToStringify,
@ -12,26 +12,23 @@ import {
stringToObj,
} from "@/utils/DesignForm/form";
import {
saveProductionForm,
asfHandle,
getOneProductionForm,
haveCustomerFormVersion,
editCustomerFormInfo,
saveAsNewVersion,
enableVersion,
judgeSubmitCancel,
createAppForm,
editAppPageInfo,
saveOtherVersion,
getOneProductionForm,
haveCustomerFormVersion,
previewAppFormVersion,
saveOtherVersion,
} from "@/api/DesignForm/requestapi";
import { afterResponse, beforeRequest, onChange } from '@/api/DesignForm/utils'
import Control from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/control.vue";
import Design from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/design.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 { useDesignFormStore } from "@/store/DesignForm/designForm";
import PreviewPage from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/previewPage.vue";
const props = defineProps({
appCont: {
@ -67,9 +64,28 @@ const props = defineProps({
},
},
state: {
type: Object,
type: Object as () => formStruct,
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);
},
});
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 sunFormFieldAry = ref<string[]>([]);
@ -108,7 +138,7 @@ const drawer = reactive<DrawerStruct>({
direction: undefined, //rtl / ltr
callback: "",
});
const store = useDesignFormStore() as any;
/**
@ 作者: 秦东
@ 时间: 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("configtablekey----->"+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 4app
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 4app
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
@ -278,6 +479,51 @@ function optionsValue3Get3(data: any, fieldName: string) {
*/
const buttonCallbackEvent = (type: string) => {
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',
// })
};
/**
@ 作者: 秦东
@ 时间: 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) => {
// jsonstate.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({
gainTableForm,
});
@ -413,6 +762,18 @@ onMounted(() => {
});
</script>
<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">
<Control
:table-key="state.formData.form.name"
@ -453,6 +814,7 @@ onMounted(() => {
grid-template-rows: auto;
gap: 10px;
padding: 10px 10px 0 10px;
height: calc(100vh - 50px);
:deep .el-tabs--border-card{
border: 0;
}
@ -466,7 +828,7 @@ onMounted(() => {
}
:deep .el-tabs__header{
justify-content: space-between;
width: 100%;
// width: 100%;
}
:deep .is-active{
border-bottom: 1px solid var(--el-color-primary);

7329
src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue

File diff suppressed because it is too large

3455
src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/design.vue

File diff suppressed because it is too large

215
vite.config.ts.timestamp-1772586397203-879cadf7fb034.mjs

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save