@aplus-frontend/ui 0.0.1 → 0.0.3

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.
Files changed (73) hide show
  1. package/es/src/ap-field/date/index.vue.d.ts +63 -5
  2. package/es/src/ap-field/date/index.vue.mjs +115 -46
  3. package/es/src/ap-field/date-range/index.vue.d.ts +68 -6
  4. package/es/src/ap-field/date-range/index.vue.mjs +135 -62
  5. package/es/src/ap-field/interface.d.ts +3 -7
  6. package/es/src/ap-field/select/index.vue.d.ts +45 -179
  7. package/es/src/ap-field/select/index.vue.mjs +137 -66
  8. package/es/src/ap-form/items/date/index.vue.mjs +27 -29
  9. package/es/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  10. package/es/src/ap-form/items/date-range/index.vue.mjs +27 -29
  11. package/es/src/ap-form/items/interface.d.ts +1 -1
  12. package/es/src/ap-form/items/select/index.vue.mjs +32 -32
  13. package/es/src/ap-table/ap-table.vue.d.ts +7 -7
  14. package/es/src/ap-table/ap-table.vue.mjs +141 -117
  15. package/es/src/ap-table/constants.d.ts +3092 -1827
  16. package/es/src/ap-table/hooks/use-table-paging.mjs +23 -23
  17. package/es/src/ap-table/interface.d.ts +21 -13
  18. package/es/src/ap-table/utils.d.ts +47 -0
  19. package/es/src/ap-table/utils.mjs +68 -20
  20. package/es/src/ap-tag/style/ap-tag-group.css +1 -0
  21. package/es/src/ap-tag/style/ap-tag.css +1 -0
  22. package/es/src/pro-form/components/form-action.vue2.mjs +37 -35
  23. package/es/src/pro-form/hooks/use-advanced.mjs +45 -45
  24. package/es/src/pro-table/style/pro-table.css +3 -0
  25. package/es/src/theme/antd-global-overwrite/admin/button.css +0 -11
  26. package/es/src/theme/antd-global-overwrite/admin/index.css +35 -31
  27. package/es/src/theme/antd-global-overwrite/admin/table.css +35 -20
  28. package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -11
  29. package/es/src/theme/antd-global-overwrite/aplus/index.css +35 -31
  30. package/es/src/theme/antd-global-overwrite/aplus/table.css +35 -20
  31. package/es/src/theme/ap-tag/ap-tag-group.css +1 -0
  32. package/es/src/theme/ap-tag/ap-tag.css +1 -0
  33. package/es/src/theme/pro-table/pro-table.css +3 -0
  34. package/es/src/utils/index.d.ts +8 -0
  35. package/es/src/utils/index.mjs +40 -32
  36. package/es/src/work-order-modal/work-order-modal.vue.mjs +6 -8
  37. package/lib/src/ap-field/date/index.vue.d.ts +63 -5
  38. package/lib/src/ap-field/date/index.vue.js +1 -1
  39. package/lib/src/ap-field/date-range/index.vue.d.ts +68 -6
  40. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  41. package/lib/src/ap-field/interface.d.ts +3 -7
  42. package/lib/src/ap-field/select/index.vue.d.ts +45 -179
  43. package/lib/src/ap-field/select/index.vue.js +1 -1
  44. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  45. package/lib/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  46. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  47. package/lib/src/ap-form/items/interface.d.ts +1 -1
  48. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  49. package/lib/src/ap-table/ap-table.vue.d.ts +7 -7
  50. package/lib/src/ap-table/ap-table.vue.js +1 -1
  51. package/lib/src/ap-table/constants.d.ts +3092 -1827
  52. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  53. package/lib/src/ap-table/interface.d.ts +21 -13
  54. package/lib/src/ap-table/utils.d.ts +47 -0
  55. package/lib/src/ap-table/utils.js +1 -1
  56. package/lib/src/ap-tag/style/ap-tag-group.css +1 -0
  57. package/lib/src/ap-tag/style/ap-tag.css +1 -0
  58. package/lib/src/pro-form/components/form-action.vue2.js +1 -1
  59. package/lib/src/pro-form/hooks/use-advanced.js +1 -1
  60. package/lib/src/pro-table/style/pro-table.css +3 -0
  61. package/lib/src/theme/antd-global-overwrite/admin/button.css +0 -11
  62. package/lib/src/theme/antd-global-overwrite/admin/index.css +35 -31
  63. package/lib/src/theme/antd-global-overwrite/admin/table.css +35 -20
  64. package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -11
  65. package/lib/src/theme/antd-global-overwrite/aplus/index.css +35 -31
  66. package/lib/src/theme/antd-global-overwrite/aplus/table.css +35 -20
  67. package/lib/src/theme/ap-tag/ap-tag-group.css +1 -0
  68. package/lib/src/theme/ap-tag/ap-tag.css +1 -0
  69. package/lib/src/theme/pro-table/pro-table.css +3 -0
  70. package/lib/src/utils/index.d.ts +8 -0
  71. package/lib/src/utils/index.js +1 -1
  72. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  73. package/package.json +3 -3
