@jeecg/online 3.4.3 → 3.4.4-beta2
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 +2 -1
- package/AuthButtonTree.js +2 -1
- package/AuthDataConfig.js +2 -1
- package/AuthDataTree.js +2 -1
- package/AuthFieldConfig.js +3 -2
- package/AuthFieldTree.js +2 -1
- package/AuthManagerDrawer.js +2 -1
- package/AuthSetterModal.js +2 -1
- package/CgformCopyList.js +5 -1
- package/CgformModal.js +19 -2
- package/CgreportModal.js +1 -0
- package/CheckDictTable.js +2 -2
- package/CodeFileListModal.js +2 -1
- package/CodeFileViewModal.js +2 -1
- package/CodeGeneratorModal.js +2 -1
- package/CustomButtonList.js +2 -1
- package/DBAttributeTable.js +2 -2
- package/DbToOnlineModal.js +2 -1
- package/DetailForm.js +4 -2
- package/EnhanceJavaModal.js +2 -1
- package/EnhanceJsHistory.js +1 -1
- package/EnhanceJsModal.js +2 -1
- package/EnhanceSqlModal.js +2 -1
- package/ExtendConfigModal.js +3 -3
- package/FieldExtendJsonModal.js +270 -0
- package/FileSelectModal.js +2 -1
- package/ForeignKeyTable.js +2 -2
- package/FormSchemaFactory.js +150 -10
- package/IndexTable.js +2 -2
- package/JModalTip.js +2 -2
- package/JOnlineSearchSelect.js +115 -0
- package/LICENSE +7 -0
- package/LeftDepart.js +2 -2
- package/LeftRole.js +2 -1
- package/LeftUser.js +2 -1
- package/LinkTableConfigModal.js +2 -1
- package/LinkTableFieldConfigModal.js +2 -1
- package/LinkTableListPiece.js +2 -2
- package/ModalFormDemo.js +2 -1
- package/OnlineAutoList.js +7 -4
- package/OnlineAutoModal.js +4 -2
- package/OnlineAutoTreeList.js +7 -4
- package/OnlineCustomModal.js +5 -3
- package/OnlineDetailModal.js +5 -3
- package/OnlineForm.js +49 -39
- package/OnlineFormDetail.js +4 -2
- package/OnlineQueryForm.js +12 -6
- package/OnlineSearchFormItem.js +8 -5
- package/OnlineSelectCascade.js +228 -0
- package/OnlineSubFormDetail.js +4 -2
- package/PageAttributeTable.js +70 -28
- package/ProcessOnlineForm.js +4 -2
- package/QueryTable.js +2 -2
- package/README.md +6 -1
- package/{OnlineSuperQuery.js → SuperQuery.js} +216 -128
- package/{OnlineSuperQueryValComponent.js → SuperQueryValComponent.js} +2 -2
- package/{OnlineSuperQueryValComponent.vue_vue_type_script_lang.js → SuperQueryValComponent.vue_vue_type_script_lang.js} +8 -2
- package/_arrayPush.js +1 -1
- package/_baseClone.js +1 -1
- package/_flatRest.js +1 -1
- package/cgform.data.js +8 -8
- package/clipboard.js +565 -0
- package/index.js +37 -340
- package/index2.js +8 -4
- package/index3.js +33 -571
- package/isArray.js +1 -1
- package/main.index.js +3 -3
- package/omit.js +1 -1
- package/package.json +1 -1
- package/pick.js +1 -1
- package/style.css +1 -1
- package/toString.js +1 -1
- package/useAutoForm.js +22 -5
- package/useCgformList.js +97 -5
- package/OnlCgReportList.js +0 -34
package/OnlineDetailModal.js
CHANGED
|
@@ -46,6 +46,9 @@ import "./_commonjsHelpers.js";
|
|
|
46
46
|
import "/@/store/modules/user";
|
|
47
47
|
import "/@/utils/desform/customExpression";
|
|
48
48
|
import "/@/components/Form/src/componentMap";
|
|
49
|
+
import "./OnlineSelectCascade.js";
|
|
50
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
51
|
+
import "vue-router";
|
|
49
52
|
import "/@/store/modules/permission";
|
|
50
53
|
import "/@/components/Form/index";
|
|
51
54
|
import "./pick.js";
|
|
@@ -55,11 +58,10 @@ import "./toString.js";
|
|
|
55
58
|
import "./_arrayPush.js";
|
|
56
59
|
import "/@/components/Table";
|
|
57
60
|
import "/@/hooks/system/useListPage";
|
|
58
|
-
import "vue-router";
|
|
59
61
|
import "./LinkTableListPiece.js";
|
|
60
|
-
import "@vueuse/core";
|
|
61
62
|
import "./JModalTip.js";
|
|
62
63
|
import "ant-design-vue";
|
|
64
|
+
import "@vueuse/core";
|
|
63
65
|
import "./OnlineSubFormDetail.js";
|
|
64
66
|
const _sfc_main = defineComponent({
|
|
65
67
|
name: "OnlineDetailModal",
|
|
@@ -147,7 +149,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
147
149
|
defaultFullscreen: false
|
|
148
150
|
}, _ctx.$attrs, {
|
|
149
151
|
onRegister: _ctx.registerModal,
|
|
150
|
-
wrapClassName: "jeecg-online-modal"
|
|
152
|
+
wrapClassName: "jeecg-online-detail-modal"
|
|
151
153
|
}), {
|
|
152
154
|
footer: withCtx(() => [
|
|
153
155
|
createVNode(_component_a_button, {
|
package/OnlineForm.js
CHANGED
|
@@ -57,19 +57,21 @@ import "./_commonjsHelpers.js";
|
|
|
57
57
|
import "/@/store/modules/user";
|
|
58
58
|
import "/@/utils/desform/customExpression";
|
|
59
59
|
import "/@/components/Form/src/componentMap";
|
|
60
|
+
import "./OnlineSelectCascade.js";
|
|
61
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
62
|
+
import "vue-router";
|
|
60
63
|
import "/@/store/modules/permission";
|
|
61
64
|
import "/@/utils/propTypes";
|
|
62
65
|
import "/@/utils/dict/JDictSelectUtil";
|
|
63
66
|
import "/@/utils/common/compUtils";
|
|
64
67
|
import "/@/components/Table";
|
|
65
68
|
import "/@/hooks/system/useListPage";
|
|
66
|
-
import "vue-router";
|
|
67
69
|
import "/@/components/Form/src/utils/Area";
|
|
68
70
|
import "/@/components/Preview/index";
|
|
69
71
|
import "./LinkTableListPiece.js";
|
|
70
|
-
import "@vueuse/core";
|
|
71
72
|
import "./JModalTip.js";
|
|
72
73
|
import "ant-design-vue";
|
|
74
|
+
import "@vueuse/core";
|
|
73
75
|
import "./_flatRest.js";
|
|
74
76
|
import "./isArray.js";
|
|
75
77
|
import "./toString.js";
|
|
@@ -154,7 +156,6 @@ const _sfc_main = {
|
|
|
154
156
|
fieldDisplayStatus
|
|
155
157
|
} = useFormItems(props, onlineFormRef);
|
|
156
158
|
let { EnhanceJS, initCgEnhanceJs } = useEnhance(onlineFormContext, false);
|
|
157
|
-
console.log("--formSchemas----------", formSchemas);
|
|
158
159
|
const [registerForm, { setProps, validate, resetFields, setFieldsValue, updateSchema, getFieldsValue, scrollToField }] = useForm({
|
|
159
160
|
schemas: formSchemas,
|
|
160
161
|
showActionButtonGroup: false,
|
|
@@ -359,8 +360,7 @@ const _sfc_main = {
|
|
|
359
360
|
}
|
|
360
361
|
subActiveKey.value = activeKey;
|
|
361
362
|
if (arr[i].relationType === 0) {
|
|
362
|
-
let instance =
|
|
363
|
-
instance = Array.isArray(instance) ? instance[0] : instance;
|
|
363
|
+
let instance = getSubTableInstance(key);
|
|
364
364
|
sleep(300, () => instance == null ? void 0 : instance.validateTable());
|
|
365
365
|
}
|
|
366
366
|
break;
|
|
@@ -374,10 +374,7 @@ const _sfc_main = {
|
|
|
374
374
|
let arr = subTabInfo.value;
|
|
375
375
|
for (let i = 0; i < arr.length; i++) {
|
|
376
376
|
let key = arr[i].key;
|
|
377
|
-
let instance =
|
|
378
|
-
if (instance instanceof Array) {
|
|
379
|
-
instance = instance[0];
|
|
380
|
-
}
|
|
377
|
+
let instance = getSubTableInstance(key);
|
|
381
378
|
if (arr[i].relationType == 1) {
|
|
382
379
|
try {
|
|
383
380
|
let subFormData = yield instance.getAll();
|
|
@@ -503,10 +500,7 @@ const _sfc_main = {
|
|
|
503
500
|
let tableChangeObj = EnhanceJS[tableKey + "_onlChange"]();
|
|
504
501
|
let columnKey = Object.keys(valueObj)[0];
|
|
505
502
|
if (tableChangeObj[columnKey]) {
|
|
506
|
-
let subRef =
|
|
507
|
-
if (subRef instanceof Array) {
|
|
508
|
-
subRef = subRef[0];
|
|
509
|
-
}
|
|
503
|
+
let subRef = getSubTableInstance(tableKey);
|
|
510
504
|
let formEvent = subRef.getFormEvent();
|
|
511
505
|
let event = __spreadValues({
|
|
512
506
|
column: { key: columnKey },
|
|
@@ -592,7 +586,7 @@ const _sfc_main = {
|
|
|
592
586
|
}
|
|
593
587
|
}
|
|
594
588
|
function clearSubRows(tbname) {
|
|
595
|
-
let instance =
|
|
589
|
+
let instance = getSubTableInstance(tbname);
|
|
596
590
|
let rows = [...instance.getNewDataWithId(), ...subDataSource.value[tbname]];
|
|
597
591
|
if (!rows || rows.length == 0) {
|
|
598
592
|
return false;
|
|
@@ -607,7 +601,7 @@ const _sfc_main = {
|
|
|
607
601
|
if (!rows) {
|
|
608
602
|
return false;
|
|
609
603
|
}
|
|
610
|
-
let instance =
|
|
604
|
+
let instance = getSubTableInstance(tbname);
|
|
611
605
|
if (typeof rows == "object") {
|
|
612
606
|
instance.addRows(rows, true);
|
|
613
607
|
} else {
|
|
@@ -675,6 +669,10 @@ const _sfc_main = {
|
|
|
675
669
|
if (instance instanceof Array) {
|
|
676
670
|
instance = instance[0];
|
|
677
671
|
}
|
|
672
|
+
if (!instance) {
|
|
673
|
+
$message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + tableName2);
|
|
674
|
+
return;
|
|
675
|
+
}
|
|
678
676
|
return instance;
|
|
679
677
|
}
|
|
680
678
|
function onOpenReportPrint() {
|
|
@@ -690,18 +688,10 @@ const _sfc_main = {
|
|
|
690
688
|
console.log("openSubFormModalForAdd", sub);
|
|
691
689
|
popTableName.value = sub.id;
|
|
692
690
|
popModalRequest.value = false;
|
|
693
|
-
openPopModal(true, {});
|
|
691
|
+
openPopModal(true, { isUpdate: false });
|
|
694
692
|
}
|
|
695
693
|
function openSubFormModalForEdit(sub) {
|
|
696
|
-
let ref2 =
|
|
697
|
-
if (!ref2 || !ref2.value) {
|
|
698
|
-
$message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + sub.key);
|
|
699
|
-
return;
|
|
700
|
-
}
|
|
701
|
-
ref2 = ref2.value;
|
|
702
|
-
if (Array.isArray(ref2)) {
|
|
703
|
-
ref2 = ref2[0];
|
|
704
|
-
}
|
|
694
|
+
let ref2 = getSubTableInstance(sub.key);
|
|
705
695
|
let arr = ref2.getSelectedData();
|
|
706
696
|
if (arr.length != 1) {
|
|
707
697
|
$message.warning("\u8BF7\u9009\u62E9\u4E00\u6761\u6570\u636E");
|
|
@@ -715,23 +705,12 @@ const _sfc_main = {
|
|
|
715
705
|
const tableName2 = data[ONL_FORM_TABLE_NAME];
|
|
716
706
|
let record = omit(data, [ONL_FORM_TABLE_NAME]);
|
|
717
707
|
if (record.id) {
|
|
718
|
-
const ref2 = refMap[tableName2];
|
|
719
|
-
if (!ref2 || !ref2.value) {
|
|
720
|
-
$message.warning("\u5B50\u8868ref\u627E\u4E0D\u5230:" + tableName2);
|
|
721
|
-
return;
|
|
722
|
-
}
|
|
723
708
|
let values = omit(__spreadValues({}, record), "id");
|
|
724
709
|
let arr = [{ rowKey: record.id, values }];
|
|
725
|
-
let instance =
|
|
726
|
-
if (instance instanceof Array) {
|
|
727
|
-
instance = instance[0];
|
|
728
|
-
}
|
|
710
|
+
let instance = getSubTableInstance(tableName2);
|
|
729
711
|
instance.setValues(arr);
|
|
730
712
|
} else {
|
|
731
|
-
let instance =
|
|
732
|
-
if (instance instanceof Array) {
|
|
733
|
-
instance = instance[0];
|
|
734
|
-
}
|
|
713
|
+
let instance = getSubTableInstance(tableName2);
|
|
735
714
|
instance.addRows(record, { isOnlineJS: false, setActive: false, emitChange: true });
|
|
736
715
|
}
|
|
737
716
|
}
|
|
@@ -750,6 +729,35 @@ const _sfc_main = {
|
|
|
750
729
|
}
|
|
751
730
|
}
|
|
752
731
|
}
|
|
732
|
+
function executeMainFillRule() {
|
|
733
|
+
let formData = getFieldsValue();
|
|
734
|
+
let fieldProperties = toRaw(defaultValueFields[tableName.value]);
|
|
735
|
+
loadFormFieldsDefVal(fieldProperties, (values) => {
|
|
736
|
+
setFieldsValue(values);
|
|
737
|
+
}, formData);
|
|
738
|
+
}
|
|
739
|
+
function executeSubFillRule(subKey, $event) {
|
|
740
|
+
let subList = subTabInfo.value;
|
|
741
|
+
if (subList && subList.length > 0) {
|
|
742
|
+
let arr = subList.filter((sub) => sub.key === subKey);
|
|
743
|
+
if (arr.length == 0) {
|
|
744
|
+
console.error("\u6CA1\u627E\u5230\u4E0E\u4E4B\u5339\u914D\u7684\u5B50\u8868", subKey);
|
|
745
|
+
return;
|
|
746
|
+
}
|
|
747
|
+
if (arr[0].relationType == 1) {
|
|
748
|
+
let subInstance = getSubTableInstance(subKey);
|
|
749
|
+
subInstance.executeFillRule();
|
|
750
|
+
} else {
|
|
751
|
+
let subFieldProperties = toRaw(defaultValueFields[subKey]);
|
|
752
|
+
let row = toRaw($event.row);
|
|
753
|
+
loadFormFieldsDefVal(subFieldProperties, (values) => {
|
|
754
|
+
const { row: row2, target } = $event;
|
|
755
|
+
let v = [{ rowKey: row2.id, values: __spreadValues({}, values) }];
|
|
756
|
+
target.setValues(v);
|
|
757
|
+
}, row);
|
|
758
|
+
}
|
|
759
|
+
}
|
|
760
|
+
}
|
|
753
761
|
let context = {
|
|
754
762
|
tableName,
|
|
755
763
|
loading,
|
|
@@ -770,7 +778,9 @@ const _sfc_main = {
|
|
|
770
778
|
changeOptions,
|
|
771
779
|
isUpdate,
|
|
772
780
|
getSubTableInstance,
|
|
773
|
-
updateSchema
|
|
781
|
+
updateSchema,
|
|
782
|
+
executeMainFillRule,
|
|
783
|
+
executeSubFillRule
|
|
774
784
|
};
|
|
775
785
|
resetContext(context);
|
|
776
786
|
return {
|
package/OnlineFormDetail.js
CHANGED
|
@@ -61,6 +61,9 @@ import "./_commonjsHelpers.js";
|
|
|
61
61
|
import "/@/store/modules/user";
|
|
62
62
|
import "/@/utils/desform/customExpression";
|
|
63
63
|
import "/@/components/Form/src/componentMap";
|
|
64
|
+
import "./OnlineSelectCascade.js";
|
|
65
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
66
|
+
import "vue-router";
|
|
64
67
|
import "/@/store/modules/permission";
|
|
65
68
|
import "/@/components/Modal";
|
|
66
69
|
import "./pick.js";
|
|
@@ -70,11 +73,10 @@ import "./toString.js";
|
|
|
70
73
|
import "./_arrayPush.js";
|
|
71
74
|
import "/@/components/Table";
|
|
72
75
|
import "/@/hooks/system/useListPage";
|
|
73
|
-
import "vue-router";
|
|
74
76
|
import "./LinkTableListPiece.js";
|
|
75
|
-
import "@vueuse/core";
|
|
76
77
|
import "./JModalTip.js";
|
|
77
78
|
import "ant-design-vue";
|
|
79
|
+
import "@vueuse/core";
|
|
78
80
|
const _sfc_main = {
|
|
79
81
|
name: "OnlineFormDetail",
|
|
80
82
|
components: {
|
package/OnlineQueryForm.js
CHANGED
|
@@ -48,6 +48,9 @@ import "/@/store/modules/user";
|
|
|
48
48
|
import "/@/utils";
|
|
49
49
|
import "/@/utils/desform/customExpression";
|
|
50
50
|
import "/@/components/Form/src/componentMap";
|
|
51
|
+
import "./OnlineSelectCascade.js";
|
|
52
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
53
|
+
import "vue-router";
|
|
51
54
|
import "/@/store/modules/permission";
|
|
52
55
|
import "/@/utils/propTypes";
|
|
53
56
|
import "@ant-design/icons-vue";
|
|
@@ -61,15 +64,14 @@ import "./toString.js";
|
|
|
61
64
|
import "./_arrayPush.js";
|
|
62
65
|
import "/@/components/Table";
|
|
63
66
|
import "/@/hooks/system/useListPage";
|
|
64
|
-
import "vue-router";
|
|
65
67
|
import "/@/components/Form/src/utils/Area";
|
|
66
68
|
import "/@/components/Preview/index";
|
|
67
69
|
import "./LinkTableListPiece.js";
|
|
68
|
-
import "@vueuse/core";
|
|
69
70
|
import "/@/components/Loading";
|
|
70
71
|
import "/@/utils/auth";
|
|
71
72
|
import "./JModalTip.js";
|
|
72
73
|
import "ant-design-vue";
|
|
74
|
+
import "@vueuse/core";
|
|
73
75
|
var OnlineQueryForm_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
74
76
|
const _sfc_main = {
|
|
75
77
|
name: "OnlineQueryForm",
|
|
@@ -87,7 +89,7 @@ const _sfc_main = {
|
|
|
87
89
|
const LOAD_URL = "/online/cgform/api/getQueryInfoVue3/";
|
|
88
90
|
const onlineQueryFormRef = ref(null);
|
|
89
91
|
const formSchemas = ref([]);
|
|
90
|
-
const baseColProps = ref({ xs: 24, sm: 24, md: 12, lg:
|
|
92
|
+
const baseColProps = ref({ xs: 24, sm: 24, md: 12, lg: 6, xl: 6 });
|
|
91
93
|
const toggleButtonShow = ref(false);
|
|
92
94
|
const toggleSearchStatus = ref(false);
|
|
93
95
|
const queryParams = ref({});
|
|
@@ -180,7 +182,11 @@ const _sfc_main = {
|
|
|
180
182
|
hideFieldName.push(item.field);
|
|
181
183
|
item.isHidden();
|
|
182
184
|
}
|
|
183
|
-
|
|
185
|
+
let tempSchema = item.getFormItemSchema();
|
|
186
|
+
if (item.slot == "groupDatetime") {
|
|
187
|
+
tempSchema["colProps"] = { xs: 24, sm: 24, md: 12, lg: 8, xl: 8 };
|
|
188
|
+
}
|
|
189
|
+
schemaArray.push(tempSchema);
|
|
184
190
|
}
|
|
185
191
|
hideList.value = hideFieldName;
|
|
186
192
|
formSchemas.value = schemaArray;
|
|
@@ -344,7 +350,7 @@ const _sfc_main = {
|
|
|
344
350
|
};
|
|
345
351
|
}
|
|
346
352
|
};
|
|
347
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
353
|
+
const _withScopeId = (n) => (pushScopeId("data-v-716ddf4f"), n = n(), popScopeId(), n);
|
|
348
354
|
const _hoisted_1 = {
|
|
349
355
|
key: 0,
|
|
350
356
|
class: "jeecg-basic-table-form-container p-0"
|
|
@@ -468,5 +474,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
468
474
|
}, 8, ["onRegister"])
|
|
469
475
|
])) : createCommentVNode("", true);
|
|
470
476
|
}
|
|
471
|
-
var OnlineQueryForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
477
|
+
var OnlineQueryForm = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-716ddf4f"]]);
|
|
472
478
|
export { OnlineQueryForm as default };
|
package/OnlineSearchFormItem.js
CHANGED
|
@@ -16,10 +16,13 @@ var __spreadValues = (a, b) => {
|
|
|
16
16
|
};
|
|
17
17
|
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, normalizeClass, withCtx, createElementVNode, toDisplayString, createElementBlock, Fragment, createVNode, renderList, createTextVNode, mergeProps, useCssVars, pushScopeId, popScopeId } from "vue";
|
|
18
18
|
import { JDictSelectTag, JTreeSelect, JCategorySelect, JSelectUser, JSelectUserByDept, JSelectDept, JPopup, JAreaLinkage, JAreaSelect, JSelectMultiple } from "/@/components/Form";
|
|
19
|
-
import
|
|
19
|
+
import JOnlineSearchSelect from "./JOnlineSearchSelect.js";
|
|
20
|
+
import { _ as _export_sfc } from "./index.js";
|
|
21
|
+
import "@vueuse/core";
|
|
20
22
|
import "/@/utils/http/axios";
|
|
21
23
|
import "/@/hooks/web/useMessage";
|
|
22
|
-
import "
|
|
24
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
25
|
+
import "vue-router";
|
|
23
26
|
var OnlineSearchFormItem_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
24
27
|
const __default__ = defineComponent({
|
|
25
28
|
name: "OnlineSearchFormItem",
|
|
@@ -216,7 +219,7 @@ const __default__ = defineComponent({
|
|
|
216
219
|
});
|
|
217
220
|
const __injectCSSVars__ = () => {
|
|
218
221
|
useCssVars((_ctx) => ({
|
|
219
|
-
"
|
|
222
|
+
"1e41a56d": _ctx.labelTextMaxWidth
|
|
220
223
|
}));
|
|
221
224
|
};
|
|
222
225
|
const __setup__ = __default__.setup;
|
|
@@ -225,7 +228,7 @@ __default__.setup = __setup__ ? (props, ctx) => {
|
|
|
225
228
|
return __setup__(props, ctx);
|
|
226
229
|
} : __injectCSSVars__;
|
|
227
230
|
const _sfc_main = __default__;
|
|
228
|
-
const _withScopeId = (n) => (pushScopeId("data-v-
|
|
231
|
+
const _withScopeId = (n) => (pushScopeId("data-v-76dfb908"), n = n(), popScopeId(), n);
|
|
229
232
|
const _hoisted_1 = ["title"];
|
|
230
233
|
const _hoisted_2 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "group-query-strig" }, "~", -1));
|
|
231
234
|
const _hoisted_3 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("span", { class: "group-query-strig" }, "~", -1));
|
|
@@ -429,5 +432,5 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
429
432
|
_: 1
|
|
430
433
|
}, 8, ["labelCol"]);
|
|
431
434
|
}
|
|
432
|
-
var OnlineSearchFormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-
|
|
435
|
+
var OnlineSearchFormItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-76dfb908"]]);
|
|
433
436
|
export { OnlineSearchFormItem as default };
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
var __async = (__this, __arguments, generator) => {
|
|
2
|
+
return new Promise((resolve, reject) => {
|
|
3
|
+
var fulfilled = (value) => {
|
|
4
|
+
try {
|
|
5
|
+
step(generator.next(value));
|
|
6
|
+
} catch (e) {
|
|
7
|
+
reject(e);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
var rejected = (value) => {
|
|
11
|
+
try {
|
|
12
|
+
step(generator.throw(value));
|
|
13
|
+
} catch (e) {
|
|
14
|
+
reject(e);
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
18
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
import { defineComponent, ref, watch, resolveComponent, openBlock, createBlock, withCtx, createElementBlock, Fragment, renderList, createElementVNode, toDisplayString } from "vue";
|
|
22
|
+
import { defHttp } from "/@/utils/http/axios";
|
|
23
|
+
import { useMessage } from "/@/hooks/web/useMessage";
|
|
24
|
+
import { _ as _export_sfc } from "./index.js";
|
|
25
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
26
|
+
import "vue-router";
|
|
27
|
+
const SELECT_OPTIONS_URL = "/online/cgform/api/querySelectOptions";
|
|
28
|
+
const _sfc_main = defineComponent({
|
|
29
|
+
name: "OnlineSelectCascade",
|
|
30
|
+
props: {
|
|
31
|
+
table: { type: String, default: "" },
|
|
32
|
+
txt: { type: String, default: "" },
|
|
33
|
+
store: { type: String, default: "" },
|
|
34
|
+
idField: { type: String, default: "" },
|
|
35
|
+
pidField: { type: String, default: "" },
|
|
36
|
+
pidValue: { type: String, default: "-1" },
|
|
37
|
+
origin: { type: Boolean, default: false },
|
|
38
|
+
condition: { type: String, default: "" },
|
|
39
|
+
value: { type: String, default: "" },
|
|
40
|
+
isNumber: { type: Boolean, default: false },
|
|
41
|
+
placeholder: { type: String, default: "\u8BF7\u9009\u62E9" }
|
|
42
|
+
},
|
|
43
|
+
emits: ["change", "next"],
|
|
44
|
+
setup(props, { emit }) {
|
|
45
|
+
const { createMessage: $message } = useMessage();
|
|
46
|
+
const selectedValue = ref("");
|
|
47
|
+
const dictOptions = ref([]);
|
|
48
|
+
const optionsLoad = ref(true);
|
|
49
|
+
function handleChange(value) {
|
|
50
|
+
console.log("handleChange", value);
|
|
51
|
+
let temp = value || "";
|
|
52
|
+
emit("change", temp);
|
|
53
|
+
valueChangeThenEmitNext(temp);
|
|
54
|
+
}
|
|
55
|
+
watch(
|
|
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(), createBlock(_component_a_select, {
|
|
202
|
+
placeholder: _ctx.placeholder,
|
|
203
|
+
value: _ctx.selectedValue,
|
|
204
|
+
onChange: _ctx.handleChange,
|
|
205
|
+
allowClear: "",
|
|
206
|
+
style: { "width": "100%" }
|
|
207
|
+
}, {
|
|
208
|
+
default: withCtx(() => [
|
|
209
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.dictOptions, (item, index) => {
|
|
210
|
+
return openBlock(), createBlock(_component_a_select_option, {
|
|
211
|
+
key: index,
|
|
212
|
+
value: item.store
|
|
213
|
+
}, {
|
|
214
|
+
default: withCtx(() => [
|
|
215
|
+
createElementVNode("span", {
|
|
216
|
+
style: { "display": "inline-block", "width": "100%" },
|
|
217
|
+
title: item.label
|
|
218
|
+
}, toDisplayString(item.label), 9, _hoisted_1)
|
|
219
|
+
]),
|
|
220
|
+
_: 2
|
|
221
|
+
}, 1032, ["value"]);
|
|
222
|
+
}), 128))
|
|
223
|
+
]),
|
|
224
|
+
_: 1
|
|
225
|
+
}, 8, ["placeholder", "value", "onChange"]);
|
|
226
|
+
}
|
|
227
|
+
var OnlineSelectCascade = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
228
|
+
export { OnlineSelectCascade as default };
|
package/OnlineSubFormDetail.js
CHANGED
|
@@ -34,6 +34,9 @@ import "/@/store/modules/user";
|
|
|
34
34
|
import "/@/utils";
|
|
35
35
|
import "/@/utils/desform/customExpression";
|
|
36
36
|
import "/@/components/Form/src/componentMap";
|
|
37
|
+
import "./OnlineSelectCascade.js";
|
|
38
|
+
import "/@/components/jeecg/OnLine/JPopupOnlReport.vue";
|
|
39
|
+
import "vue-router";
|
|
37
40
|
import "/@/store/modules/permission";
|
|
38
41
|
import "/@/utils/propTypes";
|
|
39
42
|
import "@ant-design/icons-vue";
|
|
@@ -47,14 +50,13 @@ import "./toString.js";
|
|
|
47
50
|
import "./_arrayPush.js";
|
|
48
51
|
import "/@/components/Table";
|
|
49
52
|
import "/@/hooks/system/useListPage";
|
|
50
|
-
import "vue-router";
|
|
51
53
|
import "/@/components/Form/src/utils/Area";
|
|
52
54
|
import "/@/components/Preview/index";
|
|
53
55
|
import "./LinkTableListPiece.js";
|
|
54
|
-
import "@vueuse/core";
|
|
55
56
|
import "/@/utils/auth";
|
|
56
57
|
import "./JModalTip.js";
|
|
57
58
|
import "ant-design-vue";
|
|
59
|
+
import "@vueuse/core";
|
|
58
60
|
import "/@/utils/dict";
|
|
59
61
|
import "/@/utils/dict/index";
|
|
60
62
|
import "/@/api/common/api";
|