@indfnd/common-mobile 1.0.16 → 1.0.18
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/CHANGELOG.md +15 -0
- package/dist/ind-common-mobile.es.js +207 -154
- package/dist/ind-common-mobile.umd.cjs +7 -7
- package/dist/styles/index.css +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.0.18](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v1.0.17...v1.0.18) (2026-01-20)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 升级上传组件 ([2bf31cd](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/2bf31cd6bca0d0c452b1dd7d8c7d776dc668d325))
|
|
11
|
+
* 增加getIconByPositionId ([6e1c487](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/6e1c4878938944db314e991f59d6155fbb0dd5cc))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* 修改移动端文件上传 ([cd6e322](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/commit/cd6e322c2a94836f94703cb0e25808c01c1ef36d))
|
|
17
|
+
|
|
18
|
+
### [1.0.17](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v1.0.16...v1.0.17) (2026-01-19)
|
|
19
|
+
|
|
5
20
|
### [1.0.16](http://git.inspur.com/imp-ec/ind-front/ind-common-mobile-front/compare/v1.0.15...v1.0.16) (2026-01-16)
|
|
6
21
|
|
|
7
22
|
|
|
@@ -3,7 +3,7 @@ import { getQuarterNum, getHalfYearNum, formatDate, useConfig, getLocalStorage,
|
|
|
3
3
|
import Vue$1 from "vue";
|
|
4
4
|
import { DropdownMenu as DropdownMenu$1, DropdownItem as DropdownItem$1, Message, LoadingBar, Spin } from "view-design";
|
|
5
5
|
const name$1 = "@indfnd/common-mobile";
|
|
6
|
-
const version$2 = "1.0.
|
|
6
|
+
const version$2 = "1.0.17";
|
|
7
7
|
const author$1 = "huxuetong";
|
|
8
8
|
const publishConfig = {
|
|
9
9
|
registry: "https://registry.npmjs.org/"
|
|
@@ -879,7 +879,51 @@ function generateConfigByXml(xml, isTransfer) {
|
|
|
879
879
|
}
|
|
880
880
|
const isDev = false;
|
|
881
881
|
var config = useConfig(isDev);
|
|
882
|
-
|
|
882
|
+
function formatServerTime(timeString) {
|
|
883
|
+
if (typeof timeString !== "string" || !dayjs(timeString).isValid()) {
|
|
884
|
+
return timeString;
|
|
885
|
+
}
|
|
886
|
+
switch (timeString.length) {
|
|
887
|
+
case 4: {
|
|
888
|
+
return dayjs(timeString, "YYYY").format("YYYY");
|
|
889
|
+
}
|
|
890
|
+
case 6: {
|
|
891
|
+
return dayjs(timeString, "YYYYMM").format("YYYY-MM");
|
|
892
|
+
}
|
|
893
|
+
case 8: {
|
|
894
|
+
return dayjs(timeString, "YYYYMMDD").format("YYYY-MM-DD");
|
|
895
|
+
}
|
|
896
|
+
case 14: {
|
|
897
|
+
return dayjs(timeString, "YYYYMMDDhhmmss").format("YYYY-MM-DD hh:mm:ss");
|
|
898
|
+
}
|
|
899
|
+
default: {
|
|
900
|
+
return timeString;
|
|
901
|
+
}
|
|
902
|
+
}
|
|
903
|
+
}
|
|
904
|
+
function handleExpiredTime(expiredTime, handle) {
|
|
905
|
+
let leftDays = dayjs(expiredTime).diff(dayjs(), "day");
|
|
906
|
+
if (leftDays <= config.leftLockDays) {
|
|
907
|
+
handle(leftDays);
|
|
908
|
+
}
|
|
909
|
+
}
|
|
910
|
+
const CHINESE_WEEKDAY_MAP = { 0: "\u65E5", 1: "\u4E00", 2: "\u4E8C", 3: "\u4E09", 4: "\u56DB", 5: "\u4E94", 6: "\u516D" };
|
|
911
|
+
const EventBus = new Vue$1();
|
|
912
|
+
const hasChild = (item2) => {
|
|
913
|
+
return item2.children && item2.children.length;
|
|
914
|
+
};
|
|
915
|
+
const hasOneOf = (targetArr, arr) => {
|
|
916
|
+
return targetArr.some((_2) => arr.includes(_2));
|
|
917
|
+
};
|
|
918
|
+
const showThisMenuEle = (item2, access) => {
|
|
919
|
+
if (item2.meta && item2.meta.access && item2.meta.access.length) {
|
|
920
|
+
if (hasOneOf(item2.meta.access, access))
|
|
921
|
+
return true;
|
|
922
|
+
else
|
|
923
|
+
return false;
|
|
924
|
+
} else
|
|
925
|
+
return true;
|
|
926
|
+
};
|
|
883
927
|
const doCustomTimes = (times2, callback2) => {
|
|
884
928
|
let i = -1;
|
|
885
929
|
while (++i < times2) {
|
|
@@ -901,6 +945,28 @@ const getRouteTitleHandled = (route2) => {
|
|
|
901
945
|
router.meta = meta;
|
|
902
946
|
return router;
|
|
903
947
|
};
|
|
948
|
+
const setTitle = () => {
|
|
949
|
+
};
|
|
950
|
+
const getMenuByRouter = (list2, access) => {
|
|
951
|
+
let res = [];
|
|
952
|
+
_forEach(list2, (item2) => {
|
|
953
|
+
if (!item2.meta || item2.meta && !item2.meta.hideInMenu) {
|
|
954
|
+
let obj = {
|
|
955
|
+
icon: item2.meta && item2.meta.icon || "",
|
|
956
|
+
name: item2.name,
|
|
957
|
+
meta: item2.meta
|
|
958
|
+
};
|
|
959
|
+
if ((hasChild(item2) || item2.meta && item2.meta.showAlways) && showThisMenuEle(item2, access)) {
|
|
960
|
+
obj.children = getMenuByRouter(item2.children, access);
|
|
961
|
+
}
|
|
962
|
+
if (item2.meta && item2.meta.href)
|
|
963
|
+
obj.href = item2.meta.href;
|
|
964
|
+
if (showThisMenuEle(item2, access))
|
|
965
|
+
res.push(obj);
|
|
966
|
+
}
|
|
967
|
+
});
|
|
968
|
+
return res;
|
|
969
|
+
};
|
|
904
970
|
const getBreadCrumbList = (route2, homeRoute) => {
|
|
905
971
|
let homeItem = { ...homeRoute, icon: homeRoute.meta.icon };
|
|
906
972
|
const { crumbs } = route2.meta;
|
|
@@ -920,6 +986,9 @@ const getBreadCrumbList = (route2, homeRoute) => {
|
|
|
920
986
|
}
|
|
921
987
|
return breadCrumbList;
|
|
922
988
|
};
|
|
989
|
+
const showTitle = (item2) => {
|
|
990
|
+
return item2.meta.title;
|
|
991
|
+
};
|
|
923
992
|
const setTagNavListInLocalstorage = (list2) => {
|
|
924
993
|
sessionStorage.tagNaveList = JSON.stringify(list2);
|
|
925
994
|
};
|
|
@@ -969,6 +1038,46 @@ const routeHasExist = (tagNavList, routeItem) => {
|
|
|
969
1038
|
const routeEqual = (route1, route2) => {
|
|
970
1039
|
return route1.name === route2.name;
|
|
971
1040
|
};
|
|
1041
|
+
const getNewTagList = (list2, newRoute) => {
|
|
1042
|
+
const { name: name2, path: path2, meta } = newRoute;
|
|
1043
|
+
let newList = [...list2];
|
|
1044
|
+
if (newList.findIndex((item2) => item2.name === name2) >= 0)
|
|
1045
|
+
return newList;
|
|
1046
|
+
else
|
|
1047
|
+
newList.push({ name: name2, path: path2, meta });
|
|
1048
|
+
return newList;
|
|
1049
|
+
};
|
|
1050
|
+
function _forEach(arr, fn2) {
|
|
1051
|
+
if (!arr.length || !fn2)
|
|
1052
|
+
return;
|
|
1053
|
+
let i = -1;
|
|
1054
|
+
let len = arr.length;
|
|
1055
|
+
while (++i < len) {
|
|
1056
|
+
let item2 = arr[i];
|
|
1057
|
+
fn2(item2, i, arr);
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
const SPECIAL_CHARS_REGEXP = /([\:\-\_]+(.))/g;
|
|
1061
|
+
const MOZ_HACK_REGEXP = /^moz([A-Z])/;
|
|
1062
|
+
function camelCase(name2) {
|
|
1063
|
+
return name2.replace(SPECIAL_CHARS_REGEXP, function(_2, separator, letter, offset3) {
|
|
1064
|
+
return offset3 ? letter.toUpperCase() : letter;
|
|
1065
|
+
}).replace(MOZ_HACK_REGEXP, "Moz$1");
|
|
1066
|
+
}
|
|
1067
|
+
function getStyle(element, styleName) {
|
|
1068
|
+
if (!element || !styleName)
|
|
1069
|
+
return null;
|
|
1070
|
+
styleName = camelCase(styleName);
|
|
1071
|
+
if (styleName === "float") {
|
|
1072
|
+
styleName = "cssFloat";
|
|
1073
|
+
}
|
|
1074
|
+
try {
|
|
1075
|
+
const computed = document.defaultView.getComputedStyle(element, "");
|
|
1076
|
+
return element.style[styleName] || computed ? computed[styleName] : null;
|
|
1077
|
+
} catch (e) {
|
|
1078
|
+
return element.style[styleName];
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
972
1081
|
var classnames$1 = { exports: {} };
|
|
973
1082
|
/*!
|
|
974
1083
|
Copyright (c) 2018 Jed Watson.
|
|
@@ -1046,6 +1155,10 @@ function doChangeTheme(theme) {
|
|
|
1046
1155
|
body.className = classnames(theme, { ...nowCls, ...removeCls });
|
|
1047
1156
|
}
|
|
1048
1157
|
}
|
|
1158
|
+
let transferIndex = 1e3;
|
|
1159
|
+
function transferIncrease() {
|
|
1160
|
+
transferIndex++;
|
|
1161
|
+
}
|
|
1049
1162
|
function Debug() {
|
|
1050
1163
|
let debuge = "";
|
|
1051
1164
|
if (location.search) {
|
|
@@ -1069,6 +1182,8 @@ function Debug() {
|
|
|
1069
1182
|
document.getElementsByTagName("head")[0].appendChild(script);
|
|
1070
1183
|
}
|
|
1071
1184
|
}
|
|
1185
|
+
function getIconByPositionId(options) {
|
|
1186
|
+
}
|
|
1072
1187
|
const defaultSpan = 24;
|
|
1073
1188
|
const showMorePosition = 3;
|
|
1074
1189
|
var FormImpl = {
|
|
@@ -1778,7 +1893,7 @@ var FormImpl = {
|
|
|
1778
1893
|
break;
|
|
1779
1894
|
}
|
|
1780
1895
|
case "fileUpload": {
|
|
1781
|
-
itemInner = h("
|
|
1896
|
+
itemInner = h("IndMUploadFile", {
|
|
1782
1897
|
ref: d.formKey,
|
|
1783
1898
|
props: {
|
|
1784
1899
|
...d.props || {},
|
|
@@ -2507,7 +2622,7 @@ Module.prototype.removeChild = function removeChild(key) {
|
|
|
2507
2622
|
Module.prototype.getChild = function getChild(key) {
|
|
2508
2623
|
return this._children[key];
|
|
2509
2624
|
};
|
|
2510
|
-
Module.prototype.hasChild = function
|
|
2625
|
+
Module.prototype.hasChild = function hasChild2(key) {
|
|
2511
2626
|
return key in this._children;
|
|
2512
2627
|
};
|
|
2513
2628
|
Module.prototype.update = function update(rawModule) {
|
|
@@ -6721,7 +6836,7 @@ var _createNamespace$1t = createNamespace("cell"), createComponent$1x = _createN
|
|
|
6721
6836
|
function Cell(h, props, slots2, ctx) {
|
|
6722
6837
|
var _props$clickable;
|
|
6723
6838
|
var icon2 = props.icon, size2 = props.size, title4 = props.title, label = props.label, value17 = props.value, isLink = props.isLink;
|
|
6724
|
-
var
|
|
6839
|
+
var showTitle2 = slots2.title || isDef(title4);
|
|
6725
6840
|
function Label() {
|
|
6726
6841
|
var showLabel = slots2.label || isDef(label);
|
|
6727
6842
|
if (showLabel) {
|
|
@@ -6731,7 +6846,7 @@ function Cell(h, props, slots2, ctx) {
|
|
|
6731
6846
|
}
|
|
6732
6847
|
}
|
|
6733
6848
|
function Title2() {
|
|
6734
|
-
if (
|
|
6849
|
+
if (showTitle2) {
|
|
6735
6850
|
return h("div", {
|
|
6736
6851
|
"class": [bem$1o("title"), props.titleClass],
|
|
6737
6852
|
"style": props.titleStyle
|
|
@@ -6743,7 +6858,7 @@ function Cell(h, props, slots2, ctx) {
|
|
|
6743
6858
|
if (showValue) {
|
|
6744
6859
|
return h("div", {
|
|
6745
6860
|
"class": [bem$1o("value", {
|
|
6746
|
-
alone: !
|
|
6861
|
+
alone: !showTitle2
|
|
6747
6862
|
}), props.valueClass]
|
|
6748
6863
|
}, [slots2.default ? slots2.default() : h("span", [value17])]);
|
|
6749
6864
|
}
|
|
@@ -16412,8 +16527,8 @@ var NumberKeyboard = createComponent$z({
|
|
|
16412
16527
|
var title4 = this.title, theme = this.theme, closeButtonText = this.closeButtonText;
|
|
16413
16528
|
var titleLeft = this.slots("title-left");
|
|
16414
16529
|
var showClose = closeButtonText && theme === "default";
|
|
16415
|
-
var
|
|
16416
|
-
if (!
|
|
16530
|
+
var showTitle2 = title4 || showClose || titleLeft;
|
|
16531
|
+
if (!showTitle2) {
|
|
16417
16532
|
return;
|
|
16418
16533
|
}
|
|
16419
16534
|
return h("div", {
|
|
@@ -29210,23 +29325,23 @@ var render82 = function() {
|
|
|
29210
29325
|
var _vm = this;
|
|
29211
29326
|
var _h = _vm.$createElement;
|
|
29212
29327
|
var _c = _vm._self._c || _h;
|
|
29213
|
-
return _c("div", [_c("div", { staticStyle: { "width": "100%", "height": "100%", "text-align": "right"
|
|
29328
|
+
return _c("div", [_c("div", { staticStyle: { "width": "100%", "height": "100%", "text-align": "right" }, on: { "click": function($event) {
|
|
29214
29329
|
_vm.isshow = true;
|
|
29215
|
-
} } }, [_c("span", { staticStyle: { "color": "#c5d2e3" } }, [_vm._v(_vm._s(_vm.resultList.length ? "\u7EE7\u7EED\u4E0A\u4F20" : "\u8BF7\u4E0A\u4F20"))]), _c("
|
|
29330
|
+
} } }, [_c("span", { staticStyle: { "color": "#c5d2e3" } }, [_vm._v(_vm._s(_vm.resultList.length ? "\u7EE7\u7EED\u4E0A\u4F20" : "\u8BF7\u4E0A\u4F20"))]), _c("Icon", { staticStyle: { "font-size": "16px", "color": "#808695 !important" }, attrs: { "type": "ios-arrow-forward" } })], 1), _c("van-popup", { attrs: { "position": "right", "get-container": "body", "lazy-render": true }, model: { value: _vm.isshow, callback: function($$v) {
|
|
29216
29331
|
_vm.isshow = $$v;
|
|
29217
|
-
}, expression: "isshow" } }, [_c("van-
|
|
29332
|
+
}, expression: "isshow" } }, [_c("van-overlay", { directives: [{ name: "show", rawName: "v-show", value: _vm.loading, expression: "loading" }], staticClass: "ind-up-loading-overlay", attrs: { "z-index": "9999", "show": _vm.loading } }, [_c("div", { staticClass: "ind-up-loading-wrapper" }, [_c("van-loading", { attrs: { "color": "#1989fa", "size": "25px" } }), _c("div", { staticClass: "ind-up-loading-text" }, [_vm._v("\u4E0A\u4F20\u4E2D...")])], 1)]), _c("div", { staticStyle: { "height": "100vh", "width": "100vw", "display": "flex", "flex-direction": "column", "justify-content": "space-between", "background-color": "rgb(240 240 240)" } }, [_c("div", { staticStyle: { "height": "48px", "width": "100vw" } }, [_c("van-nav-bar", { staticClass: "ind-flex-no-shrink", attrs: { "title": "\u6587\u4EF6\u4E0A\u4F20", "left-text": "", "left-arrow": "" }, on: { "click-left": function($event) {
|
|
29218
29333
|
_vm.isshow = false;
|
|
29219
|
-
} } })], 1), _c("div", {
|
|
29334
|
+
} } })], 1), _c("div", { style: { height: !_vm.readonly ? "calc(100vh - 100px)" : "100%" } }, [!_vm.readonly ? _c("div", { staticClass: "ind-upLoad-clickHere", on: { "click": _vm.uploadFile } }, [_c("div", { staticClass: "ind-upLoad-clickHere-icon" }, [_c("Icon", { staticClass: "ind-upLoad-clickHere-icon-icon", attrs: { "type": "ios-cloud-upload" } }), _c("div", { staticClass: "ind-upLoad-clickHere-icon-text" }, [_vm._v("\u70B9\u51FB\u4E0A\u4F20")])], 1)]) : _vm._e(), _c("div", { staticClass: "ind-upLoad-file-list", staticStyle: { "overflow-y": "auto" }, style: { height: !_vm.readonly ? "calc(100% - 220px)" : "100%", padding: "10px" } }, [!_vm.resultList.length ? _c("div", { staticStyle: { "background-color": "#fff", "height": "100%", "overflow": "hidden", "border-radius": "8px" } }, [_c("van-cell", { staticStyle: { "color": "#1989fa" }, attrs: { "icon": "description", "title": "\u9644\u4EF6\u5217\u8868" } }), _c("van-empty", { attrs: { "description": "\u6682\u65E0\u6587\u4EF6" } })], 1) : _c("div", { staticStyle: { "background-color": "#fff", "height": "100%", "overflow-y": "auto", "border-radius": "8px" } }, [_c("van-cell", { staticStyle: { "color": "#1989fa" }, attrs: { "icon": "description", "title": "\u9644\u4EF6\u5217\u8868" } }), _vm._l(_vm.resultList || _vm.defaultList, function(item2, index2) {
|
|
29220
29335
|
return _c("van-cell", { key: index2 }, [_c("div", { staticClass: "ind-upLoad-file-list-container-item" }, [_c("div", { staticClass: "ind-upLoad-file-list-container-ititle", on: { "click": function($event) {
|
|
29221
29336
|
return _vm.handleClickAttachment(item2);
|
|
29222
|
-
} } }, [_vm._v(" " + _vm._s(item2.fileName) + " ")]), _c("div", { staticClass: "ind-upLoad-file-list-container-idel", on: { "click": function($event) {
|
|
29337
|
+
} } }, [_vm._v(" " + _vm._s(item2.fileName) + " ")]), !_vm.readonly ? _c("div", { staticClass: "ind-upLoad-file-list-container-idel", on: { "click": function($event) {
|
|
29223
29338
|
return _vm.deleteFile(item2.fileId);
|
|
29224
|
-
} } }, [_c("div", { staticClass: "ind-upLoad-file-list-container-idel-btn" }, [_c("Icon", { staticStyle: { "font-size": "16px" }, attrs: { "type": "md-trash" } }), _vm._v("\u5220\u9664 ")], 1)]), _c("div", { staticClass: "ind-upLoad-file-list-container-idownload", on: { "click": function($event) {
|
|
29339
|
+
} } }, [_c("div", { staticClass: "ind-upLoad-file-list-container-idel-btn" }, [_c("Icon", { staticStyle: { "font-size": "16px" }, attrs: { "type": "md-trash" } }), _vm._v("\u5220\u9664 ")], 1)]) : _vm._e(), !_vm.readonly ? _c("div", { staticClass: "ind-upLoad-file-list-container-idownload", on: { "click": function($event) {
|
|
29225
29340
|
return _vm.handleDownload(item2);
|
|
29226
|
-
} } }, [_c("div", { staticClass: "ind-upLoad-file-list-container-idownload-btn" }, [_c("Icon", { staticStyle: { "font-size": "18px" }, attrs: { "type": "md-cloud-download" } }), _vm._v(" \u4E0B\u8F7D ")], 1)])])]);
|
|
29227
|
-
}),
|
|
29341
|
+
} } }, [_c("div", { staticClass: "ind-upLoad-file-list-container-idownload-btn" }, [_c("Icon", { staticStyle: { "font-size": "18px" }, attrs: { "type": "md-cloud-download" } }), _vm._v(" \u4E0B\u8F7D ")], 1)]) : _vm._e()])]);
|
|
29342
|
+
})], 2)])]), !_vm.readonly ? _c("div", { staticClass: "ind-bottom-btn ind-flex ind-flex-no-shrink ind-space-between" }, [_c("IndButton", { attrs: { "bizType": "reset" }, on: { "click": _vm.cancel } }, [_vm._v("\u53D6\u6D88")]), _c("IndButton", { attrs: { "bizType": "primary" }, on: { "click": _vm.confirm } }, [_vm._v("\u786E\u8BA4")])], 1) : _vm._e(), _c("input", { ref: "uploadInput", staticStyle: { "position": "absolute", "clip": "rect(0 0 0 0)" }, attrs: { "type": "file", "disabled": false, "multiple": true, "accept": _vm.accept }, on: { "change": function($event) {
|
|
29228
29343
|
return _vm.readFile($event);
|
|
29229
|
-
} } })], 1), _c("van-popup", { style: { width: "100%", height: "100%" }, attrs: { "position": "right", "get-container": "body", "lazy-render": true }, model: { value: _vm.previewVisible, callback: function($$v) {
|
|
29344
|
+
} } })])], 1), _c("van-popup", { style: { width: "100%", height: "100%" }, attrs: { "position": "right", "get-container": "body", "lazy-render": true }, model: { value: _vm.previewVisible, callback: function($$v) {
|
|
29230
29345
|
_vm.previewVisible = $$v;
|
|
29231
29346
|
}, expression: "previewVisible" } }, [_c("van-sticky", [_c("van-nav-bar", { staticClass: "ind-flex-no-shrink", attrs: { "title": "\u6587\u4EF6\u9884\u89C8", "left-text": "", "left-arrow": "" }, on: { "click-left": _vm.closePreview } })], 1), _c("div", { staticClass: "ind-main-content-wrapper ind-flex-grow ind-vcenter" }, [_vm.isHB ? _c("iframe", { staticClass: "preview-iframe", attrs: { "src": _vm.previewUrl, "frameborder": "0" } }) : _c("div", { staticStyle: { "width": "100%", "height": "calc(100% - 46px)" }, attrs: { "id": "wps-preview-container" } })])], 1)], 1);
|
|
29232
29347
|
};
|
|
@@ -29245,30 +29360,18 @@ function formatterSizeUnit(size2) {
|
|
|
29245
29360
|
}
|
|
29246
29361
|
}
|
|
29247
29362
|
}
|
|
29248
|
-
function arraysEqual(a, b) {
|
|
29249
|
-
return _.isEqual(a, b);
|
|
29250
|
-
}
|
|
29251
29363
|
const __vue2_script = {
|
|
29252
29364
|
name: "UploadFile",
|
|
29253
|
-
components: { [Toast.name]: Toast },
|
|
29254
29365
|
props: {
|
|
29255
|
-
max: {
|
|
29256
|
-
type: Number,
|
|
29257
|
-
default: 10
|
|
29258
|
-
},
|
|
29259
|
-
must: {
|
|
29260
|
-
type: Boolean,
|
|
29261
|
-
default: false
|
|
29262
|
-
},
|
|
29263
29366
|
accept: {
|
|
29264
29367
|
type: String,
|
|
29265
29368
|
required: false,
|
|
29266
|
-
default: "application/pdf,application/zip,text/csv,text/plain,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
29369
|
+
default: "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,image/jpeg,image/png,image/gif,video/mp4,video/mov,application/pdf,application/zip,text/csv,text/plain,application/msword,application/vnd.ms-excel,application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
|
|
29267
29370
|
},
|
|
29268
29371
|
fileSuffix: {
|
|
29269
29372
|
type: String,
|
|
29270
29373
|
required: false,
|
|
29271
|
-
default: "pdf|doc|docx|txt|xls|xlsx|zip|csv"
|
|
29374
|
+
default: "pdf|doc|docx|txt|xls|xlsx|zip|csv|mp4|mov|jpg|jpeg|png|gif"
|
|
29272
29375
|
},
|
|
29273
29376
|
multiple: {
|
|
29274
29377
|
type: Boolean,
|
|
@@ -29278,18 +29381,7 @@ const __vue2_script = {
|
|
|
29278
29381
|
type: String,
|
|
29279
29382
|
default: ""
|
|
29280
29383
|
},
|
|
29281
|
-
|
|
29282
|
-
type: Boolean,
|
|
29283
|
-
default: true
|
|
29284
|
-
},
|
|
29285
|
-
fileIdList: {
|
|
29286
|
-
type: Array,
|
|
29287
|
-
required: false,
|
|
29288
|
-
default: () => {
|
|
29289
|
-
return [];
|
|
29290
|
-
}
|
|
29291
|
-
},
|
|
29292
|
-
fileList: {
|
|
29384
|
+
defaultList: {
|
|
29293
29385
|
type: Array,
|
|
29294
29386
|
required: false,
|
|
29295
29387
|
default: () => {
|
|
@@ -29321,15 +29413,17 @@ const __vue2_script = {
|
|
|
29321
29413
|
return () => {
|
|
29322
29414
|
};
|
|
29323
29415
|
}
|
|
29416
|
+
},
|
|
29417
|
+
readonly: {
|
|
29418
|
+
type: Boolean,
|
|
29419
|
+
default: false
|
|
29324
29420
|
}
|
|
29325
29421
|
},
|
|
29326
29422
|
data() {
|
|
29327
29423
|
return {
|
|
29328
|
-
loading: false,
|
|
29329
29424
|
isHB: false,
|
|
29425
|
+
loading: false,
|
|
29330
29426
|
resultList: [],
|
|
29331
|
-
dateCellShow: "",
|
|
29332
|
-
fileId: "",
|
|
29333
29427
|
isshow: false,
|
|
29334
29428
|
previewVisible: false,
|
|
29335
29429
|
attachmentFile: {
|
|
@@ -29337,7 +29431,8 @@ const __vue2_script = {
|
|
|
29337
29431
|
fileType: "",
|
|
29338
29432
|
fileName: "",
|
|
29339
29433
|
size: ""
|
|
29340
|
-
}
|
|
29434
|
+
},
|
|
29435
|
+
deepdefaultList: []
|
|
29341
29436
|
};
|
|
29342
29437
|
},
|
|
29343
29438
|
computed: {
|
|
@@ -29347,21 +29442,17 @@ const __vue2_script = {
|
|
|
29347
29442
|
dynamicFileTypeAlertMessage() {
|
|
29348
29443
|
const fileExtensions = this.fileSuffix.split("|").join("\uFF0C");
|
|
29349
29444
|
return `\u6587\u4EF6\u7C7B\u578B\u5FC5\u987B\u662F ${fileExtensions} \u4E2D\u7684\u4E00\u79CD`;
|
|
29445
|
+
},
|
|
29446
|
+
fileSizeLimit() {
|
|
29447
|
+
var _a, _b;
|
|
29448
|
+
return ((_b = (_a = this.$config) == null ? void 0 : _a.systemDefaultConfig) == null ? void 0 : _b.fileSizeLimit) || 500;
|
|
29350
29449
|
}
|
|
29351
29450
|
},
|
|
29352
29451
|
watch: {
|
|
29353
|
-
|
|
29354
|
-
handler
|
|
29355
|
-
this.resultList =
|
|
29356
|
-
|
|
29357
|
-
immediate: true,
|
|
29358
|
-
deep: true
|
|
29359
|
-
},
|
|
29360
|
-
fileIdList: {
|
|
29361
|
-
handler: function(newValue, oldValue) {
|
|
29362
|
-
if (newValue.length > 0 && !arraysEqual(newValue, oldValue)) {
|
|
29363
|
-
this.initFileList(newValue);
|
|
29364
|
-
}
|
|
29452
|
+
defaultList: {
|
|
29453
|
+
handler(newVal) {
|
|
29454
|
+
this.resultList = newVal || [];
|
|
29455
|
+
this.deepdefaultList = _.cloneDeep(newVal);
|
|
29365
29456
|
},
|
|
29366
29457
|
immediate: true,
|
|
29367
29458
|
deep: true
|
|
@@ -29370,31 +29461,17 @@ const __vue2_script = {
|
|
|
29370
29461
|
methods: {
|
|
29371
29462
|
uploadFileToServer() {
|
|
29372
29463
|
let self2 = this;
|
|
29464
|
+
self2.loading = true;
|
|
29373
29465
|
let inputDOM = this.$refs.uploadInput;
|
|
29374
29466
|
const allFile = inputDOM.files;
|
|
29375
|
-
if (allFile.size === 0) {
|
|
29376
|
-
Toast("\u4E0D\u80FD\u4F20\u5165\u7A7A\u6587\u4EF6");
|
|
29377
|
-
return false;
|
|
29378
|
-
}
|
|
29379
|
-
if (this.resultList.length + allFile.length > this.max) {
|
|
29380
|
-
Toast(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20 ${this.max} \u4E2A\u6587\u4EF6`);
|
|
29381
|
-
return false;
|
|
29382
|
-
}
|
|
29383
|
-
Toast.loading({
|
|
29384
|
-
message: "\u4E0A\u4F20\u4E2D...",
|
|
29385
|
-
duration: 0,
|
|
29386
|
-
forbidClick: true
|
|
29387
|
-
});
|
|
29388
29467
|
let formData = new FormData();
|
|
29389
29468
|
for (let file of allFile) {
|
|
29390
29469
|
formData.append("file", file);
|
|
29391
29470
|
}
|
|
29392
|
-
let resultList = [];
|
|
29393
29471
|
axios$3.post(self2.ossServerContext + self2.ossFilePutUrl, formData, { payload: true }).then((response) => {
|
|
29394
|
-
self2.loading = false;
|
|
29395
29472
|
if (response.code === 1) {
|
|
29396
|
-
const result = response.data;
|
|
29397
29473
|
self2.loading = false;
|
|
29474
|
+
const result = response.data;
|
|
29398
29475
|
if (result.length >= 1) {
|
|
29399
29476
|
result.forEach((item2) => {
|
|
29400
29477
|
let tmp = {
|
|
@@ -29406,81 +29483,41 @@ const __vue2_script = {
|
|
|
29406
29483
|
showSize: formatterSizeUnit(item2.length),
|
|
29407
29484
|
otherParam: self2.otherParam
|
|
29408
29485
|
};
|
|
29409
|
-
resultList.push(tmp);
|
|
29410
29486
|
self2.resultList.push(tmp);
|
|
29411
29487
|
});
|
|
29412
|
-
if (this.showFileList) {
|
|
29413
|
-
self2.$emit("onChangeData", self2.resultList);
|
|
29414
|
-
} else {
|
|
29415
|
-
if (self2.multiple) {
|
|
29416
|
-
self2.$emit("onChangeData", resultList);
|
|
29417
|
-
} else {
|
|
29418
|
-
self2.$emit("onChangeData", resultList[0]);
|
|
29419
|
-
}
|
|
29420
|
-
}
|
|
29421
|
-
} else {
|
|
29422
|
-
self2.$emit("onChangeData", null);
|
|
29423
|
-
self2.dateCellShow = "";
|
|
29424
29488
|
}
|
|
29489
|
+
} else {
|
|
29490
|
+
self2.loading = false;
|
|
29425
29491
|
}
|
|
29426
29492
|
self2.$refs.uploadInput.value = null;
|
|
29427
|
-
|
|
29493
|
+
}).catch(() => {
|
|
29494
|
+
self2.loading = false;
|
|
29495
|
+
self2.$refs.uploadInput.value = null;
|
|
29428
29496
|
});
|
|
29429
29497
|
},
|
|
29430
29498
|
uploadFile() {
|
|
29431
|
-
if (this.resultList.length >= this.max) {
|
|
29432
|
-
Toast(`\u6700\u591A\u53EA\u80FD\u4E0A\u4F20 ${this.max} \u4E2A\u6587\u4EF6`);
|
|
29433
|
-
return;
|
|
29434
|
-
}
|
|
29435
29499
|
this.$refs.uploadInput.click();
|
|
29436
29500
|
},
|
|
29437
29501
|
deleteFile(fileId) {
|
|
29438
29502
|
if (fileId) {
|
|
29439
29503
|
let result = [];
|
|
29440
|
-
let deletes = [];
|
|
29441
29504
|
this.resultList.forEach((item2) => {
|
|
29442
29505
|
if (item2.fileId !== fileId) {
|
|
29443
29506
|
result.push(item2);
|
|
29444
|
-
} else {
|
|
29445
|
-
deletes.push(item2);
|
|
29446
29507
|
}
|
|
29447
29508
|
});
|
|
29448
29509
|
this.resultList = result;
|
|
29449
|
-
if (this.multiple) {
|
|
29450
|
-
this.$emit("onChangeData", this.resultList, deletes);
|
|
29451
|
-
} else {
|
|
29452
|
-
this.$emit("onChangeData", this.resultList, deletes);
|
|
29453
|
-
}
|
|
29454
|
-
if (this.resultList.length === 0) {
|
|
29455
|
-
this.dateCellShow = "";
|
|
29456
|
-
} else {
|
|
29457
|
-
this.dateCellShow = "\u70B9\u51FB\u4E0A\u4F20(" + this.resultList.length + "/" + this.max + ")";
|
|
29458
|
-
}
|
|
29459
|
-
}
|
|
29460
|
-
},
|
|
29461
|
-
initFileList: function(value17) {
|
|
29462
|
-
if (this.resultList.length === 0 && value17.length > 0) {
|
|
29463
|
-
let requests = [];
|
|
29464
|
-
for (const fileId of value17) {
|
|
29465
|
-
requests.push(axios$3.get(this.ossServerContext + "/oss/file/getMetaData/" + fileId));
|
|
29466
|
-
}
|
|
29467
|
-
Promise.all(requests).then((response) => {
|
|
29468
|
-
let respFileList = [];
|
|
29469
|
-
response.forEach((item2) => {
|
|
29470
|
-
respFileList.push({
|
|
29471
|
-
fileId: item2.data.fileId,
|
|
29472
|
-
fileUrl: this.downloadUrl + item2.data.fileId,
|
|
29473
|
-
fileName: item2.data.fileName,
|
|
29474
|
-
fileType: item2.data.fileName.substring(item2.data.fileName.lastIndexOf(".") + 1),
|
|
29475
|
-
size: item2.data.length,
|
|
29476
|
-
showSize: formatterSizeUnit(item2.data.length),
|
|
29477
|
-
otherParam: this.otherParam
|
|
29478
|
-
});
|
|
29479
|
-
});
|
|
29480
|
-
this.resultList = respFileList;
|
|
29481
|
-
});
|
|
29482
29510
|
}
|
|
29483
29511
|
},
|
|
29512
|
+
cancel() {
|
|
29513
|
+
this.resultList = this.deepdefaultList;
|
|
29514
|
+
this.$emit("onChangeData", this.resultList);
|
|
29515
|
+
this.isshow = false;
|
|
29516
|
+
},
|
|
29517
|
+
confirm() {
|
|
29518
|
+
this.$emit("onChangeData", this.resultList);
|
|
29519
|
+
this.isshow = false;
|
|
29520
|
+
},
|
|
29484
29521
|
handleDownload(file) {
|
|
29485
29522
|
if (typeof wx !== "undefined" && wx.miniProgram) {
|
|
29486
29523
|
this.goToMiniProgramDown(file);
|
|
@@ -29591,30 +29628,46 @@ const __vue2_script = {
|
|
|
29591
29628
|
},
|
|
29592
29629
|
readFile(e) {
|
|
29593
29630
|
let self2 = this;
|
|
29594
|
-
|
|
29595
|
-
|
|
29596
|
-
|
|
29597
|
-
|
|
29598
|
-
|
|
29599
|
-
|
|
29600
|
-
|
|
29601
|
-
|
|
29602
|
-
|
|
29603
|
-
|
|
29604
|
-
|
|
29605
|
-
|
|
29606
|
-
|
|
29607
|
-
|
|
29608
|
-
|
|
29609
|
-
|
|
29610
|
-
|
|
29611
|
-
|
|
29612
|
-
|
|
29613
|
-
|
|
29614
|
-
|
|
29615
|
-
self2.
|
|
29616
|
-
);
|
|
29631
|
+
if (!e.target.files || e.target.files.length === 0) {
|
|
29632
|
+
this.$Message.warning({
|
|
29633
|
+
content: "\u6CA1\u6709\u9009\u62E9\u6587\u4EF6\u6216\u6587\u4EF6\u5217\u8868\u4E3A\u7A7A"
|
|
29634
|
+
});
|
|
29635
|
+
return false;
|
|
29636
|
+
}
|
|
29637
|
+
const file = e.target.files[0];
|
|
29638
|
+
const extensions = this.fileSuffix.split("|");
|
|
29639
|
+
const regexPattern = "\\.(" + extensions.join("|") + ")$";
|
|
29640
|
+
const reg = new RegExp(regexPattern, "i");
|
|
29641
|
+
const isFileTypeValid = reg.test(file.name);
|
|
29642
|
+
if (!isFileTypeValid) {
|
|
29643
|
+
this.$Message.warning({
|
|
29644
|
+
content: "\u6587\u4EF6\u7C7B\u578B\u5FC5\u987B\u662F pdf\uFF0Cdoc\uFF0Cdocx\uFF0Ctxt\uFF0Cxls\uFF0Cxlsx\uFF0Czip\uFF0Ccsv\uFF0Cmp4\uFF0Cmov\uFF0Cjpg\uFF0Cjpeg\uFF0Cpng\uFF0Cgif \u4E2D\u7684\u4E00\u79CD"
|
|
29645
|
+
});
|
|
29646
|
+
self2.$refs.uploadInput.value = null;
|
|
29647
|
+
return false;
|
|
29648
|
+
}
|
|
29649
|
+
const fileSizeInMB = file.size / (1024 * 1024);
|
|
29650
|
+
if (fileSizeInMB > self2.fileSizeLimit) {
|
|
29651
|
+
this.$Message.warning({
|
|
29652
|
+
content: `\u6587\u4EF6\u5927\u5C0F\u4E0D\u80FD\u8D85\u8FC7${self2.fileSizeLimit}MB`
|
|
29653
|
+
});
|
|
29654
|
+
self2.$refs.uploadInput.value = null;
|
|
29655
|
+
return false;
|
|
29656
|
+
}
|
|
29657
|
+
let fileName = file.name;
|
|
29658
|
+
if (fileName.indexOf("/") > 0) {
|
|
29659
|
+
fileName = fileName.substring(fileName.lastIndexOf("/") + 1);
|
|
29617
29660
|
}
|
|
29661
|
+
if (fileName.indexOf("\\") > 0) {
|
|
29662
|
+
fileName = fileName.substring(fileName.lastIndexOf("\\") + 1);
|
|
29663
|
+
}
|
|
29664
|
+
const lastDotIndex = fileName.lastIndexOf(".");
|
|
29665
|
+
const fileExtension = lastDotIndex > -1 ? fileName.substring(lastDotIndex + 1) : "";
|
|
29666
|
+
self2.attachmentFile = {
|
|
29667
|
+
fileName,
|
|
29668
|
+
fileType: fileExtension,
|
|
29669
|
+
size: file.size
|
|
29670
|
+
};
|
|
29618
29671
|
self2.uploadFileToServer();
|
|
29619
29672
|
}
|
|
29620
29673
|
},
|
|
@@ -31920,4 +31973,4 @@ const API = {
|
|
|
31920
31973
|
doChangeTheme,
|
|
31921
31974
|
directives
|
|
31922
31975
|
};
|
|
31923
|
-
export { Apps, AppsEdit, AppsNew, basicLayout as BasicLayout, datepicker as DatePicker, detailView as DetailView, EmptyLayout, ErrorContent, form as Form, configPlugin as IndConfigPlugin, routerPlugin as IndRouterPlugin, inputSelect as InputSelect, loadMore as LoadMore, loadingPanel as LoadingPanel, Login, MyApps, NotFound, pageView as PageView, popupView as PopupView, queryView as QueryView, search as Search, selectBtn as SelectBtn, selectPanel as SelectPanel, Setting, index as UploadFile, User, user$1 as User1, addRouterGuards, appsItem as appItem, createMacroBasicRoutes, createMicroBasicRoutes, API as default, install, permission, routerOptions, store, tabbar };
|
|
31976
|
+
export { Apps, AppsEdit, AppsNew, basicLayout as BasicLayout, CHINESE_WEEKDAY_MAP, datepicker as DatePicker, Debug, detailView as DetailView, EmptyLayout, ErrorContent, EventBus, form as Form, configPlugin as IndConfigPlugin, routerPlugin as IndRouterPlugin, inputSelect as InputSelect, loadMore as LoadMore, loadingPanel as LoadingPanel, Login, MyApps, NotFound, pageView as PageView, popupView as PopupView, queryView as QueryView, search as Search, selectBtn as SelectBtn, selectPanel as SelectPanel, Setting, THEME_KEY, index as UploadFile, User, user$1 as User1, addRouterGuards, appsItem as appItem, bindFocus, createMacroBasicRoutes, createMicroBasicRoutes, API as default, doChangeTheme, formatServerTime, generateConfigByXml, getBreadCrumbList, getDefaultTheme, getHomeRoute, getIconByPositionId, getMenuByRouter, getNewTagList, getNextRoute, getRouteTitleHandled, getStyle, getTagNavListFromLocalstorage, handleExpiredTime, install, permission, routeEqual, routeHasExist, routerOptions, scrollToCurInput, setTagNavListInLocalstorage, setTitle, showTitle, store, tabbar, transferIncrease, transferIndex };
|