meixioacomponent 0.3.42 → 0.3.46

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.
@@ -10,7 +10,7 @@
10
10
  ref="inputFile"
11
11
  :accept="accept"
12
12
  @change="valueChange"
13
- style="display: none"
13
+ style="display: none;"
14
14
  v-if="type == 'upload'"
15
15
  :multiple="uploadType == 'single' ? false : true"
16
16
  />
@@ -31,10 +31,11 @@
31
31
  :name="`el-icon-upload`"
32
32
  ></base-icon>
33
33
  <div class="upload-notic-wrap" :class="{ disabled: disabled }">
34
- <span @click="clickFile">点击上传<br /></span
35
- ><span class="primary-color"
36
- >或点击该处后Ctrl+V 黏贴QQ或微信截图</span
37
- >
34
+ <span @click="clickFile">
35
+ 点击上传
36
+ <br />
37
+ </span>
38
+ <span class="primary-color">或点击该处后Ctrl+V 黏贴QQ或微信截图</span>
38
39
  </div>
39
40
  </div>
40
41
  </div>
@@ -59,15 +60,16 @@
59
60
  </template>
60
61
 
61
62
  <script>
62
- import baseImgVue from "../baseImg/baseImg.vue";
63
+ import baseImgVue from '../baseImg/baseImg.vue'
63
64
 
