meixioacomponent 2.0.48 → 2.0.50
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/components/index.d.ts.map +1 -1
- package/lib/components/index.js +2 -0
- package/lib/meixioacomponent.common.js +109 -54
- package/lib/meixioacomponent.umd.js +107 -52
- package/lib/meixioacomponent.umd.min.js +2 -2
- package/lib/plugin/PluginByReferenceByOss.d.ts +2 -0
- package/lib/plugin/PluginByReferenceByOss.d.ts.map +1 -0
- package/lib/plugin/PluginByReferenceByOss.js +16 -0
- package/package.json +1 -1
- package/packages/components/base/tDateRangePicker/tDateRangePicker.vue +8 -1
- package/packages/components/index.js +2 -0
- package/packages/components/index.ts +2 -0
- package/packages/components/proPageTable/oa_pro_table.vue +32 -25
- package/packages/plugin/PluginByReferenceByOss.js +16 -0
- package/packages/plugin/PluginByReferenceByOss.ts +13 -0
- package/packages/utils/utils.js +41 -94
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PluginByReferenceByOss.d.ts","sourceRoot":"","sources":["../../packages/plugin/PluginByReferenceByOss.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,oBAYlC,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PluginByReferenceByOss = void 0;
|
|
4
|
+
const PluginByReferenceByOss = (Vue) => {
|
|
5
|
+
// const metaTag = document.querySelector('meta[name="referrer"][content="no-referrer"]');
|
|
6
|
+
// if (metaTag) {
|
|
7
|
+
// metaTag.remove();
|
|
8
|
+
// }
|
|
9
|
+
// // 创建 meta 元素
|
|
10
|
+
// const metaTagByStrict = document.createElement('meta');
|
|
11
|
+
// metaTagByStrict.name = 'referrer';
|
|
12
|
+
// metaTagByStrict.content = 'strict-origin-when-cross-origin';
|
|
13
|
+
// // 添加到 head
|
|
14
|
+
// document.getElementsByTagName('head')[0].appendChild(metaTagByStrict);
|
|
15
|
+
};
|
|
16
|
+
exports.PluginByReferenceByOss = PluginByReferenceByOss;
|
package/package.json
CHANGED
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
@focus="onFocus"
|
|
8
8
|
@input="onInput"
|
|
9
9
|
@pick="onPick"
|
|
10
|
+
enableTimePicker
|
|
10
11
|
@preset-click="onPresetClick"
|
|
11
12
|
:presets="computedPresets"/>
|
|
12
13
|
</template>
|
|
@@ -15,6 +16,8 @@
|
|
|
15
16
|
<script>
|
|
16
17
|
|
|
17
18
|
|
|
19
|
+
import {getEndOfDayTimestamp, getStartOfDayTimestamp} from "../../../utils/utils";
|
|
20
|
+
|
|
18
21
|
export default {
|
|
19
22
|
name: "tDateRangePicker",
|
|
20
23
|
data() {
|
|
@@ -26,6 +29,10 @@ export default {
|
|
|
26
29
|
default: () => {
|
|
27
30
|
return []
|
|
28
31
|
}
|
|
32
|
+
},
|
|
33
|
+
enableTimePicker:{
|
|
34
|
+
type:Boolean,
|
|
35
|
+
default:true
|
|
29
36
|
}
|
|
30
37
|
},
|
|
31
38
|
components: {},
|
|
@@ -44,7 +51,7 @@ export default {
|
|
|
44
51
|
const now = {
|
|
45
52
|
'此刻': () => {
|
|
46
53
|
if (this.$attrs['valueType'] === 'time-stamp') {
|
|
47
|
-
return [
|
|
54
|
+
return [getStartOfDayTimestamp(), getEndOfDayTimestamp()]
|
|
48
55
|
}
|
|
49
56
|
return [new Date(), new Date()];
|
|
50
57
|
}
|
|
@@ -78,6 +78,7 @@ var ProTableLocalConfigManage_1 = require("../config/ProTableLocalConfigManage/P
|
|
|
78
78
|
var executeConfirm_1 = require("../config/use/useConfirm/executeConfirm");
|
|
79
79
|
var registerConfirm_1 = require("../config/use/useConfirm/registerConfirm");
|
|
80
80
|
var UseNotify_1 = require("../config/use/useConfirm/UseNotify");
|
|
81
|
+
var PluginByReferenceByOss_1 = require("../plugin/PluginByReferenceByOss");
|
|
81
82
|
var meixicomponents = [
|
|
82
83
|
baseAnchor_1["default"],
|
|
83
84
|
baseAppendix_1["default"],
|
|
@@ -151,6 +152,7 @@ var install = function (Vue) {
|
|
|
151
152
|
componentConfig_1["default"].createDialogCacheWrap();
|
|
152
153
|
componentConfig_1["default"].eventBus = new componentConfig_1["default"].Vue();
|
|
153
154
|
ProTableLocalConfigManage_1["default"].initByProTableLocalConfigManage();
|
|
155
|
+
(0, PluginByReferenceByOss_1.PluginByReferenceByOss)(Vue);
|
|
154
156
|
};
|
|
155
157
|
//
|
|
156
158
|
if (typeof window !== "undefined" && window["Vue"]) {
|
|
@@ -79,6 +79,7 @@ import {TypeByConfirmOptions, TypeByNotifyOptions, TypeByTheme} from "../typings
|
|
|
79
79
|
import {executeConfirm} from "../config/use/useConfirm/executeConfirm";
|
|
80
80
|
import registerConfirm from "../config/use/useConfirm/registerConfirm";
|
|
81
81
|
import UseNotify from "../config/use/useConfirm/UseNotify";
|
|
82
|
+
import {PluginByReferenceByOss} from "../plugin/PluginByReferenceByOss";
|
|
82
83
|
|
|
83
84
|
|
|
84
85
|
const meixicomponents: any[] = [
|
|
@@ -156,6 +157,7 @@ const install = (Vue) => {
|
|
|
156
157
|
componentConfig.createDialogCacheWrap();
|
|
157
158
|
componentConfig.eventBus = new componentConfig.Vue();
|
|
158
159
|
proTableLocalConfigManage.initByProTableLocalConfigManage();
|
|
160
|
+
PluginByReferenceByOss(Vue);
|
|
159
161
|
};
|
|
160
162
|
//
|
|
161
163
|
if (typeof window !== "undefined" && window[`Vue`]) {
|
|
@@ -234,7 +234,7 @@ import TableCheckControl from "./TableCheckControl";
|
|
|
234
234
|
import proTableLocalConfigManage from "../../config/ProTableLocalConfigManage/ProTableLocalConfigManage";
|
|
235
235
|
import {TransomTableCheckConfig, TransomTableConfig} from "../../utils/utils";
|
|
236
236
|
|
|
237
|
-
|
|
237
|
+
const ColIndexStr = 'colIndex'
|
|
238
238
|
const tableContentClassName = 't-table__content';
|
|
239
239
|
export default {
|
|
240
240
|
name: "baseProTable",
|
|
@@ -509,7 +509,7 @@ export default {
|
|
|
509
509
|
// 使用序号下标
|
|
510
510
|
useIndex: {
|
|
511
511
|
type: Boolean,
|
|
512
|
-
default:
|
|
512
|
+
default: true
|
|
513
513
|
},
|
|
514
514
|
|
|
515
515
|
expandId: {
|
|
@@ -571,32 +571,20 @@ export default {
|
|
|
571
571
|
},
|
|
572
572
|
},
|
|
573
573
|
|
|
574
|
-
showTableHeader
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
return this.tableConfigColumnList.filter((item) => {
|
|
580
|
-
if (item.hasOwnProperty('disabledSortable')) {
|
|
581
|
-
if (!item.disabledSortable) {
|
|
582
|
-
item['sorter'] = false;
|
|
583
|
-
}
|
|
584
|
-
} else {
|
|
585
|
-
item['sorter'] = true;
|
|
574
|
+
showTableHeader() {
|
|
575
|
+
return this.tableConfigColumnList.filter((item) => {
|
|
576
|
+
if (item.hasOwnProperty('disabledSortable')) {
|
|
577
|
+
if (!item.disabledSortable) {
|
|
578
|
+
item['sorter'] = false;
|
|
586
579
|
}
|
|
580
|
+
} else {
|
|
581
|
+
item['sorter'] = true;
|
|
582
|
+
}
|
|
587
583
|
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
}
|
|
584
|
+
return item.show;
|
|
585
|
+
});
|
|
591
586
|
|
|
592
587
|
},
|
|
593
|
-
columnControllerConfig() {
|
|
594
|
-
return {
|
|
595
|
-
fields:this.tableConfigColumnList.map(item=>{
|
|
596
|
-
return item.key
|
|
597
|
-
})
|
|
598
|
-
}
|
|
599
|
-
},
|
|
600
588
|
|
|
601
589
|
isCheckTableRow() {
|
|
602
590
|
const {tableCheckboxConfig} = this.$props;
|
|
@@ -648,6 +636,19 @@ export default {
|
|
|
648
636
|
},
|
|
649
637
|
mixins: [tableSectionMixins],
|
|
650
638
|
methods: {
|
|
639
|
+
/**
|
|
640
|
+
* 初始化表格下标
|
|
641
|
+
*/
|
|
642
|
+
initTableIndex() {
|
|
643
|
+
if (this.$props.useIndex) {
|
|
644
|
+
this.tableConfigColumnList.unshift({
|
|
645
|
+
key: ColIndexStr,
|
|
646
|
+
colKey: ColIndexStr,
|
|
647
|
+
label: '序号',
|
|
648
|
+
title: '序号',
|
|
649
|
+
})
|
|
650
|
+
}
|
|
651
|
+
},
|
|
651
652
|
rehandleExpandChange(value, params) {
|
|
652
653
|
this.$emit('rehandleExpandChange', value)
|
|
653
654
|
},
|
|
@@ -660,6 +661,7 @@ export default {
|
|
|
660
661
|
init() {
|
|
661
662
|
this.setTableConfigColumList();
|
|
662
663
|
const {rowKey} = this.$props;
|
|
664
|
+
this.initTableIndex();
|
|
663
665
|
if (rowKey) {
|
|
664
666
|
this.initTableControl();
|
|
665
667
|
}
|
|
@@ -1003,9 +1005,14 @@ export default {
|
|
|
1003
1005
|
this.refreshData(false);
|
|
1004
1006
|
} else {
|
|
1005
1007
|
const {refreshLayout} = this.$props;
|
|
1008
|
+
if (this.$props.useIndex) {
|
|
1009
|
+
const size = this.$props.pageProps[this.$props.pageConfig.size];
|
|
1010
|
+
data.forEach((item, index) => {
|
|
1011
|
+
item[`${ColIndexStr}`] = (((pageNum - 1) * size) + (index+1))
|
|
1012
|
+
})
|
|
1013
|
+
}
|
|
1006
1014
|
this.tableData = [];
|
|
1007
1015
|
this.tableData = data;
|
|
1008
|
-
|
|
1009
1016
|
if (this.tableCheckControl) {
|
|
1010
1017
|
this.tableCheckControl.onTableChange(
|
|
1011
1018
|
`${this.rowKey}`,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
exports.__esModule = true;
|
|
3
|
+
exports.PluginByReferenceByOss = void 0;
|
|
4
|
+
var PluginByReferenceByOss = function (Vue) {
|
|
5
|
+
// const metaTag = document.querySelector('meta[name="referrer"][content="no-referrer"]');
|
|
6
|
+
// if (metaTag) {
|
|
7
|
+
// metaTag.remove();
|
|
8
|
+
// }
|
|
9
|
+
// // 创建 meta 元素
|
|
10
|
+
// const metaTagByStrict = document.createElement('meta');
|
|
11
|
+
// metaTagByStrict.name = 'referrer';
|
|
12
|
+
// metaTagByStrict.content = 'strict-origin-when-cross-origin';
|
|
13
|
+
// // 添加到 head
|
|
14
|
+
// document.getElementsByTagName('head')[0].appendChild(metaTagByStrict);
|
|
15
|
+
};
|
|
16
|
+
exports.PluginByReferenceByOss = PluginByReferenceByOss;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const PluginByReferenceByOss = (Vue) => {
|
|
2
|
+
// const metaTag = document.querySelector('meta[name="referrer"][content="no-referrer"]');
|
|
3
|
+
// if (metaTag) {
|
|
4
|
+
// metaTag.remove();
|
|
5
|
+
// }
|
|
6
|
+
// // 创建 meta 元素
|
|
7
|
+
// const metaTagByStrict = document.createElement('meta');
|
|
8
|
+
// metaTagByStrict.name = 'referrer';
|
|
9
|
+
// metaTagByStrict.content = 'strict-origin-when-cross-origin';
|
|
10
|
+
// // 添加到 head
|
|
11
|
+
// document.getElementsByTagName('head')[0].appendChild(metaTagByStrict);
|
|
12
|
+
|
|
13
|
+
}
|
package/packages/utils/utils.js
CHANGED
|
@@ -96,10 +96,7 @@ export const formatHtml = (strHtml) => {
|
|
|
96
96
|
export const formatDate = (dateObj, fmt = "YYYY-MM-DD hh:mm:ss") => {
|
|
97
97
|
const date = new Date(dateObj);
|
|
98
98
|
if (/(Y+)/.test(fmt)) {
|
|
99
|
-
fmt = fmt.replace(
|
|
100
|
-
RegExp.$1,
|
|
101
|
-
(date.getFullYear() + "").substr(4 - RegExp.$1.length)
|
|
102
|
-
);
|
|
99
|
+
fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
|
|
103
100
|
}
|
|
104
101
|
const o = {
|
|
105
102
|
"M+": date.getMonth() + 1,
|
|
@@ -111,10 +108,7 @@ export const formatDate = (dateObj, fmt = "YYYY-MM-DD hh:mm:ss") => {
|
|
|
111
108
|
for (let k in o) {
|
|
112
109
|
if (new RegExp("(" + k + ")").test(fmt)) {
|
|
113
110
|
const str = o[k] + "";
|
|
114
|
-
fmt = fmt.replace(
|
|
115
|
-
RegExp.$1,
|
|
116
|
-
RegExp.$1.length === 1 ? str : ("00" + str).substr(str.length)
|
|
117
|
-
);
|
|
111
|
+
fmt = fmt.replace(RegExp.$1, RegExp.$1.length === 1 ? str : ("00" + str).substr(str.length));
|
|
118
112
|
}
|
|
119
113
|
}
|
|
120
114
|
return fmt;
|
|
@@ -184,86 +178,35 @@ export const filterFileSize = (fileSize) => {
|
|
|
184
178
|
//console.log(fileSize);
|
|
185
179
|
let fileSizeByte = fileSize;
|
|
186
180
|
let fileSizeMsg = "";
|
|
187
|
-
if (fileSizeByte < 1048576)
|
|
188
|
-
fileSizeMsg = (fileSizeByte / 1024).toFixed(1) + "K";
|
|
189
|
-
else if (fileSizeByte == 1048576) fileSizeMsg = "1M";
|
|
190
|
-
else if (fileSizeByte > 1048576 && fileSizeByte < 1073741824)
|
|
191
|
-
fileSizeMsg = (fileSizeByte / (1024 * 1024)).toFixed(1) + "M";
|
|
192
|
-
else if (fileSizeByte > 1048576 && fileSizeByte == 1073741824)
|
|
193
|
-
fileSizeMsg = "1G";
|
|
194
|
-
else if (fileSizeByte > 1073741824 && fileSizeByte < 1099511627776)
|
|
195
|
-
fileSizeMsg = (fileSizeByte / (1024 * 1024 * 1024)).toFixed(1) + "G";
|
|
196
|
-
else fileSizeMsg = "文件超过1T";
|
|
181
|
+
if (fileSizeByte < 1048576) fileSizeMsg = (fileSizeByte / 1024).toFixed(1) + "K"; else if (fileSizeByte == 1048576) fileSizeMsg = "1M"; else if (fileSizeByte > 1048576 && fileSizeByte < 1073741824) fileSizeMsg = (fileSizeByte / (1024 * 1024)).toFixed(1) + "M"; else if (fileSizeByte > 1048576 && fileSizeByte == 1073741824) fileSizeMsg = "1G"; else if (fileSizeByte > 1073741824 && fileSizeByte < 1099511627776) fileSizeMsg = (fileSizeByte / (1024 * 1024 * 1024)).toFixed(1) + "G"; else fileSizeMsg = "文件超过1T";
|
|
197
182
|
return fileSizeMsg;
|
|
198
183
|
};
|
|
199
184
|
|
|
200
185
|
export const jugeFileTypeKey = (suffix) => {
|
|
201
186
|
let key = null;
|
|
202
|
-
const jugeArray = [
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
key: "Excel",
|
|
210
|
-
},
|
|
211
|
-
{
|
|
212
|
-
list: [
|
|
213
|
-
"wav",
|
|
214
|
-
"aif",
|
|
215
|
-
"au",
|
|
216
|
-
"mp3",
|
|
217
|
-
"ram",
|
|
218
|
-
"wma",
|
|
219
|
-
"mmf",
|
|
220
|
-
"amr",
|
|
221
|
-
"aac",
|
|
222
|
-
"flac",
|
|
223
|
-
],
|
|
224
|
-
key: "music",
|
|
225
|
-
},
|
|
187
|
+
const jugeArray = [{
|
|
188
|
+
list: ["jpg", "png"], key: "img",
|
|
189
|
+
}, {
|
|
190
|
+
list: ["csv", "xlsx", "xls"], key: "Excel",
|
|
191
|
+
}, {
|
|
192
|
+
list: ["wav", "aif", "au", "mp3", "ram", "wma", "mmf", "amr", "aac", "flac",], key: "music",
|
|
193
|
+
},
|
|
226
194
|
|
|
227
195
|
{
|
|
228
|
-
list: ["pdf"],
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
{
|
|
232
|
-
list: ["
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
{
|
|
236
|
-
list: [
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
"avi",
|
|
243
|
-
"dat",
|
|
244
|
-
"mkv",
|
|
245
|
-
"flv",
|
|
246
|
-
"vob",
|
|
247
|
-
],
|
|
248
|
-
key: "shipin",
|
|
249
|
-
},
|
|
250
|
-
{
|
|
251
|
-
list: ["txt"],
|
|
252
|
-
key: "txt",
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
list: ["doc", "docx"],
|
|
256
|
-
key: "Word",
|
|
257
|
-
},
|
|
258
|
-
{
|
|
259
|
-
list: ["rar", "zip", "arj", "z"],
|
|
260
|
-
key: "yasuobao",
|
|
261
|
-
},
|
|
262
|
-
{
|
|
263
|
-
list: ["exe"],
|
|
264
|
-
key: "Exe",
|
|
265
|
-
},
|
|
266
|
-
];
|
|
196
|
+
list: ["pdf"], key: "Pdf",
|
|
197
|
+
}, {
|
|
198
|
+
list: ["ppt", "pptx"], key: "PPT",
|
|
199
|
+
}, {
|
|
200
|
+
list: ["mp4", "wmv", "3gp", "m4v", "mov", "avi", "dat", "mkv", "flv", "vob",], key: "shipin",
|
|
201
|
+
}, {
|
|
202
|
+
list: ["txt"], key: "txt",
|
|
203
|
+
}, {
|
|
204
|
+
list: ["doc", "docx"], key: "Word",
|
|
205
|
+
}, {
|
|
206
|
+
list: ["rar", "zip", "arj", "z"], key: "yasuobao",
|
|
207
|
+
}, {
|
|
208
|
+
list: ["exe"], key: "Exe",
|
|
209
|
+
},];
|
|
267
210
|
for (let i = 0; i < jugeArray.length; i++) {
|
|
268
211
|
const is = jugeArray[i].list.includes(suffix);
|
|
269
212
|
if (is) {
|
|
@@ -323,19 +266,11 @@ export const judgeButtonPermission = (permissionList, params) => {
|
|
|
323
266
|
return flag;
|
|
324
267
|
};
|
|
325
268
|
|
|
326
|
-
export const isDOM =
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
: function (obj) {
|
|
332
|
-
return (
|
|
333
|
-
obj &&
|
|
334
|
-
typeof obj === "object" &&
|
|
335
|
-
obj.nodeType === 1 &&
|
|
336
|
-
typeof obj.nodeName === "string"
|
|
337
|
-
);
|
|
338
|
-
};
|
|
269
|
+
export const isDOM = typeof HTMLElement === "object" ? function (obj) {
|
|
270
|
+
return obj instanceof HTMLElement;
|
|
271
|
+
} : function (obj) {
|
|
272
|
+
return (obj && typeof obj === "object" && obj.nodeType === 1 && typeof obj.nodeName === "string");
|
|
273
|
+
};
|
|
339
274
|
|
|
340
275
|
export const fromUrlToDownFile = (url) => {
|
|
341
276
|
let a = document.createElement("a");
|
|
@@ -394,4 +329,16 @@ export const TableFooterSummary = (tableData, key) => {
|
|
|
394
329
|
}, 0);
|
|
395
330
|
}
|
|
396
331
|
return 0;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
export const getStartOfDayTimestamp = () => {
|
|
335
|
+
const now = new Date();
|
|
336
|
+
const startOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate());
|
|
337
|
+
return startOfDay.getTime();
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
export const getEndOfDayTimestamp = () => {
|
|
341
|
+
const now = new Date();
|
|
342
|
+
const endOfDay = new Date(now.getFullYear(), now.getMonth(), now.getDate(), 23, 59, 59, 999);
|
|
343
|
+
return endOfDay.getTime();
|
|
397
344
|
}
|