Browse Source

更新下拉列表的取值

zhang_qk 2 months ago
parent
commit
cacd03d9fa

+ 2 - 2
Procedure/backend/project/src/main/java/com/sundata/product/rwa/dataquality/action/DataScopeManageAction.java

@@ -67,7 +67,7 @@ public class DataScopeManageAction  extends BaseAction {
     public void createRowData(HttpServletRequest request, HttpServletResponse response,
                             @RequestBody TableRelationDefineModel model) {
         String sd = Arrays.toString(model.getEnglishSourceTableName());
-        String sd2 = Arrays.toString(model.getEnglishSourceTableName());
+        String sd2 = Arrays.toString(model.getEnglishTargetTableName());
         String sd1 = sd.replace("[","").replace("]","");
         String sd3 = sd2.replace("[","").replace("]","");
         model.setEnglishSourceTableNames(sd1);
@@ -137,7 +137,7 @@ public class DataScopeManageAction  extends BaseAction {
     public void updateRowData(HttpServletRequest request, HttpServletResponse response,
                               @RequestBody TableRelationDefineModel model) {
         String sd = Arrays.toString(model.getEnglishSourceTableName());
-        String sd2 = Arrays.toString(model.getEnglishSourceTableName());
+        String sd2 = Arrays.toString(model.getEnglishTargetTableName());
         String ss = Arrays.toString(model.getRiskCategorys());
         String sd1 = sd.replace("[","").replace("]","");
         String sd3 = sd2.replace("[","").replace("]","");

+ 8 - 6
Procedure/frontend/projectb/src/pages/product/dataquality/dataqualityruledefine.tsx

@@ -10,6 +10,7 @@ import { ProductProps } from "@/sundataImport";
 import { ReportCalculationModel } from "@/services/rwa/product/report_form_config_reportcreater/reportfillingconfig";
 import { useModel } from "@umijs/max";
 import { countChineseChars } from "@/services/rwa/product/rwacheckutils";
+import { replace } from "lodash";
 type widowRush = {
   onCancel:  () => void;
   onChangeVisible(visible: boolean, type: string): unknown;
@@ -25,7 +26,7 @@ const dataqualityruledefine : React.FC<widowRush> = (prop:widowRush) => {
     /** 表格引用对象,刷新表格使用   */
     const actionRef = useRef<ActionType>();
     const formRef = useRef<FormInstance<any>>();
-    const templateRef = useRef<FormInstance<any>>();
+    const formRef1 = useRef<FormInstance<any>>();
 
 
     // 页面数据
@@ -41,9 +42,10 @@ const dataqualityruledefine : React.FC<widowRush> = (prop:widowRush) => {
     // 修改查询查询
     const selectData = async (formdata : DataQualityRuleDefineModel) => {
       const data = await selectDetailData(formdata);
-      formRef.current?.setFieldValue("checkTableName",data.checkTableNames);
+      const checkTableName1 = data.checkTableNames.replace(/ /g,'')//去除空格
+      formRef1.current?.setFieldValue("checkTableName",checkTableName1);
       const {checkTableName,...data1} =data
-      formRef.current?.setFieldsValue(data1);
+      formRef1.current?.setFieldsValue(data1);
      }
 
     // 删除
@@ -162,7 +164,7 @@ const dataqualityruledefine : React.FC<widowRush> = (prop:widowRush) => {
               onClick={
                 ()=>{ 
                 selectData(record);
-                setCurrentRow(record);
+              //  setCurrentRow(record);
                 setDetailVisible(true);
                 setEditType('update');
                } }
@@ -236,7 +238,7 @@ const dataqualityruledefine : React.FC<widowRush> = (prop:widowRush) => {
           visible={detailVisible}
           onVisibleChange={() => {setDetailVisible(false)}}
           footer={[
-          <SDSubmitButton  editType={editType}  successMessage='' formRef={formRef} doSubmit={handleSave} >保存</SDSubmitButton>,
+          <SDSubmitButton  editType={editType}  successMessage='' formRef={formRef1} doSubmit={handleSave} >保存</SDSubmitButton>,
           <SDButton
             key="closeUpdate"
             successMessage=''
@@ -245,7 +247,7 @@ const dataqualityruledefine : React.FC<widowRush> = (prop:widowRush) => {
             }}>关闭</SDButton>
           ]}
           tableRef={actionRef}
-          formRef={formRef}
+          formRef={formRef1}
         >
             <SDAreaTtile title='规则信息'/>
             <SDFormText name="checkRuleNo" readonlyCond="update" required={true} label="规则编号" rules={[{max:60,message:'最多50个字符'}]}/>

+ 19 - 19
Procedure/frontend/projectb/src/pages/product/dataquality/datascopemanage.tsx

@@ -48,6 +48,7 @@ const datascopemanage : React.FC<widowRush> = (prop:widowRush) => {
     const [englishSourceFieldNames,setEnglishSourceFieldNames] = useState<any>();
     const [englishField,setEnglishField] = useState<any>();
     const [a1,setA1]=useState<any>();
+    const [a2,setA2]=useState<any>();
 
     /** 字段关系序号编辑 */
     var paramIndex = 0;
@@ -57,8 +58,6 @@ const datascopemanage : React.FC<widowRush> = (prop:widowRush) => {
 
     useEffect(() => {
       select1();
-      
-        select2();
         select3();
       
       }, [englishSourceTableName,englishTargetTableName]);
@@ -102,7 +101,8 @@ const datascopemanage : React.FC<widowRush> = (prop:widowRush) => {
        });
        closeAndRefresh();
     } else if (editType == 'create' ) {
-      data.relationNo = "DCM" + dataIndex;
+      dataIndex++ ;
+      data.relationNo = "DCM" +  dataIndex;
       await createRowData(data).then(()=>{
          createFieldRowData(fieldRelationData,data.relationNo);
       });
@@ -123,22 +123,22 @@ const datascopemanage : React.FC<widowRush> = (prop:widowRush) => {
     if(englishTargetTableName!=null || englishTargetTableName!=undefined)
     {const sd = await selecFieldName(englishTargetTableName)
     console.log(sd)
-    return setA1(sd);
+    return setA2(sd);
     }
   }
 
- const select2 =async()=>{
-  if(englishField != undefined ||englishField !=null){
-  // console.log(englishField)
-  // const a =englishField.indexOf('.');
-  // const a1 = englishField.slice(0,a);
-  // const a2 = englishField.slice(a+1)
-    const a3 = await selectenglishSourceField(englishField)
-   return setEnglishSourceFieldNames(a3);
-  }else(
-    console.log('2222')
-  )
-  }
+//  const select2 =async()=>{
+//   if(englishField != undefined ||englishField !=null){
+//   // console.log(englishField)
+//   // const a =englishField.indexOf('.');
+//   // const a1 = englishField.slice(0,a);
+//   // const a2 = englishField.slice(a+1)
+//     const a3 = await selectenglishSourceField(englishField)
+//    return setEnglishSourceFieldNames(a3);
+//   }else(
+//     console.log('2222')
+//   )
+//   }
 
 
      
@@ -356,7 +356,7 @@ const datascopemanage : React.FC<widowRush> = (prop:widowRush) => {
             //  value={recordKey}
            //   onChange={(EnglishSourceFieldNames) => editorFormRef.current.setRowData(index,{chineseSourceFieldName:EnglishSourceFieldNames})}
               options={
-                a1
+                a2
               }
               />
             )
@@ -488,14 +488,14 @@ const datascopemanage : React.FC<widowRush> = (prop:widowRush) => {
                 actionRender: (_row,_config,defaultDoms)=>{
                   return [defaultDoms.save,defaultDoms.cancel]
                 },
-                onValuesChange: async (changedValues, Values) => {
+                onValuesChange: async (changedValues, Values) => {// 根据源表字段英文名/目标字段英文名,展示源表字段中文名/目标字段中文名
                   console.log(changedValues);
                   console.log(Values);
                   if(changedValues !=undefined && changedValues.englishSourceFieldName!=undefined){
                   const a3 = await selectenglishSourceField(changedValues.englishSourceFieldName)
                             const {fieldRelationNo,...res} = changedValues;
                 if('englishSourceFieldName' in res){
-                  editorFormRef.current.setRowData(fieldRelationNo,{chineseSourceFieldName:a3})
+                  editorFormRef.current.setRowData(fieldRelationNo,{chineseSourceFieldName:a3}) // 展示第fieldRelationNo行的中文
                 }
                   }
                   if(changedValues !=undefined && changedValues.englishTargetFieldName!=undefined) {

+ 7 - 7
Procedure/frontend/projectb/src/pages/product/report_form_config_reportcreater/reportparamdefine.tsx

@@ -152,12 +152,12 @@ const reportparamdefine : React.FC<widowProps> = (prop:widowProps) => {
             hideInTable: false,
             width:150,
             ellipsis:true,
-            valueType: 'treeSelect',
-            request: () => fetchDict('CALC_TASK_RATE'),
-            fieldProps: {
-              treeDefaultExpandAll: true,
-              treeCheckable:true,
-            },
+            valueType: 'select',
+            request: () => fetchDict('PARAM_CALC_TYPE'),
+          //   fieldProps: {
+          //     treeDefaultExpandAll: true,
+          //     treeCheckable:true,
+          //   },
         },
         {
             title: '参数对象名称', 
@@ -312,7 +312,7 @@ return (
               callback();
             }
          }}]}/>
-        <SDFormDict dictKey='CALC_TASK_RATE' name="paramCalcType" label="参数计算类型" />
+        <SDFormDict dictKey='PARAM_CALC_TYPE' name="paramCalcType" label="参数计算类型" />
         <SDFormText name="paramObjectName" required={true} rules={[{max:100,message:'最多100个字符'}]}
         bgValidater={(paramObjectName: string) => isNotExist(
             {

+ 1 - 1
Procedure/frontend/projectb/src/pages/product/rwa_calc_config_004rwa/meteringparamdefine.tsx

@@ -307,7 +307,7 @@ return (
           }
         )} 
          label="参数名称"/>
-        <SDFormText name="paramCalcType" label="参数计算类型" />
+        <SDFormDict name="paramCalcType" label="参数计算类型" dictKey="PARAM_CALC_TYPE" />
         <SDFormText name="paramObjectName" rules={[{validator:(rules,value,callback)=>{
             let chineseCount = countChineseChars(value);
             if (chineseCount > 100) {

+ 15 - 4
Procedure/frontend/projectb/src/pages/product/rwa_calc_config_004rwa/stageinformation.tsx

@@ -9,7 +9,7 @@ import {getDataList,createStageConfigType,updateStageConfigType,deleteStageConfi
   } from "@/services/rwa/product/rwa_calc_config_004rwa/stageinformation";
 import { PlusSquareTwoTone, WomanOutlined } from "@ant-design/icons";
 import { StageDefinitionModel, StageStepsModel } from "@/services/rwa/product/rwa_calc_config_004rwa/stageinformation";
-import { toNumber } from "lodash";
+import { toNumber, values } from "lodash";
 import { countChineseChars } from "@/services/rwa/product/rwacheckutils";
 
 type widowProps = {
@@ -42,6 +42,7 @@ const stageinformation : React.FC<widowProps> = (prop:widowProps) => {
     const { fetchDict } = useModel('dict');
     const [editRuleNo, setEditRuleNo] = useState<any>();
     const [stageConfigKey, setStageConfigKey] = useState<any>();
+    const [stepInfo,setStepInfo] = useState<any>();
     // 页面数据
     var formDataList = new Array<StageDefinitionModel>;
 
@@ -364,6 +365,7 @@ const stageinformation : React.FC<widowProps> = (prop:widowProps) => {
             hideInTable: false,
             width:150,
             ellipsis:true,
+          //  valueType:'select',
             request: () => fetchDict('STEP_TYPE'),
             fieldProps: {
               treeDefaultExpandAll: true,
@@ -482,7 +484,7 @@ return (
             term: "",
             dataDate: ""
           }
-        )} readonlyCond="update" rules={[{max:60,message:'最大长度不超过60'},]} required={true} label="阶段编号"/>
+        )} readonlyCond="update" rules={[{max:60,message:'请输入数字,且最大长度不超过60',validator: validateFun.naturalinteger},]} required={true} label="阶段编号"/>
         <SDFormText name="stageName" rules={[{validator:(rules,value,callback)=>{
             let chineseCount = countChineseChars(value);
             if (chineseCount > 100) {
@@ -529,7 +531,16 @@ return (
           visible={StageConfigRuleVisible}
           onVisibleChange={() => {setStageConfigRuleVisible(false)}}
           initialValues={{
-            detailRuleNo:editRuleNo
+            detailRuleNo:editRuleNo,
+            stepType : ''
+          }}
+          onValuesChange={(changevalue,values)=>{
+            if(values.stepType =='1'){
+              setStepInfo(true)
+            }else{
+              setStepInfo(false)
+            }
+
           }}
           editType={toolRuleEditType}
           formRef={toolRuleFormRef}
@@ -558,7 +569,7 @@ return (
         <SDFormDict dictKey='org' multiple={true} name="stepIns"  label="阶段输入表" />
         <SDFormDict dictKey='org' multiple={true}  name="stepOuts"  label="阶段输出表"/>
         <SDFormDict dictKey='STEP_TYPE'  name="stepType"  label="阶段步骤类型"/>
-        <SDFormText type="textarea" name="stepInfo" label="阶段步骤内容"/>
+        {stepInfo &&<SDFormText type="textarea" name="stepInfo" label="阶段步骤内容" required={stepInfo}/>}
         
 
         </SDModalForm>