@aplus-frontend/ui 0.0.1 → 0.0.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.
Files changed (53) 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 +12 -8
  14. package/es/src/ap-table/ap-table.vue.mjs +88 -78
  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 +5 -9
  18. package/es/src/ap-table/utils.d.ts +18 -0
  19. package/es/src/ap-table/utils.mjs +45 -17
  20. package/es/src/theme/antd-global-overwrite/admin/button.css +0 -11
  21. package/es/src/theme/antd-global-overwrite/admin/index.css +0 -11
  22. package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -11
  23. package/es/src/theme/antd-global-overwrite/aplus/index.css +0 -11
  24. package/es/src/utils/index.d.ts +8 -0
  25. package/es/src/utils/index.mjs +40 -32
  26. package/es/src/work-order-modal/work-order-modal.vue.mjs +6 -8
  27. package/lib/src/ap-field/date/index.vue.d.ts +63 -5
  28. package/lib/src/ap-field/date/index.vue.js +1 -1
  29. package/lib/src/ap-field/date-range/index.vue.d.ts +68 -6
  30. package/lib/src/ap-field/date-range/index.vue.js +1 -1
  31. package/lib/src/ap-field/interface.d.ts +3 -7
  32. package/lib/src/ap-field/select/index.vue.d.ts +45 -179
  33. package/lib/src/ap-field/select/index.vue.js +1 -1
  34. package/lib/src/ap-form/items/date/index.vue.js +1 -1
  35. package/lib/src/ap-form/items/date-range/index.vue.d.ts +1 -1
  36. package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
  37. package/lib/src/ap-form/items/interface.d.ts +1 -1
  38. package/lib/src/ap-form/items/select/index.vue.js +1 -1
  39. package/lib/src/ap-table/ap-table.vue.d.ts +12 -8
  40. package/lib/src/ap-table/ap-table.vue.js +1 -1
  41. package/lib/src/ap-table/constants.d.ts +3092 -1827
  42. package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
  43. package/lib/src/ap-table/interface.d.ts +5 -9
  44. package/lib/src/ap-table/utils.d.ts +18 -0
  45. package/lib/src/ap-table/utils.js +1 -1
  46. package/lib/src/theme/antd-global-overwrite/admin/button.css +0 -11
  47. package/lib/src/theme/antd-global-overwrite/admin/index.css +0 -11
  48. package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -11
  49. package/lib/src/theme/antd-global-overwrite/aplus/index.css +0 -11
  50. package/lib/src/utils/index.d.ts +8 -0
  51. package/lib/src/utils/index.js +1 -1
  52. package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
  53. 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>;
@@ -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
  /**
@@ -111,9 +110,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
111
110
  params?: ParamsType;
112
111
  /**
113
112
  * 自定义渲染搜索表单
114
- * @param props
115
- * @param defaultDom
116
- * @returns
113
+ * @deprecated 未实现 暂不可用
117
114
  */
118
115
  searchFormRender?: (props: ApTableProps<RecordType, ParamsType, ValueType>, defaultDom: any) => any;
119
116
  /**
@@ -129,7 +126,7 @@ export type ApTableProps<RecordType = any, ParamsType = any, ValueType extends k
129
126
  }) => Promise<Partial<RequestData<RecordType>>>;
130
127
  /**
131
128
  * 数据加载完成后触发
132
- * @param data
129
+ * @deprecated 已弃用,请自行实现类似效果
133
130
  * @returns
134
131
  */
135
132
  onLoad?: (data: RecordType[]) => void;
@@ -181,4 +178,3 @@ export type ApTableExpose = {
181
178
  submit: () => void;
182
179
  reset: () => void;
183
180
  };
184
- export {};
@@ -1,3 +1,5 @@
1
+ import { ValueEnum, ValueEnumType } from './interface';
2
+
1
3
  export type FieldValueType = 'multiple' | 'multipleNumber' | 'dayjs' | 'dayjsRange' | 'dayjsDayRange' | 'number' | 'boolean' | 'object';
