@jeecg/online 1.0.1
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/AuthButtonConfig.js +140 -0
- package/AuthButtonTree.js +183 -0
- package/AuthDataConfig.js +243 -0
- package/AuthDataTree.js +160 -0
- package/AuthFieldConfig.js +167 -0
- package/AuthFieldTree.js +273 -0
- package/AuthManagerDrawer.js +125 -0
- package/AuthSetterModal.js +317 -0
- package/CgformCopyList.js +253 -0
- package/CgformModal.js +748 -0
- package/CgreportModal.js +673 -0
- package/ChartAutoRender.js +69 -0
- package/ChartDoubleRender.js +154 -0
- package/ChartSingleRender.js +132 -0
- package/ChartTabsRender.js +218 -0
- package/CheckDictTable.js +121 -0
- package/CodeGeneratorModal.js +293 -0
- package/CustomButtonList.js +413 -0
- package/DBAttributeTable.js +278 -0
- package/DbToOnlineModal.js +190 -0
- package/EnhanceJavaModal.js +304 -0
- package/EnhanceJsHistory.js +231 -0
- package/EnhanceJsModal.js +293 -0
- package/EnhanceSqlModal.js +305 -0
- package/ErrorTip.js +21 -0
- package/ExtendConfigModal.js +142 -0
- package/FieldTable.js +185 -0
- package/FileSelectModal.js +102 -0
- package/ForeignKeyTable.js +78 -0
- package/FormSchemaFactory.js +938 -0
- package/GraphreportAutoChart.js +352 -0
- package/GraphreportList.js +239 -0
- package/GraphreportModal.js +559 -0
- package/IndexTable.js +96 -0
- package/JOnlineSearchSelect.js +107 -0
- package/LICENSE +7 -0
- package/LeftDepart.js +96 -0
- package/LeftRole.js +95 -0
- package/LeftUser.js +114 -0
- package/ModalFormDemo.js +84 -0
- package/OnlineAutoList.js +410 -0
- package/OnlineAutoModal.js +265 -0
- package/OnlineAutoTreeList.js +513 -0
- package/OnlineCustomModal.js +269 -0
- package/OnlineForm.js +809 -0
- package/OnlineQueryForm.js +442 -0
- package/OnlineSearchFormItem.js +428 -0
- package/OnlineSelectCascade.js +217 -0
- package/OnlineSubForm.js +200 -0
- package/OnlineSuperQuery.js +912 -0
- package/OnlineSuperQueryValComponent.js +8 -0
- package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +172 -0
- package/PageAttributeTable.js +242 -0
- package/ParamsTable.js +71 -0
- package/ProcessOnlineForm.js +183 -0
- package/QueryTable.js +128 -0
- package/README.md +23 -0
- package/_arrayPush.js +276 -0
- package/auth.api.js +43 -0
- package/auth.data.js +144 -0
- package/cgform.data.js +235 -0
- package/cloneDeep.js +475 -0
- package/enhance.api.js +120 -0
- package/enhance.data.js +196 -0
- package/graphreport.api.js +23 -0
- package/index.js +64 -0
- package/index2.js +336 -0
- package/index3.js +799 -0
- package/isArray.js +47 -0
- package/main.index.js +6 -0
- package/package.json +6 -0
- package/pick.js +238 -0
- package/style.css +1 -0
- package/toString.js +31 -0
- package/useAutoForm.js +4274 -0
- package/useCgformList.js +353 -0
- package/useChartRender.js +405 -0
- package/useMessageOnline.js +71 -0
- package/useOnlineTest.js +26866 -0
- package/useSchemas.js +505 -0
- package/useTableColumns.js +1154 -0
- package/useTableSync.js +105 -0
|
@@ -0,0 +1,428 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, toDisplayString, createElementBlock, Fragment, createVNode, renderList, createTextVNode, mergeProps, useCssVars, pushScopeId, popScopeId } from "vue";
|
|
18
|
+
import { JDictSelectTag, JTreeSelect, JCategorySelect, JSelectUser, JSelectUserByDept, JSelectDept, JPopup, JAreaLinkage, JAreaSelect, JSelectMultiple } from "/@/components/Form";
|
|
19
|
+
import JOnlineSearchSelect from "./JOnlineSearchSelect.js";
|
|
20
|
+
import { _ as _export_sfc } from "./index.js";
|
|
21
|
+
import "@vueuse/core";
|
|
22
|
+
import "/@/utils/http/axios";
|
|
23
|
+
import "/@/hooks/web/useMessage";
|
|
24
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
25
|
+
import "vue-router";
|
|
26
|
+
var OnlineSearchFormItem_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
27
|
+
const __default__ = defineComponent({
|
|
28
|
+
name: "OnlineSearchFormItem",
|
|
29
|
+
components: {
|
|
30
|
+
JOnlineSearchSelect,
|
|
31
|
+
JDictSelectTag,
|
|
32
|
+
JTreeSelect,
|
|
33
|
+
JCategorySelect,
|
|
34
|
+
JSelectUser,
|
|
35
|
+
JSelectUserByDept,
|
|
36
|
+
JSelectDept,
|
|
37
|
+
JPopup,
|
|
38
|
+
JAreaLinkage,
|
|
39
|
+
JAreaSelect,
|
|
40
|
+
JSelectMultiple
|
|
41
|
+
},
|
|
42
|
+
props: {
|
|
43
|
+
value: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: ""
|
|
46
|
+
},
|
|
47
|
+
item: {
|
|
48
|
+
type: Object,
|
|
49
|
+
default: () => {
|
|
50
|
+
},
|
|
51
|
+
required: true
|
|
52
|
+
},
|
|
53
|
+
dictOptions: {
|
|
54
|
+
type: Object,
|
|
55
|
+
default: () => {
|
|
56
|
+
},
|
|
57
|
+
required: false
|
|
58
|
+
},
|
|
59
|
+
onlineForm: {
|
|
60
|
+
type: Object,
|
|
61
|
+
default: () => {
|
|
62
|
+
},
|
|
63
|
+
required: false
|
|
64
|
+
}
|
|
65
|
+
},
|
|
66
|
+
emits: ["update:value", "change"],
|
|
67
|
+
setup(props, { emit }) {
|
|
68
|
+
const labelTextMaxWidth = "120px";
|
|
69
|
+
const labelCol = {
|
|
70
|
+
style: {
|
|
71
|
+
"max-width": labelTextMaxWidth
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
const single_mode = "single";
|
|
75
|
+
let innerValue = ref("");
|
|
76
|
+
let beginValue = ref("");
|
|
77
|
+
let endValue = ref("");
|
|
78
|
+
watch(() => props.value, () => {
|
|
79
|
+
if (isEasySelect()) {
|
|
80
|
+
innerValue.value = !!props.value ? props.value : void 0;
|
|
81
|
+
} else {
|
|
82
|
+
innerValue.value = props.value;
|
|
83
|
+
}
|
|
84
|
+
if (!props.value) {
|
|
85
|
+
beginValue.value = "";
|
|
86
|
+
endValue.value = "";
|
|
87
|
+
}
|
|
88
|
+
}, { deep: true, immediate: true });
|
|
89
|
+
watch(innerValue, (newVal) => {
|
|
90
|
+
console.log("innerValue-change", newVal);
|
|
91
|
+
emit("update:value", newVal);
|
|
92
|
+
}, { immediate: true });
|
|
93
|
+
watch(beginValue, (newVal) => {
|
|
94
|
+
emit("change", props.item.field + "_begin", newVal);
|
|
95
|
+
emit("update:value", "1");
|
|
96
|
+
});
|
|
97
|
+
watch(endValue, (newVal) => {
|
|
98
|
+
emit("change", props.item.field + "_end", newVal);
|
|
99
|
+
emit("update:value", "1");
|
|
100
|
+
});
|
|
101
|
+
function getDictOptionKey(item) {
|
|
102
|
+
console.log("ddictOptions", props.dictOptions);
|
|
103
|
+
if (item.dbField) {
|
|
104
|
+
return item.dbField;
|
|
105
|
+
} else {
|
|
106
|
+
return item.field;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
function isEasySelect() {
|
|
110
|
+
let item = props.item;
|
|
111
|
+
if (!item) {
|
|
112
|
+
return false;
|
|
113
|
+
}
|
|
114
|
+
return item.view == "list" || item.view == "radio" || item.view == "switch";
|
|
115
|
+
}
|
|
116
|
+
function getDictCode() {
|
|
117
|
+
let item = props.item;
|
|
118
|
+
if (item.dictTable && item.dictTable.length > 0) {
|
|
119
|
+
return item.dictTable + "," + item.dictText + "," + item.dictCode;
|
|
120
|
+
} else {
|
|
121
|
+
return item.dictCode;
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
function getSqlByDictCode() {
|
|
125
|
+
let item = props.item;
|
|
126
|
+
let { dictTable, dictCode, dictText } = item;
|
|
127
|
+
let temp = dictTable.toLowerCase();
|
|
128
|
+
let arr = temp.split("where");
|
|
129
|
+
let condition = "";
|
|
130
|
+
if (arr.length > 1) {
|
|
131
|
+
condition = " where" + arr[1];
|
|
132
|
+
}
|
|
133
|
+
let sql = "select " + dictCode + " as 'value', " + dictText + " as 'text' from " + arr[0] + condition;
|
|
134
|
+
console.log("sql", sql);
|
|
135
|
+
return sql;
|
|
136
|
+
}
|
|
137
|
+
function getPopupFieldConfig(item) {
|
|
138
|
+
let { dictText: destFields, dictCode: orgFields } = item;
|
|
139
|
+
if (!destFields || destFields.length == 0) {
|
|
140
|
+
return [];
|
|
141
|
+
}
|
|
142
|
+
let arr1 = destFields.split(",");
|
|
143
|
+
let arr2 = orgFields.split(",");
|
|
144
|
+
let config = [];
|
|
145
|
+
for (let i = 0; i < arr1.length; i++) {
|
|
146
|
+
config.push({
|
|
147
|
+
target: arr1[i],
|
|
148
|
+
source: arr2[i]
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
return config;
|
|
152
|
+
}
|
|
153
|
+
function setFieldsValue(values) {
|
|
154
|
+
let { dictText: destFields } = props.item;
|
|
155
|
+
let arr1 = destFields.split(",");
|
|
156
|
+
let field = arr1[0];
|
|
157
|
+
emit("change", field, values[field]);
|
|
158
|
+
}
|
|
159
|
+
function handleCategoryTreeChange(value) {
|
|
160
|
+
emit("update:value", value);
|
|
161
|
+
}
|
|
162
|
+
function getComponentProps(item, labelKey, rowKey) {
|
|
163
|
+
let props2 = {
|
|
164
|
+
labelKey,
|
|
165
|
+
rowKey
|
|
166
|
+
};
|
|
167
|
+
let fieldExtendJson = item.fieldExtendJson;
|
|
168
|
+
if (fieldExtendJson) {
|
|
169
|
+
if (typeof fieldExtendJson == "string") {
|
|
170
|
+
let json = JSON.parse(fieldExtendJson);
|
|
171
|
+
let extend = __spreadValues({}, json);
|
|
172
|
+
if (extend.text) {
|
|
173
|
+
props2["labelKey"] = extend.text;
|
|
174
|
+
}
|
|
175
|
+
if (extend.store) {
|
|
176
|
+
props2["rowKey"] = extend.store;
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return props2;
|
|
181
|
+
}
|
|
182
|
+
let userSelectProp = getComponentProps(props.item, "realname", "username");
|
|
183
|
+
console.log("userSelectProp", userSelectProp);
|
|
184
|
+
let depSelectProp = getComponentProps(props.item, "departName", "id");
|
|
185
|
+
function handleSelectChange(array) {
|
|
186
|
+
if (array && array.length > 0) {
|
|
187
|
+
emit("update:value", array.join(","));
|
|
188
|
+
} else {
|
|
189
|
+
emit("update:value", "");
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
getPopupFieldConfig,
|
|
194
|
+
userSelectProp,
|
|
195
|
+
depSelectProp,
|
|
196
|
+
handleSelectChange,
|
|
197
|
+
setFieldsValue,
|
|
198
|
+
innerValue,
|
|
199
|
+
beginValue,
|
|
200
|
+
endValue,
|
|
201
|
+
isEasySelect,
|
|
202
|
+
getDictOptionKey,
|
|
203
|
+
getDictCode,
|
|
204
|
+
labelTextMaxWidth,
|
|
205
|
+
labelCol,
|
|
206
|
+
single_mode,
|
|
207
|
+
getSqlByDictCode,
|
|
208
|
+
handleCategoryTreeChange
|
|
209
|
+
};
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
const __injectCSSVars__ = () => {
|
|
213
|
+
useCssVars((_ctx) => ({
|
|
214
|
+
"0d13e305": _ctx.labelTextMaxWidth
|
|
215
|
+
}));
|
|
216
|
+
};
|
|
217
|
+
const __setup__ = __default__.setup;
|
|
218
|
+
__default__.setup = __setup__ ? (props, ctx) => {
|
|
219
|
+
__injectCSSVars__();
|
|
220
|
+
return __setup__(props, ctx);
|
|
221
|
+
} : __injectCSSVars__;
|
|
222
|
+
const _sfc_main = __default__;
|
|
223
|
+
const _withScopeId = (n) => (pushScopeId("data-v-213184f5"), n = n(), popScopeId(), n);
|
|
224
|
+
const _hoisted_1 = ["title"];
|
|
225
|
+
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "group-query-strig" }, "~", -1));
|
|
226
|
+
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "group-query-strig" }, "~", -1));
|
|
227
|
+
const _hoisted_4 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "group-query-strig" }, "~", -1));
|
|
228
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
229
|
+
const _component_a_date_picker = resolveComponent("a-date-picker");
|
|
230
|
+
const _component_JDictSelectTag = resolveComponent("JDictSelectTag");
|
|
231
|
+
const _component_a_select_option = resolveComponent("a-select-option");
|
|
232
|
+
const _component_a_select = resolveComponent("a-select");
|
|
233
|
+
const _component_JTreeSelect = resolveComponent("JTreeSelect");
|
|
234
|
+
const _component_JCategorySelect = resolveComponent("JCategorySelect");
|
|
235
|
+
const _component_JOnlineSearchSelect = resolveComponent("JOnlineSearchSelect");
|
|
236
|
+
const _component_JSelectUser = resolveComponent("JSelectUser");
|
|
237
|
+
const _component_JSelectDept = resolveComponent("JSelectDept");
|
|
238
|
+
const _component_JPopup = resolveComponent("JPopup");
|
|
239
|
+
const _component_JAreaSelect = resolveComponent("JAreaSelect");
|
|
240
|
+
const _component_JSelectMultiple = resolveComponent("JSelectMultiple");
|
|
241
|
+
const _component_a_input = resolveComponent("a-input");
|
|
242
|
+
const _component_a_form_item = resolveComponent("a-form-item");
|
|
243
|
+
return openBlock(), createBlock(_component_a_form_item, {
|
|
244
|
+
labelCol: _ctx.labelCol,
|
|
245
|
+
class: normalizeClass("jeecg-online-search")
|
|
246
|
+
}, {
|
|
247
|
+
label: withCtx(() => [
|
|
248
|
+
createElementVNode("span", {
|
|
249
|
+
title: _ctx.item.label,
|
|
250
|
+
class: "label-text"
|
|
251
|
+
}, toDisplayString(_ctx.item.label), 9, _hoisted_1)
|
|
252
|
+
]),
|
|
253
|
+
default: withCtx(() => [
|
|
254
|
+
_ctx.item.view == "date" ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
255
|
+
_ctx.single_mode === _ctx.item.mode ? (openBlock(), createBlock(_component_a_date_picker, {
|
|
256
|
+
key: 0,
|
|
257
|
+
style: { "width": "100%" },
|
|
258
|
+
showTime: false,
|
|
259
|
+
valueFormat: "YYYY-MM-DD",
|
|
260
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
261
|
+
value: _ctx.innerValue,
|
|
262
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.innerValue = $event)
|
|
263
|
+
}, null, 8, ["placeholder", "value"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
264
|
+
createVNode(_component_a_date_picker, {
|
|
265
|
+
showTime: false,
|
|
266
|
+
valueFormat: "YYYY-MM-DD",
|
|
267
|
+
placeholder: "\u5F00\u59CB\u65E5\u671F",
|
|
268
|
+
value: _ctx.beginValue,
|
|
269
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => _ctx.beginValue = $event),
|
|
270
|
+
style: { "width": "calc(50% - 15px)" }
|
|
271
|
+
}, null, 8, ["value"]),
|
|
272
|
+
_hoisted_2,
|
|
273
|
+
createVNode(_component_a_date_picker, {
|
|
274
|
+
showTime: false,
|
|
275
|
+
valueFormat: "YYYY-MM-DD",
|
|
276
|
+
placeholder: "\u7ED3\u675F\u65E5\u671F",
|
|
277
|
+
value: _ctx.endValue,
|
|
278
|
+
"onUpdate:value": _cache[2] || (_cache[2] = ($event) => _ctx.endValue = $event),
|
|
279
|
+
style: { "width": "calc(50% - 15px)" }
|
|
280
|
+
}, null, 8, ["value"])
|
|
281
|
+
], 64))
|
|
282
|
+
], 64)) : _ctx.item.view == "datetime" ? (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
283
|
+
_ctx.single_mode === _ctx.item.mode ? (openBlock(), createBlock(_component_a_date_picker, {
|
|
284
|
+
key: 0,
|
|
285
|
+
style: { "width": "100%" },
|
|
286
|
+
showTime: true,
|
|
287
|
+
valueFormat: "YYYY-MM-DD hh:mm:ss",
|
|
288
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
289
|
+
value: _ctx.innerValue,
|
|
290
|
+
"onUpdate:value": _cache[3] || (_cache[3] = ($event) => _ctx.innerValue = $event)
|
|
291
|
+
}, null, 8, ["placeholder", "value"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
292
|
+
createVNode(_component_a_date_picker, {
|
|
293
|
+
showTime: true,
|
|
294
|
+
valueFormat: "YYYY-MM-DD hh:mm:ss",
|
|
295
|
+
placeholder: "\u5F00\u59CB\u65F6\u95F4",
|
|
296
|
+
value: _ctx.beginValue,
|
|
297
|
+
"onUpdate:value": _cache[4] || (_cache[4] = ($event) => _ctx.beginValue = $event),
|
|
298
|
+
style: { "width": "calc(50% - 15px)" }
|
|
299
|
+
}, null, 8, ["value"]),
|
|
300
|
+
_hoisted_3,
|
|
301
|
+
createVNode(_component_a_date_picker, {
|
|
302
|
+
showTime: true,
|
|
303
|
+
valueFormat: "YYYY-MM-DD hh:mm:ss",
|
|
304
|
+
placeholder: "\u7ED3\u675F\u65F6\u95F4",
|
|
305
|
+
value: _ctx.endValue,
|
|
306
|
+
"onUpdate:value": _cache[5] || (_cache[5] = ($event) => _ctx.endValue = $event),
|
|
307
|
+
style: { "width": "calc(50% - 15px)" }
|
|
308
|
+
}, null, 8, ["value"])
|
|
309
|
+
], 64))
|
|
310
|
+
], 64)) : _ctx.isEasySelect() ? (openBlock(), createElementBlock(Fragment, { key: 2 }, [
|
|
311
|
+
_ctx.item.config === "1" ? (openBlock(), createBlock(_component_JDictSelectTag, {
|
|
312
|
+
key: 0,
|
|
313
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
314
|
+
value: _ctx.innerValue,
|
|
315
|
+
"onUpdate:value": _cache[6] || (_cache[6] = ($event) => _ctx.innerValue = $event),
|
|
316
|
+
dictCode: _ctx.getDictCode()
|
|
317
|
+
}, null, 8, ["placeholder", "value", "dictCode"])) : (openBlock(), createBlock(_component_a_select, {
|
|
318
|
+
key: 1,
|
|
319
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
320
|
+
value: _ctx.innerValue,
|
|
321
|
+
"onUpdate:value": _cache[7] || (_cache[7] = ($event) => _ctx.innerValue = $event)
|
|
322
|
+
}, {
|
|
323
|
+
default: withCtx(() => [
|
|
324
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dictOptions[_ctx.getDictOptionKey(_ctx.item)], (obj, index) => {
|
|
325
|
+
return openBlock(), createBlock(_component_a_select_option, {
|
|
326
|
+
key: index,
|
|
327
|
+
value: obj.value
|
|
328
|
+
}, {
|
|
329
|
+
default: withCtx(() => [
|
|
330
|
+
createTextVNode(toDisplayString(obj.text), 1)
|
|
331
|
+
]),
|
|
332
|
+
_: 2
|
|
333
|
+
}, 1032, ["value"]);
|
|
334
|
+
}), 128))
|
|
335
|
+
]),
|
|
336
|
+
_: 1
|
|
337
|
+
}, 8, ["placeholder", "value"]))
|
|
338
|
+
], 64)) : _ctx.item.view === "sel_tree" ? (openBlock(), createBlock(_component_JTreeSelect, {
|
|
339
|
+
key: 3,
|
|
340
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
341
|
+
value: _ctx.innerValue,
|
|
342
|
+
"onUpdate:value": _cache[8] || (_cache[8] = ($event) => _ctx.innerValue = $event),
|
|
343
|
+
dict: _ctx.item.dict,
|
|
344
|
+
pidField: _ctx.item.pidField,
|
|
345
|
+
pidValue: _ctx.item.pidValue,
|
|
346
|
+
hasChildField: _ctx.item.hasChildField,
|
|
347
|
+
"load-triggle-change": ""
|
|
348
|
+
}, null, 8, ["placeholder", "value", "dict", "pidField", "pidValue", "hasChildField"])) : _ctx.item.view === "cat_tree" ? (openBlock(), createBlock(_component_JCategorySelect, {
|
|
349
|
+
key: 4,
|
|
350
|
+
onChange: _ctx.handleCategoryTreeChange,
|
|
351
|
+
loadTriggleChange: true,
|
|
352
|
+
pcode: _ctx.item.pcode,
|
|
353
|
+
value: _ctx.innerValue,
|
|
354
|
+
"onUpdate:value": _cache[9] || (_cache[9] = ($event) => _ctx.innerValue = $event),
|
|
355
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label
|
|
356
|
+
}, null, 8, ["onChange", "pcode", "value", "placeholder"])) : _ctx.item.view === "sel_search" ? (openBlock(), createElementBlock(Fragment, { key: 5 }, [
|
|
357
|
+
_ctx.item.config === "1" ? (openBlock(), createBlock(_component_JDictSelectTag, {
|
|
358
|
+
key: 0,
|
|
359
|
+
value: _ctx.innerValue,
|
|
360
|
+
"onUpdate:value": _cache[10] || (_cache[10] = ($event) => _ctx.innerValue = $event),
|
|
361
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
362
|
+
dict: _ctx.getDictCode()
|
|
363
|
+
}, null, 8, ["value", "placeholder", "dict"])) : (openBlock(), createBlock(_component_JOnlineSearchSelect, {
|
|
364
|
+
key: 1,
|
|
365
|
+
value: _ctx.innerValue,
|
|
366
|
+
"onUpdate:value": _cache[11] || (_cache[11] = ($event) => _ctx.innerValue = $event),
|
|
367
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
368
|
+
sql: _ctx.getSqlByDictCode()
|
|
369
|
+
}, null, 8, ["value", "placeholder", "sql"]))
|
|
370
|
+
], 64)) : _ctx.item.view == "sel_user" ? (openBlock(), createBlock(_component_JSelectUser, mergeProps({ key: 6 }, _ctx.userSelectProp, {
|
|
371
|
+
value: _ctx.innerValue,
|
|
372
|
+
"onUpdate:value": _cache[12] || (_cache[12] = ($event) => _ctx.innerValue = $event),
|
|
373
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label
|
|
374
|
+
}), null, 16, ["value", "placeholder"])) : _ctx.item.view == "sel_depart" ? (openBlock(), createBlock(_component_JSelectDept, mergeProps({
|
|
375
|
+
key: 7,
|
|
376
|
+
showButton: false
|
|
377
|
+
}, _ctx.depSelectProp, {
|
|
378
|
+
value: _ctx.innerValue,
|
|
379
|
+
"onUpdate:value": _cache[13] || (_cache[13] = ($event) => _ctx.innerValue = $event),
|
|
380
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label
|
|
381
|
+
}), null, 16, ["value", "placeholder"])) : _ctx.item.view == "popup" ? (openBlock(), createBlock(_component_JPopup, {
|
|
382
|
+
key: 8,
|
|
383
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
384
|
+
value: _ctx.innerValue,
|
|
385
|
+
"onUpdate:value": _cache[14] || (_cache[14] = ($event) => _ctx.innerValue = $event),
|
|
386
|
+
code: _ctx.item.dictTable,
|
|
387
|
+
setFieldsValue: _ctx.setFieldsValue,
|
|
388
|
+
"field-config": _ctx.getPopupFieldConfig(_ctx.item),
|
|
389
|
+
multi: true
|
|
390
|
+
}, null, 8, ["placeholder", "value", "code", "setFieldsValue", "field-config"])) : _ctx.item.view == "pca" ? (openBlock(), createBlock(_component_JAreaSelect, {
|
|
391
|
+
key: 9,
|
|
392
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
393
|
+
value: _ctx.innerValue,
|
|
394
|
+
"onUpdate:value": _cache[15] || (_cache[15] = ($event) => _ctx.innerValue = $event)
|
|
395
|
+
}, null, 8, ["placeholder", "value"])) : _ctx.item.view == "checkbox" || _ctx.item.view == "list_multi" ? (openBlock(), createBlock(_component_JSelectMultiple, {
|
|
396
|
+
key: 10,
|
|
397
|
+
dictCode: _ctx.getDictCode(),
|
|
398
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
399
|
+
value: _ctx.innerValue,
|
|
400
|
+
"onUpdate:value": _cache[16] || (_cache[16] = ($event) => _ctx.innerValue = $event)
|
|
401
|
+
}, null, 8, ["dictCode", "placeholder", "value"])) : (openBlock(), createElementBlock(Fragment, { key: 11 }, [
|
|
402
|
+
_ctx.single_mode === _ctx.item.mode ? (openBlock(), createBlock(_component_a_input, {
|
|
403
|
+
key: 0,
|
|
404
|
+
placeholder: "\u8BF7\u9009\u62E9" + _ctx.item.label,
|
|
405
|
+
value: _ctx.innerValue,
|
|
406
|
+
"onUpdate:value": _cache[17] || (_cache[17] = ($event) => _ctx.innerValue = $event)
|
|
407
|
+
}, null, 8, ["placeholder", "value"])) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
|
|
408
|
+
createVNode(_component_a_input, {
|
|
409
|
+
placeholder: "\u5F00\u59CB\u503C",
|
|
410
|
+
value: _ctx.beginValue,
|
|
411
|
+
"onUpdate:value": _cache[18] || (_cache[18] = ($event) => _ctx.beginValue = $event),
|
|
412
|
+
style: { "width": "calc(50% - 15px)" }
|
|
413
|
+
}, null, 8, ["value"]),
|
|
414
|
+
_hoisted_4,
|
|
415
|
+
createVNode(_component_a_input, {
|
|
416
|
+
placeholder: "\u7ED3\u675F\u503C",
|
|
417
|
+
value: _ctx.endValue,
|
|
418
|
+
"onUpdate:value": _cache[19] || (_cache[19] = ($event) => _ctx.endValue = $event),
|
|
419
|
+
style: { "width": "calc(50% - 15px)" }
|
|
420
|
+
}, null, 8, ["value"])
|
|
421
|
+
], 64))
|
|
422
|
+
], 64))
|
|
423
|
+
]),
|
|
424
|
+
_: 1
|
|
425
|
+
}, 8, ["labelCol"]);
|
|
426
|
+
}
|
|
427
|
+
var OnlineSearchFormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-213184f5"]]);
|
|
428
|
+
export { OnlineSearchFormItem as default };
|
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString } from "vue";
|
|
22
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
23
|
+
import { useMessage } from "/@/hooks/web/useMessage";
|
|
24
|
+
import { _ as _export_sfc } from "./index.js";
|
|
25
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
26
|
+
import "vue-router";
|
|
27
|
+
const SELECT_OPTIONS_URL = "/online/cgform/api/querySelectOptions";
|
|
28
|
+
const _sfc_main = defineComponent({
|
|
29
|
+
name: "OnlineSelectCascade",
|
|
30
|
+
props: {
|
|
31
|
+
table: { type: String, default: "" },
|
|
32
|
+
txt: { type: String, default: "" },
|
|
33
|
+
store: { type: String, default: "" },
|
|
34
|
+
idField: { type: String, default: "" },
|
|
35
|
+
pidField: { type: String, default: "" },
|
|
36
|
+
pidValue: { type: String, default: "-1" },
|
|
37
|
+
origin: { type: Boolean, default: false },
|
|
38
|
+
condition: { type: String, default: "" },
|
|
39
|
+
value: { type: String, default: "" },
|
|
40
|
+
isNumber: { type: Boolean, default: false },
|
|
41
|
+
placeholder: { type: String, default: "\u8BF7\u9009\u62E9" }
|
|
42
|
+
},
|
|
43
|
+
emits: ["change", "next"],
|
|
44
|
+
setup(props, { emit }) {
|
|
45
|
+
const { createMessage: $message } = useMessage();
|
|
46
|
+
const selectedValue = ref("");
|
|
47
|
+
const dictOptions = ref([]);
|
|
48
|
+
const optionsLoad = ref(true);
|
|
49
|
+
function handleChange(value) {
|
|
50
|
+
console.log("handleChange", value);
|
|
51
|
+
let temp = value || "";
|
|
52
|
+
emit("change", temp);
|
|
53
|
+
valueChangeThenEmitNext(temp);
|
|
54
|
+
}
|
|
55
|
+
watch(() => props.condition, (val) => {
|
|
56
|
+
optionsLoad.value = true;
|
|
57
|
+
if (val) {
|
|
58
|
+
loadOptions();
|
|
59
|
+
}
|
|
60
|
+
}, { immediate: true });
|
|
61
|
+
watch(() => props.pidValue, (val) => {
|
|
62
|
+
if (val === "-1") {
|
|
63
|
+
dictOptions.value = [];
|
|
64
|
+
} else {
|
|
65
|
+
loadOptions();
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
watch(() => props.value, (newVal, oldVal) => {
|
|
69
|
+
console.log("\u503C\u6539\u53D8\u4E8B\u4EF6", newVal, oldVal);
|
|
70
|
+
if (!newVal) {
|
|
71
|
+
selectedValue.value = [];
|
|
72
|
+
if (oldVal) {
|
|
73
|
+
emit("change", "");
|
|
74
|
+
emit("next", "-1");
|
|
75
|
+
}
|
|
76
|
+
} else {
|
|
77
|
+
selectedValue.value = newVal;
|
|
78
|
+
}
|
|
79
|
+
if (newVal && !oldVal) {
|
|
80
|
+
handleFirstValueSetting(newVal);
|
|
81
|
+
}
|
|
82
|
+
}, { immediate: true });
|
|
83
|
+
function handleFirstValueSetting(value) {
|
|
84
|
+
return __async(this, null, function* () {
|
|
85
|
+
if (props.idField === props.store) {
|
|
86
|
+
emit("next", value);
|
|
87
|
+
} else {
|
|
88
|
+
if (props.origin === true) {
|
|
89
|
+
yield getSelfOptions();
|
|
90
|
+
valueChangeThenEmitNext(value);
|
|
91
|
+
} else {
|
|
92
|
+
let arr = yield loadValueText();
|
|
93
|
+
valueChangeThenEmitNext(value, arr);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
function loadOptions() {
|
|
99
|
+
let params = getQueryParams();
|
|
100
|
+
if (props.origin === true) {
|
|
101
|
+
params["condition"] = props.condition;
|
|
102
|
+
} else {
|
|
103
|
+
params["pidValue"] = props.pidValue;
|
|
104
|
+
}
|
|
105
|
+
console.log("\u8BF7\u6C42\u53C2\u6570", params);
|
|
106
|
+
dictOptions.value = [];
|
|
107
|
+
defHttp.get({ url: SELECT_OPTIONS_URL, params }, { isTransformResponse: false }).then((res) => {
|
|
108
|
+
if (res.success) {
|
|
109
|
+
dictOptions.value = [...res.result];
|
|
110
|
+
console.log("\u8BF7\u6C42\u7ED3\u679C", res.result, dictOptions);
|
|
111
|
+
} else {
|
|
112
|
+
$message.warning("\u8054\u52A8\u7EC4\u4EF6\u6570\u636E\u52A0\u8F7D\u5931\u8D25,\u8BF7\u68C0\u67E5\u914D\u7F6E!");
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
function getQueryParams() {
|
|
117
|
+
let params = {
|
|
118
|
+
table: props.table,
|
|
119
|
+
txt: props.txt,
|
|
120
|
+
key: props.store,
|
|
121
|
+
idField: props.idField,
|
|
122
|
+
pidField: props.pidField
|
|
123
|
+
};
|
|
124
|
+
return params;
|
|
125
|
+
}
|
|
126
|
+
function loadValueText() {
|
|
127
|
+
return new Promise((resolve) => {
|
|
128
|
+
if (!props.value) {
|
|
129
|
+
selectedValue.value = [];
|
|
130
|
+
resolve([]);
|
|
131
|
+
} else {
|
|
132
|
+
let params = getQueryParams();
|
|
133
|
+
if (props.isNumber === true) {
|
|
134
|
+
params["condition"] = `${props.store} = ${props.value}`;
|
|
135
|
+
} else {
|
|
136
|
+
params["condition"] = `${props.store} = '${props.value}'`;
|
|
137
|
+
}
|
|
138
|
+
defHttp.get({ url: SELECT_OPTIONS_URL, params }, { isTransformResponse: false }).then((res) => {
|
|
139
|
+
if (res.success) {
|
|
140
|
+
resolve(res.result);
|
|
141
|
+
} else {
|
|
142
|
+
$message.warning("\u8054\u52A8\u7EC4\u4EF6\u6570\u636E\u52A0\u8F7D\u5931\u8D25,\u8BF7\u68C0\u67E5\u914D\u7F6E!");
|
|
143
|
+
resolve([]);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
function getSelfOptions() {
|
|
150
|
+
return new Promise((resolve) => {
|
|
151
|
+
let index = 0;
|
|
152
|
+
(function next(index2) {
|
|
153
|
+
if (index2 > 10) {
|
|
154
|
+
resolve([]);
|
|
155
|
+
}
|
|
156
|
+
let arr = dictOptions.value;
|
|
157
|
+
if (arr && arr.length > 0) {
|
|
158
|
+
resolve(arr);
|
|
159
|
+
} else {
|
|
160
|
+
setTimeout(() => {
|
|
161
|
+
next(index2++);
|
|
162
|
+
}, 300);
|
|
163
|
+
}
|
|
164
|
+
})(index);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
function valueChangeThenEmitNext(value, arr = []) {
|
|
168
|
+
if (value && value.length > 0) {
|
|
169
|
+
if (!arr || arr.length == 0) {
|
|
170
|
+
arr = dictOptions.value;
|
|
171
|
+
}
|
|
172
|
+
let selected = arr.filter((item) => item.store === value);
|
|
173
|
+
if (selected && selected.length > 0) {
|
|
174
|
+
let id = selected[0].id;
|
|
175
|
+
emit("next", id);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
return {
|
|
180
|
+
selectedValue,
|
|
181
|
+
dictOptions,
|
|
182
|
+
handleChange
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
});
|
|
186
|
+
const _hoisted_1 = ["title"];
|
|
187
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
188
|
+
const _component_a_select_option = resolveComponent("a-select-option");
|
|
189
|
+
const _component_a_select = resolveComponent("a-select");
|
|
190
|
+
return openBlock(), createBlock(_component_a_select, {
|
|
191
|
+
placeholder: _ctx.placeholder,
|
|
192
|
+
value: _ctx.selectedValue,
|
|
193
|
+
onChange: _ctx.handleChange,
|
|
194
|
+
allowClear: "",
|
|
195
|
+
style: { "width": "100%" }
|
|
196
|
+
}, {
|
|
197
|
+
default: withCtx(() => [
|
|
198
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dictOptions, (item, index) => {
|
|
199
|
+
return openBlock(), createBlock(_component_a_select_option, {
|
|
200
|
+
key: index,
|
|
201
|
+
value: item.store
|
|
202
|
+
}, {
|
|
203
|
+
default: withCtx(() => [
|
|
204
|
+
createElementVNode("span", {
|
|
205
|
+
style: { "display": "inline-block", "width": "100%" },
|
|
206
|
+
title: item.label
|
|
207
|
+
}, toDisplayString(item.label), 9, _hoisted_1)
|
|
208
|
+
]),
|
|
209
|
+
_: 2
|
|
210
|
+
}, 1032, ["value"]);
|
|
211
|
+
}), 128))
|
|
212
|
+
]),
|
|
213
|
+
_: 1
|
|
214
|
+
}, 8, ["placeholder", "value", "onChange"]);
|
|
215
|
+
}
|
|
216
|
+
var OnlineSelectCascade = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
217
|
+
export { OnlineSelectCascade as default };
|