@dt-frames/ui 1.0.15 → 1.0.19
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/es/components/curd/src/components/dialog.d.ts +0 -1
- package/es/components/forms/src/hooks/helper.d.ts +2 -0
- package/es/components/forms/src/index.d.ts +0 -1
- package/es/components/table/src/components/editable/EditTableCell.d.ts +3 -0
- package/es/components/table/src/components/editable/index.d.ts +1 -1
- package/es/components/table/src/index.d.ts +3 -0
- package/es/components/table/src/types/table.type.d.ts +2 -0
- package/es/components/upload/src/upload.d.ts +3 -0
- package/es/index.js +166 -27
- package/es/style/components/table/index.less +4 -0
- package/package.json +1 -1
- package/es/components/upload/src/index.d.ts +0 -2811
|
@@ -144,7 +144,6 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
144
144
|
getFormBindValue: import("vue").ComputedRef<Recordable<any>>;
|
|
145
145
|
getFormClass: import("vue").ComputedRef<(string | {
|
|
146
146
|
'basic-form--compact': boolean;
|
|
147
|
-
'basic-form--search': boolean;
|
|
148
147
|
})[]>;
|
|
149
148
|
formModel: Recordable<any>;
|
|
150
149
|
getLayout: import("vue").ComputedRef<"vertical" | "horizontal" | "inline">;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { ComponentType } from "../types/form.type";
|
|
2
2
|
import type { ValidationRule } from 'ant-design-vue/lib/form/Form';
|
|
3
3
|
export declare function createPlaceholder(component: ComponentType): "" | "请输入" | "请选择" | "请设置图标";
|
|
4
|
+
export declare const SINGLE_DATA_TYPE: string[];
|
|
5
|
+
export declare const MULTIFY_DATA_TYPE: string[];
|
|
4
6
|
export declare function setComponentRuleType(rule: ValidationRule, component: ComponentType, valueFormat: string): void;
|
|
5
7
|
export declare function handleInputNumberValue(component?: ComponentType, val?: any): any;
|
|
6
8
|
export declare const datePickerType: string[];
|
|
@@ -54,7 +54,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
54
54
|
getFormBindValue: import("vue").ComputedRef<Recordable<any>>;
|
|
55
55
|
getFormClass: import("vue").ComputedRef<(string | {
|
|
56
56
|
'basic-form--compact': boolean;
|
|
57
|
-
'basic-form--search': boolean;
|
|
58
57
|
})[]>;
|
|
59
58
|
formModel: Recordable<any>;
|
|
60
59
|
getLayout: import("vue").ComputedRef<"vertical" | "horizontal" | "inline">;
|
|
@@ -24,6 +24,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
24
24
|
default: () => BasicColumn;
|
|
25
25
|
};
|
|
26
26
|
index: NumberConstructor;
|
|
27
|
+
dataSource: PropType<Recordable<any>[]>;
|
|
27
28
|
}, {
|
|
28
29
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
29
30
|
value: {
|
|
@@ -48,6 +49,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
48
49
|
default: () => BasicColumn;
|
|
49
50
|
};
|
|
50
51
|
index: NumberConstructor;
|
|
52
|
+
dataSource: PropType<Recordable<any>[]>;
|
|
51
53
|
}>> & {
|
|
52
54
|
[x: string & `on${string}`]: ((...args: any[]) => any) | ((...args: unknown[]) => any);
|
|
53
55
|
}>>;
|
|
@@ -81,6 +83,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
81
83
|
default: () => BasicColumn;
|
|
82
84
|
};
|
|
83
85
|
index: NumberConstructor;
|
|
86
|
+
dataSource: PropType<Recordable<any>[]>;
|
|
84
87
|
}>>, {
|
|
85
88
|
value: string;
|
|
86
89
|
column: BasicColumn;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BasicColumn } from "../../types/table.type";
|
|
2
|
-
declare function renderEditCell(column: BasicColumn): ({ text: value, record, index }: {
|
|
2
|
+
declare function renderEditCell(column: BasicColumn, dataSource: any): ({ text: value, record, index }: {
|
|
3
3
|
text: any;
|
|
4
4
|
record: any;
|
|
5
5
|
index: any;
|
|
@@ -268,6 +268,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
268
268
|
rowKey: string;
|
|
269
269
|
columns: import("./types/table.type").BasicColumn[];
|
|
270
270
|
tableLayout: string;
|
|
271
|
+
class: (string | {
|
|
272
|
+
'dt-table-no-pagation': boolean;
|
|
273
|
+
})[];
|
|
271
274
|
customRow: (record: Recordable<any>, index: number) => {
|
|
272
275
|
onClick: (e: any) => void;
|
|
273
276
|
onDblclick: (event: Event) => void;
|
|
@@ -1284,6 +1284,9 @@ declare const _sfc_main: import("vue").DefineComponent<{
|
|
|
1284
1284
|
rowKey: string;
|
|
1285
1285
|
columns: import("../../table/src/types/table.type").BasicColumn[];
|
|
1286
1286
|
tableLayout: string;
|
|
1287
|
+
class: (string | {
|
|
1288
|
+
'dt-table-no-pagation': boolean;
|
|
1289
|
+
})[];
|
|
1287
1290
|
customRow: (record: import("@dt-frames/core").Recordable<any>, index: number) => {
|
|
1288
1291
|
onClick: (e: any) => void;
|
|
1289
1292
|
onDblclick: (event: Event) => void;
|
package/es/index.js
CHANGED
|
@@ -2050,7 +2050,7 @@ function useModalOut() {
|
|
|
2050
2050
|
if (!data)
|
|
2051
2051
|
return;
|
|
2052
2052
|
if (openOnSet) {
|
|
2053
|
-
dataTransfer[id] = toRaw(data);
|
|
2053
|
+
dataTransfer[id] = { ...toRaw(data) };
|
|
2054
2054
|
return;
|
|
2055
2055
|
}
|
|
2056
2056
|
const equal = isEqual(toRaw(dataTransfer[id]), toRaw(data));
|
|
@@ -2894,8 +2894,10 @@ function createPlaceholder(component) {
|
|
|
2894
2894
|
}
|
|
2895
2895
|
return "";
|
|
2896
2896
|
}
|
|
2897
|
+
const SINGLE_DATA_TYPE = ["DatePicker", "MonthPicker", "WeekPicker", "TimePicker"];
|
|
2898
|
+
const MULTIFY_DATA_TYPE = ["RangePicker"];
|
|
2897
2899
|
function setComponentRuleType(rule, component, valueFormat) {
|
|
2898
|
-
if (
|
|
2900
|
+
if (SINGLE_DATA_TYPE.includes(component)) {
|
|
2899
2901
|
rule.type = valueFormat ? "string" : "object";
|
|
2900
2902
|
} else if (["RangePicker", "Upload", "CheckboxGroup", "TimePicker"].includes(component)) {
|
|
2901
2903
|
rule.type = "array";
|
|
@@ -2916,7 +2918,7 @@ function handleInputNumberValue(component, val) {
|
|
|
2916
2918
|
}
|
|
2917
2919
|
return val;
|
|
2918
2920
|
}
|
|
2919
|
-
const datePickerType = [
|
|
2921
|
+
const datePickerType = [...SINGLE_DATA_TYPE, ...MULTIFY_DATA_TYPE];
|
|
2920
2922
|
const BasicProps$1 = {
|
|
2921
2923
|
mode: {
|
|
2922
2924
|
type: String,
|
|
@@ -3042,11 +3044,7 @@ var _sfc_main$P = defineComponent({
|
|
|
3042
3044
|
props: cProps = {}
|
|
3043
3045
|
} = schema2;
|
|
3044
3046
|
if (isFunction(cProps)) {
|
|
3045
|
-
cProps = (_a = cProps({
|
|
3046
|
-
schema: schema2,
|
|
3047
|
-
formModel,
|
|
3048
|
-
formActionType
|
|
3049
|
-
})) != null ? _a : {};
|
|
3047
|
+
cProps = (_a = cProps(formModel)) != null ? _a : {};
|
|
3050
3048
|
}
|
|
3051
3049
|
if (schema2.component === "Divider") {
|
|
3052
3050
|
cProps = Object.assign({
|
|
@@ -3310,7 +3308,7 @@ var _sfc_main$P = defineComponent({
|
|
|
3310
3308
|
error("\u8BF7\u914D\u7F6Erender\u51FD\u6570");
|
|
3311
3309
|
return;
|
|
3312
3310
|
}
|
|
3313
|
-
return createVNode(Col, {
|
|
3311
|
+
return unref(getShow) && createVNode(Col, {
|
|
3314
3312
|
"span": 24
|
|
3315
3313
|
}, _isSlot(_slot2 = render2(values)) ? _slot2 : {
|
|
3316
3314
|
default: () => [_slot2]
|
|
@@ -3757,6 +3755,12 @@ function useFormValues({
|
|
|
3757
3755
|
if (!key || Array.isArray(value) && value.length === 0 || isFunction(value)) {
|
|
3758
3756
|
continue;
|
|
3759
3757
|
}
|
|
3758
|
+
const schema = unref(getSchema).filter((it) => it.name === key)[0];
|
|
3759
|
+
if (SINGLE_DATA_TYPE.includes(schema == null ? void 0 : schema.component)) {
|
|
3760
|
+
value = dayjs(value).valueOf();
|
|
3761
|
+
} else if (MULTIFY_DATA_TYPE.includes(schema == null ? void 0 : schema.component)) {
|
|
3762
|
+
value = value.map((item) => dayjs(item).valueOf());
|
|
3763
|
+
}
|
|
3760
3764
|
if (isString(value)) {
|
|
3761
3765
|
value = value.trim();
|
|
3762
3766
|
}
|
|
@@ -3769,7 +3773,7 @@ function useFormValues({
|
|
|
3769
3773
|
const obj = {};
|
|
3770
3774
|
schema.forEach((item) => {
|
|
3771
3775
|
const { props = {}, name, component } = item;
|
|
3772
|
-
let { defaultValue: defaultValue2, mode, format, treeCheckable } = isFunction(props) ? props() : props;
|
|
3776
|
+
let { defaultValue: defaultValue2, mode, format, treeCheckable } = isFunction(props) ? props({ formModel }) : props;
|
|
3773
3777
|
const names = isString(name) ? [name] : name;
|
|
3774
3778
|
if (defaultValue2 !== null && defaultValue2 !== void 0) {
|
|
3775
3779
|
if (datePickerType.includes(component)) {
|
|
@@ -3803,6 +3807,8 @@ function useFormValues({
|
|
|
3803
3807
|
}
|
|
3804
3808
|
}
|
|
3805
3809
|
} else {
|
|
3810
|
+
if (!names)
|
|
3811
|
+
return;
|
|
3806
3812
|
names.forEach((key, index) => {
|
|
3807
3813
|
let defaultV = null;
|
|
3808
3814
|
if (component === "TreeSelect" && (mode === "multiple" || treeCheckable) || component === "Select" && mode === "multiple") {
|
|
@@ -3819,6 +3825,100 @@ function useFormValues({
|
|
|
3819
3825
|
initDefault
|
|
3820
3826
|
};
|
|
3821
3827
|
}
|
|
3828
|
+
var weekday$1 = { exports: {} };
|
|
3829
|
+
(function(module, exports) {
|
|
3830
|
+
!function(e, t) {
|
|
3831
|
+
module.exports = t();
|
|
3832
|
+
}(commonjsGlobal, function() {
|
|
3833
|
+
return function(e, t) {
|
|
3834
|
+
t.prototype.weekday = function(e2) {
|
|
3835
|
+
var t2 = this.$locale().weekStart || 0, i = this.$W, n = (i < t2 ? i + 7 : i) - t2;
|
|
3836
|
+
return this.$utils().u(e2) ? n : this.subtract(n, "day").add(e2, "day");
|
|
3837
|
+
};
|
|
3838
|
+
};
|
|
3839
|
+
});
|
|
3840
|
+
})(weekday$1);
|
|
3841
|
+
var weekday = weekday$1.exports;
|
|
3842
|
+
var localeData$1 = { exports: {} };
|
|
3843
|
+
(function(module, exports) {
|
|
3844
|
+
!function(n, e) {
|
|
3845
|
+
module.exports = e();
|
|
3846
|
+
}(commonjsGlobal, function() {
|
|
3847
|
+
return function(n, e, t) {
|
|
3848
|
+
var r = e.prototype, o = function(n2) {
|
|
3849
|
+
return n2 && (n2.indexOf ? n2 : n2.s);
|
|
3850
|
+
}, u = function(n2, e2, t2, r2, u2) {
|
|
3851
|
+
var i2 = n2.name ? n2 : n2.$locale(), a2 = o(i2[e2]), s2 = o(i2[t2]), f = a2 || s2.map(function(n3) {
|
|
3852
|
+
return n3.slice(0, r2);
|
|
3853
|
+
});
|
|
3854
|
+
if (!u2)
|
|
3855
|
+
return f;
|
|
3856
|
+
var d = i2.weekStart;
|
|
3857
|
+
return f.map(function(n3, e3) {
|
|
3858
|
+
return f[(e3 + (d || 0)) % 7];
|
|
3859
|
+
});
|
|
3860
|
+
}, i = function() {
|
|
3861
|
+
return t.Ls[t.locale()];
|
|
3862
|
+
}, a = function(n2, e2) {
|
|
3863
|
+
return n2.formats[e2] || function(n3) {
|
|
3864
|
+
return n3.replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g, function(n4, e3, t2) {
|
|
3865
|
+
return e3 || t2.slice(1);
|
|
3866
|
+
});
|
|
3867
|
+
}(n2.formats[e2.toUpperCase()]);
|
|
3868
|
+
}, s = function() {
|
|
3869
|
+
var n2 = this;
|
|
3870
|
+
return { months: function(e2) {
|
|
3871
|
+
return e2 ? e2.format("MMMM") : u(n2, "months");
|
|
3872
|
+
}, monthsShort: function(e2) {
|
|
3873
|
+
return e2 ? e2.format("MMM") : u(n2, "monthsShort", "months", 3);
|
|
3874
|
+
}, firstDayOfWeek: function() {
|
|
3875
|
+
return n2.$locale().weekStart || 0;
|
|
3876
|
+
}, weekdays: function(e2) {
|
|
3877
|
+
return e2 ? e2.format("dddd") : u(n2, "weekdays");
|
|
3878
|
+
}, weekdaysMin: function(e2) {
|
|
3879
|
+
return e2 ? e2.format("dd") : u(n2, "weekdaysMin", "weekdays", 2);
|
|
3880
|
+
}, weekdaysShort: function(e2) {
|
|
3881
|
+
return e2 ? e2.format("ddd") : u(n2, "weekdaysShort", "weekdays", 3);
|
|
3882
|
+
}, longDateFormat: function(e2) {
|
|
3883
|
+
return a(n2.$locale(), e2);
|
|
3884
|
+
}, meridiem: this.$locale().meridiem, ordinal: this.$locale().ordinal };
|
|
3885
|
+
};
|
|
3886
|
+
r.localeData = function() {
|
|
3887
|
+
return s.bind(this)();
|
|
3888
|
+
}, t.localeData = function() {
|
|
3889
|
+
var n2 = i();
|
|
3890
|
+
return { firstDayOfWeek: function() {
|
|
3891
|
+
return n2.weekStart || 0;
|
|
3892
|
+
}, weekdays: function() {
|
|
3893
|
+
return t.weekdays();
|
|
3894
|
+
}, weekdaysShort: function() {
|
|
3895
|
+
return t.weekdaysShort();
|
|
3896
|
+
}, weekdaysMin: function() {
|
|
3897
|
+
return t.weekdaysMin();
|
|
3898
|
+
}, months: function() {
|
|
3899
|
+
return t.months();
|
|
3900
|
+
}, monthsShort: function() {
|
|
3901
|
+
return t.monthsShort();
|
|
3902
|
+
}, longDateFormat: function(e2) {
|
|
3903
|
+
return a(n2, e2);
|
|
3904
|
+
}, meridiem: n2.meridiem, ordinal: n2.ordinal };
|
|
3905
|
+
}, t.months = function() {
|
|
3906
|
+
return u(i(), "months");
|
|
3907
|
+
}, t.monthsShort = function() {
|
|
3908
|
+
return u(i(), "monthsShort", "months", 3);
|
|
3909
|
+
}, t.weekdays = function(n2) {
|
|
3910
|
+
return u(i(), "weekdays", null, null, n2);
|
|
3911
|
+
}, t.weekdaysShort = function(n2) {
|
|
3912
|
+
return u(i(), "weekdaysShort", "weekdays", 3, n2);
|
|
3913
|
+
}, t.weekdaysMin = function(n2) {
|
|
3914
|
+
return u(i(), "weekdaysMin", "weekdays", 2, n2);
|
|
3915
|
+
};
|
|
3916
|
+
};
|
|
3917
|
+
});
|
|
3918
|
+
})(localeData$1);
|
|
3919
|
+
var localeData = localeData$1.exports;
|
|
3920
|
+
dayjs.extend(weekday);
|
|
3921
|
+
dayjs.extend(localeData);
|
|
3822
3922
|
function useFormEvents({
|
|
3823
3923
|
emit,
|
|
3824
3924
|
getSchema,
|
|
@@ -4028,7 +4128,7 @@ const _sfc_main$N = defineComponent({
|
|
|
4028
4128
|
const { style, mode } = unref(getProps);
|
|
4029
4129
|
return {
|
|
4030
4130
|
style: deepMerge({
|
|
4031
|
-
padding: mode === "dialog" ? "20px" : null
|
|
4131
|
+
padding: mode === "dialog" ? "20px 30px" : null
|
|
4032
4132
|
}, style)
|
|
4033
4133
|
};
|
|
4034
4134
|
});
|
|
@@ -4054,9 +4154,9 @@ const _sfc_main$N = defineComponent({
|
|
|
4054
4154
|
const getCompact = compact === null ? mode === "dialog" ? false : true : compact;
|
|
4055
4155
|
return [
|
|
4056
4156
|
"basic-form",
|
|
4157
|
+
`basic-form--${mode}`,
|
|
4057
4158
|
{
|
|
4058
|
-
"basic-form--compact": getCompact
|
|
4059
|
-
"basic-form--search": mode === "search" || mode === void 0 ? true : false
|
|
4159
|
+
"basic-form--compact": getCompact
|
|
4060
4160
|
}
|
|
4061
4161
|
];
|
|
4062
4162
|
});
|
|
@@ -4976,11 +5076,12 @@ function useRowSelection(propsRef, emit) {
|
|
|
4976
5076
|
return null;
|
|
4977
5077
|
}
|
|
4978
5078
|
return {
|
|
4979
|
-
...rowSelection,
|
|
4980
5079
|
selectedRowKeys: toRaw(unref(selectedRowKeysRef)),
|
|
4981
5080
|
onChange: (selectedRowKeys) => {
|
|
4982
5081
|
setSelectedRowKeys(selectedRowKeys);
|
|
4983
|
-
}
|
|
5082
|
+
},
|
|
5083
|
+
preserveSelectedRowKeys: true,
|
|
5084
|
+
...omit(rowSelection, ["onChange"])
|
|
4984
5085
|
};
|
|
4985
5086
|
});
|
|
4986
5087
|
watch(() => {
|
|
@@ -5079,8 +5180,20 @@ var _sfc_main$J = defineComponent({
|
|
|
5079
5180
|
dict,
|
|
5080
5181
|
date,
|
|
5081
5182
|
number,
|
|
5082
|
-
percent
|
|
5183
|
+
percent,
|
|
5184
|
+
struc
|
|
5083
5185
|
} = render2;
|
|
5186
|
+
if (struc) {
|
|
5187
|
+
const {
|
|
5188
|
+
appConf
|
|
5189
|
+
} = useAppStore();
|
|
5190
|
+
let apiStruc = appConf.structure[struc];
|
|
5191
|
+
if (!apiStruc) {
|
|
5192
|
+
error(`${struc}\u672A\u5728structure\u4E2D\u914D\u7F6E`);
|
|
5193
|
+
} else {
|
|
5194
|
+
renderText = getDictValueByCode(text, apiStruc);
|
|
5195
|
+
}
|
|
5196
|
+
}
|
|
5084
5197
|
if (dict) {
|
|
5085
5198
|
renderText = getDictValueByCode(text, dict);
|
|
5086
5199
|
}
|
|
@@ -5167,7 +5280,8 @@ var _sfc_main$I = defineComponent({
|
|
|
5167
5280
|
type: Object,
|
|
5168
5281
|
default: () => ({})
|
|
5169
5282
|
},
|
|
5170
|
-
index: Number
|
|
5283
|
+
index: Number,
|
|
5284
|
+
dataSource: Array
|
|
5171
5285
|
},
|
|
5172
5286
|
setup(props) {
|
|
5173
5287
|
const table = getTableInstance();
|
|
@@ -5200,6 +5314,9 @@ var _sfc_main$I = defineComponent({
|
|
|
5200
5314
|
}
|
|
5201
5315
|
return "\u8BF7\u9009\u62E9";
|
|
5202
5316
|
};
|
|
5317
|
+
const setTableValue = () => {
|
|
5318
|
+
props.dataSource[props.index][props.column.dataIndex] = unref(currentValueRef);
|
|
5319
|
+
};
|
|
5203
5320
|
const getComponentProps = computed(() => {
|
|
5204
5321
|
var _a, _b, _c;
|
|
5205
5322
|
const isCheckValue = unref(getIsCheckComp);
|
|
@@ -5225,7 +5342,8 @@ var _sfc_main$I = defineComponent({
|
|
|
5225
5342
|
getPopupContainer: () => document.body,
|
|
5226
5343
|
placeholder: createPlaceholderMessage(unref(getComponent)),
|
|
5227
5344
|
...omit(compProps, "onChange"),
|
|
5228
|
-
[valueField]: value
|
|
5345
|
+
[valueField]: value,
|
|
5346
|
+
onBlur: setTableValue
|
|
5229
5347
|
};
|
|
5230
5348
|
});
|
|
5231
5349
|
async function handleChange(e) {
|
|
@@ -5245,10 +5363,14 @@ var _sfc_main$I = defineComponent({
|
|
|
5245
5363
|
const onChange = (_a = unref(getComponentProps)) == null ? void 0 : _a.onChange;
|
|
5246
5364
|
if (onChange && isFunction$1(onChange))
|
|
5247
5365
|
onChange(...arguments);
|
|
5366
|
+
if (!["Input", "InputNumber"].includes(props.column.editComponent)) {
|
|
5367
|
+
setTableValue();
|
|
5368
|
+
}
|
|
5248
5369
|
(_b = table.emit) == null ? void 0 : _b.call(table, "edit-change", {
|
|
5249
5370
|
column: props.column,
|
|
5250
5371
|
value: unref(currentValueRef),
|
|
5251
|
-
record: toRaw(props.record)
|
|
5372
|
+
record: toRaw(props.record),
|
|
5373
|
+
index: props.index
|
|
5252
5374
|
});
|
|
5253
5375
|
handleSubmitRule();
|
|
5254
5376
|
}
|
|
@@ -5312,7 +5434,7 @@ function _sfc_render$3(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
5312
5434
|
]);
|
|
5313
5435
|
}
|
|
5314
5436
|
var EditableCell = /* @__PURE__ */ _export_sfc(_sfc_main$I, [["render", _sfc_render$3]]);
|
|
5315
|
-
function renderEditCell(column) {
|
|
5437
|
+
function renderEditCell(column, dataSource) {
|
|
5316
5438
|
return ({ text: value, record, index }) => {
|
|
5317
5439
|
record.onValid = async () => {
|
|
5318
5440
|
if (isArray$1(record == null ? void 0 : record.validCbs)) {
|
|
@@ -5346,7 +5468,8 @@ function renderEditCell(column) {
|
|
|
5346
5468
|
value,
|
|
5347
5469
|
record,
|
|
5348
5470
|
column,
|
|
5349
|
-
index
|
|
5471
|
+
index,
|
|
5472
|
+
dataSource
|
|
5350
5473
|
});
|
|
5351
5474
|
};
|
|
5352
5475
|
}
|
|
@@ -5614,7 +5737,7 @@ function useColumns(propsRef, getPaginationRef) {
|
|
|
5614
5737
|
const columns = cloneDeep(viewColumns);
|
|
5615
5738
|
return columns.filter((column) => isIfShow(column)).map((column) => {
|
|
5616
5739
|
if (column.edit) {
|
|
5617
|
-
column.customRender = renderEditCell(column);
|
|
5740
|
+
column.customRender = renderEditCell(column, unref(propsRef).dataSource);
|
|
5618
5741
|
}
|
|
5619
5742
|
return column;
|
|
5620
5743
|
});
|
|
@@ -6410,6 +6533,7 @@ function useTableScroll(propsRef, tableElRef, columnsRef, rowSelectionRef) {
|
|
|
6410
6533
|
bodyEl.style.height = "unset";
|
|
6411
6534
|
if (unref(propsRef).dataSource.length === 0)
|
|
6412
6535
|
return;
|
|
6536
|
+
filterSource.value = [];
|
|
6413
6537
|
await nextTick();
|
|
6414
6538
|
let headerHeight = 0, paginationHeight = 2, footerHeight = 0, titleHeight = (_b = (_a = tableEl.querySelector(".ant-table-title")) == null ? void 0 : _a.offsetHeight) != null ? _b : 0, marginHeight = 15;
|
|
6415
6539
|
const headEl = tableEl.querySelector(".ant-table-thead ");
|
|
@@ -6607,6 +6731,12 @@ const _sfc_main$A = defineComponent({
|
|
|
6607
6731
|
const getProps = computed(() => {
|
|
6608
6732
|
return { ...props, ...unref(innerPropsRef) };
|
|
6609
6733
|
});
|
|
6734
|
+
const tableClass = computed(() => {
|
|
6735
|
+
return [
|
|
6736
|
+
"dt-table",
|
|
6737
|
+
{ "dt-table-no-pagation": !unref(getProps).pagination }
|
|
6738
|
+
];
|
|
6739
|
+
});
|
|
6610
6740
|
const { getLoading, setLoading } = useLoading(getProps);
|
|
6611
6741
|
const { getPaginationInfo, setPagination, getPagination, getShowPagination, setShowPagination } = usePagination(getProps);
|
|
6612
6742
|
const {
|
|
@@ -6673,6 +6803,7 @@ const _sfc_main$A = defineComponent({
|
|
|
6673
6803
|
rowKey: unref(getProps).rowKey,
|
|
6674
6804
|
columns: unref(getViewColumns),
|
|
6675
6805
|
tableLayout: "fixed",
|
|
6806
|
+
class: unref(tableClass),
|
|
6676
6807
|
customRow
|
|
6677
6808
|
};
|
|
6678
6809
|
});
|
|
@@ -6702,10 +6833,7 @@ const _sfc_main$A = defineComponent({
|
|
|
6702
6833
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
6703
6834
|
const _component_TableRender = resolveComponent("TableRender");
|
|
6704
6835
|
const _component_Table = resolveComponent("Table");
|
|
6705
|
-
return openBlock(), createBlock(_component_Table, mergeProps({
|
|
6706
|
-
ref: "tableElRef",
|
|
6707
|
-
class: "dt-table"
|
|
6708
|
-
}, _ctx.getBind, {
|
|
6836
|
+
return openBlock(), createBlock(_component_Table, mergeProps({ ref: "tableElRef" }, _ctx.getBind, {
|
|
6709
6837
|
rowClassName: _ctx.getRowClassName,
|
|
6710
6838
|
onChange: _ctx.handleTableChange,
|
|
6711
6839
|
onResizeColumn: _ctx.handleResizeColumn
|
|
@@ -6852,6 +6980,8 @@ function useSource(opt) {
|
|
|
6852
6980
|
search();
|
|
6853
6981
|
}
|
|
6854
6982
|
function search() {
|
|
6983
|
+
if (!queryPage)
|
|
6984
|
+
return;
|
|
6855
6985
|
const { fetch } = useFetch(queryPage, baseUrl);
|
|
6856
6986
|
loading.onQuerypage.value = true;
|
|
6857
6987
|
fetch(toRaw(baseData)).then((rsp) => {
|
|
@@ -6874,6 +7004,8 @@ function useSource(opt) {
|
|
|
6874
7004
|
});
|
|
6875
7005
|
}
|
|
6876
7006
|
function onAdd(model) {
|
|
7007
|
+
if (!add)
|
|
7008
|
+
return;
|
|
6877
7009
|
const { fetch } = useFetch(add, baseUrl);
|
|
6878
7010
|
return fetch(model, false).then((rsp) => {
|
|
6879
7011
|
if ((rsp == null ? void 0 : rsp.code) === 0)
|
|
@@ -6882,10 +7014,14 @@ function useSource(opt) {
|
|
|
6882
7014
|
});
|
|
6883
7015
|
}
|
|
6884
7016
|
async function onQueryById(id) {
|
|
7017
|
+
if (!queryById)
|
|
7018
|
+
return;
|
|
6885
7019
|
const { fetch } = useFetch(queryById, baseUrl);
|
|
6886
7020
|
return await fetch({ id });
|
|
6887
7021
|
}
|
|
6888
7022
|
function onUpdate(model) {
|
|
7023
|
+
if (!update)
|
|
7024
|
+
return;
|
|
6889
7025
|
const { fetch } = useFetch(update, baseUrl);
|
|
6890
7026
|
return fetch(model, false).then((rsp) => {
|
|
6891
7027
|
if ((rsp == null ? void 0 : rsp.code) === 0)
|
|
@@ -6894,6 +7030,8 @@ function useSource(opt) {
|
|
|
6894
7030
|
});
|
|
6895
7031
|
}
|
|
6896
7032
|
function onDeletes(ids) {
|
|
7033
|
+
if (!deletes)
|
|
7034
|
+
return;
|
|
6897
7035
|
const { fetch } = useFetch(deletes, baseUrl);
|
|
6898
7036
|
fetch(toRaw(ids), false).then((rsp) => {
|
|
6899
7037
|
if ((rsp == null ? void 0 : rsp.code) === 0)
|
|
@@ -7075,6 +7213,7 @@ function useCurd(curdOpt) {
|
|
|
7075
7213
|
} = curdOpt;
|
|
7076
7214
|
curd.onQueryById(row[primaryKey]).then((rsp) => {
|
|
7077
7215
|
formsVal.value = rsp;
|
|
7216
|
+
nextTick(() => dispatchResize());
|
|
7078
7217
|
});
|
|
7079
7218
|
openModal();
|
|
7080
7219
|
}
|
|
@@ -8666,7 +8805,7 @@ const _sfc_main$s = /* @__PURE__ */ defineComponent({
|
|
|
8666
8805
|
},
|
|
8667
8806
|
setup(__props) {
|
|
8668
8807
|
const props = __props;
|
|
8669
|
-
const title = "\u9686\u57FA\
|
|
8808
|
+
const title = "\u9686\u57FA\u96C6\u56E2\u6D77\u5916\u7A0E\u52A1\u7CFB\u7EDF";
|
|
8670
8809
|
const { getCollapsedShowTitle } = useMenu();
|
|
8671
8810
|
const getLogoClass = computed(() => {
|
|
8672
8811
|
return [
|