From 3d83e5ad104f19490cce31cec30f1c0309e9a3a0 Mon Sep 17 00:00:00 2001 From: herenshan112 Date: Sat, 12 Apr 2025 10:19:08 +0800 Subject: [PATCH] =?UTF-8?q?AI=E9=85=8D=E7=BD=AEDemo?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/DesignForm/filterUnit.ts | 28 +- .../DesignForm/formControlPropertiNew.vue | 184 +++-- .../workflow/drwer/approverDrawer.vue | 73 +- .../workflow/drwer/promoterDrawer.vue | 717 ++++++++++-------- 4 files changed, 613 insertions(+), 389 deletions(-) diff --git a/src/api/DesignForm/filterUnit.ts b/src/api/DesignForm/filterUnit.ts index 2d02878..7ff71d3 100644 --- a/src/api/DesignForm/filterUnit.ts +++ b/src/api/DesignForm/filterUnit.ts @@ -5,12 +5,34 @@ import { layoutUnit } from "@/api/DesignForm/fieldUnit"; @ 时间: 2025-04-11 15:12:02 @ 功能: 解析出表单可作为AI变量的元素 */ -const analysisFromUnit = (formData:formStruct) => { - console.log("解析出表单可作为AI变量的元素------------>",formData) +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 default { +export { analysisFromUnit } diff --git a/src/components/DesignForm/formControlPropertiNew.vue b/src/components/DesignForm/formControlPropertiNew.vue index 03994d6..50496d0 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, @@ -36,7 +42,6 @@ import { Plus } from "@element-plus/icons-vue"; import Draggable from "vuedraggable-es"; import { dataBaseStruct } from "@/api/date/type"; -import { formStruct } from "@/api/DesignForm/types"; import { analysisFromUnit } from "@/api/DesignForm/filterUnit"; @@ -1866,8 +1871,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"; @@ -1916,7 +1919,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"; @@ -3493,12 +3495,13 @@ const scanTypes = [ let asfs: any[] = []; let asfsExpectCurrent: any[] = []; +const unitFormList = ref([]); watch( () => props.formList, (dataList: any) => { //console.log(dataList) - analysisFromUnit(props.state); + unitFormList.value = analysisFromUnit(props.state); if ( dataList && Array.isArray(dataList) && @@ -5303,52 +5306,69 @@ const libraryList = ref([ AI触发条件设置 - {{ props.state }} - - - - -
{{ llItem.item }}
-
- - - 全部有值 - 任一有值 - 半数以上有值 - - - - - - - - - - 底部展示 - 消息弹出框 - 抽屉 - 消息提示 - 通知框 - - -
-
+
+ + + + + + + + + + + + 全部有值 + 任一有值 + 半数以上有值 + + + + + + + + + + 底部展示 + 消息弹出框 + 抽屉 + 消息提示 + 通知框 + + + + - 添加条件 + 添加条件 + +
@@ -6321,4 +6341,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 @ 备注: 发起人节点操作 --> - -