Browse Source

Merge branch 'qin_v9'

# Conflicts:
#	src/components/DesignForm/app/formPage.vue
qin_v10
hreenshan112 1 year ago
parent
commit
2608604b43
  1. 1
      src/api/DesignForm/fieldUnit.ts
  2. 2126
      src/components/DesignForm/app/formPage.vue
  3. 15
      src/components/DesignForm/app/index.vue
  4. 38
      src/components/DesignForm/formControlPropertiNew.vue
  5. 50
      src/components/DesignForm/public/expand/treeSelect.vue
  6. 3904
      src/components/DesignForm/public/form/form.vue
  7. 25
      src/components/DesignForm/public/form/formItem.vue
  8. 8
      src/components/DesignForm/tableListPage/index.vue
  9. 2
      src/widget/index.ts
  10. 101
      src/widget/systemunit/deptOrgSearch.vue

1
src/api/DesignForm/fieldUnit.ts

@ -4,3 +4,4 @@ export const orgUnit = ["org"]
export const choiceUnit = ["radio"]
export const switchUnit = ["switch"]
export const checkboxUnit = ["checkbox"]
export const orgDeptUnit = ["deptOrg"]

2126
src/components/DesignForm/app/formPage.vue

File diff suppressed because it is too large

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

@ -25,6 +25,7 @@ import {
switchUnit,
orgUnit,
checkboxUnit,
orgDeptUnit,
} from "@/api/DesignForm/fieldUnit";
import type { FormInstance, FormRules, ElNotification } from "element-plus";
import { gainFormPageListCont } from "@/api/DesignForm/requestapi";
@ -183,6 +184,9 @@ const unitIsShow = (val: tableButton, unitName: string) => {
case "checkbox":
return checkboxUnit.includes(unitName);
break;
case "deptOrg":
return orgDeptUnit.includes(unitName);
break;
default:
if (val.fieldClass != "datePicker" && val.fieldClass != "timePicker") {
return inputUnit.includes(unitName);
@ -1005,7 +1009,18 @@ const transformOption = (val: string | number, type?: string) => {
v-if="unitIsShow(item, 'org')"
>
</el-select>
<DeptOrgSearch
v-if="unitIsShow(item, 'deptOrg')"
v-model:model-value="item.value"
/>
</el-form-item>
<!-- <DeptOrgPage
v-if="item.fieldClass === 'deptOrg' && type != 4"
:data="data"
:form-props="formProps"
:tablekey="props.tablekey"
/> -->
</div>
</template>
<div class="group group-btn" v-if="searchData.length">

38
src/components/DesignForm/formControlPropertiNew.vue

@ -499,7 +499,7 @@ const attrList = computed(() => {
value: config.append,
placeholder: "文本后缀",
path: "config.append",
vShow: ["input", "password"],
vShow: ["input", "password", "digitpage"],
},
// {
// label: '',
@ -1364,6 +1364,7 @@ const delSelectOption = (index: number, type?: string) => {
};
//
const addSelectOption = (type: any) => {
// console.log("", controlData.value.type);
if (controlData.value.type === "cascader") {
//
openAttrDialog("cascader", "级联选择器");
@ -1377,14 +1378,43 @@ const addSelectOption = (type: any) => {
});
} else {
let maxVal = 1;
// console.log("-------1---->", maxVal, controlData.value.options);
if (controlData.value.options && controlData.value.options.length > 0) {
let optMax = 1;
controlData.value.options.forEach((item: any) => {
if (item.value >= maxVal) {
maxVal = item.value;
if (item.value * 1 >= optMax) {
optMax = item.value;
}
});
maxVal = maxVal * 1 + 1;
// console.log("-------4---->", maxVal, optMax);
if (maxVal < optMax) {
maxVal = optMax * 1 + 1;
} else {
maxVal = maxVal * 1 + 1;
}
// let isTrue = true;
// controlData.value.options.forEach((item: any) => {
// console.log("-------4---->", maxVal, item.value);
// if (item.value == maxVal) {
// maxVal = item.value;
// isTrue = false;
// }
// });
// if (isTrue) {
// maxVal = maxVal * 1 + 1;
// }
}
// console.log(
// "-------3---->",
// maxVal,
// controlData.value.options.length
// );
controlData.value.options.push({
label: "",
value: maxVal.toString(),

50
src/components/DesignForm/public/expand/treeSelect.vue

@ -0,0 +1,50 @@
<!--
@ 作者: 秦东
@ 时间: 2024-12-03 14:29:45
@ 备注: 树型组件
-->
<script lang="ts" setup>
import { stringToObj } from "@/utils/DesignForm/form";
const props = withDefaults(
defineProps<{
modelValue?: string;
disabled?: boolean;
action?: string;
name?: string;
fileList?: Object;
control?: Object;
config?: Object;
data?: Object;
options?: Object;
}>(),
{}
);
const emits = defineEmits<{
(e: "update:modelValue", value: string): void;
}>();
const value = computed({
get: () => {
console.log("图片上传处理-112->", props.modelValue, stringToObj(props.modelValue));
return stringToObj(props.modelValue);
},
set: (newVal: any) => {
emits("update:modelValue", newVal);
return newVal;
},
});
const handleChange = () => {};
const cascaderProps = {
label: "label",
value: "value",
children: "children",
};
</script>
<template>
<el-tree-select
v-model="value"
:data="props.data"
clearable
:render-after-expand="false"
/>
</template>
<style lang="scss" scoped></style>

3904
src/components/DesignForm/public/form/form.vue

File diff suppressed because it is too large

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

@ -34,6 +34,7 @@ import OrgCitys from "@/components/DesignForm/public/expand/orgCitys.vue";
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 AKSelect from "./select.vue";
import { uploadUrl, getRequest } from "@/api/DesignForm";
@ -211,6 +212,10 @@ const currentComponent = computed(() => {
if (props.data.type === "cascader") {
return markRaw(CascaderPage);
}
if (props.data.type === "treeSelect") {
return markRaw(TreeSelectPage);
}
if (props.data.type === "switch") {
if (typeof props.data.control.activeValue === "number") {
props.data.control.activeValue = props.data.control.activeValue.toString();
@ -222,7 +227,7 @@ const currentComponent = computed(() => {
// if (props.data.type === 'timePicker') {
// props.data.control.valueFormat="timestamp"
// }
// console.log("",props.data)
console.log("自定义组件", props.data.tye);
return `el-${props.data.type}`;
});
//
@ -941,7 +946,9 @@ const judjeCascader = (val: any[], options: any[]) => {
if (val && val.length < 0) return "";
let valAry = stringToObj(val);
console.log("获取级联选择值", stringToObj(val), val.length, options);
if (!Array.isArray(valAry)) return "";
if (!Array.isArray(valAry)) {
return diGuiJilian(val, options);
}
let title = "";
valAry.forEach((item: any) => {
// console.log("item", item);
@ -991,7 +998,13 @@ const diGuiJilian = (val: any, options: any[]) => {
v-if="judgeIsShow(data.name) && data.type === 'baidumap' && type != 4"
:data="data"
/>
<!--所属部门-->
<DeptOrgPage
v-if="judgeIsShow(data.name) && data.type === 'deptOrg' && type != 4"
:data="data"
:form-props="formProps"
:tablekey="props.tablekey"
/>
<!--拥有者-->
<OwnerPage
v-else-if="judgeIsShow(data.name) && data.type === 'owner'"
@ -1077,7 +1090,8 @@ const diGuiJilian = (val: any, options: any[]) => {
data.type != 'lowcodeCarsusel' &&
data.type != 'signaturemap' &&
data.type != 'signaturemap' &&
data.type != 'urllink'
data.type != 'urllink' &&
data.type != 'deptOrg'
"
:disabled="judgeIsDisabled(data.name)"
:prop="tProp || data.name"
@ -1117,6 +1131,9 @@ const diGuiJilian = (val: any, options: any[]) => {
<div class="form-value" v-else-if="data.type == 'cascader'">
{{ judjeCascader(value, data.options) }}
</div>
<div class="form-value" v-else-if="data.type == 'treeSelect'">
{{ judjeCascader(value, data.control.data) }}
</div>
<div class="form-value" v-else-if="data.type == 'colorPicker'">
<div :style="'width:20px; height:20px; background-color:' + value + ';'"></div>
</div>

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

@ -25,6 +25,7 @@ import {
switchUnit,
orgUnit,
checkboxUnit,
orgDeptUnit,
} from "@/api/DesignForm/fieldUnit";
import type { FormInstance, FormRules, ElNotification } from "element-plus";
import { gainFormPageListCont } from "@/api/DesignForm/requestapi";
@ -179,6 +180,9 @@ const unitIsShow = (val: tableButton, unitName: string) => {
case "checkbox":
return checkboxUnit.includes(unitName);
break;
case "deptOrg":
return orgDeptUnit.includes(unitName);
break;
default:
if (val.fieldClass != "datePicker" && val.fieldClass != "timePicker") {
return inputUnit.includes(unitName);
@ -989,6 +993,10 @@ const diGuiJilian = (val: any, options: any[]) => {
v-if="unitIsShow(item, 'org')"
>
</el-select>
<DeptOrgSearch
v-if="unitIsShow(item, 'deptOrg')"
v-model:model-value="item.value"
/>
</el-form-item>
</div>
</template>

2
src/widget/index.ts

@ -22,6 +22,7 @@ import FounderTime from './systemunit/founderTime.vue'
import EditTime from './systemunit/editTime.vue'
import OwnerPage from './systemunit/ownerPage.vue'
import DeptOrgPage from './systemunit/deptOrgPage.vue'
import DeptOrgSearch from './systemunit/deptOrgSearch.vue'
import Editor from "@/components/WangEditor/index.vue";
// import { QuillEditor } from '@vueup/vue-quill'
@ -49,6 +50,7 @@ export default (app: any) => {
app.component('EditTime',EditTime) //创建时间主键
app.component('OwnerPage',OwnerPage) //选择拥有者
app.component('DeptOrgPage',DeptOrgPage) //所属部门
app.component('DeptOrgSearch',DeptOrgSearch) //所属部门
app.component('Editor', Editor) //Editor富文本
}

101
src/widget/systemunit/deptOrgSearch.vue

@ -0,0 +1,101 @@
<!--
@ 作者: 秦东
@ 时间: 2024-12-05 09:26:54
@ 备注: 搜索用部门
-->
<script lang="ts" setup>
import { orgAndPeople } from "@/api/displayboardapi/types";
import { getPeopleKey, getUserCont } from "@/api/hr/people/index";
import { govthree } from "@/api/opk/opk/api";
const props = withDefaults(
defineProps<{
modelValue: any; //
}>(),
{}
);
const emits = defineEmits(["update:modelValue"]);
const orgList = ref<orgAndPeople[]>();
const orgLoading = ref(false);
const orgTree = {
label: "name",
children: "child",
};
const value = computed({
get() {
console.log("行政组织-1--》", props.modelValue);
if (
props.modelValue != "" &&
props.modelValue != undefined &&
props.modelValue != null
) {
return props.modelValue * 1;
} else {
return props.modelValue;
}
},
set(newVal: any) {
emits("update:modelValue", newVal);
// updateModel(newVal)
return newVal;
},
});
onMounted(() => {
orgLoading.value = true;
getUserCont()
.then((data: any) => {
let orgId = data.data.organization * 1;
let companyId = data.data.company * 1;
if (companyId == null || companyId == "" || companyId == "0" || companyId == 0) {
companyId = 309;
}
if (orgId == null || orgId == "" || orgId == "0" || orgId == 0) {
orgId = "";
}
nextTick(() => {
govthree({ id: companyId, all: 1 })
.then(({ data }) => {
orgList.value = data;
if (
Number.isNaN(value.value) ||
isNaN(value.value) ||
value.value == null ||
value.value == "" ||
value.value == "0" ||
value.value == 0 ||
value.value == undefined
) {
nextTick(() => {
value.value = orgId;
console.log("行政组织---》", orgId, value.value);
});
}
})
.finally(() => {
orgLoading.value = false;
});
});
})
.finally(() => {
orgLoading.value = false;
});
});
</script>
<template>
<el-tree-select
v-loading="orgLoading"
element-loading-text="Loading..."
v-model="value"
:data="orgList"
:props="orgTree"
:render-after-expand="false"
:filterable="true"
node-key="id"
clearable
check-strictly
style="width: 140px"
/>
</template>
<style lang="scss" scoped></style>
Loading…
Cancel
Save