quanwei
18 hours ago c441dea81bd86bdfb12dff35821fed51f4cc91c2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<template>
  <div v-loading="loading">
    <el-tabs size="small" v-model="activeName" type="card" @tab-click="handleClick">
      <el-tab-pane label="基础设置" name="basic"></el-tab-pane>
      <el-tab-pane label="入会协议" name="license"></el-tab-pane>
      <el-tab-pane label="自定义文字" name="words"></el-tab-pane>
    </el-tabs>
 
    <!--基础设置-->
    <Basic v-if="activeName == 'basic'" :settingData="settingData"></Basic>
    <!--入会协议-->
    <License v-if="activeName == 'license'" :settingData="settingData"></License>
    <!--入会协议-->
    <Words v-if="activeName == 'words'" :settingData="settingData"></Words>
  </div>
</template>
<script>
import BranchApi from '@/api/branch.js';
import Basic from './part/Basic';
import License from './part/License';
import Words from './part/Words';
export default {
  components: {
    /*编辑组件*/
    Basic,
    License,
    Words
  },
  data() {
    return {
      /*是否正在加载*/
      loading:true,
      /*当前选中*/
      activeName: '',
      /*数据对象*/
      settingData:{}
    };
  },
  created() {
    if (this.$route.query.type != null) {
      this.activeName = this.$route.query.type;
    }
    this.getData();
  },
  methods: {
 
    /*获取数据*/
    getData() {
      let self = this;
      BranchApi.branchSet({}, true)
        .then(res => {
          self.settingData = res.data;
          self.loading = false;
          self.activeName = 'basic';
        })
        .catch(error => {});
    },
 
    handleClick(e) {
      this.activeName = e.name;
    }
  }
};
</script>