htui-yllkbz 1.2.18 → 1.2.22

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.2.18",
3
+ "version": "1.2.22",
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-12 09:07:39
8
+ * @LastEditTime: 2021-12-12 11:01:44
9
9
  -->
10
10
  <template>
11
11
  <div v-loading="state.loading">
@@ -43,10 +43,14 @@
43
43
  @cell-click="(row, column, cell, event)=>$emit('cell-click',row, column, cell, event)"
44
44
  @cell-dblclick="(row, column, cell, event)=>$emit('cell-dblclick',row, column, cell, event)">
45
45
  <el-table-column width="55"
46
+ v-if="checked"
47
+ :reserve-selection="reserveSelection"
48
+ :selectable="selectable"
46
49
  type='selection'>
47
50
  </el-table-column>
48
51
  <el-table-column v-if="!hideOrder"
49
52
  label="序号"
53
+ :align="'center'"
50
54
  width="55">
51
55
  <template slot="header">
52
56
  <slot :name="'header_order'"></slot>
@@ -57,15 +61,48 @@
57
61
  </el-table-column>
58
62
  <el-table-column :label="item.title"
59
63
  :key='item.key'
64
+ :fixed="item.fixed"
65
+ :align="item.align"
66
+ :header-align="item.headerAlign"
67
+ :column-key="item.columnKey"
68
+ :class-name="item.className"
60
69
  v-for="item in columns"
61
70
  :show-overflow-tooltip="true"
62
71
  :prop="item.key"
63
- :width="item.width||120">
72
+ :sortable="item.sortable"
73
+ :sort-method="item.sortMethod"
74
+ :sort-orders="item.sortOrders"
75
+ :formatter="item.formatter"
76
+ :sort-by="item.sortBy"
77
+ :min-width="item.minWidth"
78
+ :width="item.width">
64
79
  <template slot-scope="{row,column,rowIndex}">
65
80
  <slot :name="item.key"
66
81
  :row="row"
67
82
  :column="column"
68
- :rowIndex="rowIndex">{{getPropByPath(row,item.key)}}</slot>
83
+ :rowIndex="rowIndex">
84
+ <!-- 处理部门 -->
85
+ <template v-if="item.type==='org'">
86
+ <common-org-info v-if="getPropByPath(row,item.key)"
87
+ :org-id="getPropByPath(row,item.key)"
88
+ type="tag"></common-org-info>
89
+ </template>
90
+ <!-- 处理部门人员 -->
91
+ <template v-else-if="item.type==='userId'">
92
+ <div is='common-datas-info-id'
93
+ v-if="getPropByPath(row,item.key)"
94
+ :user-id="JSON.stringify(getPropByPath(row,item.key))"
95
+ :base-data-info='true'></div>
96
+ <span v-else>--</span>
97
+ </template>
98
+ <!-- 处理时间 -->
99
+ <template v-else-if="item.type==='time'">
100
+ <span v-if='getPropByPath(row,item.key)'>{{getPropByPath(row,item.key).replace('T', ' ').slice(0,19)}}</span>
101
+ <span v-else>--</span>
102
+ </template>
103
+ <!-- 其他 -->
104
+ <span v-else>{{getPropByPath(row,item.key)}}</span>
105
+ </slot>
69
106
 
70
107
  </template>
71
108
  <template slot-scope="{column,$index}"
@@ -113,6 +150,10 @@ export default class HtTable extends Vue {
113
150
  @Prop() data!: any[];
114
151
  /** 是否隐藏分页 */
115
152
  @Prop() hidePage!: boolean;
153
+ /** 是否启用复选框 */
154
+ @Prop() checked!: boolean;
155
+ /** 仅对 type=selection 的列有效,类型为 Boolean,为 true 则会在数据更新之后保留之前选中的数据(需指定 row-key) */
156
+ @Prop() reserveSelection!: boolean;
116
157
  @Prop() height?: string | number;
117
158
  @Prop() maxHeight?: string | number;
118
159
  @Prop() rowKey?: string;
@@ -122,6 +163,8 @@ export default class HtTable extends Vue {
122
163
  @Prop() fit?: boolean;
123
164
  @Prop() showHeader?: boolean;
124
165
  @Prop() rowClassName?: any;
166
+ /** 仅对 type=selection 的列有效,类型为 Function,Function 的返回值用来决定这一行的 CheckBox 是否可以勾选 */
167
+ @Prop() selectable?: any;
125
168
  @Prop() currentRowKey?: string | number;
126
169
  @Prop() highlightCurrentRow?: boolean;
127
170
  @Prop() rowStyle?: any;
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-11 11:06:51
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2021-12-08 11:29:19
7
+ * @LastEditTime: 2021-12-12 10:07:34
8
8
  -->
9
9
  <template>
10
10
  <el-popover placement="bottom"
@@ -182,7 +182,7 @@ export default class HtSelectTable extends Vue {
182
182
  //
183
183
  if (!this.state.config.disabled) {
184
184
  const ref: any = this.$refs[this.state.config.key || "ht-table"];
185
- console.log("333");
185
+
186
186
  this.state.visible = false;
187
187
  ref.clearCheck();
188
188
  }