Kaynağa Gözat

feat: userTag

zhengxy 1 yıl önce
ebeveyn
işleme
3a7525f01d

+ 51 - 0
project/src/components/assembly/screen/userTag.vue

@@ -0,0 +1,51 @@
1
+<template>
2
+  <div class="customerServiceTagBox">
3
+    <div class="customerServiceTag" :style="tagStyle"><i :class="icon"></i> <span><slot /></span></div>
4
+  </div>
5
+</template>
6
+
7
+<script>
8
+export default {
9
+  props: {
10
+    icon: {
11
+      type: String,
12
+      default: () => 'el-icon-user-solid',
13
+    },
14
+    bgColor: {
15
+      type: String,
16
+      default: () => '#00b38a',
17
+    },
18
+  },
19
+  data() {
20
+    return {
21
+      tagStyle: {
22
+        backgroundColor: this.bgColor,
23
+        borderColor: this.bgColor,
24
+      },
25
+    }
26
+  },
27
+}
28
+</script>
29
+
30
+<style lang="scss" scoped>
31
+.customerServiceTagBox {
32
+  display: flex;
33
+  flex-wrap: wrap;
34
+  justify-content: center;
35
+  .customerServiceTag {
36
+    display: flex;
37
+    align-items: center;
38
+    background: #00b38a;
39
+    border-radius: 4px;
40
+    border: 1px solid #00b38a;
41
+    color: #ffffff;
42
+    font-size: 12px;
43
+    margin: 2px;
44
+    padding: 0 3px;
45
+    word-wrap: break-word;
46
+    i {
47
+      margin-top: 2px;
48
+    }
49
+  }
50
+}
51
+</style>

+ 4 - 5
project/src/components/smartPush/ruleList.vue

@@ -21,10 +21,8 @@
21 21
     <el-table ref="multipleTable" :height="height" :data="tableData" tooltip-effect="dark" style="width: 100%">
22 22
       <el-table-column prop="name" label="标题" show-overflow-tooltip align="center" min-width="120" />
23 23
       <el-table-column label="创建人" align="center" min-width="120">
24
-        <template slot-scope="scope">
25
-          <div class="customerServiceTagBox">
26
-            <div class="customerServiceTag"><i class="el-icon-user-solid"></i> {{ scope.row.creator }}</div>
27
-          </div>
24
+        <template slot-scope="{ row }">
25
+          <userTag icon="el-icon-user-solid" bgColor="#00b38a">{{ row.creator }}</userTag>
28 26
         </template>
29 27
       </el-table-column>
30 28
       <el-table-column prop="desc" label="规则" align="center" min-width="200" />
@@ -66,9 +64,10 @@
66 64
 <script>
67 65
 import datePicker from '@/components/assembly/screen/datePicker.vue'
68 66
 import selfChannel from '@/components/assembly/screen/channel.vue'
67
+import userTag from '@/components/assembly/screen/userTag.vue'
69 68
 import createMassMsg from './createMassMsg.vue'
70 69
 export default {
71
-  components: { datePicker, selfChannel, createMassMsg, },
70
+  components: { datePicker, selfChannel, createMassMsg, userTag },
72 71
   data () {
73 72
     return {
74 73
       massMsgFlag: false,