htui-yllkbz 1.4.18 → 1.4.20

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.4.18",
3
+ "version": "1.4.20",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -210,7 +210,9 @@
210
210
  <span v-else>--</span>
211
211
  </template>
212
212
  <!-- 其他 -->
213
- <span v-else>{{ getPropByPath(row, item.key) }}</span>
213
+ <span :style="item.style" v-else>{{
214
+ getPropByPath(row, item.key)
215
+ }}</span>
214
216
  </slot>
215
217
  </template>
216
218
  <!-- 处理重定义table头相关信息 header_key -->
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-11 11:23:24
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-04-11 18:32:23
7
+ * @LastEditTime: 2023-04-17 18:01:05
8
8
  -->
9
9
  <template>
10
10
  <div v-loading="state.loading" style="background:#fff">
@@ -32,7 +32,9 @@
32
32
  :show-header="showHeader"
33
33
  :empty-text="emptyText || '暂无数据'"
34
34
  :row-style="rowStyle"
35
+ :cell-style="cellStyle"
35
36
  :row-class-name="rowClassName"
37
+ :cell-class-name="cellClassName"
36
38
  :current-row-key="currentRowKey"
37
39
  :highlight-current-row="highlightCurrentRow"
38
40
  :row-key="rowKey || 'id'"
@@ -133,12 +135,38 @@
133
135
  </slot>
134
136
  </template>
135
137
  </el-table-column>
138
+
136
139
  <template v-for="(item, index) in state.showColumns">
137
140
  <HtTableColumn
138
141
  :key="`${item.key}_${index}`"
139
142
  :item="item"
140
143
  @showFiles="showFiles"
141
144
  >
145
+ <template
146
+ v-for="child in allChildren"
147
+ :slot="child.key"
148
+ slot-scope="scope"
149
+ >
150
+ <slot
151
+ :name="child.key"
152
+ :row="scope.row"
153
+ :column="scope.column"
154
+ :rowIndex="scope.rowIndex"
155
+ >
156
+ </slot>
157
+ </template>
158
+ <template
159
+ v-for="child in allChildren"
160
+ slot-scope="{ column, $index }"
161
+ :slot="'header_' + child.key"
162
+ >
163
+ <slot
164
+ :name="'header_' + child.key"
165
+ :column="column"
166
+ :$index="$index"
167
+ ></slot>
168
+ </template>
169
+
142
170
  <template :slot="item.key" slot-scope="scope">
143
171
  <slot
144
172
  :name="item.key"
