From 4fabfdb4ebf60e28923c68548fa3421f84557149 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Tue, 12 Oct 2021 23:29:26 +0800
Subject: [PATCH] 新增微信交流群二维码维护

---
 src/views/wxpicture/wxpicture.vue |  125 +++++++++++++++++++++++++++++++
 vue.config.js                     |    6 
 src/api/resource/attach.js        |   79 +++++++++++--------
 3 files changed, 172 insertions(+), 38 deletions(-)

diff --git a/src/api/resource/attach.js b/src/api/resource/attach.js
index e90ccaf..5280b82 100644
--- a/src/api/resource/attach.js
+++ b/src/api/resource/attach.js
@@ -1,50 +1,59 @@
 import request from '@/router/axios';
 
 export const getList = (current, size, params) => {
-  return request({
-    url: '/api/blade-resource/attach/list',
-    method: 'get',
-    params: {
-      ...params,
-      current,
-      size,
-    }
-  })
+    return request({
+        url: '/api/blade-resource/attach/list',
+        method: 'get',
+        params: {
+            ...params,
+            current,
+            size,
+        }
+    })
 }
 
 export const getDetail = (id) => {
-  return request({
-    url: '/api/blade-resource/attach/detail',
-    method: 'get',
-    params: {
-      id
-    }
-  })
+    return request({
+        url: '/api/blade-resource/attach/detail',
+        method: 'get',
+        params: {
+            id
+        }
+    })
+}
+
+export const getDetails = (type) => {
+    return request({
+        url: '/api/blade-resource/attach/detail',
+        method: 'get',
+        params: {
+            type
+        }
+    })
 }
 
 export const remove = (ids) => {
-  return request({
-    url: '/api/blade-resource/attach/remove',
-    method: 'post',
-    params: {
-      ids,
-    }
-  })
+    return request({
+        url: '/api/blade-resource/attach/remove',
+        method: 'post',
+        params: {
+            ids,
+        }
+    })
 }
 
 export const add = (row) => {
-  return request({
-    url: '/api/blade-resource/attach/submit',
-    method: 'post',
-    data: row
-  })
+    return request({
+        url: '/api/blade-resource/attach/submit',
+        method: 'post',
+        data: row
+    })
 }
 
 export const update = (row) => {
-  return request({
-    url: '/api/blade-resource/attach/submit',
-    method: 'post',
-    data: row
-  })
-}
-
+    return request({
+        url: '/api/blade-resource/attach/submit',
+        method: 'post',
+        data: row
+    })
+}
\ No newline at end of file
diff --git a/src/views/wxpicture/wxpicture.vue b/src/views/wxpicture/wxpicture.vue
new file mode 100644
index 0000000..1c57992
--- /dev/null
+++ b/src/views/wxpicture/wxpicture.vue
@@ -0,0 +1,125 @@
+<template>
+  <div>
+    <basic-container>
+      <avue-form
+        :option="option"
+        v-model="form"
+        @submit="handleSubmit"
+      ></avue-form>
+    </basic-container>
+  </div>
+</template>
+
+<script>
+import { add,getDetails } from "@/api/resource/attach";
+
+export default {
+  data() {
+    return {
+      index: 0,
+      option: {
+        tabs: true,
+        tabsActive: 1,
+        group: [
+          {
+            label: "保安服务企业技术交流群二维码信息",
+            prop: "info",
+            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",
+
+              }
+            ],
+          },
+        ],
+      },
+      form: {},
+    };
+  },
+  created() {
+    this.handleWitch();
+  },
+  methods: {
+    handleSubmit(form, done) {
+      if (this.index === 0) {
+        form['type'] = 9;
+        add(form).then(
+          (res) => {
+            if (res.data.success) {
+              this.handleWitch();
+              this.$message({
+                type: "success",
+                message: "修改信息成功!",
+              });
+            } else {
+              this.$message({
+                type: "error",
+                message: res.data.msg,
+              });
+            }
+            done();
+          },
+          (error) => {
+            window.console.log(error);
+            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
+            }
+          });
+        }
+      },
+  },
+};
+</script>
+
+<style>
+</style>
diff --git a/vue.config.js b/vue.config.js
index 940a629..aabc55c 100644
--- a/vue.config.js
+++ b/vue.config.js
@@ -27,11 +27,11 @@
         proxy: {
             '/api': {
                 // 本地服务接口地址
-                // target: 'http://localhost:81',
+                target: 'http://localhost:81',
                 // target: 'http://192.168.0.114:81',//钟日健W
                 // target: 'http://localhost:81', //原W
                 // target: 'http://192.168.0.108:81',//原W
-                target: 'http://192.168.0.107:81',//唐N
+                // target: 'http://192.168.0.107:81',//唐N
                 // target: 'http://223.82.109.183:81',//唐N
                 //远程演示服务地址,可用于直接启动项目
                 ws: true,
@@ -41,4 +41,4 @@
             }
         }
     }
-};
+};
\ No newline at end of file

--
Gitblit v1.9.3