meixioacomponent 2.0.49 → 2.0.51

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.
@@ -2,15 +2,15 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.PluginByReferenceByOss = void 0;
4
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);
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
15
  };
16
16
  exports.PluginByReferenceByOss = PluginByReferenceByOss;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "meixioacomponent",
3
- "version": "2.0.49",
3
+ "version": "2.0.51",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -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 [new Date().valueOf(), new Date().valueOf()]
54
+ return [getStartOfDayTimestamp(), getEndOfDayTimestamp()]
48
55
  }
49
56
  return [new Date(), new Date()];
50
57
  }
@@ -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",
@@ -512,6 +512,11 @@ export default {
512
512
  default: false
513
513
  },
514
514
 
515
+ indexDefaultValue: {
516
+ type: Number,
517
+ default: 0
518
+ },
519
+
515
520
  expandId: {
516
521
  type: String,
517
522
  default: null
@@ -636,6 +641,19 @@ export default {
636
641
  },
637
642
  mixins: [tableSectionMixins],
638
643
  methods: {
644
+ /**
645
+ * 初始化表格下标
646
+ */
647
+ initTableIndex() {
648
+ if (this.$props.useIndex) {
649
+ this.tableConfigColumnList.unshift({
650
+ key: ColIndexStr,
651
+ colKey: ColIndexStr,
652
+ label: '序号',
653
+ title: '序号',
654
+ })
655
+ }
656
+ },
639
657
  rehandleExpandChange(value, params) {
640
658
  this.$emit('rehandleExpandChange', value)
641
659
  },
@@ -648,6 +666,7 @@ export default {
648
666
  init() {
649
667
  this.setTableConfigColumList();
650
668
  const {rowKey} = this.$props;
669
+ this.initTableIndex();
651
670
  if (rowKey) {
652
671
  this.initTableControl();
653
672
  }
@@ -991,9 +1010,14 @@ export default {
991
1010
  this.refreshData(false);
992
1011
  } else {
993
1012
  const {refreshLayout} = this.$props;
1013
+ if (this.$props.useIndex) {
1014
+ const size = this.$props.pageProps[this.$props.pageConfig.size];
1015
+ data.forEach((item, index) => {
1016
+ item[`${ColIndexStr}`] = (((pageNum - 1) * size) + (index + this.$props.indexDefaultValue))
1017
+ })
1018
+ }
994
1019
  this.tableData = [];
995
1020
  this.tableData = data;
996
-
997
1021
  if (this.tableCheckControl) {
998
1022
  this.tableCheckControl.onTableChange(
999
1023
  `${this.rowKey}`,
@@ -2,15 +2,15 @@
2
2
  exports.__esModule = true;
3
3
  exports.PluginByReferenceByOss = void 0;
4
4
  var PluginByReferenceByOss = function (Vue) {
5
- var metaTag = document.querySelector('meta[name="referrer"][content="no-referrer"]');
6
- if (metaTag) {
7
- metaTag.remove();
8
- }
9
- // 创建 meta 元素
10
- var 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);
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
15
  };
16
16
  exports.PluginByReferenceByOss = PluginByReferenceByOss;
@@ -1,13 +1,13 @@
1
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);
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
12
 
13
13
  }
@@ -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
- list: ["jpg", "png"],
205
- key: "img",
206
- },
207
- {
208
- list: ["csv", "xlsx", "xls"],
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
- key: "Pdf",
230
- },
231
- {
232
- list: ["ppt", "pptx"],
233
- key: "PPT",
234
- },
235
- {
236
- list: [
237
- "mp4",
238
- "wmv",
239
- "3gp",
240
- "m4v",
241
- "mov",
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
- typeof HTMLElement === "object"
328
- ? function (obj) {
329
- return obj instanceof HTMLElement;
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
  }