64
- import { baseUploadMixins } from "./mixins";
65
+ import { baseUploadMixins } from './mixins'
65
66
  export default {
66
- name: "baseUploadItem",
67
+ name: 'baseUploadItem',
67
68
  data() {
68
- return {};
69
+ return {}
69
70
  },
70
- created() {},
71
+
72
+ mounted() {},
71
73
  mixins: [baseUploadMixins],
72
74
  components: {
73
75
  baseImgVue,
@@ -75,17 +77,17 @@ export default {
75
77
  props: {
76
78
  type: {
77
79
  type: String,
78
- default: "upload",
80
+ default: 'upload',
79
81
  },
80
82
 
81
83
  uploadType: {
82
84
  type: String,
83
- default: "single",
85
+ default: 'single',
84
86
  },
85
87
 
86
88
  fileType: {
87
89
  type: String,
88
- default: "other",
90
+ default: 'other',
89
91
  },
90
92
 
91
93
  uploadItem: {},
@@ -93,7 +95,7 @@ export default {
93
95
  shape: {
94
96
  // square rect cir
95
97
  type: String,
96
- default: "rect",
98
+ default: 'rect',
97
99
  },
98
100
 
99
101
  value: {
@@ -108,124 +110,120 @@ export default {
108
110
  type: Boolean,
109
111
  default: false,
110
112
  },
113
+ isGroup: {
114
+ default: false,
115
+ },
111
116
  },
112
117
  computed: {
113
118
  module: {
114
119
  get() {
115
- return this.$props.value;
120
+ return this.$props.value
116
121
  },
117
122
  set(val) {
118
- this.$emit("input", val);
123
+ this.$emit('input', val)
119
124
  },
120
125
  },
121
126
 
122
127
  imgSrc() {
123
- if (this.isGroup) {
124
- if (!this.uploadItem?.url) {
125
- return "";
126
- }
127
- return this.uploadItem.url;
128
+ if (this.module) {
129
+ return this.module[0]?.url
128
130
  } else {
129
- return this.module[0]?.url;
131
+ return this.uploadItem.url
130
132
  }
131
133
  },
132
134
 
133
135
  accept() {
134
- let accept = "";
135
- let fileType = this.$props.fileType;
136
+ let accept = ''
137
+ let fileType = this.$props.fileType
136
138
  switch (fileType) {
137
- case "img":
138
- accept = "image/*";
139
- break;
140
- case "other":
141
- accept = "";
142
- break;
139
+ case 'img':
140
+ accept = 'image/*'
141
+ break
142
+ case 'other':
143
+ accept = ''
144
+ break
143
145
  default:
144
- break;
146
+ break
145
147
  }
146
- return accept;
148
+ return accept
147
149
  },
148
150
 
149
151
  isUploadProImg() {
150
- let props = this.$props;
152
+ let props = this.$props
151
153
  return (
152
- props.shape == "pro" &&
153
- props.fileType == "img" &&
154
- props.uploadType == "single"
155
- );
156
- },
157
-
158
- isGroup() {
159
- return this.$parent.$options.name == "baseUpload";
154
+ props.shape == 'pro' &&
155
+ props.fileType == 'img' &&
156
+ props.uploadType == 'single'
157
+ )
160
158
  },
161
159
  },
162
160
  methods: {
163
161
  clickFile() {
164
- const { disabled } = this.$props;
165
- if (disabled) return;
166
- this.$refs.inputFile.click();
162
+ const { disabled } = this.$props
163
+ if (disabled) return
164
+ this.$refs.inputFile.click()
167
165
  },
168
166
 
169
167
  async returnFiles(files) {
170
- let list = [];
168
+ let list = []
171
169
  for (let i = 0; i < files.length; i++) {
172
170
  let obj = {
173
171
  url: null,
174
172
  process: 0,
175
173
  file: files[i],
176
- };
177
- list.push(obj);
174
+ }
175
+ list.push(obj)
178
176
  }
179
- return list;
177
+ return list
180
178
  },
181
179
 
182
180
  async valueChange(e) {
183
- let files = e.target.files;
184
- let list = await this.returnFiles(files);
185
- this.emitEvent(list);
186
- this.$refs.inputFile.value = "";
181
+ let files = e.target.files
182
+ let list = await this.returnFiles(files)
183
+ this.emitEvent(list)
184
+ this.$refs.inputFile.value = ''
187
185
  },
188
186
 
189
187
  emitEvent(list) {
190
188
  if (this.isGroup) {
191
- this.$emit("inputChange", list);
189
+ this.$emit('inputChange', list)
192
190
  } else {
193
- this.inputChange(list);
191
+ this.inputChange(list)
194
192
  }
195
193
  },
196
194
 
197
195
  handleDeleteUploadItem() {
198
196
  if (this.isGroup) {
199
- this.$emit("handleDeleteUploadItem");
197
+ this.$emit('handleDeleteUploadItem')
200
198
  } else {
201
- this.module = [];
199
+ this.module = []
202
200
  }
203
201
  },
204
202
 
205
203
  async onPasteFile() {
206
- const { disabled } = this.$props;
207
- if (this.uploadLoading || disabled) return;
208
- const items = (event.clipboardData || window.clipboardData).items;
209
- const rowList = [];
210
- if (this.fileType == "img") {
204
+ const { disabled } = this.$props
205
+ if (this.uploadLoading || disabled) return
206
+ const items = (event.clipboardData || window.clipboardData).items
207
+ const rowList = []
208
+ if (this.fileType == 'img') {
211
209
  for (var i = 0; i < items.length; i++) {
212
- if (items[i].type.indexOf("image") !== -1) {
213
- let file = items[i].getAsFile(); // getAsFile 如果拖拽项的对象是一个文件, 则返回 File 对象; 否则返回 null
214
- rowList.push(file);
210
+ if (items[i].type.indexOf('image') !== -1) {
211
+ let file = items[i].getAsFile() // getAsFile 如果拖拽项的对象是一个文件, 则返回 File 对象; 否则返回 null
212
+ rowList.push(file)
215
213
  }
216
214
  }
217
215
  } else {
218
216
  for (var i = 0; i < items.length; i++) {
219
- let file = items[i].getAsFile(); // getAsFile 如果拖拽项的对象是一个文件, 则返回 File 对象; 否则返回 null
220
- rowList.push(file);
217
+ let file = items[i].getAsFile() // getAsFile 如果拖拽项的对象是一个文件, 则返回 File 对象; 否则返回 null
218
+ rowList.push(file)
221
219
  }
222
220
  }
223
- if (rowList.length <= 0) return;
224
- let list = await this.returnFiles(rowList);
225
- this.emitEvent(list);
221
+ if (rowList.length <= 0) return
222
+ let list = await this.returnFiles(rowList)
223
+ this.emitEvent(list)
226
224
  },
227
225
  },
228
- };
226
+ }
229
227
  </script>
230
228
 
231
229
  <style lang="less" scoped>
@@ -309,6 +307,11 @@ export default {
309
307
  height: auto;
310
308
  display: none;
311
309
  position: absolute;
310
+ border-radius: var(--radius);
311
+ background: rgba(0, 0, 0, 0.3);
312
+ /deep/ i {
313
+ color: var(--text-white) !important;
314
+ }
312
315
  }
313
316
  }
314
317
  }
@@ -6,8 +6,12 @@ export const baseUploadMixins = {
6
6
  dynamicmount: null,
7
7
  };
8
8
  },
9
- mounted() {},
10
- beforeDestroy() {},
9
+ created() {
10
+ },
11
+ mounted() {
12
+
13
+ },
14
+ beforeDestroy() { },
11
15
 
12
16
  props: {
13
17
  uploadPath: {
@@ -15,6 +19,7 @@ export const baseUploadMixins = {
15
19
  return [0, 1];
16
20
  },
17
21
  },
22
+
18
23
  },
19
24
  computed: {
20
25
  isMax() {
@@ -52,7 +57,9 @@ export const baseUploadMixins = {
52
57
  },
53
58
 
54
59
  uploadEd(list) {
55
- this.module = list;
60
+ if (!this.isGroup) {
61
+ this.module = list;
62
+ }
56
63
  this.uploadLoading = false;
57
64
  this.$emit("uploadEd", list);
58
65
  },
@@ -26,9 +26,9 @@
26
26
  v-if="config.type == 'radio'"
27
27
  >
28
28
  <el-radio-button
29
- :key="index"
29
+ :key="item.value"
30
30
  :label="item.value"
31
- v-for="(item, index) in config.list"
31
+ v-for="item in config.list"
32
32
  >
33
33
  {{ item.label }}
34
34
  </el-radio-button>
@@ -556,7 +556,11 @@ export default {
556
556
  }
557
557
  }
558
558
  .textarea {
559
- border: 2px solid var(--color-gray-d);
559
+ border: 0px;
560
+ padding: 0px;
561
+ &:hover {
562
+ border-color: transparent !important ;
563
+ }
560
564
  }
561
565
 
562
566
  .bottom-handle-wrap {
@@ -142,11 +142,12 @@
142
142
 
143
143
  <span
144
144
  v-else
145
- :class="
146
- item.click
147
- ? 'cell-content-text active'
148
- : `cell-content-text ${item.color}`
149
- "
145
+ class="cell-content-text"
146
+ :class="[
147
+ item.fun ? 'fun' : '',
148
+ item.click ? 'primary' : '',
149
+ item.color ? item.color : '',
150
+ ]"
150
151
  @click="rowClick(item, scope.row)"
151
152
  >
152
153
  {{ scope.row[`${item.key}`] }}
@@ -243,6 +244,9 @@ export default {
243
244
  borderRow: true,
244
245
  // 倒计时
245
246
  triggerDown: null,
247
+
248
+ // 组件销毁时重置的class 配合 LinkViewClass使用
249
+ _linkViewClassSubs: null,
246
250
  }
247
251
  },
248
252
  created() {
@@ -255,6 +259,9 @@ export default {
255
259
  beforeDestroy() {
256
260
  componentConfig.eventBus.$off('handleTableBorder', this.handleTableBorder)
257
261
  clearTimeout(this.triggerDown)
262
+ if (this._linkViewClassSubs) {
263
+ this._linkViewClassSubs.init()
264
+ }
258
265
  },
259
266
  computed: {
260
267
  config() {
@@ -637,7 +644,22 @@ export default {
637
644
 
638
645
  let screenResult = this.returnProScreenResult()
639
646
  this.$props.httpRequire(screenResult).then((res) => {
640
- this.setTableData(res)
647
+ let isArray = res instanceof Array
648
+ if (isArray) {
649
+ this.setTableData(res)
650
+ } else {
651
+ const tableData = res.tableData
652
+ if (
653
+ res._class.__proto__.__proto__.constructor.name ==
654
+ 'LinkViewClass' &&
655
+ !this._linkViewClassSubs
656
+ ) {
657
+ this._linkViewClassSubs = res._class
658
+ }
659
+ if (tableData) {
660
+ this.setTableData(tableData)
661
+ }
662
+ }
641
663
  })
642
664
  },
643
665
  // 设置表格数据
@@ -786,7 +808,6 @@ export default {
786
808
  })
787
809
  },
788
810
  sortChange(column) {
789
- console.log('sort')
790
811
  this.tableData = this.tableData.sort(
791
812
  this.sortFun(
792
813
  column.prop,
@@ -822,7 +843,6 @@ export default {
822
843
  return index == tableConfig.length - 1
823
844
  },
824
845
  },
825
- watch: {},
826
846
  }
827
847
  </script>
828
848
 
@@ -11513,7 +11513,7 @@
11513
11513
  resize: vertical;
11514
11514
  padding: var(--padding-2) var(--padding-3);
11515
11515
  line-height: 1.5;
11516
- border: 0px !important;
11516
+ border: 2px solid var(--color-gray-d) !important;
11517
11517
  -webkit-box-sizing: border-box;
11518
11518
  box-sizing: border-box;
11519
11519
  width: 100%;
@@ -11527,6 +11527,10 @@
11527
11527
  transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
11528
11528
  }
11529
11529
 
11530
+ .el-textarea__inner:hover {
11531
+ border-color: var(--color-primary) !important;
11532
+ }
11533
+
11530
11534
  .el-textarea__inner::-webkit-input-placeholder {
11531
11535
  color: #8f959e;
11532
11536
  }
package/src/App.vue CHANGED
@@ -2,6 +2,7 @@
2
2
  <div id="app">
3
3
  <div style="height: 100vh;">
4
4
  <test></test>
5
+ <!-- <base-upload v-model="test"></base-upload> -->
5
6
  </div>
6
7
  </div>
7
8
  </template>
@@ -11,8 +12,9 @@ import test from './component/test.vue'
11
12
 
12
13
  import BaseArea from '../packages/components/base/baseArea/baseArea.vue'
13
14
  import BaseTimeLine from '../packages/components/base/baseTimeLine/baseTimeLine.vue'
15
+ import BaseUpload from '../packages/components/base/baseUpload/baseUpload.vue'
14
16
  export default {
15
- components: { test, BaseArea, BaseTimeLine },
17
+ components: { test, BaseArea, BaseTimeLine, BaseUpload },
16
18
  data() {
17
19
  return {
18
20
  test: [],
@@ -28,6 +30,23 @@ export default {
28
30
  value3: [],
29
31
 
30
32
  flag: false,
33
+ infoList: [
34
+ {
35
+ label: '手机号(登录名)',
36
+ value: '18626860059',
37
+ key: 'phone',
38
+ },
39
+ {
40
+ label: '姓名',
41
+ value: '余群',
42
+ key: 'accountname',
43
+ },
44
+ {
45
+ label: '部门',
46
+ value: '技术部',
47
+ key: 'deptName',
48
+ },
49
+ ],
31
50
  }
32
51
  },
33
52
  mounted() {},