htui-yllkbz 1.4.13 → 1.4.14

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.13",
3
+ "version": "1.4.14",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -24,15 +24,17 @@
24
24
  :min-width="item.minWidth"
25
25
  :width="item.width"
26
26
  >
27
- <template v-for="(child, childindex) in item.children">
27
+ <template v-if="item.children && item.children.length">
28
28
  <HtTableColumn
29
29
  :item="child"
30
+ v-for="(child, childindex) in item.children"
30
31
  @showFiles="(val) => $emit('showFiles', val)"
31
32
  :fromColumn="true"
32
33
  :key="`${child.key}_${childindex}_1`"
33
34
  ></HtTableColumn>
34
35
  </template>
35
36
  <template slot-scope="{ row, column, $index }">
37
+ {{ item.type }}
36
38
  <slot :name="item.key" :row="row" :column="column" :rowIndex="$index">
37
39
  <!-- 处理部门 -->
38
40
  <template v-if="item.type === 'org'">
@@ -207,7 +209,7 @@ import HtShowBaseData from '@/packages/HtShowBaseData';
207
209
  import HtOrgInfo from '@/packages/HtOrgInfo';
208
210
  import HtUploadFiles from '@/packages/HtUploadFiles/index.vue';
209
211
  import HtSelectUnit from '@/packages/HtSelectUnit';
210
- import { getPropByPath } from './table-span-method';
212
+
211
213
  interface State {
212
214
  /** 数据状态 */
213
215
  loading: boolean;
@@ -234,8 +236,34 @@ export default class Index extends Vue {
234
236
  };
235
237
  /** 生命周期 */
236
238
  /** 方法 */
239
+ // getPropByPath(obj: any, path: string, strict = true) {
240
+ // return getPropByPath(obj, path, strict);
241
+ // }
237
242
  getPropByPath(obj: any, path: string, strict = true) {
238
- return getPropByPath(obj, path, strict);
243
+ let tempObj = obj;
244
+ path = path.replace(/\[(\w+)\]/g, '.$1');
245
+ path = path.replace(/^\./, '');
246
+
247
+ const keyArr = path.split('.');
248
+ let i = 0;
249
+ for (let len = keyArr.length; i < len - 1; ++i) {
250
+ if (!tempObj && !strict) break;
251
+ const key = keyArr[i];
252
+ if (key in tempObj) {
253
+ tempObj = tempObj[key];
254
+ } else {
255
+ if (strict) {
256
+ throw new Error(`table中${path}字段发生错误,请检查`);
257
+ }
258
+ break;
259
+ }
260
+ }
261
+ // return {
262
+ // o: tempObj,
263
+ // k: keyArr[i],
264
+ // v: tempObj ? tempObj[keyArr[i]] : null,
265
+ // };
266
+ return tempObj ? tempObj[keyArr[i]] : null;
239
267
  }
240
268
  /** 监听 */
241
269
  /** 计算属性 */
@@ -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 15:46:52
7
+ * @LastEditTime: 2023-04-09 16:48:04
8
8
  -->
9
9
  <template>
10
10
  <div>
@@ -47,7 +47,7 @@
47
47
  </template>
48
48
  <script lang="ts">
49
49
  import { Component, Vue } from 'vue-property-decorator';
50
- import HtTable from '@/packages/HtTable/table.vue';
50
+ import HtTable from '@/packages/HtTable/index.vue';
51
51
  import HtCountDown from '@/packages/HtCountDown/index.vue';
52
52
  import HtSelectUser from '@/packages/HtSelectUser/index.vue';
53
53
  import HtSelectOrg from '@/packages/HtSelectOrg/index.vue';
@@ -134,6 +134,12 @@ export default class Index extends Vue {
134
134
  disabled: true,
135
135
  deafaultShow: true,
136
136
  },
137
+ {
138
+ title: 'selectable',
139
+ key: 'selectable',
140
+ width: '300px',
141
+ type: 'boolean',
142
+ },
137
143
  {
138
144
  title: '姓额外名',
139
145
  key: 'namey',