浏览代码

perf: 巡检代码命名优化

lanjianrong 4 年之前
父节点
当前提交
f140f99da6

+ 4 - 4
src/assets/css/variable.scss

@@ -14,14 +14,14 @@ $pi-line-color: rgba(0,0,0,.125) !default;
   position: relative;
   &::after {
     content: ' ';
-    width: 200%;
-    height: 200%;
+    width: 100%;
+    height: 100%;
     position: absolute;
     top: 0;
     left: 0;
     border-radius: inherit;
-    transform: scale(0.5);
-    transform-origin: 0 0;
+    // transform: scale(0.5);
+    // transform-origin: 0 0;
     pointer-events: none;
     box-sizing: border-box;
     z-index: 2;

+ 7 - 0
src/pages/Dashboard/api.ts

@@ -0,0 +1,7 @@
+import request from "@/utils/common/request"
+
+/** 获取待办事项的内容 */
+export async function apiGetDashboard() {
+  const { data } = await request.get('/api/dashboard')
+  return data
+}

+ 0 - 1
src/pages/Dashboard/index.scss

@@ -51,4 +51,3 @@
     border: none;
   }
 }
-

+ 20 - 2
src/pages/Dashboard/index.tsx

@@ -9,22 +9,40 @@ import { dayjsFormat } from '@/utils/util'
 import { userStore } from '@/store/mobx'
 import { Tooltip } from 'antd'
 import { observer } from 'mobx-react'
+import { apiGetDashboard } from './api'
+import consts from '@/utils/consts'
+
+interface iState {
+
+}
 const Index = () => {
   useEffect(() => {
+    initData()
+
+  }, [])
+  useEffect(() => {
     if(!userStore.projectInfo.id) {
       userStore.getProjectInfo()
     }
   }, [ userStore.projectInfo.id ])
+  // const [state, setState] = useState(initialState)
+  const initData = async () => {
+    const { code = -1, data } = await apiGetDashboard()
+    if (code !== consts.RET_CODE.SUCCESS) {
+      console.log(data)
+
+    }
+  }
   return (
     <div className="wrap-contaniner hide-menu">
       <Header title="待办事项"></Header>
       <div className={styles.content}>
         <span>系统消息</span>
         <h5 className={styles.title}>{userStore.projectName}</h5>
-        <div className={styles.downtime}>
+        {/* <div className={styles.downtime}>
           <SvgIcon type="xxh-wrench" style={{ fontSize: '1.5rem' }}></SvgIcon>
           <p className={styles.downtimeText}>系统将于 2019年3月10日 14:09 开始停机维护,持续30分钟。造成不便敬请谅解。</p>
-        </div>
+        </div> */}
         <div className="pi-justify-between">
           <div className={[ styles.card, 'pi-flex-quintuple' ].join(' ')}>
             <div className={styles.cardHeader}>

+ 0 - 0
src/pages/Dashboard/util.ts


+ 2 - 2
src/pages/Quality/Content/Info/Detail/components/Modal/index.tsx

@@ -51,7 +51,7 @@ const textObj = {
 
 const AuditModal: React.FC<iAuditModalProps> = props => {
   const [ form ] = Form.useForm()
-  const { modalObj: { visible, type, loading }, onCancel, onCreate, auditors, curAuditor, type } = props
+  const { modalObj: { visible, type, loading }, onCancel, onCreate, auditors, curAuditor, type: auditType } = props
   console.log(loading)
 
 
@@ -179,7 +179,7 @@ const AuditModal: React.FC<iAuditModalProps> = props => {
       )
     } else if (type === 'delete') {
       return (
-        <Authorization type={type} auth="delete">
+        <Authorization type={auditType} auth="delete">
           <Button danger size="small" onClick={comfirmBtnClick} loading={loading}>
             {textObj[type]?.okText}
           </Button>

+ 1 - 1
src/pages/Quality/Content/List/index.tsx

@@ -169,7 +169,7 @@ const QualityList: React.FC<{}> = () => {
         </Slot>
       </Header>
       <Table
-        dataSource={list}
+        dataSource={qualityList}
         columns={columns}
         pagination={{
           hideOnSinglePage: true,

+ 1 - 1
src/pages/Safe/Content/List/index.tsx

@@ -172,7 +172,7 @@ const SafeList: React.FC<{}> = () => {
         </Slot>
       </Header>
       <Table
-        dataSource={list}
+        dataSource={safeList}
         columns={columns}
         pagination={{
           hideOnSinglePage: true,