meixioacomponent 0.3.40 → 0.3.44

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
  },
@@ -185,7 +185,9 @@
185
185
  type="textarea"
186
186
  v-model="module"
187
187
  :disabled="isDisabled"
188
+ :maxlength="config.maxlength"
188
189
  v-if="config.type == 'textarea'"
190
+ :show-word-limit="config.maxlength ? true : false"
189
191
  ></el-input>
190
192
  <!-- 插槽 -->
191
193
  <slot name="template" v-else-if="config.type == 'template'"></slot>
@@ -554,7 +556,11 @@ export default {
554
556
  }
555
557
  }
556
558
  .textarea {
557
- border: 2px solid var(--color-gray-d);
559
+ border: 0px;
560
+ padding: 0px;
561
+ &:hover {
562
+ border-color: transparent !important ;
563
+ }
558
564
  }
559
565
 
560
566
  .bottom-handle-wrap {
@@ -1,112 +1,103 @@
1
1
  <template>
2
- <el-dropdown
3
- slot="suffix"
4
- trigger="click"
5
- ref="dropdown"
6
- @visible-change="setDragConfigList"
2
+ <base-popover-button
3
+ iconClass="element"
4
+ v-model="popoverFlag"
5
+ @popoverShow="setDragConfigList"
6
+ buttonIcon="el-icon-s-operation"
7
7
  >
8
- <el-button
9
- type="info"
10
- size="small"
11
- class="dropdown-button"
12
- icon="el-icon-s-operation"
13
- plain
14
- ></el-button>
15
- <el-dropdown-menu slot="dropdown">
16
- <div class="config-wrap">
17
- <span class="tips-text">显示列表项</span>
18
- <div class="config-content">
19
- <!-- 显示被固定在头部的列表 -->
20
- <div class="fixed">
8
+ <div class="config-wrap" slot="popoverContent">
9
+ <span class="tips-text">显示列表项</span>
10
+ <div class="config-content">
11
+ <!-- 显示被固定在头部的列表 -->
12
+ <div class="fixed">
13
+ <div
14
+ class="config-item-wrap"
15
+ :key="index"
16
+ v-for="(item, index) in lockConfigList"
17
+ >
18
+ <div class="item-left" @click="showTableColum(item)">
19
+ <el-checkbox
20
+ v-model="item.show"
21
+ :disabled="item.lock ? true : false"
22
+ ></el-checkbox>
23
+ <span class="item-text">{{ item.label }}</span>
24
+ </div>
25
+ </div>
26
+ </div>
27
+ <!-- 可以拖拽的列表 -->
28
+
29
+ <div class="drag">
30
+ <draggable
31
+ element="div"
32
+ v-model="dragConfigList"
33
+ animation="500"
34
+ @start="onStart"
35
+ @end="onEnd"
36
+ >
21
37
  <div
22
38
  class="config-item-wrap"
23
39
  :key="index"
24
- v-for="(item, index) in lockConfigList"
40
+ v-for="(item, index) in dragConfigList"
25
41
  >
26
- <div class="item-left" @click="showTableColum(item)">
42
+ <div class="item-left" @click.self="showTableColum(item)">
27
43
  <el-checkbox
28
44
  v-model="item.show"
29
- :disabled="item.lock?true:false"
45
+ :disabled="item.lock"
30
46
  ></el-checkbox>
31
47
  <span class="item-text">{{ item.label }}</span>
32
48
  </div>
33
- </div>
34
- </div>
35
- <!-- 可以拖拽的列表 -->
36
-
37
- <div class="drag">
38
- <draggable
39
- element="div"
40
- v-model="dragConfigList"
41
- animation="500"
42
- @start="onStart"
43
- @end="onEnd"
44
- >
45
- <div
46
- class="config-item-wrap"
47
- :key="index"
48
- v-for="(item, index) in dragConfigList"
49
- >
50
- <div class="item-left" @click.self="showTableColum(item)">
51
- <el-checkbox
52
- v-model="item.show"
53
- :disabled="item.lock"
54
- ></el-checkbox>
55
- <span class="item-text">{{ item.label }}</span>
56
- </div>
57
- <div class="item-right">
58
- <base-icon
59
- :name="`meixicomponenticon-tuozhuai`"
60
- :size="`s`"
61
- :color="`m`"
62
- ></base-icon>
63
- </div>
49
+ <div class="item-right">
50
+ <base-icon
51
+ :name="`meixicomponenticon-tuozhuai`"
52
+ :size="`s`"
53
+ :color="`m`"
54
+ ></base-icon>
64
55
  </div>
65
- </draggable>
66
- </div>
56
+ </div>
57
+ </draggable>
67
58
  </div>
68
- <baseButtonHandle
69
- :align="`end`"
70
- :size="`mini`"
71
- class="config-footer"
72
- :config="handleConfig"
73
- ></baseButtonHandle>
74
59
  </div>
75
- </el-dropdown-menu>
76
- </el-dropdown>
60
+ <baseButtonHandle
61
+ :align="`end`"
62
+ :size="`mini`"
63
+ class="config-footer"
64
+ :config="handleConfig"
65
+ ></baseButtonHandle>
66
+ </div>
67
+ </base-popover-button>
77
68
  </template>
78
69
 
79
70
  <script>
80
- import draggable from "vuedraggable";
81
-
82
- import baseButtonHandle from "../base/baseButtonHandle/baseButtonHandle.vue";
71
+ import draggable from 'vuedraggable'
72
+ import baseButtonHandle from '../base/baseButtonHandle/baseButtonHandle.vue'
83
73
  export default {
84
74
  data() {
85
75
  return {
76
+ isDrag: false,
86
77
  handleConfig: [],
87
78
  dragConfigList: [],
88
- isDrag: false,
89
- };
79
+ popoverFlag: false,
80
+ }
90
81
  },
91
82
  created() {
92
83
  this.handleConfig = [
93
84
  {
94
- text: "取消",
95
- type: "info",
85
+ text: '取消',
86
+ type: 'info',
96
87
  plain: true,
97
88
  click: () => {
98
- this.$refs.dropdown.hide();
89
+ this.popoverFlag = false
99
90
  },
100
91
  },
101
92
  {
102
- text: "确定",
103
- type: "primary",
93
+ text: '确定',
94
+ type: 'primary',
104
95
  plain: false,
105
96
  click: () => {
106
- this.setTableHeaderConfig();
97
+ this.setTableHeaderConfig()
107
98
  },
108
99
  },
109
- ];
100
+ ]
110
101
  },
