hy-dispatch-ui-v3 0.2.46 → 0.2.48

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.
@@ -86,7 +86,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
86
86
  "reset",
87
87
  "validate",
88
88
  "submitting",
89
- "submit"
89
+ "submit",
90
+ "onMinimized",
91
+ "onDialogMousedown"
90
92
  ], ["update:modelValue"]),
91
93
  setup(__props, { expose: __expose, emit: __emit }) {
92
94
  const emits = __emit;
@@ -96,6 +98,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
96
98
  const isSubmitting = ref(false);
97
99
  const failedCount = ref(0);
98
100
  const failedStatus = ref(null);
101
+ const HyDialogRef = useTemplateRef("HyDialogRef");
102
+ function setDragLevelIndex(dragLevel) {
103
+ HyDialogRef.value.setDragLevelIndex(dragLevel);
104
+ }
105
+ function onMinimized(e) {
106
+ emits("onMinimized", e);
107
+ }
108
+ function onDialogMousedown(e) {
109
+ emits("onDialogMousedown", e);
110
+ }
99
111
  async function show() {
100
112
  visible.value = true;
101
113
  showSubmit.value = false;
@@ -144,6 +156,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
144
156
  }
145
157
  __expose({
146
158
  show,
159
+ setDragLevelIndex,
147
160
  getTableDataSource: () => {
148
161
  return batchTableFormRef.value.getTableDataSource();
149
162
  },
@@ -156,6 +169,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
156
169
  });
157
170
  return (_ctx, _cache) => {
158
171
  return openBlock(), createBlock(unref(HyDialog), mergeProps({
172
+ ref_key: "HyDialogRef",
173
+ ref: HyDialogRef,
159
174
  modelValue: visible.value,
160
175
  "onUpdate:modelValue": ($event) => visible.value = $event,
161
176
  loading: isSubmitting.value,
@@ -168,7 +183,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
168
183
  "show-cancel": !isSubmitting.value,
169
184
  ifShrink: __props.ifShrink,
170
185
  ifDraggable: __props.ifDraggable
171
- }, _ctx.$attrs), createSlots({
186
+ }, _ctx.$attrs, {
187
+ onOnMinimized: onMinimized,
188
+ onOnDialogMousedown: onDialogMousedown
189
+ }), createSlots({
172
190
  "operate-left-box": withCtx(() => [
173
191
  failedCount.value ? (openBlock(), createElementBlock("div", {
174
192
  key: 0,
@@ -24,6 +24,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
24
24
  type: String,
25
25
  default: ""
26
26
  },
27
+ operateClass: {
28
+ type: String,
29
+ default: ""
30
+ },
27
31
  top: String,
28
32
  // 是否可缩小化
29
33
  ifShrink: { type: Boolean, default: false },
@@ -40,7 +44,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
40
44
  default: "default"
41
45
  },
42
46
  cancelText: {
43
- type: String
47
+ type: String,
48
+ default: () => {
49
+ return null;
50
+ }
51
+ },
52
+ submitText: {
53
+ type: String,
54
+ default: () => {
55
+ return null;
56
+ }
44
57
  },
45
58
  showSubmit: {
46
59
  type: Boolean,
@@ -56,9 +69,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
56
69
  return "1000px";
57
70
  }
58
71
  },
59
- submitText: {
60
- type: String
61
- },
62
72
  onClose: Function,
63
73
  onCancel: Function,
64
74
  onSubmit: Function
@@ -259,47 +269,55 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
259
269
  key: 0,
260
270
  class: "flex items-center flex-row-reverse justify-between p-5 pr-[26px] mt-auto box-border"
261
271
  }, [
262
- createElementVNode("div", { class: "flex items-center" }, [
263
- renderSlot(_ctx.$slots, "operate", {}, () => [
264
- __props.showCancel ? (openBlock(), createBlock(unref(HyButton), {
265
- key: 0,
266
- type: __props.cancelType,
267
- disabled: loading.value,
268
- class: "!min-w-[120px]",
269
- onMousedown: withModifiers(() => {
270
- }, ["stop"]),
271
- onClick: onCancelHandler
272
- }, {
273
- default: withCtx(() => [
274
- createTextVNode(
275
- toDisplayString(unref(t)("dialog.cancel")),
276
- 1
277
- /* TEXT */
278
- )
279
- ]),
280
- _: 1
281
- /* STABLE */
282
- }, 8, ["type", "disabled", "onMousedown"])) : createCommentVNode("v-if", true),
283
- __props.showSubmit ? (openBlock(), createBlock(unref(HyButton), {
284
- key: 1,
285
- type: __props.submitType,
286
- disabled: loading.value,
287
- class: "!min-w-[120px]",
288
- onClick: onSubmitHandler
289
- }, {
290
- default: withCtx(() => [
291
- createTextVNode(
292
- toDisplayString(unref(t)("dialog.confirm")),
293
- 1
294
- /* TEXT */
295
- )
296
- ]),
297
- _: 1
298
- /* STABLE */
299
- }, 8, ["type", "disabled"])) : createCommentVNode("v-if", true)
300
- ]),
301
- renderSlot(_ctx.$slots, "operate-right-box")
302
- ]),
272
+ createElementVNode(
273
+ "div",
274
+ {
275
+ class: normalizeClass([__props.operateClass, "flex items-center"])
276
+ },
277
+ [
278
+ renderSlot(_ctx.$slots, "operate", {}, () => [
279
+ __props.showCancel ? (openBlock(), createBlock(unref(HyButton), {
280
+ key: 0,
281
+ type: __props.cancelType,
282
+ disabled: loading.value,
283
+ class: "!min-w-[120px]",
284
+ onMousedown: withModifiers(() => {
285
+ }, ["stop"]),
286
+ onClick: onCancelHandler
287
+ }, {
288
+ default: withCtx(() => [
289
+ createTextVNode(
290
+ toDisplayString(__props.cancelText || unref(t)("dialog.cancel")),
291
+ 1
292
+ /* TEXT */
293
+ )
294
+ ]),
295
+ _: 1
296
+ /* STABLE */
297
+ }, 8, ["type", "disabled", "onMousedown"])) : createCommentVNode("v-if", true),
298
+ __props.showSubmit ? (openBlock(), createBlock(unref(HyButton), {
299
+ key: 1,
300
+ type: __props.submitType,
301
+ disabled: loading.value,
302
+ class: "!min-w-[120px]",
303
+ onClick: onSubmitHandler
304
+ }, {
305
+ default: withCtx(() => [
306
+ createTextVNode(
307
+ toDisplayString(__props.submitText || unref(t)("dialog.confirm")),
308
+ 1
309
+ /* TEXT */
310
+ )
311
+ ]),
312
+ _: 1
313
+ /* STABLE */
314
+ }, 8, ["type", "disabled"])) : createCommentVNode("v-if", true)
315
+ ]),
316
+ renderSlot(_ctx.$slots, "operate-right-box")
317
+ ],
318
+ 2
319
+ /* CLASS */
320
+ ),
303
321
  renderSlot(_ctx.$slots, "operate-left-box")
304
322
  ])) : createCommentVNode("v-if", true)
305
323
  ])
@@ -232,7 +232,7 @@ const _sfc_main = {
232
232
  "onUpdate:end": ($event) => bindValue2.value = $event,
233
233
  "is-range": true,
234
234
  style: { "width": "100%" },
235
- teleported: false
235
+ teleported: true
236
236
  }, __props.column.attrs, {
237
237
  disabled: unref(isDisabled)(props, __props.column),
238
238
  onChange: onChangeHandler
@@ -242,7 +242,7 @@ const _sfc_main = {
242
242
  "onUpdate:modelValue": ($event) => bindValue.value = $event,
243
243
  "is-range": false,
244
244
  style: { "width": "100%" },
245
- teleported: false
245
+ teleported: true
246
246
  }, __props.column.attrs, {
247
247
  disabled: unref(isDisabled)(props, __props.column),
248
248
  onChange: onChangeHandler
@@ -263,7 +263,7 @@ const _sfc_main = {
263
263
  "onUpdate:end": ($event) => bindValue2.value = $event,
264
264
  "is-range": true,
265
265
  style: { "width": "100%" },
266
- teleported: false
266
+ teleported: true
267
267
  }, __props.column.attrs, {
268
268
  disabled: unref(isDisabled)(props, __props.column),
269
269
  onChange: onChangeHandler
@@ -273,7 +273,7 @@ const _sfc_main = {
273
273
  "onUpdate:modelValue": ($event) => bindValue.value = $event,
274
274
  "is-range": false,
275
275
  style: { "width": "100%" },
276
- teleported: false
276
+ teleported: true
277
277
  }, __props.column.attrs, {
278
278
  disabled: unref(isDisabled)(props, __props.column),
279
279
  onChange: onChangeHandler
@@ -35,6 +35,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
35
35
  type: Boolean,
36
36
  default: false
37
37
  },
38
+ loading: {
39
+ type: Boolean,
40
+ default: false
41
+ },
38
42
  disabled: {
39
43
  type: Boolean,
40
44
  default: false
@@ -168,7 +172,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
168
172
  column,
169
173
  rules: __props.rules,
170
174
  columnNum: __props.columnNum,
171
- loading: _ctx.loading,
175
+ loading: __props.loading,
172
176
  disabled: __props.disabled,
173
177
  readonly: __props.readonly,
174
178
  style: normalizeStyle(unref(columnItemStyle)(props, column))
@@ -199,7 +203,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
199
203
  column,
200
204
  rules: __props.rules,
201
205
  columnNum: __props.columnNum,
202
- loading: _ctx.loading,
206
+ loading: __props.loading,
203
207
  disabled: __props.disabled,
204
208
  readonly: __props.readonly,
205
209
  size: __props.size,
@@ -229,7 +233,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
229
233
  model: __props.model,
230
234
  column,
231
235
  rules: __props.rules,
232
- loading: _ctx.loading,
236
+ loading: __props.loading,
233
237
  disabled: __props.disabled,
234
238
  readonly: __props.readonly
235
239
  }, createSlots({
@@ -105,7 +105,8 @@ const useAppTreeWrapper = (hy) => {
105
105
  return false;
106
106
  }
107
107
  return false;
108
- }
108
+ },
109
+ ...props.treeProps
109
110
  },
110
111
  rowSelection: {
111
112
  type: props.showCheckbox ? "checkbox" : "radio",
@@ -121,6 +122,7 @@ const useAppTreeWrapper = (hy) => {
121
122
  cancelable: true,
122
123
  // 选中回调
123
124
  onCheckChange: (data, info, checked) => {
125
+ console.log("onCheckChange", info);
124
126
  if (data.dataType === 3 && !checked) {
125
127
  emits("on-click-delete", JSON.parse(JSON.stringify(data)));
126
128
  } else if (data.dataType === 3) {
@@ -128,7 +130,9 @@ const useAppTreeWrapper = (hy) => {
128
130
  }
129
131
  emits(
130
132
  "on-check-tree",
131
- JSON.parse(JSON.stringify(info.checkedBusinessNodes))
133
+ JSON.parse(
134
+ JSON.stringify(info.checkedBusinessNodes || info.checkedNodes)
135
+ )
132
136
  );
133
137
  }
134
138
  },
@@ -136,7 +140,9 @@ const useAppTreeWrapper = (hy) => {
136
140
  filterMethod: ({ filterValue: filterValue2 }, data) => {
137
141
  let isFilter = true;
138
142
  if (filterValue2) {
139
- isFilter = isFilter && !!filterNodeMethod(data, filterValue2);
143
+ isFilter = isFilter && !!filterNodeMethod(data, filterValue2, {
144
+ treeFilterParam: props.treeFilterParam
145
+ });
140
146
  }
141
147
  return isFilter;
142
148
  },
@@ -369,23 +375,29 @@ const useAppTreeWrapper = (hy) => {
369
375
  emits("on-addDevice");
370
376
  }
371
377
  function singleRemovalFn(row) {
372
- if (props.treeType === "user") {
373
- virtualTree.setChecked(row.id, false, true);
374
- } else {
378
+ if (props.treeType === "device") {
375
379
  virtualTree.setChecked(row.deviceId, false, true);
380
+ } else if (props.treeType) {
381
+ virtualTree.setChecked(row.id, false, true);
382
+ } else if (!props.treeType && props.treeProps) {
383
+ virtualTree.setChecked(row[`${props.treeProps.value}`], false, true);
376
384
  }
377
385
  }
378
386
  function setCheckedKeys(dataList) {
379
- if (props.treeType === "user") {
387
+ if (props.treeType === "device") {
380
388
  virtualTree?.setCheckedKeys(
381
- dataList.map((v) => v.id),
389
+ dataList.map((v) => v.deviceId),
382
390
  true
383
391
  );
384
- } else {
392
+ } else if (props.treeType) {
385
393
  virtualTree?.setCheckedKeys(
386
- dataList.map((v) => v.deviceId),
394
+ dataList.map((v) => v.id),
387
395
  true
388
396
  );
397
+ } else if (!props.treeType && props.treeProps) {
398
+ virtualTree?.setCheckedKeys(
399
+ dataList.map((v) => v[`${props.treeProps.value}`])
400
+ );
389
401
  }
390
402
  if (props.isBackDefaultSelected) {
391
403
  setTimeout(() => {
@@ -395,10 +407,12 @@ const useAppTreeWrapper = (hy) => {
395
407
  }
396
408
  }
397
409
  function setChecked(data, type) {
398
- if (props.treeType === "user") {
399
- virtualTree?.setChecked(data.id, type, true);
400
- } else {
410
+ if (props.treeType === "device") {
401
411
  virtualTree?.setChecked(data.deviceId, type, true);
412
+ } else if (props.treeType) {
413
+ virtualTree?.setChecked(data.id, type, true);
414
+ } else if (!props.treeType && props.treeProps) {
415
+ virtualTree?.setChecked(data[`${props.treeProps.value}`], type, true);
402
416
  }
403
417
  }
404
418
  function setSelectedOrg(deviceList) {
@@ -498,31 +512,46 @@ const useAppTreeWrapper = (hy) => {
498
512
  getSelectedDataList
499
513
  };
500
514
  };
501
- function filterNodeMethod(data, value, selectFilterType) {
515
+ function filterNodeMethod(data, value, { selectFilterType, treeFilterParam = [] }) {
502
516
  let type = data.dataType;
517
+ if (selectFilterType) type = selectFilterType;
503
518
  const includesValue = (field) => {
504
519
  return field && field.toString().includes(value.toString());
505
520
  };
506
- switch (type) {
507
- case 7:
508
- if (data.typeName === "workOrderList") {
509
- return includesValue(data.workTimeName);
510
- } else {
511
- return includesValue(data.dailyCheckName);
521
+ if (!type) {
522
+ let filterType = false;
523
+ for (let i = 0; i < treeFilterParam.length; i++) {
524
+ const item = treeFilterParam[i];
525
+ if (!filterType) {
526
+ filterType = includesValue(data[`${item}`]);
527
+ if (filterType) {
528
+ break;
529
+ }
512
530
  }
513
- case 6:
514
- return includesValue(data.deviceUserName) || includesValue(data.item?.deviceId);
515
- case 5:
516
- return includesValue(data.jobNum) || includesValue(data.name) || includesValue(data.phone);
517
- case 4:
518
- case 11:
519
- return includesValue(data.groupName);
520
- case 8:
521
- return includesValue(data.sname);
522
- case 3:
523
- return includesValue(data.deviceId) || includesValue(data.devName) || includesValue(data.name) || includesValue(data.deviceCode) || includesValue(data.imei);
524
- default:
525
- return includesValue(data.companyName) || includesValue(data.orgName);
531
+ }
532
+ return filterType;
533
+ } else {
534
+ switch (type) {
535
+ case 7:
536
+ if (data.typeName === "workOrderList") {
537
+ return includesValue(data.workTimeName);
538
+ } else {
539
+ return includesValue(data.dailyCheckName);
540
+ }
541
+ case 6:
542
+ return includesValue(data.deviceUserName) || includesValue(data.item?.deviceId);
543
+ case 5:
544
+ return includesValue(data.jobNum) || includesValue(data.name) || includesValue(data.phone);
545
+ case 4:
546
+ case 11:
547
+ return includesValue(data.groupName);
548
+ case 8:
549
+ return includesValue(data.sname);
550
+ case 3:
551
+ return includesValue(data.deviceId) || includesValue(data.devName) || includesValue(data.name) || includesValue(data.deviceCode) || includesValue(data.imei);
552
+ default:
553
+ return includesValue(data.companyName) || includesValue(data.orgName);
554
+ }
526
555
  }
527
556
  }
528
557
 
@@ -77,6 +77,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
77
77
  return treeTypeConfig.device;
78
78
  }
79
79
  },
80
+ // 树形 props 类型 (treeType null时生效)
81
+ treeProps: {
82
+ type: Object,
83
+ default: () => {
84
+ return {};
85
+ }
86
+ },
87
+ // 树形 过滤参数 类型 (treeType null时生效)
88
+ treeFilterParam: {
89
+ type: Array,
90
+ default: () => {
91
+ return [];
92
+ }
93
+ },
80
94
  // 是否显示通道节点的选择框
81
95
  isShowChannelSelect: {
82
96
  type: Boolean,
@@ -0,0 +1,8 @@
1
+ export default {
2
+ id: 'hy-icon-layout-sidenav-parameter-settings',
3
+ symbol: `<symbol id="hy-icon-layout-sidenav-parameter-settings" viewBox="0 0 20 20">
4
+ <g id="hy-icon-layout-sidenav-parameter-settings-menu/ParameterSettings" stroke="none" stroke-width="1" fill-rule="evenodd">
5
+ <path d="M15.8266599,2 L4.1733401,2 C2.97313737,2 2,2.97313735 2,4.17334008 L2,15.8266599 C2,17.0268626 2.97313735,18 4.1733401,18 L15.8266599,18 C17.0268627,18 18,17.0268627 18,15.8266599 L18,4.17334008 C17.9959453,2.97313735 17.0228079,2 15.8266599,2 Z M15.4941713,14.1033958 L13.6087177,14.1033958 C13.2924481,14.7602636 12.6234161,15.2184491 11.8449062,15.2184491 C11.0663964,15.2184491 10.3973644,14.7643183 10.0810948,14.1033958 L4.80993411,14.1033958 C4.34769387,14.1033958 3.97060315,13.7263051 3.97060315,13.2640649 C3.97060315,12.8018246 4.34769387,12.4247339 4.80993411,12.4247339 L10.0851495,12.4247339 C10.4014192,11.7678662 11.0704511,11.3096807 11.848961,11.3096807 C12.6274709,11.3096807 13.2965028,11.7638115 13.6127724,12.4247339 L15.4941713,12.4247339 C15.9564116,12.4247339 16.3335347,12.8018246 16.3335347,13.2640649 C16.337557,13.7303599 15.9604663,14.1033958 15.4941713,14.1033958 Z M15.4941713,7.57121135 L9.95945262,7.57121135 C9.64318298,8.22807907 8.97415105,8.68626458 8.19564115,8.68626458 C7.41713125,8.68626458 6.74809933,8.23213381 6.4318297,7.57121135 L4.80993411,7.57121135 C4.34769387,7.57121135 3.97060315,7.19412063 3.97060315,6.73188038 C3.97060315,6.26964014 4.34769387,5.89254941 4.80993411,5.89254941 L6.43588444,5.89254941 C6.75215408,5.2356817 7.42118601,4.77749619 8.1996959,4.77749619 C8.97820578,4.77749619 9.64723771,5.23162695 9.96350735,5.89254941 L15.4941713,5.89254941 C15.9564116,5.89254941 16.3335347,6.26964014 16.3335347,6.73188038 C16.337557,7.19412061 15.9604663,7.57121134 15.4941713,7.57121135 Z" id="hy-icon-layout-sidenav-parameter-settings-形状" fill-rule="nonzero"></path>
6
+ </g>
7
+ </symbol>`,
8
+ };
package/es/version.mjs CHANGED
@@ -1,3 +1,3 @@
1
- const version = "0.2.45";
1
+ const version = "0.2.47";
2
2
 
3
3
  export { version };
@@ -90,7 +90,9 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
90
90
  "reset",
91
91
  "validate",
92
92
  "submitting",
93
- "submit"
93
+ "submit",
94
+ "onMinimized",
95
+ "onDialogMousedown"
94
96
  ], ["update:modelValue"]),
95
97
  setup(__props, { expose: __expose, emit: __emit }) {
96
98
  const emits = __emit;
@@ -100,6 +102,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
100
102
  const isSubmitting = vue.ref(false);
101
103
  const failedCount = vue.ref(0);
102
104
  const failedStatus = vue.ref(null);
105
+ const HyDialogRef = vue.useTemplateRef("HyDialogRef");
106
+ function setDragLevelIndex(dragLevel) {
107
+ HyDialogRef.value.setDragLevelIndex(dragLevel);
108
+ }
109
+ function onMinimized(e) {
110
+ emits("onMinimized", e);
111
+ }
112
+ function onDialogMousedown(e) {
113
+ emits("onDialogMousedown", e);
114
+ }
103
115
  async function show() {
104
116
  visible.value = true;
105
117
  showSubmit.value = false;
@@ -148,6 +160,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
148
160
  }
149
161
  __expose({
150
162
  show,
163
+ setDragLevelIndex,
151
164
  getTableDataSource: () => {
152
165
  return batchTableFormRef.value.getTableDataSource();
153
166
  },
@@ -160,6 +173,8 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
160
173
  });
161
174
  return (_ctx, _cache) => {
162
175
  return vue.openBlock(), vue.createBlock(vue.unref(index.HyDialog), vue.mergeProps({
176
+ ref_key: "HyDialogRef",
177
+ ref: HyDialogRef,
163
178
  modelValue: visible.value,
164
179
  "onUpdate:modelValue": ($event) => visible.value = $event,
165
180
  loading: isSubmitting.value,
@@ -172,7 +187,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
172
187
  "show-cancel": !isSubmitting.value,
173
188
  ifShrink: __props.ifShrink,
174
189
  ifDraggable: __props.ifDraggable
175
- }, _ctx.$attrs), vue.createSlots({
190
+ }, _ctx.$attrs, {
191
+ onOnMinimized: onMinimized,
192
+ onOnDialogMousedown: onDialogMousedown
193
+ }), vue.createSlots({
176
194
  "operate-left-box": vue.withCtx(() => [
177
195
  failedCount.value ? (vue.openBlock(), vue.createElementBlock("div", {
178
196
  key: 0,
@@ -28,6 +28,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
28
28
  type: String,
29
29
  default: ""
30
30
  },
31
+ operateClass: {
32
+ type: String,
33
+ default: ""
34
+ },
31
35
  top: String,
32
36
  // 是否可缩小化
33
37
  ifShrink: { type: Boolean, default: false },
@@ -44,7 +48,16 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
44
48
  default: "default"
45
49
  },
46
50
  cancelText: {
47
- type: String
51
+ type: String,
52
+ default: () => {
53
+ return null;
54
+ }
55
+ },
56
+ submitText: {
57
+ type: String,
58
+ default: () => {
59
+ return null;
60
+ }
48
61
  },
49
62
  showSubmit: {
50
63
  type: Boolean,
@@ -60,9 +73,6 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
60
73
  return "1000px";
61
74
  }
62
75
  },
63
- submitText: {
64
- type: String
65
- },
66
76
  onClose: Function,
67
77
  onCancel: Function,
68
78
  onSubmit: Function
@@ -263,47 +273,55 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
263
273
  key: 0,
264
274
  class: "flex items-center flex-row-reverse justify-between p-5 pr-[26px] mt-auto box-border"
265
275
  }, [
266
- vue.createElementVNode("div", { class: "flex items-center" }, [
267
- vue.renderSlot(_ctx.$slots, "operate", {}, () => [
268
- __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index.HyButton), {
269
- key: 0,
270
- type: __props.cancelType,
271
- disabled: loading.value,
272
- class: "!min-w-[120px]",
273
- onMousedown: vue.withModifiers(() => {
274
- }, ["stop"]),
275
- onClick: onCancelHandler
276
- }, {
277
- default: vue.withCtx(() => [
278
- vue.createTextVNode(
279
- vue.toDisplayString(vue.unref(t)("dialog.cancel")),
280
- 1
281
- /* TEXT */
282
- )
283
- ]),
284
- _: 1
285
- /* STABLE */
286
- }, 8, ["type", "disabled", "onMousedown"])) : vue.createCommentVNode("v-if", true),
287
- __props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(index.HyButton), {
288
- key: 1,
289
- type: __props.submitType,
290
- disabled: loading.value,
291
- class: "!min-w-[120px]",
292
- onClick: onSubmitHandler
293
- }, {
294
- default: vue.withCtx(() => [
295
- vue.createTextVNode(
296
- vue.toDisplayString(vue.unref(t)("dialog.confirm")),
297
- 1
298
- /* TEXT */
299
- )
300
- ]),
301
- _: 1
302
- /* STABLE */
303
- }, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true)
304
- ]),
305
- vue.renderSlot(_ctx.$slots, "operate-right-box")
306
- ]),
276
+ vue.createElementVNode(
277
+ "div",
278
+ {
279
+ class: vue.normalizeClass([__props.operateClass, "flex items-center"])
280
+ },
281
+ [
282
+ vue.renderSlot(_ctx.$slots, "operate", {}, () => [
283
+ __props.showCancel ? (vue.openBlock(), vue.createBlock(vue.unref(index.HyButton), {
284
+ key: 0,
285
+ type: __props.cancelType,
286
+ disabled: loading.value,
287
+ class: "!min-w-[120px]",
288
+ onMousedown: vue.withModifiers(() => {
289
+ }, ["stop"]),
290
+ onClick: onCancelHandler
291
+ }, {
292
+ default: vue.withCtx(() => [
293
+ vue.createTextVNode(
294
+ vue.toDisplayString(__props.cancelText || vue.unref(t)("dialog.cancel")),
295
+ 1
296
+ /* TEXT */
297
+ )
298
+ ]),
299
+ _: 1
300
+ /* STABLE */
301
+ }, 8, ["type", "disabled", "onMousedown"])) : vue.createCommentVNode("v-if", true),
302
+ __props.showSubmit ? (vue.openBlock(), vue.createBlock(vue.unref(index.HyButton), {
303
+ key: 1,
304
+ type: __props.submitType,
305
+ disabled: loading.value,
306
+ class: "!min-w-[120px]",
307
+ onClick: onSubmitHandler
308
+ }, {
309
+ default: vue.withCtx(() => [
310
+ vue.createTextVNode(
311
+ vue.toDisplayString(__props.submitText || vue.unref(t)("dialog.confirm")),
312
+ 1
313
+ /* TEXT */
314
+ )
315
+ ]),
316
+ _: 1
317
+ /* STABLE */
318
+ }, 8, ["type", "disabled"])) : vue.createCommentVNode("v-if", true)
319
+ ]),
320
+ vue.renderSlot(_ctx.$slots, "operate-right-box")
321
+ ],
322
+ 2
323
+ /* CLASS */
324
+ ),
307
325
  vue.renderSlot(_ctx.$slots, "operate-left-box")
308
326
  ])) : vue.createCommentVNode("v-if", true)
309
327
  ])
@@ -236,7 +236,7 @@ const _sfc_main = {
236
236
  "onUpdate:end": ($event) => bindValue2.value = $event,
237
237
  "is-range": true,
238
238
  style: { "width": "100%" },
239
- teleported: false
239
+ teleported: true
240
240
  }, __props.column.attrs, {
241
241
  disabled: vue.unref(index.isDisabled)(props, __props.column),
242
242
  onChange: onChangeHandler
@@ -246,7 +246,7 @@ const _sfc_main = {
246
246
  "onUpdate:modelValue": ($event) => bindValue.value = $event,
247
247
  "is-range": false,
248
248
  style: { "width": "100%" },
249
- teleported: false
249
+ teleported: true
250
250
  }, __props.column.attrs, {
251
251
  disabled: vue.unref(index.isDisabled)(props, __props.column),
252
252
  onChange: onChangeHandler
@@ -267,7 +267,7 @@ const _sfc_main = {
267
267
  "onUpdate:end": ($event) => bindValue2.value = $event,
268
268
  "is-range": true,
269
269
  style: { "width": "100%" },
270
- teleported: false
270
+ teleported: true
271
271
  }, __props.column.attrs, {
272
272
  disabled: vue.unref(index.isDisabled)(props, __props.column),
273
273
  onChange: onChangeHandler
@@ -277,7 +277,7 @@ const _sfc_main = {
277
277
  "onUpdate:modelValue": ($event) => bindValue.value = $event,
278
278
  "is-range": false,
279
279
  style: { "width": "100%" },
280
- teleported: false
280
+ teleported: true
281
281
  }, __props.column.attrs, {
282
282
  disabled: vue.unref(index.isDisabled)(props, __props.column),
283
283
  onChange: onChangeHandler
@@ -39,6 +39,10 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
39
39
  type: Boolean,
40
40
  default: false
41
41
  },
42
+ loading: {
43
+ type: Boolean,
44
+ default: false
45
+ },
42
46
  disabled: {
43
47
  type: Boolean,
44
48
  default: false
@@ -172,7 +176,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
172
176
  column,
173
177
  rules: __props.rules,
174
178
  columnNum: __props.columnNum,
175
- loading: _ctx.loading,
179
+ loading: __props.loading,
176
180
  disabled: __props.disabled,
177
181
  readonly: __props.readonly,
178
182
  style: vue.normalizeStyle(vue.unref(index.columnItemStyle)(props, column))
@@ -203,7 +207,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
203
207
  column,
204
208
  rules: __props.rules,
205
209
  columnNum: __props.columnNum,
206
- loading: _ctx.loading,
210
+ loading: __props.loading,
207
211
  disabled: __props.disabled,
208
212
  readonly: __props.readonly,
209
213
  size: __props.size,
@@ -233,7 +237,7 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
233
237
  model: __props.model,
234
238
  column,
235
239
  rules: __props.rules,
236
- loading: _ctx.loading,
240
+ loading: __props.loading,
237
241
  disabled: __props.disabled,
238
242
  readonly: __props.readonly
239
243
  }, vue.createSlots({
@@ -107,7 +107,8 @@ const useAppTreeWrapper = (hy) => {
107
107
  return false;
108
108
  }
109
109
  return false;
110
- }
110
+ },
111
+ ...props.treeProps
111
112
  },
112
113
  rowSelection: {
113
114
  type: props.showCheckbox ? "checkbox" : "radio",
@@ -123,6 +124,7 @@ const useAppTreeWrapper = (hy) => {
123
124
  cancelable: true,
124
125
  // 选中回调
125
126
  onCheckChange: (data, info, checked) => {
127
+ console.log("onCheckChange", info);
126
128
  if (data.dataType === 3 && !checked) {
127
129
  emits("on-click-delete", JSON.parse(JSON.stringify(data)));
128
130
  } else if (data.dataType === 3) {
@@ -130,7 +132,9 @@ const useAppTreeWrapper = (hy) => {
130
132
  }
131
133
  emits(
132
134
  "on-check-tree",
133
- JSON.parse(JSON.stringify(info.checkedBusinessNodes))
135
+ JSON.parse(
136
+ JSON.stringify(info.checkedBusinessNodes || info.checkedNodes)
137
+ )
134
138
  );
135
139
  }
136
140
  },
@@ -138,7 +142,9 @@ const useAppTreeWrapper = (hy) => {
138
142
  filterMethod: ({ filterValue: filterValue2 }, data) => {
139
143
  let isFilter = true;
140
144
  if (filterValue2) {
141
- isFilter = isFilter && !!filterNodeMethod(data, filterValue2);
145
+ isFilter = isFilter && !!filterNodeMethod(data, filterValue2, {
146
+ treeFilterParam: props.treeFilterParam
147
+ });
142
148
  }
143
149
  return isFilter;
144
150
  },
@@ -371,23 +377,29 @@ const useAppTreeWrapper = (hy) => {
371
377
  emits("on-addDevice");
372
378
  }
373
379
  function singleRemovalFn(row) {
374
- if (props.treeType === "user") {
375
- virtualTree.setChecked(row.id, false, true);
376
- } else {
380
+ if (props.treeType === "device") {
377
381
  virtualTree.setChecked(row.deviceId, false, true);
382
+ } else if (props.treeType) {
383
+ virtualTree.setChecked(row.id, false, true);
384
+ } else if (!props.treeType && props.treeProps) {
385
+ virtualTree.setChecked(row[`${props.treeProps.value}`], false, true);
378
386
  }
379
387
  }
380
388
  function setCheckedKeys(dataList) {
381
- if (props.treeType === "user") {
389
+ if (props.treeType === "device") {
382
390
  virtualTree?.setCheckedKeys(
383
- dataList.map((v) => v.id),
391
+ dataList.map((v) => v.deviceId),
384
392
  true
385
393
  );
386
- } else {
394
+ } else if (props.treeType) {
387
395
  virtualTree?.setCheckedKeys(
388
- dataList.map((v) => v.deviceId),
396
+ dataList.map((v) => v.id),
389
397
  true
390
398
  );
399
+ } else if (!props.treeType && props.treeProps) {
400
+ virtualTree?.setCheckedKeys(
401
+ dataList.map((v) => v[`${props.treeProps.value}`])
402
+ );
391
403
  }
392
404
  if (props.isBackDefaultSelected) {
393
405
  setTimeout(() => {
@@ -397,10 +409,12 @@ const useAppTreeWrapper = (hy) => {
397
409
  }
398
410
  }
399
411
  function setChecked(data, type) {
400
- if (props.treeType === "user") {
401
- virtualTree?.setChecked(data.id, type, true);
402
- } else {
412
+ if (props.treeType === "device") {
403
413
  virtualTree?.setChecked(data.deviceId, type, true);
414
+ } else if (props.treeType) {
415
+ virtualTree?.setChecked(data.id, type, true);
416
+ } else if (!props.treeType && props.treeProps) {
417
+ virtualTree?.setChecked(data[`${props.treeProps.value}`], type, true);
404
418
  }
405
419
  }
406
420
  function setSelectedOrg(deviceList) {
@@ -500,31 +514,46 @@ const useAppTreeWrapper = (hy) => {
500
514
  getSelectedDataList
501
515
  };
502
516
  };
503
- function filterNodeMethod(data, value, selectFilterType) {
517
+ function filterNodeMethod(data, value, { selectFilterType, treeFilterParam = [] }) {
504
518
  let type = data.dataType;
519
+ if (selectFilterType) type = selectFilterType;
505
520
  const includesValue = (field) => {
506
521
  return field && field.toString().includes(value.toString());
507
522
  };
508
- switch (type) {
509
- case 7:
510
- if (data.typeName === "workOrderList") {
511
- return includesValue(data.workTimeName);
512
- } else {
513
- return includesValue(data.dailyCheckName);
523
+ if (!type) {
524
+ let filterType = false;
525
+ for (let i = 0; i < treeFilterParam.length; i++) {
526
+ const item = treeFilterParam[i];
527
+ if (!filterType) {
528
+ filterType = includesValue(data[`${item}`]);
529
+ if (filterType) {
530
+ break;
531
+ }
514
532
  }
515
- case 6:
516
- return includesValue(data.deviceUserName) || includesValue(data.item?.deviceId);
517
- case 5:
518
- return includesValue(data.jobNum) || includesValue(data.name) || includesValue(data.phone);
519
- case 4:
520
- case 11:
521
- return includesValue(data.groupName);
522
- case 8:
523
- return includesValue(data.sname);
524
- case 3:
525
- return includesValue(data.deviceId) || includesValue(data.devName) || includesValue(data.name) || includesValue(data.deviceCode) || includesValue(data.imei);
526
- default:
527
- return includesValue(data.companyName) || includesValue(data.orgName);
533
+ }
534
+ return filterType;
535
+ } else {
536
+ switch (type) {
537
+ case 7:
538
+ if (data.typeName === "workOrderList") {
539
+ return includesValue(data.workTimeName);
540
+ } else {
541
+ return includesValue(data.dailyCheckName);
542
+ }
543
+ case 6:
544
+ return includesValue(data.deviceUserName) || includesValue(data.item?.deviceId);
545
+ case 5:
546
+ return includesValue(data.jobNum) || includesValue(data.name) || includesValue(data.phone);
547
+ case 4:
548
+ case 11:
549
+ return includesValue(data.groupName);
550
+ case 8:
551
+ return includesValue(data.sname);
552
+ case 3:
553
+ return includesValue(data.deviceId) || includesValue(data.devName) || includesValue(data.name) || includesValue(data.deviceCode) || includesValue(data.imei);
554
+ default:
555
+ return includesValue(data.companyName) || includesValue(data.orgName);
556
+ }
528
557
  }
529
558
  }
530
559
 
@@ -81,6 +81,20 @@ const _sfc_main = /* @__PURE__ */ Object.assign(__default__, {
81
81
  return treeConfig.treeTypeConfig.device;
82
82
  }
83
83
  },
84
+ // 树形 props 类型 (treeType null时生效)
85
+ treeProps: {
86
+ type: Object,
87
+ default: () => {
88
+ return {};
89
+ }
90
+ },
91
+ // 树形 过滤参数 类型 (treeType null时生效)
92
+ treeFilterParam: {
93
+ type: Array,
94
+ default: () => {
95
+ return [];
96
+ }
97
+ },
84
98
  // 是否显示通道节点的选择框
85
99
  isShowChannelSelect: {
86
100
  type: Boolean,
@@ -0,0 +1,8 @@
1
+ export default {
2
+ id: 'hy-icon-layout-sidenav-parameter-settings',
3
+ symbol: `<symbol id="hy-icon-layout-sidenav-parameter-settings" viewBox="0 0 20 20">
4
+ <g id="hy-icon-layout-sidenav-parameter-settings-menu/ParameterSettings" stroke="none" stroke-width="1" fill-rule="evenodd">
5
+ <path d="M15.8266599,2 L4.1733401,2 C2.97313737,2 2,2.97313735 2,4.17334008 L2,15.8266599 C2,17.0268626 2.97313735,18 4.1733401,18 L15.8266599,18 C17.0268627,18 18,17.0268627 18,15.8266599 L18,4.17334008 C17.9959453,2.97313735 17.0228079,2 15.8266599,2 Z M15.4941713,14.1033958 L13.6087177,14.1033958 C13.2924481,14.7602636 12.6234161,15.2184491 11.8449062,15.2184491 C11.0663964,15.2184491 10.3973644,14.7643183 10.0810948,14.1033958 L4.80993411,14.1033958 C4.34769387,14.1033958 3.97060315,13.7263051 3.97060315,13.2640649 C3.97060315,12.8018246 4.34769387,12.4247339 4.80993411,12.4247339 L10.0851495,12.4247339 C10.4014192,11.7678662 11.0704511,11.3096807 11.848961,11.3096807 C12.6274709,11.3096807 13.2965028,11.7638115 13.6127724,12.4247339 L15.4941713,12.4247339 C15.9564116,12.4247339 16.3335347,12.8018246 16.3335347,13.2640649 C16.337557,13.7303599 15.9604663,14.1033958 15.4941713,14.1033958 Z M15.4941713,7.57121135 L9.95945262,7.57121135 C9.64318298,8.22807907 8.97415105,8.68626458 8.19564115,8.68626458 C7.41713125,8.68626458 6.74809933,8.23213381 6.4318297,7.57121135 L4.80993411,7.57121135 C4.34769387,7.57121135 3.97060315,7.19412063 3.97060315,6.73188038 C3.97060315,6.26964014 4.34769387,5.89254941 4.80993411,5.89254941 L6.43588444,5.89254941 C6.75215408,5.2356817 7.42118601,4.77749619 8.1996959,4.77749619 C8.97820578,4.77749619 9.64723771,5.23162695 9.96350735,5.89254941 L15.4941713,5.89254941 C15.9564116,5.89254941 16.3335347,6.26964014 16.3335347,6.73188038 C16.337557,7.19412061 15.9604663,7.57121134 15.4941713,7.57121135 Z" id="hy-icon-layout-sidenav-parameter-settings-形状" fill-rule="nonzero"></path>
6
+ </g>
7
+ </symbol>`,
8
+ };
package/lib/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  'use strict';
2
2
 
3
- const version = "0.2.45";
3
+ const version = "0.2.47";
4
4
 
5
5
  exports.version = version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hy-dispatch-ui-v3",
3
- "version": "0.2.46",
3
+ "version": "0.2.48",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "scripts": {