diff --git a/src/api/DesignForm/fieldUnit.ts b/src/api/DesignForm/fieldUnit.ts index 903c2bf..ef41804 100644 --- a/src/api/DesignForm/fieldUnit.ts +++ b/src/api/DesignForm/fieldUnit.ts @@ -5,3 +5,4 @@ export const choiceUnit = ["radio"] export const switchUnit = ["switch"] export const checkboxUnit = ["checkbox"] export const orgDeptUnit = ["deptOrg"] +export const layoutUnit = ["grid","card","flex","div","tabs","divider","title","button","lowcodeImage","videoUpAndPlay","table","baidumap","lowcodeCarsusel","signaturemap","component"] diff --git a/src/api/DesignForm/filterUnit.ts b/src/api/DesignForm/filterUnit.ts new file mode 100644 index 0000000..7ff71d3 --- /dev/null +++ b/src/api/DesignForm/filterUnit.ts @@ -0,0 +1,38 @@ +import { formStruct } from "@/api/DesignForm/types"; +import { layoutUnit } from "@/api/DesignForm/fieldUnit"; +/** +@ 作者: 秦东 +@ 时间: 2025-04-11 15:12:02 +@ 功能: 解析出表单可作为AI变量的元素 +*/ +const analysisFromUnit = (unitInfo:formStruct) => { + console.log("解析出表单可作为AI变量的元素------------>",unitInfo) + let optionsInfo = new Array + if(unitInfo.formData&&unitInfo.formData.list && unitInfo.formData.list.length>0 ){ + unitInfo.formData.list.forEach((item:any) => { + // console.log("解析出表单可作为AI变量的元素------1---1--->",item.label?1:2) + if(!layoutUnit.includes(item.type)){ + let labelName = "" + if(item.label){ + labelName = item.label + }else if(item.item && item.item.label){ + labelName = item.item.label + }else{ + labelName = item.unitName + } + console.log("解析出表单可作为AI变量的元素----2--1-1----->",item) + optionsInfo.push({ + label:labelName, + value:item.name + }) + } + }) + } + return optionsInfo +} + + + +export { + analysisFromUnit +} diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index a5f78d0..9db5d45 100644 --- a/src/components/DesignForm/formControlPropertiNew.vue +++ b/src/components/DesignForm/formControlPropertiNew.vue @@ -13,7 +13,13 @@ import validateInt from "./validateInt"; import { ValidateTextTypes } from "@/components/DesignForm/validateText"; import { ElMessage } from "element-plus"; import { formatNumber } from "@/api/DesignForm/utils"; -import { PublicAtrr } from "@/api/DesignForm/types"; +import { + PublicAtrr, + formStruct, + CarsuselConfig, + VideoMsg, + optionsInfo, +} from "@/api/DesignForm/types"; import { chineseToPinyin, @@ -37,6 +43,8 @@ import { Plus } from "@element-plus/icons-vue"; import Draggable from "vuedraggable-es"; import { dataBaseStruct } from "@/api/date/type"; +import { analysisFromUnit } from "@/api/DesignForm/filterUnit"; + const props = withDefaults( //接收父级参数 defineProps<{ @@ -49,6 +57,7 @@ const props = withDefaults( isEdit: boolean; formField: any[]; sunFormField: any[]; + state: formStruct; }>(), { formConfig: () => { @@ -805,14 +814,14 @@ const attrList = computed(() => { vShow: ["videoUpAndPlay"], }, { - label: '默认图片', - value: config.lowcodeImage, - path: 'config.lowcodeImage', - type: 'lowcodeImage_url', - vIf: state.isSearch, - vShow: ['lowcodeImage'] - }, - /*{ + label: "默认图片", + value: config.lowcodeImage, + path: "config.lowcodeImage", + type: "lowcodeImage_url", + vIf: state.isSearch, + vShow: ["lowcodeImage"], + }, + /*{ label: '尺寸', value: config.lowcodeImage, path: 'config.lowcodeImage', @@ -1874,8 +1883,6 @@ const updataDigit = (key: string, val: any) => { }; //liwenxuan 20240108 vidioupload start - -import { VideoMsg } from "@/api/DesignForm/types"; import { genFileId } from "element-plus"; import type { UploadInstance, UploadProps, UploadRawFile } from "element-plus"; @@ -1924,7 +1931,6 @@ function videoUploadErr(error: Error, uploadFile: UploadFile, uploadFiles: Uploa //liwenxuan 20240111 carousel start import { Delete } from "@element-plus/icons-vue"; -import { CarsuselConfig } from "@/api/DesignForm/types"; import errimg from "@/assets/404_images/untilUploadImg.png"; import { v4 as uuidv4 } from "uuid"; @@ -2369,10 +2375,10 @@ function formidChanged() { ); //console.log(dataExceptChild) //dataExceptChild = removeFirstNumElements(dataExceptChild, 8); - - dataExceptChild.splice(0, 2); - dataExceptChild.splice(2, 4); + dataExceptChild.splice(0, 2); + + dataExceptChild.splice(2, 4); dataOnlyChild = dataOnlyChild.filter( (obj: { type: string }) => obj.type == "table" @@ -2572,32 +2578,30 @@ function getAssociatedFormsCurrentFieldTree1() { disabled: true, }, ]; - + //liwenxuan 关联选项设置对子表不生效的bug修复 start 250409 let resDataHasTableButNoTableChild = JSON.parse(JSON.stringify(data.children)); - resDataHasTableButNoTableChild.splice(0,2); - resDataHasTableButNoTableChild.splice(2,4); + resDataHasTableButNoTableChild.splice(0, 2); + resDataHasTableButNoTableChild.splice(2, 4); resDataHasTableButNoTableChild.forEach((element: any) => { - if(element.type&&element.type=="table"){ - element.children = [] - element.disabled = false + if (element.type && element.type == "table") { + element.children = []; + element.disabled = false; } - let currentIdArr = element.id.split(":") + let currentIdArr = element.id.split(":"); //console.log(currentIdArr) - let currentId = currentIdArr[currentIdArr.length-1] + let currentId = currentIdArr[currentIdArr.length - 1]; //console.log(currentId) - - if(currentId==controlData.value.name){ + + if (currentId == controlData.value.name) { /* alert(currentId) console.log(currentId) */ - element.disabled = true + element.disabled = true; } }); - //liwenxuan 关联选项设置对子表不生效的bug修复 end 250409 - resDataNoTable = resDataNoTable.filter( (item: { type: string | null }) => item.type != "table" ); @@ -2650,37 +2654,35 @@ function getAssociatedFormsCurrentFieldTree1() { }); } function removeTreeNode(tree: any, targetId: any) { - // 深拷贝原始树结构避免污染原数据 - const clonedTree = JSON.parse(JSON.stringify(tree)); - - // 递归处理节点 - function processNode(node) { - // 命中目标节点时返回null进行过滤 - if (node.id === targetId) return null; - - // 递归处理子节点并过滤空值 - if (node.children?.length) { - node.children = node.children - .map(child => processNode(child)) - .filter(Boolean); - } + // 深拷贝原始树结构避免污染原数据 + const clonedTree = JSON.parse(JSON.stringify(tree)); + + // 递归处理节点 + function processNode(node) { + // 命中目标节点时返回null进行过滤 + if (node.id === targetId) return null; - return node; + // 递归处理子节点并过滤空值 + if (node.children?.length) { + node.children = node.children.map((child) => processNode(child)).filter(Boolean); } - // 处理单根或多根树结构 - const result = Array.isArray(clonedTree) - ? clonedTree.map(node => processNode(node)).filter(Boolean) - : processNode(clonedTree); + return node; + } + + // 处理单根或多根树结构 + const result = Array.isArray(clonedTree) + ? clonedTree.map((node) => processNode(node)).filter(Boolean) + : processNode(clonedTree); - return result || null; + return result || null; } const customerFormTree = ref(); getCustomerFormList().then(({ data }) => { /* console.log(data.children) console.log(props.customerformid) */ - let datachildrenWithoutSelf = removeTreeNode(data.children,props.customerformid) + let datachildrenWithoutSelf = removeTreeNode(data.children, props.customerformid); let resData = ref(datachildrenWithoutSelf); customerFormTree.value = [ { @@ -3332,8 +3334,8 @@ watch( ) ); } else { - console.log(changedOptions) - console.log(controlData.value.control.glxxsz) + console.log(changedOptions); + console.log(controlData.value.control.glxxsz); for (var i = 0; i < changedOptions.length; i++) { if (controlData.value.control.glxxsz[i] === undefined) { //新增了某个option @@ -3505,12 +3507,13 @@ const scanTypes = [ let asfs: any[] = []; let asfsExpectCurrent: any[] = []; +const unitFormList = ref([]); watch( () => props.formList, (dataList: any) => { //console.log(dataList) - + unitFormList.value = analysisFromUnit(props.state); if ( dataList && Array.isArray(dataList) && @@ -3593,6 +3596,7 @@ watch( onMounted(() => { gainFormGroupList(); + analysisFromUnit(props.state); }); watch( @@ -3942,6 +3946,43 @@ const updataBase = (val: any) => { // console.log("设定关联数据------2-------》", val.fields); // console.log("设定关联数据------3-------》", state.dataSourceList); }; +//添加条件 +const addPickTracn = () => { + if (props.formInfo.aiConfig) { + props.formInfo.aiConfig.push({ + title: [], + trigger: 1, + openShowType: 1, + }); + } else { + props.formInfo.aiConfig = [ + { + title: [], + trigger: 1, + openShowType: 1, + }, + ]; + } +}; +/** +@ 作者: 秦东 +@ 时间: 2025-04-10 08:12:21 +@ 功能: 知识库 +*/ +const libraryList = ref([ + { + label: "法律法规", + value: 1, + }, + { + label: "安全环保", + value: 2, + }, + { + label: "员工守则", + value: 3, + }, +]); @@ -6239,4 +6353,66 @@ li::before { justify-content: space-between; align-items: center; } + +.common-layout { + width: 100%; + height: calc(100vh - 170px); + :deep .el-header { + padding: 0px; + } + :deep .el-main { + padding: 10px; + } + + .asideBox { + height: calc(100vh - 170px); + } + .aiButs { + width: 94%; + margin-left: 3%; + } + .contBox { + border-right: 1px solid #ccc; + } + .titleBox { + width: 100%; + height: 40px; + border-bottom: 1px solid #ccc; + display: flex; + align-items: center; + } + .rowBox { + width: 100%; + text-align: center; + } +} +.aiBox { + width: 100%; + + height: calc(100vh - 170px); + .aiBut { + width: 94%; + margin-bottom: 15px; + margin-left: 3%; + } + :deep .el-card__header { + padding: 5px 10px; + border: 0; + i { + color: #ff0000; + } + } + :deep .el-card__body { + padding: 0px 10px 10px 10px; + } +} +.aiCardBox { + width: 94%; + margin-top: 15px; + margin-bottom: 15px; + margin-left: 3%; +} +.card-header { + text-align: right; +} diff --git a/src/components/workflow/drwer/approverDrawer.vue b/src/components/workflow/drwer/approverDrawer.vue index d72a760..ea444cb 100644 --- a/src/components/workflow/drwer/approverDrawer.vue +++ b/src/components/workflow/drwer/approverDrawer.vue @@ -19,7 +19,8 @@ import { govthree } from "@/api/opk/opk/api"; import PositionDialog from "@/components/workflow/dialog/positionDialog.vue"; import FormWord from "@/components/workflow/dialog/formWord.vue"; import MatrixPage from "@/components/workflow/dialog/matrix.vue"; - +import { formTableField } from "@/api/DesignForm/type"; +import { gainFormTableField } from "@/api/DesignForm/requestapi"; import { matrixInfo } from "@/api/matrixapi/type"; let props = defineProps({ @@ -263,6 +264,7 @@ const saveApprover = () => { // console.log("正确---->",item.nodeKey) if (item.nodeKey == approverConfig1.value.value.nodeNumber) { item.powerAry = powerAry; + item.apiSetup = apiSetup; isNew = false; } }); @@ -270,6 +272,7 @@ const saveApprover = () => { formData.value.purview.push({ nodeKey: approverConfig1.value.value.nodeNumber, powerAry: powerAry, + apiSetup: apiSetup, }); } } else { @@ -277,6 +280,7 @@ const saveApprover = () => { { nodeKey: approverConfig1.value.value.nodeNumber, powerAry: powerAry, + apiSetup: apiSetup, }, ]; } @@ -317,6 +321,8 @@ const sureFormTableApprover = (data: any) => { const updateMatrix = (val: any) => { approverConfig.value.matrix = val; }; + +const formTableFielding = reactive({}); /** @ 作者: 秦东 @ 时间: 2024-03-13 08:24:54 @@ -332,6 +338,14 @@ const jieForm = () => { powerUnitAry.value = data.data; } }); + + if (props.customerFormKey != "") { + gainFormTableField({ id: props.customerFormKey.toString() }).then((data) => { + // console.log('解析表单--->',data) + formTableFielding.masterTable = data.data.masterTable; + formTableFielding.sunTable = data.data.sunTable; + }); + } }; watch( @@ -546,6 +560,30 @@ const setOrgTree = (val: any) => { flowOrgTree.value!.setCheckedKeys([val], true); } }; + +const apiSetup = reactive({ + title: [], + library: [], +}); +/** +@ 作者: 秦东 +@ 时间: 2025-04-10 08:12:21 +@ 功能: 知识库 +*/ +const libraryList = ref([ + { + label: "法律法规", + value: 1, + }, + { + label: "安全环保", + value: 2, + }, + { + label: "员工守则", + value: 3, + }, +]);
+ AI触发条件设置 + + + + + + + + + + + +
diff --git a/src/components/workflow/drwer/promoterDrawer.vue b/src/components/workflow/drwer/promoterDrawer.vue index b00e68d..7cd6860 100644 --- a/src/components/workflow/drwer/promoterDrawer.vue +++ b/src/components/workflow/drwer/promoterDrawer.vue @@ -3,217 +3,225 @@ @ 时间: 2023-10-11 08:39:10 @ 备注: 发起人节点操作 --> - - diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/aiPage.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/aiPage.vue index 41b7fe7..c97fd4c 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/aiPage.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/aiPage.vue @@ -56,18 +56,27 @@ const aiList = reactive([ const aiFormField = ref([]); //添加条件 const addPickTracn = () => { - aiList.push({ - title: "", - trigger: 1, - openShowType: 1, - }); - props.state.formData.aiConfig = aiList; + if (props.state.formData.aiConfig) { + props.state.formData.aiConfig.push({ + title: "", + trigger: 1, + openShowType: 1, + }); + } else { + props.state.formData.aiConfig = [ + { + title: "", + trigger: 1, + openShowType: 1, + }, + ]; + } }; //删除条件 const delList = (index: number) => { console.log("删除条件=========>", index); - if (aiList && aiList.length > 0) { - aiList.splice(index, 1); + if (props.state.formData.aiConfig && props.state.formData.aiConfig.length > 0) { + props.state.formData.aiConfig.splice(index, 1); } }; /** @@ -107,6 +116,15 @@ const jieForm = () => { onMounted(() => { jieForm(); }); +/** +@ 作者: 秦东 +@ 时间: 2025-04-10 13:56:29 +@ 功能: 发布 +*/ +const sendPickTracn = () => { + console.log("发布---------------------->", props); + // props.state.formData.aiConfig = aiList; +};