gyyg-components 0.2.23 → 0.2.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gyyg-components",
3
- "version": "0.2.23",
3
+ "version": "0.2.25",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -1,6 +1,13 @@
1
1
  <template>
2
2
  <div>
3
- <el-descriptions :column="column" :title="title" :extra="extra" :direction="direction" :border="border">
3
+ <el-descriptions
4
+ :column="column"
5
+ :title="title"
6
+ :extra="extra"
7
+ :direction="direction"
8
+ :border="border"
9
+ :class="!title ? 'no-title' : ''"
10
+ >
4
11
  <template #title>
5
12
  <div class="title">{{ title }}</div>
6
13
  <div class="top-content">
@@ -9,21 +16,48 @@
9
16
  </div>
10
17
  </template>
11
18
 
12
- <el-descriptions-item v-for="(item, index) in detailsData" :key="index" :label="item.label" :span="item.span || 1">
19
+ <el-descriptions-item
20
+ v-for="(item, index) in detailsData"
21
+ :key="index"
22
+ :label="item.label"
23
+ :span="item.span || 1"
24
+ :contentClassName="item.contentClassName || ''"
25
+ :labelStyle="{width:labelWidth + 'px', textAlign: 'right'}"
26
+ :contentStyle="item.contentStyle || {}"
27
+ :labelClassName="item.labelClassName || ''"
28
+
29
+ >
13
30
  <div v-if="item.type === 'img'">
14
- <el-image
31
+ <el-image
15
32
  v-for="(url, index) in item.value"
16
33
  :key="index"
17
34
  style="width: 100px; height: 100px; margin-right: 10px;"
18
- :src="url"
19
- :preview-src-list="item.value">
35
+ :src="url"
36
+ :preview-src-list="item.value"
37
+ >
20
38
  </el-image>
21
39
  </div>
22
40
  <div v-else-if="item.type === 'voice'">
23
- <audio controls="controls" style="width: 240px; height: 40px;" v-for="item in item.value" :key="item.id">
24
- <source :src="item" type="audio/mp3">
41
+ <audio
42
+ controls="controls"
43
+ style="width: 240px; height: 40px;"
44
+ v-for="item in item.value"
45
+ :key="item.id"
46
+ >
47
+ <source
48
+ :src="item"
49
+ type="audio/mp3"
50
+ >
25
51
  </audio>
26
52
  </div>
53
+ <div v-else-if="item.type === 'custom'">
54
+ <component
55
+ :is="item.componentName"
56
+ v-model="item.value"
57
+ v-bind="typeof item.componentProps === 'function' ? item.componentProps(item) : item.componentProps"
58
+ v-on="typeof item.componentListeners === 'function' ? item.componentListeners(item) : item.componentListeners || {}"
59
+ />
60
+ </div>
27
61
  <span v-else>{{ item.value }}</span>
28
62
  </el-descriptions-item>
29
63
  </el-descriptions>
@@ -67,7 +101,12 @@ export default {
67
101
  border: {
68
102
  type: Boolean,
69
103
  default: false
70
- }
104
+ },
105
+ labelWidth: {
106
+ type: [Number, String],
107
+ default: 100
108
+ },
109
+
71
110
  },
72
111
  }
73
112
  </script>
@@ -75,6 +114,13 @@ export default {
75
114
  /deep/ .el-descriptions__header {
76
115
  display: block;
77
116
  }
117
+
118
+ .no-title {
119
+ /deep/ .el-descriptions__header {
120
+ display: none;
121
+ }
122
+ }
123
+
78
124
  .title {
79
125
  padding-left: 10px;
80
126
  height: 30px;
@@ -85,14 +131,17 @@ export default {
85
131
  color: #606266;
86
132
  font-size: 14px;
87
133
  }
134
+
88
135
  .top-content {
89
136
  color: #606266;
90
137
  font-size: 14px;
91
138
  font-weight: normal;
92
139
  }
140
+
93
141
  /deep/ .el-descriptions-item__label {
94
142
  white-space: nowrap;
95
143
  }
144
+
96
145
  /deep/ .el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
97
146
  white-space: pre-wrap;
98
147
  }
@@ -67,6 +67,7 @@
67
67
  :key="index + 'header'"
68
68
  :fixed="col.fixed"
69
69
  :min-width="col.minWidth"
70
+ :align="col.align"
70
71
  >
71
72
  <el-table-column
72
73
  v-for="(item, subIndex) in col.headerList"
@@ -2,7 +2,7 @@
2
2
  <div>
3
3
  <span class="default-text" :style="[statusStyle]" v-if="tableData.columnType == 'text'"
4
4
  :class="tableData.getClass ? tableData.getClass(scope.row) : ''">{{ getText(tableData.bind) }}</span>
5
- <el-button v-if="tableData.columnType == 'button'" size="mini" plain round :type="tableData.setType(this.scope.row)">{{ getText(tableData.bind) }}</el-button>
5
+ <el-button v-if="tableData.columnType == 'button' && getText(tableData.bind)" size="mini" plain round :type="tableData.setType(this.scope.row)">{{ getText(tableData.bind) }}</el-button>
6
6
  </div>
7
7
  </template>
8
8
  <script>