Browse Source

添加角色和岗位组件

qin_v18
herenshan112 8 months ago
parent
commit
0accc5528a
  1. 1
      package.json
  2. 16
      src/api/api/index.ts
  3. 20
      src/api/hr/org/index.ts
  4. 9
      src/api/role/index.ts
  5. 51
      src/components/DesignForm/app/index.vue
  6. 40
      src/components/DesignForm/assembly/index.ts
  7. 42
      src/components/DesignForm/formControlPropertiNew.vue
  8. 232
      src/components/DesignForm/public/expand/pickpost.vue
  9. 51
      src/components/DesignForm/public/expand/pickrole.vue
  10. 21
      src/components/DesignForm/public/form/formItem.vue
  11. 249
      src/components/DesignForm/public/form/web/childTable.vue
  12. 61
      src/components/DesignForm/tableListPage/index.vue
  13. 39
      src/components/WangEditor/Untitled-1.html
  14. 126
      src/views/sysworkflow/lowcodepage/appPage/MoveAppMenus.vue
  15. 34
      src/views/sysworkflow/lowcodepage/appPage/appMenus.vue
  16. 546
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue
  17. 4
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue
  18. 185
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue

1
package.json

@ -49,6 +49,7 @@
"@wangeditor/editor": "^5.1.23",
"@wangeditor/editor-for-vue": "5.1.10",
"@wecom/jssdk": "^1.3.2",
"appsys": "file:",
"axios": "^1.4.0",
"clipboard": "^2.0.11",
"compressorjs": "^1.2.1",

16
src/api/api/index.ts

@ -11,3 +11,19 @@ import request from '@/utils/request';
data: data
});
}
export function gainAppGroupMenus(data?: any) {
return request({
url: "/systemapi/app/gainAppGroupMenus",
method: "POST",
data: data
});
}
export function moveAppMenus(data?: any) {
return request({
url: "/systemapi/app/moveAppMenus",
method: "POST",
data: data
});
}

20
src/api/hr/org/index.ts

@ -275,3 +275,23 @@ export function getTeamListCont(data: searchTeamList): AxiosPromise<orgTeamListC
data: data
});
}
/**
*
*/
export function basis_org_postList(data?: any){
return request({
url: '/hrapi/org/basis_org_postList',
method: 'post',
data: data
});
}
/**
*
*/
export function getpositioncont(data: getContId){
return request({
url: '/hrapi/org/getpositioncont',
method: 'post',
data: data
});
}

9
src/api/role/index.ts

@ -110,3 +110,12 @@ export function deleteRoles(ids: string) {
method: 'delete'
});
}
//获取角色列表
export function gainRoleList(data?: any) {
return request({
url: "/systemapi/user/gainRoleList",
method: "POST",
data: data
});
}

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