@@ -346,6 +374,7 @@ export default class HtTable extends Vue {
346
374
  @Prop() fit?: boolean;
347
375
  @Prop() showHeader?: boolean;
348
376
  @Prop() rowClassName?: any;
377
+ @Prop() cellClassName?: any;
349
378
  /** 是否启用复选框 */
350
379
  @Prop() checked!: boolean;
351
380
  /** 设置的禁用字段值--与check同步 */
@@ -355,6 +384,7 @@ export default class HtTable extends Vue {
355
384
  @Prop() currentRowKey?: string | number;
356
385
  @Prop() highlightCurrentRow?: boolean;
357
386
  @Prop() rowStyle?: any;
387
+ @Prop() cellStyle?: any;
358
388
  @Prop() hideOrder?: boolean;
359
389
  @Prop() pageInfo?: PageInfoType;
360
390
  @Prop() emptyText?: string | number;
@@ -559,6 +589,16 @@ export default class HtTable extends Vue {
559
589
  const data = showColumns.filter((item) => obj[item.key as string]);
560
590
  return data;
561
591
  }
592
+ get allChildren() {
593
+ const { showColumns } = this.state;
594
+ let allchildren: Column[] = [];
595
+ showColumns.forEach((item) => {
596
+ if (item.children) {
597
+ allchildren = [...allchildren, ...item.children];
598
+ }
599
+ });
600
+ return allchildren;
601
+ }
562
602
 
563
603
  /** 监听 */
564
604
  @Watch('pageInfo')
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-10-25 17:05:17
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-04-09 10:34:44
7
+ * @LastEditTime: 2023-04-14 10:35:56
8
8
  */
9
9
  /** 初始的默认条数 */
10
10
  export const defalutPageSize = 10
@@ -63,7 +63,7 @@ export interface Column {
63
63
  headerAlign?: 'left' | 'right' | 'center';
64
64
  className?: string;
65
65
  labelClassName?: string;
66
-
66
+ style?: string;
67
67
  /** 是否隐藏当前列 */
68
68
  hide?: boolean;
69
69
  /** 时间是否跨行展示 */
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-04-09 18:46:03
7
+ * @LastEditTime: 2023-04-17 18:04:07
8
8
  -->
9
9
  <template>
10
10
  <div>
@@ -32,7 +32,7 @@
32
32
  <HtTable
33
33
  :data="state.data"
34
34
  :checked="true"
35
- :isExpand="false"
35
+ :isExpand="true"
36
36
  :spanMethodProps="{
37
37
  colRows: ['name', 'age'],
38
38
  sameColRows: [],
@@ -41,13 +41,14 @@
41
41
  :height="500"
42
42
  :columns="state.columns"
43
43
  >
44
- jjjj
45
- <template slot="name" slot-scope="{ row }">
46
- ----{{ row.name }}----yy
47
- </template>
48
- <template slot="time1" slot-scope="{ row }">
49
- ----{{ row.name }}----yy
44
+ <!-- <template slot="namey">
45
+ <template slot="times" slot-scope="{ row }">
46
+ {{ row.name }}----外面
47
+ </template>
50
48
  </template>
49
+ <template slot="times" slot-scope="{ row }">
50
+ {{ row.name }}----yy1
51
+ </template> -->
51
52
  <template slot="header_time1">
52
53
  次数
53
54
  </template>
@@ -98,6 +99,7 @@ export default class Index extends Vue {
98
99
  {
99
100
  name: '胡涛',
100
101
  selectable: true,
102
+ times: 1,
101
103
 
102
104
  age: 12,
103
105
  sex:
@@ -108,6 +110,7 @@ export default class Index extends Vue {
108
110
  },
109
111
  {
110
112
  name: '胡涛',
113
+ times: 1,
111
114
  age: 12,
112
115
  selectable: false,
113
116
  sex: 'e49961a4f385e5d341ce3a01ee674c90ea9e037b734228fe26753a01ee674c90',
@@ -118,6 +121,7 @@ export default class Index extends Vue {
118
121
  {
119
122
  name: '胡涛1',
120
123
  age: 13,
124
+ times: 1,
121
125
  sex: 'tt',
122
126
  id: 3,
123
127
  test: { title: '测试' },
@@ -126,6 +130,7 @@ export default class Index extends Vue {
126
130
  {
127
131
  name: '胡涛',
128
132
  age: 13,
133
+ times: 4,
129
134
  file: [],
130
135
  sex: 'tt',
131
136
  id: 4,
@@ -135,6 +140,7 @@ export default class Index extends Vue {
135
140
  {
136
141
  name: '胡涛',
137
142
  age: 12,
143
+ times: 8,
138
144
  sex: 'tt',
139
145
  id: 41,
140
146
  test: { title: '测试' },
@@ -149,6 +155,7 @@ export default class Index extends Vue {
149
155
  property: 'base',
150
156
  disabled: true,
151
157
  deafaultShow: true,
158
+ style: 'color:red',
152
159
  },
153
160
  {
154
161
  title: 'selectable',
@@ -166,8 +173,8 @@ export default class Index extends Vue {
166
173
  },
167
174
  {
168
175
  title: '名',
169
- key: 'time1',
170
- type: 'date',
176
+ key: 'times',
177
+
171
178
  align: 'center',
172
179
  },
173
180
  ],