meixioacomponent 0.2.86 → 0.2.89

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": "meixioacomponent",
3
- "version": "0.2.86",
3
+ "version": "0.2.89",
4
4
  "private": false,
5
5
  "author": "YuRi",
6
6
  "main": "lib/meixioacomponent.umd.min.js",
@@ -1,3 +1,4 @@
1
+ import componentConfig from "../../../config/componentConfig";
1
2
  import useUpload from "../../../config/use/UseUpload";
2
3
  export const baseUploadMixins = {
3
4
  data() {
@@ -8,6 +9,13 @@ export const baseUploadMixins = {
8
9
  mounted() {},
9
10
  beforeDestroy() {},
10
11
 
12
+ props: {
13
+ uploadPath: {
14
+ default: () => {
15
+ return [0, 1];
16
+ },
17
+ },
18
+ },
11
19
  computed: {
12
20
  isMax() {
13
21
  if (this.module.length >= this.$props.max) {
@@ -28,6 +36,8 @@ export const baseUploadMixins = {
28
36
  this.module.push(list[i]);
29
37
  }
30
38
  }
39
+ const { uploadPath } = this.$props;
40
+ componentConfig.setUploadUrl(uploadPath[0], uploadPath[1]);
31
41
  if (!this.uploadLoading) {
32
42
  useUpload.toUpload(this.module ? this.module : list, this.uploadEd);
33
43
  }
@@ -52,9 +52,10 @@
52
52
  "
53
53
  ></baseAreaVue>
54
54
  <baseUploadVue
55
+ v-model="item.value"
55
56
  :max="formConfig.max"
56
57
  v-if="formType == `upload`"
57
- v-model="item.value"
58
+ :uploadPath="item.uploadPath"
58
59
  :class="[`form-item-${item.key}`]"
59
60
  ></baseUploadVue>
60
61
  </el-form-item>
@@ -188,9 +189,13 @@ export default {
188
189
 
189
190
  formdata() {
190
191
  let obj = {};
192
+
191
193
  this.module.forEach((item) => {
192
- obj[`${item.key}`] = item.value;
194
+ if (!item.renderHide) {
195
+ obj[`${item.key}`] = item.value;
196
+ }
193
197
  });
198
+
194
199
  return obj;
195
200
  },
196
201
 
@@ -223,7 +228,11 @@ export default {
223
228
  this.setChunkLength();
224
229
  },
225
230
  setChunkLength() {
226
- if (this.$props.rowNumber) {
231
+ const { formConfig } = this.$props;
232
+ if (formConfig.rowNumber) {
233
+ this.chunkLength = formConfig.rowNumber;
234
+ return;
235
+ } else if (this.$props.rowNumber) {
227
236
  this.chunkLength = this.$props.rowNumber;
228
237
  return;
229
238
  }
@@ -268,10 +277,7 @@ export default {
268
277
  let confrim = true;
269
278
  const rulesItem = this.$props.rules[params.config.key];
270
279
  if (rulesItem) {
271
- console.log(rulesItem);
272
- console.log(this.$refs.form);
273
280
  this.$refs.form.validateField(`${params.config.key}`, (errorMsg) => {
274
- console.log(errorMsg);
275
281
  if (errorMsg) {
276
282
  confrim = false;
277
283
  }
@@ -355,7 +361,7 @@ export default {
355
361
  if (this.loading) {
356
362
  setTimeout(() => {
357
363
  this.loading = false;
358
- }, 1500);
364
+ }, 750);
359
365
  }
360
366
  },
361
367
  },
@@ -130,7 +130,7 @@
130
130
  :size="size"
131
131
  ref="target"
132
132
  placeholder="选择日期"
133
- value-format="timestamp"
133
+ value-format="yyyy-MM-dd HH:mm:ss"
134
134
  :disabled="config.disabled"
135
135
  :prefix-icon="`el-icon-time`"
136
136
  style="width: 100%; height: 100%"
@@ -224,7 +224,7 @@ export default {
224
224
  mounted() {
225
225
  this.$nextTick(() => {
226
226
  if (this.$props.disableWatcher) {
227
- // this.triggerDisable();
227
+ this.triggerDisable(this.$props.value);
228
228
  }
229
229
  });
230
230
  },
@@ -351,9 +351,7 @@ export default {
351
351
  return this.$props.value;
352
352
  },
353
353
  set(val) {
354
- console.log(val);
355
354
  this.$emit("input", val);
356
- console.log(this.$props.disableWatcher);
357
355
  if (this.$props.disableWatcher) {
358
356
  this.triggerDisable(val);
359
357
  }
@@ -424,8 +422,8 @@ export default {
424
422
  type: item.type,
425
423
  result: item.fn(val),
426
424
  };
427
- console.log(obj);
428
425
 
426
+ console.log(val);
429
427
  this.$emit("disableWatcherResult", obj);
430
428
  });
431
429
  },
@@ -6,15 +6,20 @@ const componentConfig = {
6
6
  router: null,
7
7
  dynamicId: 0,
8
8
  uploadUrl: null,
9
+ uploadPrefix: null,
9
10
  eventBus: new Vue(),
10
11
  selectStore: null,
11
-
12
+ uploadStoreList: ["meixidev"],
12
13
  setDynamicId: () => {
13
14
  componentConfig.dynamicId += 1;
14
15
  },
15
16
 
16
- setUploadUrl: (url) => {
17
- componentConfig.uploadUrl = url;
17
+ setUploadPrefix: (url) => {
18
+ componentConfig.uploadPrefix = url;
19
+ },
20
+
21
+ setUploadUrl: (storeType, uploadType) => {
22
+ componentConfig.uploadUrl = `${componentConfig.uploadStoreList[storeType]}/${uploadType}/upload`;
18
23
  },
19
24
 
20
25
  initConfig: (_store, _router) => {
@@ -6,7 +6,7 @@ const ossInstance = (params, uploadProgressFn) => {
6
6
  // 创建 axios 实例
7
7
  const instance = axios.create({
8
8
  // API 请求的默认前缀
9
- baseURL: componentConfig.uploadUrl,
9
+ baseURL: `${componentConfig.uploadPrefix}/${componentConfig.uploadUrl}`,
10
10
  });
11
11
 
12
12
  // 异常拦截处理器
@@ -23,7 +23,7 @@ const ossInstance = (params, uploadProgressFn) => {
23
23
  // request 拦截器
24
24
  instance.interceptors.request.use((config) => {
25
25
  config.headers["Content-Type"] = "multipart/form-data";
26
- config.Authorization = GetToken("token");
26
+ config.headers["authorization"] = `Bearer ${GetToken("token")}`;
27
27
  config.onUploadProgress = (progressEvent) => {
28
28
  if (uploadProgressFn) {
29
29
  const percent = (progressEvent.loaded / progressEvent.total) * 100 || 0;
@@ -55,6 +55,7 @@ export default (file, uploadProgressFn, sourceToken) => {
55
55
  uploadProgressFn
56
56
  )
57
57
  .then((res) => {
58
+ console.log(res);
58
59
  const result = res.data;
59
60
  if (result.code == 200) {
60
61
  resolve(result.data);