@ftjs/antd 3.1.1 → 3.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +23 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getField, useFormItem, useLocale, unrefs, useFormInject, toValueWithForm, useForm, set, useTable, get } from "@ftjs/core";
|
|
2
2
|
import { computed, toValue, createVNode, mergeProps, unref, createTextVNode, isVNode, defineComponent, createBlock, openBlock, resolveDynamicComponent, createElementBlock, Fragment, renderList, normalizeClass, ref, useId, withCtx, renderSlot, createCommentVNode, toDisplayString, createElementVNode, onMounted, h, useTemplateRef, normalizeStyle, createSlots, normalizeProps } from "vue";
|
|
3
|
-
import { FormItem, Input, Select, DatePicker, RangePicker, Radio, Textarea, Upload, Cascader, AutoComplete, CheckboxGroup, InputNumber, Mentions, Rate, Slider, Switch, TreeSelect, Form, Button, Modal, Tree, Divider, Spin, Pagination } from "ant-design-vue";
|
|
3
|
+
import { FormItem, Input, Select, DatePicker, RangePicker, Radio, Textarea, Upload, Cascader, AutoComplete, CheckboxGroup, InputNumber, Mentions, Rate, Slider, Switch, TreeSelect, Form, Button, Modal, Tree, Badge, Divider, Spin, Pagination } from "ant-design-vue";
|
|
4
4
|
import dayjs from "dayjs";
|
|
5
5
|
import { SwapOutlined, SettingOutlined } from "@ant-design/icons-vue";
|
|
6
6
|
import { VxeGrid } from "vxe-table";
|
|
@@ -787,6 +787,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
787
787
|
list.splice(fromIndex, 1);
|
|
788
788
|
list.splice(toIndex, 0, dragNode);
|
|
789
789
|
};
|
|
790
|
+
const hideCountNum = computed(() => {
|
|
791
|
+
return props.cache ? props.columns.length - columnsChecked.value.length : 0;
|
|
792
|
+
});
|
|
790
793
|
__expose({
|
|
791
794
|
formInstance: formRef,
|
|
792
795
|
formData: form,
|
|
@@ -876,18 +879,23 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
876
879
|
createVNode(unref(FormItem), { style: { "--ft-form-control-width": "220px" } }, {
|
|
877
880
|
default: withCtx(() => [
|
|
878
881
|
createElementVNode("div", _hoisted_4, [
|
|
879
|
-
_ctx.cache ? (openBlock(), createBlock(unref(
|
|
882
|
+
_ctx.cache ? (openBlock(), createBlock(unref(Badge), {
|
|
880
883
|
key: 0,
|
|
881
|
-
|
|
884
|
+
count: hideCountNum.value
|
|
882
885
|
}, {
|
|
883
|
-
icon: withCtx(() => [
|
|
884
|
-
createVNode(unref(SettingOutlined))
|
|
885
|
-
]),
|
|
886
886
|
default: withCtx(() => [
|
|
887
|
-
|
|
887
|
+
createVNode(unref(Button), { onClick: setting }, {
|
|
888
|
+
icon: withCtx(() => [
|
|
889
|
+
createVNode(unref(SettingOutlined))
|
|
890
|
+
]),
|
|
891
|
+
default: withCtx(() => [
|
|
892
|
+
createTextVNode(" " + toDisplayString(unref(locale).form.settings), 1)
|
|
893
|
+
]),
|
|
894
|
+
_: 1
|
|
895
|
+
})
|
|
888
896
|
]),
|
|
889
897
|
_: 1
|
|
890
|
-
})) : createCommentVNode("", true),
|
|
898
|
+
}, 8, ["count"])) : createCommentVNode("", true),
|
|
891
899
|
createVNode(unref(Button), {
|
|
892
900
|
type: "primary",
|
|
893
901
|
htmlType: "submit"
|
|
@@ -1169,6 +1177,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1169
1177
|
}
|
|
1170
1178
|
const current = ref(1);
|
|
1171
1179
|
const pageSize = ref(props.defaultPageSize);
|
|
1180
|
+
const locale = useLocale();
|
|
1181
|
+
const showPaginationTotal = computed(() => {
|
|
1182
|
+
if ((props.total ?? 0) <= 0) return void 0;
|
|
1183
|
+
return (total) => locale.value.table.paginationTotal(total);
|
|
1184
|
+
});
|
|
1172
1185
|
async function refresh() {
|
|
1173
1186
|
var _a;
|
|
1174
1187
|
current.value = 1;
|
|
@@ -1252,13 +1265,14 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
1252
1265
|
showQuickJumper: "",
|
|
1253
1266
|
showSizeChanger: "",
|
|
1254
1267
|
showLessItems: "",
|
|
1268
|
+
showTotal: showPaginationTotal.value,
|
|
1255
1269
|
total: _ctx.total,
|
|
1256
1270
|
defaultPageSize: _ctx.defaultPageSize,
|
|
1257
1271
|
onChange: _cache[2] || (_cache[2] = () => {
|
|
1258
1272
|
var _a;
|
|
1259
1273
|
return (_a = _ctx.onSearch) == null ? void 0 : _a.call(_ctx);
|
|
1260
1274
|
})
|
|
1261
|
-
}, null, 8, ["current", "pageSize", "total", "defaultPageSize"])])) : createCommentVNode("", true)]),
|
|
1275
|
+
}, null, 8, ["current", "pageSize", "showTotal", "total", "defaultPageSize"])])) : createCommentVNode("", true)]),
|
|
1262
1276
|
loading: withCtx((slotData) => [_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", normalizeProps(mergeProps({
|
|
1263
1277
|
key: 0
|
|
1264
1278
|
}, slotData))) : (openBlock(), createElementBlock("div", _hoisted_2, [createVNode(unref(Spin))]))]),
|