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. 42
      src/components/DesignForm/assembly/index.ts
  7. 130
      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. 543
      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. 958
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/openAppFormPage.vue
  17. 4
      src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageForm.vue
  18. 197
      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"

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

@ -777,7 +777,7 @@ export default [
config: {
carsuselWidth: 448,
carsuselHeight: 252,
interval: 2000,
interval: 2000,
}
},
@ -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: {}
}
},
]
},
{

130
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":
@ -1168,26 +1180,54 @@ const controlChange = (obj: any, val: any) => {
Array.isArray(props.formField) &&
!props.formField.includes(controlData.value.name)
) {
chineseToPinyin({
title: val,
types: 8,
connector: "",
formJson: JSON.stringify(props.formInfo),
}).then((data: any) => {
if (data.code == 0) {
if (data.data != "") {
if (!fileSignAry.includes(data.data)) {
if (controlData.value.type == "table") {
controlData.value.name = "table_" + data.data;
if (
Array.isArray(props.sunFormField) &&
!props.sunFormField.includes(controlData.value.name)
) {
chineseToPinyin({
title: val,
types: 8,
connector: "",
formJson: JSON.stringify(props.formInfo),
}).then((data: any) => {
if (data.code == 0) {
if (data.data != "") {
if (!fileSignAry.includes(data.data)) {
if (controlData.value.type == "table") {
controlData.value.name = "table_" + data.data;
} else {
controlData.value.name = data.data;
}
fileSignAry.push(data.data);
} else {
controlData.value.name = data.data;
let isEnd = true;
do {
let titleVal = data.data + Rand(10000000, 99999999);
if (!fileSignAry.includes(titleVal)) {
// controlData.value.name = titleVal;
if (controlData.value.type == "table") {
controlData.value.name = "table_" + titleVal;
} else {
controlData.value.name = titleVal;
}
fileSignAry.push(titleVal);
isEnd = false;
}
} while (isEnd);
}
fileSignAry.push(data.data);
} else {
let isEnd = true;
do {
let titleVal = data.data + Rand(10000000, 99999999);
if (!fileSignAry.includes(val)) {
if (controlData.value.type == "table") {
controlData.value.name = "table_" + val;
} else {
controlData.value.name = val;
}
// controlData.value.name = val;
fileSignAry.push(val);
} else {
let titleVal = val + Rand(10000000, 99999999);
if (!fileSignAry.includes(titleVal)) {
// controlData.value.name = titleVal;
if (controlData.value.type == "table") {
@ -1195,36 +1235,13 @@ const controlChange = (obj: any, val: any) => {
} else {
controlData.value.name = titleVal;
}
fileSignAry.push(titleVal);
isEnd = false;
}
} while (isEnd);
}
} else {
if (!fileSignAry.includes(val)) {
if (controlData.value.type == "table") {
controlData.value.name = "table_" + val;
} else {
controlData.value.name = val;
}
// controlData.value.name = val;
fileSignAry.push(val);
} else {
let titleVal = val + Rand(10000000, 99999999);
if (!fileSignAry.includes(titleVal)) {
// controlData.value.name = titleVal;
if (controlData.value.type == "table") {
controlData.value.name = "table_" + titleVal;
} else {
controlData.value.name = titleVal;
}
fileSignAry.push(titleVal);
}
}
}
}
});
});
}
}
}
// chineseToPinyin({title:val,types:8,connector:"",formJson:JSON.stringify(props.formInfo)})
@ -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)){
return true;
// }
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

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

@ -3,303 +3,308 @@
@ 时间: 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: () => {
return {}
}
}
)
const formProps = inject(constFormProps, {}) as any
defineProps<{
data: any;
}>(),
{
data: () => {
return {};
},
}
);
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]
})
// 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];
});
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 = {}
if (props.data.list) {
props.data.list.forEach((item: any) => {
if (item.name) {
temp[item.name] = item.control.modelValue
}
})
tableDataNew.value.push(jsonParseStringify(temp))
}
}
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
} else {
return text && text.toString()
}
}
// console.log("--------->",tableDataNew.value)
const temp: any = {};
if (props.data.list) {
props.data.list.forEach((item: any) => {
if (item.name) {
temp[item.name] = item.control.modelValue;
}
});
tableDataNew.value.push(jsonParseStringify(temp));
}
};
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;
} else {
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 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);
return {
year:year,
month:month,
day:day,
hours:hours,
minutes:minutes,
seconds
}
}
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);
return {
year: year,
month: month,
day: day,
hours: hours,
minutes: minutes,
seconds,
};
};
/**
@ 作者: 秦东
@ 时间: 2024-08-02 13:02:49
@ 功能: 将时间戳转换成字符串
*/
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){
case "year": //
timeStr = `${startTime.year}${endTime.year}`;
break;
case "month": //
timeStr = `${startTime.year}-${startTime.month}${endTime.year}-${endTime.month}`;
break;
case "datetime": //+
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)
timeStr = `${startWeek}${endWeek}`;
break;
case "timeCalss": //
timeStr = `${startTime.hours}:${startTime.minutes}:${startTime.seconds}${endTime.hours}:${endTime.minutes}:${endTime.seconds}`;
break;
case "datetimerange":
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 "daterange":
timeStr = `${startTime.year}-${startTime.month}-${startTime.day}${endTime.year}-${endTime.month}-${endTime.day}`;
break;
case "monthrange":
timeStr = `${startTime.year}-${startTime.month}${endTime.year}-${endTime.month}`;
break;
default:
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){
case "year": //
timeStr = `${year}`;
break;
case "month": //
timeStr = `${year}-${month}`;
break;
case "datetime": //+
timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
break;
case "week": //
timeStr = getYearWeek(timeVal)
break;
case "timeCalss": //
timeStr = `${hours}:${minutes}:${seconds}`;
break;
default:
timeStr = `${year}-${month}-${day}`
break;
}
}else{
timeStr = "未知时间"
}
}else{
let {year,month,day,hours,minutes,seconds} = timeToAry(timeVal)
switch(types){
case "year": //
timeStr = `${year}`;
break;
case "month": //
timeStr = `${year}-${month}`;
break;
case "datetime": //+
timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
break;
case "week": //
timeStr = getYearWeek(timeVal)
break;
case "timePicker": //
timeStr = `${hours}:${minutes}:${seconds}`;
break;
default:
timeStr = `${year}-${month}-${day}`
break;
}
}
return timeStr
}
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) {
case "year": //
timeStr = `${startTime.year}${endTime.year}`;
break;
case "month": //
timeStr = `${startTime.year}-${startTime.month}${endTime.year}-${endTime.month}`;
break;
case "datetime": //+
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);
timeStr = `${startWeek}${endWeek}`;
break;
case "timeCalss": //
timeStr = `${startTime.hours}:${startTime.minutes}:${startTime.seconds}${endTime.hours}:${endTime.minutes}:${endTime.seconds}`;
break;
case "datetimerange":
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 "daterange":
timeStr = `${startTime.year}-${startTime.month}-${startTime.day}${endTime.year}-${endTime.month}-${endTime.day}`;
break;
case "monthrange":
timeStr = `${startTime.year}-${startTime.month}${endTime.year}-${endTime.month}`;
break;
default:
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) {
case "year": //
timeStr = `${year}`;
break;
case "month": //
timeStr = `${year}-${month}`;
break;
case "datetime": //+
timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
break;
case "week": //
timeStr = getYearWeek(timeVal);
break;
case "timeCalss": //
timeStr = `${hours}:${minutes}:${seconds}`;
break;
default:
timeStr = `${year}-${month}-${day}`;
break;
}
} else {
timeStr = "未知时间";
}
} else {
let { year, month, day, hours, minutes, seconds } = timeToAry(timeVal);
switch (types) {
case "year": //
timeStr = `${year}`;
break;
case "month": //
timeStr = `${year}-${month}`;
break;
case "datetime": //+
timeStr = `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
break;
case "week": //
timeStr = getYearWeek(timeVal);
break;
case "timePicker": //
timeStr = `${hours}:${minutes}:${seconds}`;
break;
default:
timeStr = `${year}-${month}-${day}`;
break;
}
}
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){
case "radio":
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)
}
})
})
break;
case "select":
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()
}
}else{
let strArt = new Array
switch(item.type){
case "radio":
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)
}
})
break;
case "select":
item.options.forEach((it:any)=>{
if(it.value == timeVal){
strArt.push(it.label)
}
})
break;
default:
break;
}
if(strArt.length > 0){
timeStr = strArt.toString()
}
}
}
return timeStr
}
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);
}
});
});
break;
case "checkbox":
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);
}
});
});
break;
default:
break;
}
if (strArt.length > 0) {
timeStr = strArt.toString();
}
} else {
let strArt = new Array();
switch (item.type) {
case "radio":
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);
}
});
break;
case "select":
item.options.forEach((it: any) => {
if (it.value == timeVal) {
strArt.push(it.label);
}
});
break;
default:
break;
}
if (strArt.length > 0) {
timeStr = strArt.toString();
}
}
}
return timeStr;
};
</script>
<template>
<div>
<el-card v-for="(cardItem,cardIndex) in tableDataNew" :key="cardIndex" style="width: 100%;margin-bottom: 10px;" shadow="always">
<!-- {{cardItem}}<br><br><br>
<div>
<el-card
v-for="(cardItem, cardIndex) in tableDataNew"
:key="cardIndex"
style="width: 100%; margin-bottom: 10px"
shadow="always"
>
<!-- {{cardItem}}<br><br><br>
{{data.list}} -->
<template v-for="(item, index) in data.list">
<span v-if="item.type === 'index'"></span>
<form-item
v-else
v-model="cardItem[item.name]"
:tProp="`${data.name}.${cardIndex}.${item.name}`"
:data="item"
/>
</template>
<template #footer class="footBody">
<div class="footBody">
<el-button link type="danger" @click="delColumn(cardIndex)">{{ data.config.delBtnText }}</el-button>
</div>
</template>
</el-card>
<div
class="table-btn"
v-if="[1, 2].includes(type as number) && data.config.addBtnText && !editDisabled"
>
<el-button size="small" @click="addColumn">{{ data.config.addBtnText }}</el-button>
</div>
</div>
<template v-for="(item, index) in data.list">
<span v-if="item.type === 'index'"></span>
<form-item
v-else
v-model="cardItem[item.name]"
:tProp="`${data.name}.${cardIndex}.${item.name}`"
:data="item"
/>
</template>
<template #footer class="footBody">
<div class="footBody">
<el-button link type="danger" @click="delColumn(cardIndex)">{{
data.config.delBtnText
}}</el-button>
</div>
</template>
</el-card>
<div
class="table-btn"
v-if="[1, 2].includes(type as number) && data.config.addBtnText && !editDisabled"
>
<el-button size="small" @click="addColumn">{{ data.config.addBtnText }}</el-button>
</div>
</div>
</template>
<style lang='scss' scoped>
.cardTable{
width: 100%;
margin-bottom: 10px;
<style lang="scss" scoped>
.cardTable {
width: 100%;
margin-bottom: 10px;
}
.footBody{
text-align: right;
deep:el-card__footer{
text-align: right;
}
.footBody {
text-align: right;
deep:el-card__footer {
text-align: right;
}
}
</style>

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 {

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

File diff suppressed because it is too large

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"
/>

197
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,14 +572,18 @@ const tableFieldAttrButClick = (val: tableButton[]) => {
@ 功能: 定义自定义表头
*/
const readerColumn = (column: any, isSun: int) => {
console.log("定义自定义表头------------------->", column, isSun);
// console.log("------------------->", column, isSun);
if (isSun != 1) {
let labelLong = column.label.length; // label
if (column.label.length < 3) {
labelLong = 3;
if (column.label) {
let labelLong = column.label.length; // label
if (column.label.length < 3) {
labelLong = 3;
}
let size = 30; //
return labelLong * size;
} else {
return "100%";
}
let size = 30; //
return labelLong * size;
} 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)
"
style="width: 100%"
>
<el-table-column fixed type="selection" width="40" align="center" />
<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;
"
: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