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