@ -1504,6 +1504,27 @@ const judgeListTitle = (val: any, viewConfig: any) => {
const transformOption = (val: string | number, type?: string) => {
return formatNumber(val);
};
const readerColumnSun = (column: any) => {
let labelLong = 0; // label
if (column) {
labelLong = column.length;
}
if (labelLong > 0) {
let countLenght = 3;
column.forEach((item: any) => {
if (item.label.length < 3) {
countLenght = countLenght + 90;
} else {
countLenght = countLenght + item.label.length * 40;
}
});
console.log("表头label长度-->", countLenght);
return countLenght;
} else {
return 420;
}
};
</script>
<template>
<div ref="container" v-loading="state.loading" class="table-list-comm">
@ -1871,6 +1892,36 @@ const transformOption = (val: string | number, type?: string) => {
{{ writeListTitle(scope.row, viewPage.list) }}
</template>
</el-table-column>
<el-table-column
v-else-if="item.fieldClass == ''"
:prop="item.field"
:label="item.label"
:width="readerColumnSun(item.children)"
>
<template #default="scope">
<el-table
v-if="item.pattern == 'table'"
v-bind="data.tableProps"
ref="table"
border
:data="scope.row[item.field]"
>
<template
v-for="sunItem in item.children"
:key="sunItem.id || sunItem.label"
>
<el-table-column
v-if="sunItem.fieldClass == ''"
:prop="sunItem.field"
:label="sunItem.label"
>
</el-table-column>
</template>
</el-table>
</template>
</el-table-column>
<el-table-column
v-else
:prop="item.field"

40
src/components/DesignForm/assembly/index.ts

@ -1154,6 +1154,46 @@ export default [
inputStyle: {}
}
},
{
type: 'pickpost',
label: '岗位选择',
unitName: '岗位选择',
icon: 'number',
iconFont: 'fa-vcard-o',
control: {
modelValue: ""
},
config: {},
styles: {
divStyle: {
marginBot: "15"
},
labelStyle: {
paddingLeft: "7",
},
inputStyle: {}
}
},
{
type: 'pickrole',
label: '角色选择',
unitName: '角色选择',
icon: 'number',
iconFont: 'fa-user',
control: {
modelValue: ""
},
config: {},
styles: {
divStyle: {
marginBot: "15"
},
labelStyle: {
paddingLeft: "7",
},
inputStyle: {}
}
},
]
},
{

42
src/components/DesignForm/formControlPropertiNew.vue

@ -48,6 +48,7 @@ const props = withDefaults(
formInfo: any;
isEdit: boolean;
formField: any[];
sunFormField: any[];
}>(),
{
formConfig: () => {
@ -59,6 +60,9 @@ const props = withDefaults(
formField: () => {
return [];
},
sunFormField: () => {
return [];
},
formOtherData: () => {
// formData
return {};
@ -1110,12 +1114,20 @@ watch(
const fileSignAry = reactive<any>([]);
const controlChange = (obj: any, val: any) => {
console.log("字段编辑--1--》", obj);
console.log("字段编辑--2--》", obj.eventName);
console.log("字段编辑--3--》", val);
console.log("字段编辑--4--》", controlData.value);
console.log("字段编辑--5--》", obj.path);
// console.log("--1--", obj);
// console.log("--2--", obj.eventName);
// console.log("--3--", val);
// console.log("--4--", controlData.value);
// console.log("--5--", obj.path);
// console.log("--6--", props.formField);
// console.log("--7--", controlData.value.name);
// console.log("--8--", props.sunFormField);
// console.log(
// "--9--",
// Array.isArray(props.sunFormField) &&
// !props.sunFormField.includes(controlData.value.name)
// );
// select
switch (obj.eventName) {
case "selectMultiple":
@ -1167,6 +1179,10 @@ const controlChange = (obj: any, val: any) => {
if (
Array.isArray(props.formField) &&
!props.formField.includes(controlData.value.name)
) {
if (
Array.isArray(props.sunFormField) &&
!props.sunFormField.includes(controlData.value.name)
) {
chineseToPinyin({
title: val,
@ -1227,6 +1243,7 @@ const controlChange = (obj: any, val: any) => {
});
}
}
}
// chineseToPinyin({title:val,types:8,connector:"",formJson:JSON.stringify(props.formInfo)})
// .then((data:any)=>{
// if(data.code == 0){
@ -1749,6 +1766,7 @@ const eventClick = (type: string, tooltip?: string) => {
};
getDataSource();
defineExpose({ getFormFieldBySource, saveRefreshFormControlAttr });
//
const isNotWrite = (val: any) => {
// console.log("--->",val,props.customerformid)
@ -1762,8 +1780,8 @@ const isNotWrite = (val: any) => {
return false;
};
const isNotWriteWord = (val: any) => {
// console.log("isNotWriteWord---->",val)
// console.log("isNotWriteWord--formField-->",props.formField)
// console.log("isNotWriteWord---->", val);
// console.log("isNotWriteWord--formField-->", props.formField);
if (
val.eventName === "filedNameKey" &&
props.customerformid != "" &&
@ -1771,9 +1789,15 @@ const isNotWriteWord = (val: any) => {
Array.isArray(props.formField) &&
props.formField.includes(val.value)
) {
// if(props.formField.includes(val.value)){
if (
props.sunFormField &&
Array.isArray(props.sunFormField) &&
props.sunFormField.includes(val.value)
) {
return true;
// }
} else {
return false;
}
}
return false;
};

232
src/components/DesignForm/public/expand/pickpost.vue

@ -0,0 +1,232 @@
<!--
@ 作者: 秦东
@ 时间: 2025-03-19 13:27:12
@ 备注: 岗位选择
-->
<script lang="ts" setup>
import { basis_org_postList } from "@/api/hr/org/index";
import { orgInfo } from "@/api/hr/org/type";
import { getOrgTreeList } from "@/api/hr/org/index";
import { getgovcont, getpositioncont } from "@/api/hr/org/index";
const props = withDefaults(
defineProps<{
modelValue?: string;
disabled?: boolean;
type?: number;
data?: object;
}>(),
{}
);
const emits = defineEmits<{
(e: "update:modelValue", value: string): void;
}>();
const value = computed({
get: () => {
if (props.modelValue != "" && props.modelValue != undefined) {
console.log("初始结果", props.modelValue);
let ads = props.modelValue.split("#@#");
console.log("初始结果", ads);
if (ads.length >= 2) {
orgPostInfo.orgId = ads[0] * 1;
orgPostInfo.postId = ads[1] * 1;
orgChange(ads[0] * 1);
} else if (ads.length == 1) {
orgPostInfo.orgId = ads[0] * 1;
orgChange(ads[0] * 1);
} else {
orgPostInfo.orgId = "";
orgPostInfo.postId = "";
}
// if (props.type == 4) {
// writeInfo(props.modelValue);
// return valueHtml;
// } else {
// return props.modelValue;
// }
return props.modelValue;
} else {
return props.modelValue;
}
},
set: (newVal: any) => {
emits("update:modelValue", newVal);
},
});
const postOptions = ref([]);
const valueHtml = ref("");
const valueHtmlPost = ref("");
const orgTreeList = ref<orgInfo[]>();
const orgTreeLoading = ref(false); //
const orgTreeProps = {
children: "child",
label: "name",
}; //
const orgPostTreeLoading = ref(false);
const orgPostInfo = reactive({
orgId: "",
postId: "",
});
function haveOrgTreeInfo() {
orgTreeLoading.value = true;
getOrgTreeList({ orgid: 309 })
.then(({ data }) => {
console.log("行政组织树对照值", data);
orgTreeList.value = data;
})
.finally(() => {
orgTreeLoading.value = false;
});
}
onBeforeMount(() => {
haveOrgTreeInfo();
});
onMounted(() => {
// console.log("value---1--",value.value,props.modelValue)
nextTick(() => {
haveOrgTreeInfo();
if (props.type == 4) {
console.log("value---1--》", props.modelValue);
}
});
});
/**
@ 作者: 秦东
@ 时间: 2025-03-20 14:43:57
@ 功能: 改变行政组织获取相应岗位
*/
const orgChange = (val: any) => {
// console.log("", val);
orgPostTreeLoading.value = true;
basis_org_postList({ id: [val] })
.then(({ data }) => {
console.log("改变行政组织获取相应岗位", data);
postOptions.value = data;
})
.finally(() => {
orgPostTreeLoading.value = false;
});
};
watch(
() => orgPostInfo,
(val: any) => {
if (val.orgId != "") {
value.value = val.orgId;
if (val.postId != "") {
value.value = val.orgId + "#@#" + val.postId;
if (props.type == 4) {
if (postOptions.value && postOptions.value.length > 0) {
orgPostInfo.postId.forEach((item: any) => {
if (item.id == val.postId) {
value.value = value.value + item.name;
}
});
}
}
} else {
value.value = "";
}
} else {
value.value = "";
}
},
{
deep: true,
}
);
/**
@ 作者: 秦东
@ 时间: 2025-03-20 16:06:01
@ 功能: 获取行政组织基本信息
*/
const gainOrgCont = (val: string) => {
let name = "";
getgovcont({ id: val * 1, idstr: val })
.then(({ data }) => {
console.log("选择行政组织-3->", data, data.name);
// orgName.value = data.name
valueHtml.value = data.name;
})
.finally(() => {});
return name;
};
/**
@ 作者: 秦东
@ 时间: 2025-03-20 16:36:03
@ 功能: 获取岗位
*/
const getPostInfo = (val: string) => {
getpositioncont({ id: val * 1, idstr: val }).then(({ data }) => {
console.log("选择行政组织----4->", data, data.name);
valueHtmlPost.value = data.name;
});
};
/**
@ 作者: 秦东
@ 时间: 2025-03-20 16:15:48
@ 功能: 输出结果
*/
const writeInfo = (val: any) => {
console.log("输出结果-3->", val);
if (val != "" && val != undefined) {
let ads = val.split("#@#");
if (ads.length >= 2) {
gainOrgCont(ads[0]);
getPostInfo(ads[1]);
} else if (ads.length == 1) {
gainOrgCont(ads[0]);
}
}
let sendInfo = valueHtml.value;
if (valueHtmlPost.value != "") {
sendInfo = sendInfo + "-" + valueHtmlPost.value;
}
return sendInfo;
};
</script>
<template>
<el-row v-if="props.type != 4">
<el-col :span="24">
<el-tree-select
v-bind="$props"
v-model="orgPostInfo.orgId"
v-loading="orgTreeLoading"
node-key="id"
:props="orgTreeProps"
:data="orgTreeList"
check-strictly
b
:render-after-expand="false"
placeholder="请选择行政组织"
@change="orgChange"
/>
</el-col>
<el-col :span="24">
<el-select
v-model="orgPostInfo.postId"
v-loading="orgPostTreeLoading"
placeholder="请选择岗位"
>
<el-option
v-for="item in postOptions"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-col>
<el-input style="display: none" v-model="value" placeholder="请选择" />
</el-row>
<div v-else v-html="writeInfo(value)"></div>
</template>
<style lang="scss" scoped>
.el-row {
width: 100%;
}
</style>

51
src/components/DesignForm/public/expand/pickrole.vue

@ -0,0 +1,51 @@
<!--
@ 作者: 秦东
@ 时间: 2025-03-19 13:26:28
@ 备注: 角色选择
-->
<script lang="ts" setup>
import { gainRoleList } from "@/api/role/index";
const props = withDefaults(
defineProps<{
modelValue?: string;
disabled?: boolean;
type?: number;
}>(),
{}
);
const emits = defineEmits<{
(e: "update:modelValue", value: string): void;
}>();
const value = computed({
get: () => {
return props.modelValue * 1;
},
set: (newVal: any) => {
emits("update:modelValue", newVal);
},
});
const roleLoading = ref(false); //
const roleLiet = ref([]);
onBeforeMount(() => {
roleLoading.value = true;
gainRoleList()
.then(({ data }) => {
console.log("角色列表", data);
roleLiet.value = data;
})
.finally(() => {
roleLoading.value = false;
});
});
</script>
<template>
<el-select v-model="value" placeholder="请选择">
<el-option
v-for="item in roleLiet"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</template>
<style lang="scss" scoped></style>

21
src/components/DesignForm/public/form/formItem.vue

@ -35,6 +35,8 @@ import DatePickerPage from "@/components/DesignForm/public/expand/datePicker.vue
import CascaderPage from "@/components/DesignForm/public/expand/cascader.vue";
import AssociatedForms from "@/widget/associatedforms/index.vue";
import TreeSelectPage from "@/components/DesignForm/public/expand/treeSelect.vue";
import PickPost from "@/components/DesignForm/public/expand/pickpost.vue";
import PickRole from "@/components/DesignForm/public/expand/pickrole.vue";
import AKSelect from "./select.vue";
import { uploadUrl, getRequest } from "@/api/DesignForm";
@ -216,6 +218,13 @@ const currentComponent = computed(() => {
return markRaw(TreeSelectPage);
}
if (props.data.type === "pickpost") {
return markRaw(PickPost);
}
if (props.data.type === "pickrole") {
return markRaw(PickRole);
}
if (props.data.type === "switch") {
if (typeof props.data.control.activeValue === "number") {
props.data.control.activeValue = props.data.control.activeValue.toString();
@ -994,6 +1003,7 @@ const diGuiJilian = (val: any, options: any[]) => {
};
</script>
<template>
{{ data.type }}
<BaiduMap
v-if="judgeIsShow(data.name) && data.type === 'baidumap' && type != 4"
:data="data"
@ -1178,7 +1188,13 @@ const diGuiJilian = (val: any, options: any[]) => {
v-html="pickUserVal(value)"
></div>
<LokOrgCentent v-else-if="data.type == 'orgCentent'" :orgid="value" />
<PickPost
v-else-if="data.type == 'pickpost'"
v-bind="control"
:data="data"
:type="type"
v-model="value"
/>
<div class="form-value" v-else v-html="value"></div>
</template>
<template v-else>
@ -1361,6 +1377,8 @@ const diGuiJilian = (val: any, options: any[]) => {
'expand-user',
'orgCentent',
'digitpage',
'pickpost',
'pickrole',
].includes(data.type)
"
:is="currentComponent"
@ -1372,6 +1390,7 @@ const diGuiJilian = (val: any, options: any[]) => {
: '请选择' + getLabel(data.item)
"
:data="data"
:type="type"
v-model="value"
/>
<component

249
src/components/DesignForm/public/form/web/childTable.vue

@ -3,103 +3,102 @@
@ 时间: 2024-10-18 09:21:25
@ 备注: 表单表格属性解析
-->
<script lang='ts' setup>
import FormItem from '@/components/DesignForm/public/form/formItem.vue'
import { inject, computed } from 'vue'
import Tooltips from '@/components/DesignForm/tooltip.vue'
import {constFormProps } from '@/api/DesignForm/utils'
import { jsonParseStringify } from '@/utils/DesignForm'
import LowcodeImagePage from '@/components/DesignForm/public/expand/lowcodeImage.vue'
import UploadPageList from '@/components/DesignForm/public/expand/uploadPageList.vue'
import LokOrgCentent from '@/widget/org/cont.vue'
<script lang="ts" setup>
import FormItem from "@/components/DesignForm/public/form/formItem.vue";
import { inject, computed } from "vue";
import Tooltips from "@/components/DesignForm/tooltip.vue";
import { constFormProps } from "@/api/DesignForm/utils";
import { jsonParseStringify } from "@/utils/DesignForm";
import LowcodeImagePage from "@/components/DesignForm/public/expand/lowcodeImage.vue";
import UploadPageList from "@/components/DesignForm/public/expand/uploadPageList.vue";
import LokOrgCentent from "@/widget/org/cont.vue";
const props = withDefaults(
defineProps<{
data: any
data: any;
}>(),
{
data: () => {
return {}
}
return {};
},
}
)
const formProps = inject(constFormProps, {}) as any
);
const formProps = inject(constFormProps, {}) as any;
const tableDataNew = computed(() => {
// console.log("-----1---->",props.data.name)
// console.log("-----2---->",formProps.value.model[props.data.name])
// console.log("-----3---->",formProps.value.model)
// console.log("-----4---->",formProps.value)
return formProps.value.model[props.data.name]
})
return formProps.value.model[props.data.name];
});
const type = computed(() => {
return formProps.value.type
})
return formProps.value.type;
});
// true
const editDisabled = computed(() => {
return formProps.value.type === 2 && props.data.config?.editDisabled
})
return formProps.value.type === 2 && props.data.config?.editDisabled;
});
const addColumn = () => {
// console.log("--------->",tableDataNew.value)
const temp: any = {}
const temp: any = {};
if (props.data.list) {
props.data.list.forEach((item: any) => {
if (item.name) {
temp[item.name] = item.control.modelValue
temp[item.name] = item.control.modelValue;
}
})
tableDataNew.value.push(jsonParseStringify(temp))
});
tableDataNew.value.push(jsonParseStringify(temp));
}
}
const getText = (text: any,val:any,name:any) => {
};
const getText = (text: any, val: any, name: any) => {
// console.log("text===>",text)
// console.log("name===>",name)
// console.log("val===>",val)
if (typeof text === 'string') {
return text
if (typeof text === "string") {
return text;
} else {
return text && text.toString()
return text && text.toString();
}
}
};
const delColumn = (index: number) => {
tableDataNew.value.splice(index, 1)
}
tableDataNew.value.splice(index, 1);
};
/**
@ 作者: 秦东
@ 时间: 2024-08-02 13:22:14
@ 功能: 时间戳转换对象
*/
const timeToAry = (timestamp:number) => {
const timeToAry = (timestamp: number) => {
const date = new Date(timestamp);
const year = date.getFullYear();
const month = ('0' + (date.getMonth() + 1)).slice(-2);
const day = ('0' + date.getDate()).slice(-2);
const hours = ('0' + date.getHours()).slice(-2);
const minutes = ('0' + date.getMinutes()).slice(-2);
const seconds = ('0' + date.getSeconds()).slice(-2);
const month = ("0" + (date.getMonth() + 1)).slice(-2);
const day = ("0" + date.getDate()).slice(-2);
const hours = ("0" + date.getHours()).slice(-2);
const minutes = ("0" + date.getMinutes()).slice(-2);
const seconds = ("0" + date.getSeconds()).slice(-2);
return {
year:year,
month:month,
day:day,
hours:hours,
minutes:minutes,
seconds
}
}
year: year,
month: month,
day: day,
hours: hours,
minutes: minutes,
seconds,
};
};
/**
@ 作者: 秦东
@ 时间: 2024-08-02 13:02:49
@ 功能: 将时间戳转换成字符串
*/
const timeToString = (timeVal:any,types:int) => {
const timeToString = (timeVal: any, types: int) => {
// console.log("",timeVal,types)
let timeStr = ""
if(Array.isArray(timeVal)){
if(timeVal.length >= 2){
let startTime = timeToAry(timeVal[0])
let endTime = timeToAry(timeVal[1])
switch(types){
let timeStr = "";
if (Array.isArray(timeVal)) {
if (timeVal.length >= 2) {
let startTime = timeToAry(timeVal[0]);
let endTime = timeToAry(timeVal[1]);
switch (types) {
case "year": //
timeStr = `${startTime.year}${endTime.year}`;
break;
@ -110,8 +109,8 @@ const timeToString = (timeVal:any,types:int) => {
timeStr = `${startTime.year}-${startTime.month}-${startTime.day} ${startTime.hours}:${startTime.minutes}:${startTime.seconds}${endTime.year}-${endTime.month}-${endTime.day} ${endTime.hours}:${endTime.minutes}:${endTime.seconds}`;
break;
case "week": //
let startWeek = getYearWeek(startTime)
let endWeek = getYearWeek(endTime)
let startWeek = getYearWeek(startTime);
let endWeek = getYearWeek(endTime);
timeStr = `${startWeek}${endWeek}`;
break;
case "timeCalss": //
@ -130,9 +129,9 @@ const timeToString = (timeVal:any,types:int) => {
timeStr = `${startTime.year}-${startTime.month}-${startTime.day}${endTime.year}-${endTime.month}-${endTime.day}`;
break;
}
}else if(timeVal.length == 1){
let {year,month,day,hours,minutes,seconds} = timeToAry(timeVal[0])
switch(types){
} else if (timeVal.length == 1) {
let { year, month, day, hours, minutes, seconds } = timeToAry(timeVal[0]);
switch (types) {
case "year": //
timeStr = `${year}`;
break;
@ -143,21 +142,21 @@ const timeToString = (timeVal:any,types:int) => {
timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
break;
case "week": //
timeStr = getYearWeek(timeVal)
timeStr = getYearWeek(timeVal);
break;
case "timeCalss": //
timeStr = `${hours}:${minutes}:${seconds}`;
break;
default:
timeStr = `${year}-${month}-${day}`
timeStr = `${year}-${month}-${day}`;
break;
}
}else{
timeStr = "未知时间"
} else {
timeStr = "未知时间";
}
}else{
let {year,month,day,hours,minutes,seconds} = timeToAry(timeVal)
switch(types){
} else {
let { year, month, day, hours, minutes, seconds } = timeToAry(timeVal);
switch (types) {
case "year": //
timeStr = `${year}`;
break;
@ -168,103 +167,107 @@ const timeToString = (timeVal:any,types:int) => {
timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
break;
case "week": //
timeStr = getYearWeek(timeVal)
timeStr = getYearWeek(timeVal);
break;
case "timePicker": //
timeStr = `${hours}:${minutes}:${seconds}`;
break;
default:
timeStr = `${year}-${month}-${day}`
timeStr = `${year}-${month}-${day}`;
break;
}
}
return timeStr
}
return timeStr;
};
/**
@ 作者: 秦东
@ 时间: 2024-10-11 14:49:23
@ 功能: 计算有options属性的结果
*/
const optToString = (timeVal:any,item:any) => {
let timeStr = ""
if(item.options && Array.isArray(item.options)){
if(Array.isArray(timeVal)){
let strArt = new Array
switch(item.type){
const optToString = (timeVal: any, item: any) => {
let timeStr = "";
if (item.options && Array.isArray(item.options)) {
if (Array.isArray(timeVal)) {
let strArt = new Array();
switch (item.type) {
case "radio":
timeVal.forEach((tim:any)=>{
item.options.forEach((it:any)=>{
if(it.value == tim){
strArt.push(it.label)
timeVal.forEach((tim: any) => {
item.options.forEach((it: any) => {
if (it.value == tim) {
strArt.push(it.label);
}
})
})
});
});
break;
case "checkbox":
timeVal.forEach((tim:any)=>{
item.options.forEach((it:any)=>{
if(it.value == tim){
strArt.push(it.label)
timeVal.forEach((tim: any) => {
item.options.forEach((it: any) => {
if (it.value == tim) {
strArt.push(it.label);
}
})
})
});
});
break;
case "select":
timeVal.forEach((tim:any)=>{
item.options.forEach((it:any)=>{
if(it.value == tim){
strArt.push(it.label)
timeVal.forEach((tim: any) => {
item.options.forEach((it: any) => {
if (it.value == tim) {
strArt.push(it.label);
}
})
})
});
});
break;
default:
break;
}
if(strArt.length > 0){
timeStr = strArt.toString()
if (strArt.length > 0) {
timeStr = strArt.toString();
}
}else{
let strArt = new Array
switch(item.type){
} else {
let strArt = new Array();
switch (item.type) {
case "radio":
item.options.forEach((it:any)=>{
if(it.value == timeVal){
strArt.push(it.label)
item.options.forEach((it: any) => {
if (it.value == timeVal) {
strArt.push(it.label);
}
})
});
break;
case "checkbox":
item.options.forEach((it:any)=>{
if(it.value == timeVal){
strArt.push(it.label)
item.options.forEach((it: any) => {
if (it.value == timeVal) {
strArt.push(it.label);
}
})
});
break;
case "select":
item.options.forEach((it:any)=>{
if(it.value == timeVal){
strArt.push(it.label)
item.options.forEach((it: any) => {
if (it.value == timeVal) {
strArt.push(it.label);
}
})
});
break;
default:
break;
}
if(strArt.length > 0){
timeStr = strArt.toString()
if (strArt.length > 0) {
timeStr = strArt.toString();
}
}
}
return timeStr
}
return timeStr;
};
</script>
<template>
<div>
<el-card v-for="(cardItem,cardIndex) in tableDataNew" :key="cardIndex" style="width: 100%;margin-bottom: 10px;" shadow="always">
<el-card
v-for="(cardItem, cardIndex) in tableDataNew"
:key="cardIndex"
style="width: 100%; margin-bottom: 10px"
shadow="always"
>
<!-- {{cardItem}}<br><br><br>
{{data.list}} -->
@ -279,7 +282,9 @@ const optToString = (timeVal:any,item:any) => {
</template>
<template #footer class="footBody">
<div class="footBody">
<el-button link type="danger" @click="delColumn(cardIndex)">{{ data.config.delBtnText }}</el-button>
<el-button link type="danger" @click="delColumn(cardIndex)">{{
data.config.delBtnText
}}</el-button>
</div>
</template>
</el-card>
@ -291,14 +296,14 @@ const optToString = (timeVal:any,item:any) => {
</div>
</div>
</template>
<style lang='scss' scoped>
.cardTable{
<style lang="scss" scoped>
.cardTable {
width: 100%;
margin-bottom: 10px;
}
.footBody{
.footBody {
text-align: right;
deep:el-card__footer{
deep:el-card__footer {
text-align: right;
}
}

61
src/components/DesignForm/tableListPage/index.vue

@ -1504,6 +1504,44 @@ const diGuiJilian = (val: any, options: any[]) => {
});
return dataVal;
};
/**
@ 作者: 秦东
@ 时间: 2024-05-21 16:00:41
@ 功能: 定义自定义表头
*/
const readerColumn = (column: any, isSun: int) => {
console.log("定义自定义表头------------------->", column, isSun);
if (isSun != 1) {
let labelLong = column.label.length; // label
if (column.label.length < 3) {
labelLong = 3;
}
let size = 30; //
return labelLong * size;
} else {
return "100%";
}
};
const readerColumnSun = (column: any) => {
let labelLong = 0; // label
if (column) {
labelLong = column.length;
}
if (labelLong > 0) {
let countLenght = 3;
column.forEach((item: any) => {
if (item.label.length < 3) {
countLenght = countLenght + 90;
} else {
countLenght = countLenght + item.label.length * 40;
}
});
console.log("表头label长度-->", countLenght);
return countLenght;
} else {
return 420;
}
};
</script>
<template>
<div ref="container" v-loading="state.loading" class="table-list-comm">
@ -1865,8 +1903,29 @@ const diGuiJilian = (val: any, options: any[]) => {
v-else-if="item.fieldClass == ''"
:prop="item.field"
:label="item.label"
min-width="320"
:width="readerColumnSun(item.children)"
>
<template #default="scope">
<el-table
v-if="item.pattern == 'table'"
v-bind="data.tableProps"
ref="table"
border
:data="scope.row[item.field]"
>
<template
v-for="sunItem in item.children"
:key="sunItem.id || sunItem.label"
>
<el-table-column
v-if="sunItem.fieldClass == ''"
:prop="sunItem.field"
:label="sunItem.label"
>
</el-table-column>
</template>
</el-table>
</template>
</el-table-column>
<el-table-column
v-else

39
src/components/WangEditor/Untitled-1.html

@ -0,0 +1,39 @@
<template>
<el-table
:data="tableData"
@selection-change="handleSelectionChange"
row-key="id"
>
<el-table-column type="selection" />
<el-table-column prop="name" label="Name" />
</el-table>
<button @click="selectRows([1, 3])">Select Items 1 and 3</button>
</template>
<script setup>
import { ref, nextTick } from 'vue';
const tableData = ref([
{ id: 1, name: 'Item 1' },
{ id: 2, name: 'Item 2' },
{ id: 3, name: 'Item 3' },
]);
const selectedRows = ref([]);
function handleSelectionChange(selection) {
selectedRows.value = selection;
}
async function selectRows(ids) {
// 更新数据中的选中状态
tableData.value = tableData.value.map(item => ({
...item,
selected: ids.includes(item.id),
}));
// 确保el-table更新
await nextTick();
selectedRows.value = tableData.value.filter(item => ids.includes(item.id));
}
</script>

126
src/views/sysworkflow/lowcodepage/appPage/MoveAppMenus.vue

@ -0,0 +1,126 @@
<!--
@ 作者: 秦东
@ 时间: 2025-03-18 14:04:28
@ 备注: 编辑移动菜单弹窗
-->
<script lang="ts" setup>
import { gainAppGroupMenus, moveAppMenus } from "@/api/api/index";
const props = defineProps({
menuInfo: {
type: Object,
default() {
return {};
},
},
show: {
type: Boolean,
default: false,
},
});
const emits = defineEmits(["update:show", "update:appPageKey", "updateMenu"]);
const menuLoading = ref(false);
const menuListLoading = ref(false);
const menuList = ref([]);
const menuInfo = reactive<any>({
menuid: "",
oldmenuid: "",
});
/**
@ 作者: 秦东
@ 时间: 2025-03-18 14:17:55
@ 功能: 获取列表
*/
const appMenusList = () => {
menuListLoading.value = true;
gainAppGroupMenus()
.then((data: any) => {
menuList.value = data.data;
})
.finally(() => {
menuListLoading.value = false;
});
};
watch(
() => props.show,
(val: boolean) => {
menuInfo.menuid = props.menuInfo.id;
menuInfo.oldmenuid = props.menuInfo.id;
if (val) {
appMenusList();
} else {
menuList.value = [];
}
},
{
deep: true,
}
);
onMounted(() => {
nextTick(() => {
menuInfo.menuid = props.menuInfo.id;
menuInfo.oldmenuid = props.menuInfo.id;
appMenusList();
});
});
//
const closeBox = () => {
emits("updateMenu");
emits("update:show", false);
};
const menuTreePropsBut = {
children: "children",
value: "id",
label: "label",
};
/**
@ 作者: 秦东
@ 时间: 2025-03-18 15:00:29
@ 功能: 确定移动
*/
const pickmove = () => {
menuLoading.value = true;
moveAppMenus(menuInfo)
.then((data: any) => {
// menuList.value = data.data;
console.log("确定移动", data);
closeBox();
})
.finally(() => {
menuLoading.value = false;
});
};
</script>
<template>
<el-dialog
v-model="props.show"
title="移动菜单"
width="500"
draggable
:before-close="closeBox"
>
<el-form :model="menuInfo" label-width="auto" style="max-width: 600px">
<el-form-item label="归属于">
<el-tree-select
v-model="menuInfo.menuid"
:data="menuList"
:render-after-expand="false"
filterable
style="width: 240px"
clearable
:props="menuTreePropsBut"
check-strictly
v-loading="menuListLoading"
/>
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button @click="closeBox">取消</el-button>
<el-button v-loading="menuLoading" type="primary" @click="pickmove">
确定
</el-button>
</div>
</template>
</el-dialog>
</template>
<style lang="scss" scoped></style>

34
src/views/sysworkflow/lowcodepage/appPage/appMenus.vue

@ -23,6 +23,7 @@ import AppMenuSvgPage from "@/components/IconSelect/appMenuSvgPage.vue";
import AppMenuGroup from "@/views/sysworkflow/lowcodepage/appPage/appMenuGroup.vue";
import EditAppMenuNamePage from "@/views/sysworkflow/lowcodepage/appPage/editAppMenuNamePage.vue";
import CreateAppFormPage from "@/views/sysworkflow/lowcodepage/appPage/createAppFormPage.vue";
import MoveAppMenus from "@/views/sysworkflow/lowcodepage/appPage/MoveAppMenus.vue";
const props = defineProps({
appCont: {
@ -56,7 +57,17 @@ const props = defineProps({
});
const svgIsShow = ref(false);
const emits = defineEmits(["update:menusTree", "update:appPageKey", "openAppPageForm"]);
const appOenMenu = ref<appMenuTreeInfo>({});
const appOenMenu = ref<appMenuTreeInfo>({
id: "",
label: "",
type: 0,
pcIsShow: 0,
wapIsShow: 0,
parent: "",
appkey: "",
isLock: 0,
sort: 0,
});
/**
@ 作者: 秦东
@ 时间: 2024-04-24 13:17:30
@ -311,6 +322,14 @@ const openAppPage = (val: any) => {
}
}
};
const moveShow = ref(false);
const moveMenuInfo = ref<any>("");
//
const moveMenus = (val: any) => {
console.log("打开移动菜单选项", val);
moveMenuInfo.value = val;
moveShow.value = true;
};
</script>
<template>
<el-tree
@ -350,11 +369,8 @@ const openAppPage = (val: any) => {
<template #dropdown>
<el-dropdown-item @click="editMenuName(data)">修改名称</el-dropdown-item>
<!-- <el-dropdown-item @click="">复制</el-dropdown-item> -->
<!-- <el-dropdown-item @click="moveMenus(data)">移动到</el-dropdown-item> -->
<el-dropdown-item
v-if="data.type == 1"
divided
@click="addNewSunMenuGroup(data)"
<el-dropdown-item @click="moveMenus(data)" divided>移动到</el-dropdown-item>
<el-dropdown-item v-if="data.type == 1" @click="addNewSunMenuGroup(data)"
>新建子分组</el-dropdown-item
>
<!-- <el-dropdown-item @click="">新建普通表单</el-dropdown-item>
@ -407,6 +423,12 @@ const openAppPage = (val: any) => {
:menu-id="creetMenuId"
@gainSunAppContent="gainSunAppContent"
/>
<MoveAppMenus
v-if="moveShow"
v-model:show="moveShow"
:menu-info="moveMenuInfo"
@updateMenu="gainSunAppContent"
/>
</template>
<style lang="scss" scoped>
.appMenuTitle {

546
src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue

@ -3,45 +3,49 @@
@ 时间: 2024-05-18 09:08:21
@ 备注: 展开应用表单
-->
<script lang='ts' setup>
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form'
<script lang="ts" setup>
import {
json2string,
objToStringify,
string2json,
stringToObj,
} from "@/utils/DesignForm/form";
import request from "@/utils/request";
import { gainAppPageInfo,getFieldRecord } from '@/api/DesignForm/requestapi'
import { Edit,Picture as IconPicture } from '@element-plus/icons-vue'
import { appPageDataInit,appWorkFlow } from "@/api/date/type"
import { gainAppPageInfo, getFieldRecord } from "@/api/DesignForm/requestapi";
import { Edit, Picture as IconPicture } from "@element-plus/icons-vue";
import { appPageDataInit, appWorkFlow } from "@/api/date/type";
//
import AppFlowSee from '@/views/sysworkflow/lowcodepage/appPage/appPageForm/appFlow/appFlowSee.vue'
import AppFlowSee from "@/views/sysworkflow/lowcodepage/appPage/appPageForm/appFlow/appFlowSee.vue";
const props = defineProps({
appCont:{
type:Object,
default(){
return {}
}
appCont: {
type: Object,
default() {
return {};
},
formKey:{
type:String,
default:""
},
menusInfo:{
type:Object,
default(){
return {}
}
formKey: {
type: String,
default: "",
},
drawerWith:{
type:Number,
default:0
menusInfo: {
type: Object,
default() {
return {};
},
},
drawerWith: {
type: Number,
default: 0,
},
groupKey: {
type: String,
default: "",
},
groupKey:{
type:String,
default:""
}
});
const appInitData = ref<appPageDataInit>("")
const appInitData = ref<appPageDataInit>("");
//app
const stateForm = reactive<any>({
type: 1, // 123 4 5
@ -49,191 +53,181 @@ const stateForm = reactive<any>({
list: [],
form: {},
config: {},
powerstr:{}
powerstr: {},
},
dict: {},
formId: "1",
id: 0,
formId: 0,
versionId: 0,
loading: true
})
loading: true,
});
//
const stateList = reactive({
tableData: {
// tableProps: {}, //
columns: [],
config: {},
controlBtn:[],
operateBtn:[]
controlBtn: [],
operateBtn: [],
},
searchData: [],
loading: false,
attrObj: {},
config: {
pageSize:10,
searchIsShow:true,
searchFormIsShow:true,
openPageMode:"drawer"
pageSize: 10,
searchIsShow: true,
searchFormIsShow: true,
openPageMode: "drawer",
},
tagList: {},
formId: props.formKey || '',
formId: props.formKey || "",
formList: [], //
name: '',
name: "",
treeData: {}, //
previewVisible: false,
tabsName: 'second',
tabsName: "second",
formFieldList: [], //
formApi:{
type:"1",
addApiUrl:"",
editApiUrl:"",
delApiUrl:"",
lookApiUrl:""
formApi: {
type: "1",
addApiUrl: "",
editApiUrl: "",
delApiUrl: "",
lookApiUrl: "",
},
dict: {},
refreshTable: true,
view:{
list:{
status:true,
isClick:false,
form:{
sortWord:"",
sortClass:1
}
view: {
list: {
status: true,
isClick: false,
form: {
sortWord: "",
sortClass: 1,
},
},
date: {
status: false,
isClick: false,
form: {
startTime: "",
endTime: "",
dayType: 1,
},
},
time: {
status: false,
isClick: false,
form: {
sortWord: "",
sort: 1,
},
},
gantt: {
status: false,
isClick: false,
form: {
startTime: "",
endTime: "",
dayType: 2,
sortWord: "",
sort: 1,
},
},
map: {
status: false,
isClick: false,
form: {
mapWord: "",
sortWord: "",
sort: 1,
},
},
card: {
status: false,
isClick: false,
form: {
sort: 1,
sortWord: "",
imgWork: "",
imgWidth: 50,
imgHeight: 50,
imgBorderRadius: 5,
imgPadding: 2,
titleWork: "",
describe: "",
ranks: 3,
},
date:{
status:false,
isClick:false,
form:{
startTime:"",
endTime:"",
dayType:1
}
}
,
time:{
status:false,
isClick:false,
form:{
sortWord:"",
sort:1
}
}
,
gantt:{
status:false,
isClick:false,
form:{
startTime:"",
endTime:"",
dayType:2,
sortWord:"",
sort:1
}
}
,
map:{
status:false,
isClick:false,
form:{
mapWord:"",
sortWord:"",
sort:1
}
},
card:{
status:false,
isClick:false,
form:{
sort:1,
sortWord:"",
imgWork:"",
imgWidth:50,
imgHeight:50,
imgBorderRadius:5,
imgPadding:2,
titleWork:"",
describe:"",
ranks:3
}
}
}
})
},
});
const versionTitle = ref<string>("") //
const versionId = ref<string>("") //
const appFlowInfo = ref<appWorkFlow>("") //
const versionTitle = ref<string>(""); //
const versionId = ref<string>(""); //
const appFlowInfo = ref<appWorkFlow>(""); //
/**
@ 作者: 秦东
@ 时间: 2024-05-18 09:32:23
@ 功能: 监听菜单传递数据变化
*/
watch(()=>props.menusInfo,(val:appMenuTreeInfo)=>{
watch(
() => props.menusInfo,
(val: appMenuTreeInfo) => {
// console.log("",val)
if(val){
gainAppFormPageInit()
if (val) {
gainAppFormPageInit();
}
},{
deep:true
})
},
{
deep: true,
}
);
const emits = defineEmits(["editAppInfo"]);
/**
@ 作者: 秦东
@ 时间: 2024-05-18 14:04:20
@ 功能: 获取App页面预览信息
*/
const editAppPage = (signCode:string) => {
emits("editAppInfo",signCode)
}
const editAppPage = (signCode: string) => {
emits("editAppInfo", signCode);
};
const activePage = ref(0) //
const activePage = ref(0); //
/**
@ 作者: 秦东
@ 时间: 2024-05-18 10:13:15
@ 功能:
*/
const handleAppPageClick = () =>{
}
const handleAppPageClick = () => {};
/**
@ 作者: 秦东
@ 时间: 2024-05-20 16:15:54
@ 功能: 获取表单初始化信息
*/
const gainAppFormPageInit = () =>{
if(props.menusInfo.id){
gainAppPageInfo({id:props.menusInfo.id})
.then((data)=>{
console.log("获取初始化表单数据",data)
appInitData.value = data.data
if (data.data.page && data.data.pageList && data.data.appFlow){
activePage.value = 1
}else if (data.data.page && !data.data.pageList && data.data.appFlow){
activePage.value = 2
}else if (!data.data.page && !data.data.pageList && data.data.appFlow){
activePage.value = 3
}else if (!data.data.page && data.data.pageList && data.data.appFlow){
activePage.value = 1
}else if (data.data.page && !data.data.pageList && !data.data.appFlow){
activePage.value = 2
}else{
activePage.value = 1
}
versionId.value = data.data.appForm.id.toString()
versionTitle.value = data.data.appForm.name
if(data.data.pageList){
let stateData = string2json(data.data.appForm.listjson)
let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson)
const gainAppFormPageInit = () => {
if (props.menusInfo.id) {
gainAppPageInfo({ id: props.menusInfo.id }).then((data) => {
console.log("获取初始化表单数据", data);
appInitData.value = data.data;
if (data.data.page && data.data.pageList && data.data.appFlow) {
activePage.value = 1;
} else if (data.data.page && !data.data.pageList && data.data.appFlow) {
activePage.value = 2;
} else if (!data.data.page && !data.data.pageList && data.data.appFlow) {
activePage.value = 3;
} else if (!data.data.page && data.data.pageList && data.data.appFlow) {
activePage.value = 1;
} else if (data.data.page && !data.data.pageList && !data.data.appFlow) {
activePage.value = 2;
} else {
activePage.value = 1;
}
versionId.value = data.data.appForm.id.toString();
versionTitle.value = data.data.appForm.name;
if (data.data.pageList) {
let stateData = string2json(data.data.appForm.listjson);
let holeControlAndConfigStateData = string2json(data.data.appForm.mastesformjson);
//console.log(data.data.appForm.mastesform)
//let mastesform = string2json(data.data.appForm.mastesform)
//console.log(mastesform)
@ -241,25 +235,25 @@ const gainAppFormPageInit = () =>{
//console.log(data.data.appForm.mastesformjson)
/*console.log(stateData) */
//options start
//console.log(holeControlAndConfigStateData.list)
for (const element of holeControlAndConfigStateData.list) {
if(element.type == "table"){
if (element.type == "table") {
//console.log(element);
for (const item of element.list){
if(item.options){
if(item.type=="radio"||item.type=="select"||item.type=="checkbox"){
for (const item of element.list) {
if (item.options) {
if (
item.type == "radio" ||
item.type == "select" ||
item.type == "checkbox"
) {
//console.log(item);
let paramx:string = ""+item.control.optionsValue3Field
let paramx: string = "" + item.control.optionsValue3Field;
getFieldRecord(paramx).then(({ data }) => {
//console.log(data)
item.options = data
})
item.options = data;
});
}
}
}
}
@ -270,21 +264,27 @@ const gainAppFormPageInit = () =>{
//data.data.appForm.mastesformjson =
//options end
if(stateData.tableData.columns && stateData.tableData.columns.length>0){
for(let i = 0;i<stateData.tableData.columns.length;i++){
for(let u = 0;u<holeControlAndConfigStateData.list.length;u++){
if(stateData.tableData.columns[i].id==holeControlAndConfigStateData.list[u].name){
stateData.tableData.columns[i].control = holeControlAndConfigStateData.list[u].control
stateData.tableData.columns[i].config = holeControlAndConfigStateData.list[u].config
if (stateData.tableData.columns && stateData.tableData.columns.length > 0) {
for (let i = 0; i < stateData.tableData.columns.length; i++) {
for (let u = 0; u < holeControlAndConfigStateData.list.length; u++) {
if (
stateData.tableData.columns[i].id ==
holeControlAndConfigStateData.list[u].name
) {
stateData.tableData.columns[i].control =
holeControlAndConfigStateData.list[u].control;
stateData.tableData.columns[i].config =
holeControlAndConfigStateData.list[u].config;
}
}
//console.log(stateData.tableData.columns[i])
if(stateData.tableData.columns[i].config!=undefined && stateData.tableData.columns[i].control!=undefined){
if (
stateData.tableData.columns[i].config != undefined &&
stateData.tableData.columns[i].control != undefined
) {
//console.log(stateData.tableData.columns[i])
let paramx:string = ""+stateData.tableData.columns[i].control.optionsValue3Field
let paramx: string =
"" + stateData.tableData.columns[i].control.optionsValue3Field;
/*
在这里请求后台获取字段
let kkk = {
@ -302,32 +302,32 @@ const gainAppFormPageInit = () =>{
}
*/
if(paramx && paramx != "" && paramx != null && paramx != "undefined"){
if (paramx && paramx != "" && paramx != null && paramx != "undefined") {
//console.log(paramx)
getFieldRecord(paramx).then(({ data }) => {
stateData.tableData.columns[i].options = data
if(stateData.searchData.length>0){
for(let j = 0;j<stateData.searchData.length;j++){
stateData.tableData.columns[i].options = data;
if (stateData.searchData.length > 0) {
for (let j = 0; j < stateData.searchData.length; j++) {
//console.log(stateData.searchData[j])
if(stateData.searchData[j].id==stateData.tableData.columns[i].id){
stateData.searchData[j].options = data
if (
stateData.searchData[j].id == stateData.tableData.columns[i].id
) {
stateData.searchData[j].options = data;
}
}
}
})
});
}
if(stateData.searchData && stateData.searchData.length>0){
for(let j = 0;j<stateData.searchData.length;j++){
if (stateData.searchData && stateData.searchData.length > 0) {
for (let j = 0; j < stateData.searchData.length; j++) {
//console.log(stateData.searchData[j])
if(stateData.searchData[j].id==stateData.tableData.columns[i].id){
if (stateData.searchData[j].id == stateData.tableData.columns[i].id) {
//console.log(stateData.tableData.columns[i])
stateData.searchData[j].control = stateData.tableData.columns[i].control
stateData.searchData[j].config = stateData.tableData.columns[i].config
stateData.searchData[j].control =
stateData.tableData.columns[i].control;
stateData.searchData[j].config =
stateData.tableData.columns[i].config;
//console.log(stateData.searchData[j])
}
}
@ -336,51 +336,45 @@ const gainAppFormPageInit = () =>{
}
}
stateList.tableData = stateData.tableData;
stateList.tableData = stateData.tableData
stateList.searchData = stateData.searchData
if(stateList.searchData == null){
stateList.searchData = new Array()
stateList.searchData = stateData.searchData;
if (stateList.searchData == null) {
stateList.searchData = new Array();
}
// console.log("",stateList.searchData)
stateList.loading = stateData.loading
stateList.attrObj = stateData.attrObj
stateList.config = stateData.config
stateList.tagList = stateData.tagList
stateList.formList = stateData.formList
stateList.name = stateData.name
stateList.treeData = stateData.treeData
stateList.previewVisible = stateData.previewVisible
stateList.formFieldList = stateData.formFieldList
stateList.formApi = stateData.formApi
stateList.dict = stateData.dict
stateList.refreshTable = stateData.refreshTable
if(stateData.view){
stateList.view = stateData.view
}
}
if(data.data.page){
stateList.loading = stateData.loading;
stateList.attrObj = stateData.attrObj;
stateList.config = stateData.config;
stateList.tagList = stateData.tagList;
stateList.formList = stateData.formList;
stateList.name = stateData.name;
stateList.treeData = stateData.treeData;
stateList.previewVisible = stateData.previewVisible;
stateList.formFieldList = stateData.formFieldList;
stateList.formApi = stateData.formApi;
stateList.dict = stateData.dict;
stateList.refreshTable = stateData.refreshTable;
if (stateData.view) {
stateList.view = stateData.view;
}
}
if (data.data.page) {
// console.log("data.data.mastesform", data.data)
stateForm.id=data.data.appForm.version.toString()
stateForm.formId =data.data.appForm.cfid.toString()
stateForm.versionId =data.data.appForm.id.toString()
stateForm.formData = stringToObj(data.data.appForm.mastesform)
console.log(stateForm.formData)
stateForm.dict = string2json(data.data.appForm.dict)
stateForm.formData.powerstr = string2json(data.data.appForm.powerstr)
stateForm.id = data.data.appForm.version.toString();
stateForm.formId = data.data.appForm.cfid.toString();
stateForm.versionId = data.data.appForm.id.toString();
stateForm.formData = stringToObj(data.data.appForm.mastesform);
console.log(stateForm.formData);
stateForm.dict = string2json(data.data.appForm.dict);
stateForm.formData.powerstr = string2json(data.data.appForm.powerstr);
}
if(data.data.appFlow){
appFlowInfo.value = data.data.workFlow
if (data.data.appFlow) {
appFlowInfo.value = data.data.workFlow;
}
})
});
}
}
};
//liwenxuan start
@ -393,7 +387,7 @@ interface Tree {
[key: string]: any;
}
const orgAndManTree = ref<Tree[]>();
function getAssociatedFormsOrgAndManTree() {
function getAssociatedFormsOrgAndManTree() {
return request({
url: "/javasys/lowCode/transfer/getOrgAndManTree",
method: "post",
@ -412,11 +406,9 @@ getAssociatedFormsOrgAndManTree().then(({ data }) => {
});
//liwenxuan end
function optionsValue3Get3(data: any,fieldName: string){
function optionsValue3Get3(data: any, fieldName: string) {
//console.log("openAppFormPage","optionsValue3Get3")
/* if(fieldName.startsWith("childTable---")){
let tableAndFieldNameArr = fieldName.split("---")
for(let i = 0; i < stateForm.formData.list.length; i++){
@ -433,24 +425,20 @@ function optionsValue3Get3(data: any,fieldName: string){
}
}else{ */
for(let i = 0; i < stateForm.formData.list.length; i++){
if(stateForm.formData.list[i].name==fieldName){
stateForm.formData.list[i].options = []
for(let j = 0;j<data.length;j++){
stateForm.formData.list[i].options.push(data[j])
for (let i = 0; i < stateForm.formData.list.length; i++) {
if (stateForm.formData.list[i].name == fieldName) {
stateForm.formData.list[i].options = [];
for (let j = 0; j < data.length; j++) {
stateForm.formData.list[i].options.push(data[j]);
}
}
}
//}
}
defineExpose({
gainAppFormPageInit
})
gainAppFormPageInit,
});
/* onMounted(() => {
getAssociatedFormsOrgAndManTree().then(({ data }) => {
let resData = ref(data.children);
@ -498,15 +486,15 @@ defineExpose({
} */
</script>
<template>
<div>
<el-row v-if="props.menusInfo">
<el-col :span="24" class="pageBox pageHeader">
<el-text class="wordFont">{{ props.menusInfo.label }}</el-text>
<el-button type="primary" :icon="Edit" @click="editAppPage(stateForm.formId)">编辑App页面</el-button>
<el-button type="primary" :icon="Edit" @click="editAppPage(stateForm.formId)"
>编辑App页面</el-button
>
</el-col>
<el-col :span="24" class="pageBox baiDiSe">
<el-tabs v-model="activePage" class="demo-tabs" @tab-click="handleAppPageClick">
@ -515,11 +503,11 @@ defineExpose({
<el-tab-pane v-if="appInitData.appFlow" label="流程图" :name="3" />
</el-tabs>
</el-col>
<el-col v-if="activePage!=3" :span="24" class="pageBoxInfo">
<el-col v-if="activePage != 3" :span="24" class="pageBoxInfo">
<el-card class="tispMsg" shadow="always">
<el-scrollbar class="suojing">
<ak-page-list
v-if="activePage==1"
v-if="activePage == 1"
:data="stateList.tableData"
:search-data="stateList.searchData"
:config="stateList.config"
@ -530,11 +518,11 @@ defineExpose({
:viewPage="stateList.view"
:form-basic-config="stateForm.formData.form"
:fields-detail-list="stateForm.formData.list"
:org-and-man-tree = "orgAndManTree"
:org-and-man-tree="orgAndManTree"
@optionsValue5Get5="optionsValue5Get5"
/>
<ak-form
v-if="activePage==2"
v-if="activePage == 2"
ref="formEl"
:numrun="formType"
:form-data="stateForm.formData"
@ -550,22 +538,17 @@ defineExpose({
:save-draft-page="saveDraftPage"
@optionsValue3Get3="optionsValue3Get3"
/>
</el-scrollbar>
</el-card>
</el-col>
<el-col v-else :span="24">
<AppFlowSee
:app-flow-info="appFlowInfo"
/>
<AppFlowSee :app-flow-info="appFlowInfo" />
</el-col>
</el-row>
<el-row v-else>
<el-col :span="24" class="pageBox">
<el-card class="tispMsg" shadow="always">
欢迎使用 {{ props.appCont.appName }}<br>
欢迎使用 {{ props.appCont.appName }}<br />
<div class="demo-image__error">
<el-image :src="props.appCont.appSvg" fit="fit">
<template #error>
@ -580,13 +563,13 @@ defineExpose({
</el-row>
</div>
</template>
<style lang='scss' scoped>
.pageBox{
<style lang="scss" scoped>
.pageBox {
padding: 0 15px;
.wordFont{
.wordFont {
font-size: 20px;
}
.tispMsg{
.tispMsg {
width: 100%;
margin: 10px 0 0 0;
height: calc(100vh - 80px);
@ -597,36 +580,35 @@ defineExpose({
font-size: 20px;
}
}
.pageBoxInfo{
.pageBoxInfo {
padding: 0 15px;
.tispMsg{
.tispMsg {
width: 100%;
margin: 20px 0 0 0;
height: calc(100vh - 175px);
}
:deep .el-card__body{
:deep .el-card__body {
padding: 10px 0;
}
}
.pageHeader{
.pageHeader {
display: flex;
align-items: center;
justify-content: space-between;
background-color: #FFFFFF;
padding:15px 15px 5px 15px;
background-color: #ffffff;
padding: 15px 15px 5px 15px;
}
.baiDiSe{
background-color: #FFFFFF;
border-bottom : 3px solid #dedfe0;
:deep .el-tabs__header{
margin:0px 0 -2px 0;
.baiDiSe {
background-color: #ffffff;
border-bottom: 3px solid #dedfe0;
:deep .el-tabs__header {
margin: 0px 0 -2px 0;
}
}
.suojing{
.suojing {
height: calc(100vh - 135px);
}
.demo-image__error{
.demo-image__error {
margin-top: 15px;
}
.demo-image__error .block {

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

@ -140,6 +140,7 @@ const drawer = reactive<DrawerStruct>({
callback: "",
});
const formFieldAry = ref<string[]>([]);
const sunFormFieldAry = ref<string[]>([]);
//
const searchCheckField = (data: FormData) => {
state.value.formData.list.push(data);
@ -315,6 +316,7 @@ const gainTableForm = () => {
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);
@ -523,6 +525,7 @@ const versionPreviewPage = (val: string) => {
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);
@ -742,6 +745,7 @@ const dialogConfirmTree = (val: treeStruct[], types: string) => {
:form-info="state.formData"
:is-edit="isEdit"
:form-field="formFieldAry"
:sun-form-field="sunFormFieldAry"
@open-dialog="openAceEditDrawer"
@form-name-change="formNameChanged"
/>

185
src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageList.vue

@ -365,7 +365,7 @@ const getListInfo = () => {
// console.log("",data)
if (data.data.listjson != null && data.data.listjson != "") {
let stateData = string2json(data.data.listjson);
// console.log("---->",stateData)
console.log("获取列表内容---->", stateData);
state.tableData = stateData.tableData;
state.searchData = stateData.searchData;
if (state.searchData == null) {
@ -418,9 +418,9 @@ const getListInfo = () => {
}
zhuDaunIsTrue.value = false;
// console.log("====1====>",state.tableData.columns)
// console.log("====2====>",formTableField.masterTable)
// console.log("====3====>",state.searchData)
console.log("====1====>", state.tableData.columns);
console.log("====2====>", formTableField.masterTable);
console.log("====3====>", state.searchData);
if (state.searchData && state.searchData.length > 0) {
if (formTableField.masterTable && formTableField.masterTable.length > 0) {
state.searchData.forEach((itemCol: any) => {
@ -434,6 +434,19 @@ const getListInfo = () => {
});
});
}
if (formTableField.sunFormList && formTableField.sunFormList.length > 0) {
state.searchData.forEach((itemCol: any) => {
formTableField.sunFormList.forEach((item: any) => {
if (item.fields && item.fields.length > 0) {
item.fields.forEach((itemField: any) => {
if (!itemCol.isMsater && itemCol.id == itemField.id) {
itemField.isSearch = true;
}
});
}
});
});
}
}
if (state.tableData.columns && state.tableData.columns.length > 0) {
if (formTableField.masterTable && formTableField.masterTable.length > 0) {
@ -559,8 +572,9 @@ const tableFieldAttrButClick = (val: tableButton[]) => {
@ 功能: 定义自定义表头
*/
const readerColumn = (column: any, isSun: int) => {
console.log("定义自定义表头------------------->", column, isSun);
// console.log("------------------->", column, isSun);
if (isSun != 1) {
if (column.label) {
let labelLong = column.label.length; // label
if (column.label.length < 3) {
labelLong = 3;
@ -570,6 +584,9 @@ const readerColumn = (column: any, isSun: int) => {
} else {
return "100%";
}
} else {
return "100%";
}
};
/**
@ 作者: 秦东
@ -577,8 +594,8 @@ const readerColumn = (column: any, isSun: int) => {
@ 功能: 列表字段处理
*/
const tableListFieldClick = (val: any[]) => {
console.log("列表字段处理-1->", val);
console.log("列表字段处理-2->", state.tableData);
// console.log("-1->", val);
// console.log("-2->", state.tableData);
// zhuDaunIsTrue.value = true
if (zhuDaunIsTrue.value == true) {
if (val.length > 0) {
@ -727,7 +744,6 @@ const addOrDelSearchField = (val: attrButton, tableKey: string, isTrue: boolean)
val.sunFormKey = tableKey;
}
console.log("处理查询条件", state.searchData);
if (isTrue) {
if (state.searchData.length > 0) {
let isWrite = true;
@ -751,6 +767,7 @@ const addOrDelSearchField = (val: attrButton, tableKey: string, isTrue: boolean)
});
}
}
console.log("处理查询条件", state.searchData);
};
/**
@ 作者: 秦东
@ -944,6 +961,132 @@ const dialogConfirm = (editVal: string) => {
//ElMessage.error(res.message)
}
};
//
const isPickField = (val: any, tableKey: string) => {
let isOk = false;
// console.log("", val, tableKey, state.tableData.columns);
if (state.tableData.columns && state.tableData.columns.length > 0) {
state.tableData.columns.forEach((item: any) => {
if (tableKey == item.id) {
// console.log("", item);
if (item.children && item.children.length > 0) {
item.children.forEach((fieldItem: any) => {
if (fieldItem.field == val.field) {
isOk = true;
}
});
}
}
});
}
return isOk;
};
/**
@ 作者: 秦东
@ 时间: 2025-03-13 13:44:32
@ 功能: 添加显示字段
*/
const addListField = (
val: attrButton,
name: string,
tableKey: string,
isTrue: boolean
) => {
// console.log("", tableKey, isTrue, val);
// if (isTrue) {
//
if (state.tableData.columns && state.tableData.columns.length > 0) {
//
let sunIsOk = true;
state.tableData.columns.forEach((item: any, inNum: number) => {
if (item.field == tableKey) {
//
sunIsOk = false;
// console.log("------------------------->", item, inNum);
if (item.children && item.children.length > 0) {
let sunChildIsOk = true; //
item.children.forEach((sunItem: any, index: number) => {
if (sunItem.field == val.field) {
// console.log("-----------1-------------->", sunItem, index);
sunChildIsOk = false;
item.children.splice(index, 1);
}
});
if (sunChildIsOk) {
// console.log("-----------2-------------->", val);
item.children.push(val);
} else {
// console.log("-----------3-------------->", inNum);
if (item.children <= 0) {
// console.log("-----------4-------------->", inNum);
//
state.tableData.columns.splice(inNum, 1);
}
}
} else {
// console.log("-----------5-------------->", val);
//
item.children.push(val);
}
}
});
if (sunIsOk) {
// console.log("-----------6-------------->", val);
//
state.tableData.columns.push({
id: tableKey,
label: name,
field: tableKey,
type: "",
attribute: "",
pattern: "table",
fieldClass: "",
auxiliary: "",
activeValue: "",
inactiveValue: "",
config: {
optionsType: 0,
},
control: {
optionsValue3Formid: "",
optionsValue3Field: "",
},
options: null,
children: [val],
});
}
} else {
// console.log("-----------7-------------->", val);
//
state.tableData.columns.push({
id: tableKey,
label: name,
field: tableKey,
type: "",
attribute: "",
pattern: "table",
fieldClass: "",
auxiliary: "",
activeValue: "",
inactiveValue: "",
config: {
optionsType: 0,
},
control: {
optionsValue3Formid: "",
optionsValue3Field: "",
},
options: null,
children: [val],
});
}
// } else {
// //
// if (state.tableData && state.tableData.length > 0)
// }
// console.log("state.tableData.columns", state.tableData);
};
</script>
<template>
<el-main class="mainBox">
@ -1309,15 +1452,24 @@ const dialogConfirm = (editVal: string) => {
v-for="sunItem in formTableField.sunFormList"
:label="sunItem.name"
>
<el-table
:data="sunItem.fields"
border
@selection-change="
tableSunListFieldClick(sunItem.name, sunItem.fieldKey, $event)
<el-table :data="sunItem.fields" border style="width: 100%">
<el-table-column fixed label="列表" width="55" align="center">
<template #default="scope">
<el-switch
size="small"
:active-action-icon="View"
:inactive-action-icon="Hide"
style="
--el-switch-on-color: #13ce66;
--el-switch-off-color: #ff4949;
"
style="width: 100%"
>
<el-table-column fixed type="selection" width="40" align="center" />
:model-value="isPickField(scope.row, sunItem.fieldKey)"
@change="
addListField(scope.row, sunItem.name, sunItem.fieldKey, $event)
"
/>
</template>
</el-table-column>
<el-table-column prop="label" label="字段">
<template #default="scope">
{{ scope.row.label }}({{ scope.row.field }}[{{ scope.row.pattern }}])
@ -1326,6 +1478,7 @@ const dialogConfirm = (editVal: string) => {
<el-table-column fixed="right" label="查询" width="55" align="center">
<template #default="scope">
<el-switch
size="small"
v-model="scope.row.isSearch"
:active-action-icon="View"
:inactive-action-icon="Hide"

Loading…
Cancel
Save