@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,413 @@
|
|
|
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
|
+
var __async = (__this, __arguments, generator) => {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
var fulfilled = (value) => {
|
|
20
|
+
try {
|
|
21
|
+
step(generator.next(value));
|
|
22
|
+
} catch (e) {
|
|
23
|
+
reject(e);
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
var rejected = (value) => {
|
|
27
|
+
try {
|
|
28
|
+
step(generator.throw(value));
|
|
29
|
+
} catch (e) {
|
|
30
|
+
reject(e);
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
34
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
import { defineComponent, ref, reactive, computed, resolveComponent, openBlock, createBlock, withCtx, createVNode, createElementBlock, createCommentVNode, normalizeProps, guardReactiveProps, createTextVNode, nextTick } from "vue";
|
|
38
|
+
import { u as useOnlineTest } from "./useOnlineTest.js";
|
|
39
|
+
import { useListPage } from "/@/hooks/system/useListPage";
|
|
40
|
+
import { BasicTable, TableAction } from "/@/components/Table";
|
|
41
|
+
import { BasicModal, useModalInner, useModal } from "/@/components/Modal";
|
|
42
|
+
import { BasicForm, useForm } from "/@/components/Form";
|
|
43
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
44
|
+
import { _ as _export_sfc } from "./index.js";
|
|
45
|
+
import "/@/hooks/web/useMessage";
|
|
46
|
+
import "/@/utils/cache";
|
|
47
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
48
|
+
import "vue-router";
|
|
49
|
+
const list = (code, params) => defHttp.get({ url: "/online/cgform/button/list/" + code, params });
|
|
50
|
+
function doBatchDelete(idList) {
|
|
51
|
+
return defHttp.delete({
|
|
52
|
+
url: "/online/cgform/button/deleteBatch",
|
|
53
|
+
params: {
|
|
54
|
+
ids: idList.join(",")
|
|
55
|
+
}
|
|
56
|
+
}, { joinParamsToUrl: true });
|
|
57
|
+
}
|
|
58
|
+
const saveOrUpdate = (params, isUpdate) => {
|
|
59
|
+
if (isUpdate) {
|
|
60
|
+
return defHttp.put({ url: "/online/cgform/button/edit", params });
|
|
61
|
+
} else {
|
|
62
|
+
return defHttp.post({ url: "/online/cgform/button/add", params });
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
const columns = [
|
|
66
|
+
{ title: "\u6309\u94AE\u7F16\u7801", align: "center", dataIndex: "buttonCode" },
|
|
67
|
+
{ title: "\u6309\u94AE\u540D\u79F0", align: "center", dataIndex: "buttonName" },
|
|
68
|
+
{
|
|
69
|
+
title: "\u6309\u94AE\u6837\u5F0F",
|
|
70
|
+
align: "center",
|
|
71
|
+
dataIndex: "buttonStyle",
|
|
72
|
+
customRender({ text, record }) {
|
|
73
|
+
if (text === "form") {
|
|
74
|
+
let p = record.optPosition;
|
|
75
|
+
return text + "(" + (p == "2" ? "\u5E95\u90E8" : "\u4FA7\u9762") + ")";
|
|
76
|
+
} else {
|
|
77
|
+
return text;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
{ title: "\u6309\u94AE\u7C7B\u578B", align: "center", dataIndex: "optType" },
|
|
82
|
+
{ title: "\u6392\u5E8F", align: "center", dataIndex: "orderNum" },
|
|
83
|
+
{ title: "\u6309\u94AE\u56FE\u6807", align: "center", dataIndex: "buttonIcon" },
|
|
84
|
+
{ title: "\u8868\u8FBE\u5F0F", align: "center", dataIndex: "exp" },
|
|
85
|
+
{
|
|
86
|
+
title: "\u6309\u94AE\u72B6\u6001",
|
|
87
|
+
align: "center",
|
|
88
|
+
dataIndex: "buttonStatus",
|
|
89
|
+
customRender({ text }) {
|
|
90
|
+
if (text == 1) {
|
|
91
|
+
return "\u6FC0\u6D3B";
|
|
92
|
+
} else {
|
|
93
|
+
return "\u672A\u6FC0\u6D3B";
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
];
|
|
98
|
+
const formSchemas = [
|
|
99
|
+
{
|
|
100
|
+
label: "\u6309\u94AE\u7F16\u7801",
|
|
101
|
+
field: "buttonCode",
|
|
102
|
+
component: "Input",
|
|
103
|
+
required: true
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
label: "\u6309\u94AE\u540D\u79F0",
|
|
107
|
+
field: "buttonName",
|
|
108
|
+
component: "Input",
|
|
109
|
+
required: true
|
|
110
|
+
},
|
|
111
|
+
{
|
|
112
|
+
label: "\u6309\u94AE\u6837\u5F0F",
|
|
113
|
+
field: "buttonStyle",
|
|
114
|
+
component: "Select",
|
|
115
|
+
componentProps: {
|
|
116
|
+
options: [
|
|
117
|
+
{ label: "Link", value: "link" },
|
|
118
|
+
{ label: "Button", value: "button" },
|
|
119
|
+
{ label: "Form", value: "form" }
|
|
120
|
+
]
|
|
121
|
+
},
|
|
122
|
+
defaultValue: "link"
|
|
123
|
+
},
|
|
124
|
+
{
|
|
125
|
+
label: "\u6309\u94AE\u4F4D\u7F6E",
|
|
126
|
+
field: "optPosition",
|
|
127
|
+
component: "Select",
|
|
128
|
+
componentProps: {
|
|
129
|
+
options: [
|
|
130
|
+
{ label: "\u4FA7\u9762", value: "1" },
|
|
131
|
+
{ label: "\u5E95\u90E8", value: "2" }
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
defaultValue: "2",
|
|
135
|
+
show: ({ model }) => model.buttonStyle === "form"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
label: "\u6309\u94AE\u7C7B\u578B",
|
|
139
|
+
field: "optType",
|
|
140
|
+
component: "Select",
|
|
141
|
+
componentProps: {
|
|
142
|
+
options: [
|
|
143
|
+
{ label: "Js", value: "js" },
|
|
144
|
+
{ label: "Action", value: "action" }
|
|
145
|
+
]
|
|
146
|
+
},
|
|
147
|
+
defaultValue: "js"
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
label: "\u6392\u5E8F",
|
|
151
|
+
field: "orderNum",
|
|
152
|
+
component: "InputNumber",
|
|
153
|
+
componentProps: {
|
|
154
|
+
style: "width: 100%"
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
label: "\u6309\u94AE\u56FE\u6807",
|
|
159
|
+
field: "buttonIcon",
|
|
160
|
+
component: "Input",
|
|
161
|
+
helpMessage: "a-icon type"
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
label: "\u8868\u8FBE\u5F0F",
|
|
165
|
+
field: "exp",
|
|
166
|
+
component: "Input"
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
label: "\u6309\u94AE\u72B6\u6001",
|
|
170
|
+
field: "buttonStatus",
|
|
171
|
+
component: "RadioButtonGroup",
|
|
172
|
+
componentProps: {
|
|
173
|
+
options: [
|
|
174
|
+
{ label: "\u6FC0\u6D3B", value: "1" },
|
|
175
|
+
{ label: "\u672A\u6FC0\u6D3B", value: "0" }
|
|
176
|
+
]
|
|
177
|
+
},
|
|
178
|
+
defaultValue: "1"
|
|
179
|
+
}
|
|
180
|
+
];
|
|
181
|
+
const _sfc_main = defineComponent({
|
|
182
|
+
name: "CustomButtonList",
|
|
183
|
+
components: { BasicModal, BasicTable, TableAction, BasicForm },
|
|
184
|
+
emits: ["register"],
|
|
185
|
+
setup() {
|
|
186
|
+
const code = ref("");
|
|
187
|
+
const { doRequest, doDeleteRecord, tableContext } = useListPage({
|
|
188
|
+
tableProps: {
|
|
189
|
+
api: (params) => list(code.value, params),
|
|
190
|
+
columns,
|
|
191
|
+
canResize: false,
|
|
192
|
+
useSearchForm: false,
|
|
193
|
+
beforeFetch(params) {
|
|
194
|
+
return Object.assign(params, { column: "orderNum", order: "asc" });
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
});
|
|
198
|
+
const [registerTable, { reload }, { rowSelection, selectedRowKeys }] = tableContext;
|
|
199
|
+
const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
|
|
200
|
+
code.value = data.row.id;
|
|
201
|
+
reload();
|
|
202
|
+
}));
|
|
203
|
+
const { aiTestMode, genButtons } = useOnlineTest({}, { reload }, null);
|
|
204
|
+
const [registerFormModal, formModal] = useModal();
|
|
205
|
+
const isUpdate = ref(false);
|
|
206
|
+
const formModalProps = reactive({
|
|
207
|
+
onRegister: registerFormModal,
|
|
208
|
+
title: computed(() => (isUpdate == null ? void 0 : isUpdate.value) ? "\u4FEE\u6539" : "\u65B0\u589E"),
|
|
209
|
+
width: 800,
|
|
210
|
+
confirmLoading: false,
|
|
211
|
+
onOk: onSubmit,
|
|
212
|
+
onCancel: formModal.closeModal
|
|
213
|
+
});
|
|
214
|
+
let formRecord = {};
|
|
215
|
+
const [registerForm, { resetFields, setFieldsValue, validate }] = useForm({
|
|
216
|
+
schemas: formSchemas,
|
|
217
|
+
showActionButtonGroup: false
|
|
218
|
+
});
|
|
219
|
+
function openFormModal(data) {
|
|
220
|
+
return __async(this, null, function* () {
|
|
221
|
+
var _a;
|
|
222
|
+
isUpdate.value = data.isUpdate;
|
|
223
|
+
formRecord = __spreadValues({}, (_a = data.record) != null ? _a : {});
|
|
224
|
+
formModal.openModal();
|
|
225
|
+
yield nextTick();
|
|
226
|
+
yield resetFields();
|
|
227
|
+
setFieldsValue(formRecord);
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
function onAdd() {
|
|
231
|
+
openFormModal({ isUpdate: false });
|
|
232
|
+
}
|
|
233
|
+
function onEdit(record) {
|
|
234
|
+
openFormModal({ isUpdate: true, record });
|
|
235
|
+
}
|
|
236
|
+
function onCancel() {
|
|
237
|
+
closeModal();
|
|
238
|
+
}
|
|
239
|
+
function onGenButtons() {
|
|
240
|
+
genButtons(code.value);
|
|
241
|
+
}
|
|
242
|
+
function onBatchDelete() {
|
|
243
|
+
return __async(this, null, function* () {
|
|
244
|
+
doRequest(() => doBatchDelete(selectedRowKeys.value));
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
function onSubmit() {
|
|
248
|
+
return __async(this, null, function* () {
|
|
249
|
+
try {
|
|
250
|
+
formModalProps.confirmLoading = true;
|
|
251
|
+
let values = yield validate();
|
|
252
|
+
values = Object.assign({ cgformHeadId: code.value }, formRecord, values);
|
|
253
|
+
yield saveOrUpdate(values, isUpdate.value);
|
|
254
|
+
reload();
|
|
255
|
+
formModal.closeModal();
|
|
256
|
+
} finally {
|
|
257
|
+
formModalProps.confirmLoading = false;
|
|
258
|
+
}
|
|
259
|
+
});
|
|
260
|
+
}
|
|
261
|
+
function getTableAction(record) {
|
|
262
|
+
return [
|
|
263
|
+
{
|
|
264
|
+
label: "\u7F16\u8F91",
|
|
265
|
+
onClick: () => onEdit(record)
|
|
266
|
+
}
|
|
267
|
+
];
|
|
268
|
+
}
|
|
269
|
+
function getDropDownAction(record) {
|
|
270
|
+
return [
|
|
271
|
+
{
|
|
272
|
+
label: "\u5220\u9664",
|
|
273
|
+
popConfirm: {
|
|
274
|
+
title: "\u786E\u5B9A\u5220\u9664\u5417\uFF1F",
|
|
275
|
+
placement: "left",
|
|
276
|
+
confirm: () => doDeleteRecord(() => doBatchDelete([record.id]))
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
];
|
|
280
|
+
}
|
|
281
|
+
return {
|
|
282
|
+
onAdd,
|
|
283
|
+
onBatchDelete,
|
|
284
|
+
aiTestMode,
|
|
285
|
+
onGenButtons,
|
|
286
|
+
registerModal,
|
|
287
|
+
registerTable,
|
|
288
|
+
selectedRowKeys,
|
|
289
|
+
rowSelection,
|
|
290
|
+
onCancel,
|
|
291
|
+
getTableAction,
|
|
292
|
+
getDropDownAction,
|
|
293
|
+
registerForm,
|
|
294
|
+
formModalProps
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
});
|
|
298
|
+
const _hoisted_1 = /* @__PURE__ */ createTextVNode("\u5173\u95ED");
|
|
299
|
+
const _hoisted_2 = {
|
|
300
|
+
key: 0,
|
|
301
|
+
style: { "float": "left" }
|
|
302
|
+
};
|
|
303
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u751F\u6210\u6D4B\u8BD5\u6570\u636E");
|
|
304
|
+
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u65B0\u589E");
|
|
305
|
+
const _hoisted_5 = /* @__PURE__ */ createTextVNode(" \u5220\u9664 ");
|
|
306
|
+
const _hoisted_6 = /* @__PURE__ */ createTextVNode(" \u6279\u91CF\u64CD\u4F5C ");
|
|
307
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
308
|
+
const _component_a_button = resolveComponent("a-button");
|
|
309
|
+
const _component_a_icon = resolveComponent("a-icon");
|
|
310
|
+
const _component_a_menu_item = resolveComponent("a-menu-item");
|
|
311
|
+
const _component_a_menu = resolveComponent("a-menu");
|
|
312
|
+
const _component_a_dropdown = resolveComponent("a-dropdown");
|
|
313
|
+
const _component_TableAction = resolveComponent("TableAction");
|
|
314
|
+
const _component_BasicTable = resolveComponent("BasicTable");
|
|
315
|
+
const _component_BasicForm = resolveComponent("BasicForm");
|
|
316
|
+
const _component_a_spin = resolveComponent("a-spin");
|
|
317
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
318
|
+
return openBlock(), createBlock(_component_BasicModal, {
|
|
319
|
+
onRegister: _ctx.registerModal,
|
|
320
|
+
title: "\u81EA\u5B9A\u4E49\u6309\u94AE",
|
|
321
|
+
width: 1200,
|
|
322
|
+
defaultFullscreen: "",
|
|
323
|
+
onCancel: _ctx.onCancel
|
|
324
|
+
}, {
|
|
325
|
+
footer: withCtx(() => [
|
|
326
|
+
createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
|
|
327
|
+
default: withCtx(() => [
|
|
328
|
+
_hoisted_1
|
|
329
|
+
]),
|
|
330
|
+
_: 1
|
|
331
|
+
}, 8, ["onClick"]),
|
|
332
|
+
_ctx.aiTestMode ? (openBlock(), createElementBlock("div", _hoisted_2, [
|
|
333
|
+
createVNode(_component_a_button, { onClick: _ctx.onGenButtons }, {
|
|
334
|
+
default: withCtx(() => [
|
|
335
|
+
_hoisted_3
|
|
336
|
+
]),
|
|
337
|
+
_: 1
|
|
338
|
+
}, 8, ["onClick"])
|
|
339
|
+
])) : createCommentVNode("", true)
|
|
340
|
+
]),
|
|
341
|
+
default: withCtx(() => [
|
|
342
|
+
createVNode(_component_BasicTable, {
|
|
343
|
+
onRegister: _ctx.registerTable,
|
|
344
|
+
rowSelection: _ctx.rowSelection
|
|
345
|
+
}, {
|
|
346
|
+
tableTitle: withCtx(() => [
|
|
347
|
+
createVNode(_component_a_button, {
|
|
348
|
+
onClick: _ctx.onAdd,
|
|
349
|
+
type: "primary",
|
|
350
|
+
preIcon: "ant-design:plus"
|
|
351
|
+
}, {
|
|
352
|
+
default: withCtx(() => [
|
|
353
|
+
_hoisted_4
|
|
354
|
+
]),
|
|
355
|
+
_: 1
|
|
356
|
+
}, 8, ["onClick"]),
|
|
357
|
+
_ctx.selectedRowKeys.length > 0 ? (openBlock(), createBlock(_component_a_dropdown, { key: 0 }, {
|
|
358
|
+
overlay: withCtx(() => [
|
|
359
|
+
createVNode(_component_a_menu, null, {
|
|
360
|
+
default: withCtx(() => [
|
|
361
|
+
createVNode(_component_a_menu_item, {
|
|
362
|
+
key: "1",
|
|
363
|
+
onClick: _ctx.onBatchDelete
|
|
364
|
+
}, {
|
|
365
|
+
default: withCtx(() => [
|
|
366
|
+
createVNode(_component_a_icon, { type: "delete" }),
|
|
367
|
+
_hoisted_5
|
|
368
|
+
]),
|
|
369
|
+
_: 1
|
|
370
|
+
}, 8, ["onClick"])
|
|
371
|
+
]),
|
|
372
|
+
_: 1
|
|
373
|
+
})
|
|
374
|
+
]),
|
|
375
|
+
default: withCtx(() => [
|
|
376
|
+
createVNode(_component_a_button, { style: { "margin-left": "8px" } }, {
|
|
377
|
+
default: withCtx(() => [
|
|
378
|
+
_hoisted_6,
|
|
379
|
+
createVNode(_component_a_icon, { type: "down" })
|
|
380
|
+
]),
|
|
381
|
+
_: 1
|
|
382
|
+
})
|
|
383
|
+
]),
|
|
384
|
+
_: 1
|
|
385
|
+
})) : createCommentVNode("", true)
|
|
386
|
+
]),
|
|
387
|
+
action: withCtx(({ record }) => [
|
|
388
|
+
createVNode(_component_TableAction, {
|
|
389
|
+
actions: _ctx.getTableAction(record),
|
|
390
|
+
dropDownActions: _ctx.getDropDownAction(record)
|
|
391
|
+
}, null, 8, ["actions", "dropDownActions"])
|
|
392
|
+
]),
|
|
393
|
+
_: 1
|
|
394
|
+
}, 8, ["onRegister", "rowSelection"]),
|
|
395
|
+
createVNode(_component_BasicModal, normalizeProps(guardReactiveProps(_ctx.formModalProps)), {
|
|
396
|
+
default: withCtx(() => [
|
|
397
|
+
createVNode(_component_a_spin, {
|
|
398
|
+
spinning: _ctx.formModalProps.confirmLoading
|
|
399
|
+
}, {
|
|
400
|
+
default: withCtx(() => [
|
|
401
|
+
createVNode(_component_BasicForm, { onRegister: _ctx.registerForm }, null, 8, ["onRegister"])
|
|
402
|
+
]),
|
|
403
|
+
_: 1
|
|
404
|
+
}, 8, ["spinning"])
|
|
405
|
+
]),
|
|
406
|
+
_: 1
|
|
407
|
+
}, 16)
|
|
408
|
+
]),
|
|
409
|
+
_: 1
|
|
410
|
+
}, 8, ["onRegister", "onCancel"]);
|
|
411
|
+
}
|
|
412
|
+
var CustomButtonList = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
413
|
+
export { CustomButtonList as default };
|
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
import { defineComponent, getCurrentInstance, ref, resolveComponent, openBlock, createBlock } from "vue";
|
|
21
|
+
import { JVxeTypes } from "/@/components/jeecg/JVxeTable/types";
|
|
22
|
+
import { u as useTableSync } from "./useTableSync.js";
|
|
23
|
+
import { _ as _export_sfc } from "./index.js";
|
|
24
|
+
import "./cgform.data.js";
|
|
25
|
+
import "/@/utils/dict";
|
|
26
|
+
import "/@/utils/dict/JDictSelectUtil";
|
|
27
|
+
import "/@/utils/uuid";
|
|
28
|
+
import "./pick.js";
|
|
29
|
+
import "./isArray.js";
|
|
30
|
+
import "./toString.js";
|
|
31
|
+
import "./_arrayPush.js";
|
|
32
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
33
|
+
import "/@/hooks/web/useMessage";
|
|
34
|
+
import "vue-router";
|
|
35
|
+
const MySQLKeywords = ["ADD", "ALL", "ALTER", "ANALYZE", "AND", "AS", "ASC", "ASENSITIVE", "BEFORE", "BETWEEN", "BIGINT", "BINARY", "BLOB", "BOTH", "BY", "CALL", "CASCADE", "CASE", "CHANGE", "CHAR", "CHARACTER", "CHECK", "COLLATE", "COLUMN", "CONDITION", "CONNECTION", "CONSTRAINT", "CONTINUE", "CONVERT", "CREATE", "CROSS", "CURRENT_DATE", "CURRENT_TIME", "CURRENT_TIMESTAMP", "CURRENT_USER", "CURSOR", "DATABASE", "DATABASES", "DAY_HOUR", "DAY_MICROSECOND", "DAY_MINUTE", "DAY_SECOND", "DEC", "DECIMAL", "DECLARE", "DEFAULT", "DELAYED", "DELETE", "DESC", "DESCRIBE", "DETERMINISTIC", "DISTINCT", "DISTINCTROW", "DIV", "DOUBLE", "DROP", "DUAL", "EACH", "ELSE", "ELSEIF", "ENCLOSED", "ESCAPED", "EXISTS", "EXIT", "EXPLAIN", "FALSE", "FETCH", "FLOAT", "FLOAT4", "FLOAT8", "FOR", "FORCE", "FOREIGN", "FROM", "FULLTEXT", "GOTO", "GRANT", "GROUP", "HAVING", "HIGH_PRIORITY", "HOUR_MICROSECOND", "HOUR_MINUTE", "HOUR_SECOND", "IF", "IGNORE", "IN", "INDEX", "INFILE", "INNER", "INOUT", "INSENSITIVE", "INSERT", "INT", "INT1", "INT2", "INT3", "INT4", "INT8", "INTEGER", "INTERVAL", "INTO", "IS", "ITERATE", "JOIN", "KEY", "KEYS", "KILL", "LABEL", "LEADING", "LEAVE", "LEFT", "LIKE", "LIMIT", "LINEAR", "LINES", "LOAD", "LOCALTIME", "LOCALTIMESTAMP", "LOCK", "LONG", "LONGBLOB", "LONGTEXT", "LOOP", "LOW_PRIORITY", "MATCH", "MEDIUMBLOB", "MEDIUMINT", "MEDIUMTEXT", "MIDDLEINT", "MINUTE_MICROSECOND", "MINUTE_SECOND", "MOD", "MODIFIES", "NATURAL", "NOT", "NO_WRITE_TO_BINLOG", "NULL", "NUMERIC", "ON", "OPTIMIZE", "OPTION", "OPTIONALLY", "OR", "ORDER", "OUT", "OUTER", "OUTFILE", "PRECISION", "PRIMARY", "PROCEDURE", "PURGE", "RAID0", "RANGE", "READ", "READS", "REAL", "REFERENCES", "REGEXP", "RELEASE", "RENAME", "REPEAT", "REPLACE", "REQUIRE", "RESTRICT", "RETURN", "REVOKE", "RIGHT", "RLIKE", "SCHEMA", "SCHEMAS", "SECOND_MICROSECOND", "SELECT", "SENSITIVE", "SEPARATOR", "SET", "SHOW", "SMALLINT", "SPATIAL", "SPECIFIC", "SQL", "SQLEXCEPTION", "SQLSTATE", "SQLWARNING", "SQL_BIG_RESULT", "SQL_CALC_FOUND_ROWS", "SQL_SMALL_RESULT", "SSL", "STARTING", "STRAIGHT_JOIN", "TABLE", "TERMINATED", "THEN", "TINYBLOB", "TINYINT", "TINYTEXT", "TO", "TRAILING", "TRIGGER", "TRUE", "UNDO", "UNION", "UNIQUE", "UNLOCK", "UNSIGNED", "UPDATE", "USAGE", "USE", "USING", "UTC_DATE", "UTC_TIME", "UTC_TIMESTAMP", "VALUES", "VARBINARY", "VARCHAR", "VARCHARACTER", "VARYING", "WHEN", "WHERE", "WHILE", "WITH", "WRITE", "X509", "XOR", "YEAR_MONTH", "ZEROFILL"];
|
|
36
|
+
const _sfc_main = defineComponent({
|
|
37
|
+
name: "DBAttributeTable",
|
|
38
|
+
props: {
|
|
39
|
+
actionButton: { type: Boolean, default: true }
|
|
40
|
+
},
|
|
41
|
+
emits: ["added", "removed", "inserted", "dragged", "syncDbType"],
|
|
42
|
+
setup(props, { emit }) {
|
|
43
|
+
const instance = getCurrentInstance();
|
|
44
|
+
const addBatching = ref(false);
|
|
45
|
+
const columns = ref([
|
|
46
|
+
{
|
|
47
|
+
title: "\u5B57\u6BB5\u540D\u79F0",
|
|
48
|
+
key: "dbFieldName",
|
|
49
|
+
width: 140,
|
|
50
|
+
type: JVxeTypes.input,
|
|
51
|
+
defaultValue: "",
|
|
52
|
+
placeholder: "\u8BF7\u8F93\u5165${title}",
|
|
53
|
+
validateRules: [
|
|
54
|
+
{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" },
|
|
55
|
+
{
|
|
56
|
+
pattern: /^[a-zA-Z]{1}(?!_)[a-zA-Z0-9_\\$]+$/,
|
|
57
|
+
message: "\u547D\u540D\u89C4\u5219\uFF1A\u53EA\u80FD\u7531\u5B57\u6BCD\u3001\u6570\u5B57\u3001\u4E0B\u5212\u7EBF\u3001$\u7B26\u53F7\u7EC4\u6210\uFF1B\u5FC5\u987B\u4EE5\u5B57\u6BCD\u5F00\u5934\uFF1B\u4E0D\u80FD\u4EE5\u5355\u4E2A\u5B57\u6BCD\u52A0\u4E0B\u6ED1\u7EBF\u5F00\u5934"
|
|
58
|
+
},
|
|
59
|
+
{ unique: true, message: "${title}\u4E0D\u80FD\u91CD\u590D" },
|
|
60
|
+
{
|
|
61
|
+
handler({ cellValue }, callback) {
|
|
62
|
+
if (MySQLKeywords.includes(cellValue.toUpperCase())) {
|
|
63
|
+
callback(false, cellValue + "\u662F\u5173\u952E\u5B57\uFF0C\u4E0D\u80FD\u4F5C\u4E3A\u5B57\u6BB5\u540D\u79F0\u4F7F\u7528\uFF01");
|
|
64
|
+
} else {
|
|
65
|
+
callback(true);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
{ handler: validateExistIndex }
|
|
70
|
+
],
|
|
71
|
+
disabled: !props.actionButton
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
title: "\u5B57\u6BB5\u5907\u6CE8",
|
|
75
|
+
key: "dbFieldTxt",
|
|
76
|
+
width: 140,
|
|
77
|
+
type: JVxeTypes.input,
|
|
78
|
+
defaultValue: "",
|
|
79
|
+
placeholder: "\u8BF7\u8F93\u5165${title}",
|
|
80
|
+
validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }]
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
title: "\u5B57\u6BB5\u957F\u5EA6",
|
|
84
|
+
key: "dbLength",
|
|
85
|
+
width: 120,
|
|
86
|
+
type: JVxeTypes.inputNumber,
|
|
87
|
+
defaultValue: 32,
|
|
88
|
+
placeholder: "\u8BF7\u8F93\u5165${title}",
|
|
89
|
+
validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }],
|
|
90
|
+
disabled: !props.actionButton
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
title: "\u5C0F\u6570\u70B9",
|
|
94
|
+
key: "dbPointLength",
|
|
95
|
+
width: 100,
|
|
96
|
+
type: JVxeTypes.inputNumber,
|
|
97
|
+
defaultValue: 0,
|
|
98
|
+
placeholder: "\u8BF7\u8F93\u5165${title}",
|
|
99
|
+
validateRules: [{ required: true, message: "${title}\u4E0D\u80FD\u4E3A\u7A7A" }],
|
|
100
|
+
disabled: !props.actionButton
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
title: "\u9ED8\u8BA4\u503C",
|
|
104
|
+
key: "dbDefaultVal",
|
|
105
|
+
width: 140,
|
|
106
|
+
type: JVxeTypes.input,
|
|
107
|
+
defaultValue: "",
|
|
108
|
+
disabled: !props.actionButton
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
title: "\u5B57\u6BB5\u7C7B\u578B",
|
|
112
|
+
key: "dbType",
|
|
113
|
+
width: 140,
|
|
114
|
+
type: JVxeTypes.select,
|
|
115
|
+
options: [
|
|
116
|
+
{ title: "String", value: "string" },
|
|
117
|
+
{ title: "Integer", value: "int" },
|
|
118
|
+
{ title: "Double", value: "double" },
|
|
119
|
+
{ title: "Date", value: "Date" },
|
|
120
|
+
{ title: "Datetime", value: "Datetime" },
|
|
121
|
+
{ title: "BigDecimal", value: "BigDecimal" },
|
|
122
|
+
{ title: "Text", value: "Text" },
|
|
123
|
+
{ title: "Blob", value: "Blob" }
|
|
124
|
+
],
|
|
125
|
+
defaultValue: "string",
|
|
126
|
+
placeholder: "\u8BF7\u9009\u62E9${title}",
|
|
127
|
+
disabled: !props.actionButton,
|
|
128
|
+
validateRules: [
|
|
129
|
+
{ required: true, message: "\u8BF7\u9009\u62E9${title}" }
|
|
130
|
+
]
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
title: "\u4E3B\u952E",
|
|
134
|
+
key: "dbIsKey",
|
|
135
|
+
width: 80,
|
|
136
|
+
type: JVxeTypes.checkbox,
|
|
137
|
+
align: "center",
|
|
138
|
+
customValue: ["1", "0"],
|
|
139
|
+
defaultChecked: false,
|
|
140
|
+
disabled: !props.actionButton
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
title: "\u5141\u8BB8\u7A7A\u503C",
|
|
144
|
+
key: "dbIsNull",
|
|
145
|
+
minWidth: 80,
|
|
146
|
+
type: JVxeTypes.checkbox,
|
|
147
|
+
customValue: ["1", "0"],
|
|
148
|
+
defaultChecked: true,
|
|
149
|
+
disabled: !props.actionButton
|
|
150
|
+
},
|
|
151
|
+
{ title: "orderNum", key: "orderNum", type: JVxeTypes.hidden }
|
|
152
|
+
]);
|
|
153
|
+
let removeIds = [];
|
|
154
|
+
const setup = useTableSync(columns);
|
|
155
|
+
const { tableRef, loading, dataSource, tableHeight, setDataSource, validateData } = setup;
|
|
156
|
+
function handleAdded() {
|
|
157
|
+
emit("added", instance);
|
|
158
|
+
}
|
|
159
|
+
function handleRemoved(event) {
|
|
160
|
+
removeIds = removeIds.concat(event.deleteRows.map((r) => r.id));
|
|
161
|
+
emit("removed", __spreadProps(__spreadValues({}, event), { removeIds, target: instance }));
|
|
162
|
+
}
|
|
163
|
+
function handleDragged(event) {
|
|
164
|
+
emit("dragged", {
|
|
165
|
+
oldIndex: event.oldIndex,
|
|
166
|
+
newIndex: event.newIndex,
|
|
167
|
+
target: instance
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function handleInserted(event) {
|
|
171
|
+
emit("inserted", __spreadProps(__spreadValues({}, event), { target: instance }));
|
|
172
|
+
}
|
|
173
|
+
function getRemoveIds() {
|
|
174
|
+
return removeIds;
|
|
175
|
+
}
|
|
176
|
+
function handleValueChange(event) {
|
|
177
|
+
let { type, row, col, value, target } = event;
|
|
178
|
+
if (type === JVxeTypes.select && col.key === "dbType") {
|
|
179
|
+
if (value === "Date" || value === "Datetime") {
|
|
180
|
+
emit("syncDbType", { row, value, target: instance });
|
|
181
|
+
}
|
|
182
|
+
if (value === "Blob" || value === "Text" || value === "Date") {
|
|
183
|
+
target.ctx.setValues([{ rowKey: row.id, values: { dbLength: "0" } }]);
|
|
184
|
+
} else if (value === "int" || value === "double" || value === "BigDecimal") {
|
|
185
|
+
target.ctx.setValues([{ rowKey: row.id, values: { dbLength: "10" } }]);
|
|
186
|
+
} else if (row["dbLength"] === "0") {
|
|
187
|
+
target.ctx.setValues([{ rowKey: row.id, values: { dbLength: "32" } }]);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
function tableAddLine(newLine) {
|
|
192
|
+
tableRef.value.pushRows(newLine);
|
|
193
|
+
if (!addBatching.value) {
|
|
194
|
+
emit("added", instance);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
function tableDeleteLines(ids) {
|
|
198
|
+
return tableRef.value.removeRowsById(ids);
|
|
199
|
+
}
|
|
200
|
+
function addBatchBegin() {
|
|
201
|
+
addBatching.value = true;
|
|
202
|
+
loading.value = true;
|
|
203
|
+
}
|
|
204
|
+
function addBatchEnd() {
|
|
205
|
+
addBatching.value = false;
|
|
206
|
+
loading.value = false;
|
|
207
|
+
emit("added", instance);
|
|
208
|
+
}
|
|
209
|
+
function validateExistIndex({ cellValue, row }, callback) {
|
|
210
|
+
const { tables } = setup;
|
|
211
|
+
if (tables) {
|
|
212
|
+
let dataSource2 = tables.dbTable.value.tableRef.dataSource;
|
|
213
|
+
let temp = dataSource2.filter((item) => item.id === row.id);
|
|
214
|
+
if (!temp || temp.length <= 0) {
|
|
215
|
+
callback(true);
|
|
216
|
+
}
|
|
217
|
+
let dbFieldName = temp[0]["dbFieldName"];
|
|
218
|
+
if (dbFieldName == cellValue) {
|
|
219
|
+
callback(true);
|
|
220
|
+
}
|
|
221
|
+
let arr = tables.idxTable.value.tableRef.getTableData();
|
|
222
|
+
for (let item of arr) {
|
|
223
|
+
let indexField = item.indexField;
|
|
224
|
+
let indexFieldArray = indexField.split(",");
|
|
225
|
+
if (indexFieldArray.indexOf(dbFieldName) >= 0) {
|
|
226
|
+
callback(false, "\u5F53\u524D\u5B57\u6BB5\u5B58\u5728\u7D22\u5F15\u914D\u7F6E\uFF0C\u8BF7\u5148\u5220\u9664\u7D22\u5F15\u518D\u4FEE\u6539\u5B57\u6BB5");
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
callback(true);
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
tableRef,
|
|
234
|
+
loading,
|
|
235
|
+
columns,
|
|
236
|
+
dataSource,
|
|
237
|
+
setDataSource,
|
|
238
|
+
addBatchBegin,
|
|
239
|
+
addBatchEnd,
|
|
240
|
+
tableAddLine,
|
|
241
|
+
tableHeight,
|
|
242
|
+
tableDeleteLines,
|
|
243
|
+
handleAdded,
|
|
244
|
+
handleRemoved,
|
|
245
|
+
handleDragged,
|
|
246
|
+
handleInserted,
|
|
247
|
+
handleValueChange,
|
|
248
|
+
validateData,
|
|
249
|
+
getRemoveIds,
|
|
250
|
+
validateExistIndex
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
255
|
+
const _component_JVxeTable = resolveComponent("JVxeTable");
|
|
256
|
+
return openBlock(), createBlock(_component_JVxeTable, {
|
|
257
|
+
ref: "tableRef",
|
|
258
|
+
rowNumber: "",
|
|
259
|
+
rowSelection: "",
|
|
260
|
+
dragSort: "",
|
|
261
|
+
keyboardEdit: "",
|
|
262
|
+
sortKey: "orderNum",
|
|
263
|
+
addButtonSettings: "",
|
|
264
|
+
loading: _ctx.loading,
|
|
265
|
+
columns: _ctx.columns,
|
|
266
|
+
dataSource: _ctx.dataSource,
|
|
267
|
+
toolbar: _ctx.actionButton,
|
|
268
|
+
maxHeight: _ctx.tableHeight.normal,
|
|
269
|
+
disabledRows: { dbFieldName: ["id", "has_child"] },
|
|
270
|
+
onAdded: _ctx.handleAdded,
|
|
271
|
+
onRemoved: _ctx.handleRemoved,
|
|
272
|
+
onDragged: _ctx.handleDragged,
|
|
273
|
+
onInserted: _ctx.handleInserted,
|
|
274
|
+
onValueChange: _ctx.handleValueChange
|
|
275
|
+
}, null, 8, ["loading", "columns", "dataSource", "toolbar", "maxHeight", "onAdded", "onRemoved", "onDragged", "onInserted", "onValueChange"]);
|
|
276
|
+
}
|
|
277
|
+
var DBAttributeTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
278
|
+
export { DBAttributeTable as default };
|