Browse Source

修复子表标签无法设置问题

qin_14
hreenshan112 10 months ago
parent
commit
c877c955b3
  1. 8
      src/components/DesignForm/app/formPage.vue
  2. 3
      src/components/DesignForm/assembly/index.ts
  3. 115
      src/components/DesignForm/formControlPropertiNew.vue
  4. 7
      src/views/hr/archives/index.vue

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

@ -1270,14 +1270,6 @@ watch(
'detail-form': type === 3 || type === 4 || type === 1, 'detail-form': type === 3 || type === 4 || type === 1,
}" }"
> >
<FormGroup
:tableinfo="formData.form"
:numrun="numrun"
:data="formData.list"
:alldata="formData"
@optionsValue3Get2="optionsValue3Get2"
/>
<slot></slot> <slot></slot>
</el-form> </el-form>
</div> </div>

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

@ -658,6 +658,9 @@ export default [
icon: 'table', icon: 'table',
iconFont: 'fa-table', iconFont: 'fa-table',
list: [], list: [],
item:{
label:""
},
tableData: [], // 子表表格列表数据集合 tableData: [], // 子表表格列表数据集合
control: { control: {
border: true border: true

115
src/components/DesignForm/formControlPropertiNew.vue

@ -79,8 +79,8 @@ const { formConfig, formData } = toRefs(props);
const store = useDesignFormStore() as any; const store = useDesignFormStore() as any;
const controlData = computed(() => { const controlData = computed(() => {
// console.log("----------------->",props.formInfo) // console.log("----------------->",props.formInfo)
// console.log("--------1--------->",store.controlAttr) // console.log("--------1--------->", store.controlAttr);
// console.log("---------3-------->",controlData.value.customRules) // console.log("---------3-------->", controlData.value.customRules);
return store.controlAttr; return store.controlAttr;
}); });
//Demo //Demo
@ -291,12 +291,12 @@ const attrList = computed(() => {
} }
} }
// //
// console.log("--->",typeof(controlData.value.customRules)) // console.log("--->", item);
if (typeof controlData.value.customRules == "object") { if (typeof controlData.value.customRules == "object") {
if (Array.isArray(controlData.value.customRules)) { if (Array.isArray(controlData.value.customRules)) {
let otherPick = []; let otherPick = [];
controlData.value.customRules.forEach((item: any) => { controlData.value.customRules.forEach((item: any) => {
// console.log("-1-->",item) // console.log("-1-->", item);
if (item.type == ValidateText.type) { if (item.type == ValidateText.type) {
ValidateText.checkbox = true; ValidateText.checkbox = true;
} else { } else {
@ -317,7 +317,7 @@ const attrList = computed(() => {
ValidateText.checkbox = false; ValidateText.checkbox = false;
radioVerify.type = ""; radioVerify.type = "";
} }
// console.log("-1-->", item);
const temp = reactive<PublicAtrr[]>([ const temp = reactive<PublicAtrr[]>([
{ {
label: "标签名称", label: "标签名称",
@ -1167,14 +1167,25 @@ const controlChange = (obj: any, val: any) => {
if (data.code == 0) { if (data.code == 0) {
if (data.data != "") { if (data.data != "") {
if (!fileSignAry.includes(data.data)) { if (!fileSignAry.includes(data.data)) {
controlData.value.name = data.data; if (controlData.value.type == "table") {
controlData.value.name = "table_" + data.data;
} else {
controlData.value.name = data.data;
}
fileSignAry.push(data.data); fileSignAry.push(data.data);
} else { } else {
let isEnd = true; let isEnd = true;
do { do {
let titleVal = data.data + Rand(10000000, 99999999); let titleVal = data.data + Rand(10000000, 99999999);
if (!fileSignAry.includes(titleVal)) { if (!fileSignAry.includes(titleVal)) {
controlData.value.name = titleVal; // controlData.value.name = titleVal;
if (controlData.value.type == "table") {
controlData.value.name = "table_" + titleVal;
} else {
controlData.value.name = titleVal;
}
fileSignAry.push(titleVal); fileSignAry.push(titleVal);
isEnd = false; isEnd = false;
} }
@ -1182,12 +1193,22 @@ const controlChange = (obj: any, val: any) => {
} }
} else { } else {
if (!fileSignAry.includes(val)) { if (!fileSignAry.includes(val)) {
controlData.value.name = val; if (controlData.value.type == "table") {
controlData.value.name = "table_" + val;
} else {
controlData.value.name = val;
}
// controlData.value.name = val;
fileSignAry.push(val); fileSignAry.push(val);
} else { } else {
let titleVal = val + Rand(10000000, 99999999); let titleVal = val + Rand(10000000, 99999999);
if (!fileSignAry.includes(titleVal)) { if (!fileSignAry.includes(titleVal)) {
controlData.value.name = titleVal; // controlData.value.name = titleVal;
if (controlData.value.type == "table") {
controlData.value.name = "table_" + titleVal;
} else {
controlData.value.name = titleVal;
}
fileSignAry.push(titleVal); fileSignAry.push(titleVal);
} }
} }
@ -1266,6 +1287,7 @@ const Rand = (Min: number, Max: number) => {
const getPropByPath = (obj: any, path: string, val: any) => { const getPropByPath = (obj: any, path: string, val: any) => {
let tempObj = obj; let tempObj = obj;
const keyArr = path.split("."); const keyArr = path.split(".");
console.log("修改指定路径下的值", keyArr, tempObj);
let i = 0; let i = 0;
for (i; i < keyArr.length - 1; i++) { for (i; i < keyArr.length - 1; i++) {
const key = keyArr[i]; const key = keyArr[i];
@ -2154,23 +2176,22 @@ const transferDataSourceOptions = [
//liwenxuan20240313 lowcodeImage end //liwenxuan20240313 lowcodeImage end
//liwenxuan20250103 qrCode start //liwenxuan20250103 qrCode start
let qrCodeImgInside = "" let qrCodeImgInside = "";
const qrCodeInsideDialogFlag = ref(false) const qrCodeInsideDialogFlag = ref(false);
function showQrCodeOutside(){ function showQrCodeOutside() {
alert("暂不支持外部填单") alert("暂不支持外部填单");
} }
function showQrCodeInside(){ function showQrCodeInside() {
//,,app,, //,,app,,
//,,, //,,,
//cfid //cfid
getQrCodeImgInside().then(({ data }) => { getQrCodeImgInside().then(({ data }) => {
qrCodeImgInside = data qrCodeImgInside = data;
if(qrCodeInsideDialogFlag.value==false){ if (qrCodeInsideDialogFlag.value == false) {
//console.log(qrCodeImgInside) //console.log(qrCodeImgInside)
qrCodeInsideDialogFlag.value = true qrCodeInsideDialogFlag.value = true;
} }
}) });
} }
function getQrCodeImgInside() { function getQrCodeImgInside() {
return request({ return request({
@ -2185,12 +2206,13 @@ function getQrCodeImgInside() {
function showQrCodeOutPrintConfig(){ function showQrCodeOutPrintConfig(){
qrCodeOutPrintConfigFlag.value = true qrCodeOutPrintConfigFlag.value = true
} */ } */
function handleMaxSelect(){ function handleMaxSelect() {
//console.log(formData.value.qrCodeShowFields.length) //console.log(formData.value.qrCodeShowFields.length)
if(formData.value.qrCodeShowFields.length>5){ if (formData.value.qrCodeShowFields.length > 5) {
alert("最多可选择5个字段") alert("最多可选择5个字段");
} }
while (formData.value.qrCodeShowFields.length > 5) {// while (formData.value.qrCodeShowFields.length > 5) {
//
formData.value.qrCodeShowFields.pop(); formData.value.qrCodeShowFields.pop();
} }
} }
@ -2201,7 +2223,8 @@ import AssociatedFormsTinyaceRange from "@/widget/associatedforms/associatedForm
import AssociatedFormsFillRole from "@/widget/associatedforms/associatedFormsFillRole.vue"; import AssociatedFormsFillRole from "@/widget/associatedforms/associatedFormsFillRole.vue";
import AssociatedFormsChildFillRole from "@/widget/associatedforms/associatedFormsChildFillRole.vue"; import AssociatedFormsChildFillRole from "@/widget/associatedforms/associatedFormsChildFillRole.vue";
const treeDefaultProps = {// const treeDefaultProps = {
//
children: "children", children: "children",
label: "label", label: "label",
}; };
@ -2503,7 +2526,10 @@ function getAssociatedFormsCurrentFieldTree1() {
(item: { type: string | null }) => item.type != "table" (item: { type: string | null }) => item.type != "table"
); );
resDataNoTableNoAsf = resDataNoTable.filter( resDataNoTableNoAsf = resDataNoTable.filter(
(item: { type: string | null }) => item.type != "associatedForms"&&item.type != "table"&&item.type != "checkbox" (item: { type: string | null }) =>
item.type != "associatedForms" &&
item.type != "table" &&
item.type != "checkbox"
); );
associatedFormsCurrentFormFieldTreeNoTable.value = [ associatedFormsCurrentFormFieldTreeNoTable.value = [
@ -2515,7 +2541,7 @@ function getAssociatedFormsCurrentFieldTree1() {
}, },
]; ];
associatedFormsCurrentFormFieldTreeNoTable1.value = [...resDataNoTable] associatedFormsCurrentFormFieldTreeNoTable1.value = [...resDataNoTable];
let resDataForGlxxsz = ref(data.children.slice(8)); let resDataForGlxxsz = ref(data.children.slice(8));
@ -3342,11 +3368,11 @@ const gainFormGroupList = () => {
.finally(() => { .finally(() => {
loadingmore.value = false; loadingmore.value = false;
console.log("组件加载完毕--------1----------->", formData.value); // console.log("--------1----------->", formData.value);
console.log("组件加载完毕--------2----------->", props.formList); // console.log("--------2----------->", props.formList);
console.log("组件加载完毕--------3----------->", state.dataSourceList); // console.log("--------3----------->", state.dataSourceList);
if (formData.value.dataSource == "yes" && state.dataSourceList.length < 1) { if (formData.value.dataSource == "yes" && state.dataSourceList.length < 1) {
console.log("组件加载完毕--------4----------->", state.dataSourceList); // console.log("--------4----------->", state.dataSourceList);
tableFileList(); tableFileList();
} }
}); });
@ -3446,10 +3472,10 @@ onMounted(() => {
watch( watch(
() => state.tabsName, () => state.tabsName,
(val: string) => { (val: string) => {
console.log("监听字段切换", val); // console.log("", val);
if (val == "first") { if (val == "first") {
if (formData.value.dataSource == "yes" && state.dataSourceList.length < 1) { if (formData.value.dataSource == "yes" && state.dataSourceList.length < 1) {
console.log("组件加载完毕--------4----------->", formData.value); // console.log("--------4----------->", formData.value);
tableFileList(); tableFileList();
} }
} }
@ -3569,7 +3595,7 @@ const requiredText = (val: any) => {
}); });
} }
} }
console.log("判断校验规则-1-->", controlData.value.customRules); // console.log("-1-->", controlData.value.customRules);
}; };
/** /**
@ -4833,10 +4859,10 @@ const updataBase = (val: any) => {
/> />
</el-form-item> </el-form-item>
<el-form-item class="form_cont" label="二维码"> <el-form-item class="form_cont" label="二维码">
<el-switch v-model="formData.qrCodeFlag" /> <el-switch v-model="formData.qrCodeFlag" />
</el-form-item> </el-form-item>
<el-form-item v-if="formData.qrCodeFlag" class="form_cont" label="内部二维码"> <el-form-item v-if="formData.qrCodeFlag" class="form_cont" label="内部二维码">
<el-switch v-model="formData.qrCodeInside" /> <el-switch v-model="formData.qrCodeInside" />
<el-button <el-button
v-if="formData.qrCodeInside" v-if="formData.qrCodeInside"
@ -4847,7 +4873,7 @@ const updataBase = (val: any) => {
查看内部二维码图片 查看内部二维码图片
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="formData.qrCodeFlag" class="form_cont" label="外部二维码"> <el-form-item v-if="formData.qrCodeFlag" class="form_cont" label="外部二维码">
<el-switch v-model="formData.qrCodeOutside" /> <el-switch v-model="formData.qrCodeOutside" />
<el-button <el-button
v-if="formData.qrCodeOutside" v-if="formData.qrCodeOutside"
@ -4858,8 +4884,11 @@ const updataBase = (val: any) => {
查看外部二维码图片 查看外部二维码图片
</el-button> </el-button>
</el-form-item> </el-form-item>
<el-form-item v-if="formData.qrCodeFlag" class="form_cont" label="二维码打印样式"> <el-form-item
v-if="formData.qrCodeFlag"
class="form_cont"
label="二维码打印样式"
>
<!-- <el-button <!-- <el-button
type="primary" type="primary"
text text
@ -4874,14 +4903,17 @@ const updataBase = (val: any) => {
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="formData.qrCodeFlag&&formData.qrCodePrintStyle==2" class="form_cont" label="表格卡片显示字段"> <el-form-item
v-if="formData.qrCodeFlag && formData.qrCodePrintStyle == 2"
class="form_cont"
label="表格卡片显示字段"
>
<el-select <el-select
v-model="formData.qrCodeShowFields" v-model="formData.qrCodeShowFields"
multiple multiple
placeholder="请选择" placeholder="请选择"
style="width: 240px" style="width: 240px"
@change="handleMaxSelect" @change="handleMaxSelect"
> >
<el-option <el-option
v-for="item in associatedFormsCurrentFormFieldTreeNoTable1" v-for="item in associatedFormsCurrentFormFieldTreeNoTable1"
@ -5241,7 +5273,6 @@ const updataBase = (val: any) => {
</el-dialog> </el-dialog>
<!-- 穿梭框设置弹窗 liwenxuan 20240217 end --> <!-- 穿梭框设置弹窗 liwenxuan 20240217 end -->
<!-- 二维码展示弹窗 liwenxuan 20250103 start --> <!-- 二维码展示弹窗 liwenxuan 20250103 start -->
<el-dialog <el-dialog
@ -5254,7 +5285,7 @@ const updataBase = (val: any) => {
style="margin-top: 70px" style="margin-top: 70px"
width="50%" width="50%"
> >
<img :src="qrCodeImgInside" style="width: 50%;height: 50%;" /> <img :src="qrCodeImgInside" style="width: 50%; height: 50%" />
<template #footer> <template #footer>
<div class="dialog-footer"> <div class="dialog-footer">
<el-button type="primary" @click="qrCodeInsideDialogFlag = false"> <el-button type="primary" @click="qrCodeInsideDialogFlag = false">

7
src/views/hr/archives/index.vue

@ -232,7 +232,7 @@ const totalNum = ref<number>();
*/ */
const uploadTrue = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => { const uploadTrue = (response: any, uploadFile: UploadFile, uploadFiles: UploadFiles) => {
excelLoading.value = false; excelLoading.value = false;
// console.log("response",response); console.log("response", response);
// console.log("uploadFile",uploadFile); // console.log("uploadFile",uploadFile);
// console.log("uploadFiles",uploadFiles); // console.log("uploadFiles",uploadFiles);
peopleListAry.push("文件上传成功!开始解析数据并写入数据库!"); peopleListAry.push("文件上传成功!开始解析数据并写入数据库!");
@ -247,6 +247,7 @@ const uploadTrue = (response: any, uploadFile: UploadFile, uploadFiles: UploadFi
rewPunYearsIng.value = response.data.rewPunYearsIng; rewPunYearsIng.value = response.data.rewPunYearsIng;
redisListKey.value = response.data.redisListKey; redisListKey.value = response.data.redisListKey;
totalNum.value = response.data.totalNum; totalNum.value = response.data.totalNum;
// console.log("===>", staffChengji);
insetPeopleCont(); insetPeopleCont();
} }
}; };
@ -267,7 +268,7 @@ const excelUpload = ref<any>();
const excelUploadStaff = ref<any>(); const excelUploadStaff = ref<any>();
const insetPeopleCont = () => { const insetPeopleCont = () => {
// console.log("",jiBuQiVal,totalNum.value) console.log("启动数据写入数据库===============》", jiBuQiVal, totalNum.value);
if (jiBuQiVal < totalNum.value) { if (jiBuQiVal < totalNum.value) {
let sendData = { let sendData = {
meritsYearIng: meritsYearIng.value, meritsYearIng: meritsYearIng.value,
@ -276,7 +277,7 @@ const insetPeopleCont = () => {
number: jiBuQiVal, number: jiBuQiVal,
orgId: tempForm.orgId.toString(), orgId: tempForm.orgId.toString(),
}; };
// console.log("",sendData) console.log("启动数据写入数据库", sendData);
analysisRedisOrgExelect(sendData).then((data: any) => { analysisRedisOrgExelect(sendData).then((data: any) => {
// console.log("11111",data,data.data.msgStr) // console.log("11111",data,data.data.msgStr)
peopleMsg.value.push(data.data.msgStr); peopleMsg.value.push(data.data.msgStr);

Loading…
Cancel
Save