htui-yllkbz 1.2.58 → 1.3.2

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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.2.58",
3
+ "version": "1.3.2",
4
4
  "typings": "types/index.d.ts",
5
5
  "main": "lib/htui.common.js",
6
6
  "style": "lib/htui.css",
@@ -5,7 +5,7 @@
5
5
  * @Author: hutao
6
6
  * @Date: 2021-11-11 11:23:24
7
7
  * @LastEditors: hutao
8
- * @LastEditTime: 2021-12-13 15:02:13
8
+ * @LastEditTime: 2022-02-15 10:14:46
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading">
@@ -195,7 +195,6 @@ export default class HtTable extends Vue {
195
195
  },
196
196
  };
197
197
  created() {
198
- // console.log("this", this.$props);
199
198
  this.setPageInfo(this.pageInfo);
200
199
  }
201
200
  getPropByPath(obj: any, path: string, strict: boolean) {
@@ -224,30 +223,7 @@ export default class HtTable extends Vue {
224
223
  // };
225
224
  return tempObj ? tempObj[keyArr[i]] : null;
226
225
  }
227
- /** 遍历循环展示row数据 */
228
- showValue(row: any, key: string) {
229
- if (key) {
230
- if (key.includes(".")) {
231
- //存在多级的情况
232
- //console.log("eval", key, eval(row[key]));
233
- // const arrKey = key.split(".");
234
- // let data = row;
235
- // arrKey.forEach((item) => {
236
- // if (data[item]) {
237
- // data = data[item];
238
- // } else {
239
- // data = "";
240
- // }
241
- // });
242
- return "";
243
- } else {
244
- //如果不存在多级数据
245
- return row[key];
246
- }
247
- } else {
248
- return "";
249
- }
250
- }
226
+
251
227
  /** 监听 */
252
228
  @Watch("pageInfo")
253
229
  setPageInfo(val?: PageInfoType) {
@@ -5,7 +5,7 @@
5
5
  * @Author: hutao
6
6
  * @Date: 2021-11-11 11:23:24
7
7
  * @LastEditors: hutao
8
- * @LastEditTime: 2022-02-14 11:07:24
8
+ * @LastEditTime: 2022-02-20 17:54:42
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading"
@@ -240,6 +240,7 @@
240
240
  <el-button type="primary"
241
241
  @click="confirmSortAndshow">确定</el-button>
242
242
  <el-button @click="state.visibleFilter=false">取消</el-button>
243
+ <el-button @click="resetColumn">重置</el-button>
243
244
  </span>
244
245
  </el-dialog>
245
246
  <!-- 附件详情弹框 -->
@@ -373,6 +374,15 @@ export default class HtTable extends Vue {
373
374
  this.creatInitColumnKey(this.columns || []);
374
375
  }
375
376
  }
377
+ resetColumn() {
378
+ this.creatInitColumnKey(this.columns || []);
379
+ if (this.uuId) {
380
+ window.localStorage.setItem(
381
+ "table_" + this.uuId,
382
+ JSON.stringify(this.columns || [])
383
+ );
384
+ }
385
+ }
376
386
  /** 获取展示的keys值 */
377
387
  getShowKeys(data: Column[]) {
378
388
  const arr: string[] = [];
@@ -390,11 +400,11 @@ export default class HtTable extends Vue {
390
400
  this.state.allColumns.forEach((item) => {
391
401
  item.checked = true;
392
402
  });
403
+ this.$nextTick(() => {
404
+ (this.$refs.comTable as any).doLayout();
405
+ // el-table加ref="comTable"
406
+ });
393
407
  this.getShowKeys(this.state.allColumns);
394
- // this.state.showColumnKeys = this.columns.reduce((arr: string[], item) => {
395
- // arr.push(item.key);
396
- // return arr;
397
- // }, []);
398
408
  }
399
409
  /** 展示附件信息 */
400
410
  showFiles(val = "") {
@@ -424,15 +434,12 @@ export default class HtTable extends Vue {
424
434
  // dropType === "before"
425
435
  // ? data.splice(index, 0, currentColumn)
426
436
  // : data.splice(index + 1, 0, currentColumn);
427
- // console.log("tree drag end: ", currentColumn, showColumnKeys);
437
+
428
438
  if (currentColumn && checkedColumnKeys.includes(currentColumn.key)) {
429
439
  setTimeout(() => {
430
440
  (this.$refs.tree as any).setChecked(currentColumn, true);
431
441
  }, 0);
432
442
  }
433
- //console.log("handleDragEnd", this.columns);
434
-
435
- // }
436
443
  }
437
444
  handleDrop() {
438
445
  // console.log("tree drop: ", dropNode, dropType);
@@ -492,6 +499,7 @@ export default class HtTable extends Vue {
492
499
  confirmSortAndshow() {
493
500
  this.state.loading = true;
494
501
  this.state.showColumns = [];
502
+ this.state.allColumns = this.getAllColumns;
495
503
  const { allColumns, checkedColumnKeys } = this.state;
496
504
  //对列表check复制
497
505
  allColumns.forEach(
@@ -510,33 +518,15 @@ export default class HtTable extends Vue {
510
518
  this.state.showColumns = allColumns;
511
519
  this.state.visibleFilter = false;
512
520
  this.state.loading = false;
521
+ this.$nextTick(() => {
522
+ (this.$refs.comTable as any).doLayout();
523
+ // el-table加ref="multipleTable"
524
+ });
525
+
513
526
  /** 自定义列回调 */
514
527
  this.$emit("customColumn", allColumns);
515
528
  }
516
- /** 遍历循环展示row数据 */
517
- showValue(row: any, key: string) {
518
- if (key) {
519
- if (key.includes(".")) {
520
- //存在多级的情况
521
- //console.log("eval", key, eval(row[key]));
522
- // const arrKey = key.split(".");
523
- // let data = row;
524
- // arrKey.forEach((item) => {
525
- // if (data[item]) {
526
- // data = data[item];
527
- // } else {
528
- // data = "";
529
- // }
530
- // });
531
- return "";
532
- } else {
533
- //如果不存在多级数据
534
- return row[key];
535
- }
536
- } else {
537
- return "";
538
- }
539
- }
529
+
540
530
  /** 获取显示出来的table头信息 */
541
531
  get showColumns() {
542
532
  const { showColumnKeys, showColumns } = this.state;
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2022-02-11 14:26:23
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2022-02-11 14:36:54
7
+ * @LastEditTime: 2022-02-15 10:14:00
8
8
  -->
9
9
  <!--
10
10
  * @Descripttion: 附件列表 ------没有搞完
@@ -135,7 +135,7 @@ export default class HtUploadFiles extends Vue {
135
135
  }
136
136
  /** 附件上传成功 */
137
137
  onSuccess(response: { fileToken: string }) {
138
- console.log("response, file, fileList", response.fileToken);
138
+ // console.log("response, file, fileList", response.fileToken);
139
139
  //this.state.files.push(response.fileToken);
140
140
  this.getFileInfo(response.fileToken);
141
141
  }