111
102
  components: {
112
103
  draggable,
@@ -121,42 +112,40 @@ export default {
121
112
  computed: {
122
113
  lockConfigList() {
123
114
  return this.$props.config.filter((item) => {
124
- return item.lock;
125
- });
115
+ return item.lock
116
+ })
126
117
  },
127
118
  },
128
119
  methods: {
129
120
  onEnd() {
130
- this.isDrag = true;
121
+ this.isDrag = true
131
122
  },
132
123
  onStart() {},
133
- setDragConfigList(event) {
134
- if (event) {
135
- this.isDrag = false;
136
- this.dragConfigList = [];
137
- this.dragConfigList = this.$props.config.filter((item) => {
138
- return item.key != "noData" && !item.lock;
139
- });
140
- }
124
+ setDragConfigList() {
125
+ this.isDrag = false
126
+ this.dragConfigList = []
127
+ this.dragConfigList = this.$props.config.filter((item) => {
128
+ return item.key != 'noData' && !item.lock
129
+ })
141
130
  },
142
131
  showTableColum(item) {
143
- if (item.lock) return;
144
- item.show = !item.show;
132
+ if (item.lock) return
133
+ item.show = !item.show
145
134
  },
146
135
  setTableHeaderConfig() {
147
136
  if (this.isDrag) {
148
- this.$emit("setTableHeaderConfig", this.dragConfigList);
137
+ this.$emit('setTableHeaderConfig', this.dragConfigList)
149
138
  }
150
- this.$refs.dropdown.hide();
139
+ this.popoverFlag = false
151
140
  },
152
141
  },
153
- };
142
+ }
154
143
  </script>
155
144
 
156
145
  <style lang="less" scoped>
157
146
  .config-wrap {
158
147
  width: 240px;
159
- height: auto;
148
+ min-height: 66px;
160
149
  max-height: 370px;
161
150
  background: inherit;
162
151
  box-sizing: border-box;
@@ -170,7 +159,7 @@ export default {
170
159
  .config-content {
171
160
  width: 100%;
172
161
  overflow-y: auto;
173
- max-height: calc(100% - 46px);
162
+ max-height: calc(370px - 56px);
174
163
  .config-item-wrap {
175
164
  width: 100%;
176
165
  height: 34px;