From bae717f19ea1d2464dc6d55011187a862749c552 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 04 Jan 2022 16:58:42 +0800
Subject: [PATCH] 微信二维码上传新增公安交流二维码展示

---
 src/views/wel/index.vue           |   31 ++++++++++
 src/views/wxpicture/wxpicture.vue |  111 +++++++++++++++++++++++++++++--------
 2 files changed, 118 insertions(+), 24 deletions(-)

diff --git a/src/views/wel/index.vue b/src/views/wel/index.vue
index 27aaf4a..20b976a 100644
--- a/src/views/wel/index.vue
+++ b/src/views/wel/index.vue
@@ -3,6 +3,8 @@
     <div class="homeL-up">
       <span class="h1">保安服务企业管理平台</span>
       <span class="h2">Security service enterprise management platform</span>
+      <!-- <img class="img" src="../../static/img/permit/服务许可背景图.png"/> -->
+      <img class="img" :src="img" v-if="isImg"/>
     </div>
     <div class="homeL-bar">
       <div
@@ -39,11 +41,14 @@
 
 <script>
 import website from "@/config/website";
+import { getDetails } from "@/api/resource/attach";
 import { mapGetters } from "vuex";
 export default {
   data() {
     return {
       usedata: {},
+      img:"",
+      isImg:false,
     };
   },
   mounted() {
@@ -59,6 +64,25 @@
   },
   computed: {
     ...mapGetters(["userInfo"]),
+  },
+  created(){
+    //获取二维码图片
+    // if(this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "administrator"){
+    //   this.isImg = true;
+    //   //查询图片
+    //   getDetails(10).then((res) => {
+    //     const att = res.data.data;
+    //     this.img = att.link;
+    //   });
+    // }
+    if(this.userInfo.role_name == "administrator"){
+      this.isImg = true;
+      //查询图片
+      getDetails(10).then((res) => {
+        const att = res.data.data;
+        this.img = att.link;
+      });
+    }
   },
   methods: {
     down(path) {
@@ -99,6 +123,13 @@
     .h2 {
       font-size: 28px;
     }
+    .img{
+      width:100px;
+      position:relative;
+      position: absolute;
+      right: 1.5rem;
+      top: 4rem;
+    }
   }
   .homeL-bar {
     width: 100%;
diff --git a/src/views/wxpicture/wxpicture.vue b/src/views/wxpicture/wxpicture.vue
index 1c57992..1ede4a0 100644
--- a/src/views/wxpicture/wxpicture.vue
+++ b/src/views/wxpicture/wxpicture.vue
@@ -4,6 +4,7 @@
       <avue-form
         :option="option"
         v-model="form"
+        @tab-click="handleTabClick"
         @submit="handleSubmit"
       ></avue-form>
     </basic-container>
@@ -11,8 +12,8 @@
 </template>
 
 <script>
-import { add,getDetails } from "@/api/resource/attach";
-
+import { add, getDetails } from "@/api/resource/attach";
+  import func from "@/util/func";
 export default {
   data() {
     return {
@@ -42,16 +43,16 @@
                 span: 12,
                 row: true,
                 prop: "link",
-                labelWidth:180,
+                labelWidth: 180,
               },
               {
                 label: "首次上传时间",
                 span: 6,
                 row: true,
                 prop: "createTime",
-                labelWidth:180,
+                labelWidth: 180,
                 type: "datetime",
-                disabled:true,
+                disabled: true,
                 format: "yyyy-MM-dd HH:mm:ss",
                 valueFormat: "yyyy-MM-dd HH:mm:ss",
               },
@@ -60,13 +61,59 @@
                 span: 6,
                 row: true,
                 prop: "updateTime",
-                labelWidth:180,
+                labelWidth: 180,
                 type: "datetime",
-                disabled:true,
+                disabled: true,
                 format: "yyyy-MM-dd HH:mm:ss",
                 valueFormat: "yyyy-MM-dd HH:mm:ss",
-
-              }
+              },
+            ],
+          },
+          {
+            label: "技术交流群-公安",
+            prop: "password",
+            column: [
+              {
+                label: "二维码图片",
+                type: "upload",
+                listType: "picture-img",
+                propsHttp: {
+                  res: "data",
+                  url: "link",
+                },
+                canvasOption: {
+                  text: " ",
+                  ratio: 0.1,
+                },
+                action: "/api/blade-resource/oss/endpoint/put-file",
+                tip: "只能上传jpg/png用户头像,且不超过500kb",
+                span: 12,
+                row: true,
+                prop: "link",
+                labelWidth: 180,
+              },
+              {
+                label: "首次上传时间",
+                span: 6,
+                row: true,
+                prop: "createTime",
+                labelWidth: 180,
+                type: "datetime",
+                disabled: true,
+                format: "yyyy-MM-dd HH:mm:ss",
+                valueFormat: "yyyy-MM-dd HH:mm:ss",
+              },
+              {
+                label: "上次更新时间",
+                span: 6,
+                row: true,
+                prop: "updateTime",
+                labelWidth: 180,
+                type: "datetime",
+                disabled: true,
+                format: "yyyy-MM-dd HH:mm:ss",
+                valueFormat: "yyyy-MM-dd HH:mm:ss",
+              },
             ],
           },
         ],
@@ -80,8 +127,11 @@
   methods: {
     handleSubmit(form, done) {
       if (this.index === 0) {
-        form['type'] = 9;
-        add(form).then(
+        form["type"] = 9;
+      }else{
+        form["type"] = 10;
+      }
+      add(form).then(
           (res) => {
             if (res.data.success) {
               this.handleWitch();
@@ -102,21 +152,34 @@
             done();
           }
         );
-      } 
     },
     handleWitch() {
-        if (this.index === 0) {
-          getDetails(9).then(res => {
-            const att = res.data.data;
-            this.form = {
-              id: att.id,
-              link: att.link,
-              createTime: att.createTime,
-              updateTime: att.updateTime
-            }
-          });
-        }
-      },
+      if (this.index === 0) {
+        getDetails(9).then((res) => {
+          const att = res.data.data;
+          this.form = {
+            id: att.id,
+            link: att.link,
+            createTime: att.createTime,
+            updateTime: att.updateTime,
+          };
+        });
+      }else {
+        getDetails(10).then((res) => {
+          const att = res.data.data;
+          this.form = {
+            id: att.id,
+            link: att.link,
+            createTime: att.createTime,
+            updateTime: att.updateTime,
+          };
+        });
+      }
+    },
+    handleTabClick(tabs) {
+        this.index = func.toInt(tabs.index);
+        this.handleWitch();
+      }
   },
 };
 </script>

--
Gitblit v1.9.3