mali-ui-plus 1.0.4 → 1.0.6
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/mali-ui-plus.common.js +17 -94
- package/lib/mali-ui-plus.umd.js +17 -94
- package/lib/mali-ui-plus.umd.min.js +1 -1
- package/package.json +1 -1
|
@@ -68389,11 +68389,7 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68389
68389
|
__name: 'MlUpload',
|
|
68390
68390
|
props: {
|
|
68391
68391
|
modelValue: {
|
|
68392
|
-
type: Array,
|
|
68393
|
-
default: () => []
|
|
68394
|
-
},
|
|
68395
|
-
urlList: {
|
|
68396
|
-
type: Array,
|
|
68392
|
+
type: [Array, String, Object],
|
|
68397
68393
|
default: () => []
|
|
68398
68394
|
},
|
|
68399
68395
|
params: {
|
|
@@ -68521,8 +68517,14 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68521
68517
|
return fieldMaps.value.fileName || 'fileName';
|
|
68522
68518
|
});
|
|
68523
68519
|
const loadList = () => {
|
|
68520
|
+
let vals = [];
|
|
68521
|
+
if (xe_utils_default().isArray(props.modelValue)) {
|
|
68522
|
+
vals = props.modelValue;
|
|
68523
|
+
} else if (props.modelValue && xe_utils_default().isString(props.modelValue)) {
|
|
68524
|
+
vals = [props.modelValue];
|
|
68525
|
+
}
|
|
68524
68526
|
if (props.simpleValue) {
|
|
68525
|
-
fileList.value =
|
|
68527
|
+
fileList.value = vals.map(url => {
|
|
68526
68528
|
const name = getUrlName(url);
|
|
68527
68529
|
return {
|
|
68528
68530
|
[nameField.value]: name,
|
|
@@ -68530,12 +68532,8 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68530
68532
|
[urlField.value]: url
|
|
68531
68533
|
};
|
|
68532
68534
|
});
|
|
68533
|
-
if (props.urlList && props.urlList.length) {
|
|
68534
|
-
isModelUpdate = true;
|
|
68535
|
-
updateModel();
|
|
68536
|
-
}
|
|
68537
68535
|
} else {
|
|
68538
|
-
fileList.value =
|
|
68536
|
+
fileList.value = vals.map(item => {
|
|
68539
68537
|
const url = item[urlField.value] || item.url;
|
|
68540
68538
|
const name = item[nameField.value] || getUrlName(url);
|
|
68541
68539
|
return Object.assign(item, {
|
|
@@ -68548,7 +68546,11 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68548
68546
|
};
|
|
68549
68547
|
const updateModel = () => {
|
|
68550
68548
|
const urlList = fileList.value.map(item => item[urlField.value]);
|
|
68551
|
-
const
|
|
68549
|
+
const rest = props.simpleValue ? urlList : fileList.value;
|
|
68550
|
+
let value = rest;
|
|
68551
|
+
if (!props.multiple) {
|
|
68552
|
+
value = rest[0] || null;
|
|
68553
|
+
}
|
|
68552
68554
|
// 自动更新校验状态
|
|
68553
68555
|
if ($xeform && $xeformiteminfo) {
|
|
68554
68556
|
$xeform.triggerItemEvent(new Event('change'), $xeformiteminfo.itemConfig.field, value);
|
|
@@ -68648,82 +68650,6 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68648
68650
|
});
|
|
68649
68651
|
});
|
|
68650
68652
|
};
|
|
68651
|
-
const customRequest = action => {
|
|
68652
|
-
if (isReadonly.value || isDisabled.value || loading.value) {
|
|
68653
|
-
return;
|
|
68654
|
-
}
|
|
68655
|
-
if (props.limit && fileList.value.length >= props.limit) {
|
|
68656
|
-
VXETable.modal.message({
|
|
68657
|
-
status: 'error',
|
|
68658
|
-
content: props.mediatype === 'image' ? `最多只允许选择 ${props.limit} 个图片!` : `最多只允许选择 ${props.limit} 个文件!`
|
|
68659
|
-
});
|
|
68660
|
-
return;
|
|
68661
|
-
}
|
|
68662
|
-
const file = action.file;
|
|
68663
|
-
const fileSuffix = getSuffix(file.name);
|
|
68664
|
-
if (props.mediatype === 'image') {
|
|
68665
|
-
if (!imgTypes.value.includes(fileSuffix)) {
|
|
68666
|
-
VXETable.modal.message({
|
|
68667
|
-
status: 'error',
|
|
68668
|
-
content: `只支持 ${imgTypes.value.join(', ')} 格式的图片,请重新选择!`
|
|
68669
|
-
});
|
|
68670
|
-
return;
|
|
68671
|
-
}
|
|
68672
|
-
} else {
|
|
68673
|
-
if (fileTypes.value.length && !fileTypes.value.includes(fileSuffix)) {
|
|
68674
|
-
VXETable.modal.message({
|
|
68675
|
-
status: 'error',
|
|
68676
|
-
content: `只支持 ${fileTypes.value.join(', ')} 格式的文件,请重新选择!`
|
|
68677
|
-
});
|
|
68678
|
-
return;
|
|
68679
|
-
}
|
|
68680
|
-
}
|
|
68681
|
-
const uploadMethod = props.uploadFile ? props.uploadFile : config_0.upload ? config_0.upload.uploadFile : null;
|
|
68682
|
-
if (uploadMethod) {
|
|
68683
|
-
loading.value = true;
|
|
68684
|
-
Promise.resolve(uploadMethod({
|
|
68685
|
-
file,
|
|
68686
|
-
params: props.params
|
|
68687
|
-
})).then(res => {
|
|
68688
|
-
const item = {
|
|
68689
|
-
...res,
|
|
68690
|
-
[nameField.value]: res[nameField.value] || file.name,
|
|
68691
|
-
[typeField.value]: res[typeField.value] || fileSuffix
|
|
68692
|
-
};
|
|
68693
|
-
isModelUpdate = true;
|
|
68694
|
-
fileList.value.push(item);
|
|
68695
|
-
updateModel();
|
|
68696
|
-
emit('success', {
|
|
68697
|
-
item,
|
|
68698
|
-
file
|
|
68699
|
-
});
|
|
68700
|
-
loading.value = false;
|
|
68701
|
-
}).catch(e => {
|
|
68702
|
-
const item = {
|
|
68703
|
-
[nameField.value]: file.name,
|
|
68704
|
-
[typeField.value]: fileSuffix
|
|
68705
|
-
};
|
|
68706
|
-
emit('error', {
|
|
68707
|
-
item,
|
|
68708
|
-
file
|
|
68709
|
-
});
|
|
68710
|
-
loading.value = false;
|
|
68711
|
-
console.error(e);
|
|
68712
|
-
});
|
|
68713
|
-
} else {
|
|
68714
|
-
const item = {
|
|
68715
|
-
[nameField.value]: file.name,
|
|
68716
|
-
[typeField.value]: fileSuffix
|
|
68717
|
-
};
|
|
68718
|
-
isModelUpdate = true;
|
|
68719
|
-
fileList.value.push(item);
|
|
68720
|
-
updateModel();
|
|
68721
|
-
emit('success', {
|
|
68722
|
-
item
|
|
68723
|
-
});
|
|
68724
|
-
console.error('[MlUpload] 代码检查:未设置上传方法,请通过 MaliUI.config({ ... }) 全局设置 upload.uploadFile');
|
|
68725
|
-
}
|
|
68726
|
-
};
|
|
68727
68653
|
const hidePreview = () => {
|
|
68728
68654
|
previewVisible.value = false;
|
|
68729
68655
|
previewItem.value = null;
|
|
@@ -68813,9 +68739,6 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68813
68739
|
}
|
|
68814
68740
|
isModelUpdate = false;
|
|
68815
68741
|
});
|
|
68816
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.urlList, () => {
|
|
68817
|
-
loadList();
|
|
68818
|
-
});
|
|
68819
68742
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
68820
68743
|
if (config_0.upload && !config_0.upload.fileProps) {
|
|
68821
68744
|
console.warn('[MlUpload] 代码检查:全局参数 upload.fileProps 字段属性未配置');
|
|
@@ -68958,10 +68881,10 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68958
68881
|
}));
|
|
68959
68882
|
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue?vue&type=script&lang=ts&setup=true
|
|
68960
68883
|
|
|
68961
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=
|
|
68884
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-22.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-22.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-22.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-22.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=6997de74&lang=scss
|
|
68962
68885
|
// extracted by mini-css-extract-plugin
|
|
68963
68886
|
|
|
68964
|
-
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=
|
|
68887
|
+
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=6997de74&lang=scss
|
|
68965
68888
|
|
|
68966
68889
|
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue
|
|
68967
68890
|
|
|
@@ -71490,7 +71413,7 @@ function index_config(options) {
|
|
|
71490
71413
|
return config_0;
|
|
71491
71414
|
}
|
|
71492
71415
|
const MaliUI = {
|
|
71493
|
-
version: "1.0.
|
|
71416
|
+
version: "1.0.5",
|
|
71494
71417
|
modal: index_esm.modal,
|
|
71495
71418
|
install: index_install,
|
|
71496
71419
|
config: index_config,
|
package/lib/mali-ui-plus.umd.js
CHANGED
|
@@ -68399,11 +68399,7 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68399
68399
|
__name: 'MlUpload',
|
|
68400
68400
|
props: {
|
|
68401
68401
|
modelValue: {
|
|
68402
|
-
type: Array,
|
|
68403
|
-
default: () => []
|
|
68404
|
-
},
|
|
68405
|
-
urlList: {
|
|
68406
|
-
type: Array,
|
|
68402
|
+
type: [Array, String, Object],
|
|
68407
68403
|
default: () => []
|
|
68408
68404
|
},
|
|
68409
68405
|
params: {
|
|
@@ -68531,8 +68527,14 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68531
68527
|
return fieldMaps.value.fileName || 'fileName';
|
|
68532
68528
|
});
|
|
68533
68529
|
const loadList = () => {
|
|
68530
|
+
let vals = [];
|
|
68531
|
+
if (xe_utils_default().isArray(props.modelValue)) {
|
|
68532
|
+
vals = props.modelValue;
|
|
68533
|
+
} else if (props.modelValue && xe_utils_default().isString(props.modelValue)) {
|
|
68534
|
+
vals = [props.modelValue];
|
|
68535
|
+
}
|
|
68534
68536
|
if (props.simpleValue) {
|
|
68535
|
-
fileList.value =
|
|
68537
|
+
fileList.value = vals.map(url => {
|
|
68536
68538
|
const name = getUrlName(url);
|
|
68537
68539
|
return {
|
|
68538
68540
|
[nameField.value]: name,
|
|
@@ -68540,12 +68542,8 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68540
68542
|
[urlField.value]: url
|
|
68541
68543
|
};
|
|
68542
68544
|
});
|
|
68543
|
-
if (props.urlList && props.urlList.length) {
|
|
68544
|
-
isModelUpdate = true;
|
|
68545
|
-
updateModel();
|
|
68546
|
-
}
|
|
68547
68545
|
} else {
|
|
68548
|
-
fileList.value =
|
|
68546
|
+
fileList.value = vals.map(item => {
|
|
68549
68547
|
const url = item[urlField.value] || item.url;
|
|
68550
68548
|
const name = item[nameField.value] || getUrlName(url);
|
|
68551
68549
|
return Object.assign(item, {
|
|
@@ -68558,7 +68556,11 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68558
68556
|
};
|
|
68559
68557
|
const updateModel = () => {
|
|
68560
68558
|
const urlList = fileList.value.map(item => item[urlField.value]);
|
|
68561
|
-
const
|
|
68559
|
+
const rest = props.simpleValue ? urlList : fileList.value;
|
|
68560
|
+
let value = rest;
|
|
68561
|
+
if (!props.multiple) {
|
|
68562
|
+
value = rest[0] || null;
|
|
68563
|
+
}
|
|
68562
68564
|
// 自动更新校验状态
|
|
68563
68565
|
if ($xeform && $xeformiteminfo) {
|
|
68564
68566
|
$xeform.triggerItemEvent(new Event('change'), $xeformiteminfo.itemConfig.field, value);
|
|
@@ -68658,82 +68660,6 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68658
68660
|
});
|
|
68659
68661
|
});
|
|
68660
68662
|
};
|
|
68661
|
-
const customRequest = action => {
|
|
68662
|
-
if (isReadonly.value || isDisabled.value || loading.value) {
|
|
68663
|
-
return;
|
|
68664
|
-
}
|
|
68665
|
-
if (props.limit && fileList.value.length >= props.limit) {
|
|
68666
|
-
VXETable.modal.message({
|
|
68667
|
-
status: 'error',
|
|
68668
|
-
content: props.mediatype === 'image' ? `最多只允许选择 ${props.limit} 个图片!` : `最多只允许选择 ${props.limit} 个文件!`
|
|
68669
|
-
});
|
|
68670
|
-
return;
|
|
68671
|
-
}
|
|
68672
|
-
const file = action.file;
|
|
68673
|
-
const fileSuffix = getSuffix(file.name);
|
|
68674
|
-
if (props.mediatype === 'image') {
|
|
68675
|
-
if (!imgTypes.value.includes(fileSuffix)) {
|
|
68676
|
-
VXETable.modal.message({
|
|
68677
|
-
status: 'error',
|
|
68678
|
-
content: `只支持 ${imgTypes.value.join(', ')} 格式的图片,请重新选择!`
|
|
68679
|
-
});
|
|
68680
|
-
return;
|
|
68681
|
-
}
|
|
68682
|
-
} else {
|
|
68683
|
-
if (fileTypes.value.length && !fileTypes.value.includes(fileSuffix)) {
|
|
68684
|
-
VXETable.modal.message({
|
|
68685
|
-
status: 'error',
|
|
68686
|
-
content: `只支持 ${fileTypes.value.join(', ')} 格式的文件,请重新选择!`
|
|
68687
|
-
});
|
|
68688
|
-
return;
|
|
68689
|
-
}
|
|
68690
|
-
}
|
|
68691
|
-
const uploadMethod = props.uploadFile ? props.uploadFile : config_0.upload ? config_0.upload.uploadFile : null;
|
|
68692
|
-
if (uploadMethod) {
|
|
68693
|
-
loading.value = true;
|
|
68694
|
-
Promise.resolve(uploadMethod({
|
|
68695
|
-
file,
|
|
68696
|
-
params: props.params
|
|
68697
|
-
})).then(res => {
|
|
68698
|
-
const item = {
|
|
68699
|
-
...res,
|
|
68700
|
-
[nameField.value]: res[nameField.value] || file.name,
|
|
68701
|
-
[typeField.value]: res[typeField.value] || fileSuffix
|
|
68702
|
-
};
|
|
68703
|
-
isModelUpdate = true;
|
|
68704
|
-
fileList.value.push(item);
|
|
68705
|
-
updateModel();
|
|
68706
|
-
emit('success', {
|
|
68707
|
-
item,
|
|
68708
|
-
file
|
|
68709
|
-
});
|
|
68710
|
-
loading.value = false;
|
|
68711
|
-
}).catch(e => {
|
|
68712
|
-
const item = {
|
|
68713
|
-
[nameField.value]: file.name,
|
|
68714
|
-
[typeField.value]: fileSuffix
|
|
68715
|
-
};
|
|
68716
|
-
emit('error', {
|
|
68717
|
-
item,
|
|
68718
|
-
file
|
|
68719
|
-
});
|
|
68720
|
-
loading.value = false;
|
|
68721
|
-
console.error(e);
|
|
68722
|
-
});
|
|
68723
|
-
} else {
|
|
68724
|
-
const item = {
|
|
68725
|
-
[nameField.value]: file.name,
|
|
68726
|
-
[typeField.value]: fileSuffix
|
|
68727
|
-
};
|
|
68728
|
-
isModelUpdate = true;
|
|
68729
|
-
fileList.value.push(item);
|
|
68730
|
-
updateModel();
|
|
68731
|
-
emit('success', {
|
|
68732
|
-
item
|
|
68733
|
-
});
|
|
68734
|
-
console.error('[MlUpload] 代码检查:未设置上传方法,请通过 MaliUI.config({ ... }) 全局设置 upload.uploadFile');
|
|
68735
|
-
}
|
|
68736
|
-
};
|
|
68737
68663
|
const hidePreview = () => {
|
|
68738
68664
|
previewVisible.value = false;
|
|
68739
68665
|
previewItem.value = null;
|
|
@@ -68823,9 +68749,6 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68823
68749
|
}
|
|
68824
68750
|
isModelUpdate = false;
|
|
68825
68751
|
});
|
|
68826
|
-
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.urlList, () => {
|
|
68827
|
-
loadList();
|
|
68828
|
-
});
|
|
68829
68752
|
(0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
|
|
68830
68753
|
if (config_0.upload && !config_0.upload.fileProps) {
|
|
68831
68754
|
console.warn('[MlUpload] 代码检查:全局参数 upload.fileProps 字段属性未配置');
|
|
@@ -68968,10 +68891,10 @@ const MlUploadvue_type_script_lang_ts_setup_true_hoisted_21 = ["src"];
|
|
|
68968
68891
|
}));
|
|
68969
68892
|
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue?vue&type=script&lang=ts&setup=true
|
|
68970
68893
|
|
|
68971
|
-
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=
|
|
68894
|
+
;// CONCATENATED MODULE: ./node_modules/mini-css-extract-plugin/dist/loader.js??clonedRuleSet-67.use[0]!./node_modules/css-loader/dist/cjs.js??clonedRuleSet-67.use[1]!./node_modules/vue-loader/dist/stylePostLoader.js!./node_modules/postcss-loader/dist/cjs.js??clonedRuleSet-67.use[2]!./node_modules/sass-loader/dist/cjs.js??clonedRuleSet-67.use[3]!./node_modules/vue-loader/dist/index.js??ruleSet[0].use[0]!./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=6997de74&lang=scss
|
|
68972
68895
|
// extracted by mini-css-extract-plugin
|
|
68973
68896
|
|
|
68974
|
-
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=
|
|
68897
|
+
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue?vue&type=style&index=0&id=6997de74&lang=scss
|
|
68975
68898
|
|
|
68976
68899
|
;// CONCATENATED MODULE: ./components/ml-upload/MlUpload.vue
|
|
68977
68900
|
|
|
@@ -71500,7 +71423,7 @@ function index_config(options) {
|
|
|
71500
71423
|
return config_0;
|
|
71501
71424
|
}
|
|
71502
71425
|
const MaliUI = {
|
|
71503
|
-
version: "1.0.
|
|
71426
|
+
version: "1.0.5",
|
|
71504
71427
|
modal: index_esm.modal,
|
|
71505
71428
|
install: index_install,
|
|
71506
71429
|
config: index_config,
|