xianniu-ui 0.5.6 → 0.5.8
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/lib/xianniu-ui.common.js +88 -39
- package/lib/xianniu-ui.umd.js +88 -39
- package/lib/xianniu-ui.umd.min.js +4 -4
- package/package.json +1 -1
- package/packages/search/main.vue +20 -0
- package/packages/upload/main.vue +7 -8
package/package.json
CHANGED
package/packages/search/main.vue
CHANGED
|
@@ -299,6 +299,26 @@ export default {
|
|
|
299
299
|
this.form.value && this.form.value.find((item) => item.label === key);
|
|
300
300
|
this.$set(row, "data", data);
|
|
301
301
|
},
|
|
302
|
+
setValue(key, value) {
|
|
303
|
+
if (Object.prototype.toString.call(key) === "[object Object]") {
|
|
304
|
+
const list = this.form.value;
|
|
305
|
+
const keys = Object.keys(key)
|
|
306
|
+
for (let i = 0; i < list.length; i++) {
|
|
307
|
+
const item = list[i];
|
|
308
|
+
if(keys.includes(item.prop)){
|
|
309
|
+
console.log(item,key[item.prop]);
|
|
310
|
+
item.modelVal = key[item.prop]
|
|
311
|
+
}
|
|
312
|
+
}
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
const row =
|
|
317
|
+
this.form.value && this.form.value.find((item) => item.label === key);
|
|
318
|
+
if (row) {
|
|
319
|
+
this.$set(row, "modelVal", value);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
302
322
|
},
|
|
303
323
|
};
|
|
304
324
|
</script>
|
package/packages/upload/main.vue
CHANGED
|
@@ -98,10 +98,9 @@
|
|
|
98
98
|
|
|
99
99
|
<script>
|
|
100
100
|
import ElImageViewer from "element-ui/packages/image/src/image-viewer";
|
|
101
|
-
// import * as imageConversion from "image-conversion";
|
|
102
101
|
import axios from "axios";
|
|
103
102
|
import uploadPop from "./upload-pop.vue";
|
|
104
|
-
const MAX_WARNING = 1024 *
|
|
103
|
+
const MAX_WARNING = 1024 * 10 * 1024;
|
|
105
104
|
export default {
|
|
106
105
|
name: "XnUpload",
|
|
107
106
|
inheritAttrs: false,
|
|
@@ -141,7 +140,7 @@ export default {
|
|
|
141
140
|
},
|
|
142
141
|
maxSize: {
|
|
143
142
|
type: Number,
|
|
144
|
-
default: 1024 *
|
|
143
|
+
default: 1024 * 200 * 1024, // 最大限制 50M
|
|
145
144
|
},
|
|
146
145
|
compress: {
|
|
147
146
|
type: Number,
|
|
@@ -235,8 +234,8 @@ export default {
|
|
|
235
234
|
const formData = new FormData();
|
|
236
235
|
const _file = file.file;
|
|
237
236
|
formData.append("file", _file);
|
|
238
|
-
this.$emit("on-uploading");
|
|
239
237
|
this.isUploading = true;
|
|
238
|
+
this.$emit("on-uploaded", false);
|
|
240
239
|
axios({
|
|
241
240
|
method: "post",
|
|
242
241
|
url: this.$XN.uploadUrl || "",
|
|
@@ -257,16 +256,16 @@ export default {
|
|
|
257
256
|
file.onSuccess();
|
|
258
257
|
this.$emit("update:fileList", this.successFiles);
|
|
259
258
|
this.$emit("on-success", this.successFiles);
|
|
260
|
-
this.$emit("on-uploaded");
|
|
259
|
+
this.$emit("on-uploaded", true);
|
|
261
260
|
this.isUploading = false;
|
|
262
261
|
if (this.file.size > MAX_WARNING) {
|
|
263
|
-
this.$notify.closeAll()
|
|
262
|
+
this.$notify.closeAll();
|
|
264
263
|
this.bigFileSucces();
|
|
265
264
|
}
|
|
266
265
|
})
|
|
267
266
|
.catch((err) => {
|
|
268
267
|
console.log(err);
|
|
269
|
-
this.$notify.closeAll()
|
|
268
|
+
this.$notify.closeAll();
|
|
270
269
|
this.$emit("update:fileList", this.successFiles);
|
|
271
270
|
file.onError();
|
|
272
271
|
});
|
|
@@ -334,7 +333,7 @@ export default {
|
|
|
334
333
|
duration: 0,
|
|
335
334
|
dangerouslyUseHTMLString: true,
|
|
336
335
|
message: `
|
|
337
|
-
<p class="text-primary"
|
|
336
|
+
<p class="text-primary">当前文件体积过大,请您耐心等待,在此期间请勿刷新页面。</p>
|
|
338
337
|
<p>名称:${this.file.name}</p>
|
|
339
338
|
<p>体积:${this.fileSize}</p>
|
|
340
339
|
`,
|