quanwei
13 hours ago 408c463c5b66bba2aa1c81d8dca23e04c1608e24
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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<template>
  <!--
        作者:luoyiming
        时间:2020-01-08
        描述:超链接选择
    -->
  <el-dialog title="超链接设置" :visible.sync="dialogVisible" @close="dialogFormVisible" :close-on-click-modal="false" :close-on-press-escape="false">
    <!--内容-->
    <el-tabs type="border-card" v-model="activeName">
      <el-tab-pane label="页面" name="pages">
        <Pages v-if="activeName == 'pages'" @changeData="activeDataFunc"></Pages>
      </el-tab-pane>
      <el-tab-pane label="产品" name="product">
        <Product v-if="activeName == 'product'" @changeData="activeDataFunc"></Product>
      </el-tab-pane>
      <el-tab-pane v-if="supplier.is_release" label="供需" name="release">
        <Release v-if="activeName == 'release'" @changeData="activeDataFunc"></Release>
      </el-tab-pane>
    </el-tabs>
    <div slot="footer" class="dialog-footer d-b-c">
      <div class="flex-1">
        <div v-if="activeData != null" class="d-s-s d-c tl">
          <p class="text-ellipsis setlink-set-link">
            <span>当前链接:</span>
            <span class="gray9">{{ activeData.type }}</span>
            <span class="p-0-10 gray">/</span>
            <span class="blue">{{ activeData.name }}</span>
          </p>
          <p class="text-ellipsis gray" style="font-size: 10px;">{{ activeData.url }}</p>
        </div>
        <div v-else class="tl">
          暂无
        </div>
      </div>
      <div class="setlink-footer-btn">
        <el-button size="small" @click="dialogFormVisible(false)">取 消</el-button>
        <el-button size="small" type="primary" @click="dialogFormVisible(true)">确 定</el-button>
      </div>
    </div>
  </el-dialog>
</template>
 
<script>
import Product from './part/Product.vue';
import Pages from './part/Pages.vue';
import Release from './part/Release.vue';
import SettingApi from '@/api/setting.js';
export default {
  components: {
    Product,
    Pages,
    Release
  },
  data() {
    return {
      /*是否显示*/
      dialogVisible: true,
      /*选中的链接*/
      activeData: null,
      activeName: 'pages',
      /*供应商列*/
      supplier: []
    };
  },
  props: ['is_linkset'],
  created() {
    this.getSupplier();
    this.dialogVisible = this.is_linkset;
  },
  methods: {
    /*获取供应商列表*/
    getSupplier(){
      SettingApi.getSupplier().then(res => {
        console.log(res);
        this.supplier = res.data.model;
      })
      .catch(error => {
        this.loading = false;
      });
    },
    /*关闭弹窗*/
    dialogFormVisible(e) {
      if (e) {
        this.$emit('closeDialog', this.activeData);
      } else {
        this.$emit('closeDialog', null);
      }
    },
 
    /*页面返回值*/
    activeDataFunc(e) {
      this.activeData = e;
    }
  }
};
</script>
 
<style>
.marketing-box .el-tabs__item {
  font-size: 12px;
}
.setlink-footer-btn{ width: 160px;}
.setlink-set-link{ width: 500px;}
</style>