Forráskód Böngészése

公司编辑小程序功能新增

lmx 1 hete
szülő
commit
40b68de53c

+ 16 - 0
src/api/company/companyConfig.js

@@ -35,4 +35,20 @@ export function configUserCheck(data) {
   })
 }
 
+export function getCompanyMiniAppList() {
+  return request({
+    url: '/company/companyConfig/getCompanyMiniAppList',
+    method: 'get'
+  })
+}
+
+export function saveCompanyMiniApp(data) {
+  return request({
+    url: '/company/companyConfig/saveCompanyMiniApp',
+    method: 'post',
+    data: data
+  })
+}
+
+
 

+ 111 - 0
src/views/company/companyConfig/miniappConfig.vue

@@ -0,0 +1,111 @@
+<template>
+  <div class="app-container">
+    <el-tabs v-model="activeName">
+      <el-tab-pane label="公司小程序配置" name="companyConfig">
+        <el-form ref="sysConfig" :model="sysConfig" label-width="120px">
+          <el-form-item label="主要小程序" prop="mainMiniAppId">
+            <el-select
+              v-model="queryParams.mainMiniAppId"
+              placeholder="请选择主要小程序"
+              clearable
+              size="small"
+            >
+              <el-option
+                v-for="item in companyMiniAppList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.appid"
+              />
+            </el-select>
+          </el-form-item>
+          <el-form-item label="备用小程序" prop="backupMiniAppId">
+            <el-select
+              v-model="queryParams.backupMiniAppId"
+              placeholder="请选择备用小程序"
+              clearable
+              size="small"
+            >
+              <el-option
+                v-for="item in companyMiniAppList"
+                :key="item.id"
+                :label="item.name"
+                :value="item.appid"
+              />
+            </el-select>
+          </el-form-item>
+          <div class="line"></div>
+          <div style="float: right; margin-right: 20px">
+            <el-button type="primary" @click="onSubmit1">提交</el-button>
+          </div>
+        </el-form>
+      </el-tab-pane>
+    </el-tabs>
+  </div>
+</template>
+
+<script>
+import {
+    getCompanyMiniAppList,
+    saveCompanyMiniApp
+} from "@/api/company/companyConfig";
+
+export default {
+  name: "miniappConfig",
+  data() {
+    return {
+     activeName: "companyConfig",
+     queryParams:{
+        mainMiniAppId:null,
+        backupMiniAppId:null
+     },
+     companyMiniAppList:[],
+     sysConfig:{}
+    };
+  },
+  created() {
+    this.initMimiAppList();
+  },
+  mounted() {},
+  methods: {
+    initMimiAppList(){
+        getCompanyMiniAppList().then(res=>{
+        console.log(res.data);
+        this.companyMiniAppList = res.data;
+        let current = res.current;
+        if(!!current){
+            this.queryParams.mainMiniAppId =  current.mainMiniAppId;
+            this.queryParams.backupMiniAppId =  current.backupMiniAppId;
+        }
+        }).catch(res=>{
+          console.log(res);
+        })
+    },
+    //保存配置
+    onSubmit1() {
+        console.log(this.queryParams);
+        saveCompanyMiniApp(this.queryParams).then(res=>{
+            this.msgSuccess("修改成功");
+        }).catch(res=>{
+
+        })
+    },
+  },
+};
+</script>
+<style scoped lang="scss">
+.tip {
+  color: indianred;
+}
+.line {
+  margin: 10px 0;
+  background-color: gainsboro;
+  height: 1px;
+}
+.el-row {
+  margin-bottom: 0px;
+  &:last-child {
+    margin-bottom: 0;
+  }
+}
+</style>
+