@aplus-frontend/ui 0.0.23 → 0.0.25
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/src/ap-field/date/index.vue.mjs +26 -26
- package/es/src/ap-field/number/helper.d.ts +9 -0
- package/es/src/ap-field/number/helper.mjs +20 -11
- package/es/src/ap-table/ap-table.vue.d.ts +2137 -112
- package/es/src/ap-table/ap-table.vue.mjs +31 -30
- package/es/src/check-card/style/index.css +1 -0
- package/es/src/editable-table/form-item.vue.mjs +61 -63
- package/es/src/editable-table/hooks/use-get-columns.mjs +27 -27
- package/es/src/editable-table/index.vue.mjs +63 -65
- package/es/src/editable-table/utils.d.ts +13 -0
- package/es/src/editable-table/utils.mjs +26 -6
- package/es/src/theme/check-card/index.css +1 -0
- package/es/src/work-order-modal/createWorkOrder.mjs +2 -1
- package/es/src/work-order-modal/work-order-modal.vue.d.ts +2 -0
- package/es/src/work-order-modal/work-order-modal.vue.mjs +51 -46
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/number/helper.d.ts +9 -0
- package/lib/src/ap-field/number/helper.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +2137 -112
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/check-card/style/index.css +1 -0
- package/lib/src/editable-table/form-item.vue.js +1 -1
- package/lib/src/editable-table/hooks/use-get-columns.js +1 -1
- package/lib/src/editable-table/index.vue.js +1 -1
- package/lib/src/editable-table/utils.d.ts +13 -0
- package/lib/src/editable-table/utils.js +1 -1
- package/lib/src/theme/check-card/index.css +1 -0
- package/lib/src/work-order-modal/createWorkOrder.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.d.ts +2 -0
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +3 -3
|
@@ -6,3 +6,16 @@ import { EditableColumnType } from './interface';
|
|
|
6
6
|
* @returns
|
|
7
7
|
*/
|
|
8
8
|
export declare function getEditableComponent(valueType: EditableColumnType['valueType']): any;
|
|
9
|
+
/**
|
|
10
|
+
* 获取可编辑表格的某列字段是否是required
|
|
11
|
+
* @param column
|
|
12
|
+
* @returns
|
|
13
|
+
*/
|
|
14
|
+
export declare function getColumnIsRequired(column: EditableColumnType<any, 'text'>): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* 获取ellipsis模式下最终需要渲染的字符串
|
|
17
|
+
* @param column
|
|
18
|
+
* @param value
|
|
19
|
+
* @returns
|
|
20
|
+
*/
|
|
21
|
+
export declare function getRawDisplayValue(column: EditableColumnType, value: any): any;
|
|
@@ -1,10 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { isFunction as i, isArray as o } from "lodash-unified";
|
|
2
|
+
import { apTableFormItemMap as f } from "../ap-table/constants.mjs";
|
|
3
|
+
import { isDef as n } from "../utils/index.mjs";
|
|
4
|
+
import { getValueStr as p } from "../ap-field/number/helper.mjs";
|
|
5
|
+
function P(e) {
|
|
6
|
+
const r = f[e];
|
|
7
|
+
return r || console.warn(
|
|
5
8
|
`${e} can not render because of no default renderer, use customRender instead.`
|
|
6
|
-
),
|
|
9
|
+
), r;
|
|
10
|
+
}
|
|
11
|
+
function m(e) {
|
|
12
|
+
if (!e.fieldProps)
|
|
13
|
+
return !1;
|
|
14
|
+
const r = i(e.fieldProps) ? e.fieldProps({}) : e.fieldProps;
|
|
15
|
+
return n(r.required) ? r.required : (o(r.rules) ? r.rules : r.rules ? [r.rules] : []).some((s) => s.required);
|
|
16
|
+
}
|
|
17
|
+
function b(e, r) {
|
|
18
|
+
if (e.valueType === "text" || e.valueType === "textArea")
|
|
19
|
+
return r || "--";
|
|
20
|
+
if (e.valueType === "number") {
|
|
21
|
+
const t = e.fieldProps ? i(e.fieldProps) ? e.fieldProps({}) : e.fieldProps : {};
|
|
22
|
+
return p(r, t) || "--";
|
|
23
|
+
}
|
|
24
|
+
return r;
|
|
7
25
|
}
|
|
8
26
|
export {
|
|
9
|
-
|
|
27
|
+
m as getColumnIsRequired,
|
|
28
|
+
P as getEditableComponent,
|
|
29
|
+
b as getRawDisplayValue
|
|
10
30
|
};
|
|
@@ -3,7 +3,9 @@ import { DefineComponent, ComponentOptionsMixin, PublicProps, ExtractPropTypes,
|
|
|
3
3
|
|
|
4
4
|
declare const _default: DefineComponent<__VLS_TypePropsToRuntimeProps<WorkOrderModalProps>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
|
|
5
5
|
modalClose: () => void;
|
|
6
|
+
"update:open": () => void;
|
|
6
7
|
}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_TypePropsToRuntimeProps<WorkOrderModalProps>>> & {
|
|
8
|
+
"onUpdate:open"?: (() => any) | undefined;
|
|
7
9
|
onModalClose?: (() => any) | undefined;
|
|
8
10
|
}, {}, {}>;
|
|
9
11
|
export default _default;
|
|
@@ -1,19 +1,21 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { message as
|
|
3
|
-
import { ApForm as
|
|
1
|
+
import { defineComponent as w, ref as g, openBlock as T, createElementBlock as N, createVNode as t, unref as e, mergeProps as O, h as m, withCtx as n } from "vue";
|
|
2
|
+
import { message as A, Modal as L, Input as P, Textarea as q } from "ant-design-vue";
|
|
3
|
+
import { ApForm as i } 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 "../hooks/index.mjs";
|
|
9
10
|
import { useNamespace as I } from "../config-provider/hooks/use-namespace.mjs";
|
|
10
|
-
import { useGlobalConfig as
|
|
11
|
+
import { useGlobalConfig as V } from "../config-provider/hooks/use-global-config.mjs";
|
|
11
12
|
import { useLocale as R } from "../config-provider/hooks/use-locale.mjs";
|
|
12
|
-
import S from "../
|
|
13
|
-
import $ from "../ap-form/items/
|
|
14
|
-
import j from "../ap-
|
|
15
|
-
import z from "
|
|
16
|
-
|
|
13
|
+
import { useControllableValue as S } from "../hooks/useControllableValue.mjs";
|
|
14
|
+
import $ from "../ap-form/items/select/index.vue.mjs";
|
|
15
|
+
import j from "../ap-form/items/radio/index.vue.mjs";
|
|
16
|
+
import z from "../ap-upload/apUpload.vue.mjs";
|
|
17
|
+
import D from "./help-message.vue2.mjs";
|
|
18
|
+
const re = /* @__PURE__ */ w({
|
|
17
19
|
__name: "work-order-modal",
|
|
18
20
|
props: {
|
|
19
21
|
api: { type: Function },
|
|
@@ -57,34 +59,37 @@ const oe = /* @__PURE__ */ F({
|
|
|
57
59
|
modalRender: { type: Function },
|
|
58
60
|
mousePosition: {}
|
|
59
61
|
},
|
|
60
|
-
emits: ["modalClose"],
|
|
61
|
-
setup(
|
|
62
|
-
const { b: v, e:
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
emits: ["modalClose", "update:open"],
|
|
63
|
+
setup(C, { emit: x }) {
|
|
64
|
+
const { b: v, e: K } = I("work-order-modal"), c = x, p = g(), a = g(!1), r = C, b = V("api"), { lang: _ } = R(), { value: h, updateValue: B } = S(r, c, {
|
|
65
|
+
valuePropName: "open",
|
|
66
|
+
defaultValue: !0
|
|
67
|
+
}), u = async (l) => {
|
|
68
|
+
var s, d;
|
|
69
|
+
const o = await ((d = (s = b.value) == null ? void 0 : s.select) == null ? void 0 : d.call(s, {
|
|
70
|
+
dictCode: l,
|
|
71
|
+
locale: _.value
|
|
67
72
|
}));
|
|
68
|
-
return o == null ? void 0 : o.map((
|
|
69
|
-
},
|
|
70
|
-
var
|
|
73
|
+
return o == null ? void 0 : o.map((y) => ({ label: y.itemText, value: y.itemValue }));
|
|
74
|
+
}, F = async () => {
|
|
75
|
+
var l;
|
|
71
76
|
if (!a.value)
|
|
72
77
|
try {
|
|
73
78
|
a.value = !0;
|
|
74
|
-
const o = await ((
|
|
75
|
-
await
|
|
79
|
+
const o = await ((l = p.value) == null ? void 0 : l.validateFields());
|
|
80
|
+
await r.api(o), a.value = !1, A.success("操作成功"), f();
|
|
76
81
|
} catch {
|
|
77
82
|
a.value = !1;
|
|
78
83
|
return;
|
|
79
84
|
}
|
|
80
|
-
},
|
|
81
|
-
|
|
85
|
+
}, f = () => {
|
|
86
|
+
B(!1), c("modalClose");
|
|
82
87
|
};
|
|
83
|
-
return (
|
|
84
|
-
t(e(
|
|
88
|
+
return (l, o) => (T(), N("div", null, [
|
|
89
|
+
t(e(L), O(r, {
|
|
85
90
|
width: 600,
|
|
86
91
|
centered: !0,
|
|
87
|
-
open:
|
|
92
|
+
open: e(h),
|
|
88
93
|
title: "创建工单",
|
|
89
94
|
"ok-text": m("span", {}, ["确认"]),
|
|
90
95
|
"cancel-text": m("span", {}, ["取消"]),
|
|
@@ -92,24 +97,24 @@ const oe = /* @__PURE__ */ F({
|
|
|
92
97
|
"mask-closable": !0,
|
|
93
98
|
wrapClassName: e(v)(),
|
|
94
99
|
closable: !0,
|
|
95
|
-
onOk:
|
|
100
|
+
onOk: F,
|
|
96
101
|
confirmLoading: a.value,
|
|
97
|
-
onCancel:
|
|
102
|
+
onCancel: f
|
|
98
103
|
}), {
|
|
99
|
-
default:
|
|
100
|
-
t(e(
|
|
104
|
+
default: n(() => [
|
|
105
|
+
t(e(i), {
|
|
101
106
|
ref_key: "formRef",
|
|
102
107
|
ref: p,
|
|
103
108
|
colon: !1
|
|
104
109
|
}, {
|
|
105
|
-
default:
|
|
106
|
-
t(e(
|
|
110
|
+
default: n(() => [
|
|
111
|
+
t(e(i).FormItem, {
|
|
107
112
|
label: "工单标题",
|
|
108
113
|
name: "ticketsTitle",
|
|
109
114
|
rules: [{ required: !0, message: "不可为空" }]
|
|
110
115
|
}, {
|
|
111
|
-
default:
|
|
112
|
-
t(e(
|
|
116
|
+
default: n(() => [
|
|
117
|
+
t(e(P), {
|
|
113
118
|
placeholder: "请输入",
|
|
114
119
|
maxlength: 50,
|
|
115
120
|
"show-count": !0
|
|
@@ -117,21 +122,21 @@ const oe = /* @__PURE__ */ F({
|
|
|
117
122
|
]),
|
|
118
123
|
_: 1
|
|
119
124
|
}),
|
|
120
|
-
t(e(
|
|
125
|
+
t(e($), {
|
|
121
126
|
label: "工单类型",
|
|
122
127
|
name: "ticketsType",
|
|
123
128
|
rules: [{ required: !0, message: "不可为空" }],
|
|
124
129
|
field: {
|
|
125
130
|
placeholder: "请选择",
|
|
126
|
-
request: () =>
|
|
131
|
+
request: () => u(e(k).TicketsType)
|
|
127
132
|
}
|
|
128
133
|
}, null, 8, ["field"]),
|
|
129
|
-
t(e(
|
|
134
|
+
t(e(i).FormItem, {
|
|
130
135
|
label: "工单详情",
|
|
131
136
|
name: "ticketsContent",
|
|
132
137
|
rules: [{ required: !0, message: "不可为空" }]
|
|
133
138
|
}, {
|
|
134
|
-
default:
|
|
139
|
+
default: n(() => [
|
|
135
140
|
t(e(q), {
|
|
136
141
|
placeholder: "请输入",
|
|
137
142
|
maxlength: 300,
|
|
@@ -140,19 +145,19 @@ const oe = /* @__PURE__ */ F({
|
|
|
140
145
|
]),
|
|
141
146
|
_: 1
|
|
142
147
|
}),
|
|
143
|
-
t(e(
|
|
148
|
+
t(e(j), {
|
|
144
149
|
label: "优先级",
|
|
145
150
|
name: "ticketsLevel",
|
|
146
151
|
rules: [{ required: !0, message: "不可为空" }],
|
|
147
152
|
field: {
|
|
148
|
-
request: () =>
|
|
153
|
+
request: () => u(e(k).TicketsLevel)
|
|
149
154
|
}
|
|
150
155
|
}, null, 8, ["field"]),
|
|
151
|
-
t(e(
|
|
152
|
-
default:
|
|
153
|
-
t(e(
|
|
156
|
+
t(e(i).FormItem, { name: "files" }, {
|
|
157
|
+
default: n(() => [
|
|
158
|
+
t(e(z), {
|
|
154
159
|
dirName: "WorkOrder",
|
|
155
|
-
getOssAccess:
|
|
160
|
+
getOssAccess: r.getOssAccess,
|
|
156
161
|
type: "multipleFile",
|
|
157
162
|
needName: {
|
|
158
163
|
pathKey: "filePath",
|
|
@@ -161,7 +166,7 @@ const oe = /* @__PURE__ */ F({
|
|
|
161
166
|
accept: ".txt,.doc,.docx,.rtf,.pdf,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.mp4,.avi,.wmv,.mov,.mkv,.xls,.xlsx,.csv,.ppt,.pptx",
|
|
162
167
|
maxCount: 10,
|
|
163
168
|
maxSize: 50,
|
|
164
|
-
subTitle: m(
|
|
169
|
+
subTitle: m(D)
|
|
165
170
|
}, null, 8, ["getOssAccess", "subTitle"])
|
|
166
171
|
]),
|
|
167
172
|
_: 1
|
|
@@ -176,5 +181,5 @@ const oe = /* @__PURE__ */ F({
|
|
|
176
181
|
}
|
|
177
182
|
});
|
|
178
183
|
export {
|
|
179
|
-
|
|
184
|
+
re as default
|
|
180
185
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),u=require("dayjs"),b=require("ant-design-vue"),s=require("./constant.js");require("../../hooks/index.js");const v=require("lodash-unified"),S=require("./helper.js"),T=require("@aplus-frontend/utils"),_=require("../../hooks/useControllableValue.js"),M=e.defineComponent({name:"ApFieldDate",__name:"index",props:{mode:{default:"edit"},class:{},style:{},dropdownClassName:{},dropdownAlign:{},popupStyle:{},transitionName:{},placeholder:{},allowClear:{type:Boolean,default:!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"},timezone:{}},emits:["update:value"],setup(y,{emit:h}){const o=y,g=h,{value:f,updateValue:c}=_.useControllableValue(o,g),l=e.computed(()=>s.ApFieldDatePresetFormats.indexOf(o.format)>-1),r=e.computed(()=>l.value?s.PRESET_FORMAT_MAP[o.format]:o.format),p=e.computed(()=>{if(v.isNil(e.unref(f)))return;let t=u(e.unref(f));return o.timezone&&(t=u(T.getTimeFormatToZone(e.unref(f),o.timezone))),t}),B=e.computed(()=>e.unref(l)?o.picker??s.PRESET_FORMAT_PICK_MAP[o.format]:o.picker),k=e.computed(()=>{const t=e.unref(l)?s.PRESET_FORMAT_TIME_MAP[o.format]:{};return{...v.omit(o,["value","defaultValue","onChange","onOk","format","onUpdate:value","mode"]),...t}}),m=S.formatDayWithTimezone(o.timezone);function O(t){if(v.isNil(t)){c(null);return}const n=u(t);e.unref(l)?c(m(n,e.unref(r))):c(n.valueOf())}function P(t,n){var i;const d=u(t),a=t?e.unref(l)?m(d,e.unref(r)):d.valueOf():null;(i=o.onChange)==null||i.call(o,a,n)}function C(t){var a;const n=u(t),d=t?e.unref(l)?m(n,e.unref(r)):n.valueOf():null;(a=o.onOk)==null||a.call(o,d)}return(t,n)=>t.mode==="read"?(e.openBlock(),e.createElementBlock(e.Fragment,{key:0},[e.createTextVNode(e.toDisplayString(p.value?e.unref(u)(p.value).format(r.value):t.emptyText),1)],64)):(e.openBlock(),e.createBlock(e.unref(b.DatePicker),e.mergeProps({key:1},k.value,{value:p.value,format:r.value,"onUpdate:value":O,onChange:P,onOk:C,picker:B.value}),e.createSlots({_:2},[e.renderList(t.$slots,(d,a)=>({name:a,fn:e.withCtx(i=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(i||{})))])}))]),1040,["value","format","picker"]))}});exports.default=M;
|
|
@@ -1 +1,10 @@
|
|
|
1
|
+
import { ApFieldNumberProps } from '../interface';
|
|
2
|
+
|
|
1
3
|
export declare function addZeroToDecimalPlaces(numStr: string, precision?: number): string;
|
|
4
|
+
/**
|
|
5
|
+
* 获取字符串类型的值
|
|
6
|
+
* @param value
|
|
7
|
+
* @param options
|
|
8
|
+
* @returns
|
|
9
|
+
*/
|
|
10
|
+
export declare function getValueStr(value?: number, options?: ApFieldNumberProps): string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("lodash-unified"),u=require("@fruits-chain/utils");function i(l,e){if(c.isNil(e))return l;let[a,r=""]=l.split(".");if(r.length>=e)return l;for(let t=r.length;t<e;t++)r+="0";return a+"."+r}function f(l,e){const a=l;if(c.isNil(a))return e==null?void 0:e.emptyText;let r=e!=null&&e.thousands?u.toDecimalMark(a,e.precision):String(a);return e!=null&&e.precision&&e.limitDecimalsRetain&&(r=i(r,e.precision)),r}exports.addZeroToDecimalPlaces=i;exports.getValueStr=f;
|