@oinone/kunlun-vue-admin-base 6.3.0 → 6.3.2
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/dist/oinone-kunlun-vue-admin-base.css +1 -1
- package/dist/oinone-kunlun-vue-admin-base.esm.js +100 -73
- package/dist/oinone-kunlun-vue-admin-base.scss +1 -1
- package/dist/types/src/file/excel/typing/index.d.ts +3 -1
- package/dist/types/src/view/search/SearchWidget.d.ts +1 -0
- package/package.json +8 -8
- package/src/field/transfer/ExportFieldTransfer.ts +4 -2
- package/src/file/excel/action/ExportWorkbookActionWidget.ts +18 -4
- package/src/file/excel/typing/index.ts +1 -1
- package/src/view/search/DefaultSearch.vue +36 -32
- package/src/view/search/SearchWidget.ts +14 -1
|
@@ -67648,11 +67648,12 @@ let ExportFieldTransfer = class ExportFieldTransfer extends FormTransferFieldWid
|
|
|
67648
67648
|
return [];
|
|
67649
67649
|
}
|
|
67650
67650
|
const tableFields = (_b = this.metadataRuntimeContext.parentContext) === null || _b === void 0 ? void 0 : _b.model.modelFields.map((f) => {
|
|
67651
|
+
var _a;
|
|
67651
67652
|
const target = this.options.find((o) => `${o.model}+${o.field}` === `${f.model}+${f.data}`);
|
|
67652
67653
|
if (!target) {
|
|
67653
67654
|
return undefined;
|
|
67654
67655
|
}
|
|
67655
|
-
return Object.assign(Object.assign({}, target), { displayName: f.label || target.displayName, invisible: f.invisible });
|
|
67656
|
+
return Object.assign(Object.assign({}, target), { displayName: f.label || target.displayName, invisible: f.invisible, optionLabel: (_a = f.template) === null || _a === void 0 ? void 0 : _a.optionLabel });
|
|
67656
67657
|
}).filter((v) => !!v && BooleanHelper.isFalse(v.invisible));
|
|
67657
67658
|
return (tableFields || []);
|
|
67658
67659
|
}
|
|
@@ -67663,11 +67664,12 @@ let ExportFieldTransfer = class ExportFieldTransfer extends FormTransferFieldWid
|
|
|
67663
67664
|
}
|
|
67664
67665
|
const tableFields = (_a = this.metadataRuntimeContext.parentContext) === null || _a === void 0 ? void 0 : _a.model.modelFields;
|
|
67665
67666
|
return super.generatorFullOptions(content.map((o) => {
|
|
67667
|
+
var _a;
|
|
67666
67668
|
const target = tableFields === null || tableFields === void 0 ? void 0 : tableFields.find((f) => `${o.model}+${o.field}` === `${f.model}+${f.data}`);
|
|
67667
67669
|
if (!target) {
|
|
67668
67670
|
return o;
|
|
67669
67671
|
}
|
|
67670
|
-
return Object.assign(Object.assign({}, o), { displayName: target.label || o.displayName });
|
|
67672
|
+
return Object.assign(Object.assign({}, o), { displayName: target.label || o.displayName, optionLabel: (_a = target.template) === null || _a === void 0 ? void 0 : _a.optionLabel });
|
|
67671
67673
|
}));
|
|
67672
67674
|
}
|
|
67673
67675
|
backfillSelectedValues() {
|
|
@@ -70812,32 +70814,38 @@ var script$1h = defineComponent({
|
|
|
70812
70814
|
}
|
|
70813
70815
|
const finalExpandSize = props.invisibleSearch ? props.foldSize + 1 : props.foldSize;
|
|
70814
70816
|
appendFieldDslDefinition(fields, widgets, finalExpandSize, props.foldSize, props.cateFields);
|
|
70815
|
-
|
|
70816
|
-
|
|
70817
|
-
|
|
70817
|
+
if (fields.length) {
|
|
70818
|
+
hasExpandButton = fields.length > finalExpandSize;
|
|
70819
|
+
if (hasExpandButton) {
|
|
70820
|
+
fields = fields.slice(0, finalExpandSize);
|
|
70821
|
+
}
|
|
70822
|
+
if (!props.invisibleSearch) {
|
|
70823
|
+
const searchActionBar = createSearchBar(false, {
|
|
70824
|
+
hasExpandButton,
|
|
70825
|
+
showSearchPrefer: props.showSearchPrefer,
|
|
70826
|
+
onSearch,
|
|
70827
|
+
onReset,
|
|
70828
|
+
onExpand,
|
|
70829
|
+
translate: props.translate,
|
|
70830
|
+
preferProps: {
|
|
70831
|
+
selected: props.selectedPrefer,
|
|
70832
|
+
options: props.searchPreferOptions,
|
|
70833
|
+
onLoad: props.onLoadSearchPreferOptions,
|
|
70834
|
+
onCreate: props.onCreateSearchPrefer,
|
|
70835
|
+
onUpdate: props.onUpdateSearchPrefer,
|
|
70836
|
+
onRemove: props.onRemoveSearchPrefer,
|
|
70837
|
+
onSelect: props.onSelectSearchPrefer,
|
|
70838
|
+
onUnselect: props.onUnselectSearchPrefer
|
|
70839
|
+
}
|
|
70840
|
+
});
|
|
70841
|
+
invisible = !fields.length;
|
|
70842
|
+
const searchBarCol = createSearchBarCol(searchActionBar, (props.foldSize - fields.length) * (DEFAULT_COLS$1 / (props.foldSize + 1)), invisible, props.foldSize);
|
|
70843
|
+
fields.push(searchBarCol);
|
|
70844
|
+
}
|
|
70818
70845
|
}
|
|
70819
|
-
|
|
70820
|
-
|
|
70821
|
-
|
|
70822
|
-
showSearchPrefer: props.showSearchPrefer,
|
|
70823
|
-
onSearch,
|
|
70824
|
-
onReset,
|
|
70825
|
-
onExpand,
|
|
70826
|
-
translate: props.translate,
|
|
70827
|
-
preferProps: {
|
|
70828
|
-
selected: props.selectedPrefer,
|
|
70829
|
-
options: props.searchPreferOptions,
|
|
70830
|
-
onLoad: props.onLoadSearchPreferOptions,
|
|
70831
|
-
onCreate: props.onCreateSearchPrefer,
|
|
70832
|
-
onUpdate: props.onUpdateSearchPrefer,
|
|
70833
|
-
onRemove: props.onRemoveSearchPrefer,
|
|
70834
|
-
onSelect: props.onSelectSearchPrefer,
|
|
70835
|
-
onUnselect: props.onUnselectSearchPrefer
|
|
70836
|
-
}
|
|
70837
|
-
});
|
|
70838
|
-
invisible = !fields.length;
|
|
70839
|
-
const searchBarCol = createSearchBarCol(searchActionBar, (props.foldSize - fields.length) * (DEFAULT_COLS$1 / (props.foldSize + 1)), invisible, props.foldSize);
|
|
70840
|
-
fields.push(searchBarCol);
|
|
70846
|
+
else {
|
|
70847
|
+
hasExpandButton = false;
|
|
70848
|
+
fields = widgets;
|
|
70841
70849
|
}
|
|
70842
70850
|
defaultChildren.push(withDirectives(DslRender.render({
|
|
70843
70851
|
internal: true,
|
|
@@ -71116,6 +71124,17 @@ let SearchWidget = class SearchWidget extends BaseSearchWidget {
|
|
|
71116
71124
|
super.$$mounted();
|
|
71117
71125
|
this.isExpand = BooleanHelper.toBoolean(this.urlParameters.expand) || false;
|
|
71118
71126
|
}
|
|
71127
|
+
childrenInvisibleProcess() {
|
|
71128
|
+
if (this.disabledExpand && !this.invisibleSearch) {
|
|
71129
|
+
const children = this.getChildren();
|
|
71130
|
+
const lastChild = children[children.length - 1];
|
|
71131
|
+
if (children.length === 2 && lastChild instanceof DefaultRowWidget) {
|
|
71132
|
+
return isAllInvisible(children.slice(0, children.length - 1));
|
|
71133
|
+
}
|
|
71134
|
+
return isAllInvisible(children);
|
|
71135
|
+
}
|
|
71136
|
+
return super.childrenInvisibleProcess();
|
|
71137
|
+
}
|
|
71119
71138
|
};
|
|
71120
71139
|
__decorate([
|
|
71121
71140
|
Widget.Reactive(),
|
|
@@ -95757,54 +95776,62 @@ let ExportWorkbookActionWidget = class ExportWorkbookActionWidget extends Abstra
|
|
|
95757
95776
|
return BooleanHelper.isTrue((_b = (_a = this.metadataRuntimeContext.viewAction) === null || _a === void 0 ? void 0 : _a.template) === null || _b === void 0 ? void 0 : _b.sync);
|
|
95758
95777
|
}
|
|
95759
95778
|
generatorGQLByTask(task, condition) {
|
|
95760
|
-
|
|
95761
|
-
|
|
95762
|
-
|
|
95763
|
-
|
|
95764
|
-
|
|
95765
|
-
|
|
95766
|
-
|
|
95767
|
-
rsql = condition.toString();
|
|
95768
|
-
}
|
|
95769
|
-
const conditionWrapper = condition
|
|
95770
|
-
? {
|
|
95771
|
-
rsql,
|
|
95772
|
-
queryData
|
|
95773
|
-
}
|
|
95774
|
-
: undefined;
|
|
95775
|
-
const modelName = this.model.name || 'excelExportTask';
|
|
95776
|
-
return GQL.mutation(`${modelName}Mutation`, 'createExportTask')
|
|
95777
|
-
.buildRequest((builder) => {
|
|
95778
|
-
builder.buildObjectParameter('data', (builder) => {
|
|
95779
|
-
const { workbookDefinition, exportMethod, selectedFields } = task;
|
|
95780
|
-
builder.stringParameter('model', task.model);
|
|
95781
|
-
builder.booleanParameter('sync', true);
|
|
95782
|
-
if (workbookDefinition) {
|
|
95783
|
-
builder.buildObjectParameter('workbookDefinition', (builder) => {
|
|
95784
|
-
builder.stringParameter('id', workbookDefinition.id);
|
|
95785
|
-
});
|
|
95786
|
-
}
|
|
95787
|
-
if (conditionWrapper) {
|
|
95788
|
-
builder.buildObjectParameter('conditionWrapper', (builder) => {
|
|
95789
|
-
builder.stringParameter('rsql', conditionWrapper.rsql);
|
|
95790
|
-
builder.stringParameter('queryData', conditionWrapper.queryData);
|
|
95791
|
-
});
|
|
95792
|
-
}
|
|
95793
|
-
if (exportMethod) {
|
|
95794
|
-
builder.enumerationParameter('exportMethod', exportMethod);
|
|
95779
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95780
|
+
let queryData = '{}';
|
|
95781
|
+
let rsql = condition;
|
|
95782
|
+
if (condition instanceof Condition) {
|
|
95783
|
+
const conditionBodyData = condition.getConditionBodyData();
|
|
95784
|
+
if (conditionBodyData && Object.keys(conditionBodyData).length) {
|
|
95785
|
+
queryData = GraphqlHelper.serializableObject(conditionBodyData);
|
|
95795
95786
|
}
|
|
95796
|
-
|
|
95797
|
-
|
|
95798
|
-
|
|
95799
|
-
|
|
95800
|
-
|
|
95787
|
+
rsql = condition.toString();
|
|
95788
|
+
}
|
|
95789
|
+
const conditionWrapper = condition
|
|
95790
|
+
? {
|
|
95791
|
+
rsql,
|
|
95792
|
+
queryData
|
|
95801
95793
|
}
|
|
95802
|
-
|
|
95803
|
-
|
|
95804
|
-
.
|
|
95805
|
-
|
|
95806
|
-
|
|
95807
|
-
.
|
|
95794
|
+
: undefined;
|
|
95795
|
+
const modelName = this.model.name || 'excelExportTask';
|
|
95796
|
+
const excelExportTaskModel = yield ModelCache.get('file.ExcelExportTask');
|
|
95797
|
+
const selectedFieldsField = excelExportTaskModel === null || excelExportTaskModel === void 0 ? void 0 : excelExportTaskModel.modelFields.find((v) => v.data === 'selectedFields');
|
|
95798
|
+
const hasOptionLabel = selectedFieldsField.references === 'file.ExcelModelField';
|
|
95799
|
+
return GQL.mutation(`${modelName}Mutation`, 'createExportTask')
|
|
95800
|
+
.buildRequest((builder) => {
|
|
95801
|
+
builder.buildObjectParameter('data', (builder) => {
|
|
95802
|
+
const { workbookDefinition, exportMethod, selectedFields } = task;
|
|
95803
|
+
builder.stringParameter('model', task.model);
|
|
95804
|
+
builder.booleanParameter('sync', true);
|
|
95805
|
+
if (workbookDefinition) {
|
|
95806
|
+
builder.buildObjectParameter('workbookDefinition', (builder) => {
|
|
95807
|
+
builder.stringParameter('id', workbookDefinition.id);
|
|
95808
|
+
});
|
|
95809
|
+
}
|
|
95810
|
+
if (conditionWrapper) {
|
|
95811
|
+
builder.buildObjectParameter('conditionWrapper', (builder) => {
|
|
95812
|
+
builder.stringParameter('rsql', conditionWrapper.rsql);
|
|
95813
|
+
builder.stringParameter('queryData', conditionWrapper.queryData);
|
|
95814
|
+
});
|
|
95815
|
+
}
|
|
95816
|
+
if (exportMethod) {
|
|
95817
|
+
builder.enumerationParameter('exportMethod', exportMethod);
|
|
95818
|
+
}
|
|
95819
|
+
if (selectedFields === null || selectedFields === void 0 ? void 0 : selectedFields.length) {
|
|
95820
|
+
builder.buildArrayParameter('selectedFields', selectedFields, (builder, value) => {
|
|
95821
|
+
builder.stringParameter('field', value.data);
|
|
95822
|
+
builder.stringParameter('displayName', value.displayName);
|
|
95823
|
+
if (hasOptionLabel) {
|
|
95824
|
+
builder.stringParameter('optionLabel', value.optionLabel);
|
|
95825
|
+
}
|
|
95826
|
+
});
|
|
95827
|
+
}
|
|
95828
|
+
});
|
|
95829
|
+
})
|
|
95830
|
+
.buildResponse((builder) => {
|
|
95831
|
+
builder.parameter('id');
|
|
95832
|
+
})
|
|
95833
|
+
.toString();
|
|
95834
|
+
});
|
|
95808
95835
|
}
|
|
95809
95836
|
createTask(searchRuntimeContext, task, condition) {
|
|
95810
95837
|
return __awaiter(this, void 0, void 0, function* () {
|