meixioacomponent 0.2.87 → 0.2.88

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.87",
3
+ "version": "0.2.88",
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
 
@@ -272,10 +277,7 @@ export default {
272
277
  let confrim = true;
273
278
  const rulesItem = this.$props.rules[params.config.key];
274
279
  if (rulesItem) {
275
- console.log(rulesItem);
276
- console.log(this.$refs.form);
277
280
  this.$refs.form.validateField(`${params.config.key}`, (errorMsg) => {
278
- console.log(errorMsg);
279
281
  if (errorMsg) {
280
282
  confrim = false;
281
283
  }
@@ -359,7 +361,7 @@ export default {
359
361
  if (this.loading) {
360
362
  setTimeout(() => {
361
363
  this.loading = false;
362
- }, 1500);
364
+ }, 750);
363
365
  }
364
366
  },
365
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();
228
228
  }
229
229
  });
230
230
  },
@@ -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);