gyyg-components 0.3.4 → 0.3.5

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.3.04",
3
+ "version": "0.3.05",
4
4
  "private": false,
5
5
  "main": "lib/gyyg-components.umd.js",
6
6
  "scripts": {
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div>
2
+ <div :class="isCard ? 'card' : ''">
3
3
  <el-descriptions
4
4
  :column="column"
5
5
  :title="title"
@@ -9,7 +9,9 @@
9
9
  :class="!title ? 'no-title' : ''"
10
10
  >
11
11
  <template #title>
12
- <div class="title">{{ title }}</div>
12
+ <div class="title">
13
+ <el-icon :class="titleIcon"></el-icon><span>{{ title }}</span>
14
+ </div>
13
15
  <div class="top-content">
14
16
  <slot name="topContent"></slot>
15
17
  </div>
@@ -20,11 +22,10 @@
20
22
  :key="index"
21
23
  :label="item.label"
22
24
  :span="item.span || 1"
23
- :contentClassName="item.contentClassName || ''"
24
- :labelStyle="{width:labelWidth + 'px', textAlign: 'right'}"
25
+ :contentClassName="direction == 'vertical' ? 'vertical-content' : item.contentClassName || ''"
26
+ :labelStyle="direction == 'horizontal' ? { width: labelWidth + 'px', textAlign: 'right' } : {}"
25
27
  :contentStyle="item.contentStyle || {}"
26
- :labelClassName="item.labelClassName || ''"
27
-
28
+ :labelClassName="direction == 'vertical' ? 'vertical-label' : item.labelClassName || ''"
28
29
  >
29
30
  <div v-if="item.type === 'img'">
30
31
  <el-image
@@ -53,16 +54,23 @@
53
54
  <component
54
55
  :is="item.componentName"
55
56
  v-model="item.value"
57
+ :tableData="item"
56
58
  v-bind="typeof item.componentProps === 'function' ? item.componentProps(item) : item.componentProps"
57
59
  v-on="typeof item.componentListeners === 'function' ? item.componentListeners(item) : item.componentListeners || {}"
58
60
  />
59
61
  </div>
60
- <span v-else>{{ item.value }}</span>
62
+ <span
63
+ v-else
64
+ :style="!item.value ? 'color: #C0C4CC; font-style: italic;' : ''"
65
+ >{{ item.value || '未填写' }}</span>
61
66
  </el-descriptions-item>
62
67
  </el-descriptions>
63
68
  </div>
69
+
70
+
64
71
  </template>
65
72
  <script>
73
+ import styleText from '@/otherComponents/styleText.vue'
66
74
  export default {
67
75
  name: 'mec-descriptions',
68
76
  props: {
@@ -105,8 +113,20 @@ export default {
105
113
  type: [Number, String],
106
114
  default: 100
107
115
  },
116
+ isCard: {
117
+ type: Boolean,
118
+ default: false
119
+ },
120
+ titleIcon: {
121
+ type: String,
122
+ default: ''
123
+ },
108
124
 
109
125
  },
126
+ components: {
127
+ styleText
128
+ },
129
+
110
130
  }
111
131
  </script>
112
132
  <style lang="less" scoped>
@@ -144,7 +164,55 @@ export default {
144
164
  /deep/ .el-descriptions__body .el-descriptions__table .el-descriptions-item__cell {
145
165
  white-space: pre-wrap;
146
166
  }
167
+
147
168
  /deep/ .el-progress-bar {
148
169
  width: 200px
149
170
  }
171
+
172
+ /deep/ .el-descriptions-item__content {
173
+ color: #000;
174
+ }
175
+
176
+ .card {
177
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, .1);
178
+ margin-bottom: 20px;
179
+ border-radius: 8px;
180
+ overflow: hidden;
181
+
182
+ /deep/ .el-descriptions {
183
+ .el-descriptions__body {
184
+ padding: 0 10px;
185
+
186
+ .vertical-content {
187
+ padding-bottom: 20px;
188
+ color: #000;
189
+ }
190
+
191
+ .vertical-label {
192
+ padding-bottom: 0;
193
+ color: #606266;
194
+ }
195
+ }
196
+
197
+ .title {
198
+ background-color: #fff;
199
+ margin-bottom: 0;
200
+ display: flex;
201
+ align-items: center;
202
+ }
203
+
204
+ .el-descriptions__title {
205
+ padding: 10px 0;
206
+ border-bottom: 1px solid #ebeef5;
207
+
208
+ i {
209
+ font-size: 20px;
210
+ color: #1890ff;
211
+ margin-right: 5px;
212
+ }
213
+
214
+ }
215
+
216
+ }
217
+ }
150
218
  </style>
@@ -81,6 +81,11 @@ export default {
81
81
  }
82
82
  </script>
83
83
  <style lang="less" scoped>
84
+ /deep/ .el-button {
85
+ &:not(:disabled):hover {
86
+ transform: translateY(-1px);
87
+ }
88
+ }
84
89
  .btn-group {
85
90
  display: flex;
86
91
  align-items: center;
@@ -19,6 +19,10 @@
19
19
  :destroy-on-close="destroyOnClose"
20
20
  :modal='modal'
21
21
  >
22
+ <div slot="title" style="font-size: 16px; color: #303133;">
23
+ <el-icon :class="titleIcon" style="color: #1890ff; font-size: 18px;margin-right: 5px;"></el-icon>
24
+ <span>{{ title }}</span>
25
+ </div>
22
26
  <slot name="body" />
23
27
  <div v-if="footer" slot="footer">
24
28
  <slot name="footer" />
@@ -84,7 +88,11 @@ export default {
84
88
  dialogClass: {
85
89
  type: String,
86
90
  default: ""
87
- }
91
+ },
92
+ titleIcon: {
93
+ type: Boolean,
94
+ default: false,
95
+ },
88
96
  },
89
97
  data() {
90
98
  return {
@@ -20,6 +20,9 @@ export default {
20
20
 
21
21
  },
22
22
  },
23
+ created() {
24
+ console.log(this.tableData)
25
+ },
23
26
  computed: {
24
27
  statusStyle() {
25
28
  if (this.tableData.statusStyle) return this.tableData.statusStyle(this.scope.row);