yc-agent-ui 1.2.7 → 1.2.8
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/es/_virtual/_commonjsHelpers.mjs +7 -0
- package/es/_virtual/toastify.mjs +3 -0
- package/es/components/chart/src/chart-card.vue.d.ts +21 -21
- package/es/components/chart/src/chart-container.vue.d.ts +2 -2
- package/es/components/chart/src/metric-card.vue.d.ts +1 -1
- package/es/components/data-table/src/data-table.vue.d.ts +8 -8
- package/es/components/descriptions/index.d.ts +9 -9
- package/es/components/descriptions/src/index.vue.d.ts +3 -3
- package/es/components/dialog/index.d.ts +6 -6
- package/es/components/dialog/src/index.vue.d.ts +2 -2
- package/es/components/dialog-form/index.d.ts +10 -10
- package/es/components/dialog-form/src/index.vue.d.ts +6 -6
- package/es/components/display-item/index.d.ts +12 -12
- package/es/components/display-item/src/index.vue.d.ts +12 -12
- package/es/components/drawer-form/index.d.ts +19 -19
- package/es/components/drawer-form/src/index.vue.d.ts +9 -9
- package/es/components/form/index.d.ts +17 -17
- package/es/components/form/src/form-content.vue.d.ts +11 -11
- package/es/components/form/src/index.vue.d.ts +11 -11
- package/es/components/form-item/index.d.ts +25 -25
- package/es/components/form-item/src/index.vue.d.ts +12 -12
- package/es/components/input-tag/index.d.ts +3 -3
- package/es/components/input-tag/src/index.vue.d.ts +3 -3
- package/es/components/page/index.d.ts +494 -494
- package/es/components/page/src/index.vue.d.ts +167 -167
- package/es/components/pagination/index.d.ts +3 -3
- package/es/components/pagination/src/index.vue.d.ts +1 -1
- package/es/components/radio/index.d.ts +5 -5
- package/es/components/radio/src/index.vue.d.ts +5 -5
- package/es/components/render/index.d.ts +1 -1
- package/es/components/render/src/index.vue.d.ts +1 -1
- package/es/components/search/index.d.ts +130 -130
- package/es/components/search/src/index.vue.d.ts +46 -46
- package/es/components/table/src/table-action-bar.vue.d.ts +2 -2
- package/es/components/table/src/table-column.vue.d.ts +24 -24
- package/es/components/utils/index.d.ts +3 -3
- package/es/components/virtual-table/index.d.ts +3 -3
- package/es/components/virtual-table/src/index.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/bubble.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/mobile-frame.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/select.vue.d.ts +5 -5
- package/es/components/yc-ai-chat/src/sender.vue.d.ts +1 -1
- package/es/components/yc-ai-chat/src/sidebar.vue.d.ts +2 -2
- package/es/components/yc-ai-chat/src/studio.vue.d.ts +1 -1
- package/es/components/yc-controls/src/choice-cards.vue.d.ts +2 -2
- package/es/components/yc-controls/src/segmented.vue.d.ts +1 -1
- package/es/components/yc-coss-table/src/coss-table.vue.d.ts +3 -3
- package/es/components/yc-coss-table/src/table-head.vue.d.ts +2 -2
- package/es/components/yc-display-cards/index.d.ts +4 -3
- package/es/components/yc-display-cards/src/form-card.vue.d.ts +3 -2
- package/es/components/yc-display-cards/src/table-card.vue.d.ts +1 -1
- package/es/components/yc-display-cards/src/toast.d.ts +4 -0
- package/es/components/yc-display-cards/src/types.d.ts +21 -0
- package/es/components/yc-gradient-card/src/index.vue.d.ts +2 -2
- package/es/components/yc-input/src/input.vue.d.ts +4 -4
- package/es/components/yc-input/src/money-input.vue.d.ts +3 -3
- package/es/components/yc-input/src/stepper-input.vue.d.ts +3 -3
- package/es/components/yc-input/src/textarea.vue.d.ts +1 -1
- package/es/components/yc-input-otp/src/index.vue.d.ts +3 -3
- package/es/components/yc-pagination/src/index.vue.d.ts +2 -2
- package/es/components/yc-plus-page/src/index.vue.d.ts +504 -504
- package/es/components/yc-plus-tree/src/index.vue.d.ts +1 -1
- package/es/components/yc-property-table/src/asset-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/bill-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/device-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/order-table.vue.d.ts +2 -2
- package/es/components/yc-property-table/src/property-table.vue.d.ts +6 -6
- package/es/components/yc-select-v2/src/index.vue.d.ts +4 -4
- package/es/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/es/components/yc-svg-icon/src/index.vue.d.ts +1 -1
- package/es/hooks/usePlusFormReset.d.ts +168 -168
- package/es/index.css +15 -8
- package/es/node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.mjs +456 -0
- package/es/packages/components/yc-display-cards/src/form-card.vue.mjs +1 -1
- package/es/packages/components/yc-display-cards/src/form-card2.vue.mjs +449 -90
- package/es/packages/components/yc-display-cards/src/toast.mjs +35 -0
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/index.css +8 -1
- package/index.js +937 -93
- package/index.min.css +8 -1
- package/index.min.js +40 -34
- package/index.min.mjs +40 -34
- package/index.mjs +937 -93
- package/lib/_virtual/_commonjsHelpers.js +10 -0
- package/lib/_virtual/toastify.js +5 -0
- package/lib/components/chart/src/chart-card.vue.d.ts +21 -21
- package/lib/components/chart/src/chart-container.vue.d.ts +2 -2
- package/lib/components/chart/src/metric-card.vue.d.ts +1 -1
- package/lib/components/data-table/src/data-table.vue.d.ts +8 -8
- package/lib/components/descriptions/index.d.ts +9 -9
- package/lib/components/descriptions/src/index.vue.d.ts +3 -3
- package/lib/components/dialog/index.d.ts +6 -6
- package/lib/components/dialog/src/index.vue.d.ts +2 -2
- package/lib/components/dialog-form/index.d.ts +10 -10
- package/lib/components/dialog-form/src/index.vue.d.ts +6 -6
- package/lib/components/display-item/index.d.ts +12 -12
- package/lib/components/display-item/src/index.vue.d.ts +12 -12
- package/lib/components/drawer-form/index.d.ts +19 -19
- package/lib/components/drawer-form/src/index.vue.d.ts +9 -9
- package/lib/components/form/index.d.ts +17 -17
- package/lib/components/form/src/form-content.vue.d.ts +11 -11
- package/lib/components/form/src/index.vue.d.ts +11 -11
- package/lib/components/form-item/index.d.ts +25 -25
- package/lib/components/form-item/src/index.vue.d.ts +12 -12
- package/lib/components/input-tag/index.d.ts +3 -3
- package/lib/components/input-tag/src/index.vue.d.ts +3 -3
- package/lib/components/page/index.d.ts +494 -494
- package/lib/components/page/src/index.vue.d.ts +167 -167
- package/lib/components/pagination/index.d.ts +3 -3
- package/lib/components/pagination/src/index.vue.d.ts +1 -1
- package/lib/components/radio/index.d.ts +5 -5
- package/lib/components/radio/src/index.vue.d.ts +5 -5
- package/lib/components/render/index.d.ts +1 -1
- package/lib/components/render/src/index.vue.d.ts +1 -1
- package/lib/components/search/index.d.ts +130 -130
- package/lib/components/search/src/index.vue.d.ts +46 -46
- package/lib/components/table/src/table-action-bar.vue.d.ts +2 -2
- package/lib/components/table/src/table-column.vue.d.ts +24 -24
- package/lib/components/utils/index.d.ts +3 -3
- package/lib/components/virtual-table/index.d.ts +3 -3
- package/lib/components/virtual-table/src/index.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/bubble.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/mobile-frame.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/select.vue.d.ts +5 -5
- package/lib/components/yc-ai-chat/src/sender.vue.d.ts +1 -1
- package/lib/components/yc-ai-chat/src/sidebar.vue.d.ts +2 -2
- package/lib/components/yc-ai-chat/src/studio.vue.d.ts +1 -1
- package/lib/components/yc-controls/src/choice-cards.vue.d.ts +2 -2
- package/lib/components/yc-controls/src/segmented.vue.d.ts +1 -1
- package/lib/components/yc-coss-table/src/coss-table.vue.d.ts +3 -3
- package/lib/components/yc-coss-table/src/table-head.vue.d.ts +2 -2
- package/lib/components/yc-display-cards/index.d.ts +4 -3
- package/lib/components/yc-display-cards/src/form-card.vue.d.ts +3 -2
- package/lib/components/yc-display-cards/src/table-card.vue.d.ts +1 -1
- package/lib/components/yc-display-cards/src/toast.d.ts +4 -0
- package/lib/components/yc-display-cards/src/types.d.ts +21 -0
- package/lib/components/yc-gradient-card/src/index.vue.d.ts +2 -2
- package/lib/components/yc-input/src/input.vue.d.ts +4 -4
- package/lib/components/yc-input/src/money-input.vue.d.ts +3 -3
- package/lib/components/yc-input/src/stepper-input.vue.d.ts +3 -3
- package/lib/components/yc-input/src/textarea.vue.d.ts +1 -1
- package/lib/components/yc-input-otp/src/index.vue.d.ts +3 -3
- package/lib/components/yc-pagination/src/index.vue.d.ts +2 -2
- package/lib/components/yc-plus-page/src/index.vue.d.ts +504 -504
- package/lib/components/yc-plus-tree/src/index.vue.d.ts +1 -1
- package/lib/components/yc-property-table/src/asset-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/bill-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/device-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/order-table.vue.d.ts +2 -2
- package/lib/components/yc-property-table/src/property-table.vue.d.ts +6 -6
- package/lib/components/yc-select-v2/src/index.vue.d.ts +4 -4
- package/lib/components/yc-status-dialog/src/index.vue.d.ts +1 -1
- package/lib/components/yc-svg-icon/src/index.vue.d.ts +1 -1
- package/lib/hooks/usePlusFormReset.d.ts +168 -168
- package/lib/index.css +17 -10
- package/lib/node_modules/.pnpm/toastify-js@1.12.0/node_modules/toastify-js/src/toastify.js +460 -0
- package/lib/packages/components/yc-display-cards/src/form-card.vue.js +1 -1
- package/lib/packages/components/yc-display-cards/src/form-card2.vue.js +449 -90
- package/lib/packages/components/yc-display-cards/src/toast.js +37 -0
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/locale/en.js +1 -1
- package/locale/en.min.js +1 -1
- package/locale/en.min.mjs +1 -1
- package/locale/en.mjs +1 -1
- package/locale/ja.js +1 -1
- package/locale/ja.min.js +1 -1
- package/locale/ja.min.mjs +1 -1
- package/locale/ja.mjs +1 -1
- package/locale/ko.js +1 -1
- package/locale/ko.min.js +1 -1
- package/locale/ko.min.mjs +1 -1
- package/locale/ko.mjs +1 -1
- package/locale/zh-cn.js +1 -1
- package/locale/zh-cn.min.js +1 -1
- package/locale/zh-cn.min.mjs +1 -1
- package/locale/zh-cn.mjs +1 -1
- package/locale/zh-tw.js +1 -1
- package/locale/zh-tw.min.js +1 -1
- package/locale/zh-tw.min.mjs +1 -1
- package/locale/zh-tw.mjs +1 -1
- package/package.json +2 -1
- package/theme-chalk/index.css +8 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, reactive, computed, watch, onMounted, onBeforeUnmount, openBlock, createElementBlock, normalizeClass, createElementVNode, toDisplayString, createCommentVNode, Fragment, renderList, createTextVNode } from 'vue';
|
|
2
|
+
import { showDisplayToast } from './toast.mjs';
|
|
2
3
|
|
|
3
4
|
const _hoisted_1 = { class: "yc-display-card__header" };
|
|
4
5
|
const _hoisted_2 = { class: "yc-display-card__title-wrap yc-display-form-card__title-group" };
|
|
@@ -25,61 +26,98 @@ const _hoisted_10 = {
|
|
|
25
26
|
key: 0,
|
|
26
27
|
class: "is-required"
|
|
27
28
|
};
|
|
28
|
-
const _hoisted_11 =
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
29
|
+
const _hoisted_11 = {
|
|
30
|
+
key: 1,
|
|
31
|
+
class: "yc-display-form-card__dynamic-tag"
|
|
32
|
+
};
|
|
33
|
+
const _hoisted_12 = {
|
|
34
|
+
key: 0,
|
|
35
|
+
class: "yc-display-form-card__choice-group",
|
|
36
|
+
role: "radiogroup"
|
|
37
|
+
};
|
|
38
|
+
const _hoisted_13 = ["aria-checked", "disabled", "onClick"];
|
|
39
|
+
const _hoisted_14 = {
|
|
40
|
+
key: 1,
|
|
41
|
+
class: "yc-display-form-card__choice-group",
|
|
42
|
+
role: "group"
|
|
43
|
+
};
|
|
44
|
+
const _hoisted_15 = ["aria-checked", "disabled", "onClick"];
|
|
45
|
+
const _hoisted_16 = ["value", "disabled", "onFocus", "onChange"];
|
|
46
|
+
const _hoisted_17 = { value: "" };
|
|
47
|
+
const _hoisted_18 = ["value"];
|
|
48
|
+
const _hoisted_19 = ["type", "value", "disabled", "onInput"];
|
|
49
|
+
const _hoisted_20 = ["step", "inputmode", "value", "disabled", "placeholder", "onInput"];
|
|
50
|
+
const _hoisted_21 = ["aria-checked", "disabled", "onClick"];
|
|
51
|
+
const _hoisted_22 = {
|
|
52
|
+
key: 6,
|
|
36
53
|
class: "yc-display-form-card__upload"
|
|
37
54
|
};
|
|
38
|
-
const
|
|
39
|
-
const
|
|
40
|
-
const
|
|
55
|
+
const _hoisted_23 = ["accept", "onChange"];
|
|
56
|
+
const _hoisted_24 = { class: "yc-display-form-card__upload-list" };
|
|
57
|
+
const _hoisted_25 = {
|
|
41
58
|
key: 0,
|
|
42
59
|
class: "yc-display-form-card__thumb"
|
|
43
60
|
};
|
|
44
|
-
const
|
|
45
|
-
const
|
|
46
|
-
const
|
|
61
|
+
const _hoisted_26 = ["src", "alt"];
|
|
62
|
+
const _hoisted_27 = ["onClick"];
|
|
63
|
+
const _hoisted_28 = {
|
|
47
64
|
key: 1,
|
|
48
65
|
class: "yc-display-form-card__file-chip"
|
|
49
66
|
};
|
|
50
|
-
const
|
|
51
|
-
const
|
|
52
|
-
const
|
|
53
|
-
const
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const
|
|
57
|
-
const
|
|
58
|
-
const
|
|
59
|
-
const
|
|
60
|
-
|
|
67
|
+
const _hoisted_29 = { class: "yc-display-form-card__file-name" };
|
|
68
|
+
const _hoisted_30 = ["onClick"];
|
|
69
|
+
const _hoisted_31 = ["disabled", "onClick"];
|
|
70
|
+
const _hoisted_32 = { key: 0 };
|
|
71
|
+
const _hoisted_33 = { key: 1 };
|
|
72
|
+
const _hoisted_34 = ["value", "disabled", "placeholder", "onInput", "onBlur"];
|
|
73
|
+
const _hoisted_35 = ["value", "disabled", "placeholder", "onInput", "onBlur"];
|
|
74
|
+
const _hoisted_36 = ["value", "disabled", "placeholder", "onInput"];
|
|
75
|
+
const _hoisted_37 = ["value", "disabled", "placeholder", "onInput"];
|
|
76
|
+
const _hoisted_38 = {
|
|
77
|
+
key: 11,
|
|
78
|
+
class: "yc-display-form-card__field-error"
|
|
79
|
+
};
|
|
80
|
+
const _hoisted_39 = { class: "yc-display-form-card__actions" };
|
|
81
|
+
const _hoisted_40 = ["disabled"];
|
|
82
|
+
const _hoisted_41 = ["disabled"];
|
|
83
|
+
const _hoisted_42 = {
|
|
61
84
|
key: 1,
|
|
62
85
|
class: "yc-display-form-card__alert is-error"
|
|
63
86
|
};
|
|
64
|
-
const
|
|
87
|
+
const _hoisted_43 = {
|
|
65
88
|
key: 2,
|
|
66
89
|
class: "yc-display-form-card__alert is-success"
|
|
67
90
|
};
|
|
68
|
-
const
|
|
91
|
+
const _hoisted_44 = {
|
|
69
92
|
key: 3,
|
|
93
|
+
class: "yc-display-form-card__trace"
|
|
94
|
+
};
|
|
95
|
+
const _hoisted_45 = { class: "yc-display-form-card__trace-arrow" };
|
|
96
|
+
const _hoisted_46 = {
|
|
97
|
+
key: 0,
|
|
98
|
+
class: "yc-display-form-card__trace-list"
|
|
99
|
+
};
|
|
100
|
+
const _hoisted_47 = { class: "yc-display-form-card__trace-content" };
|
|
101
|
+
const _hoisted_48 = { class: "yc-display-form-card__trace-label" };
|
|
102
|
+
const _hoisted_49 = {
|
|
103
|
+
key: 0,
|
|
104
|
+
class: "yc-display-form-card__trace-detail"
|
|
105
|
+
};
|
|
106
|
+
const _hoisted_50 = {
|
|
107
|
+
key: 4,
|
|
70
108
|
class: "yc-display-form-card__result"
|
|
71
109
|
};
|
|
72
|
-
const
|
|
110
|
+
const _hoisted_51 = {
|
|
73
111
|
key: 0,
|
|
74
112
|
class: "yc-display-form-card__table-wrap"
|
|
75
113
|
};
|
|
76
|
-
const
|
|
77
|
-
const
|
|
114
|
+
const _hoisted_52 = { class: "yc-display-form-card__table" };
|
|
115
|
+
const _hoisted_53 = {
|
|
78
116
|
key: 1,
|
|
79
117
|
class: "yc-display-form-card__kv"
|
|
80
118
|
};
|
|
81
|
-
const
|
|
82
|
-
const
|
|
119
|
+
const _hoisted_54 = { class: "yc-display-form-card__kv-label" };
|
|
120
|
+
const _hoisted_55 = { class: "yc-display-form-card__kv-value" };
|
|
83
121
|
var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
84
122
|
...{ name: "YcDisplayFormCard" },
|
|
85
123
|
__name: "form-card",
|
|
@@ -95,7 +133,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
95
133
|
compact: { type: Boolean, default: false },
|
|
96
134
|
skillName: { default: "" },
|
|
97
135
|
executeAction: { type: Function, default: void 0 },
|
|
98
|
-
uploadFile: { type: Function, default: void 0 }
|
|
136
|
+
uploadFile: { type: Function, default: void 0 },
|
|
137
|
+
submitReply: { type: Function, default: void 0 }
|
|
99
138
|
},
|
|
100
139
|
emits: ["action"],
|
|
101
140
|
setup(__props, { emit: __emit }) {
|
|
@@ -111,6 +150,9 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
111
150
|
const resultData = ref(null);
|
|
112
151
|
const hasExecuted = ref(false);
|
|
113
152
|
const replySent = ref(false);
|
|
153
|
+
const dynamicFields = ref([]);
|
|
154
|
+
const traceSteps = ref([]);
|
|
155
|
+
const traceExpanded = ref(false);
|
|
114
156
|
const formValues = reactive({});
|
|
115
157
|
const remoteOptions = reactive({});
|
|
116
158
|
const loadingOptions = reactive({});
|
|
@@ -166,27 +208,51 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
166
208
|
return options.length ? options : void 0;
|
|
167
209
|
}
|
|
168
210
|
const inlineFields = computed(() => {
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
211
|
+
var _a;
|
|
212
|
+
const base = Array.isArray(props.fields) ? props.fields : [];
|
|
213
|
+
const merged = [...base, ...dynamicFields.value];
|
|
214
|
+
const seen = /* @__PURE__ */ new Set();
|
|
215
|
+
const result = [];
|
|
216
|
+
for (const item of merged) {
|
|
217
|
+
if (!item || typeof item !== "object" || !item.name) continue;
|
|
218
|
+
const name = String(item.name);
|
|
219
|
+
if (seen.has(name)) continue;
|
|
220
|
+
seen.add(name);
|
|
221
|
+
result.push({
|
|
173
222
|
...item,
|
|
174
|
-
name
|
|
175
|
-
label: String((_a = item.label) != null ? _a :
|
|
223
|
+
name,
|
|
224
|
+
label: String((_a = item.label) != null ? _a : name),
|
|
176
225
|
visible: item.visible !== false
|
|
177
|
-
};
|
|
178
|
-
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return result;
|
|
179
229
|
});
|
|
230
|
+
const dynamicFieldNames = computed(
|
|
231
|
+
() => new Set(dynamicFields.value.map((f) => f.name))
|
|
232
|
+
);
|
|
180
233
|
const visibleFields = computed(() => {
|
|
181
234
|
const source = inlineFields.value.length > 0 ? inlineFields.value : loadedFields.value;
|
|
182
235
|
return source.filter((field) => field.visible !== false);
|
|
183
236
|
});
|
|
237
|
+
function isRadioField(field) {
|
|
238
|
+
return field.widget === "radio";
|
|
239
|
+
}
|
|
240
|
+
function isCheckboxField(field) {
|
|
241
|
+
return field.widget === "checkbox";
|
|
242
|
+
}
|
|
184
243
|
function isSelectField(field) {
|
|
185
244
|
var _a, _b;
|
|
245
|
+
if (isRadioField(field) || isCheckboxField(field)) return false;
|
|
186
246
|
return Boolean(
|
|
187
247
|
field.widget === "select" || field.options_operation || ((_a = field.options) == null ? void 0 : _a.length) || ((_b = field.enum) == null ? void 0 : _b.length)
|
|
188
248
|
);
|
|
189
249
|
}
|
|
250
|
+
function isPhoneField(field) {
|
|
251
|
+
return field.widget === "phone" || field.widget === "tel";
|
|
252
|
+
}
|
|
253
|
+
function isEmailField(field) {
|
|
254
|
+
return field.widget === "email";
|
|
255
|
+
}
|
|
190
256
|
function isDateField(field) {
|
|
191
257
|
return field.widget === "date" || field.widget === "datetime";
|
|
192
258
|
}
|
|
@@ -443,6 +509,47 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
443
509
|
}
|
|
444
510
|
return result;
|
|
445
511
|
}
|
|
512
|
+
function isCheckboxChecked(field, optionValue) {
|
|
513
|
+
const current = formValues[field.name];
|
|
514
|
+
return Array.isArray(current) && current.includes(optionValue);
|
|
515
|
+
}
|
|
516
|
+
function toggleCheckboxOption(field, optionValue) {
|
|
517
|
+
if (replySent.value) return;
|
|
518
|
+
const current = Array.isArray(formValues[field.name]) ? [...formValues[field.name]] : [];
|
|
519
|
+
const idx = current.indexOf(optionValue);
|
|
520
|
+
if (idx >= 0) {
|
|
521
|
+
current.splice(idx, 1);
|
|
522
|
+
} else {
|
|
523
|
+
current.push(optionValue);
|
|
524
|
+
}
|
|
525
|
+
formValues[field.name] = current.length ? current : void 0;
|
|
526
|
+
}
|
|
527
|
+
const fieldValidationErrors = reactive({});
|
|
528
|
+
function validateFieldFormat(field, value) {
|
|
529
|
+
if (isBlank(value)) return "";
|
|
530
|
+
const text = String(value).trim();
|
|
531
|
+
const label = field.label || field.name;
|
|
532
|
+
if (isPhoneField(field)) {
|
|
533
|
+
const normalized = text.replace(/[\s-]/g, "");
|
|
534
|
+
if (!/^1[3-9]\d{9}$/.test(normalized) && !/^0\d{2,3}\d{7,8}$/.test(normalized)) {
|
|
535
|
+
return `\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u300C${label}\u300D\uFF0811\u4F4D\u624B\u673A\u53F7\u6216\u56FA\u8BDD\uFF09`;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
if (isEmailField(field)) {
|
|
539
|
+
if (!/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(text)) {
|
|
540
|
+
return `\u8BF7\u8F93\u5165\u6B63\u786E\u7684\u300C${label}\u300D\u90AE\u7BB1\u683C\u5F0F`;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
return "";
|
|
544
|
+
}
|
|
545
|
+
function handleFieldBlur(field) {
|
|
546
|
+
const msg = validateFieldFormat(field, formValues[field.name]);
|
|
547
|
+
if (msg) {
|
|
548
|
+
fieldValidationErrors[field.name] = msg;
|
|
549
|
+
} else {
|
|
550
|
+
delete fieldValidationErrors[field.name];
|
|
551
|
+
}
|
|
552
|
+
}
|
|
446
553
|
function isBlank(value) {
|
|
447
554
|
if (Array.isArray(value)) return value.length === 0;
|
|
448
555
|
return value === void 0 || value === null || String(value).trim() === "";
|
|
@@ -455,6 +562,13 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
455
562
|
return `\u5DF2\u968F\u6D88\u606F\u4E0A\u4F20 ${items.length} \u4E2A\u9644\u4EF6\uFF08${items.map((item) => item.attachment.fileName).join("\u3001")}\uFF09`;
|
|
456
563
|
}
|
|
457
564
|
}
|
|
565
|
+
if (Array.isArray(value)) {
|
|
566
|
+
const opts = fieldOptions(field);
|
|
567
|
+
return value.map((v) => {
|
|
568
|
+
const opt = opts.find((o) => o.value === v);
|
|
569
|
+
return !opt || opt.label === String(v) ? String(v) : `${opt.label}\uFF08${String(v)}\uFF09`;
|
|
570
|
+
}).join("\u3001");
|
|
571
|
+
}
|
|
458
572
|
const option = fieldOptions(field).find((opt) => opt.value === value);
|
|
459
573
|
if (!option || option.label === String(value)) return String(value);
|
|
460
574
|
return `${option.label}\uFF08${String(value)}\uFF09`;
|
|
@@ -470,6 +584,35 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
470
584
|
}
|
|
471
585
|
return [`${prefix}\uFF1A`, ...lines].join("\n");
|
|
472
586
|
}
|
|
587
|
+
function upsertTraceStep(step) {
|
|
588
|
+
const idx = traceSteps.value.findIndex((item) => item.id === step.id);
|
|
589
|
+
if (idx >= 0) {
|
|
590
|
+
traceSteps.value[idx] = { ...traceSteps.value[idx], ...step };
|
|
591
|
+
} else {
|
|
592
|
+
traceSteps.value.push(step);
|
|
593
|
+
}
|
|
594
|
+
}
|
|
595
|
+
function appendMissingFieldsFromResult(missingFields, message) {
|
|
596
|
+
const existingNames = new Set(inlineFields.value.map((f) => f.name));
|
|
597
|
+
const candidates = Array.isArray(missingFields) ? [...missingFields] : [];
|
|
598
|
+
if (candidates.length === 0 && message && /(附件|图片|照片|photo|image|attachment)/i.test(message) && !inlineFields.value.some((f) => isUploadField(f))) {
|
|
599
|
+
candidates.push({
|
|
600
|
+
name: "attachments",
|
|
601
|
+
label: "\u73B0\u573A\u7167\u7247",
|
|
602
|
+
widget: "image",
|
|
603
|
+
required: true,
|
|
604
|
+
visible: true
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
for (const field of candidates) {
|
|
608
|
+
if (!(field == null ? void 0 : field.name) || existingNames.has(field.name)) continue;
|
|
609
|
+
existingNames.add(field.name);
|
|
610
|
+
dynamicFields.value.push({
|
|
611
|
+
...field,
|
|
612
|
+
visible: field.visible !== false
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
}
|
|
473
616
|
async function handleExecute() {
|
|
474
617
|
if (!canExecute.value || executing.value) return;
|
|
475
618
|
errorMessage.value = "";
|
|
@@ -479,20 +622,85 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
479
622
|
return;
|
|
480
623
|
}
|
|
481
624
|
for (const field of visibleFields.value) {
|
|
482
|
-
|
|
625
|
+
const val = formValues[field.name];
|
|
626
|
+
if (field.required && isBlank(val)) {
|
|
483
627
|
const label = field.label || field.name;
|
|
484
628
|
errorMessage.value = isUploadField(field) ? `\u8BF7\u5148\u4E0A\u4F20\u300C${label}\u300D` : `\u8BF7\u5148\u586B\u5199\u300C${label}\u300D`;
|
|
485
629
|
return;
|
|
486
630
|
}
|
|
631
|
+
const formatErr = validateFieldFormat(field, val);
|
|
632
|
+
if (formatErr) {
|
|
633
|
+
fieldValidationErrors[field.name] = formatErr;
|
|
634
|
+
errorMessage.value = formatErr;
|
|
635
|
+
return;
|
|
636
|
+
}
|
|
637
|
+
delete fieldValidationErrors[field.name];
|
|
487
638
|
}
|
|
488
639
|
if (resolvedMode.value === "reply") {
|
|
489
640
|
const attachments = collectUploadedAttachments();
|
|
641
|
+
const replyText = buildReplyText();
|
|
642
|
+
if (props.submitReply) {
|
|
643
|
+
executing.value = true;
|
|
644
|
+
traceExpanded.value = true;
|
|
645
|
+
traceSteps.value = [
|
|
646
|
+
{
|
|
647
|
+
id: "submit",
|
|
648
|
+
label: "\u6B63\u5728\u63D0\u4EA4\u8868\u5355\u4EA4\u7531\u4E1A\u52A1\u52A9\u624B\u5904\u7406\u2026",
|
|
649
|
+
status: "running"
|
|
650
|
+
}
|
|
651
|
+
];
|
|
652
|
+
try {
|
|
653
|
+
const res = await props.submitReply({
|
|
654
|
+
text: replyText,
|
|
655
|
+
attachments: attachments.length ? attachments : void 0,
|
|
656
|
+
values: { ...formValues },
|
|
657
|
+
onTrace: upsertTraceStep
|
|
658
|
+
});
|
|
659
|
+
if (Array.isArray(res.trace)) {
|
|
660
|
+
for (const step of res.trace) upsertTraceStep(step);
|
|
661
|
+
}
|
|
662
|
+
if (res.ok) {
|
|
663
|
+
upsertTraceStep({
|
|
664
|
+
id: "submit",
|
|
665
|
+
label: "\u8868\u5355\u63D0\u4EA4\u4E0E\u5904\u7406\u5B8C\u6210",
|
|
666
|
+
status: "succeeded",
|
|
667
|
+
detail: res.message
|
|
668
|
+
});
|
|
669
|
+
replySent.value = true;
|
|
670
|
+
submitReceipt.value = res.message || `${cardTitle.value}\u5904\u7406\u6210\u529F`;
|
|
671
|
+
showDisplayToast(submitReceipt.value, "success");
|
|
672
|
+
} else {
|
|
673
|
+
upsertTraceStep({
|
|
674
|
+
id: "submit",
|
|
675
|
+
label: "\u5904\u7406\u672A\u5B8C\u6210\uFF0C\u9700\u8865\u5145\u4FE1\u606F",
|
|
676
|
+
status: "failed",
|
|
677
|
+
detail: res.message
|
|
678
|
+
});
|
|
679
|
+
errorMessage.value = res.message || "\u4FE1\u606F\u4E0D\u5B8C\u6574\u6216\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u8865\u5145\u540E\u91CD\u65B0\u63D0\u4EA4";
|
|
680
|
+
appendMissingFieldsFromResult(res.missingFields, res.message);
|
|
681
|
+
showDisplayToast(errorMessage.value, "warning", 4500);
|
|
682
|
+
}
|
|
683
|
+
} catch (err) {
|
|
684
|
+
const msg = err instanceof Error ? err.message : "\u63D0\u4EA4\u5904\u7406\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5";
|
|
685
|
+
upsertTraceStep({
|
|
686
|
+
id: "submit",
|
|
687
|
+
label: "\u63D0\u4EA4\u8FC7\u7A0B\u53D1\u751F\u5F02\u5E38",
|
|
688
|
+
status: "failed",
|
|
689
|
+
detail: msg
|
|
690
|
+
});
|
|
691
|
+
errorMessage.value = msg;
|
|
692
|
+
showDisplayToast(msg, "error", 4500);
|
|
693
|
+
} finally {
|
|
694
|
+
executing.value = false;
|
|
695
|
+
}
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
490
698
|
replySent.value = true;
|
|
491
|
-
submitReceipt.value = "\u5DF2\u63D0\u4EA4\uFF0CAgent \u6B63\u5728\u6309\u4F60\u586B\u5199\u7684\u4FE1\u606F\u5904\u7406";
|
|
699
|
+
submitReceipt.value = "\u5DF2\u63D0\u4EA4\uFF0CAgent \u6B63\u5728\u6309\u4F60\u586B\u5199\u7684\u4FE1\u606F\u5904\u7406\uFF08\u82E5\u5904\u7406\u5931\u8D25\u53EF\u70B9\u300C\u4FEE\u6539\u91CD\u63D0\u300D\uFF09";
|
|
492
700
|
if (attachments.length) {
|
|
493
|
-
emit("action",
|
|
701
|
+
emit("action", replyText, attachments);
|
|
494
702
|
} else {
|
|
495
|
-
emit("action",
|
|
703
|
+
emit("action", replyText);
|
|
496
704
|
}
|
|
497
705
|
return;
|
|
498
706
|
}
|
|
@@ -531,10 +739,18 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
531
739
|
}
|
|
532
740
|
}
|
|
533
741
|
}
|
|
742
|
+
function unlockReplyEdit() {
|
|
743
|
+
replySent.value = false;
|
|
744
|
+
errorMessage.value = "";
|
|
745
|
+
submitReceipt.value = null;
|
|
746
|
+
}
|
|
534
747
|
function handleReset() {
|
|
535
748
|
for (const key of Object.keys(formValues)) {
|
|
536
749
|
delete formValues[key];
|
|
537
750
|
}
|
|
751
|
+
for (const key of Object.keys(fieldValidationErrors)) {
|
|
752
|
+
delete fieldValidationErrors[key];
|
|
753
|
+
}
|
|
538
754
|
revokeAllUploadPreviews();
|
|
539
755
|
for (const key of Object.keys(uploadedFiles)) {
|
|
540
756
|
delete uploadedFiles[key];
|
|
@@ -566,7 +782,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
566
782
|
[
|
|
567
783
|
createElementVNode("div", _hoisted_1, [
|
|
568
784
|
createElementVNode("div", _hoisted_2, [
|
|
569
|
-
_cache[
|
|
785
|
+
_cache[1] || (_cache[1] = createElementVNode(
|
|
570
786
|
"span",
|
|
571
787
|
{ class: "yc-display-form-card__accent" },
|
|
572
788
|
null,
|
|
@@ -606,7 +822,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
606
822
|
Fragment,
|
|
607
823
|
null,
|
|
608
824
|
renderList(visibleFields.value, (field) => {
|
|
609
|
-
var _a2, _b, _c, _d, _e;
|
|
825
|
+
var _a2, _b, _c, _d, _e, _f, _g;
|
|
610
826
|
return openBlock(), createElementBlock(
|
|
611
827
|
"div",
|
|
612
828
|
{
|
|
@@ -619,13 +835,50 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
619
835
|
createElementVNode("label", _hoisted_9, [
|
|
620
836
|
field.required ? (openBlock(), createElementBlock("span", _hoisted_10, "*")) : createCommentVNode("v-if", true),
|
|
621
837
|
createTextVNode(
|
|
622
|
-
" " + toDisplayString(field.label || field.name),
|
|
838
|
+
" " + toDisplayString(field.label || field.name) + " ",
|
|
623
839
|
1
|
|
624
840
|
/* TEXT */
|
|
625
|
-
)
|
|
841
|
+
),
|
|
842
|
+
dynamicFieldNames.value.has(field.name) ? (openBlock(), createElementBlock("span", _hoisted_11, " \u9700\u8865\u5145 ")) : createCommentVNode("v-if", true)
|
|
626
843
|
]),
|
|
627
|
-
|
|
628
|
-
|
|
844
|
+
isRadioField(field) ? (openBlock(), createElementBlock("div", _hoisted_12, [
|
|
845
|
+
(openBlock(true), createElementBlock(
|
|
846
|
+
Fragment,
|
|
847
|
+
null,
|
|
848
|
+
renderList(fieldOptions(field), (opt) => {
|
|
849
|
+
return openBlock(), createElementBlock("button", {
|
|
850
|
+
key: String(opt.value),
|
|
851
|
+
type: "button",
|
|
852
|
+
role: "radio",
|
|
853
|
+
"aria-checked": formValues[field.name] === opt.value,
|
|
854
|
+
disabled: replySent.value,
|
|
855
|
+
class: normalizeClass(["yc-display-form-card__choice-item", { "is-selected": formValues[field.name] === opt.value }]),
|
|
856
|
+
onClick: ($event) => formValues[field.name] = opt.value
|
|
857
|
+
}, toDisplayString(opt.label), 11, _hoisted_13);
|
|
858
|
+
}),
|
|
859
|
+
128
|
|
860
|
+
/* KEYED_FRAGMENT */
|
|
861
|
+
))
|
|
862
|
+
])) : isCheckboxField(field) ? (openBlock(), createElementBlock("div", _hoisted_14, [
|
|
863
|
+
(openBlock(true), createElementBlock(
|
|
864
|
+
Fragment,
|
|
865
|
+
null,
|
|
866
|
+
renderList(fieldOptions(field), (opt) => {
|
|
867
|
+
return openBlock(), createElementBlock("button", {
|
|
868
|
+
key: String(opt.value),
|
|
869
|
+
type: "button",
|
|
870
|
+
role: "checkbox",
|
|
871
|
+
"aria-checked": isCheckboxChecked(field, opt.value),
|
|
872
|
+
disabled: replySent.value,
|
|
873
|
+
class: normalizeClass(["yc-display-form-card__choice-item", { "is-selected": isCheckboxChecked(field, opt.value) }]),
|
|
874
|
+
onClick: ($event) => toggleCheckboxOption(field, opt.value)
|
|
875
|
+
}, toDisplayString(opt.label), 11, _hoisted_15);
|
|
876
|
+
}),
|
|
877
|
+
128
|
|
878
|
+
/* KEYED_FRAGMENT */
|
|
879
|
+
))
|
|
880
|
+
])) : isSelectField(field) ? (openBlock(), createElementBlock("select", {
|
|
881
|
+
key: 2,
|
|
629
882
|
value: (_a2 = formValues[field.name]) != null ? _a2 : "",
|
|
630
883
|
disabled: replySent.value,
|
|
631
884
|
class: "yc-display-form-card__control yc-display-form-card__select",
|
|
@@ -634,7 +887,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
634
887
|
}, [
|
|
635
888
|
createElementVNode(
|
|
636
889
|
"option",
|
|
637
|
-
|
|
890
|
+
_hoisted_17,
|
|
638
891
|
toDisplayString(loadingOptions[field.name] ? "\u52A0\u8F7D\u9009\u9879\u4E2D\u2026" : `\u8BF7\u9009\u62E9${field.label || field.name}`),
|
|
639
892
|
1
|
|
640
893
|
/* TEXT */
|
|
@@ -646,20 +899,20 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
646
899
|
return openBlock(), createElementBlock("option", {
|
|
647
900
|
key: String(opt.value),
|
|
648
901
|
value: String(opt.value)
|
|
649
|
-
}, toDisplayString(opt.label), 9,
|
|
902
|
+
}, toDisplayString(opt.label), 9, _hoisted_18);
|
|
650
903
|
}),
|
|
651
904
|
128
|
|
652
905
|
/* KEYED_FRAGMENT */
|
|
653
906
|
))
|
|
654
|
-
], 40,
|
|
655
|
-
key:
|
|
907
|
+
], 40, _hoisted_16)) : isDateField(field) ? (openBlock(), createElementBlock("input", {
|
|
908
|
+
key: 3,
|
|
656
909
|
type: field.widget === "datetime" ? "datetime-local" : "date",
|
|
657
910
|
value: formatDateInputValue(field, formValues[field.name]),
|
|
658
911
|
disabled: replySent.value,
|
|
659
912
|
class: "yc-display-form-card__control yc-display-form-card__input",
|
|
660
913
|
onInput: (event) => handleDateInput(field, event)
|
|
661
|
-
}, null, 40,
|
|
662
|
-
key:
|
|
914
|
+
}, null, 40, _hoisted_19)) : isNumberField(field) ? (openBlock(), createElementBlock("input", {
|
|
915
|
+
key: 4,
|
|
663
916
|
type: "number",
|
|
664
917
|
step: field.type === "integer" ? "1" : "any",
|
|
665
918
|
inputmode: field.type === "integer" ? "numeric" : "decimal",
|
|
@@ -668,15 +921,15 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
668
921
|
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
669
922
|
class: "yc-display-form-card__control yc-display-form-card__input",
|
|
670
923
|
onInput: (event) => handleNumberInput(field, event)
|
|
671
|
-
}, null, 40,
|
|
672
|
-
key:
|
|
924
|
+
}, null, 40, _hoisted_20)) : field.type === "boolean" ? (openBlock(), createElementBlock("button", {
|
|
925
|
+
key: 5,
|
|
673
926
|
type: "button",
|
|
674
927
|
role: "switch",
|
|
675
928
|
"aria-checked": Boolean(formValues[field.name]),
|
|
676
929
|
disabled: replySent.value,
|
|
677
930
|
class: normalizeClass(["yc-display-form-card__switch", { "is-checked": Boolean(formValues[field.name]) }]),
|
|
678
931
|
onClick: ($event) => formValues[field.name] = !formValues[field.name]
|
|
679
|
-
}, [..._cache[
|
|
932
|
+
}, [..._cache[2] || (_cache[2] = [
|
|
680
933
|
createElementVNode(
|
|
681
934
|
"span",
|
|
682
935
|
{ class: "yc-display-form-card__switch-thumb" },
|
|
@@ -684,7 +937,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
684
937
|
-1
|
|
685
938
|
/* CACHED */
|
|
686
939
|
)
|
|
687
|
-
])], 10,
|
|
940
|
+
])], 10, _hoisted_21)) : isUploadField(field) ? (openBlock(), createElementBlock("div", _hoisted_22, [
|
|
688
941
|
createElementVNode("input", {
|
|
689
942
|
ref_for: true,
|
|
690
943
|
ref: (el) => setFileInputRef(field.name, el),
|
|
@@ -693,8 +946,8 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
693
946
|
accept: field.widget === "image" ? "image/*" : void 0,
|
|
694
947
|
class: "yc-display-form-card__upload-input",
|
|
695
948
|
onChange: (event) => handleFileInputChange(field, event)
|
|
696
|
-
}, null, 40,
|
|
697
|
-
createElementVNode("div",
|
|
949
|
+
}, null, 40, _hoisted_23),
|
|
950
|
+
createElementVNode("div", _hoisted_24, [
|
|
698
951
|
(openBlock(true), createElementBlock(
|
|
699
952
|
Fragment,
|
|
700
953
|
null,
|
|
@@ -705,22 +958,22 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
705
958
|
key: `${item.attachment.fileRef || item.attachment.fileName}-${idx}`
|
|
706
959
|
},
|
|
707
960
|
[
|
|
708
|
-
item.previewUrl ? (openBlock(), createElementBlock("div",
|
|
961
|
+
item.previewUrl ? (openBlock(), createElementBlock("div", _hoisted_25, [
|
|
709
962
|
createElementVNode("img", {
|
|
710
963
|
src: item.previewUrl,
|
|
711
964
|
alt: item.attachment.fileName
|
|
712
|
-
}, null, 8,
|
|
965
|
+
}, null, 8, _hoisted_26),
|
|
713
966
|
!replySent.value ? (openBlock(), createElementBlock("button", {
|
|
714
967
|
key: 0,
|
|
715
968
|
type: "button",
|
|
716
969
|
class: "yc-display-form-card__thumb-remove",
|
|
717
970
|
title: "\u79FB\u9664",
|
|
718
971
|
onClick: ($event) => removeUploadedItem(field.name, idx)
|
|
719
|
-
}, " \xD7 ", 8,
|
|
720
|
-
])) : (openBlock(), createElementBlock("div",
|
|
972
|
+
}, " \xD7 ", 8, _hoisted_27)) : createCommentVNode("v-if", true)
|
|
973
|
+
])) : (openBlock(), createElementBlock("div", _hoisted_28, [
|
|
721
974
|
createElementVNode(
|
|
722
975
|
"span",
|
|
723
|
-
|
|
976
|
+
_hoisted_29,
|
|
724
977
|
toDisplayString(item.attachment.fileName),
|
|
725
978
|
1
|
|
726
979
|
/* TEXT */
|
|
@@ -731,7 +984,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
731
984
|
class: "yc-display-form-card__file-remove",
|
|
732
985
|
title: "\u79FB\u9664",
|
|
733
986
|
onClick: ($event) => removeUploadedItem(field.name, idx)
|
|
734
|
-
}, " \xD7 ", 8,
|
|
987
|
+
}, " \xD7 ", 8, _hoisted_30)) : createCommentVNode("v-if", true)
|
|
735
988
|
]))
|
|
736
989
|
],
|
|
737
990
|
64
|
|
@@ -751,32 +1004,66 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
751
1004
|
disabled: Boolean(uploadingFields[field.name]),
|
|
752
1005
|
onClick: ($event) => triggerFileSelect(field.name)
|
|
753
1006
|
}, [
|
|
754
|
-
uploadingFields[field.name] ? (openBlock(), createElementBlock("span",
|
|
1007
|
+
uploadingFields[field.name] ? (openBlock(), createElementBlock("span", _hoisted_32, "\u4E0A\u4F20\u4E2D\u2026")) : (openBlock(), createElementBlock(
|
|
755
1008
|
"span",
|
|
756
|
-
|
|
1009
|
+
_hoisted_33,
|
|
757
1010
|
toDisplayString(field.widget === "image" ? "+ \u4E0A\u4F20\u56FE\u7247" : "+ \u4E0A\u4F20\u9644\u4EF6"),
|
|
758
1011
|
1
|
|
759
1012
|
/* TEXT */
|
|
760
1013
|
))
|
|
761
|
-
], 10,
|
|
1014
|
+
], 10, _hoisted_31)) : createCommentVNode("v-if", true)
|
|
762
1015
|
])
|
|
763
|
-
])) : field
|
|
764
|
-
key:
|
|
765
|
-
|
|
1016
|
+
])) : isPhoneField(field) ? (openBlock(), createElementBlock("input", {
|
|
1017
|
+
key: 7,
|
|
1018
|
+
type: "tel",
|
|
1019
|
+
inputmode: "tel",
|
|
1020
|
+
maxlength: "20",
|
|
766
1021
|
value: String((_d = formValues[field.name]) != null ? _d : ""),
|
|
767
1022
|
disabled: replySent.value,
|
|
768
1023
|
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
1024
|
+
class: normalizeClass(["yc-display-form-card__control yc-display-form-card__input", { "is-invalid": Boolean(fieldValidationErrors[field.name]) }]),
|
|
1025
|
+
onInput: (event) => {
|
|
1026
|
+
formValues[field.name] = event.target.value;
|
|
1027
|
+
delete fieldValidationErrors[field.name];
|
|
1028
|
+
},
|
|
1029
|
+
onBlur: ($event) => handleFieldBlur(field)
|
|
1030
|
+
}, null, 42, _hoisted_34)) : isEmailField(field) ? (openBlock(), createElementBlock("input", {
|
|
1031
|
+
key: 8,
|
|
1032
|
+
type: "email",
|
|
1033
|
+
inputmode: "email",
|
|
1034
|
+
value: String((_e = formValues[field.name]) != null ? _e : ""),
|
|
1035
|
+
disabled: replySent.value,
|
|
1036
|
+
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
1037
|
+
class: normalizeClass(["yc-display-form-card__control yc-display-form-card__input", { "is-invalid": Boolean(fieldValidationErrors[field.name]) }]),
|
|
1038
|
+
onInput: (event) => {
|
|
1039
|
+
formValues[field.name] = event.target.value;
|
|
1040
|
+
delete fieldValidationErrors[field.name];
|
|
1041
|
+
},
|
|
1042
|
+
onBlur: ($event) => handleFieldBlur(field)
|
|
1043
|
+
}, null, 42, _hoisted_35)) : field.widget === "textarea" ? (openBlock(), createElementBlock("textarea", {
|
|
1044
|
+
key: 9,
|
|
1045
|
+
rows: "3",
|
|
1046
|
+
value: String((_f = formValues[field.name]) != null ? _f : ""),
|
|
1047
|
+
disabled: replySent.value,
|
|
1048
|
+
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
769
1049
|
class: "yc-display-form-card__control yc-display-form-card__textarea",
|
|
770
1050
|
onInput: (event) => formValues[field.name] = event.target.value
|
|
771
|
-
}, null, 40,
|
|
772
|
-
key:
|
|
1051
|
+
}, null, 40, _hoisted_36)) : (openBlock(), createElementBlock("input", {
|
|
1052
|
+
key: 10,
|
|
773
1053
|
type: "text",
|
|
774
|
-
value: String((
|
|
1054
|
+
value: String((_g = formValues[field.name]) != null ? _g : ""),
|
|
775
1055
|
disabled: replySent.value,
|
|
776
1056
|
placeholder: `\u8BF7\u8F93\u5165${field.label || field.name}`,
|
|
777
1057
|
class: "yc-display-form-card__control yc-display-form-card__input",
|
|
778
1058
|
onInput: (event) => formValues[field.name] = event.target.value
|
|
779
|
-
}, null, 40,
|
|
1059
|
+
}, null, 40, _hoisted_37)),
|
|
1060
|
+
fieldValidationErrors[field.name] ? (openBlock(), createElementBlock(
|
|
1061
|
+
"span",
|
|
1062
|
+
_hoisted_38,
|
|
1063
|
+
toDisplayString(fieldValidationErrors[field.name]),
|
|
1064
|
+
1
|
|
1065
|
+
/* TEXT */
|
|
1066
|
+
)) : createCommentVNode("v-if", true)
|
|
780
1067
|
],
|
|
781
1068
|
2
|
|
782
1069
|
/* CLASS */
|
|
@@ -786,37 +1073,109 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
786
1073
|
/* KEYED_FRAGMENT */
|
|
787
1074
|
))
|
|
788
1075
|
])) : createCommentVNode("v-if", true),
|
|
789
|
-
createElementVNode("div",
|
|
1076
|
+
createElementVNode("div", _hoisted_39, [
|
|
1077
|
+
resolvedMode.value === "reply" && replySent.value ? (openBlock(), createElementBlock("button", {
|
|
1078
|
+
key: 0,
|
|
1079
|
+
type: "button",
|
|
1080
|
+
class: "yc-display-form-card__btn is-default",
|
|
1081
|
+
onClick: unlockReplyEdit
|
|
1082
|
+
}, " \u4FEE\u6539\u91CD\u63D0 ")) : createCommentVNode("v-if", true),
|
|
790
1083
|
createElementVNode("button", {
|
|
791
1084
|
type: "button",
|
|
792
1085
|
class: "yc-display-form-card__btn is-primary",
|
|
793
1086
|
disabled: !canExecute.value || executing.value,
|
|
794
1087
|
onClick: handleExecute
|
|
795
|
-
}, toDisplayString(executing.value ? "\u5904\u7406\u4E2D\u2026" : resolvedSubmitLabel.value), 9,
|
|
1088
|
+
}, toDisplayString(executing.value ? "\u5904\u7406\u4E2D\u2026" : resolvedSubmitLabel.value), 9, _hoisted_40),
|
|
796
1089
|
createElementVNode("button", {
|
|
797
1090
|
type: "button",
|
|
798
1091
|
class: "yc-display-form-card__btn is-default",
|
|
799
1092
|
disabled: executing.value || replySent.value,
|
|
800
1093
|
onClick: handleReset
|
|
801
|
-
}, " \u91CD\u7F6E ", 8,
|
|
1094
|
+
}, " \u91CD\u7F6E ", 8, _hoisted_41)
|
|
802
1095
|
]),
|
|
803
1096
|
errorMessage.value ? (openBlock(), createElementBlock(
|
|
804
1097
|
"div",
|
|
805
|
-
|
|
1098
|
+
_hoisted_42,
|
|
806
1099
|
toDisplayString(errorMessage.value),
|
|
807
1100
|
1
|
|
808
1101
|
/* TEXT */
|
|
809
1102
|
)) : createCommentVNode("v-if", true),
|
|
810
1103
|
submitReceipt.value ? (openBlock(), createElementBlock(
|
|
811
1104
|
"div",
|
|
812
|
-
|
|
1105
|
+
_hoisted_43,
|
|
813
1106
|
toDisplayString(submitReceipt.value),
|
|
814
1107
|
1
|
|
815
1108
|
/* TEXT */
|
|
816
1109
|
)) : createCommentVNode("v-if", true),
|
|
817
|
-
|
|
818
|
-
(
|
|
819
|
-
|
|
1110
|
+
traceSteps.value.length ? (openBlock(), createElementBlock("div", _hoisted_44, [
|
|
1111
|
+
createElementVNode("button", {
|
|
1112
|
+
type: "button",
|
|
1113
|
+
class: "yc-display-form-card__trace-toggle",
|
|
1114
|
+
onClick: _cache[0] || (_cache[0] = ($event) => traceExpanded.value = !traceExpanded.value)
|
|
1115
|
+
}, [
|
|
1116
|
+
createElementVNode(
|
|
1117
|
+
"span",
|
|
1118
|
+
null,
|
|
1119
|
+
" \u6267\u884C\u8FFD\u8E2A\uFF08" + toDisplayString(traceSteps.value.length) + " \u6B65\uFF09 ",
|
|
1120
|
+
1
|
|
1121
|
+
/* TEXT */
|
|
1122
|
+
),
|
|
1123
|
+
createElementVNode(
|
|
1124
|
+
"span",
|
|
1125
|
+
_hoisted_45,
|
|
1126
|
+
toDisplayString(traceExpanded.value ? "\u6536\u8D77" : "\u5C55\u5F00"),
|
|
1127
|
+
1
|
|
1128
|
+
/* TEXT */
|
|
1129
|
+
)
|
|
1130
|
+
]),
|
|
1131
|
+
traceExpanded.value ? (openBlock(), createElementBlock("ul", _hoisted_46, [
|
|
1132
|
+
(openBlock(true), createElementBlock(
|
|
1133
|
+
Fragment,
|
|
1134
|
+
null,
|
|
1135
|
+
renderList(traceSteps.value, (step) => {
|
|
1136
|
+
return openBlock(), createElementBlock(
|
|
1137
|
+
"li",
|
|
1138
|
+
{
|
|
1139
|
+
key: step.id,
|
|
1140
|
+
class: normalizeClass(["yc-display-form-card__trace-item", `is-${step.status}`])
|
|
1141
|
+
},
|
|
1142
|
+
[
|
|
1143
|
+
_cache[3] || (_cache[3] = createElementVNode(
|
|
1144
|
+
"span",
|
|
1145
|
+
{ class: "yc-display-form-card__trace-dot" },
|
|
1146
|
+
null,
|
|
1147
|
+
-1
|
|
1148
|
+
/* CACHED */
|
|
1149
|
+
)),
|
|
1150
|
+
createElementVNode("div", _hoisted_47, [
|
|
1151
|
+
createElementVNode(
|
|
1152
|
+
"div",
|
|
1153
|
+
_hoisted_48,
|
|
1154
|
+
toDisplayString(step.label),
|
|
1155
|
+
1
|
|
1156
|
+
/* TEXT */
|
|
1157
|
+
),
|
|
1158
|
+
step.detail ? (openBlock(), createElementBlock(
|
|
1159
|
+
"div",
|
|
1160
|
+
_hoisted_49,
|
|
1161
|
+
toDisplayString(step.detail),
|
|
1162
|
+
1
|
|
1163
|
+
/* TEXT */
|
|
1164
|
+
)) : createCommentVNode("v-if", true)
|
|
1165
|
+
])
|
|
1166
|
+
],
|
|
1167
|
+
2
|
|
1168
|
+
/* CLASS */
|
|
1169
|
+
);
|
|
1170
|
+
}),
|
|
1171
|
+
128
|
|
1172
|
+
/* KEYED_FRAGMENT */
|
|
1173
|
+
))
|
|
1174
|
+
])) : createCommentVNode("v-if", true)
|
|
1175
|
+
])) : createCommentVNode("v-if", true),
|
|
1176
|
+
hasExecuted.value ? (openBlock(), createElementBlock("div", _hoisted_50, [
|
|
1177
|
+
((_a = resultRows.value) == null ? void 0 : _a.length) ? (openBlock(), createElementBlock("div", _hoisted_51, [
|
|
1178
|
+
createElementVNode("table", _hoisted_52, [
|
|
820
1179
|
createElementVNode("thead", null, [
|
|
821
1180
|
createElementVNode("tr", null, [
|
|
822
1181
|
(openBlock(true), createElementBlock(
|
|
@@ -865,7 +1224,7 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
865
1224
|
))
|
|
866
1225
|
])
|
|
867
1226
|
])
|
|
868
|
-
])) : resultDetailEntries.value.length ? (openBlock(), createElementBlock("div",
|
|
1227
|
+
])) : resultDetailEntries.value.length ? (openBlock(), createElementBlock("div", _hoisted_53, [
|
|
869
1228
|
(openBlock(true), createElementBlock(
|
|
870
1229
|
Fragment,
|
|
871
1230
|
null,
|
|
@@ -876,14 +1235,14 @@ var _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
876
1235
|
}, [
|
|
877
1236
|
createElementVNode(
|
|
878
1237
|
"span",
|
|
879
|
-
|
|
1238
|
+
_hoisted_54,
|
|
880
1239
|
toDisplayString(entry.label),
|
|
881
1240
|
1
|
|
882
1241
|
/* TEXT */
|
|
883
1242
|
),
|
|
884
1243
|
createElementVNode(
|
|
885
1244
|
"span",
|
|
886
|
-
|
|
1245
|
+
_hoisted_55,
|
|
887
1246
|
toDisplayString(entry.value),
|
|
888
1247
|
1
|
|
889
1248
|
/* TEXT */
|