2
4
  export declare const formatParamsValueType: (type: FieldValueType | Record<string, FieldValueType>, value: any, cb: (t: FieldValueType, value: any) => any) => any;
3
5
  /**
@@ -12,3 +14,19 @@ export declare const parseFieldValue: (t: FieldValueType, value: any) => any;
12
14
  * @returns
13
15
  */
14
16
  export declare function dataIndexToStr(dataIndex: string | number | (string | number)[]): string | number;
17
+ type OptionType = {
18
+ label?: string;
19
+ text?: string;
20
+ value?: any;
21
+ disabled?: boolean;
22
+ [key: string]: any;
23
+ };
24
+ type ValueEnumMap = Map<string | number | boolean, ValueEnumType>;
25
+ export declare const objectToMap: (value: ValueEnum | undefined) => ValueEnumMap;
26
+ /**
27
+ * valueEnum转options array
28
+ * @param valueEnumParams
29
+ * @returns
30
+ */
31
+ export declare const valueEnumToArray: (valueEnumParams: ValueEnum) => OptionType;
32
+ export {};
@@ -1,22 +1,22 @@
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 a } from "lodash-unified";
2
+ const u = (t, r, n) => {
3
+ let o = {};
4
+ return c(t) ? Object.keys(t).forEach((s) => {
5
+ c(t[s]) ? o[s] = u(t[s], r[s], n) : o[s] = n(t[s], r);
6
+ }) : o = n(t, r), o;
7
+ }, d = (t, r) => {
8
+ switch (t) {
9
9
  case "dayjs":
10
10
  return r.valueOf();
11
11
  case "dayjsRange":
12
- return r.map((s) => s.valueOf());
12
+ return r.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, o] = r;
15
+ return [n.startOf("day").valueOf(), o.endOf("day").valueOf()];
16
16
  }
17
17
  case "multiple":
18
18
  case "multipleNumber":
19
- return c(r) ? r : [r];
19
+ return a(r) ? r : [r];
20
20
  case "boolean":
21
21
  return r;
22
22
  case "object":
@@ -25,11 +25,39 @@ const f = (e, r, s) => {
25
25
  return r;
26
26
  }
27
27
  };
28
- function O(e) {
29
- return c(e) ? e.join(".") : e;
28
+ function p(t) {
29
+ return a(t) ? t.join(".") : t;
30
30
  }
31
+ function f(t) {
32
+ const r = Object.prototype.toString.call(t).match(/^\[object (.*)\]$/)[1].toLowerCase();
33
+ return r === "string" && typeof t == "object" ? "object" : t === null ? "null" : t === void 0 ? "undefined" : r;
34
+ }
35
+ const i = (t) => f(t) === "map" ? t : new Map(Object.entries(t || {})), b = (t) => {
36
+ const r = [], n = i(t);
37
+ return n.forEach((o, s) => {
38
+ const e = n.get(s) || n.get(`${s}`);
39
+ if (e) {
40
+ if (typeof e == "object" && (e != null && e.text)) {
41
+ r.push({
42
+ text: e == null ? void 0 : e.text,
43
+ value: s,
44
+ label: e == null ? void 0 : e.text,
45
+ disabled: e.disabled
46
+ });
47
+ return;
48
+ }
49
+ r.push({
50
+ text: e,
51
+ label: e,
52
+ value: s
53
+ });
54
+ }
55
+ }), r;
56
+ };
31
57
  export {
32
- O as dataIndexToStr,
33
- f as formatParamsValueType,
34
- u as parseFieldValue
58
+ p as dataIndexToStr,
59
+ u as formatParamsValueType,
60
+ i as objectToMap,
61
+ d as parseFieldValue,
62
+ b as valueEnumToArray
35
63
  };
@@ -1,5 +1,4 @@
1
1
  .ant-btn {
2
- min-width: 88px;
3
2
  box-shadow: none;
4
3
  }
5
4
  .ant-btn-primary[disabled],
@@ -26,13 +25,3 @@
26
25
  .ant-btn-text[disabled]:hover {
27
26
  color: rgba(24, 144, 255, 0.2) !important;
28
27
  }
29
- .ant-form-item-control-input-content [text='重置'],
30
- .ant-form-item-control-input-content [text='查询'],
31
- .ant-form-item-control-input-content [text='Reset'],
32
- .ant-form-item-control-input-content [text='Search'] {
33
- min-width: 0;
34
- }
35
- .ant-btn-link,
36
- .ant-btn-text {
37
- min-width: 0;
38
- }
@@ -46,7 +46,6 @@
46
46
  border: 1px solid rgba(255, 77, 79, 0.4);
47
47
  }