@@ -17,11 +17,11 @@ const ae = ({
17
17
  sortFields: E = []
18
18
  }) => {
19
19
  let F = 0, f = {};
20
- const L = (e) => T ? T(e) : e, c = v(), l = v(y), g = v(S), { t: C } = Y(), n = v({
20
+ const L = (e) => T ? T(e) : e, i = v(), l = v(y), g = v(S), { t: V } = Y(), n = v({
21
21
  total: 0,
22
22
  records: A,
23
23
  loading: !1
24
- }), V = async (e) => {
24
+ }), b = async (e) => {
25
25
  var o;
26
26
  const a = L(e), t = Date.now();
27
27
  F = t, n.value.loading = !0;
@@ -36,7 +36,7 @@ const ae = ({
36
36
  } finally {
37
37
  n.value.loading = !1;
38
38
  }
39
- }, b = (e) => {
39
+ }, w = (e) => {
40
40
  const a = {};
41
41
  return Object.entries(e).forEach(([t, o]) => {
42
42
  if (a[t] = o, z && o) {
@@ -45,30 +45,30 @@ const ae = ({
45
45
  }
46
46
  }), a;
47
47
  }, M = (e) => {
48
- var o, s, d, p, m, u, i;
49
- const a = ((s = (o = c.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
48
+ var o, s, d, p, m, u, c;
49
+ const a = ((s = (o = i.value) == null ? void 0 : o.apForm) == null ? void 0 : s.getFieldsValue()) || {}, t = {};
50
50
  Object.entries(a).forEach(([$, K]) => {
51
51
  P && P.indexOf($) > -1 && (t[$] = K);
52
- }), (p = (d = c.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (i = (u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || i.call(u, t), e == null || e();
52
+ }), (p = (d = i.value) == null ? void 0 : d.apForm) == null || p.resetFields(), (c = (u = (m = i.value) == null ? void 0 : m.apForm) == null ? void 0 : u.setFieldsValue) == null || c.call(u, t), e == null || e();
53
53
  }, h = (e) => {
54
54
  f = e;
55
- const a = b(e);
56
- V(a);
55
+ const a = w(e);
56
+ b(a);
57
57
  }, q = (e) => {
58
58
  h({
59
59
  ...f,
60
60
  ...e
61
61
  });
62
- }, w = () => {
62
+ }, C = () => {
63
63
  var a, t;
64
- const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
64
+ const e = ((t = (a = i.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
65
65
  h({
66
66
  ...e,
67
- pageCurrent: 1,
67
+ current: 1,
68
68
  pageSize: f.pageSize || S
69
69
  });
70
70
  }, J = () => {
71
- M(w);
71
+ M(C);
72
72
  }, Q = () => {
73
73
  h(f);
74
74
  }, G = (e) => {
@@ -78,14 +78,14 @@ const ae = ({
78
78
  });
79
79
  }, O = (e, a, t) => {
80
80
  var m, u;
81
- const o = ((u = (m = c.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
81
+ const o = ((u = (m = i.value) == null ? void 0 : m.apForm) == null ? void 0 : u.getFieldsValue(!0)) || {};
82
82
  l.value = e.current, g.value = e.pageSize;
83
83
  const s = X(t) ? [...t] : [t], d = {};
84
- for (const i of s)
85
- E.includes(i.field) && (d[W(i.field)] = i.order);
84
+ for (const c of s)
85
+ E.includes(c.field) && (d[W(c.field)] = c.order);
86
86
  const p = {};
87
- for (const i of Object.keys(a))
88
- B.includes(i) && (p[i] = a[i]);
87
+ for (const c of Object.keys(a))
88
+ B.includes(c) && (p[c] = a[c]);
89
89
  h({
90
90
  ...o,
91
91
  filter: p,
@@ -96,14 +96,14 @@ const ae = ({
96
96
  };
97
97
  N(() => {
98
98
  var a, t;
99
- const e = ((t = (a = c.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
99
+ const e = ((t = (a = i.value) == null ? void 0 : a.apForm) == null ? void 0 : t.getFieldsValue(!0)) || {};
100
100
  if (f = {
101
101
  current: r(l),
102
102
  pageSize: r(g),
103
103
  ...e
104
104
  }, !x) {
105
- const o = b(f);
106
- V(o);
105
+ const o = w(f);
106
+ b(o);
107
107
  }
108
108
  });
109
109
  const H = j(() => r(n).total === 0 ? "-" : `${r(l.value)}/${Math.ceil(
@@ -116,7 +116,7 @@ const ae = ({
116
116
  total: r(n).total,
117
117
  showSizeChanger: !0,
118
118
  showQuickJumper: !0,
119
- showTotal: (e) => `${C("ap.apTable.pagination.totalLeft", { total: e })} ${C(
119
+ showTotal: (e) => `${V("ap.apTable.pagination.totalLeft", { total: e })} ${V(
120
120
  "ap.apTable.pagination.totalRight",
121
121
  { page: r(H) }
122
122
  )}`
@@ -125,8 +125,8 @@ const ae = ({
125
125
  dataSource: r(n).records
126
126
  }));
127
127
  return {
128
- formRef: c,
129
- submit: w,
128
+ formRef: i,
129
+ submit: C,
130
130
  reset: J,
131
131
  refresh: Q,
132
132
  refreshByDelete: G,
@@ -7,7 +7,7 @@ import { CSSProperties } from 'vue';
7
7
  import { ApActionGroupProps } from '../ap-action';
8
8
  import { ApTableIndexProps } from './components/interface';
9
9
 
10
- type ValueEnmuTyType = {
10
+ export type ValueEnumType = {
11
11
  text: string;
12
12
  status?: string;
13
13
  color?: string;
@@ -44,7 +44,7 @@ export type ApTableValueFields = {
44
44
  */
45
45
  index: ApTableIndexProps;
46
46
  };
47
- export type ValueEnum = Record<string, ValueEnmuTyType>;
47
+ export type ValueEnum = Record<string, ValueEnumType>;
48
48
  export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
49
49
  sorter?: string | boolean | CompareFn<T> | {
50
50
  compare?: CompareFn<T>;
@@ -52,8 +52,8 @@ export type ExtraProColumnType<T> = Omit<ColumnType<T>, 'children'> & {
52
52
  multiple?: number;
53
53
  };
54
54
  };
55
- export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> = ExtraProColumnType<any> & {
56
- children?: ApColumnType[];
55
+ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text', RecordType = any> = ExtraProColumnType<any> & {
56
+ children?: ApColumnType<any, RecordType>[];
57
57
  /**
58
58
  * 表单项所占据的格子数(1-24格)
59
59
  */
@@ -75,8 +75,7 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> =
75
75
  */
76
76
  hideInTable?: boolean;
77
77
  /**
78
- * 值的枚举,会自动转化把值当成 key 来取出要显示的内容(也会作为select的选项)
79
- * @deprecated 未实现请使用`fieldProps.options`
78
+ * 值的枚举,会自动转化把值当成 key 来取出要显示的内容(也会作为select等组件的选项)
80
79
  */
81
80
  valueEnum?: ValueEnum;
82
81
  /**
@@ -90,7 +89,19 @@ export type ApColumnType<ValueType extends keyof ApTableValueFields = 'text'> =
90
89
  /**
91
90
  * 值类型额外配置的参数(用于查询表单渲染)
92
91
  */
93
- fieldProps?: ApTableValueFields[ValueType];
92
+ fieldProps?: ApTableValueFields[ValueType] | ((opt?: {
93
+ value: any;
94
+ text: any;
95
+ record: RecordType;
96
+ index: number;
97
+ renderIndex: number;
98
+ column: ApColumnType<ValueType, RecordType>;
99
+ }) => ApTableValueFields[ValueType]);
100
+ /**
101
+ * 用于表单项排序的字段
102
+ * @description 值越大,越排在前面,请设置正整数,设置为0或负数将会无效
103
+ */
104
+ order?: number;
94
105
  };
95
106
  export type RequestData<T> = {
96
107
  data: T[] | undefined;
@@ -100,7 +111,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
100
111
  /**
101
112
  * 列配置
102
113
  */
103
- columns?: ApColumnType<any>[];
114
+ columns?: ApColumnType<any, RecordType>[];
104
115
  /**
105
116
  * 是否启用卡片样式
106
117
  */
@@ -111,9 +122,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
111
122
  params?: ParamsType;
112
123
  /**
113
124
  * 自定义渲染搜索表单
114
- * @param props
115
- * @param defaultDom
116
- * @returns
125
+ * @deprecated 未实现 暂不可用
117
126
  */
118
127
  searchFormRender?: (props: ApTableProps<RecordType, ParamsType, ValueType>, defaultDom: any) => any;
119
128
  /**
@@ -129,7 +138,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
129
138
  }) => Promise<Partial<RequestData<RecordType>>>;
130
139
  /**
131
140
  * 数据加载完成后触发
132
- * @param data
141
+ * @deprecated 已弃用,请自行实现类似效果
133
142
  * @returns
134
143
  */
135
144
  onLoad?: (data: RecordType[]) => void;
@@ -181,4 +190,3 @@ export type ApTableExpose = {
181
190
  submit: () => void;
182
191
  reset: () => void;
183
192
  };
184
- export {};
@@ -1,3 +1,6 @@
1
+ import { ApColumnType, ApTableValueFields, ValueEnum, ValueEnumType } from './interface';
2
+ import { Translator } from '../config-provider';
3
+
1
4
  export type FieldValueType = 'multiple' | 'multipleNumber' | 'dayjs' | 'dayjsRange' | 'dayjsDayRange' | 'number' | 'boolean' | 'object';
2
5
  export declare const formatParamsValueType: (type: FieldValueType | Record<string, FieldValueType>, value: any, cb: (t: FieldValueType, value: any) => any) => any;
3
6
  /**
@@ -12,3 +15,47 @@ export declare const parseFieldValue: (t: FieldValueType, value: any) => any;
12
15
  * @returns
13
16
  */
14
17
  export declare function dataIndexToStr(dataIndex: string | number | (string | number)[]): string | number;
18
+ type OptionType = {
19
+ label?: string;
20
+ text?: string;
21
+ value?: any;
22
+ disabled?: boolean;
23
+ [key: string]: any;
24
+ };
25
+ type ValueEnumMap = Map<string | number | boolean, ValueEnumType>;
26
+ export declare const objectToMap: (value: ValueEnum | undefined) => ValueEnumMap;
27
+ /**
28
+ * valueEnum转options array
29
+ * @param valueEnumParams
30
+ * @returns
31
+ */
32
+ export declare const valueEnumToArray: (valueEnumParams: ValueEnum) => OptionType;
33
+ /**
34
+ * 获取列在查询表单中的排序
35
+ * @param order
36
+ * @returns
37
+ */
38
+ export declare const getColumnOrder: (order?: number) => number;
39
+ /**
40
+ * 获取查询表单的placeholder
41
+ * @param t
42
+ * @param valueType
43
+ * @param placeholder
44
+ * @returns
45
+ */
46
+ export declare const getPlaceholder: (t: Translator, valueType?: keyof ApTableValueFields, placeholder?: string) => string | string[] | undefined;
47
+ /**
48
+ * 获取对象形式的FieldProps
49
+ * @param fieldProps
50
+ * @param record
51
+ * @returns
52
+ */
53
+ export declare function getFieldProps<RecordType = any>(fieldProps: ApColumnType<any, any>['fieldProps'], opt?: {
54
+ value: any;
55
+ text: any;
56
+ record: any;
57
+ index: number;
58
+ renderIndex: number;
59
+ column: ApColumnType<any, RecordType>;
60
+ }): any;
61
+ export {};
@@ -1,35 +1,83 @@
1
- import { isObject as t, isArray as c } from "lodash-unified";
2
- const f = (e, r, s) => {
3
- let a = {};
4
- return t(e) ? Object.keys(e).forEach((n) => {
5
- t(e[n]) ? a[n] = f(e[n], r[n], s) : a[n] = s(e[n], r);
6
- }) : a = s(e, r), a;
7
- }, u = (e, r) => {
8
- switch (e) {
1
+ import { isObject as c, isArray as u, isUndefined as i, isFunction as a } from "lodash-unified";
2
+ const f = (t, e, n) => {
3
+ let s = {};
4
+ return c(t) ? Object.keys(t).forEach((o) => {
5
+ c(t[o]) ? s[o] = f(t[o], e[o], n) : s[o] = n(t[o], e);
6
+ }) : s = n(t, e), s;
7
+ }, p = (t, e) => {
8
+ switch (t) {
9
9
  case "dayjs":
10
- return r.valueOf();
10
+ return e.valueOf();
11
11
  case "dayjsRange":
12
- return r.map((s) => s.valueOf());
12
+ return e.map((n) => n.valueOf());
13
13
  case "dayjsDayRange": {
14
- const [s, a] = r;
15
- return [s.startOf("day").valueOf(), a.endOf("day").valueOf()];
14
+ const [n, s] = e;
15
+ return [n.startOf("day").valueOf(), s.endOf("day").valueOf()];
16
16
  }
17
17
  case "multiple":
18
18
  case "multipleNumber":
19
- return c(r) ? r : [r];
19
+ return u(e) ? e : [e];
20
20
  case "boolean":
21
- return r;
21
+ return e;
22
22
  case "object":
23
- return r;
23
+ return e;
24
24
  default:
25
- return r;
25
+ return e;
26
26
  }
27
27
  };
28
- function O(e) {
29
- return c(e) ? e.join(".") : e;
28
+ function b(t) {
29
+ return u(t) ? t.join(".") : t;
30
+ }
31
+ function d(t) {
32
+ const e = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
33
+ return e === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : e;
34
+ }
35
+ const l = (t) => d(t) === "map" ? t : new Map(Object.entries(t || {})), g = (t) => {
36
+ const e = [], n = l(t);
37
+ return n.forEach((s, o) => {
38
+ const r = n.get(o) || n.get(`${o}`);
39
+ if (r) {
40
+ if (typeof r == "object" && (r != null && r.text)) {
41
+ e.push({
42
+ text: r == null ? void 0 : r.text,
43
+ value: o,
44
+ label: r == null ? void 0 : r.text,
45
+ disabled: r.disabled
46
+ });
47
+ return;
48
+ }
49
+ e.push({
50
+ text: r,
51
+ label: r,
52
+ value: o
53
+ });
54
+ }
55
+ }), e;
56
+ }, j = (t) => i(t) || t < 0 ? 0 : t, x = (t, e, n) => {
57
+ if (n)
58
+ return n;
59
+ const s = ["select", "date"], o = [
60
+ "text",
61
+ "textArea",
62
+ "number"
63
+ ];
64
+ if (e === "dateRange")
65
+ return [t("ap.common.chooseText"), t("ap.common.chooseText")];
66
+ if (s.includes(e))
67
+ return t("ap.common.chooseText");
68
+ if (o.includes(e))
69
+ return t("ap.common.inputText");
70
+ };
71
+ function O(t, e) {
72
+ return !t || !a(t) ? t : t(e);
30
73
  }
31
74
  export {
32
- O as dataIndexToStr,
75
+ b as dataIndexToStr,
33
76
  f as formatParamsValueType,
34
- u as parseFieldValue
77
+ j as getColumnOrder,
78
+ O as getFieldProps,
79
+ x as getPlaceholder,
80
+ l as objectToMap,
81
+ p as parseFieldValue,
82
+ g as valueEnumToArray
35
83
  };
@@ -2,5 +2,6 @@
2
2
  text-wrap: nowrap;
3
3
  display: flex;
4
4
  flex-wrap: nowrap;
5
+ white-space: nowrap;
5
6
  align-items: center;
6
7
  }
@@ -1,5 +1,6 @@
1
1
  .aplus-tag-wrapper {
2
2
  text-wrap: nowrap;
3
+ white-space: nowrap;
3
4
  display: inline-block;
4
5
  }
5
6
  .aplus-tag-inner-wrapper {
@@ -1,12 +1,13 @@
1
- import { defineComponent as T, computed as u, openBlock as a, createBlock as s, unref as e, normalizeProps as z, mergeProps as p, withCtx as o, createElementVNode as V, normalizeStyle as $, createVNode as C, renderSlot as i, createTextVNode as m, toDisplayString as d, createCommentVNode as l, normalizeClass as j } from "vue";
2
- import { Col as F, Form as R } from "ant-design-vue";
3
- import { BaseButton as B } from "../../base-button/index.mjs";
4
- import { BasicArrow as G } from "../../basic/index.mjs";
5
- import { useFormContext as P } from "../hooks/use-form-context.mjs";
1
+ import { defineComponent as T, computed as s, openBlock as a, createBlock as l, unref as e, normalizeProps as z, mergeProps as m, withCtx as o, createElementVNode as V, normalizeStyle as A, createVNode as g, renderSlot as i, createTextVNode as p, toDisplayString as d, createCommentVNode as r, normalizeClass as $ } from "vue";
2
+ import { Col as F, Form as G } from "ant-design-vue";
3
+ import { BaseButton as f } from "../../base-button/index.mjs";
4
+ import { BasicArrow as R } from "../../basic/index.mjs";
5
+ import { useFormContext as j } from "../hooks/use-form-context.mjs";
6
6
  import "../../config-provider/index.mjs";
7
7
  import "./style/form-action.css";
8
- import { useLocale as q } from "../../config-provider/hooks/use-locale.mjs";
9
- import { useNamespace as D } from "../../config-provider/hooks/use-namespace.mjs";
8
+ import { useGlobalConfig as P } from "../../config-provider/hooks/use-global-config.mjs";
9
+ import { useLocale as W } from "../../config-provider/hooks/use-locale.mjs";
10
+ import { useNamespace as q } from "../../config-provider/hooks/use-namespace.mjs";
10
11
  const X = /* @__PURE__ */ T({
11
12
  name: "BasicFormAction",
12
13
  __name: "form-action",
@@ -23,75 +24,76 @@ const X = /* @__PURE__ */ T({
23
24
  hideAdvanceBtn: { type: Boolean }
24
25
  },
25
26
  emits: ["toggle-advanced"],
26
- setup(h, { emit: O }) {
27
- const r = h, b = O, { t: n } = q(), { em: c } = D("form-action"), { resetAction: k, submitAction: w } = P(), f = u(() => {
28
- const { showAdvancedButton: t, actionSpan: A, actionColOptions: x } = r, g = 24 - A, N = t ? { span: g < 6 ? 24 : g } : {};
27
+ setup(h, { emit: C }) {
28
+ const u = h, b = C, O = P("uiMode"), k = s(() => O.value === "aplus" ? {} : {
29
+ color: "#34b77c"
30
+ }), { t: n } = W(), { em: c } = q("form-action"), { resetAction: w, submitAction: x } = j(), B = s(() => {
31
+ const { actionColOptions: t } = u;
29
32
  return {
30
- style: { textAlign: "right" },
31
- span: t ? 6 : 4,
32
- ...N,
33
- ...x
33
+ style: { textAlign: "right", flex: 1, maxWidth: "100%", minWidth: "25%" },
34
+ ...t
34
35
  };
35
- }), v = u(() => Object.assign(
36
+ }), y = s(() => Object.assign(
36
37
  {
37
38
  text: n("ap.common.resetText")
38
39
  },
39
- r.resetButtonOptions
40
- )), y = u(() => Object.assign(
40
+ u.resetButtonOptions
41
+ )), v = s(() => Object.assign(
41
42
  {
42
43
  text: n("ap.common.queryText")
43
44
  },
44
- r.submitButtonOptions
45
+ u.submitButtonOptions
45
46
  ));
46
47
  function S() {
47
48
  b("toggle-advanced");
48
49
  }
49
- return (t, A) => t.showActionButtonGroup ? (a(), s(e(F), z(p({ key: 0 }, f.value)), {
50
+ return (t, N) => t.showActionButtonGroup ? (a(), l(e(F), z(m({ key: 0 }, B.value)), {
50
51
  default: o(() => [
51
52
  V("div", {
52
- style: $([{ width: "100%" }, { textAlign: f.value.style.textAlign }])
53
+ style: A([{ width: "100%" }, { textAlign: B.value.style.textAlign }])
53
54
  }, [
54
- C(e(R).Item, null, {
55
+ g(e(G).Item, null, {
55
56
  default: o(() => [
56
57
  i(t.$slots, "resetBefore"),
57
- t.showResetButton ? (a(), s(e(B), p({
58
+ t.showResetButton ? (a(), l(e(f), m({
58
59
  key: 0,
59
60
  type: "default",
60
61
  class: e(c)("button", "space")
61
- }, v.value, { onClick: e(k) }), {
62
+ }, y.value, { onClick: e(w) }), {
62
63
  default: o(() => [
63
- m(d(v.value.text), 1)
64
+ p(d(y.value.text), 1)
64
65
  ]),
65
66
  _: 1
66
- }, 16, ["class", "onClick"])) : l("", !0),
67
+ }, 16, ["class", "onClick"])) : r("", !0),
67
68
  i(t.$slots, "submitBefore"),
68
- t.showSubmitButton ? (a(), s(e(B), p({
69
+ t.showSubmitButton ? (a(), l(e(f), m({
69
70
  key: 1,
70
71
  type: "primary",
71
72
  class: e(c)("button", "space")
72
- }, y.value, { onClick: e(w) }), {
73
+ }, v.value, { onClick: e(x) }), {
73
74
  default: o(() => [
74
- m(d(y.value.text), 1)
75
+ p(d(v.value.text), 1)
75
76
  ]),
76
77
  _: 1
77
- }, 16, ["class", "onClick"])) : l("", !0),
78
+ }, 16, ["class", "onClick"])) : r("", !0),
78
79
  i(t.$slots, "advanceBefore"),
79
- t.showAdvancedButton && !t.hideAdvanceBtn ? (a(), s(e(B), {
80
+ t.showAdvancedButton && !t.hideAdvanceBtn ? (a(), l(e(f), {
80
81
  key: 2,
81
82
  type: "link",
82
83
  size: "small",
84
+ style: A(k.value),
83
85
  onClick: S
84
86
  }, {
85
87
  default: o(() => [
86
- m(d(t.isAdvanced ? e(n)("ap.common.closeText") : e(n)("ap.common.expandText")) + " ", 1),
87
- C(e(G), {
88
- class: j(e(c)("item", "space")),
88
+ p(d(t.isAdvanced ? e(n)("ap.common.closeText") : e(n)("ap.common.expandText")) + " ", 1),
89
+ g(e(R), {
90
+ class: $(e(c)("item", "space")),
89
91
  expand: !t.isAdvanced,
90
92
  up: ""
91
93
  }, null, 8, ["class", "expand"])
92
94
  ]),
93
95
  _: 1
94
- })) : l("", !0),
96
+ }, 8, ["style"])) : r("", !0),
95
97
  i(t.$slots, "advanceAfter")
96
98
  ]),
97
99
  _: 3
@@ -99,7 +101,7 @@ const X = /* @__PURE__ */ T({
99
101
  ], 4)
100
102
  ]),
101
103
  _: 3
102
- }, 16)) : l("", !0);
104
+ }, 16)) : r("", !0);
103
105
  }
104
106
  });
105
107
  export {
@@ -1,79 +1,79 @@
1
- import { getCurrentInstance as X, computed as g, unref as d, watch as F, shallowReactive as N } from "vue";
2
- import { isNumber as U, isObject as _, isBoolean as j, isFunction as k } from "lodash-unified";
1
+ import { getCurrentInstance as N, computed as T, unref as d, watch as X, shallowReactive as g } from "vue";
2
+ import { isNumber as F, isObject as U, isBoolean as j, isFunction as k } from "lodash-unified";
3
3
  import { useDebounceFn as D } from "@vueuse/core";
4
4
  import { useBreakpoint as G, ScreenEnum as A } from "./use-break-point.mjs";
5
- const o = 24;
6
- function H({
7
- advanceState: e,
8
- emit: x,
9
- getProps: t,
10
- getSchema: l,
11
- formModel: h,
12
- defaultValueRef: B
5
+ const f = 24, l = 18;
6
+ function J({
7
+ advanceState: s,
8
+ emit: B,
9
+ getProps: o,
10
+ getSchema: h,
11
+ formModel: v,
12
+ defaultValueRef: b
13
13
  }) {
14
- const p = X(), { screenRef: b, realWidthRef: v } = G(), y = g(() => {
15
- if (!e.isAdvanced)
14
+ const p = N(), { screenRef: y, realWidthRef: L } = G(), E = T(() => {
15
+ if (!s.isAdvanced)
16
16
  return 0;
17
- const n = d(t).emptySpan || 0;
18
- if (U(n))
17
+ const n = d(o).emptySpan || 0;
18
+ if (F(n))
19
19
  return n;
20
- if (_(n)) {
21
- const { span: s = 0 } = n, f = d(b);
22
- return n[f.toLowerCase()] || s || 0;
20
+ if (U(n)) {
21
+ const { span: e = 0 } = n, t = d(y);
22
+ return n[t.toLowerCase()] || e || 0;
23
23
  }
24
24
  return 0;
25
- }), W = D(E, 30);
26
- F(
25
+ }), R = D(W, 30);
26
+ X(
27
27
  [
28
- () => d(l),
29
- () => e.isAdvanced,
30
- () => d(v)
28
+ () => d(h),
29
+ () => s.isAdvanced,
30
+ () => d(L)
31
31
  ],
32
32
  () => {
33
- const { showAdvancedButton: n } = d(t);
34
- n && W();
33
+ const { showAdvancedButton: n } = d(o);
34
+ n && R();
35
35
  },
36
36
  { immediate: !0 }
37
37
  );
38
- function I(n, s = 0, f = !1) {
39
- const c = d(v), i = parseInt(n.md) || parseInt(n.xs) || parseInt(n.sm) || n.span || o, r = parseInt(n.lg) || i, a = parseInt(n.xl) || r, u = parseInt(n.xxl) || a;
40
- return c <= A.LG ? s += i : c < A.XL ? s += r : c < A.XXL ? s += a : s += u, f ? (e.hideAdvanceBtn = !1, s <= o * 2 ? (e.hideAdvanceBtn = !0, e.isAdvanced = !0) : s > o * 2 && s <= o * (d(t).autoAdvancedLine || 3) ? e.hideAdvanceBtn = !1 : e.isLoad || (e.isLoad = !0, e.isAdvanced = !e.isAdvanced), { isAdvanced: e.isAdvanced, itemColSum: s }) : s > o * (d(t).alwaysShowLines || 1) ? { isAdvanced: e.isAdvanced, itemColSum: s } : { isAdvanced: !0, itemColSum: s };
38
+ function I(n, e = 0, t = !1) {
39
+ const c = d(L), i = parseInt(n.md) || parseInt(n.xs) || parseInt(n.sm) || n.span || f, r = parseInt(n.lg) || i, a = parseInt(n.xl) || r, u = parseInt(n.xxl) || a;
40
+ return c <= A.LG ? e += i : c < A.XL ? e += r : c < A.XXL ? e += a : e += u, t ? (s.hideAdvanceBtn = !1, e <= f + l ? (s.hideAdvanceBtn = !0, s.isAdvanced = !0) : e > f + l && e <= f * (d(o).autoAdvancedLine || 3) ? s.hideAdvanceBtn = !1 : s.isLoad || (s.isLoad = !0, s.isAdvanced = !0), { isAdvanced: s.isAdvanced, itemColSum: e }) : e > l * (d(o).alwaysShowLines || 1) ? { isAdvanced: s.isAdvanced, itemColSum: e } : { isAdvanced: !0, itemColSum: e };
41
41
  }
42
- const L = N({});
43
- function E() {
42
+ const w = g({});
43
+ function W() {
44
44
  var c;
45
- let n = 0, s = 0;
46
- const { baseColProps: f = {} } = d(t);
47
- for (const i of d(l)) {
45
+ let n = 0, e = 0;
46
+ const { baseColProps: t = {} } = d(o);
47
+ for (const i of d(h)) {
48
48
  const { show: r, colProps: a } = i;
49
49
  let u = !0;
50
50
  if (j(r) && (u = r), k(r) && (u = r({
51
51
  schema: i,
52
- model: h,
52
+ model: v,
53
53
  field: i.field,
54
54
  values: {
55
- ...d(B),
56
- ...h
55
+ ...d(b),
56
+ ...v
57
57
  }
58
- })), u && (a || f)) {
59
- const { itemColSum: R, isAdvanced: w } = I(
60
- { ...f, ...a },
58
+ })), u && (a || t)) {
59
+ const { itemColSum: _, isAdvanced: x } = I(
60
+ { ...t, ...a },
61
61
  n
62
62
  );
63
- n = R || 0, w && (s = n), L[i.field] = w;
63
+ n = _ || 0, x && (e = n), w[i.field] = x;
64
64
  }
65
65
  }
66
- (c = p == null ? void 0 : p.proxy) == null || c.$forceUpdate(), e.actionSpan = s % o + d(y), I(
67
- d(t).actionColOptions || { span: o },
66
+ (c = p == null ? void 0 : p.proxy) == null || c.$forceUpdate(), s.actionSpan = e % f + d(E), I(
67
+ d(o).actionColOptions || { span: f },
68
68
  n,
69
69
  !0
70
- ), x("advanced-change");
70
+ ), B("advanced-change");
71
71
  }
72
72
  function O() {
73
- e.isAdvanced = !e.isAdvanced;
73
+ s.isAdvanced = !s.isAdvanced;
74
74
  }
75
- return { handleToggleAdvanced: O, fieldsIsAdvancedMap: L };
75
+ return { handleToggleAdvanced: O, fieldsIsAdvancedMap: w };
76
76
  }
77
77
  export {
78
- H as default
78
+ J as default
79
79
  };
@@ -16,6 +16,9 @@
16
16
  border-radius: 2px;
17
17
  background-color: #fff;
18
18
  }
19
+ .aplus-pro-table-form-container .ant-form .ant-form-item {
20
+ margin-bottom: 16px;
21
+ }
19
22
  .aplus-pro-table-form-container-no-divide .ant-form {
20
23
  border-bottom-left-radius: 0 !important;
21
24
  border-bottom-right-radius: 0 !important;