@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,231 @@
|
|
|
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 { formatToDate } from "/@/utils/dateUtil";
|
|
38
|
+
import { defineComponent, ref, nextTick, resolveComponent, openBlock, createBlock, withCtx, createVNode, normalizeClass, createElementVNode, toDisplayString, createTextVNode } from "vue";
|
|
39
|
+
import { BasicModal, useModalInner } from "/@/components/Modal";
|
|
40
|
+
import { JCodeEditor } from "/@/components/Form";
|
|
41
|
+
import "/@/store";
|
|
42
|
+
import { defineStore } from "pinia";
|
|
43
|
+
import { createLocalStorage } from "/@/utils/cache";
|
|
44
|
+
import { _ as _export_sfc } from "./index.js";
|
|
45
|
+
const ls = createLocalStorage();
|
|
46
|
+
const ENHANCE_PRE = "enhance_";
|
|
47
|
+
const useEnhanceStore = defineStore({
|
|
48
|
+
id: "online-cgform-enhance",
|
|
49
|
+
state: () => ({
|
|
50
|
+
enhanceJs: {}
|
|
51
|
+
}),
|
|
52
|
+
getters: {},
|
|
53
|
+
actions: {
|
|
54
|
+
getEnhanceJs(code) {
|
|
55
|
+
this.enhanceJs[code] = ls.get(ENHANCE_PRE + code);
|
|
56
|
+
return this.enhanceJs[code];
|
|
57
|
+
},
|
|
58
|
+
addEnhanceJs(record) {
|
|
59
|
+
if (!this.enhanceJs[record.code]) {
|
|
60
|
+
this.enhanceJs[record.code] = [__spreadValues({}, record)];
|
|
61
|
+
} else {
|
|
62
|
+
this.enhanceJs[record.code].push(__spreadValues({}, record));
|
|
63
|
+
}
|
|
64
|
+
let enhanceJsArray = this.enhanceJs[record.code];
|
|
65
|
+
while (enhanceJsArray.length > 16) {
|
|
66
|
+
enhanceJsArray.shift();
|
|
67
|
+
}
|
|
68
|
+
ls.set(ENHANCE_PRE + record.code, enhanceJsArray);
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
var EnhanceJsHistory_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
73
|
+
const _sfc_main = defineComponent({
|
|
74
|
+
name: "EnhanceJsHistory",
|
|
75
|
+
components: { BasicModal, JCodeEditor },
|
|
76
|
+
setup() {
|
|
77
|
+
const enhanceStore = useEnhanceStore();
|
|
78
|
+
const codeEditorRef = ref();
|
|
79
|
+
const confirmLoading = ref(false);
|
|
80
|
+
const dataList = ref([]);
|
|
81
|
+
const jsStr = ref("");
|
|
82
|
+
const activeIndex = ref(0);
|
|
83
|
+
const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
|
|
84
|
+
show(data.code, data.type);
|
|
85
|
+
}));
|
|
86
|
+
function show(code, type) {
|
|
87
|
+
jsStr.value = "";
|
|
88
|
+
dataList.value = [];
|
|
89
|
+
let arr = enhanceStore.getEnhanceJs(code);
|
|
90
|
+
let ls2 = [];
|
|
91
|
+
let index = 0;
|
|
92
|
+
for (let item of arr) {
|
|
93
|
+
if (item.type === type) {
|
|
94
|
+
index++;
|
|
95
|
+
ls2.push(Object.assign({}, item, { index }));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
if (ls2 && ls2.length > 0) {
|
|
99
|
+
ls2.sort((a, b) => {
|
|
100
|
+
return b.date - a.date;
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
dataList.value = [...ls2];
|
|
104
|
+
nextTick(() => fullCode(ls2[0]));
|
|
105
|
+
}
|
|
106
|
+
function onCancel() {
|
|
107
|
+
closeModal();
|
|
108
|
+
}
|
|
109
|
+
function getFormatDate(date) {
|
|
110
|
+
return formatToDate(date, "yyyy-MM-DD HH:mm:ss");
|
|
111
|
+
}
|
|
112
|
+
function fullCode(item) {
|
|
113
|
+
activeIndex.value = item.index;
|
|
114
|
+
codeEditorRef.value.setValue(item.str);
|
|
115
|
+
}
|
|
116
|
+
return {
|
|
117
|
+
codeEditorRef,
|
|
118
|
+
fullCode,
|
|
119
|
+
registerModal,
|
|
120
|
+
getFormatDate,
|
|
121
|
+
onCancel,
|
|
122
|
+
confirmLoading,
|
|
123
|
+
dataList,
|
|
124
|
+
jsStr,
|
|
125
|
+
activeIndex
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const _hoisted_1 = /* @__PURE__ */ createTextVNode("\u4FDD\u5B58\u65F6\u95F4");
|
|
130
|
+
const _hoisted_2 = ["onClick"];
|
|
131
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u5173\u95ED");
|
|
132
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
133
|
+
const _component_a_divider = resolveComponent("a-divider");
|
|
134
|
+
const _component_a_list_item = resolveComponent("a-list-item");
|
|
135
|
+
const _component_a_list = resolveComponent("a-list");
|
|
136
|
+
const _component_a_layout_sider = resolveComponent("a-layout-sider");
|
|
137
|
+
const _component_JCodeEditor = resolveComponent("JCodeEditor");
|
|
138
|
+
const _component_a_layout_content = resolveComponent("a-layout-content");
|
|
139
|
+
const _component_a_layout = resolveComponent("a-layout");
|
|
140
|
+
const _component_a_spin = resolveComponent("a-spin");
|
|
141
|
+
const _component_a_button = resolveComponent("a-button");
|
|
142
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
143
|
+
return openBlock(), createBlock(_component_BasicModal, {
|
|
144
|
+
onRegister: _ctx.registerModal,
|
|
145
|
+
title: "JS\u589E\u5F3A\u5386\u53F2\u8BB0\u5F55",
|
|
146
|
+
width: 1200,
|
|
147
|
+
maskClosable: false,
|
|
148
|
+
confirmLoading: _ctx.confirmLoading,
|
|
149
|
+
defaultFullscreen: "",
|
|
150
|
+
onCancel: _ctx.onCancel
|
|
151
|
+
}, {
|
|
152
|
+
footer: withCtx(() => [
|
|
153
|
+
createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
|
|
154
|
+
default: withCtx(() => [
|
|
155
|
+
_hoisted_3
|
|
156
|
+
]),
|
|
157
|
+
_: 1
|
|
158
|
+
}, 8, ["onClick"])
|
|
159
|
+
]),
|
|
160
|
+
default: withCtx(() => [
|
|
161
|
+
createVNode(_component_a_spin, { spinning: _ctx.confirmLoading }, {
|
|
162
|
+
default: withCtx(() => [
|
|
163
|
+
createVNode(_component_a_layout, null, {
|
|
164
|
+
default: withCtx(() => [
|
|
165
|
+
createVNode(_component_a_layout_sider, { theme: "light" }, {
|
|
166
|
+
default: withCtx(() => [
|
|
167
|
+
createVNode(_component_a_list, {
|
|
168
|
+
bordered: "",
|
|
169
|
+
dataSource: _ctx.dataList,
|
|
170
|
+
class: normalizeClass("enhance-list")
|
|
171
|
+
}, {
|
|
172
|
+
header: withCtx(() => [
|
|
173
|
+
createElementVNode("div", null, [
|
|
174
|
+
createVNode(_component_a_divider, { style: { "margin": "0" } }, {
|
|
175
|
+
default: withCtx(() => [
|
|
176
|
+
_hoisted_1
|
|
177
|
+
]),
|
|
178
|
+
_: 1
|
|
179
|
+
})
|
|
180
|
+
])
|
|
181
|
+
]),
|
|
182
|
+
renderItem: withCtx(({ item }) => [
|
|
183
|
+
createVNode(_component_a_list_item, {
|
|
184
|
+
class: normalizeClass(_ctx.activeIndex === item.index ? "bg-blue" : "")
|
|
185
|
+
}, {
|
|
186
|
+
default: withCtx(() => [
|
|
187
|
+
createElementVNode("a", {
|
|
188
|
+
onClick: ($event) => _ctx.fullCode(item)
|
|
189
|
+
}, toDisplayString(_ctx.getFormatDate(item.date)), 9, _hoisted_2)
|
|
190
|
+
]),
|
|
191
|
+
_: 2
|
|
192
|
+
}, 1032, ["class"])
|
|
193
|
+
]),
|
|
194
|
+
_: 1
|
|
195
|
+
}, 8, ["dataSource"])
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
}),
|
|
199
|
+
createVNode(_component_a_layout, null, {
|
|
200
|
+
default: withCtx(() => [
|
|
201
|
+
createVNode(_component_a_layout_content, { style: { margin: "8px 8px", padding: "8px", background: "#fff", minHeight: "280px" } }, {
|
|
202
|
+
default: withCtx(() => [
|
|
203
|
+
createVNode(_component_JCodeEditor, {
|
|
204
|
+
ref: "codeEditorRef",
|
|
205
|
+
language: "javascript",
|
|
206
|
+
fullScreen: true,
|
|
207
|
+
lineNumbers: false,
|
|
208
|
+
"language-change": false
|
|
209
|
+
}, null, 512)
|
|
210
|
+
]),
|
|
211
|
+
_: 1
|
|
212
|
+
})
|
|
213
|
+
]),
|
|
214
|
+
_: 1
|
|
215
|
+
})
|
|
216
|
+
]),
|
|
217
|
+
_: 1
|
|
218
|
+
})
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["spinning"])
|
|
222
|
+
]),
|
|
223
|
+
_: 1
|
|
224
|
+
}, 8, ["onRegister", "confirmLoading", "onCancel"]);
|
|
225
|
+
}
|
|
226
|
+
var EnhanceJsHistory = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-3b0bad10"]]);
|
|
227
|
+
var EnhanceJsHistory$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
228
|
+
__proto__: null,
|
|
229
|
+
"default": EnhanceJsHistory
|
|
230
|
+
}, Symbol.toStringTag, { value: "Module" }));
|
|
231
|
+
export { EnhanceJsHistory as E, EnhanceJsHistory$1 as a, useEnhanceStore as u };
|
|
@@ -0,0 +1,293 @@
|
|
|
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, reactive, resolveComponent, openBlock, createBlock, withCtx, createVNode, createCommentVNode, createTextVNode } from "vue";
|
|
22
|
+
import { BasicModal, useModalInner, useModal } from "/@/components/Modal";
|
|
23
|
+
import { JCodeEditor } from "/@/components/Form";
|
|
24
|
+
import { u as useOnlineTest } from "./useOnlineTest.js";
|
|
25
|
+
import { E as EnhanceJsHistory, u as useEnhanceStore } from "./EnhanceJsHistory.js";
|
|
26
|
+
import { g as getEnhanceJsByCode, s as saveEnhanceJs } from "./enhance.api.js";
|
|
27
|
+
import { useMessage } from "/@/hooks/web/useMessage";
|
|
28
|
+
import { _ as _export_sfc } from "./index.js";
|
|
29
|
+
import "/@/utils/http/axios";
|
|
30
|
+
import "/@/utils/cache";
|
|
31
|
+
import "/@/utils/dateUtil";
|
|
32
|
+
import "/@/store";
|
|
33
|
+
import "pinia";
|
|
34
|
+
import "/@/utils/is";
|
|
35
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
36
|
+
import "vue-router";
|
|
37
|
+
const _sfc_main = defineComponent({
|
|
38
|
+
name: "EnhanceJs",
|
|
39
|
+
components: { BasicModal, JCodeEditor, EnhanceJsHistory },
|
|
40
|
+
emits: ["register"],
|
|
41
|
+
setup() {
|
|
42
|
+
const { createMessage: $message } = useMessage();
|
|
43
|
+
const enhanceStore = useEnhanceStore();
|
|
44
|
+
const formEditorRef = ref();
|
|
45
|
+
const listEditorRef = ref();
|
|
46
|
+
const models = reactive({ form: {}, list: {} });
|
|
47
|
+
const enhanceType = ref("list");
|
|
48
|
+
const code = ref("");
|
|
49
|
+
const showHistory = ref(false);
|
|
50
|
+
const codeChange = ref(false);
|
|
51
|
+
const tableName = ref("");
|
|
52
|
+
const enhanceValues = reactive({ form: "", list: "" });
|
|
53
|
+
const getFlag = { form: false, list: false };
|
|
54
|
+
const reloading = ref(false);
|
|
55
|
+
const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
|
|
56
|
+
show(data.row);
|
|
57
|
+
}));
|
|
58
|
+
const [registerEnhanceJsHistory, enhanceJsHistory] = useModal();
|
|
59
|
+
const { aiTestMode, genEnhanceJsData } = useOnlineTest({}, {}, null);
|
|
60
|
+
function show(row) {
|
|
61
|
+
code.value = row.id;
|
|
62
|
+
codeChange.value = false;
|
|
63
|
+
tableName.value = row.tableName;
|
|
64
|
+
let enhances = enhanceStore.getEnhanceJs(code.value);
|
|
65
|
+
if ((enhances == null ? void 0 : enhances.length) > 0) {
|
|
66
|
+
enhanceType.value = enhances[enhances.length - 1].type;
|
|
67
|
+
showHistory.value = true;
|
|
68
|
+
} else {
|
|
69
|
+
showHistory.value = false;
|
|
70
|
+
}
|
|
71
|
+
getFlag.form = false;
|
|
72
|
+
getFlag.list = false;
|
|
73
|
+
if (!enhanceType.value) {
|
|
74
|
+
onChangeType("form");
|
|
75
|
+
} else {
|
|
76
|
+
onChangeType(enhanceType.value);
|
|
77
|
+
}
|
|
78
|
+
reloading.value = true;
|
|
79
|
+
setTimeout(() => reloading.value = false, 150);
|
|
80
|
+
}
|
|
81
|
+
function onSubmit() {
|
|
82
|
+
return __async(this, null, function* () {
|
|
83
|
+
yield Promise.all([
|
|
84
|
+
saveEnhanceJsByType("form"),
|
|
85
|
+
saveEnhanceJsByType("list")
|
|
86
|
+
]);
|
|
87
|
+
closeModal();
|
|
88
|
+
$message.success("\u4FDD\u5B58\u6210\u529F");
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
function saveEnhanceJsByType(type) {
|
|
92
|
+
return __async(this, null, function* () {
|
|
93
|
+
let model = models[type];
|
|
94
|
+
let params = {
|
|
95
|
+
cgJs: enhanceValues[type],
|
|
96
|
+
cgJsType: type
|
|
97
|
+
};
|
|
98
|
+
if (!getFlag[type] || model.cgJs === params.cgJs) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
let isUpdate = !!model.id;
|
|
102
|
+
if (isUpdate) {
|
|
103
|
+
params = Object.assign({}, model, params);
|
|
104
|
+
}
|
|
105
|
+
yield saveEnhanceJs(code.value, params, isUpdate);
|
|
106
|
+
enhanceStore.addEnhanceJs({
|
|
107
|
+
code: code.value,
|
|
108
|
+
str: params.cgJs,
|
|
109
|
+
type: params.cgJsType,
|
|
110
|
+
date: new Date().getTime()
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
function onCancel() {
|
|
115
|
+
closeModal();
|
|
116
|
+
}
|
|
117
|
+
function onChangeType(type) {
|
|
118
|
+
return __async(this, null, function* () {
|
|
119
|
+
enhanceType.value = type;
|
|
120
|
+
try {
|
|
121
|
+
if (!getFlag[type]) {
|
|
122
|
+
let result = yield getEnhanceJsByCode(code.value, type);
|
|
123
|
+
Object.assign(models[type], { id: null }, result);
|
|
124
|
+
enhanceValues[type] = models[type].cgJs;
|
|
125
|
+
getFlag[type] = true;
|
|
126
|
+
}
|
|
127
|
+
} catch (e) {
|
|
128
|
+
console.error(e);
|
|
129
|
+
}
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
function onShowHistory() {
|
|
133
|
+
enhanceJsHistory.openModal(true, {
|
|
134
|
+
code: code.value,
|
|
135
|
+
type: enhanceType.value
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
function onCodeChange(value) {
|
|
139
|
+
if (enhanceValues[enhanceType.value] != value) {
|
|
140
|
+
codeChange.value = true;
|
|
141
|
+
enhanceValues[enhanceType.value] = value;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
function onGenTestData() {
|
|
145
|
+
if (enhanceType.value === "form") {
|
|
146
|
+
genEnhanceJsData(tableName.value, enhanceType.value, formEditorRef.value);
|
|
147
|
+
} else {
|
|
148
|
+
genEnhanceJsData(tableName.value, enhanceType.value, listEditorRef.value);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
return {
|
|
152
|
+
formEditorRef,
|
|
153
|
+
listEditorRef,
|
|
154
|
+
reloading,
|
|
155
|
+
enhanceValues,
|
|
156
|
+
enhanceType,
|
|
157
|
+
showHistory,
|
|
158
|
+
aiTestMode,
|
|
159
|
+
tableName,
|
|
160
|
+
genEnhanceJsData,
|
|
161
|
+
onGenTestData,
|
|
162
|
+
onChangeType,
|
|
163
|
+
onCodeChange,
|
|
164
|
+
onShowHistory,
|
|
165
|
+
onSubmit,
|
|
166
|
+
onCancel,
|
|
167
|
+
registerModal,
|
|
168
|
+
registerEnhanceJsHistory
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
const _hoisted_1 = /* @__PURE__ */ createTextVNode("\u5173\u95ED");
|
|
173
|
+
const _hoisted_2 = /* @__PURE__ */ createTextVNode("\u786E\u5B9A");
|
|
174
|
+
const _hoisted_3 = /* @__PURE__ */ createTextVNode("\u67E5\u770B\u5386\u53F2\u7248\u672C");
|
|
175
|
+
const _hoisted_4 = /* @__PURE__ */ createTextVNode("\u751F\u6210\u6D4B\u8BD5\u6570\u636E");
|
|
176
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
177
|
+
const _component_JCodeEditor = resolveComponent("JCodeEditor");
|
|
178
|
+
const _component_a_tab_pane = resolveComponent("a-tab-pane");
|
|
179
|
+
const _component_a_tabs = resolveComponent("a-tabs");
|
|
180
|
+
const _component_a_button = resolveComponent("a-button");
|
|
181
|
+
const _component_a_space = resolveComponent("a-space");
|
|
182
|
+
const _component_EnhanceJsHistory = resolveComponent("EnhanceJsHistory");
|
|
183
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
184
|
+
return openBlock(), createBlock(_component_BasicModal, {
|
|
185
|
+
onRegister: _ctx.registerModal,
|
|
186
|
+
title: "JS\u589E\u5F3A",
|
|
187
|
+
width: 800,
|
|
188
|
+
bodyStyle: { height: "360px" }
|
|
189
|
+
}, {
|
|
190
|
+
footer: withCtx(() => [
|
|
191
|
+
createVNode(_component_a_space, null, {
|
|
192
|
+
default: withCtx(() => [
|
|
193
|
+
createVNode(_component_a_button, { onClick: _ctx.onCancel }, {
|
|
194
|
+
default: withCtx(() => [
|
|
195
|
+
_hoisted_1
|
|
196
|
+
]),
|
|
197
|
+
_: 1
|
|
198
|
+
}, 8, ["onClick"]),
|
|
199
|
+
createVNode(_component_a_button, {
|
|
200
|
+
type: "primary",
|
|
201
|
+
onClick: _ctx.onSubmit
|
|
202
|
+
}, {
|
|
203
|
+
default: withCtx(() => [
|
|
204
|
+
_hoisted_2
|
|
205
|
+
]),
|
|
206
|
+
_: 1
|
|
207
|
+
}, 8, ["onClick"])
|
|
208
|
+
]),
|
|
209
|
+
_: 1
|
|
210
|
+
}),
|
|
211
|
+
createVNode(_component_a_space, { style: { "float": "left" } }, {
|
|
212
|
+
default: withCtx(() => [
|
|
213
|
+
_ctx.showHistory ? (openBlock(), createBlock(_component_a_button, {
|
|
214
|
+
key: 0,
|
|
215
|
+
onClick: _ctx.onShowHistory
|
|
216
|
+
}, {
|
|
217
|
+
default: withCtx(() => [
|
|
218
|
+
_hoisted_3
|
|
219
|
+
]),
|
|
220
|
+
_: 1
|
|
221
|
+
}, 8, ["onClick"])) : createCommentVNode("", true),
|
|
222
|
+
_ctx.aiTestMode ? (openBlock(), createBlock(_component_a_button, {
|
|
223
|
+
key: 1,
|
|
224
|
+
onClick: _ctx.onGenTestData
|
|
225
|
+
}, {
|
|
226
|
+
default: withCtx(() => [
|
|
227
|
+
_hoisted_4
|
|
228
|
+
]),
|
|
229
|
+
_: 1
|
|
230
|
+
}, 8, ["onClick"])) : createCommentVNode("", true)
|
|
231
|
+
]),
|
|
232
|
+
_: 1
|
|
233
|
+
})
|
|
234
|
+
]),
|
|
235
|
+
default: withCtx(() => [
|
|
236
|
+
createVNode(_component_a_tabs, {
|
|
237
|
+
activeKey: _ctx.enhanceType,
|
|
238
|
+
"onUpdate:activeKey": _cache[2] || (_cache[2] = ($event) => _ctx.enhanceType = $event),
|
|
239
|
+
onChange: _ctx.onChangeType
|
|
240
|
+
}, {
|
|
241
|
+
default: withCtx(() => [
|
|
242
|
+
createVNode(_component_a_tab_pane, {
|
|
243
|
+
tab: "form",
|
|
244
|
+
key: "form",
|
|
245
|
+
forceRender: ""
|
|
246
|
+
}, {
|
|
247
|
+
default: withCtx(() => [
|
|
248
|
+
!_ctx.reloading ? (openBlock(), createBlock(_component_JCodeEditor, {
|
|
249
|
+
key: 0,
|
|
250
|
+
ref: "formEditorRef",
|
|
251
|
+
value: _ctx.enhanceValues.form,
|
|
252
|
+
"onUpdate:value": _cache[0] || (_cache[0] = ($event) => _ctx.enhanceValues.form = $event),
|
|
253
|
+
language: "javascript",
|
|
254
|
+
fullScreen: true,
|
|
255
|
+
lineNumbers: false,
|
|
256
|
+
height: "240px",
|
|
257
|
+
"language-change": false,
|
|
258
|
+
onChange: _ctx.onCodeChange
|
|
259
|
+
}, null, 8, ["value", "onChange"])) : createCommentVNode("", true)
|
|
260
|
+
]),
|
|
261
|
+
_: 1
|
|
262
|
+
}),
|
|
263
|
+
createVNode(_component_a_tab_pane, {
|
|
264
|
+
tab: "list",
|
|
265
|
+
key: "list",
|
|
266
|
+
forceRender: ""
|
|
267
|
+
}, {
|
|
268
|
+
default: withCtx(() => [
|
|
269
|
+
!_ctx.reloading ? (openBlock(), createBlock(_component_JCodeEditor, {
|
|
270
|
+
key: 0,
|
|
271
|
+
ref: "listEditorRef",
|
|
272
|
+
value: _ctx.enhanceValues.list,
|
|
273
|
+
"onUpdate:value": _cache[1] || (_cache[1] = ($event) => _ctx.enhanceValues.list = $event),
|
|
274
|
+
language: "javascript",
|
|
275
|
+
fullScreen: true,
|
|
276
|
+
lineNumbers: false,
|
|
277
|
+
height: "240px",
|
|
278
|
+
"language-change": false,
|
|
279
|
+
onChange: _ctx.onCodeChange
|
|
280
|
+
}, null, 8, ["value", "onChange"])) : createCommentVNode("", true)
|
|
281
|
+
]),
|
|
282
|
+
_: 1
|
|
283
|
+
})
|
|
284
|
+
]),
|
|
285
|
+
_: 1
|
|
286
|
+
}, 8, ["activeKey", "onChange"]),
|
|
287
|
+
createVNode(_component_EnhanceJsHistory, { onRegister: _ctx.registerEnhanceJsHistory }, null, 8, ["onRegister"])
|
|
288
|
+
]),
|
|
289
|
+
_: 1
|
|
290
|
+
}, 8, ["onRegister"]);
|
|
291
|
+
}
|
|
292
|
+
var EnhanceJsModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
293
|
+
export { EnhanceJsModal as default };
|