瀏覽代碼

feat: 操作记录新增来源过滤

ZhaoJun 1 年之前
父節點
當前提交
4c6487fc2b
共有 4 個文件被更改,包括 62 次插入19 次删除
  1. 2 1
      src/components/PageTitle/index.js
  2. 48 15
      src/pages/SmartOps/OperationRecord.js
  3. 1 1
      src/pages/SmartOps/index.js
  4. 11 2
      src/pages/SmartOps/index.less

+ 2 - 1
src/components/PageTitle/index.js

@@ -20,7 +20,6 @@ export default (props) => {
       className={`${styles.titleBox} ${tabs ? styles.tabs : ''} ${
       className={`${styles.titleBox} ${tabs ? styles.tabs : ''} ${
         isSubPage ? styles.subPage : ''
         isSubPage ? styles.subPage : ''
       }`}
       }`}
-      onClick={handleOnClick}
     >
     >
       {isSubPage && (
       {isSubPage && (
         <CaretLeftFilled
         <CaretLeftFilled
@@ -30,6 +29,7 @@ export default (props) => {
             marginRight: '0.15rem',
             marginRight: '0.15rem',
             color: '#0139F1',
             color: '#0139F1',
           }}
           }}
+          onClick={handleOnClick}
         />
         />
       )}
       )}
 
 
@@ -37,6 +37,7 @@ export default (props) => {
         <span
         <span
           className={`${styles.title}`}
           className={`${styles.title}`}
           style={returnable ? { cursor: 'pointer' } : null}
           style={returnable ? { cursor: 'pointer' } : null}
+          onClick={handleOnClick}
         >
         >
           {children}
           {children}
         </span>
         </span>

+ 48 - 15
src/pages/SmartOps/OperationRecord.js

@@ -66,14 +66,38 @@ const OperationRecord = (props) => {
       },
       },
     },
     },
     {
     {
-      title: '来源',
+      title: '操作类型',
       dataIndex: 'cause_type',
       dataIndex: 'cause_type',
       key: 'cause_type',
       key: 'cause_type',
       render: (text) => {
       render: (text) => {
         if (Number(text) === 0) {
         if (Number(text) === 0) {
           return '自主操作';
           return '自主操作';
         }
         }
-        return '工况建议';
+        if (Number(text) === 1) {
+          return '系统任务';
+        }
+        return '系统自控';
+      },
+    },
+    {
+      title: '来源',
+      dataIndex: 'source',
+      key: 'source',
+      render: (text) => {
+        if (text === undefined) {
+          return '-';
+        }
+        const temp = Number(text);
+        if (temp === 0) {
+          return '客户端';
+        }
+        if (temp === 1) {
+          return '移动端';
+        }
+        if (temp === 2) {
+          return 'Pad端';
+        }
+        return '系统';
       },
       },
     },
     },
     {
     {
@@ -146,11 +170,13 @@ const OperationRecord = (props) => {
       s_time: queryParams.s_time || '',
       s_time: queryParams.s_time || '',
       e_time: queryParams.e_time || '',
       e_time: queryParams.e_time || '',
       cause_type: queryParams.cause_type || '',
       cause_type: queryParams.cause_type || '',
+      source: queryParams.source || '',
       currentPage: 1,
       currentPage: 1,
       pageSize: queryParams.pageSize || 20,
       pageSize: queryParams.pageSize || 20,
     };
     };
     switch (key) {
     switch (key) {
       case 'cause_type':
       case 'cause_type':
+      case 'source':
         tempParams[key] = value;
         tempParams[key] = value;
         break;
         break;
       case 'date':
       case 'date':
@@ -187,35 +213,42 @@ const OperationRecord = (props) => {
   }, [queryParams]);
   }, [queryParams]);
 
 
   return (
   return (
-    <PageContent>
+    <PageContent closeable={false}>
       <PageTitle returnable>操作记录</PageTitle>
       <PageTitle returnable>操作记录</PageTitle>
 
 
       <div className={styles.searchContent}>
       <div className={styles.searchContent}>
-        {/* <Button
-            className={styles.marginRight}
-            type="primary"
-            onClick={() => navigate(-1)}
-          >
-            返回
-          </Button> */}
-        日期:
         <RangePicker
         <RangePicker
           inputReadOnly
           inputReadOnly
           className={[styles.timePicker, styles.marginRight].join(' ')}
           className={[styles.timePicker, styles.marginRight].join(' ')}
           onChange={(value) => handleParamsChange('date', value)}
           onChange={(value) => handleParamsChange('date', value)}
         />
         />
-        <span style={{ marginLeft: '0.2rem' }}>来源:</span>
+        {/* <span>操作类型:</span> */}
         <Select
         <Select
-          placeholder="请选择来源"
-          style={{ width: 250 }}
+          placeholder="请选择操作类型"
+          popupMatchSelectWidth
+          style={{ width: '2.5rem' }}
           onChange={(value) => handleParamsChange('cause_type', value)}
           onChange={(value) => handleParamsChange('cause_type', value)}
           allowClear
           allowClear
         >
         >
           <Option value="0">自主操作</Option>
           <Option value="0">自主操作</Option>
-          <Option value="1">工况建议</Option>
+          <Option value="1">系统任务</Option>
+          <Option value="2">系统自控</Option>
+        </Select>
+        {/* <span>来源:</span> */}
+        <Select
+          style={{ width: '2rem' }}
+          placeholder="请选择来源"
+          onChange={(value) => handleParamsChange('source', value)}
+          allowClear
+        >
+          <Option value="0">客户端</Option>
+          <Option value="1">移动端</Option>
+          <Option value="2">Pad端</Option>
+          <Option value="3">系统</Option>
         </Select>
         </Select>
         <Button
         <Button
           className={styles.marginLeft}
           className={styles.marginLeft}
+          style={{ height: '0.4rem' }}
           type="primary"
           type="primary"
           onClick={() => handleSearch()}
           onClick={() => handleSearch()}
         >
         >

+ 1 - 1
src/pages/SmartOps/index.js

@@ -274,7 +274,7 @@ function SmartOps(props) {
   };
   };
 
 
   return (
   return (
-    <PageContent>
+    <PageContent closeable>
       <PageTitle returnable={time}>智慧运营</PageTitle>
       <PageTitle returnable={time}>智慧运营</PageTitle>
       <div className={`card-box ${styles.topContent}`}>
       <div className={`card-box ${styles.topContent}`}>
         <div className={styles.titleContent}>
         <div className={styles.titleContent}>

+ 11 - 2
src/pages/SmartOps/index.less

@@ -159,15 +159,24 @@
   color: #4a4a4a;
   color: #4a4a4a;
   font-size: 0.24rem;
   font-size: 0.24rem;
   white-space: nowrap;
   white-space: nowrap;
+  width: 100%;
   :global {
   :global {
     .ant-select {
     .ant-select {
-      margin: 0 0.4rem 0 0.1rem;
-      // background-color: #284e83;
+      margin: 0 0.25rem 0 0.1rem;
+    }
+    .ant-select-single:not(.ant-select-customize-input) .ant-select-selector {
+      height: 0.42rem;
     }
     }
   }
   }
 }
 }
 .timePicker {
 .timePicker {
   // background-color: #284e83;
   // background-color: #284e83;
+  // width: 10rem;
+  :global {
+    .ant-picker-input {
+      min-width: 1rem;
+    }
+  }
 }
 }
 
 
 .form {
 .form {