48
48
  .ant-btn {
49
- min-width: 88px;
50
49
  box-shadow: none;
51
50
  }
52
51
  .ant-btn-primary[disabled],
@@ -73,16 +72,6 @@
73
72
  .ant-btn-text[disabled]:hover {
74
73
  color: rgba(24, 144, 255, 0.2) !important;
75
74
  }
76
- .ant-form-item-control-input-content [text='重置'],
77
- .ant-form-item-control-input-content [text='查询'],
78
- .ant-form-item-control-input-content [text='Reset'],
79
- .ant-form-item-control-input-content [text='Search'] {
80
- min-width: 0;
81
- }
82
- .ant-btn-link,
83
- .ant-btn-text {
84
- min-width: 0;
85
- }
86
75
  .ant-form .ant-form-item label {
87
76
  font-weight: normal;
88
77
  }
@@ -1,5 +1,4 @@
1
1
  .ant-btn {
2
- min-width: 88px;
3
2
  box-shadow: none;
4
3
  }
5
4
  .ant-btn-primary[disabled],
@@ -26,13 +25,3 @@
26
25
  .ant-btn-text[disabled]:hover {
27
26
  color: #cce2ff !important;
28
27
  }
29
- .ant-form-item-control-input-content [text='重置'],
30
- .ant-form-item-control-input-content [text='查询'],
31
- .ant-form-item-control-input-content [text='Reset'],
32
- .ant-form-item-control-input-content [text='Search'] {
33
- min-width: 0;
34
- }
35
- .ant-btn-link,
36
- .ant-btn-text {
37
- min-width: 0;
38
- }
@@ -46,7 +46,6 @@
46
46
  border: 1px solid rgba(255, 77, 79, 0.4);
47
47
  }
48
48
  .ant-btn {
49
- min-width: 88px;
50
49
  box-shadow: none;
51
50
  }
52
51
  .ant-btn-primary[disabled],
@@ -73,16 +72,6 @@
73
72
  .ant-btn-text[disabled]:hover {
74
73
  color: #cce2ff !important;
75
74
  }
76
- .ant-form-item-control-input-content [text='重置'],
77
- .ant-form-item-control-input-content [text='查询'],
78
- .ant-form-item-control-input-content [text='Reset'],
79
- .ant-form-item-control-input-content [text='Search'] {
80
- min-width: 0;
81
- }
82
- .ant-btn-link,
83
- .ant-btn-text {
84
- min-width: 0;
85
- }
86
75
  .ant-form .ant-form-item label {
87
76
  font-weight: normal;
88
77
  }
@@ -20,3 +20,11 @@ export declare function isPascalCase(str: string): boolean;
20
20
  * @returns
21
21
  */
22
22
  export declare function convertReactiveToRaw(obj: Recordable<any>): Recordable<any>;
