Browse Source

修改编辑页面样式

qin_s4
herenshan112 4 weeks ago
parent
commit
87309cf94e
  1. 2
      src/api/DesignForm/types.ts
  2. 14
      src/components/DesignForm/app/index.vue
  3. 5
      src/components/DesignForm/app/index_20260129.vue
  4. 1
      src/components/DesignForm/dragControlApp.vue
  5. 2
      src/components/DesignForm/formControlPropertiNew.vue
  6. 14
      src/components/DesignForm/formVersion.vue
  7. 1
      src/views/login/index.vue
  8. 3
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue
  9. 494
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFormNew.vue
  10. 1350
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/attribute.vue
  11. 257
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/control.vue
  12. 241
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/design.vue
  13. 8
      src/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue

2
src/api/DesignForm/types.ts

@ -196,6 +196,8 @@ export interface PublicAtrr{
isNum?:boolean;
inputStyle?:string;
vIf?:any;
selectvalue?:any;
control?:any;
}
//低代码视频单个属性对象
export interface VideoMsg {

14
src/components/DesignForm/app/index.vue

@ -1136,10 +1136,10 @@ watch(
const timeAxisRef = ref(null);
const groupPageRef = ref(null);
const calendarPageRef = ref(null);
const cardPageRef = ref(null);
const timeAxisRef = ref();
const groupPageRef = ref();
const calendarPageRef = ref();
const cardPageRef = ref();
const searchSend = reactive({
formId: props.formId,
page: state.currentPage,
@ -2474,9 +2474,9 @@ const getNonValue = () => {
sortable="custom"
align="center"
>
<template #default="scope">
<template v-for="sunItem in item.children" v-if="item.pattern == 'table'">
<el-table-column v-if="sunItem.fieldClass == ''" :prop="sunItem.field" :label="sunItem.label" header-align="center" align="center" :min-width="readerColumnSun(sunItem)">
<template v-if="item.pattern == 'table'" #default>
<template v-for="sunItem in item.children" :key="sunItem.field">
<el-table-column v-if="sunItem.fieldClass == ''" v-bind="sunItem" :prop="sunItem.field" :label="sunItem.label" header-align="center" align="center" :min-width="readerColumnSun(sunItem)">
<template #default="scopeChilder">
<div v-html="tableChildren(sunItem.field,scopeChilder.row[item.field])"></div>
</template>

5
src/components/DesignForm/app/index_20260129.vue

@ -51,7 +51,7 @@ const props = withDefaults(
formBasicConfig?: any;
fieldsDetailList?: any;
orgAndManTree?: any;
echatsViews: echatsViewStruct;
echatsViews: echatsViewStruct[];
}>(),
{
showPage: true,
@ -173,6 +173,9 @@ const props = withDefaults(
pickAppMenu: () => {
return {};
},
echatsViews: () => {
return [];
},
beforeRequest: (params: any, rout: any):any => {
return
},

1
src/components/DesignForm/dragControlApp.vue

@ -117,6 +117,7 @@ const clone = (origin: any) => {
</script>
<template>
<div class="components-list">
{{props}}
<div v-for="(list, index) in controlList" :key="index" v-memo="[index]">
<div class="title">
{{ list.title }}

2
src/components/DesignForm/formControlPropertiNew.vue

@ -6453,7 +6453,7 @@ const formatTooltip = (val: number) => {
<!-- <div class=""><h3>通用属性</h3></div> -->
<el-divider content-position="left">通用属性</el-divider>
<template v-for="(item, index) in attrList" :key="index">
<template v-for="(item, index) in attrList" :key="icndex">
<!-- <template v-if="item.label == '添加时间水印'">
<el-form-item :label="item.label" v-if="controlData.control.onSiteShot=='1'" class="form_cont">

14
src/components/DesignForm/formVersion.vue

@ -137,16 +137,24 @@ const setColor = (val:number) => {
</template>
<style lang='scss' scoped>
.use-template{
width:250px;
width:310px;
top: 40px;
.list{
padding: 30px 5px;
:deep .el-timeline-item__node--normal{
left: 5px;
top: 10px;
}
:deep .el-card__body{
padding:15px;
// color: #FFF;
}
}
}
.timeLineBox{
height: calc(100vh - 80px);
::v-deep .el-card__body{
padding:5px;
:deep .el-card__body{
padding:15px;
// color: #FFF;
}
}

1
src/views/login/index.vue

@ -38,6 +38,7 @@
:type="passwordVisible === false ? 'password' : 'input'"
size="large"
name="password"
show-password
@keyup="checkCapslock"
@keyup.enter="handleLogin"
/>

3
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue

@ -29,6 +29,7 @@ import {
previewAppFormVersion,
} from "@/api/DesignForm/requestapi";
import { treeStruct } from "@/api/DesignForm/type";
import { afterResponse, beforeRequest, onChange } from '@/api/DesignForm/utils'
//
import DragControlApp from "@/components/DesignForm/dragControlApp.vue";
@ -97,7 +98,7 @@ const state = computed({
},
});
const formControlAttrEl = ref(null);
const formControlAttrEl = ref();
provide("formDesignType", state.value.designType);
const appFormKeyVal = computed({

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

@ -5,6 +5,33 @@
-->
<script lang='ts' setup>
import { FormData, formStruct, DrawerStruct, VideoMsg } from "@/api/DesignForm/types";
import {
json2string,
objToStringify,
string2json,
stringToObj,
} from "@/utils/DesignForm/form";
import {
saveProductionForm,
asfHandle,
getOneProductionForm,
haveCustomerFormVersion,
editCustomerFormInfo,
saveAsNewVersion,
enableVersion,
judgeSubmitCancel,
createAppForm,
editAppPageInfo,
saveOtherVersion,
previewAppFormVersion,
} 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 { useRoute } from "vue-router";
const props = defineProps({
appCont: {
@ -56,34 +83,366 @@ const emits = defineEmits<{
(e: "runNextWindows", val: number): void;
(e: "closeFormPage"): void;
}>();
const isWeb = ref(false);
const route: any = useRoute().query || {};
const versionCont = ref<customerFormVersionCont[]>([]); //
const formControlAttrEl = ref();
const isEdit = ref(false);
const versionId = ref<string>(""); //
const state = computed({
get() {
return props.state;
},
set(val: formStruct) {
emits("update:state", val);
},
});
const formFieldAry = ref<string[]>([]);
const sunFormFieldAry = ref<string[]>([]);
const drawer = reactive<DrawerStruct>({
visible: false,
type: "",
title: "",
codeType: "",
direction: undefined, //rtl / ltr
callback: "",
});
/**
@ 作者: 秦东
@ 时间: 2026-02-24 13:39:25
@ 功能: 获取表单内容
*/
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;
sunFormFieldAry.value = result.tableStructureMap;
// 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;
if (kjdkjksd.aiConfig) {
state.value.formData.aiConfig = kjdkjksd.aiConfig;
} else {
state.value.formData.aiConfig = [];
}
// console.log("--->",kjdkjksd)
}
state.value.formData.config.groupKey = result.groupKey;
state.value.formData.config.classify = result.classify;
// 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);
} else {
emits("judgeFormIsEdit", true);
}
emits("update:formVersion", result.id.toString());
} else {
ElMessage.error(res.msg || "加载异常");
}
state.value.loading = false;
})
.finally(() => {
haveCustomerFormVersion({ id: state.value.formData.form.name }).then(
({ data }) => {
versionCont.value = data;
if (data.length > 0) {
data.forEach((item: any) => {
if (item.status == 1) {
versionId.value = item.id.toString();
emits("update:formVersion", item.id.toString());
}
});
}
}
);
})
.catch((res: any) => {
// console.log(res)
ElMessage.error(res.msg || "加载异常");
state.value.loading = false;
});
}
};
/**
@ 作者: 秦东
@ 时间: 2024-05-09 14:29:06
@ 功能: 根据启用版本进行加载页面
*/
const versionUpdateForm = (val: string) => {
// console.log("-------111------->",val)
versionId.value = val;
gainTableForm();
};
/**
@ 作者: 秦东
@ 时间: 2026-02-24 13:42:25
@ 功能: 预览版本
*/
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;
sunFormFieldAry.value = result.tableStructureMap;
// 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);
} else {
emits("judgeFormIsEdit", true);
}
} else {
ElMessage.error(res.msg || "加载异常");
}
state.value.loading = false;
});
}
};
/**
@ 作者: 秦东
@ 时间: 2026-02-24 15:41:53
@ 功能: 关联选项设置
*/
function optionsValue3Get3(data: any, fieldName: string) {
/* console.log("pageForm", "optionsValue3Get3");
console.log(state.value.formData.list);
console.log(data);
console.log(fieldName); */
for (let i = 0; i < state.value.formData.list.length; i++) {
if (state.value.formData.list[i].name == fieldName) {
state.value.formData.list[i].options = [];
for (let j = 0; j < data.length; j++) {
state.value.formData.list[i].options.push(data[j]);
}
}
}
}
/**
@ 作者: 秦东
@ 时间: 2026-02-25 10:51:57
@ 功能: 执行哪个按钮的操作
*/
const buttonCallbackEvent = (type: string) => {
console.log("执行哪个按钮的操作",type);
}
/**
@ 作者: 秦东
@ 时间: 2026-02-25 11:22:02
@ 功能: 打开脚本预览
*/
const openAceEditDrawer = (params: any) => {
// console.log("====:", params);
const { type, direction, codeType, title, callback, content } = params;
drawer.direction = direction; // ltr/rtl
drawer.type = type; // type
drawer.codeType = codeType || ""; //
drawer.title = title ? `提示:${title}` : "";
drawer.visible = true;
drawer.callback = callback;
let editData =
codeType === "json" ? json2string(content, true) : objToStringify(content, true);
// console.log("===1=:", type, editData);
switch (type) {
case "css":
editData = state.value.formData.config?.style || "";
break;
case "dict":
//
editData = json2string(state.value.formDict, true);
break;
case "cascader":
// console.log("==2=2=:", stringToObj(editData));
editData = stringToObj(editData);
break;
case "treeSelect":
let kvjData = stringToObj(editData);
// console.log("==2=2=:", editData, kvjData);
// editData = stringToObj(editData);
if (kvjData == "" || kvjData == null || kvjData == undefined) {
editData = [];
// console.log("==2=4=:", kvjData);
} else {
editData = stringToObj(editData);
// console.log("==2=5=:", editData);
}
// console.log("==2=3=:", editData);
break;
case "beforeRequest":
case "beforeSubmit":
case "afterResponse":
case "afterSubmit":
case "change":
// eslint-disable-next-line no-case-declarations
const beforeData = state.value.formData.events || {};
if (beforeData[type]) {
editData = objToStringify(beforeData[type], true);
} else {
if (["afterResponse", "afterSubmit"].includes(type)) {
editData = afterResponse;
} else if (type === "change") {
editData = onChange;
} else {
editData = beforeRequest;
}
}
break;
// case 'afterResponse':
// case 'afterSubmit':
// const newData = state.formData.events || {}
// if (newData[type]) {
// editData = objToStringify(newData[type], true)
// } else {
// editData = afterResponse
// }
// break
const attrActiveTab = ref("first");
case "optionsParams":
if (!content) {
editData = beforeRequest;
}
break;
case "optionsResult":
if (!content) {
editData = afterResponse;
}
break;
}
drawer.content = editData;
// console.log("==2=222=:", drawer.content);
};
/**
@ 作者: 李文轩
@ 时间: 2026-02-25 11:26:46
@ 功能: 关联选项设置 修复bug:当字段标识改变时关联选项设置的字段标识未同步更改
*/
const formNameChanged = (param1: any) => {
for (let i = 0; i < state.value.formData.list.length; i++) {
if (
state.value.formData.list[i].type == "radio" ||
state.value.formData.list[i].type == "select" ||
state.value.formData.list[i].type == "checkbox"
) {
if (
state.value.formData.list[i].control.glxxsz != undefined &&
state.value.formData.list[i].control.glxxsz.length > 0
) {
state.value.formData.list[i].control.glxxsz = [];
state.value.formData.list[i].options.push({
label: "",
value: "",
});
state.value.formData.list[i].options.pop();
}
if (
state.value.formData.list[i].control.glxxszForCheckBox != undefined &&
state.value.formData.list[i].control.glxxszForCheckBox.length > 0
) {
state.value.formData.list[i].control.glxxszForCheckBox = [];
}
}
}
// ElMessage({
// message: '',
// type: 'warning',
// })
};
defineExpose({
gainTableForm,
});
onMounted(() => {
if (route.source) {
formControlAttrEl.value.getFormFieldBySource(route.source);
}
gainTableForm();
});
</script>
<template>
<div class="form-content">
<el-card shadow="always">
<template #header>
<div class="card-header">控件库</div>
</template>
<el-scrollbar ref="scrollbarRef" class="scroBox ">
</el-scrollbar>
</el-card>
<el-card shadow="always">
<template #header>
<div class="card-header">控件库</div>
</template>
</el-card>
<el-card shadow="always">
<template #header>
<div class="card-header">控件库</div>
</template>
<el-tabs v-model="attrActiveTab">
<el-tab-pane label="字段设置" name="first">字段设置</el-tab-pane>
<el-tab-pane label="表单设置" name="second">表单设置</el-tab-pane>
<el-tab-pane label="AI设置" name="third">AI设置</el-tab-pane>
</el-tabs>
</el-card>
<Control
:table-key="state.formData.form.name"
@version-update-form="versionUpdateForm"
@version-preview-page="versionPreviewPage"
/>
<Design
v-model:is-web="isWeb"
:type="5"
:form-data="state.formData"
:dict="state.formDict"
@options-value3-get3="optionsValue3Get3"
@click="buttonCallbackEvent"
/>
<Attribute
ref="formControlAttrEl"
v-model:formOtherData="state.formOtherData"
:form-data="state.formData.form"
:form-config="state.formData.config"
:customerformid="props.appPageKey"
:form-list="state.formData.list"
:form-info="state.formData"
:is-edit="isEdit"
:form-field="formFieldAry"
:sun-form-field="sunFormFieldAry"
:state="state"
@open-dialog="openAceEditDrawer"
@form-name-change="formNameChanged"
/>
</div>
</template>
<style lang='scss' scoped>
@ -94,7 +453,29 @@ const attrActiveTab = ref("first");
grid-template-rows: auto;
gap: 10px;
padding: 10px 10px 0 10px;
:deep .el-tabs--border-card{
border: 0;
}
:deep .el-card__header{
padding: 10px 15px;
background-color: #f5f7fa;
}
:deep .el-card__body{
padding: 0;
}
:deep .el-tabs__header{
justify-content: space-between;
width: 100%;
}
:deep .is-active{
border-bottom: 1px solid var(--el-color-primary);
}
}
.cardHeader{
display: flex;
justify-content: space-between;
align-items: center;
}
.card-header{
font-size: 1.4rem;
@ -104,20 +485,63 @@ const attrActiveTab = ref("first");
align-items: center;
gap: 10px;
}
:deep .el-card__header{
padding: 10px 15px;
}
:deep .el-card__body{
padding: 0;
}
:deep .el-tabs__header{
justify-content: space-between;
width: 100%;
.category-title {
font-size: 14px;
font-weight: 600;
color: #165DFF;
margin-bottom: 10px;
padding-bottom: 8px;
border-bottom: 1px solid #ebeef5;
}
.scroBox{
height: calc(100vh - 110px);
overflow: auto;
}
//
.unitBox{
padding: 10px 15px;
}
.unitBody{
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
}
.unitItem{
background: #f5f7fa;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 10px 5px; /* 减小内边距以适应3列布局 */
text-align: center;
cursor: grab;
transition: all 0.2s;
display: flex;
flex-direction: column;
align-items: center;
&:hover{
background: #ecf5ff;
transform: translateY(-2px);
box-shadow: 0 2px 12px 0 rgba(22, 93, 255, 0.1);
border-color: #b3d8ff;
color: #165DFF;
}
}
.control-icon {
font-size: 25px; /* 减小图标大小以适应3列布局 */
color: #165DFF;
margin-bottom: 3px; /* 减小间距以适应3列布局 */
}
.control-name {
font-size: 12px; /* 减小字体大小以适应3列布局 */
color: #606266;
line-height: 1.2;
}
//
//
</style>

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

File diff suppressed because it is too large

257
src/views/sysworkflow/lowcodepage/appPage/appPageForm/unitsPageFrom/control.vue

@ -0,0 +1,257 @@
<!--
@ 作者: 秦东
@ 时间: 2026-02-24 13:22:18
@ 备注: 控件库
-->
<script lang='ts' setup>
import controlListData from "@/components/DesignForm/assembly";
import { jsonParseStringify } from "@/utils/DesignForm";
import Draggable from "vuedraggable-es";
import "@/assets/iconfont/iconfont.css";
import SvgIcon from "@/components/SvgIcon/index.vue";
import FormVersion from "@/components/DesignForm/formVersion.vue";
const props = defineProps({
tableKey: {
type: String,
default: ""
},
signCode: {
type: String,
default: ""
}
})
// const props = withDefaults(
// defineProps<{
// tableKey?: number | string;
// signCode?: number | string;
// }>(),
// {}
// );
const emits = defineEmits<{
(e: "versionUpdateForm", value: string): void;
(e: "versionPreviewPage", value: string): void;
}>();
const designType = inject("formDesignType") as string; // ( app.provide())
const versionActiveTab = ref(false);
const tableVersion = ref(); //
const isSearch = computed(() => {
return designType === "search";
});
//
const searchField = [
"input",
"radio",
"checkbox",
"select",
"datePicker",
"timePicker",
"inputNumber",
"cascader",
"component",
"button",
];
/**
@ 作者: 秦东
@ 时间: 2024-05-09 11:36:59
@ 功能: 启用和禁用版本
*/
const enableOrDisable = (val?: any) => {
// console.log("",val)
emits("versionUpdateForm", val);
};
/**
@ 作者: 秦东
@ 时间: 2024-05-21 09:05:20
@ 功能: 预览版本
*/
const previewPage = (val?: any) => {
emits("versionPreviewPage", val);
};
/**
@ 作者: 秦东
@ 时间: 2026-02-24 13:45:38
@ 功能: 表单组件数据
*/
const controlList = computed(() => {
if (designType === "search") {
//
const temp: any = [];
controlListData.forEach((item: any) => {
if (item.children) {
const filter = item.children.filter((ch: any) => {
return searchField.includes(ch.type);
});
if (filter && filter.length) {
temp.push({ title: item.title, children: filter });
}
}
});
return temp;
} else {
return controlListData;
}
});
/**
@ 作者: 秦东
@ 时间: 2024-05-09 11:40:15
@ 功能: 打开版本选择页面
*/
const useVersionClick = () => {
tableVersion.value.open();
};
/**
@ 作者: 秦东
@ 时间: 2024-05-15 10:15:14
@ 功能: 克隆选中的组件数据结构
*/
const clone = (origin: any) => {
// console.log("",origin)
return jsonParseStringify(origin);
};
</script>
<template>
<el-card shadow="always">
<template #header>
<div class="cardHeader">
<div class="card-header">控件库</div>
<div v-if="!isSearch" class="card-headerRight" @click="useVersionClick">版本管理</div>
</div>
</template>
<el-scrollbar ref="scrollbarRef" class="scroBox ">
<div v-for="(list, index) in controlList" :key="index" v-memo="[index]" class="unitBox">
<el-text class="category-title">{{ list.title }}</el-text>
<el-divider style="margin: 5px 0 10px 0;" />
<div class="unitBody">
<Draggable
v-model="list.children"
tag="ul"
:group="{ name: 'form', pull: 'clone', put: false }"
ghost-class="ghost"
:sort="false"
:clone="clone"
itemKey="unitListKey"
>
<template #item="{ element }">
<div class="unitItem">
<SvgIcon v-if="element.iconFont == ''" icon-class="caogaoxiang" class="control-icon" />
<i v-if="element.iconFont != ''" :class="`fa ${element.iconFont} `"></i>
<el-text class="control-name">{{element.label}}</el-text>
</div>
</template>
</Draggable>
</div>
</div>
</el-scrollbar>
<FormVersion
ref="tableVersion"
:table-key="props.tableKey"
:sign-code="props.signCode"
@enable-or-disable="enableOrDisable"
@preview-page="previewPage"
/>
</el-card>
</template>
<style lang='scss' scoped>
.form-content {
width: 100%;
display: grid;
grid-template-columns: 300px 1fr 300px;
grid-template-rows: auto;
gap: 10px;
padding: 10px 10px 0 10px;
:deep .el-tabs--border-card{
border: 0;
}
:deep .el-card__header{
padding: 10px 15px;
background-color: #f5f7fa;
}
:deep .el-card__body{
padding: 0;
}
:deep .el-tabs__header{
justify-content: space-between;
width: 100%;
}
:deep .is-active{
border-bottom: 1px solid var(--el-color-primary);
}
}
.cardHeader{
display: flex;
justify-content: space-between;
align-items: center;
}
.card-header{
font-size: 1.4rem;
font-weight: 700;
color: #0020C2;
display: flex;
align-items: center;
gap: 10px;
}
.category-title {
font-size: 14px;
font-weight: 600;
color: #165DFF;
margin-bottom: 10px;
padding-bottom: 8px;
border-bottom: 1px solid #ebeef5;
}
.scroBox{
height: calc(100vh - 110px);
overflow: auto;
}
//
.unitBox{
padding: 10px 15px;
}
.unitBody ul{
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-gap: 10px;
}
.unitItem{
background: #f5f7fa;
border: 1px solid #dcdfe6;
border-radius: 4px;
padding: 10px 5px; /* 减小内边距以适应3列布局 */
text-align: center;
cursor: grab;
transition: all 0.2s;
display: flex;
flex-direction: column;
align-items: center;
&:hover{
background: #ecf5ff;
transform: translateY(-2px);
box-shadow: 0 2px 12px 0 rgba(22, 93, 255, 0.1);
border-color: #b3d8ff;
color: #165DFF;
}
i{
font-size: 20px; /* 减小图标大小以适应3列布局 */
color: #165DFF;
margin: 5px 0; /* 减小间距以适应3列布局 */
}
}
.control-icon {
font-size: 25px; /* 减小图标大小以适应3列布局 */
color: #165DFF;
margin-bottom: 3px; /* 减小间距以适应3列布局 */
}
.control-name {
font-size: 12px; /* 减小字体大小以适应3列布局 */
color: #606266;
line-height: 1.2;
}
</style>

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

@ -0,0 +1,241 @@
<!--
@ 作者: 秦东
@ 时间: 2026-02-24 13:23:08
@ 备注: 设计区域
-->
<script lang='ts' setup>
import "@/assets/scss/element-var.scss";
import "@/assets/scss/index.scss";
import { FormData, FormList, FormDataStyle } from "@/api/DesignForm/types";
import {
constGetControlByName,
constSetFormOptions,
constFormBtnEvent,
constControlChange,
constFormProps,
appendOrRemoveStyle,
constAiEffect,
} from "@/api/DesignForm/utils";
import SvgIcon from "@/components/SvgIcon/index.vue";
import { useRoute } from "vue-router";
const props = withDefaults(
defineProps<{
formData: FormData;
type?: number; // 123 4 5
numrun?: number; //11
disabled?: boolean; //
requestUrl?: string; // url
beforeRequest?: Function; //
afterResponse?: Function | string; //
addUrl?: string; // url
editUrl?: string; // url
beforeSubmit?: Function | string; //
afterSubmit?: Function; // return false
closeAppSubmit?: Function; //
changeKeyVal?: Function; //
anewSubmit?: Function; //
saveDraftPage?: Function; //稿
saveEditFormInfo?: Function; //稿
sendDraftSubmit?: Function; //稿
submitEdit?: Function; //
value?: { [key: string]: any }; // setValue
options?: { [key: string]: any }; // setOptions
dict?: object; //
isSearch?: boolean; // 使
isWorkFlow?: number; //
flowkey?: string; //
groupid?: string; //
signCode?: string; //
versionId?: string; //
mastesformjson?: string; //
isWeb: boolean; //
nodeKey?: string;
purview?: any[];
}>(),
{
type: 1, // 123 4 5
numrun: 2,
formData: () => {
return {
list: [],
form: {},
config: {
groupKey: '',
style: "",
},
styles: {
divStyle: {},
labelStyle: {},
inputStyle: {},
},
aiConfig: [],
};
},
dict: () => {
return {};
},
isSearch: false,
issave: {
type: Boolean,
default: true,
},
key: 1,
isWorkFlow: 2,
flowkey: "",
groupid: "",
signCode: "",
mastesformjson: "",
}
);
const emits = defineEmits<{
(e: "btnClick", type: string): void;
(e: "change", val: any): void; //
(e: "update:issave", type: boolean): void;
(e: "refresh"): void;
(e: "optionsValue3Get3", val: any, fieldName: string): void;
(e: 'click', value: string): void;
}>();
const route = useRoute();
const rangedUserTrees1= ref([]);
//
const model = ref<any>({});
//
const resultDict = ref({});
const dictForm = computed(() => {
const storage = window.localStorage.getItem("akFormDict");
let storageDict = {};
if (storage) {
storageDict = JSON.parse(storage);
}
//
return Object.assign({}, storageDict, props.dict, resultDict.value);
});
//
const formProps = computed(() => {
return {
model: model.value,
type: props.type,
hideField: props.formData.config?.hideField as [],
showColon: props.formData.form.showColon,
dict: dictForm.value,
};
});
provide(constFormProps, formProps);
const pickPageType = ref("PC");
function optionsValue3Get2(data: any, fieldName: string) {
//console.log("form.vue","optionsValue3Get2")
emits("optionsValue3Get3", data, fieldName);
}
/**
@ 作者: 秦东
@ 时间: 2026-02-25 10:51:00
@ 功能: 执行哪个按钮的操作3579.76 2509.81
2162.87 2783.09
*/
const btnClick = (type: string) => {
if(type === 'monitor'){
pickPageType.value = 'PC'
}else if(type === 'iphone'){
pickPageType.value = 'WEB'
}
emits('click', type)
}
</script>
<template>
<el-card shadow="always">
<template #header>
<div class="card-header">设计区域</div>
</template>
<div class="design-toolbar">
<el-button-group>
<el-button class="fa fa-television" :type="pickPageType === 'PC' ? 'primary' : ''" size="small" @click="btnClick('monitor')">电脑端</el-button>
<el-button class="fa fa-mobile" :type="pickPageType === 'WEB' ? 'primary' : ''" size="small" @click="btnClick('iphone')">移动端</el-button>
</el-button-group>
<el-button-group>
<el-button class="fa fa-trash-o" size="small" @click="btnClick('del')">清空</el-button>
<el-button class="fa fa-eye" size="small" @click="btnClick('eye')">预览</el-button>
<el-button class="fa fa-file-code-o" size="small" @click="btnClick('json')">脚本预览</el-button>
<el-button class="fa fa-save" type="success" size="small" @click="btnClick('save')">保存</el-button>
<el-button class="fa fa-code-fork" type="warning" size="small" @click="btnClick('branch')">另存未新版本</el-button>
</el-button-group>
</div>
<div class="design-area" id="designArea">
<div v-if="formData.list.length === 0" class="placeholder" id="emptyPlaceholder">
<i class="fa fa-magic"></i>
<p>从左侧拖拽控件到此处开始设计表单</p>
</div>
<el-form
v-bind="formData.form"
ref="ruleForm"
:disabled="disabled || type === 3"
class="add-form"
:class="{
'design-form': type === 5,
'detail-form': type === 3 || type === 4 || type === 1,
}"
>
<FormGroup
:tableinfo="formData.form"
:numrun="numrun"
:data="formData.list"
:alldata="formData"
:node-key="nodeKey"
:purview="purview"
:org-and-man-tree="rangedUserTrees1"
@options-value3-get2="optionsValue3Get2"
/>
<slot></slot>
</el-form>
</div>
</el-card>
</template>
<style lang='scss' scoped>
.design-toolbar {
display: flex;
align-items: center;
justify-content: space-between;
padding: 10px 10px;
border-bottom: 1px solid #ebeef5;
background: #f5f7fa;
:deep .el-button>span{
margin-left: 5px;
}
}
.toolbar-right {
display: flex;
gap: 0px;
}
.design-area {
flex: 1;
background: #fafafa;
border: 2px dashed #c0c4cc;
border-radius: 4px;
padding: 20px;
margin: 10px;
height: calc(100vh - 170px);
overflow-y: auto;
}
.placeholder {
text-align: center;
color: #909399;
padding: 40px 20px;
}
.placeholder i {
font-size: 48px;
margin-bottom: 15px;
opacity: 0.7;
}
</style>

8
src/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue

@ -253,7 +253,7 @@ onBeforeMount(() => {
</div>
</el-header>
<el-container>
<!-- <NewPageForm
<NewPageForm
v-if="tabsActive == 1"
ref="appPageInfo"
v-model:state="state"
@ -264,8 +264,8 @@ onBeforeMount(() => {
:menu-id="menuId"
:group-key="props.groupKey"
:formconfigcont="formConfigCont"
/> -->
<PageForm
/>
<!-- <PageForm
v-if="tabsActive == 1"
ref="appPageInfo"
v-model:state="state"
@ -276,7 +276,7 @@ onBeforeMount(() => {
:menu-id="menuId"
:group-key="props.groupKey"
:formconfigcont="formConfigCont"
/>
/> -->
<PageFlow
v-if="tabsActive == 2"
v-model:state="state"

Loading…
Cancel
Save