code4eat 3 năm trước cách đây
mục cha
commit
601a39cc1b

+ 5 - 1
src/global.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-03 14:28:27
- * @LastEditTime: 2021-09-22 10:30:10
+ * @LastEditTime: 2021-12-22 16:01:41
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/global.tsx
@@ -13,6 +13,7 @@ import defaultSettings from '../config/defaultSettings';
 const { pwa } = defaultSettings;
 const isHttps = document.location.protocol === 'https:';
 
+
 // if pwa is true
 if (pwa) {
   // Notify user if offline now
@@ -89,3 +90,6 @@ if (pwa) {
     });
   }
 }
+
+
+

+ 12 - 0
src/pages/GradeHospitalAccreditation/articleManagement/index.less

@@ -1,3 +1,15 @@
+
+//overwrite antd css
+.ant-col-6 {
+  margin-bottom: 10px;
+}
+.ant-space-align-center {
+  align-items: flex-start;
+}
+
+//----------------
+
+
 .leafContent {
   .leafContentTitle {
     font-size: 16px;

+ 111 - 35
src/pages/GradeHospitalAccreditation/articleManagement/index.tsx

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-14 10:22:09
- * @LastEditTime: 2021-12-06 17:08:43
+ * @LastEditTime: 2021-12-23 09:59:54
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/GradeHospitalAccreditation/articleManagement/index.tsx
@@ -21,6 +21,7 @@ import MccsClickableTabs from '@/components/MccsClickableTabs/index';
 import MccsUpload from '@/components/MccsUpload/index';
 import { MccsModal } from '@/components/MccsModal';
 import type { ProFormInstance, } from '@ant-design/pro-form';
+import {getScoreLevelData} from '@/pages/PlatformMana/generalSetting/serve';
 
 
 
@@ -66,6 +67,80 @@ const columns = [
             )
         },
     },
