Преглед изворни кода

1. 调整部分dialog宽度; 2. 修改登录存储字段; 3. 数据管理报告配置以及报表配置查询接口接入;

Bella пре 2 година
родитељ
комит
90d6da4f66

+ 36 - 0
src/api/data/basicInfo.js

@@ -0,0 +1,36 @@
+import { get, post, put } from "@/utils/requestMethod";
+
+/**
+ * 获取楼宇列表
+ * @param {*} page
+ * @param {*} page_size
+ * @param {*} template_type
+ * @param {*} templat_name
+ * @param {*} template_format
+ * @returns
+ */
+const getBuildingList = () => {
+  return get(`/data/building_list`);
+};
+
+
+/**
+ * 获取底层系统
+ * @param {*} page
+ * @param {*} page_size
+ * @returns
+ */
+const getUnderlyingSystem = () => {
+    return get(`/data/underlying_system`);
+  };
+
+  /**
+ * 添加底层系统
+ * @param {*} picture
+ * @returns
+ */
+const addUnderlyingSystem = (picture) => {
+    let params = new FormData();
+    return post(`/data/underlying_system`,params);
+  };
+  

+ 32 - 21
src/api/data/template.js

@@ -16,35 +16,41 @@ const getTableTemplateList = (
   templat_name = "",
   template_format = ""
 ) => {
-  return get(`/data/template_list?page=${page}&page_size=${page_size}&template_type=${template_type}&templat_name=${templat_name}&template_format=${template_format}`);
+  return get(
+    `/data/template_list?page=${page}&page_size=${page_size}&template_type=${template_type}&templat_name=${templat_name}&template_format=${template_format}`
+  );
 };
 
 /**
  * 添加报表模板
- * @param {*} options 
+ * @param {*} options
  */
-const addTableTemplate = (options) =>{
-  let params = new FormData()
-  params.append("template_type",0)
-  options.templatName!=="" && params.append("template_name",options.templatName)
-  options.templateFormat!=="" && params.append("template_format",options.templateFormat)
-  options.intro!=="" && params.append("introduction",options.intro)
-  return post("/data/template",params)
-}
+const addTableTemplate = (options) => {
+  let params = new FormData();
+  params.append("template_type", 0);
+  options.templatName !== "" &&
+    params.append("template_name", options.templatName);
+  options.templateFormat !== "" &&
+    params.append("template_format", options.templateFormat);
+  options.intro !== "" && params.append("introduction", options.intro);
+  return post("/data/template", params);
+};
 
 /**
  * 添加报告模板
- * @param {*} options 
+ * @param {*} options
  */