23
+ /**
24
+ * 删除对象中为undefined的key
25
+ * @param value
26
+ * @returns
27
+ */
28
+ export declare function omitUndefined(value: Recordable<any>): {
29
+ [x: string]: any;
30
+ };
@@ -1,43 +1,51 @@
1
- import { unref as u, markRaw as a } from "vue";
2
- function l(t) {
3
- return (t == null ? void 0 : t.parentNode) ?? document.body;
1
+ import { unref as s, markRaw as u } from "vue";
2
+ import { isUndefined as a } from "lodash-unified";
3
+ function p(e) {
4
+ return (e == null ? void 0 : e.parentNode) ?? document.body;
4
5
  }
5
- function y(t) {
6
- return typeof t < "u";
6
+ function m(e) {
7
+ return typeof e < "u";
7
8
  }
8
- function p(t) {
9
- const e = {};
10
- return Object.keys(t).map((n) => {
11
- e[n] = u(t[n]);
12
- }), e;
9
+ function d(e) {
10
+ const t = {};
11
+ return Object.keys(e).map((n) => {
12
+ t[n] = s(e[n]);
13
+ }), t;
13
14
  }
14
- function m(t, e = [], n) {
15
- const r = Object.assign({}, t), o = Object.keys(r);
16
- for (let i = 0; i < o.length; i += 1) {
17
- const c = o[i];
18
- (e.includes(c) || n != null && n(c, r[c])) && delete r[c];
15
+ function g(e, t = [], n) {
16
+ const r = Object.assign({}, e), i = Object.keys(r);
17
+ for (let c = 0; c < i.length; c += 1) {
18
+ const o = i[c];
19
+ (t.includes(o) || n != null && n(o, r[o])) && delete r[o];
19
20
  }
20
21
  return r;
21
22
  }
22
- function g(t) {
23
- return /^[A-Z][A-Za-z]*$/.test(t);
23
+ function k(e) {
24
+ return /^[A-Z][A-Za-z]*$/.test(e);
24
25
  }
25
- function s(t) {
26
- if (Array.isArray(t))
27
- return t.map((e) => s(e));
28
- if (typeof t == "object" && t !== null) {
29
- const e = {};
30
- for (const n in t)
31
- e[n] = s(t[n]);
32
- return a(e);
26
+ function f(e) {
27
+ if (Array.isArray(e))
28
+ return e.map((t) => f(t));
29
+ if (typeof e == "object" && e !== null) {
30
+ const t = {};
31
+ for (const n in e)
32
+ t[n] = f(e[n]);
33
+ return u(t);
33
34
  }
34
- return t;
35
+ return e;
36
+ }
37
+ function O(e) {
38
+ const t = { ...e };
39
+ for (const n of Object.keys(t))
40
+ a(t[n]) && delete t[n];
41
+ return console.log("copy", t), t;
35
42
  }
36
43
  export {
37
- s as convertReactiveToRaw,
38
- p as getDynamicProps,
39
- l as getPopupContainer,
40
- y as isDef,
41
- g as isPascalCase,
42
- m as omitWhen
44
+ f as convertReactiveToRaw,
45
+ d as getDynamicProps,
46
+ p as getPopupContainer,
47
+ m as isDef,
48
+ k as isPascalCase,
49
+ O as omitUndefined,
50
+ g as omitWhen
43
51
  };
@@ -1,13 +1,13 @@
1
1
  import { defineComponent as F, ref as c, openBlock as w, createElementBlock as T, createVNode as t, unref as e, mergeProps as N, h as m, withCtx as l } from "vue";
2
- import { message as O, Modal as A, Input as L, Textarea as P } from "ant-design-vue";
2
+ import { message as O, Modal as A, Input as L, Textarea as q } from "ant-design-vue";
3
3
  import { ApForm as r } from "../ap-form/index.mjs";
4
4
  import "./help-message.vue.mjs";
5
5
  import "../ap-upload/index.mjs";
6
6
  import { DictCode as k } from "./interfaces.mjs";
7
7
  import "../config-provider/index.mjs";
8
8
  import "./style/index.css";
9
- import { useNamespace as q } from "../config-provider/hooks/use-namespace.mjs";
10
- import { useGlobalConfig as I } from "../config-provider/hooks/use-global-config.mjs";
9
+ import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
10
+ import { useGlobalConfig as P } from "../config-provider/hooks/use-global-config.mjs";
11
11
  import { useLocale as R } from "../config-provider/hooks/use-locale.mjs";
12
12
  import S from "../ap-form/items/select/index.vue.mjs";
13
13
  import $ from "../ap-form/items/radio/index.vue.mjs";
@@ -59,7 +59,7 @@ const oe = /* @__PURE__ */ F({
59
59
  },
60
60
  emits: ["modalClose"],
61
61
  setup(x, { emit: C }) {
62
- const { b: v, e: D } = q("work-order-modal"), p = c(), a = c(!1), u = c(!0), i = x, _ = I("api"), { lang: b } = R(), h = C, f = async (n) => {
62
+ const { b: v, e: D } = I("work-order-modal"), p = c(), a = c(!1), u = c(!0), i = x, _ = P("api"), { lang: b } = R(), h = C, f = async (n) => {
63
63
  var s, y;
64
64
  const o = await ((y = (s = _.value) == null ? void 0 : s.select) == null ? void 0 : y.call(s, {
65
65
  dictCode: n,
@@ -122,9 +122,7 @@ const oe = /* @__PURE__ */ F({
122
122
  name: "ticketsType",
123
123
  rules: [{ required: !0, message: "不可为空" }],
124
124
  field: {
125
- fieldProps: {
126
- placeholder: "请选择"
127
- },
125
+ placeholder: "请选择",
128
126
  request: () => f(e(k).TicketsType)
129
127
  }
130
128
  }, null, 8, ["field"]),
@@ -134,7 +132,7 @@ const oe = /* @__PURE__ */ F({
134
132
  rules: [{ required: !0, message: "不可为空" }]
135
133
  }, {
136
134
  default: l(() => [
137
- t(e(P), {
135
+ t(e(q), {
138
136
  placeholder: "请输入",
139
137
  maxlength: 300,
140
138
  "show-count": !0
@@ -1,6 +1,7 @@
1
+ import { default as dayjs } from 'dayjs';
1
2
  import { ApFieldDateProps, FieldMode } from '../interface';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, PropType } from 'vue';
3
- import { DatePickerProps } from 'ant-design-vue';
3
+ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes, VNode, RendererNode, RendererElement, PropType } from 'vue';
4
+ import { SharedTimeProps } from 'ant-design-vue/es/vc-picker/panels/TimePanel';
4
5
 
5
6
  type ApFieldDataSlots = {
6
7
  dateRender: any;
@@ -18,19 +19,76 @@ type ApFieldDataSlots = {
18
19
  declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldDateProps>, {
19
20
  format: string;
20
21
  mode: string;
21
- fieldProps: () => {};
22
+ emptyText: string;
23
+ allowClear: undefined;
24
+ autofocus: undefined;
25
+ bordered: undefined;
26
+ clearIcon: undefined;
27
+ defaultOpen: undefined;
28
+ disabled: undefined;
29
+ hideDisabledOptions: undefined;
30
+ inputReadOnly: undefined;
31
+ open: undefined;
32
+ showHour: undefined;
33
+ showMinute: undefined;
34
+ showNow: undefined;
35
+ showSecond: undefined;
36
+ showTime: undefined;
37
+ showToday: undefined;
38
+ suffixIcon: undefined;
39
+ use12Hours: undefined;
22
40
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
23
41
  "update:value": (...args: any[]) => void;
24
42
  }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<ApFieldDateProps>, {
25
43
  format: string;
26
44
  mode: string;
27
- fieldProps: () => {};
45
+ emptyText: string;
46
+ allowClear: undefined;
47
+ autofocus: undefined;
48
+ bordered: undefined;
49
+ clearIcon: undefined;
50
+ defaultOpen: undefined;
51
+ disabled: undefined;
52
+ hideDisabledOptions: undefined;
53
+ inputReadOnly: undefined;
54
+ open: undefined;
55
+ showHour: undefined;
56
+ showMinute: undefined;
57
+ showNow: undefined;
58
+ showSecond: undefined;
59
+ showTime: undefined;
60
+ showToday: undefined;
61
+ suffixIcon: undefined;
62
+ use12Hours: undefined;
28
63
  }>>> & {
29
64
  "onUpdate:value"?: ((...args: any[]) => any) | undefined;
30
65
  }, {
66
+ disabled: boolean;
67
+ open: boolean;
68
+ autofocus: boolean;
31
69
  mode: FieldMode;
70
+ suffixIcon: string | number | boolean | void | VNode<RendererNode, RendererElement, {
71
+ [key: string]: any;
72
+ }> | (string | number | boolean | void | VNode<RendererNode, RendererElement, {
73
+ [key: string]: any;
74
+ }> | null | undefined)[] | VNode<RendererNode, RendererElement, {
75
+ [key: string]: any;
76
+ }> | null;
77
+ bordered: boolean;
78
+ clearIcon: string | number | boolean | void | VNode<RendererNode, RendererElement, {
79
+ [key: string]: any;
80
+ }> | (string | number | boolean | void | VNode<RendererNode, RendererElement, {
81
+ [key: string]: any;
82
+ }> | null | undefined)[] | VNode<RendererNode, RendererElement, {
83
+ [key: string]: any;
84
+ }> | null;
85
+ allowClear: boolean;
86
+ defaultOpen: boolean;
32
87
  format: string;
33
- fieldProps: Omit< DatePickerProps, "mode" | "onOk" | "onChange" | "value" | "onUpdate:value" | "defaultValue" | "format">;
88
+ inputReadOnly: boolean;
89
+ showToday: boolean;
90
+ showTime: boolean | SharedTimeProps<dayjs.Dayjs>;
91
+ emptyText: string;
34
92
  }, {}>, Readonly<ApFieldDataSlots> & ApFieldDataSlots>;
35
93
  export default _default;
36
94
  type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),s=require("dayjs"),C=require("ant-design-vue"),c=require("./constant.js");require("../../hooks/index.js");const p=require("lodash-unified"),m=require("./helper.js"),D=require("../../hooks/useControllableValue.js"),M=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},fieldProps:{default:()=>({})},emptyText:{},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"}},emits:["update:value"],setup(P,{emit:v}){const t=P,k=v,{value:i,updateValue:d}=D.useControllableValue(t,k),a=e.computed(()=>c.ApFieldDatePresetFormats.indexOf(t.format)>-1),u=e.computed(()=>a.value?c.PRESET_FORMAT_MAP[t.format]:t.format),_=e.computed(()=>p.isNil(e.unref(i))?void 0:s(e.unref(i))),g=e.computed(()=>e.unref(a)?t.fieldProps.picker??c.PRESET_FORMAT_PICK_MAP[t.format]:t.fieldProps.picker),y=e.computed(()=>{const r=e.unref(a)?c.PRESET_FORMAT_TIME_MAP[t.format]:{};return{...t.fieldProps,...r}});function O(r){if(p.isNil(r)){d(null);return}const n=s(r);e.unref(a)?d(m.formatDay(n,e.unref(u))):d(n.valueOf())}function h(r,n){var f;const l=s(r),o=e.unref(a)?m.formatDay(l,e.unref(u)):r?l.valueOf():null;(f=t.onChange)==null||f.call(t,o,n)}function T(r){var o;const n=s(r),l=e.unref(a)?m.formatDay(n,e.unref(u)):r?n.valueOf():null;(o=t.onOk)==null||o.call(t,l)}return(r,n)=>r.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(i)?e.unref(s)(e.unref(i)).format(u.value):r.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(C.DatePicker),e.mergeProps({key:1},y.value,{value:_.value,format:u.value,"onUpdate:value":O,onChange:h,onOk:T,picker:g.value}),e.createSlots({_:2},[e.renderList(r.$slots,(l,o)=>({name:o,fn:e.withCtx(f=>[e.renderSlot(r.$slots,o,e.normalizeProps(e.guardReactiveProps(f||{})))])}))]),1040,["value","format","picker"]))}});exports.default=M;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),d=require("dayjs"),b=require("ant-design-vue"),f=require("./constant.js");require("../../hooks/index.js");const c=require("lodash-unified"),m=require("./helper.js"),S=require("../../hooks/useControllableValue.js"),_=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:void 0},autofocus:{type:Boolean,default:void 0},disabled:{type:Boolean,default:void 0},tabindex:{},open:{type:Boolean,default:void 0},defaultOpen:{type:Boolean,default:void 0},inputReadOnly:{type:Boolean,default:void 0},id:{},presets:{},suffixIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},clearIcon:{type:[Object,String,Number,Boolean,null,Array],default:void 0},getPopupContainer:{},panelRender:{},inputRender:{},onOpenChange:{},onPanelChange:{},onFocus:{},onBlur:{},onMousedown:{},onMouseup:{},onMouseenter:{},onMouseleave:{},onClick:{},onContextmenu:{},onKeydown:{},role:{},name:{},autocomplete:{},direction:{},showToday:{type:Boolean,default:void 0},showTime:{type:Boolean,default:void 0},picker:{},prefixCls:{},defaultPickerValue:{},disabledDate:{},dateRender:{},monthCellRender:{},renderExtraFooter:{},onSelect:{},locale:{},size:{},bordered:{type:Boolean,default:void 0},showNow:{type:Boolean,default:void 0},disabledTime:{},defaultOpenValue:{},showHour:{type:Boolean,default:void 0},showMinute:{type:Boolean,default:void 0},showSecond:{type:Boolean,default:void 0},use12Hours:{type:Boolean,default:void 0},hourStep:{},minuteStep:{},secondStep:{},hideDisabledOptions:{type:Boolean,default:void 0},disabledHours:{},disabledMinutes:{},disabledSeconds:{},valueFormat:{},emptyText:{default:"-"},value:{},defaultValue:{},onChange:{},onOk:{},format:{default:"Y-D"}},emits:["update:value"],setup(v,{emit:y}){const o=v,h=y,{value:i,updateValue:p}=S.useControllableValue(o,h),l=e.computed(()=>f.ApFieldDatePresetFormats.indexOf(o.format)>-1),u=e.computed(()=>l.value?f.PRESET_FORMAT_MAP[o.format]:o.format),B=e.computed(()=>c.isNil(e.unref(i))?void 0:d(e.unref(i))),k=e.computed(()=>e.unref(l)?o.picker??f.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),g=e.computed(()=>{const t=e.unref(l)?f.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...c.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),...t}});function O(t){if(c.isNil(t)){p(null);return}const n=d(t);e.unref(l)?p(m.formatDay(n,e.unref(u))):p(n.valueOf())}function P(t,n){var s;const r=d(t),a=e.unref(l)?m.formatDay(r,e.unref(u)):t?r.valueOf():null;(s=o.onChange)==null||s.call(o,a,n)}function C(t){var a;const n=d(t),r=e.unref(l)?m.formatDay(n,e.unref(u)):t?n.valueOf():null;(a=o.onOk)==null||a.call(o,r)}return(t,n)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(e.unref(i)?e.unref(d)(e.unref(i)).format(u.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(b.DatePicker),e.mergeProps({key:1},g.value,{value:B.value,format:u.value,"onUpdate:value":O,onChange:P,onOk:C,picker:k.value}),e.createSlots({_:2},[e.renderList(t.$slots,(r,a)=>({name:a,fn:e.withCtx(s=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(s||{})))])}))]),1040,["value","format","picker"]))}});exports.default=_;