@jeecg/online 3.4.3-beta → 3.4.3
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 +1 -2
- package/AuthButtonTree.js +1 -2
- package/AuthDataConfig.js +1 -2
- package/AuthDataTree.js +1 -2
- package/AuthFieldConfig.js +1 -2
- package/AuthFieldTree.js +1 -2
- package/AuthManagerDrawer.js +1 -2
- package/AuthSetterModal.js +1 -2
- package/CgformCopyList.js +0 -2
- package/CheckDictTable.js +3 -3
- package/CodeFileListModal.js +1 -2
- package/CodeFileViewModal.js +1 -2
- package/CodeGeneratorModal.js +1 -2
- package/CustomButtonList.js +1 -2
- package/DBAttributeTable.js +2 -2
- package/DbToOnlineModal.js +1 -2
- package/DetailForm.js +16 -14
- package/EnhanceJavaModal.js +1 -2
- package/EnhanceJsModal.js +8 -2
- package/EnhanceSqlModal.js +1 -2
- package/ExtendConfigModal.js +2 -2
- package/FileSelectModal.js +1 -2
- package/ForeignKeyTable.js +2 -2
- package/IndexTable.js +2 -2
- package/JModalTip.js +2 -2
- package/LeftDepart.js +2 -2
- package/LeftRole.js +1 -2
- package/LeftUser.js +1 -2
- package/LinkTableConfigModal.js +2 -3
- package/LinkTableFieldConfigModal.js +1 -2
- package/LinkTableListPiece.js +2 -2
- package/ModalFormDemo.js +1 -2
- package/OnlCgReportList.js +34 -0
- package/OnlineAutoList.js +2 -4
- package/OnlineAutoModal.js +9 -7
- package/OnlineAutoTreeList.js +2 -4
- package/OnlineCustomModal.js +3 -5
- package/OnlineDetailModal.js +2 -4
- package/OnlineForm.js +21 -8
- package/OnlineFormDetail.js +3 -5
- package/OnlineQueryForm.js +2 -4
- package/OnlineSearchFormItem.js +2 -5
- package/OnlineSubFormDetail.js +2 -4
- package/OnlineSuperQuery.js +5 -4
- package/PageAttributeTable.js +1 -2
- package/ProcessOnlineForm.js +2 -4
- package/QueryTable.js +2 -2
- package/index.js +345 -31
- package/index2.js +3 -5
- package/main.index.js +3 -3
- package/package.json +1 -1
- package/style.css +1 -1
- package/useAutoForm.js +66 -47
- package/useListButton.js +8 -4
- package/useSchemas.js +18 -4
- package/JOnlineSearchSelect.js +0 -115
- package/LICENSE +0 -7
- package/OnlineSelectCascade.js +0 -231
package/OnlineSelectCascade.js
DELETED
|
@@ -1,231 +0,0 @@
|
|
|
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, createElementBlock, Fragment, createTextVNode, createVNode, withCtx, renderList, createBlock, 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\u62E91" }
|
|
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(
|
|
56
|
-
() => props.condition,
|
|
57
|
-
(val) => {
|
|
58
|
-
optionsLoad.value = true;
|
|
59
|
-
if (val) {
|
|
60
|
-
loadOptions();
|
|
61
|
-
}
|
|
62
|
-
},
|
|
63
|
-
{ immediate: true }
|
|
64
|
-
);
|
|
65
|
-
watch(
|
|
66
|
-
() => props.pidValue,
|
|
67
|
-
(val) => {
|
|
68
|
-
if (val === "-1") {
|
|
69
|
-
dictOptions.value = [];
|
|
70
|
-
} else {
|
|
71
|
-
loadOptions();
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
watch(
|
|
76
|
-
() => props.value,
|
|
77
|
-
(newVal, oldVal) => {
|
|
78
|
-
console.log("\u503C\u6539\u53D8\u4E8B\u4EF6", newVal, oldVal);
|
|
79
|
-
if (!newVal) {
|
|
80
|
-
selectedValue.value = [];
|
|
81
|
-
if (oldVal) {
|
|
82
|
-
emit("change", "");
|
|
83
|
-
emit("next", "-1");
|
|
84
|
-
}
|
|
85
|
-
} else {
|
|
86
|
-
selectedValue.value = newVal;
|
|
87
|
-
}
|
|
88
|
-
if (newVal && !oldVal) {
|
|
89
|
-
handleFirstValueSetting(newVal);
|
|
90
|
-
}
|
|
91
|
-
},
|
|
92
|
-
{ immediate: true }
|
|
93
|
-
);
|
|
94
|
-
function handleFirstValueSetting(value) {
|
|
95
|
-
return __async(this, null, function* () {
|
|
96
|
-
if (props.idField === props.store) {
|
|
97
|
-
emit("next", value);
|
|
98
|
-
} else {
|
|
99
|
-
if (props.origin === true) {
|
|
100
|
-
yield getSelfOptions();
|
|
101
|
-
valueChangeThenEmitNext(value);
|
|
102
|
-
} else {
|
|
103
|
-
let arr = yield loadValueText();
|
|
104
|
-
valueChangeThenEmitNext(value, arr);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
function loadOptions() {
|
|
110
|
-
let params = getQueryParams();
|
|
111
|
-
if (props.origin === true) {
|
|
112
|
-
params["condition"] = props.condition;
|
|
113
|
-
} else {
|
|
114
|
-
params["pidValue"] = props.pidValue;
|
|
115
|
-
}
|
|
116
|
-
console.log("\u8BF7\u6C42\u53C2\u6570", params);
|
|
117
|
-
dictOptions.value = [];
|
|
118
|
-
defHttp.get({ url: SELECT_OPTIONS_URL, params }, { isTransformResponse: false }).then((res) => {
|
|
119
|
-
if (res.success) {
|
|
120
|
-
dictOptions.value = [...res.result];
|
|
121
|
-
console.log("\u8BF7\u6C42\u7ED3\u679C", res.result, dictOptions);
|
|
122
|
-
} else {
|
|
123
|
-
$message.warning("\u8054\u52A8\u7EC4\u4EF6\u6570\u636E\u52A0\u8F7D\u5931\u8D25,\u8BF7\u68C0\u67E5\u914D\u7F6E!");
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
}
|
|
127
|
-
function getQueryParams() {
|
|
128
|
-
let params = {
|
|
129
|
-
table: props.table,
|
|
130
|
-
txt: props.txt,
|
|
131
|
-
key: props.store,
|
|
132
|
-
idField: props.idField,
|
|
133
|
-
pidField: props.pidField
|
|
134
|
-
};
|
|
135
|
-
return params;
|
|
136
|
-
}
|
|
137
|
-
function loadValueText() {
|
|
138
|
-
return new Promise((resolve) => {
|
|
139
|
-
if (!props.value) {
|
|
140
|
-
selectedValue.value = [];
|
|
141
|
-
resolve([]);
|
|
142
|
-
} else {
|
|
143
|
-
let params = getQueryParams();
|
|
144
|
-
if (props.isNumber === true) {
|
|
145
|
-
params["condition"] = `${props.store} = ${props.value}`;
|
|
146
|
-
} else {
|
|
147
|
-
params["condition"] = `${props.store} = '${props.value}'`;
|
|
148
|
-
}
|
|
149
|
-
defHttp.get({ url: SELECT_OPTIONS_URL, params }, { isTransformResponse: false }).then((res) => {
|
|
150
|
-
if (res.success) {
|
|
151
|
-
resolve(res.result);
|
|
152
|
-
} else {
|
|
153
|
-
$message.warning("\u8054\u52A8\u7EC4\u4EF6\u6570\u636E\u52A0\u8F7D\u5931\u8D25,\u8BF7\u68C0\u67E5\u914D\u7F6E!");
|
|
154
|
-
resolve([]);
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
function getSelfOptions() {
|
|
161
|
-
return new Promise((resolve) => {
|
|
162
|
-
let index = 0;
|
|
163
|
-
(function next(index2) {
|
|
164
|
-
if (index2 > 10) {
|
|
165
|
-
resolve([]);
|
|
166
|
-
}
|
|
167
|
-
let arr = dictOptions.value;
|
|
168
|
-
if (arr && arr.length > 0) {
|
|
169
|
-
resolve(arr);
|
|
170
|
-
} else {
|
|
171
|
-
setTimeout(() => {
|
|
172
|
-
next(index2++);
|
|
173
|
-
}, 300);
|
|
174
|
-
}
|
|
175
|
-
})(index);
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
function valueChangeThenEmitNext(value, arr = []) {
|
|
179
|
-
if (value && value.length > 0) {
|
|
180
|
-
if (!arr || arr.length == 0) {
|
|
181
|
-
arr = dictOptions.value;
|
|
182
|
-
}
|
|
183
|
-
let selected = arr.filter((item) => item.store === value);
|
|
184
|
-
if (selected && selected.length > 0) {
|
|
185
|
-
let id = selected[0].id;
|
|
186
|
-
emit("next", id);
|
|
187
|
-
}
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
return {
|
|
191
|
-
selectedValue,
|
|
192
|
-
dictOptions,
|
|
193
|
-
handleChange
|
|
194
|
-
};
|
|
195
|
-
}
|
|
196
|
-
});
|
|
197
|
-
const _hoisted_1 = ["title"];
|
|
198
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
199
|
-
const _component_a_select_option = resolveComponent("a-select-option");
|
|
200
|
-
const _component_a_select = resolveComponent("a-select");
|
|
201
|
-
return openBlock(), createElementBlock(Fragment, null, [
|
|
202
|
-
createTextVNode(" 111 "),
|
|
203
|
-
createVNode(_component_a_select, {
|
|
204
|
-
placeholder: _ctx.placeholder,
|
|
205
|
-
value: _ctx.selectedValue,
|
|
206
|
-
onChange: _ctx.handleChange,
|
|
207
|
-
allowClear: "",
|
|
208
|
-
style: { "width": "100%" }
|
|
209
|
-
}, {
|
|
210
|
-
default: withCtx(() => [
|
|
211
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dictOptions, (item, index) => {
|
|
212
|
-
return openBlock(), createBlock(_component_a_select_option, {
|
|
213
|
-
key: index,
|
|
214
|
-
value: item.store
|
|
215
|
-
}, {
|
|
216
|
-
default: withCtx(() => [
|
|
217
|
-
createElementVNode("span", {
|
|
218
|
-
style: { "display": "inline-block", "width": "100%" },
|
|
219
|
-
title: item.label
|
|
220
|
-
}, toDisplayString(item.label), 9, _hoisted_1)
|
|
221
|
-
]),
|
|
222
|
-
_: 2
|
|
223
|
-
}, 1032, ["value"]);
|
|
224
|
-
}), 128))
|
|
225
|
-
]),
|
|
226
|
-
_: 1
|
|
227
|
-
}, 8, ["placeholder", "value", "onChange"])
|
|
228
|
-
], 64);
|
|
229
|
-
}
|
|
230
|
-
var OnlineSelectCascade = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
231
|
-
export { OnlineSelectCascade as default };
|