+    {
+        key: 'department',
+        hideInTable: true,
+        renderFormItem: (item: any, { type }: any, form: any) => {
+
+            if (type === 'form') {
+                return null;
+            }
+            return (
+                <Form.Item name='department'>
+                    <ProFormText placeholder='单位' />
+                </Form.Item>
+            )
+        },
+    },
+    {
+        key: 'name',
+        hideInTable: true,
+        renderFormItem: (item: any, { type }: any, form: any) => {
+
+            if (type === 'form') {
+                return null;
+            }
+            return (
+                <Form.Item name='name'>
+                    <ProFormText placeholder='负责人' />
+                </Form.Item>
+            )
+        },
+    },
+    {
+        key: 'selfEvaluation',
+        hideInTable: true,
+        renderFormItem: (item: any, { type }: any, form: any) => {
+
+            if (type === 'form') {
+                return null;
+            }
+            return (
+                    <ProFormSelect
+                        name="selfEvaluation"
+                        request={async () => {
+                              const data = await getScoreLevelData();
+                              if(!data)return [];
+                              return data.map(item=>({label:item.levelNumber,value:item.levelNumber}))
+                        }}
+                        placeholder="选择自评"
+                        rules={[{ required:false}]}
+                    />
+            )
+        },
+    },
+    {
+        key: 'targetEvaluation',
+        hideInTable: true,
+        renderFormItem: (item: any, { type }: any, form: any) => {
+
+            if (type === 'form') {
+                return null;
+            }
+            return (
+                    <ProFormSelect
+                        name="targetEvaluation"
+                        request={async () => {
+                            const data = await getScoreLevelData();
+                            if(!data)return [];
+                            return data.map(item=>({label:item.levelNumber,value:item.levelNumber}))
+                        }}
+                        placeholder="选择目标"
+                        rules={[{ required:false }]}
+                    />
+            )
+        },
+    },
     {
         title: '条款',
         key: 'numStr',
@@ -176,8 +251,8 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
         //因为modalForm开启了request+params获取表单默认值,
         //所以必须先设置默认值才能开启弹窗
         if (formInitData) {
-            const { fileUrl, recordTypeName, accountType, fileName,cateId } = formInitData;
-            console.log({formInitData});
+            const { fileUrl, recordTypeName, accountType, fileName, cateId } = formInitData;
+            console.log({ formInitData });
             restModelData.setUploadFormInitValue({
                 tab: { label: accountType, value: { label: recordTypeName, value: cateId } },
                 files: [{
@@ -218,7 +293,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
     const uploadLedgerChangeHandle = (tabData: any) => {
         //台账上传类型选择回调
-       
+
     }
 
 
@@ -260,11 +335,11 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
 
     useEffect(() => {
         if (treeData.length > 0) {
-          //默认展开书结构第一个结点
-          const { id } = treeData[0];
-          setDefaultOpened(`${id}`);
+            //默认展开书结构第一个结点
+            const { id } = treeData[0];
+            setDefaultOpened(`${id}`);
         }
-      }, [treeData]);
+    }, [treeData]);
 
     useEffect(() => {
         restModelData.getArticleTreeData();
@@ -305,21 +380,21 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                             />
                         </Form.Item>
                         <ProFormDependency name={['tab']}>
-                              {
-                                  ({tab})=>{
-                                     //制度特殊处理
-                                    return tab&&tab.value.label == '制度'&&(
+                            {
+                                ({ tab }) => {
+                                    //制度特殊处理
+                                    return tab && tab.value.label == '制度' && (
                                         <ProFormSelect
-                                        name="publicCateId"
-                                        label="制度下类型"
-                                        width='md'
-                                        request={async ()=> await restModelData.getSelectableRuleChilds(tab.value.value)}
-                                        placeholder="请选择"
-                                        rules={[{ required: true, message: '请选择!' }]}
-                                      />
+                                            name="publicCateId"
+                                            label="制度下类型"
+                                            width='md'
+                                            request={async () => await restModelData.getSelectableRuleChilds(tab.value.value)}
+                                            placeholder="请选择"
+                                            rules={[{ required: true, message: '请选择!' }]}
+                                        />
                                     )
-                                  }
-                              }
+                                }
+                            }
                         </ProFormDependency>
                         <Form.Item name='files' rules={[
                             {
@@ -432,14 +507,14 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
             <MccsProCard gutter={16} ghost direction='row'>
                 <MccsProCard colSpan={6} style={{ height: '78vh' }} bodyStyle={{ padding: '16px' }}>
                     {
-                        defaultOpened&&(
+                        defaultOpened && (
                             <MccsFileTree
-                            treeData={treeData}
-                            defaultSelected={defaultOpened}
-                            onSelectHandle={onSelectHandle}
-                            // actionHandle={actionHandle}
-                            // searchHandle={searchHandle}
-                            editable={false}
+                                treeData={treeData}
+                                defaultSelected={defaultOpened}
+                                onSelectHandle={onSelectHandle}
+                                // actionHandle={actionHandle}
+                                // searchHandle={searchHandle}
+                                editable={false}
                             />
                         )
                     }
@@ -454,7 +529,7 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                 search={{
                                     span: 6
                                 }}
-                                rowSelection={isModeTwo?false:{
+                                rowSelection={isModeTwo ? false : {
                                     // 自定义选择项参考: https://ant.design/components/table-cn/#components-table-demo-row-selection-custom
                                     // 注释该行则默认不显示下拉选项
                                     selections: [Table.SELECTION_ALL, Table.SELECTION_INVERT],
@@ -485,15 +560,16 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                     <span>负责人:</span>
                                     <span>{restModelData.leafData?.responsibilityUserName}</span>
                                 </div>
-                                <MccsScoreBanner list={scoreList} />
-                                {
+                                {/* <MccsScoreBanner list={scoreList} /> */}
+                                <div></div>
+                                { 
                                     isModeTwo && (
                                         <div style={{ marginTop: 5 }}>
-                                            <Tabs  activeKey={`${restModelData.tabKey}`} centered size='large' onChange={(key) => restModelData.setTabKey(key)}>
+                                            <Tabs activeKey={`${restModelData.tabKey}`} centered size='large' onChange={(key) => restModelData.setTabKey(key)}>
                                                 <TabPane tab="台账记录" key="1">
                                                     <div className='articleSetBtn'>
                                                         <span onClick={() => upLoadFileHandle()}>上传文件</span>
-                                                    </div>
+                                                    </div> 
                                                     <MccsRecordList
                                                         title='台账记录'
                                                         list={restModelData.records}
@@ -502,9 +578,9 @@ const ArticleManagement: React.FC<ArticleManagementProps> = (props) => {
                                                     />
                                                 </TabPane>
                                                 <TabPane tab="自评结果" key="2">
-                                                <div className='selfEvolutionTitle'>开始自评</div>
+                                                    <div className='selfEvolutionTitle'>开始自评</div>
                                                     <div className='selfEvolutionArea'>
-                                                       
+
                                                         <MccsClickableTabs
                                                             classNames='tabWrap'
                                                             onChange={(value: { label: string, value: any }) => restModelData.onSelfEvolutionTabChange(value)}

+ 2 - 2
src/pages/PlatformMana/generalSetting/serve.ts

@@ -1,7 +1,7 @@
 /*
  * @Author: your name
  * @Date: 2021-09-27 11:06:43
- * @LastEditTime: 2021-10-09 09:46:56
+ * @LastEditTime: 2021-12-23 09:51:22
  * @LastEditors: Please set LastEditors
  * @Description: In User Settings Edit
  * @FilePath: /MedicalWisdomCheckSys/src/pages/PlatformMana/generalSetting/serve.ts
@@ -43,7 +43,7 @@ export const editTableData  = async (data:API.EdittableDataPostType)=>{
 //获取分数等级数据
 export const getScoreLevelData  = async ()=>{
     
-    return request('/api/pfm/sysgeneralconfig/getScoreConfig', {
+    return request<Promise<any[]>>('/api/pfm/sysgeneralconfig/getScoreConfig', {
         method: 'GET',
     });
 }