Ver Fonte

Merge remote-tracking branch 'origin/master'

JoeLazy há 4 meses atrás
pai
commit
3c6618f797
1 ficheiros alterados com 30 adições e 12 exclusões
  1. 30 12
      src/pages/internalEvaluation/configuration/indexconfig.tsx

+ 30 - 12
src/pages/internalEvaluation/configuration/indexconfig.tsx

@@ -25,7 +25,8 @@ const indexconfig : React.FC<widowRush> = (prop:widowRush) => {
     const actionRef = useRef<ActionType>();
     const formRef = useRef<FormInstance<any>>();
     const templateRef = useRef<FormInstance<any>>();
-
+    const [selectType1, setrSelectType1] = useState<boolean>(false);
+    const [selectType2, setrSelectType2] = useState<boolean>(false);
     // 页面数据
     var formDataList = new Array<IndexConfigModel>;
     const { fetchDict } = useModel('dict');
@@ -143,39 +144,45 @@ const indexconfig : React.FC<widowRush> = (prop:widowRush) => {
           hideInTable: true,
         },
         {
-          title: '其他指标编号',
-          dataIndex: 'otherIndexNo',
+          title: '数据类型',
+          dataIndex: 'dataSourceType',
+          search: false,
           hideInTable: false,
+          request:()=>fetchDict('INDEXSOURCETYPE'),
           valueType:'select',
-          request:()=>fetchDict('@selectAllIndexToDict'),
           fieldProps: {
              treeDefaultExpandAll: true,
              treeCheckable:true,
            },
         },
         {
-          title: '数据集编号',
-          dataIndex: 'dataSetNo',
-          search: false,
+          title: '其他指标编号',
+          dataIndex: 'otherIndexNo',
           hideInTable: false,
           valueType:'select',
-          request:()=>fetchDict('@selectDataSet'),
+          request:()=>fetchDict('@selectAllIndexToDict'),
           fieldProps: {
              treeDefaultExpandAll: true,
              treeCheckable:true,
            },
+           editable: () => {
+            return selectType1;
+           },
         },
         {
-          title: '数据类型',
-          dataIndex: 'dataSourceType',
+          title: '数据集编号',
+          dataIndex: 'dataSetNo',
           search: false,
           hideInTable: false,
-          request:()=>fetchDict('INDEXSOURCETYPE'),
           valueType:'select',
+          request:()=>fetchDict('@selectDataSet'),
           fieldProps: {
              treeDefaultExpandAll: true,
              treeCheckable:true,
            },
+           editable: () => {
+            return selectType2;
+           },
         },
         {
           title: '操作',
@@ -275,8 +282,19 @@ const indexconfig : React.FC<widowRush> = (prop:widowRush) => {
             <SDAreaTtile title='数据来源'/>
             <EditableProTable<IndexSourceModel>
              rowKey="indexSourceNo"
-             headerTitle="可编辑表格"
              columns={indexSourceColumns}
+             editable={{
+              onValuesChange: (record) => {
+                if ( record.dataSourceType === "INDEX") {
+                  setrSelectType1(true);
+                  setrSelectType2(false);
+                }
+                if ( record.dataSourceType === "DATASET") {
+                  setrSelectType2(true);
+                  setrSelectType1(false);
+                }
+              }
+             }}
              value={indexSourceList}
              dataSource={indexSourceList}
              onChange={(value)=>{