فهرست منبع

Merge branch 'master' of http://182.92.126.35:3000/hrx/mky-vent-base

lxh 4 روز پیش
والد
کامیت
75c1f15796

+ 38 - 4
README.md

@@ -36,18 +36,52 @@
 
 `pnpm build`
 
-### 主题
+### 主题及主题化
 
 主题可以在 /views/vent/sys/setting/index.vue 中找到设置入口
 
 常规的颜色、变量在 /design/color.less 或 /design/themify/ 下添加,图片资源应在 /assets/images/themify/ 下添加
 
-各个页面的主题化标准模板可以参考登录页 /views/sys/login/Login.vue
+一般来说,主题化开发可以参考以下代码
 
-下面是配合主题化使用的工具,输入页面的 css 样式,即可输出标准模板所需的资源
+```less
+// import theme variables
+@import '/@/design/theme.less';
+
+// scope the selector
+@{theme-deepblue} {
+  .your-component-root-class-name {
+    --image-a: url('/@/assets/images/themify/deepblue/a.png');
+    --bg-a: #ffffff;
+  }
+}
+
+// scope the selector
+@{theme-dark} {
+  .your-component-root-class-name {
+    --image-a: url('/@/assets/images/themify/dark/a.png');
+    --bg-a: #000000;
+  }
+}
+
+// default css
+.your-component-root-class-name {
+  --image-a: url('/@/assets/images/a.png');
+  --bg-a: #888888;
+
+  .class-name-a {
+    background-image: var(--image-a);
+    background-color: var(--bg-a);
+  }
+}
+```
+
+更加详细的页面主题化标准模板可以参考登录页 /views/sys/login/Login.vue
+
+如果已经写了css代码,想要支持主题化,则下面是配合主题化使用的工具,用于将已有样式代码输出为主题化代码。输入页面的 css 样式,即可输出标准模板所需的资源(返回的数据第一项为变量集合,第二项为css代码文本)
 
 ```javascript
-// Please make sure these requires before using this function:
+// Take note of requires below before using this function:
 // 1. replace all url patterns to patterns like `url(/@/xxx/xxx.xxx)`.
 // 2. remove all the in-line comments(//) or replace them to block comments(/** */).
 // 3. replace all rbg/rgba/hsa or any other css color functions to hex colors(#xxxxxx).

+ 1 - 1
src/utils/echartsUtil.ts

@@ -175,7 +175,7 @@ export default class echartsUtil {
     const yAxisobj = {
       type: 'value',
       name: item.seriesName ? item.seriesName : item.legend,
-      min: 0,
+      min: item.ymin ? item.ymin : 0,
       max: item.ymax,
       position: item.yaxispos ? item.yaxispos : 'right',
       offset: item.yaxispos == 'right' ? (item.sort - 2) * 60 : 0,

+ 2 - 2
src/views/vent/monitorManager/deviceMonitor/components/device/index.vue

@@ -481,11 +481,11 @@
               </template>
             </div>
           </a-tab-pane>
-          <!-- <a-tab-pane key="5" tab="历史曲线" v-if="deviceType.startsWith('majorpath')">
+          <a-tab-pane key="5" tab="历史曲线" v-if="deviceType.startsWith('majorpath')">
             <div class="tab-item">
               <HistoryTableMajorPath class="w-100% h-100%" :sysId="`${systemID}`" :scroll="scroll" columnsType="sys_majorpath" type="chart" />
             </div>
-          </a-tab-pane> -->
+          </a-tab-pane>
           <a-tab-pane key="3" tab="报警历史" v-if="!noWarningArr.find((item) => deviceType.startsWith(item))">
             <div class="tab-item">
               <AlarmHistoryTable ref="alarmHistoryTable" v-if="activeKey == '3'" :sysId="systemID" columns-type="alarm"

+ 115 - 91
src/views/vent/monitorManager/deviceMonitor/components/device/modal/HistoryTableMajorPath.vue

@@ -12,15 +12,25 @@
         </template>
       </template>
     </BasicTable>
-    <BarAndLine
-      v-else
-      class="echarts-line"
-      xAxisPropType="createTime"
-      :dataSource="dataSource"
-      height="300px"
-      :chartsColumns="chartColumns"
-      :option="echatsOption"
-    />
+    <div v-else>
+      <Pagination
+        size="small"
+        v-model:current="currentPage"
+        v-model:page-size="pageSize"
+        :total="total"
+        :show-total="(total) => `共 ${total} 条`"
+        style="position: absolute; z-index: 99; top: 2px; right: 30px"
+      />
+      <BarAndLine
+        class="echarts-line"
+        xAxisPropType="createTime"
+        :dataSource="dataSource"
+        height="300px"
+        chartsType="history"
+        :chartsColumns="chartColumns"
+        :option="echatsOption"
+      />
+    </div>
   </div>
 </template>
 
@@ -60,10 +70,10 @@
   });
   const echatsOption = {
     grid: {
-      top: '35',
-      left: '30',
-      right: '45',
-      bottom: '25',
+      top: '40',
+      left: '20',
+      right: '0',
+      bottom: '60',
       containLabel: true,
     },
     toolbox: {
@@ -73,23 +83,101 @@
   const dataSource = ref();
   const columns = ref([]);
   const chartColumns = ref([]);
-  const deviceOptions = ref([]);
+  const currentPage = ref<number>(1);
+  const pageSize = ref<number>(20);
+  const total = ref(0);
+
   const tableScroll = props.scroll.y ? ref({ y: props.scroll.y - 100 }) : ref({});
+  // 列表页面公共参数、方法
+  const { tableContext } = useListPage({
+    tableProps: {
+      dataSource: dataSource,
+      columns: columns,
+      canResize: true,
+      showTableSetting: false,
+      showActionColumn: false,
 
+      bordered: false,
+      size: 'small',
+      scroll: tableScroll,
+      showIndexColumn: true,
+      formConfig: {
+        labelAlign: 'left',
+        showAdvancedButton: false,
+        showSubmitButton: false,
+        schemas: [
+          // {
+          //   field: 'createTime_begin',
+          //   label: '开始时间',
+          //   component: 'DatePicker',
+          //   defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
+          //   required: true,
+          //   componentProps: {
+          //     showTime: true,
+          //     valueFormat: 'YYYY-MM-DD HH:mm:ss',
+          //     getPopupContainer: getAutoScrollContainer,
+          //   },
+          //   colProps: {
+          //     span: 4,
+          //   },
+          // },
+          // {
+          //   field: 'createTime_end',
+          //   label: '结束时间',
+          //   component: 'DatePicker',
+          //   defaultValue: dayjs(),
+          //   required: true,
+          //   componentProps: {
+          //     showTime: true,
+          //     valueFormat: 'YYYY-MM-DD HH:mm:ss',
+          //     getPopupContainer: getAutoScrollContainer,
+          //   },
+          //   colProps: {
+          //     span: 4,
+          //   },
+          // },
+        ],
+      },
+      fetchSetting: {
+        listField: 'records',
+      },
+      pagination: {
+        current: 1,
+        pageSize: 10,
+        pageSizeOptions: ['10', '30', '50', '100'],
+        showQuickJumper: false,
+      },
+    },
+  });
+  //注册table数据
+  const [registerTable, { reload, setLoading, setPagination, getPaginationRef }] = tableContext;
   async function getDataSource() {
-    const pagination = getPaginationRef();
-    const res = await defHttp.post({
-      url: '/ventanaly-device/safety/ventanalyDeviceInfo/getZrfyInfoLogList',
-      data: { sysId: props.sysId, pageNo: pagination['current'], pageSize: pagination['pageSize'] },
-    });
-    setPagination({
-      total: res['total'] || 0,
-      current: res['current'] || 1,
-      pageSize: res['size'] || 1,
-      size: res['pages'] || 1,
-    });
-    if (res.records && res.records.length > 0) {
-      dataSource.value = res.records;
+    if (props.type == 'chart') {
+      const res = await defHttp.post({
+        url: '/ventanaly-device/safety/ventanalyDeviceInfo/getZrfyInfoLogList',
+        data: { sysId: props.sysId, pageNo: currentPage.value, pageSize: pageSize.value },
+      });
+      total.value = res['total'];
+      if (res.records && res.records.length > 0) {
+        dataSource.value = res.records;
+      }
+    } else {
+      const pagination = getPaginationRef();
+      if (pagination) {
+        const res = await defHttp.post({
+          url: '/ventanaly-device/safety/ventanalyDeviceInfo/getZrfyInfoLogList',
+          data: { sysId: props.sysId, pageNo: pagination['current'], pageSize: pagination['pageSize'] },
+        });
+        setPagination({
+          total: res['total'] || 0,
+          current: res['current'] || 1,
+          pageSize: res['size'] || 1,
+          size: res['pages'] || 1,
+        });
+        if (res.records && res.records.length > 0) {
+          dataSource.value = res.records;
+        }
+      }
     }
   }
   watch(
@@ -126,70 +214,6 @@
     }
   );
 
-  // 列表页面公共参数、方法
-  const { tableContext } = useListPage({
-    tableProps: {
-      dataSource: dataSource,
-      columns: columns,
-      canResize: true,
-      showTableSetting: false,
-      showActionColumn: false,
-
-      bordered: false,
-      size: 'small',
-      scroll: tableScroll,
-      showIndexColumn: true,
-      formConfig: {
-        labelAlign: 'left',
-        showAdvancedButton: false,
-        showSubmitButton: false,
-        schemas: [
-          {
-            field: 'createTime_begin',
-            label: '开始时间',
-            component: 'DatePicker',
-            defaultValue: dayjs().add(-30, 'day').format('YYYY-MM-DD HH:mm:ss'),
-            required: true,
-            componentProps: {
-              showTime: true,
-              valueFormat: 'YYYY-MM-DD HH:mm:ss',
-              getPopupContainer: getAutoScrollContainer,
-            },
-            colProps: {
-              span: 4,
-            },
-          },
-          {
-            field: 'createTime_end',
-            label: '结束时间',
-            component: 'DatePicker',
-            defaultValue: dayjs(),
-            required: true,
-            componentProps: {
-              showTime: true,
-              valueFormat: 'YYYY-MM-DD HH:mm:ss',
-              getPopupContainer: getAutoScrollContainer,
-            },
-            colProps: {
-              span: 4,
-            },
-          },
-        ],
-      },
-      fetchSetting: {
-        listField: 'records',
-      },
-      pagination: {
-        current: 1,
-        pageSize: 10,
-        pageSizeOptions: ['10', '30', '50', '100'],
-        showQuickJumper: false,
-      },
-    },
-  });
-  //注册table数据
-  const [registerTable, { reload, setLoading, setPagination, getPaginationRef }] = tableContext;
-
   onMounted(async () => {
     await getDataSource();
     watch([() => getPaginationRef()['current'], () => getPaginationRef()['pageSize']], async () => {

+ 1 - 1
src/views/vent/monitorManager/deviceMonitor/components/device/modal/mainPath.vue

@@ -49,7 +49,7 @@
           <div class="status">
             <div class="title">当前状态</div>
             <div class="value">
-              {{ zrfyValue.zrfyStatus ? '阻碍通风' : '帮助通风' }}
+              {{ zrfyValue.zrfyStatus === 1 ? '阻碍通风' : '帮助通风' }}
             </div>
           </div>
         </div>