-const addReportTemplate = (options) =>{
-  let params = new FormData()
-  params.append("template_type",0)
-  options.templatName!=="" && params.append("template_name",options.templatName)
-  options.templateFormat!=="" && params.append("template_format",options.templateFormat)
-  options.reportType !=="" && params.append("report_type",options.reportType)
-  options.intro!=="" && params.append("introduction",options.intro)
-  return post("/data/template",params)
-}
+const addReportTemplate = (options) => {
+  let params = new FormData();
+  params.append("template_type", 0);
+  options.templatName !== "" &&
+    params.append("template_name", options.templatName);
+  options.templateFormat !== "" &&
+    params.append("template_format", options.templateFormat);
+  options.reportType !== "" && params.append("report_type", options.reportType);
+  options.intro !== "" && params.append("introduction", options.intro);
+  return post("/data/template", params);
+};
 
 /**
  * 获取报告列表
@@ -68,4 +74,9 @@ const getReportTemplateList = (
   );
 };
 
-export { getTableTemplateList, getReportTemplateList };
+export {
+  addTableTemplate,
+  addReportTemplate,
+  getTableTemplateList,
+  getReportTemplateList,
+};

+ 43 - 40
src/store/modules/user.js

@@ -1,44 +1,47 @@
-import { login } from '@/api/login'
-import { getToken } from '@/utils/auth'
+import { login } from "@/api/login";
+import { getToken } from "@/utils/auth";
 const user = {
-    namespaced: true,
-    state: {
-        token: getToken(),
-        name: '',
-        avatar: '',
-        role: []
+  namespaced: true,
+  state: {
+    token: getToken(),
+    name: "",
+    avatar: "",
+    role: [],
+  },
+  mutations: {
+    SET_TOKEN: (state, token) => {
+      state.token = token;
     },
-    mutations: {
-        SET_TOKEN: (state, token) => {
-            state.token = token;
-        },
-        SET_NAME: (state, name) => {
-            state.name = name;
-        },
-        SET_AVATAR: (state, avatar) => {
-            state.avatar = avatar;
-        },
-        SET_ROLES: (state, roles) => {
-            state.roles = roles;
-        }
+    SET_NAME: (state, name) => {
+      state.name = name;
     },
-    actions: {
-        //登陆
-        login({ commit }, userInfo) {
-            const { username, password } = userInfo;
-            return new Promise((resolve, reject) => {
-                login({ username: username.trim(), password: password }).then(res => {
-                    const { data } = res;
-                    console.log(data);
-                    commit('SET_TOKEN', data.date);
-                    localStorage.setItem('Authorization',data.date);
-                    resolve(data);
-                }).catch(error => {
-                    console.log('登陆失败');
-                    reject(error);
-                })
-            })
-        },
+    SET_AVATAR: (state, avatar) => {
+      state.avatar = avatar;
     },
-}
-export default user
+    SET_ROLES: (state, roles) => {
+      state.roles = roles;
+    },
+  },
+  actions: {
+    //登陆
+    login({ commit }, userInfo) {
+      const { username, password } = userInfo;
+      return new Promise((resolve, reject) => {
+        login({ username: username.trim(), password: password })
+          .then((res) => {
+            debugger;
+            const { data } = res;
+            console.log(data);
+            commit("SET_TOKEN", data.data);
+            localStorage.setItem("Authorization", data.data);
+            resolve(data);
+          })
+          .catch((error) => {
+            console.log("登陆失败");
+            reject(error);
+          });
+      });
+    },
+  },
+};
+export default user;

+ 58 - 25
src/views/dataManagement/reportConfig.vue

@@ -59,6 +59,7 @@
         </el-table-column>
         <el-table-column prop="templateFormat" label="模板格式">
         </el-table-column>
+        <el-table-column prop="reportType" label="报告类型"> </el-table-column>
         <el-table-column prop="createUser" label="创建用户"> </el-table-column>
         <el-table-column prop="createTime" label="创建时间"> </el-table-column>
         <el-table-column prop="alterTime" label="修改时间"> </el-table-column>
@@ -98,6 +99,8 @@
 <script>
 import checkbox from "@/components/Checkbox/index";
 import page from "@/components/pagination/index";
+import { addReportTemplate, getReportTemplateList } from "@/api/data/template";
+
 export default {
   components: { checkbox, page },
   data() {
@@ -146,29 +149,31 @@ export default {
           label: "月度报告",
         },
       ],
-      tableData: [
-        {
-          templateName: "模板1",
-          templateFormat: "txt",
-          createUser: "test",
-          createTime: "2023-01-01 00:00",
-          alterTime: "2023-01-01 00:00",
-        },
-        {
-          templateName: "模板1",
-          templateFormat: "txt",
-          createUser: "test",
-          createTime: "2023-01-01 00:00",
-          alterTime: "2023-01-01 00:00",
-        },
-        {
-          templateName: "模板1",
-          templateFormat: "txt",
-          createUser: "test",
-          createTime: "2023-01-01 00:00",
-          alterTime: "2023-01-01 00:00",
-        },
-      ],
+      tableData: [],
+
+      // tableData: [
+      //   {
+      //     templateName: "模板1",
+      //     templateFormat: "txt",
+      //     createUser: "test",
+      //     createTime: "2023-01-01 00:00",
+      //     alterTime: "2023-01-01 00:00",
+      //   },
+      //   {
+      //     templateName: "模板1",
+      //     templateFormat: "txt",
+      //     createUser: "test",
+      //     createTime: "2023-01-01 00:00",
+      //     alterTime: "2023-01-01 00:00",
+      //   },
+      //   {
+      //     templateName: "模板1",
+      //     templateFormat: "txt",
+      //     createUser: "test",
+      //     createTime: "2023-01-01 00:00",
+      //     alterTime: "2023-01-01 00:00",
+      //   },
+      // ],
       defaultProps: {
         children: "children",
         label: "label",
@@ -207,8 +212,36 @@ export default {
       if (!value) return true;
       return data.label.indexOf(value) !== -1;
     },
-    getTableData(val) {},
-    handleSizeChange(val) {},
+    getTableData(val) {
+      this.tableData = [];
+      getReportTemplateList(
+        val,
+        this.currentPageSize,
+        1,
+        this.form.templateName,
+        this.form.templateFormat,
+        this.form.reportType
+      ).then((res) => {
+        if (res.data.code === 0 && res.data.data.length > 0) {
+          this.tableData = res.data.data.map((v) => {
+            return {
+              id: v.id,
+              templateName: v.name,
+              templateFormat: v.format,
+              reportType: v.report_type || "--",
+              createUser: v.creator,
+              createTime: v.create_time,
+              alterTime: v.update_time,
+              templateUrl: v.template_url,
+            };
+          });
+        }
+      });
+    },
+    handleSizeChange(val) {
+      this.currentPageSize = val;
+      this.getTableData(this.currentPage);
+    },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },

+ 56 - 25
src/views/dataManagement/statementConfig.vue

@@ -88,6 +88,7 @@
 <script>
 import checkbox from "@/components/Checkbox/index";
 import page from "@/components/pagination/index";
+import { addTableTemplate, getTableTemplateList } from "@/api/data/template";
 export default {
   components: { checkbox, page },
   data() {
@@ -99,29 +100,30 @@ export default {
         templateName: "",
         templateForm: "",
       },
-      tableData: [
-        {
-          templateName: "模板1",
-          templateForm: "txt",
-          createUser: "test",
-          createTime: "2023-01-01 00:00",
-          alterTime: "2023-01-01 00:00",
-        },
-        {
-          templateName: "模板1",
-          templateForm: "txt",
-          createUser: "test",
-          createTime: "2023-01-01 00:00",
-          alterTime: "2023-01-01 00:00",
-        },
-        {
-          templateName: "模板1",
-          templateForm: "txt",
-          createUser: "test",
-          createTime: "2023-01-01 00:00",
-          alterTime: "2023-01-01 00:00",
-        },
-      ],
+      tableData: [],
+      // tableData: [
+      //   {
+      //     templateName: "模板1",
+      //     templateForm: "txt",
+      //     createUser: "test",
+      //     createTime: "2023-01-01 00:00",
+      //     alterTime: "2023-01-01 00:00",
+      //   },
+      //   {
+      //     templateName: "模板1",
+      //     templateForm: "txt",
+      //     createUser: "test",
+      //     createTime: "2023-01-01 00:00",
+      //     alterTime: "2023-01-01 00:00",
+      //   },
+      //   {
+      //     templateName: "模板1",
+      //     templateForm: "txt",
+      //     createUser: "test",
+      //     createTime: "2023-01-01 00:00",
+      //     alterTime: "2023-01-01 00:00",
+      //   },
+      // ],
       temFormatOptions: [
         {
           value: "",
@@ -168,12 +170,41 @@ export default {
       this.$refs.search.filter(val);
     },
   },
+  mounted() {
+    this.initData();
+  },
   methods: {
     initData() {
       this.getTableData(1);
     },
-    getTableData(val) {},
-    handleSizeChange(val) {},
+    getTableData(val) {
+      this.tableData = [];
+      getTableTemplateList(
+        val,
+        this.currentPageSize,
+        0,
+        this.form.templateName,
+        this.form.templateForm
+      ).then((res) => {
+        if (res.data.code === 0 && res.data.data.length > 0) {
+          this.tableData = res.data.data.map((v) => {
+            return {
+              id: v.id,
+              templateName: v.name,
+              templateForm: v.format,
+              createUser: v.creator,
+              createTime: v.create_time,
+              alterTime: v.update_time,
+              templateUrl: v.template_url,
+            };
+          });
+        }
+      });
+    },
+    handleSizeChange(val) {
+      this.currentPageSize = val
+      this.getTableData(this.currentPage)
+    },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },

+ 1 - 1
src/views/deviceManagement/messageDailog/addDevice.vue

@@ -5,7 +5,7 @@
       class="dialog"
       title="添加设备"
       :visible.sync="dialogVisible"
-      width="25%"
+      width="500px"
       center
     >
       <el-divider></el-divider>

+ 1 - 1
src/views/deviceManagement/messageDailog/dataImport.vue

@@ -5,7 +5,7 @@
       class="dialog"
       title="批量导入数据"
       :visible.sync="dialogVisible"
-      width="25%"
+      width="500px"
       center
     >
       <el-divider></el-divider>

+ 238 - 147
src/views/servicesManagement/allServices.vue

@@ -1,49 +1,80 @@
 <template>
-    <div class="content">
-        <el-input class="search" v-model="input" placeholder="请输入" suffix-icon="el-icon-search"></el-input>
-        <el-table ref="multipleTable" border :data="tableData" tooltip-effect="dark" :show-header="false"
-            :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }" style="width: 95%"
-            @selection-change="handleSelectionChange">
-            <el-table-column type="selection" width="50">
-            </el-table-column>
-            <el-table-column prop="photo">
-                <template slot-scope="scope">
-                    <el-image :src="scope.row.photo" style="width: 40px; height: 40px;"
-                        :preview-src-list="[scope.row.photo]"></el-image>
-                </template>
-            </el-table-column>
-            <el-table-column prop="introduction">
-                <template slot-scope="scope">
-                    <el-descriptions :title="scope.row.name">
-                        <el-descriptions-item label="功能简介">{{ scope.row.introduction }}</el-descriptions-item>
-                    </el-descriptions>
-                </template>
-            </el-table-column>
-            <el-table-column prop="updatetime">
-                <template slot-scope="scope">
-                    <el-form label-position="right" label-width="100px" v-model="form">
-                        <el-form-item label="版本号:">
-                            <el-select v-model="form.version">
-                                <el-option value="v1.0"></el-option>
-                            </el-select>
-                        </el-form-item>
-                        <el-form-item label="更新时间:">
-                            <span style="margin-right: 110px;">{{ scope.row.updatetime }}</span>
-                        </el-form-item>
-                    </el-form>
-                </template>
-            </el-table-column>
-            <el-table-column prop="operation">
-                <template slot-scope="scope">
-                    <el-button style="width: 80px; height: 40px;"
-                        :type="scope.row.status == '1' ? 'primary' : scope.row.status == '2' ? 'info' : 'danger'">
-                        {{ scope.row.status == '1' ? '安装' : scope.row.status == '2' ? '未配置' : '卸载' }}
-                    </el-button>
-                </template>
-            </el-table-column>
-        </el-table>
-        <div class="bottom">
-            <div>
+  <div class="content">
+    <el-input
+      class="search"
+      v-model="input"
+      placeholder="请输入"
+      suffix-icon="el-icon-search"
+    ></el-input>
+    <el-table
+      ref="multipleTable"
+      :data="tableData"
+      tooltip-effect="dark"
+      :header-cell-style="{ textAlign: 'center' }"
+      :cell-style="{ textAlign: 'center' }"
+      style="width: 95%"
+      @selection-change="handleSelectionChange"
+    >
+      <el-table-column type="selection" width="50"> </el-table-column>
+      <el-table-column prop="photo">
+        <template slot-scope="scope">
+          <el-image
+            :src="scope.row.photo"
+            style="width: 40px; height: 40px"
+            :preview-src-list="[scope.row.photo]"
+          ></el-image>
+        </template>
+      </el-table-column>
+      <el-table-column prop="introduction">
+        <template slot-scope="scope">
+          <el-descriptions :title="scope.row.name">
+            <el-descriptions-item label="功能简介">{{
+              scope.row.introduction
+            }}</el-descriptions-item>
+          </el-descriptions>
+        </template>
+      </el-table-column>
+      <el-table-column prop="updatetime">
+        <template slot-scope="scope">
+          <el-form label-position="right" label-width="110px">
+            <el-form-item label="版本号:">
+              <el-select v-model="form.version">
+                <el-option value="v1.0"></el-option>
+              </el-select>
+            </el-form-item>
+            <el-form-item label="更新时间:">
+              <span style="margin-right: 110px">{{
+                scope.row.updatetime
+              }}</span>
+            </el-form-item>
+          </el-form>
+        </template>
+      </el-table-column>
+      <el-table-column prop="operation">
+        <template slot-scope="scope">
+          <el-button
+            style="width: 80px; height: 40px"
+            :type="
+              scope.row.status == '1'
+                ? 'primary'
+                : scope.row.status == '2'
+                ? 'info'
+                : 'danger'
+            "
+          >
+            {{
+              scope.row.status == "1"
+                ? "安装"
+                : scope.row.status == "2"
+                ? "未配置"
+                : "卸载"
+            }}
+          </el-button>
+        </template>
+      </el-table-column>
+    </el-table>
+    <div class="bottom">
+      <!-- <div>
                 <checkbox class="checkbox" :total="total"></checkbox>
                 <el-button class="check-cancel" size="mini" type="text" @click="cancleChecked">取消</el-button>
             </div>
@@ -53,140 +84,200 @@
                 <el-button class="disabled" type="text">批量激活</el-button>
                 <el-divider direction="vertical"></el-divider>
                 <el-button class="export" type="text">导出数据</el-button>
-            </div>
-            <page></page>
-        </div>
+            </div> -->
+      <page :paginationData="paginationData"></page>
     </div>
+  </div>
 </template>
 
-<script >
-import checkbox from '@/components/Checkbox/index'
-import page from '@/components/pagination/index'
+<script>
+import checkbox from "@/components/Checkbox/index";
+import page from "@/components/pagination/index";
 export default {
-    components: { checkbox, page },
-    data() {
-        return {
-            input: '',
-            show: true,
-            total:0,
-            form:{},
-            tableData: [
-                {
-                    photo: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
-                    updatetime: '2023-01-01 00:00',
-                    name: '海康威视软件包',
-                    introduction: 'xxxxxxxxxxxxx',
-                    status: '1'
-                },
-                {
-                    photo: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
-                    updatetime: '2023-01-01 00:00',
-                    name: '海康威视软件包',
-                    introduction: 'xxxxxxxxxxxxx',
-                    status: '2'
-                },
-                {
-                    photo: 'https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png',
-                    updatetime: '2023-01-01 00:00',
-                    name: '海康威视软件包',
-                    introduction: 'xxxxxxxxxxxxx',
-                    status: '3'
-                },
-            ]
-        }
-    },
-    methods: {
-        handleSelectionChange(){
-            //
+  components: { checkbox, page },
+  data() {
+    return {
+      input: "",
+      show: true,
+      total: 0,
+      form: {},
+      tableData: [
+        {
+          photo:
+            "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
+          updatetime: "2023-01-01 00:00",
+          name: "海康威视软件包",
+          introduction: "xxxxxxxxxxxxx",
+          status: "1",
         },
-        cancleChecked(){
-            //
-        }
-    }
+        {
+          photo:
+            "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
+          updatetime: "2023-01-01 00:00",
+          name: "海康威视软件包",
+          introduction: "xxxxxxxxxxxxx",
+          status: "2",
+        },
+        {
+          photo:
+            "https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png",
+          updatetime: "2023-01-01 00:00",
+          name: "海康威视软件包",
+          introduction: "xxxxxxxxxxxxx",
+          status: "3",
+        },
+      ],
+      paginationData: {
+        pageSize: 10,
+        pagerCount: 5,
+        currentPage: 1,
+        pageSizes: [5, 10, 20, 30],
+        total: 30,
+        currentChange: (val) => {
+          this.getTableData(val);
+        },
+        handleSizeChange: (val) => {
+          this.handleSizeChange(val);
+        },
+      },
+    };
+  },
+  methods: {
+    handleSelectionChange() {
+      //
+    },
+    getTableData(val) {},
+    handleSizeChange(val) {},
+  },
 };
 </script>
 <style lang="less" scoped>
 .content {
-    top: 77px;
-    position: absolute;
-    left: 218px;
-    right: 16px;
-    height: -webkit-fill-available;
-    margin-bottom: 20px;
-    background-color: #ffffff;
+  top: 77px;
+  position: absolute;
+  left: 218px;
+  right: 16px;
+  height: -webkit-fill-available;
+  margin-bottom: 20px;
+  background-color: #ffffff;
 }
 
 .el-table {
-        top: 100px;
-        margin-left: 2.5%;
+  top: 100px;
+  margin-left: 2.5%;
+  border: 1px solid #f0f2f2;
+  font-size: 0.95rem;
+  font-family: PingFang SC;
+  font-weight: 500;
+  color: #b2b2b2;
+  background: rgba(255, 255, 255, 0.8);
+  /deep/th {
+    background: #f7fbff;
+  }
+  /deep/.el-checkbox {
+    color: #b2b2b2;
+    .el-checkbox__input.is-checked + .el-checkbox__label {
+      color: #2ea8e6;
+    }
+
+    .el-checkbox__input.is-checked .el-checkbox__inner::after {
+      width: 70%;
+      height: 70%;
+      background: #2ea8e6;
+      border-radius: 0;
+      transform: rotate(0deg) scaleY(1);
+      position: static;
+      // border: 1px solid #8DD9FF;
+    }
+
+    .el-checkbox__inner {
+      border: 1px solid #8dd9ff;
+      background: rgba(0, 170, 255, 0);
+      display: flex;
+      align-items: center;
+      justify-content: center;
+      position: static;
+      &::after {
+        transition: 0ms;
+      }
     }
 
+    .el-checkbox__label {
+      padding-left: 0;
+      font-size: 15px;
+      position: absolute;
+      top: 1px;
+      left: 25px;
+    }
+  }
+}
+
 .el-form-item {
-    margin-bottom: 0 !important;
+  margin-bottom: 0 !important;
 }
 
 /deep/.el-form-item__label {
-    padding: 0;
+  padding: 0;
 }
 
 /deep/.el-form-item__content {
-    margin-right: 8px;
+  margin-right: 8px;
 }
 
 .bottom {
+  position: absolute;
+  left: 20px;
+  right: 16px;
+  bottom: 20px;
+  height: 50px;
+  line-height: 20px;
+  background-color: rgba(255, 255, 255, 1);
+  text-align: center;
+
+  .checkbox {
+    position: absolute;
+    left: 29px;
+    top: 15px;
+    font-size: 14px;
+  }
+
+  .check-cancel {
     position: absolute;
-    left: 20px;
-    right: 16px;
-    bottom: 20px;
-    height: 50px;
-    line-height: 20px;
-    background-color: rgba(255, 255, 255, 1);
+    // line-height: 20px;
+    font-size: 14px;
     text-align: center;
+    left: 140px;
+    top: 10px;
+  }
 
-    .checkbox {
-        position: absolute;
-        left: 29px;
-        top: 15px;
-        font-size: 14px;
-    }
+  .bottom_button {
+    position: absolute;
+    left: 200px;
+    margin-top: 15px;
 
-    .check-cancel {
-        position: absolute;
-        // line-height: 20px;
-        font-size: 14px;
-        text-align: center;
-        left: 140px;
-        top: 10px;
+    .delete {
+      font-size: 14px;
+      text-align: center;
+      padding: 1px;
     }
 
-    .bottom_button {
-        position: absolute;
-        left: 200px;
-        margin-top: 15px;
-
-        .delete {
-            font-size: 14px;
-            text-align: center;
-            padding: 1px;
-        }
-
-        .disabled {
-            font-size: 14px;
-            text-align: center;
-            padding: 1px;
-        }
+    .disabled {
+      font-size: 14px;
+      text-align: center;
+      padding: 1px;
+    }
 
-        .export {
-            font-size: 14px;
-            text-align: center;
-            padding: 1px;
-        }
+    .export {
+      font-size: 14px;
+      text-align: center;
+      padding: 1px;
     }
+  }
 }
 .search {
-    position: absolute;
-    width: 300px;
-    top: 20px;
-    right: 2.5%;
+  position: absolute;
+  width: 300px;
+  top: 20px;
+  right: 2.5%;
 }
-</style>
+</style>