@jeecg/online 1.0.1 → 3.4.3-beta
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 +14 -7
- package/AuthButtonTree.js +3 -5
- package/AuthDataConfig.js +9 -6
- package/AuthDataTree.js +3 -5
- package/AuthFieldConfig.js +15 -12
- package/AuthFieldTree.js +24 -18
- package/AuthManagerDrawer.js +1 -1
- package/AuthSetterModal.js +1 -0
- package/CgformCopyList.js +34 -22
- package/CgformModal.js +57 -50
- package/CgreportModal.js +32 -39
- package/CheckDictTable.js +144 -24
- package/CodeFileListModal.js +175 -0
- package/CodeFileViewModal.js +325 -0
- package/CodeGeneratorModal.js +41 -38
- package/CustomButtonList.js +19 -22
- package/DBAttributeTable.js +248 -12
- package/DbToOnlineModal.js +27 -25
- package/DetailForm.js +605 -0
- package/EnhanceJavaModal.js +11 -17
- package/EnhanceJsHistory.js +6 -8
- package/EnhanceJsModal.js +9 -16
- package/EnhanceSqlModal.js +11 -17
- package/ExtendConfigModal.js +24 -15
- package/ForeignKeyTable.js +4 -3
- package/FormSchemaFactory.js +163 -30
- package/IndexTable.js +6 -5
- package/JModalTip.js +54 -0
- package/JOnlineSearchSelect.js +18 -10
- package/LeftDepart.js +1 -1
- package/LeftRole.js +7 -4
- package/LeftUser.js +7 -4
- package/LinkTableConfigModal.js +289 -0
- package/LinkTableFieldConfigModal.js +218 -0
- package/LinkTableListPiece.js +36 -0
- package/ModalFormDemo.js +3 -2
- package/OnlineAutoList.js +154 -55
- package/OnlineAutoModal.js +88 -131
- package/OnlineAutoTreeList.js +93 -53
- package/OnlineCustomModal.js +30 -14
- package/OnlineDetailModal.js +184 -0
- package/OnlineForm.js +259 -141
- package/OnlineFormDetail.js +326 -0
- package/OnlineQueryForm.js +72 -40
- package/OnlineSearchFormItem.js +26 -18
- package/OnlineSelectCascade.js +67 -53
- package/OnlineSubFormDetail.js +167 -0
- package/OnlineSuperQuery.js +69 -74
- package/OnlineSuperQueryValComponent.js +1 -0
- package/OnlineSuperQueryValComponent.vue_vue_type_script_lang.js +1 -17
- package/PageAttributeTable.js +233 -30
- package/ProcessOnlineForm.js +41 -16
- package/QueryTable.js +4 -3
- package/README.md +3 -8
- package/_arrayPush.js +5 -3
- package/{cloneDeep.js → _baseClone.js} +5 -9
- package/_baseSlice.js +18 -0
- package/_commonjsHelpers.js +5 -0
- package/_flatRest.js +174 -0
- package/auth.data.js +1 -3
- package/cgform.data.js +18 -9
- package/enhance.api.js +27 -18
- package/index.js +16 -6
- package/index2.js +48 -45
- package/index3.js +29 -26
- package/isArray.js +1 -1
- package/omit.js +60 -0
- package/package.json +1 -1
- package/pick.js +3 -173
- package/style.css +1 -1
- package/toString.js +2 -2
- package/useAutoForm.js +3437 -3791
- package/useCgformList.js +44 -31
- package/{useTableColumns.js → useListButton.js} +212 -407
- package/useOnlineTest.js +5 -26827
- package/useSchemas.js +364 -230
- package/useTableSync.js +19 -7
- package/ChartAutoRender.js +0 -69
- package/ChartDoubleRender.js +0 -154
- package/ChartSingleRender.js +0 -132
- package/ChartTabsRender.js +0 -218
- package/ErrorTip.js +0 -21
- package/FieldTable.js +0 -185
- package/GraphreportAutoChart.js +0 -352
- package/GraphreportList.js +0 -239
- package/GraphreportModal.js +0 -559
- package/OnlineSubForm.js +0 -200
- package/ParamsTable.js +0 -71
- package/graphreport.api.js +0 -23
- package/useChartRender.js +0 -405
- package/useMessageOnline.js +0 -71
package/IndexTable.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineComponent, ref, resolveComponent, openBlock, createBlock } from "vue";
|
|
1
|
+
import { defineComponent, ref, resolveComponent, openBlock, createBlock, mergeProps } from "vue";
|
|
2
2
|
import { JVxeTypes } from "/@/components/jeecg/JVxeTable/types";
|
|
3
3
|
import { u as useTableSync } from "./useTableSync.js";
|
|
4
4
|
import { _ as _export_sfc } from "./index.js";
|
|
@@ -7,6 +7,7 @@ import "/@/utils/dict";
|
|
|
7
7
|
import "/@/utils/dict/JDictSelectUtil";
|
|
8
8
|
import "/@/utils/uuid";
|
|
9
9
|
import "./pick.js";
|
|
10
|
+
import "./_flatRest.js";
|
|
10
11
|
import "./isArray.js";
|
|
11
12
|
import "./toString.js";
|
|
12
13
|
import "./_arrayPush.js";
|
|
@@ -59,7 +60,7 @@ const _sfc_main = defineComponent({
|
|
|
59
60
|
}
|
|
60
61
|
]);
|
|
61
62
|
const setup = useTableSync(columns);
|
|
62
|
-
const { tableRef, loading, dataSource, tableHeight, setDataSource, validateData } = setup;
|
|
63
|
+
const { tableRef, loading, dataSource, tableHeight, tableProps, setDataSource, validateData } = setup;
|
|
63
64
|
function syncTable(dbTable) {
|
|
64
65
|
let options = [];
|
|
65
66
|
let data = dbTable.value.tableRef.getTableData();
|
|
@@ -73,12 +74,12 @@ const _sfc_main = defineComponent({
|
|
|
73
74
|
});
|
|
74
75
|
columns.value[1].options = options;
|
|
75
76
|
}
|
|
76
|
-
return { tableRef, loading, dataSource, columns, tableHeight, syncTable, setDataSource, validateData };
|
|
77
|
+
return { tableRef, loading, dataSource, columns, tableHeight, tableProps, syncTable, setDataSource, validateData };
|
|
77
78
|
}
|
|
78
79
|
});
|
|
79
80
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
80
81
|
const _component_JVxeTable = resolveComponent("JVxeTable");
|
|
81
|
-
return openBlock(), createBlock(_component_JVxeTable, {
|
|
82
|
+
return openBlock(), createBlock(_component_JVxeTable, mergeProps({
|
|
82
83
|
ref: "tableRef",
|
|
83
84
|
rowNumber: "",
|
|
84
85
|
rowSelection: "",
|
|
@@ -90,7 +91,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
90
91
|
columns: _ctx.columns,
|
|
91
92
|
dataSource: _ctx.dataSource,
|
|
92
93
|
toolbar: _ctx.actionButton
|
|
93
|
-
}, null,
|
|
94
|
+
}, _ctx.tableProps), null, 16, ["maxHeight", "loading", "columns", "dataSource", "toolbar"]);
|
|
94
95
|
}
|
|
95
96
|
var IndexTable = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
96
97
|
export { IndexTable as default };
|
package/JModalTip.js
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { computed, openBlock, createElementBlock, createElementVNode, createCommentVNode, pushScopeId, popScopeId } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./index.js";
|
|
3
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
4
|
+
import "/@/hooks/web/useMessage";
|
|
5
|
+
import "vue-router";
|
|
6
|
+
var JModalTip_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
7
|
+
const _sfc_main = {
|
|
8
|
+
name: "JModalTip",
|
|
9
|
+
props: {
|
|
10
|
+
visible: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
default: false
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
emits: ["save", "cancel"],
|
|
16
|
+
setup(props) {
|
|
17
|
+
const flag = computed(() => {
|
|
18
|
+
return props.visible;
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
flag
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const _withScopeId = (n) => (pushScopeId("data-v-c18755ca"), n = n(), popScopeId(), n);
|
|
26
|
+
const _hoisted_1 = {
|
|
27
|
+
key: 0,
|
|
28
|
+
class: "jeecg-update-tip-bar"
|
|
29
|
+
};
|
|
30
|
+
const _hoisted_2 = { class: "container" };
|
|
31
|
+
const _hoisted_3 = { class: "outer" };
|
|
32
|
+
const _hoisted_4 = { class: "inner" };
|
|
33
|
+
const _hoisted_5 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "tip" }, "\u6B63\u5728\u4FEE\u6539\u8868\u5355\u6570\u636E \xB7\xB7\xB7", -1));
|
|
34
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
35
|
+
return $setup.flag ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
36
|
+
createElementVNode("div", _hoisted_2, [
|
|
37
|
+
createElementVNode("div", _hoisted_3, [
|
|
38
|
+
createElementVNode("div", _hoisted_4, [
|
|
39
|
+
_hoisted_5,
|
|
40
|
+
createElementVNode("div", {
|
|
41
|
+
class: "cancel",
|
|
42
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("cancel"))
|
|
43
|
+
}, "\u53D6\u6D88"),
|
|
44
|
+
createElementVNode("div", {
|
|
45
|
+
class: "save",
|
|
46
|
+
onClick: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("save"))
|
|
47
|
+
}, "\u4FDD\u5B58")
|
|
48
|
+
])
|
|
49
|
+
])
|
|
50
|
+
])
|
|
51
|
+
])) : createCommentVNode("", true);
|
|
52
|
+
}
|
|
53
|
+
var JModalTip = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-c18755ca"]]);
|
|
54
|
+
export { JModalTip as default };
|
package/JOnlineSearchSelect.js
CHANGED
|
@@ -27,16 +27,24 @@ const _sfc_main = {
|
|
|
27
27
|
setup(props, { emit }) {
|
|
28
28
|
let selected = ref("");
|
|
29
29
|
let selectOptions = ref([]);
|
|
30
|
-
watch(
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
30
|
+
watch(
|
|
31
|
+
() => props.value,
|
|
32
|
+
(newVal) => {
|
|
33
|
+
if (!newVal) {
|
|
34
|
+
selected.value = void 0;
|
|
35
|
+
} else {
|
|
36
|
+
selected.value = newVal;
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
{ immediate: true }
|
|
40
|
+
);
|
|
41
|
+
watch(
|
|
42
|
+
() => props.sql,
|
|
43
|
+
() => {
|
|
44
|
+
resetOptions();
|
|
45
|
+
},
|
|
46
|
+
{ immediate: true }
|
|
47
|
+
);
|
|
40
48
|
const handleSearch = useDebounceFn(searchByKeyword, 800);
|
|
41
49
|
function searchByKeyword(keyword = "") {
|
|
42
50
|
let params = {
|
package/LeftDepart.js
CHANGED
|
@@ -84,7 +84,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
84
84
|
}, {
|
|
85
85
|
depIcon: withCtx(({ selected }) => [
|
|
86
86
|
createVNode(_component_a_icon, {
|
|
87
|
-
style: normalizeStyle({
|
|
87
|
+
style: normalizeStyle({ color: selected ? "blue" : "" }),
|
|
88
88
|
type: "apartment"
|
|
89
89
|
}, null, 8, ["style"])
|
|
90
90
|
]),
|
package/LeftRole.js
CHANGED
|
@@ -59,10 +59,13 @@ const _sfc_main = defineComponent({
|
|
|
59
59
|
const [registerTable, { clearSelectedRowKeys }, { rowSelection }] = tableContext;
|
|
60
60
|
function loadData(params) {
|
|
61
61
|
return __async(this, null, function* () {
|
|
62
|
-
let { code, success, result, message } = yield defHttp.get(
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
let { code, success, result, message } = yield defHttp.get(
|
|
63
|
+
{
|
|
64
|
+
url: "/sys/role/list",
|
|
65
|
+
params
|
|
66
|
+
},
|
|
67
|
+
{ isTransformResponse: false }
|
|
68
|
+
);
|
|
66
69
|
if (success) {
|
|
67
70
|
return result;
|
|
68
71
|
}
|
package/LeftUser.js
CHANGED
|
@@ -78,10 +78,13 @@ const _sfc_main = defineComponent({
|
|
|
78
78
|
const [registerTable, { clearSelectedRowKeys }, { rowSelection }] = tableContext;
|
|
79
79
|
function loadData(params) {
|
|
80
80
|
return __async(this, null, function* () {
|
|
81
|
-
let { code, success, result, message } = yield defHttp.get(
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
81
|
+
let { code, success, result, message } = yield defHttp.get(
|
|
82
|
+
{
|
|
83
|
+
url: "/sys/user/list",
|
|
84
|
+
params
|
|
85
|
+
},
|
|
86
|
+
{ isTransformResponse: false }
|
|
87
|
+
);
|
|
85
88
|
if (success) {
|
|
86
89
|
return result;
|
|
87
90
|
}
|
|
@@ -0,0 +1,289 @@
|
|
|
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 { BasicModal, useModalInner } from "/@/components/Modal";
|
|
38
|
+
import { ref, computed, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createVNode } from "vue";
|
|
39
|
+
import { BasicForm, useForm } from "/@/components/Form/index";
|
|
40
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
41
|
+
import { _ as _export_sfc } from "./index.js";
|
|
42
|
+
import { o as omit } from "./omit.js";
|
|
43
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
44
|
+
import "/@/hooks/web/useMessage";
|
|
45
|
+
import "vue-router";
|
|
46
|
+
import "./toString.js";
|
|
47
|
+
import "./isArray.js";
|
|
48
|
+
import "./_baseClone.js";
|
|
49
|
+
import "./_arrayPush.js";
|
|
50
|
+
import "./_flatRest.js";
|
|
51
|
+
import "./_baseSlice.js";
|
|
52
|
+
const _sfc_main = {
|
|
53
|
+
name: "LinkTableConfigModal",
|
|
54
|
+
emits: ["success", "register"],
|
|
55
|
+
components: {
|
|
56
|
+
BasicModal,
|
|
57
|
+
BasicForm
|
|
58
|
+
},
|
|
59
|
+
setup(_p, { emit }) {
|
|
60
|
+
const spinningLoading = ref(false);
|
|
61
|
+
const fieldName = ref("");
|
|
62
|
+
let oldValue = {};
|
|
63
|
+
const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
|
|
64
|
+
console.log("data", data);
|
|
65
|
+
oldValue = __spreadValues({}, data.record);
|
|
66
|
+
yield setFieldsValue({ dictTable: data.record.dictTable });
|
|
67
|
+
setTimeout(() => __async(this, null, function* () {
|
|
68
|
+
let otherValue = omit(data.record, "dictTable");
|
|
69
|
+
yield setFieldsValue(otherValue);
|
|
70
|
+
yield clearValidate();
|
|
71
|
+
}), 200);
|
|
72
|
+
fieldName.value = data.fieldName;
|
|
73
|
+
}));
|
|
74
|
+
const titleFieldName = ref("");
|
|
75
|
+
const imageFieldName = ref("");
|
|
76
|
+
const fieldOptions = ref([]);
|
|
77
|
+
const imageFieldOptions = ref([]);
|
|
78
|
+
function getFieldOptions(tableName) {
|
|
79
|
+
return __async(this, null, function* () {
|
|
80
|
+
if (tableName) {
|
|
81
|
+
const url = "/online/cgform/field/listByHeadCode";
|
|
82
|
+
const dataList = yield defHttp.get({ url, params: { headCode: tableName } });
|
|
83
|
+
if (dataList && dataList.length > 0) {
|
|
84
|
+
let arr1 = dataList.filter((item) => item.dbFieldName != "id" && item.dbIsPersist == 1);
|
|
85
|
+
console.log("\u5B57\u6BB5\u5B57\u5178", arr1);
|
|
86
|
+
if (arr1.length > 0) {
|
|
87
|
+
fieldOptions.value = arr1.map((item) => {
|
|
88
|
+
return {
|
|
89
|
+
text: item.dbFieldTxt,
|
|
90
|
+
value: item.dbFieldName
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
} else {
|
|
94
|
+
fieldOptions.value = [];
|
|
95
|
+
}
|
|
96
|
+
let arr2 = dataList.filter((item) => item.dbFieldName != "id" && item.fieldShowType == "image" && item.dbIsPersist == 1);
|
|
97
|
+
console.log("\u56FE\u7247\u5B57\u6BB5", arr2);
|
|
98
|
+
if (arr2.length > 0) {
|
|
99
|
+
imageFieldOptions.value = arr2.map((item) => {
|
|
100
|
+
return {
|
|
101
|
+
text: item.dbFieldTxt,
|
|
102
|
+
value: item.dbFieldName
|
|
103
|
+
};
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
imageFieldOptions.value = [{ text: "\u65E0\u56FE\u7247\u5B57\u6BB5\u53EF\u4EE5\u9009\u62E9", value: "", key: "", disabled: true }];
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
fieldOptions.value = [];
|
|
110
|
+
imageFieldOptions.value = [{ text: "\u65E0\u56FE\u7247\u5B57\u6BB5\u53EF\u4EE5\u9009\u62E9", value: "", key: "", disabled: true }];
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
function handleTableChange(tableName) {
|
|
116
|
+
return __async(this, null, function* () {
|
|
117
|
+
titleFieldName.value = "";
|
|
118
|
+
imageFieldName.value = "";
|
|
119
|
+
yield getFieldOptions(tableName);
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
const otherFieldOptions = computed(() => {
|
|
123
|
+
let arr = fieldOptions.value;
|
|
124
|
+
let titleField = titleFieldName.value;
|
|
125
|
+
let imageField = imageFieldName.value;
|
|
126
|
+
return arr.filter((item) => item.value != titleField && item.value != imageField);
|
|
127
|
+
});
|
|
128
|
+
const formSchemas = [
|
|
129
|
+
{
|
|
130
|
+
label: "rowKey",
|
|
131
|
+
field: "rowKey",
|
|
132
|
+
component: "Input",
|
|
133
|
+
show: false
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
label: "dictField",
|
|
137
|
+
field: "dictField",
|
|
138
|
+
component: "Input",
|
|
139
|
+
defaultValue: "id",
|
|
140
|
+
show: false
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
label: "\u5B57\u6BB5\u63CF\u8FF0",
|
|
144
|
+
field: "dbFieldTxt",
|
|
145
|
+
component: "Input",
|
|
146
|
+
required: true
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
label: "\u5173\u8054\u8868",
|
|
150
|
+
field: "dictTable",
|
|
151
|
+
component: "JSearchSelect",
|
|
152
|
+
required: true,
|
|
153
|
+
componentProps: ({ formActionType }) => {
|
|
154
|
+
return {
|
|
155
|
+
dict: "onl_cgform_head,table_txt,table_name",
|
|
156
|
+
pageSize: 10,
|
|
157
|
+
async: true,
|
|
158
|
+
immediateChange: true,
|
|
159
|
+
popContainer: ".link-table-config-modal",
|
|
160
|
+
params: { order: "desc", column: "create_time" },
|
|
161
|
+
onChange: (name) => __async(this, null, function* () {
|
|
162
|
+
if (oldValue.titleField || oldValue.otherFields) {
|
|
163
|
+
yield formActionType.setFieldsValue({
|
|
164
|
+
titleField: "",
|
|
165
|
+
otherFields: "",
|
|
166
|
+
imageField: ""
|
|
167
|
+
});
|
|
168
|
+
yield formActionType.clearValidate();
|
|
169
|
+
}
|
|
170
|
+
yield handleTableChange(name);
|
|
171
|
+
})
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
label: "\u6807\u9898\u5B57\u6BB5",
|
|
177
|
+
field: "titleField",
|
|
178
|
+
component: "JSearchSelect",
|
|
179
|
+
required: true,
|
|
180
|
+
componentProps: {
|
|
181
|
+
async: false,
|
|
182
|
+
popContainer: ".link-table-config-modal",
|
|
183
|
+
dictOptions: fieldOptions,
|
|
184
|
+
immediateChange: true,
|
|
185
|
+
onChange: (str) => {
|
|
186
|
+
titleFieldName.value = str;
|
|
187
|
+
oldValue["titleField"] = str;
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
label: "\u5C01\u9762\u56FE\u7247",
|
|
193
|
+
field: "imageField",
|
|
194
|
+
component: "JSearchSelect",
|
|
195
|
+
componentProps: {
|
|
196
|
+
async: false,
|
|
197
|
+
popContainer: ".link-table-config-modal",
|
|
198
|
+
dictOptions: imageFieldOptions,
|
|
199
|
+
immediateChange: true,
|
|
200
|
+
onChange: (str) => {
|
|
201
|
+
imageFieldName.value = str;
|
|
202
|
+
oldValue["imageFieldName"] = str;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
label: "\u5176\u4ED6\u5B57\u6BB5",
|
|
208
|
+
field: "otherFields",
|
|
209
|
+
component: "JSelectMultiple",
|
|
210
|
+
componentProps: {
|
|
211
|
+
popContainer: ".link-table-config-modal",
|
|
212
|
+
options: otherFieldOptions,
|
|
213
|
+
onChange: (str) => {
|
|
214
|
+
oldValue["otherFields"] = str;
|
|
215
|
+
console.error("oldValue", oldValue);
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
},
|
|
219
|
+
{
|
|
220
|
+
label: "\u663E\u793A\u65B9\u5F0F",
|
|
221
|
+
field: "showType",
|
|
222
|
+
component: "Select",
|
|
223
|
+
defaultValue: "card",
|
|
224
|
+
componentProps: {
|
|
225
|
+
options: [
|
|
226
|
+
{ label: "\u5361\u7247", value: "card" },
|
|
227
|
+
{ label: "\u4E0B\u62C9\u6846", value: "select" }
|
|
228
|
+
]
|
|
229
|
+
}
|
|
230
|
+
},
|
|
231
|
+
{
|
|
232
|
+
label: "\u662F\u5426\u591A\u9009",
|
|
233
|
+
field: "multiSelect",
|
|
234
|
+
component: "RadioGroup",
|
|
235
|
+
defaultValue: false,
|
|
236
|
+
componentProps: {
|
|
237
|
+
options: [
|
|
238
|
+
{ label: "\u5426", value: false },
|
|
239
|
+
{ label: "\u662F", value: true }
|
|
240
|
+
]
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
];
|
|
244
|
+
const [registerForm, { validate, setFieldsValue, clearValidate, resetFields }] = useForm({
|
|
245
|
+
schemas: formSchemas,
|
|
246
|
+
showActionButtonGroup: false,
|
|
247
|
+
labelAlign: "right"
|
|
248
|
+
});
|
|
249
|
+
function handleSubmit() {
|
|
250
|
+
return __async(this, null, function* () {
|
|
251
|
+
let data = yield validate();
|
|
252
|
+
data["fieldName"] = fieldName.value;
|
|
253
|
+
emit("success", data);
|
|
254
|
+
closeModal();
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
return {
|
|
258
|
+
registerModal,
|
|
259
|
+
spinningLoading,
|
|
260
|
+
registerForm,
|
|
261
|
+
handleSubmit
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
};
|
|
265
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
266
|
+
const _component_BasicForm = resolveComponent("BasicForm");
|
|
267
|
+
const _component_a_spin = resolveComponent("a-spin");
|
|
268
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
269
|
+
return openBlock(), createBlock(_component_BasicModal, mergeProps({ wrapClassName: "link-table-config-modal" }, _ctx.$attrs, {
|
|
270
|
+
title: "\u5173\u8054\u8BB0\u5F55\u914D\u7F6E",
|
|
271
|
+
onRegister: $setup.registerModal,
|
|
272
|
+
keyboard: "",
|
|
273
|
+
canFullscreen: false,
|
|
274
|
+
cancelText: "\u5173\u95ED",
|
|
275
|
+
onOk: $setup.handleSubmit
|
|
276
|
+
}), {
|
|
277
|
+
default: withCtx(() => [
|
|
278
|
+
createVNode(_component_a_spin, { spinning: $setup.spinningLoading }, {
|
|
279
|
+
default: withCtx(() => [
|
|
280
|
+
createVNode(_component_BasicForm, { onRegister: $setup.registerForm }, null, 8, ["onRegister"])
|
|
281
|
+
]),
|
|
282
|
+
_: 1
|
|
283
|
+
}, 8, ["spinning"])
|
|
284
|
+
]),
|
|
285
|
+
_: 1
|
|
286
|
+
}, 16, ["onRegister", "onOk"]);
|
|
287
|
+
}
|
|
288
|
+
var LinkTableConfigModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
289
|
+
export { LinkTableConfigModal as default };
|
|
@@ -0,0 +1,218 @@
|
|
|
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 { BasicModal, useModalInner } from "/@/components/Modal";
|
|
38
|
+
import { ref, resolveComponent, openBlock, createBlock, mergeProps, withCtx, createVNode } from "vue";
|
|
39
|
+
import { BasicForm, useForm } from "/@/components/Form/index";
|
|
40
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
41
|
+
import { useMessage } from "/@/hooks/web/useMessage";
|
|
42
|
+
import { _ as _export_sfc } from "./index.js";
|
|
43
|
+
import { o as omit } from "./omit.js";
|
|
44
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
45
|
+
import "vue-router";
|
|
46
|
+
import "./toString.js";
|
|
47
|
+
import "./isArray.js";
|
|
48
|
+
import "./_baseClone.js";
|
|
49
|
+
import "./_arrayPush.js";
|
|
50
|
+
import "./_flatRest.js";
|
|
51
|
+
import "./_baseSlice.js";
|
|
52
|
+
const _sfc_main = {
|
|
53
|
+
name: "LinkTableFieldConfigModal",
|
|
54
|
+
emits: ["success", "register"],
|
|
55
|
+
components: {
|
|
56
|
+
BasicModal,
|
|
57
|
+
BasicForm
|
|
58
|
+
},
|
|
59
|
+
setup(_p, { emit }) {
|
|
60
|
+
const spinningLoading = ref(false);
|
|
61
|
+
const linkTableOptions = ref([]);
|
|
62
|
+
const fieldOptions = ref([]);
|
|
63
|
+
let tableAndFieldsMap = {};
|
|
64
|
+
let oldValue = {};
|
|
65
|
+
const { createMessage: $message } = useMessage();
|
|
66
|
+
const [registerModal, { closeModal }] = useModalInner((data) => __async(this, null, function* () {
|
|
67
|
+
console.log("data", data);
|
|
68
|
+
oldValue = __spreadValues({}, data.record);
|
|
69
|
+
tableAndFieldsMap = data.tableAndFieldsMap;
|
|
70
|
+
yield initLinkTableOptions();
|
|
71
|
+
yield setFieldsValue({ dictTable: data.record.dictTable });
|
|
72
|
+
setTimeout(() => __async(this, null, function* () {
|
|
73
|
+
let otherValue = omit(data.record, "dictTable");
|
|
74
|
+
yield setFieldsValue(otherValue);
|
|
75
|
+
yield clearValidate();
|
|
76
|
+
}), 200);
|
|
77
|
+
}));
|
|
78
|
+
function initLinkTableOptions() {
|
|
79
|
+
return __async(this, null, function* () {
|
|
80
|
+
let fieldNames = Object.keys(tableAndFieldsMap);
|
|
81
|
+
if (!fieldNames || fieldNames.length == 0) {
|
|
82
|
+
linkTableOptions.value = [];
|
|
83
|
+
} else {
|
|
84
|
+
let arr = [];
|
|
85
|
+
for (let name of fieldNames) {
|
|
86
|
+
arr.push({
|
|
87
|
+
text: tableAndFieldsMap[name].title,
|
|
88
|
+
value: name
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
linkTableOptions.value = arr;
|
|
92
|
+
}
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
function handleChange(fieldName) {
|
|
96
|
+
return __async(this, null, function* () {
|
|
97
|
+
if (fieldName) {
|
|
98
|
+
const { table, fields } = tableAndFieldsMap[fieldName];
|
|
99
|
+
if (!table) {
|
|
100
|
+
$message.warning("\u8BF7\u5148\u5B8C\u5584\u5B57\u6BB5[" + fieldName + "]\u5173\u8054\u8BB0\u5F55\u7684\u914D\u7F6E");
|
|
101
|
+
return;
|
|
102
|
+
}
|
|
103
|
+
const url = "/online/cgform/field/listByHeadCode";
|
|
104
|
+
const dataList = yield defHttp.get({ url, params: { headCode: table } });
|
|
105
|
+
if (dataList && dataList.length > 0) {
|
|
106
|
+
let arr = dataList.map((item) => {
|
|
107
|
+
return {
|
|
108
|
+
text: item.dbFieldTxt,
|
|
109
|
+
value: item.dbFieldName
|
|
110
|
+
};
|
|
111
|
+
});
|
|
112
|
+
console.log("\u5B57\u6BB5\u5B57\u5178", arr);
|
|
113
|
+
let fieldArray = fields.split(",");
|
|
114
|
+
fieldOptions.value = arr.filter((item) => fieldArray.indexOf(item.value) > 0);
|
|
115
|
+
} else {
|
|
116
|
+
fieldOptions.value = [];
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
const formSchemas = [
|
|
122
|
+
{
|
|
123
|
+
label: "rowKey",
|
|
124
|
+
field: "rowKey",
|
|
125
|
+
component: "Input",
|
|
126
|
+
show: false
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
label: "\u5B57\u6BB5\u63CF\u8FF0",
|
|
130
|
+
field: "dbFieldTxt",
|
|
131
|
+
component: "Input",
|
|
132
|
+
required: true
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
label: "\u5173\u8054\u8BB0\u5F55",
|
|
136
|
+
field: "dictTable",
|
|
137
|
+
component: "JSearchSelect",
|
|
138
|
+
required: true,
|
|
139
|
+
componentProps: ({ formActionType }) => {
|
|
140
|
+
let tempOptions = linkTableOptions.value;
|
|
141
|
+
return {
|
|
142
|
+
async: false,
|
|
143
|
+
popContainer: ".link-table-field-config-modal",
|
|
144
|
+
dictOptions: tempOptions,
|
|
145
|
+
immediateChange: true,
|
|
146
|
+
onChange: (name) => __async(this, null, function* () {
|
|
147
|
+
if (oldValue.dictText) {
|
|
148
|
+
yield formActionType.setFieldsValue({
|
|
149
|
+
dictText: ""
|
|
150
|
+
});
|
|
151
|
+
yield formActionType.clearValidate();
|
|
152
|
+
}
|
|
153
|
+
handleChange(name);
|
|
154
|
+
})
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
label: "\u663E\u793A\u5B57\u6BB5",
|
|
160
|
+
field: "dictText",
|
|
161
|
+
component: "JSearchSelect",
|
|
162
|
+
required: true,
|
|
163
|
+
componentProps: {
|
|
164
|
+
async: false,
|
|
165
|
+
popContainer: ".link-table-field-config-modal",
|
|
166
|
+
dictOptions: fieldOptions,
|
|
167
|
+
onChange: (value) => {
|
|
168
|
+
oldValue["dictText"] = value;
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
const [registerForm, { validate, setFieldsValue, clearValidate }] = useForm({
|
|
174
|
+
schemas: formSchemas,
|
|
175
|
+
showActionButtonGroup: false,
|
|
176
|
+
labelAlign: "right"
|
|
177
|
+
});
|
|
178
|
+
function handleSubmit() {
|
|
179
|
+
return __async(this, null, function* () {
|
|
180
|
+
const data = yield validate();
|
|
181
|
+
console.log("handlesub", data);
|
|
182
|
+
emit("success", data);
|
|
183
|
+
closeModal();
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
return {
|
|
187
|
+
registerModal,
|
|
188
|
+
spinningLoading,
|
|
189
|
+
registerForm,
|
|
190
|
+
handleSubmit
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
};
|
|
194
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
195
|
+
const _component_BasicForm = resolveComponent("BasicForm");
|
|
196
|
+
const _component_a_spin = resolveComponent("a-spin");
|
|
197
|
+
const _component_BasicModal = resolveComponent("BasicModal");
|
|
198
|
+
return openBlock(), createBlock(_component_BasicModal, mergeProps({ wrapClassName: "link-table-field-config-modal" }, _ctx.$attrs, {
|
|
199
|
+
title: "\u4ED6\u8868\u5B57\u6BB5\u914D\u7F6E",
|
|
200
|
+
onRegister: $setup.registerModal,
|
|
201
|
+
keyboard: "",
|
|
202
|
+
canFullscreen: false,
|
|
203
|
+
cancelText: "\u5173\u95ED",
|
|
204
|
+
onOk: $setup.handleSubmit
|
|
205
|
+
}), {
|
|
206
|
+
default: withCtx(() => [
|
|
207
|
+
createVNode(_component_a_spin, { spinning: $setup.spinningLoading }, {
|
|
208
|
+
default: withCtx(() => [
|
|
209
|
+
createVNode(_component_BasicForm, { onRegister: $setup.registerForm }, null, 8, ["onRegister"])
|
|
210
|
+
]),
|
|
211
|
+
_: 1
|
|
212
|
+
}, 8, ["spinning"])
|
|
213
|
+
]),
|
|
214
|
+
_: 1
|
|
215
|
+
}, 16, ["onRegister", "onOk"]);
|
|
216
|
+
}
|
|
217
|
+
var LinkTableFieldConfigModal = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
218
|
+
export { LinkTableFieldConfigModal as default };
|