Administrator
2021-10-12 4fabfdb4ebf60e28923c68548fa3421f84557149
新增微信交流群二维码维护
2 files modified
1 files added
210 ■■■■ changed files
src/api/resource/attach.js 79 ●●●●● patch | view | raw | blame | history
src/views/wxpicture/wxpicture.vue 125 ●●●●● patch | view | raw | blame | history
vue.config.js 6 ●●●● patch | view | raw | blame | history
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
    })
}
src/views/wxpicture/wxpicture.vue
New file
@@ -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>
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 @@
            }
        }
    }
};
};