cnhis-design-vue 3.1.14-beta.11.2 → 3.1.14-beta.12

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.
@@ -0,0 +1,330 @@
1
+ import { defineComponent, ref, reactive, onMounted, computed, openBlock, createElementBlock, createVNode, unref, withCtx, createElementVNode, normalizeClass, createCommentVNode, createBlock, renderSlot, normalizeStyle, toDisplayString, withDirectives, vShow, vModelSelect, vModelText, createTextVNode } from 'vue';
2
+ import { NSpin, NCheckbox, NTooltip, NButton } from 'naive-ui';
3
+ import Draggable from 'vuedraggable';
4
+
5
+ const _hoisted_1 = { class: "fields-set-content" };
6
+ const _hoisted_2 = { class: "fields-table" };
7
+ const _hoisted_3 = /* @__PURE__ */ createElementVNode("span", {
8
+ class: "width-show",
9
+ style: { "width": "4%" }
10
+ }, null, -1);
11
+ const _hoisted_4 = /* @__PURE__ */ createElementVNode("span", { class: "width-large" }, "\u6240\u6709\u5B57\u6BB5", -1);
12
+ const _hoisted_5 = { class: "width-show" };
13
+ const _hoisted_6 = /* @__PURE__ */ createTextVNode(" \u663E\u793A ");
14
+ const _hoisted_7 = { class: "width-show" };
15
+ const _hoisted_8 = /* @__PURE__ */ createTextVNode(" \u6392\u5E8F ");
16
+ const _hoisted_9 = /* @__PURE__ */ createElementVNode("span", { class: "width-showed" }, "\u56FA\u5B9A", -1);
17
+ const _hoisted_10 = /* @__PURE__ */ createElementVNode("span", { class: "width-word" }, "\u81EA\u5B9A\u4E49\u6807\u9898", -1);
18
+ const _hoisted_11 = /* @__PURE__ */ createElementVNode("span", { class: "width-showed" }, "\u5217\u5BBD", -1);
19
+ const _hoisted_12 = ["onClick"];
20
+ const _hoisted_13 = { class: "width-show drag-icon-wrap" };
21
+ const _hoisted_14 = /* @__PURE__ */ createElementVNode("span", {
22
+ class: "iconfont icon-a-menzhenyishengzhanxitongtubiaotuozhuai",
23
+ style: { "color": "#000" }
24
+ }, null, -1);
25
+ const _hoisted_15 = /* @__PURE__ */ createElementVNode("span", null, "\u62D6\u62FD\u8C03\u6574\u987A\u5E8F", -1);
26
+ const _hoisted_16 = /* @__PURE__ */ createElementVNode("span", { style: { "width": "14px", "margin-right": "6px" } }, null, -1);
27
+ const _hoisted_17 = { class: "width-show" };
28
+ const _hoisted_18 = { class: "width-show" };
29
+ const _hoisted_19 = { class: "width-showed" };
30
+ const _hoisted_20 = ["onUpdate:modelValue"];
31
+ const _hoisted_21 = /* @__PURE__ */ createElementVNode("option", { value: 0 }, "\u4E0D\u56FA\u5B9A", -1);
32
+ const _hoisted_22 = /* @__PURE__ */ createElementVNode("option", { value: 1 }, "\u5DE6\u56FA\u5B9A", -1);
33
+ const _hoisted_23 = /* @__PURE__ */ createElementVNode("option", { value: 2 }, "\u53F3\u56FA\u5B9A", -1);
34
+ const _hoisted_24 = [
35
+ _hoisted_21,
36
+ _hoisted_22,
37
+ _hoisted_23
38
+ ];
39
+ const _hoisted_25 = { class: "width-word" };
40
+ const _hoisted_26 = ["onUpdate:modelValue"];
41
+ const _hoisted_27 = { class: "width-showed" };
42
+ const _hoisted_28 = ["onUpdate:modelValue"];
43
+ const _hoisted_29 = {
44
+ key: 0,
45
+ class: "check-options"
46
+ };
47
+ const _hoisted_30 = { class: "btn-operate" };
48
+ const _hoisted_31 = /* @__PURE__ */ createTextVNode("\u53D6\u6D88");
49
+ const _hoisted_32 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58");
50
+ var script = /* @__PURE__ */ defineComponent({
51
+ __name: "OldFieldSet",
52
+ props: {
53
+ fields: {
54
+ type: Array,
55
+ default: function() {
56
+ return [];
57
+ }
58
+ },
59
+ menuSource: {
60
+ type: String,
61
+ default: ""
62
+ },
63
+ drawerDirection: {
64
+ type: String,
65
+ default: "right"
66
+ },
67
+ footerFlag: {
68
+ type: Boolean,
69
+ default: true
70
+ }
71
+ },
72
+ emits: ["onSave", "onClose"],
73
+ setup(__props, { emit }) {
74
+ const props = __props;
75
+ const settingView = ref(null);
76
+ const state = reactive({
77
+ spinning: false,
78
+ isCustomSearch: true,
79
+ clickItem: {},
80
+ fields: props.fields
81
+ });
82
+ onMounted(() => {
83
+ hideTab();
84
+ });
85
+ const leftStyle = (ele) => {
86
+ return {
87
+ background: state.clickItem.sid === ele.sid ? "#f2f2f2" : void 0
88
+ };
89
+ };
90
+ const isMiddleAndAdmin = computed(() => props.menuSource == "middle");
91
+ const showCheckBox = (key) => {
92
+ return state.fields.some((i) => Object.prototype.hasOwnProperty.call(i, key));
93
+ };
94
+ const hideTab = () => {
95
+ var _a, _b;
96
+ if (isMiddleAndAdmin.value)
97
+ return;
98
+ if (props.drawerDirection === "right") {
99
+ (_a = settingView.value) == null ? void 0 : _a.style.setProperty("margin", "auto");
100
+ } else {
101
+ (_b = settingView.value) == null ? void 0 : _b.style.setProperty("margin", "auto");
102
+ }
103
+ };
104
+ const handleFieldSave = () => {
105
+ let tableFields = [];
106
+ if (state.fields.length > 0) {
107
+ state.fields.forEach((item, i) => {
108
+ tableFields.push({
109
+ id: item.sid,
110
+ field: item.columnName,
111
+ visible: item.isShow == 1,
112
+ sequence: i,
113
+ sortable: item.isSort == 1,
114
+ title: item.alias || item.title,
115
+ fixed: item.isFixed ? item.isFixed == 1 ? "left" : "right" : "",
116
+ minWidth: item.colWidth
117
+ });
118
+ });
119
+ }
120
+ emit("onSave", { tableFields });
121
+ };
122
+ const onCancle = () => {
123
+ emit("onClose");
124
+ };
125
+ const onChangeShow = (e, ele) => {
126
+ if (e == true) {
127
+ ele.isShow = 1;
128
+ } else {
129
+ ele.isShow = 0;
130
+ }
131
+ };
132
+ const onChangeSort = (e, ele) => {
133
+ if (e == true) {
134
+ ele.isSort = 1;
135
+ } else {
136
+ ele.isSort = 0;
137
+ }
138
+ };
139
+ const calculateCheck = (key) => {
140
+ if (!state.fields.length)
141
+ return false;
142
+ return state.fields.every((i) => {
143
+ if (!Object.prototype.hasOwnProperty.call(i, key))
144
+ return true;
145
+ return i[key];
146
+ });
147
+ };
148
+ const handleAllCheck = (e, key) => {
149
+ const value = e ? 1 : 0;
150
+ const data = state.fields.map((i) => {
151
+ if (Object.prototype.hasOwnProperty.call(i, key)) {
152
+ i[key] = value;
153
+ }
154
+ return i;
155
+ });
156
+ state.fields = data;
157
+ };
158
+ const handleFieldClick = (item) => {
159
+ state.clickItem = item;
160
+ };
161
+ return (_ctx, _cache) => {
162
+ return openBlock(), createElementBlock("div", {
163
+ ref_key: "settingView",
164
+ ref: settingView,
165
+ class: "c-field-set"
166
+ }, [
167
+ createVNode(unref(NSpin), {
168
+ show: state.spinning,
169
+ tip: "...",
170
+ style: { "width": "100%", "height": "100%" }
171
+ }, {
172
+ default: withCtx(() => [
173
+ createElementVNode("div", _hoisted_1, [
174
+ createElementVNode("div", _hoisted_2, [
175
+ createElementVNode("div", {
176
+ class: normalizeClass(["setting-title", { "seting-title-api": !state.isCustomSearch }])
177
+ }, [
178
+ _hoisted_3,
179
+ createCommentVNode(" \u5B57\u6BB5\u540D\u79F0 "),
180
+ _hoisted_4,
181
+ createCommentVNode(" \u663E\u793A "),
182
+ createElementVNode("span", _hoisted_5, [
183
+ showCheckBox("isShow") ? (openBlock(), createBlock(unref(NCheckbox), {
184
+ key: 0,
185
+ checked: calculateCheck("isShow"),
186
+ "onUpdate:checked": _cache[0] || (_cache[0] = ($event) => handleAllCheck($event, "isShow"))
187
+ }, null, 8, ["checked"])) : createCommentVNode("v-if", true),
188
+ _hoisted_6
189
+ ]),
190
+ createCommentVNode(" \u6392\u5E8F "),
191
+ createElementVNode("span", _hoisted_7, [
192
+ showCheckBox("isSort") ? (openBlock(), createBlock(unref(NCheckbox), {
193
+ key: 0,
194
+ checked: calculateCheck("isSort"),
195
+ "onUpdate:checked": _cache[1] || (_cache[1] = ($event) => handleAllCheck($event, "isSort"))
196
+ }, null, 8, ["checked"])) : createCommentVNode("v-if", true),
197
+ _hoisted_8
198
+ ]),
199
+ createCommentVNode(" \u56FA\u5B9A "),
200
+ _hoisted_9,
201
+ renderSlot(_ctx.$slots, "default", {}, () => [
202
+ createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
203
+ _hoisted_10
204
+ ]),
205
+ createCommentVNode(" \u5217\u5BBD "),
206
+ _hoisted_11
207
+ ], 2),
208
+ createElementVNode("div", {
209
+ ref: "setShow",
210
+ class: normalizeClass(["set-show", { "set-show-api": !state.isCustomSearch }])
211
+ }, [
212
+ createVNode(unref(Draggable), {
213
+ list: state.fields,
214
+ animation: "150",
215
+ "item-key": "sid",
216
+ tag: "ul"
217
+ }, {
218
+ item: withCtx(({ element }) => [
219
+ createElementVNode("li", {
220
+ class: "left-style",
221
+ style: normalizeStyle(leftStyle(element)),
222
+ onClick: ($event) => handleFieldClick(element)
223
+ }, [
224
+ createElementVNode("span", _hoisted_13, [
225
+ createVNode(unref(NTooltip), { trigger: "hover" }, {
226
+ trigger: withCtx(() => [
227
+ _hoisted_14
228
+ ]),
229
+ default: withCtx(() => [
230
+ _hoisted_15
231
+ ]),
232
+ _: 1
233
+ })
234
+ ]),
235
+ createCommentVNode(" \u5B57\u6BB5\u540D\u79F0 "),
236
+ createElementVNode("span", {
237
+ class: normalizeClass(["width-large title-item", { blue: element.extraField }])
238
+ }, [
239
+ _hoisted_16,
240
+ createElementVNode("span", null, toDisplayString(element.title), 1)
241
+ ], 2),
242
+ createCommentVNode(" \u663E\u793A "),
243
+ createElementVNode("span", _hoisted_17, [
244
+ withDirectives(createVNode(unref(NCheckbox), {
245
+ "default-checked": element.isShow == "1",
246
+ checked: element.isShow == "1" ? true : false,
247
+ "onUpdate:checked": ($event) => onChangeShow($event, element)
248
+ }, null, 8, ["default-checked", "checked", "onUpdate:checked"]), [
249
+ [vShow, element.sid != "0001"]
250
+ ])
251
+ ]),
252
+ createCommentVNode(" \u6392\u5E8F "),
253
+ createElementVNode("span", _hoisted_18, [
254
+ withDirectives(createVNode(unref(NCheckbox), {
255
+ "default-checked": element.isSort == "1",
256
+ disabled: element.notParticipatingSort == 1,
257
+ checked: !!element.isSort,
258
+ "onUpdate:checked": ($event) => onChangeSort($event, element)
259
+ }, null, 8, ["default-checked", "disabled", "checked", "onUpdate:checked"]), [
260
+ [vShow, element.sid != "0001"]
261
+ ])
262
+ ]),
263
+ createCommentVNode(" \u56FA\u5B9A "),
264
+ createElementVNode("span", _hoisted_19, [
265
+ withDirectives(createElementVNode("select", {
266
+ "onUpdate:modelValue": ($event) => element.isFixed = $event,
267
+ class: "is-sort-style"
268
+ }, _hoisted_24, 8, _hoisted_20), [
269
+ [vModelSelect, element.isFixed]
270
+ ])
271
+ ]),
272
+ renderSlot(_ctx.$slots, "default", {}, () => [
273
+ createCommentVNode(" \u81EA\u5B9A\u4E49\u6807\u9898 "),
274
+ createElementVNode("span", _hoisted_25, [
275
+ withDirectives(createElementVNode("input", {
276
+ "onUpdate:modelValue": ($event) => element.alias = $event,
277
+ class: "alias-style"
278
+ }, null, 8, _hoisted_26), [
279
+ [vShow, element.sid != "0001"],
280
+ [vModelText, element.alias]
281
+ ])
282
+ ])
283
+ ]),
284
+ createCommentVNode(" \u5217\u5BBD "),
285
+ createElementVNode("span", _hoisted_27, [
286
+ withDirectives(createElementVNode("input", {
287
+ "onUpdate:modelValue": ($event) => element.colWidth = $event,
288
+ class: "alias-style col-width-style"
289
+ }, null, 8, _hoisted_28), [
290
+ [vModelText, element.colWidth]
291
+ ])
292
+ ])
293
+ ], 12, _hoisted_12)
294
+ ]),
295
+ _: 3
296
+ }, 8, ["list"])
297
+ ], 2)
298
+ ]),
299
+ props.footerFlag ? (openBlock(), createElementBlock("div", _hoisted_29, [
300
+ createElementVNode("div", _hoisted_30, [
301
+ createVNode(unref(NButton), {
302
+ style: { "margin-right": "8px" },
303
+ onClick: onCancle
304
+ }, {
305
+ default: withCtx(() => [
306
+ _hoisted_31
307
+ ]),
308
+ _: 1
309
+ }),
310
+ createVNode(unref(NButton), {
311
+ type: "primary",
312
+ onClick: handleFieldSave
313
+ }, {
314
+ default: withCtx(() => [
315
+ _hoisted_32
316
+ ]),
317
+ _: 1
318
+ })
319
+ ])
320
+ ])) : createCommentVNode("v-if", true)
321
+ ])
322
+ ]),
323
+ _: 3
324
+ }, 8, ["show"])
325
+ ], 512);
326
+ };
327
+ }
328
+ });
329
+
330
+ export { script as default };
@@ -410,7 +410,6 @@ declare const FormRender: SFCWithInstall<import("vue").DefineComponent<{
410
410
  formHeight: import("vue").ComputedRef<any>;
411
411
  scrollTo: (id: string) => Promise<void>;
412
412
  onScroll: () => void;
413
- bindInfo: (info: import("../../../es/src/types").AnyObject) => import("../../../es/src/types").AnyObject;
414
413
  queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: import("./src/types").FieldItem[]) => Promise<{
415
414
  widgetElement: HTMLInputElement | null | undefined;
416
415
  widgetElementList: HTMLInputElement[];
@@ -410,7 +410,6 @@ declare const _default: import("vue").DefineComponent<{
410
410
  formHeight: import("vue").ComputedRef<any>;
411
411
  scrollTo: (id: string) => Promise<void>;
412
412
  onScroll: () => void;
413
- bindInfo: (info: AnyObject) => AnyObject;
414
413
  queryWidget: (key: string, wrapperElement: HTMLElement, fieldList: FieldItem[]) => Promise<{
415
414
  widgetElement: HTMLInputElement | null | undefined;
416
415
  widgetElementList: HTMLInputElement[];
@@ -75,12 +75,6 @@ var script = /* @__PURE__ */ defineComponent({
75
75
  });
76
76
  const { currentAnchor, scrollbarRef, generateAnchorList, anchorIdList, formHeight, scrollTo, onScroll } = useAnchor(props, formItemDepsCollector);
77
77
  watch(parsedSchema, generateAnchorList, { immediate: true });
78
- function bindInfo(info) {
79
- info.title = formModel.query(info.path).get("title");
80
- info.decoratorElement = queryDecorator(info.path, scrollbarRef.value, formUUID);
81
- Object.assign(info, queryInput(info.decoratorElement));
82
- return info;
83
- }
84
78
  async function queryWidget(key, wrapperElement, fieldList) {
85
79
  if (!scrollbarRef.value)
86
80
  return createResult();
@@ -102,6 +96,12 @@ var script = /* @__PURE__ */ defineComponent({
102
96
  return formModel.validate(path).catch((err) => {
103
97
  return Promise.reject(Array.isArray(err) ? err.map(bindInfo) : err);
104
98
  });
99
+ function bindInfo(info) {
100
+ info.title = formModel.query(info.path).get("title");
101
+ info.decoratorElement = queryDecorator(info.path, scrollbarRef.value, formUUID);
102
+ Object.assign(info, queryInput(info.decoratorElement));
103
+ return info;
104
+ }
105
105
  },
106
106
  getFormValues() {
107
107
  return formModel.getFormState().values;
@@ -1,6 +1,5 @@
1
1
  import { defineComponent, ref, computed, openBlock, createElementBlock, normalizeStyle, unref, createElementVNode, createVNode, normalizeClass } from 'vue';
2
- import './InfoEllipsis.js';
3
- import script$1 from './InfoEllipsis.vue_vue_type_script_setup_true_lang.js';
2
+ import InfoEllipsis from '../../../packages/info-header/src/InfoEllipsis.vue';
4
3
 
5
4
  const _hoisted_1 = { class: "c-info-header__hidden--content" };
6
5
  var script = /* @__PURE__ */ defineComponent({
@@ -47,7 +46,7 @@ var script = /* @__PURE__ */ defineComponent({
47
46
  style: normalizeStyle(unref(wrapperStyle))
48
47
  }, [
49
48
  createElementVNode("div", _hoisted_1, [
50
- createVNode(script$1, {
49
+ createVNode(InfoEllipsis, {
51
50
  "content-style": unref(parsedContentStyle),
52
51
  content: unref(displayContent),
53
52
  tip: __props.tip
package/global.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import * as NaiveUI from 'naive-ui';
2
-
3
- declare module 'naive-ui' {
4
- // @ts-ignore
5
- export const NTree: any;
6
- }
7
-
8
- export {};
1
+ import * as NaiveUI from 'naive-ui';
2
+
3
+ declare module 'naive-ui' {
4
+ // @ts-ignore
5
+ export const NTree: any;
6
+ }
7
+
8
+ export {};