Browse Source

事件上报页面对接

13127578837 11 months ago
parent
commit
f39c6decd8

+ 3 - 1
src/main.js

@@ -6,7 +6,7 @@ import "./permission"; // permission
 
 // 引入json导出组件
 import JsonExcel from "vue-json-excel";
-
+import { useDict } from '@/utils/dict'
 // 引入UI组件
 import uviewPlus from "@/uni_modules/uview-plus";
 import oaCalendar from "@/components/oa-calendar/uni-calendar";
@@ -38,12 +38,14 @@ export function createApp() {
   app.component('oa-transForm', oaTransForm)
   app.component('oa-ttsAudio', oaTtsAudio)
   app.component('oa-weather', oaWeather)
+  
 
   // 挂载全局json导出
   app.component("downloadExcel", JsonExcel);
   // 添加全局变量
   app.provide("$store", store);
   app.config.globalProperties.$store = store;
+  app.config.globalProperties.useDict = useDict
 
   app
     .use(uviewPlus)

+ 178 - 0
src/pages/business/zhaf/xunJian/error/errorList.vue

@@ -0,0 +1,178 @@
+<template>
+    <u-sticky class="shadow-default" bgColor="#fff" style="top: 0">
+      <u-tabs :list="tabsList" :current="tabsCurrent" @click="tabsClick" lineColor="#333" :activeStyle="{ color: '#333' }" :inactiveStyle="{ color: '#909399' }" :scrollable="false"></u-tabs>
+    </u-sticky>
+  
+    <oa-scroll
+      customClass="fastMail-container scroll-height"
+      :pageSize="pageSize"
+      :total="total"
+      :refresherLoad="true"
+      :refresherEnabled="true"
+      :refresherDefaultStyle="'none'"
+      :refresherThreshold="44"
+      :refresherBackground="'#f5f6f7'"
+      @load="load"
+      @refresh="refresh"
+      :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
+    >
+      <view v-show="tabsCurrent == 1">
+        <view class="content-area menu-list mlr0" v-for="data in dataList" :key="data">
+          <view class="list-cell" style="color: #666666; line-height: 30px" @click="toDetail(data)">
+            <view class="content-area-row_wrap menu-item">
+              <view class="content-area-row_wrap-view " style="margin-right: auto">
+                {{ data.eventName }}
+              </view>
+              <view class="content-area-row_wrap-view flexend">{{ data.createTime ? data.createTime.replace("T", " ") : "" }}</view>
+              <view class="content-area-row_wrap-view ">{{ proxy.$common.mapping("label", "value", data.eventType, patrol_event_type) }} </view>
+            </view>
+          </view>
+        </view>
+      </view>
+  
+      <view v-show="tabsCurrent == 0">
+        <view class="content-area menu-list mlr0" v-for="data in dataList" :key="data">
+          <view class="list-cell" style="color: #666666; line-height: 30px" @click="toDetail(data)">
+            <view class="content-area-row_wrap menu-item">
+              <view class="content-area-row_wrap-view " style="margin-right: auto">
+                {{ data.eventName }}
+              </view>
+              <view class="content-area-row_wrap-view flexend">{{ data.createTime ? data.createTime.replace("T", " ") : "" }}</view>
+              <view class="content-area-row_wrap-view ">{{ proxy.$common.mapping("label", "value", data.eventType, patrol_event_type) }} </view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </oa-scroll>
+  </template>
+  
+  <script setup>
+  import config from "@/config";
+  import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
+  import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+  import { useStores, commonStores } from "@/store/modules/index";
+  import { pageQuery } from "@/api/business/fastMail.js";
+  import { errorApi } from "@/api/business/zhaf/xunJian";
+  const { proxy } = getCurrentInstance();
+  const { patrol_event_classify, patrol_event_grade, patrol_event_type } = proxy.useDict("patrol_event_classify", "patrol_event_grade", "patrol_event_type");
+  const dataList = ref([]);
+  const pageSize = ref(20);
+  const current = ref(1);
+  const total = ref(0);
+  
+  const data = reactive({
+    tabsList: [{ name: "已完成事件" }, { name: "未完成事件" }],
+    tabsCurrent: 1,
+  });
+  
+  const { tabsList, tabsCurrent } = toRefs(data);
+  
+  /**
+   * @页面初始化
+   */
+  function init() {
+    pageQueryApi();
+  }
+  
+  function pageQueryApi() {
+    errorApi().Select({
+      pageNum: current.value,
+      pageSize: pageSize.value,
+      handleStatus:tabsCurrent.value,
+    }).then((res) => {
+      if (res.data.records.length > 0) {
+        dataList.value = res.data.records;
+        total.value = res.data.total;
+      }
+    });
+  }
+  
+  /**
+   * @复制粘贴板
+   */
+  function toDetail(row) {
+    uni.navigateTo({
+      url: "/pages/business/zhaf/xunJian/error/errorListDetail?id=" + row.id,
+    });
+  }
+  
+  /**
+   * @tabs点击事件
+   */
+  function tabsClick(e) {
+    tabsCurrent.value = e.index;
+    pageQueryApi();
+  }
+  
+  /**
+   * @scrollView加载数据
+   */
+  function load() {
+    pageSize.value += 10;
+    init();
+  }
+  
+  /**
+   * @scrollView刷新数据
+   */
+  function refresh() {
+    pageSize.value = 20;
+    init();
+  }
+  
+  onLoad((options) => {
+    init();
+  });
+  
+  onReady(() => {});
+  
+  onShow(() => {
+    //调用系统主题颜色
+    proxy.$settingStore.systemThemeColor([1]);
+  });
+  
+  // 自定义导航事件
+  onNavigationBarButtonTap((e) => {
+    if (e.float == "right") {
+    }
+  });
+  </script>
+  
+  <style lang="scss" scoped>
+  :deep(.uni-page-head__title) {
+    opacity: 1 !important;
+  }
+  
+  .fastMail-container {
+    .content-area {
+      &-top {
+        font-size: 16px;
+        font-weight: 600;
+        color: #000000;
+      }
+  
+      &-row_wrap {
+        font-size: 13px;
+        flex-flow: row wrap;
+  
+        &-view {
+          min-width: 50%;
+          white-space: nowrap;
+          overflow: hidden;
+          text-overflow: ellipsis;
+          > .iconfont {
+            font-size: 14px;
+            color: #909399;
+            margin-left: 5px;
+          }
+        }
+      }
+    }
+  }
+.flexend{
+  flex: 1;
+  display: block;
+  text-align: right;
+}
+  </style>
+  

+ 149 - 0
src/pages/business/zhaf/xunJian/error/errorListDetail.vue

@@ -0,0 +1,149 @@
+<template>
+    <oa-scroll
+      customClass="invoicing-container scroll-height"
+      :customStyle="{}"
+      :refresherLoad="false"
+      :refresherEnabled="false"
+      :refresherDefaultStyle="'none'"
+      :refresherThreshold="44"
+      :refresherBackground="'#f5f6f7'"
+      :scrollIntoView="scrollIntoView"
+      :data-theme="'theme-' + proxy.$settingStore.themeColor.name"
+    >
+      <view>
+        <view class="menu-list mt0 mlr0" style="padding: 0.625rem">
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">事件名称</view>
+              <view style="color: #666666">{{ dataList.eventName }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">上报人</view>
+              <view style="color: #666666">{{ dataList.personnelName }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">事件类型</view>
+              <view style="color: #666666">{{ proxy.$common.mapping("label", "value", dataList.eventType, patrol_event_type) }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">事件等级</view>
+              <view style="color: #666666">{{ proxy.$common.mapping("label", "value", dataList.eventLevel, patrol_event_grade) }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">事件分类</view>
+              <view style="color: #666666">{{ proxy.$common.mapping("label", "value", dataList.classify, patrol_event_classify) }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">事件类型</view>
+              <view style="color: #666666">{{ proxy.$common.mapping("label", "value", dataList.eventType, patrol_event_type) }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">处置状态</view>
+              <view style="color: #666666">{{ dataList.handleStatus == 0 ? '未处置' : dataList.handleStatus == 1 ? '已处置' :  '' }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">事件分类</view>
+              <view style="color: #666666">{{ proxy.$common.mapping("label", "value", dataList.classify, patrol_event_classify) }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">设备Id</view>
+              <view style="color: #666666">{{ dataList.deviceId }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">处置人</view>
+              <view style="color: #666666">{{ dataList.handleName }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">处置时间</view>
+              <view style="color: #666666"> {{ dataList.handleTime ? dataList.handleTime.replace("T", " ") : "" }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">创建人</view>
+              <view style="color: #666666">{{ dataList.createBy }}</view>
+            </view>
+          </view>
+          <view class="list-cell">
+            <view class="menu-item">
+              <view style="width: 90px">创建时间</view>
+              <view style="color: #666666">{{ dataList.createTime }}</view>
+            </view>
+          </view>
+        </view>
+      </view>
+    </oa-scroll>
+  </template>
+  
+<script setup>
+import { onLoad, onShow, onReady, onHide, onLaunch, onNavigationBarButtonTap, onPageScroll } from "@dcloudio/uni-app";
+import { ref, reactive, computed, getCurrentInstance, toRefs, inject } from "vue";
+import { errorApi } from "@/api/business/zhaf/xunJian";
+const { proxy } = getCurrentInstance();
+const { patrol_event_classify, patrol_event_grade, patrol_event_type } = proxy.useDict("patrol_event_classify", "patrol_event_grade", "patrol_event_type");
+const uForm = ref(null);
+const data = reactive({
+  tableData: {},
+  id:undefined,
+  scrollIntoView: "",
+});
+
+const { tableData, id, scrollIntoView } = toRefs(data);
+function pageQueryApi() {
+  errorApi().Select({
+    pageNum: 1,
+    pageSize: 1,
+    id:id.value,
+  }).then((res) => {
+    if (res.data.records.length > 0) {
+      dataList.value = res.data.records;
+      total.value = res.data.total;
+    }
+  });
+}
+
+onLoad((options) => {
+  id.value = options.id
+  pageQueryApi();
+});
+
+onReady(() => {});
+
+onShow(() => {
+  //调用系统主题颜色
+  proxy.$settingStore.systemThemeColor([1]);
+});
+
+// 自定义导航事件
+onNavigationBarButtonTap((e) => {
+  if (e.float == "right") {
+  }
+});
+</script>
+
+<style lang="scss" scoped>
+:deep(.uni-page-head__title) {
+  opacity: 1 !important;
+}
+</style>
+