@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.
- package/es/src/ap-field/date/index.vue.d.ts +63 -5
- package/es/src/ap-field/date/index.vue.mjs +115 -46
- package/es/src/ap-field/date-range/index.vue.d.ts +68 -6
- package/es/src/ap-field/date-range/index.vue.mjs +135 -62
- package/es/src/ap-field/interface.d.ts +3 -7
- package/es/src/ap-field/select/index.vue.d.ts +45 -179
- package/es/src/ap-field/select/index.vue.mjs +137 -66
- package/es/src/ap-form/items/date/index.vue.mjs +27 -29
- package/es/src/ap-form/items/date-range/index.vue.d.ts +1 -1
- package/es/src/ap-form/items/date-range/index.vue.mjs +27 -29
- package/es/src/ap-form/items/interface.d.ts +1 -1
- package/es/src/ap-form/items/select/index.vue.mjs +32 -32
- package/es/src/ap-table/ap-table.vue.d.ts +12 -8
- package/es/src/ap-table/ap-table.vue.mjs +88 -78
- package/es/src/ap-table/constants.d.ts +3092 -1827
- package/es/src/ap-table/hooks/use-table-paging.mjs +23 -23
- package/es/src/ap-table/interface.d.ts +5 -9
- package/es/src/ap-table/utils.d.ts +18 -0
- package/es/src/ap-table/utils.mjs +45 -17
- package/es/src/theme/antd-global-overwrite/admin/button.css +0 -11
- package/es/src/theme/antd-global-overwrite/admin/index.css +0 -11
- package/es/src/theme/antd-global-overwrite/aplus/button.css +0 -11
- package/es/src/theme/antd-global-overwrite/aplus/index.css +0 -11
- package/es/src/utils/index.d.ts +8 -0
- package/es/src/utils/index.mjs +40 -32
- package/es/src/work-order-modal/work-order-modal.vue.mjs +6 -8
- package/lib/src/ap-field/date/index.vue.d.ts +63 -5
- package/lib/src/ap-field/date/index.vue.js +1 -1
- package/lib/src/ap-field/date-range/index.vue.d.ts +68 -6
- package/lib/src/ap-field/date-range/index.vue.js +1 -1
- package/lib/src/ap-field/interface.d.ts +3 -7
- package/lib/src/ap-field/select/index.vue.d.ts +45 -179
- package/lib/src/ap-field/select/index.vue.js +1 -1
- package/lib/src/ap-form/items/date/index.vue.js +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.d.ts +1 -1
- package/lib/src/ap-form/items/date-range/index.vue.js +1 -1
- package/lib/src/ap-form/items/interface.d.ts +1 -1
- package/lib/src/ap-form/items/select/index.vue.js +1 -1
- package/lib/src/ap-table/ap-table.vue.d.ts +12 -8
- package/lib/src/ap-table/ap-table.vue.js +1 -1
- package/lib/src/ap-table/constants.d.ts +3092 -1827
- package/lib/src/ap-table/hooks/use-table-paging.js +1 -1
- package/lib/src/ap-table/interface.d.ts +5 -9
- package/lib/src/ap-table/utils.d.ts +18 -0
- package/lib/src/ap-table/utils.js +1 -1
- package/lib/src/theme/antd-global-overwrite/admin/button.css +0 -11
- package/lib/src/theme/antd-global-overwrite/admin/index.css +0 -11
- package/lib/src/theme/antd-global-overwrite/aplus/button.css +0 -11
- package/lib/src/theme/antd-global-overwrite/aplus/index.css +0 -11
- package/lib/src/utils/index.d.ts +8 -0
- package/lib/src/utils/index.js +1 -1
- package/lib/src/work-order-modal/work-order-modal.vue.js +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue"),C=require("../utils.js"),I=require("lodash-unified");require("../../config-provider/index.js");const K=require("../../config-provider/hooks/use-locale.js"),N=({manual:O=!1,defaultCurrent:j=1,defaultPageSize:F=10,request:$,defaultParams:D={},defaultData:L=[],formatParams:S,paramsValueTypeMap:T,resetFieldsIgnores:P,filterFields:M=[],sortFields:R=[]})=>{let v=0,f={};const x=e=>S?S(e):e,c=r.ref(),i=r.ref(j),g=r.ref(F),{t:b}=K.useLocale(),o=r.ref({total:0,records:L,loading:!1}),z=async e=>{var n;const a=x(e),t=Date.now();v=t,o.value.loading=!0;try{const s=await $({...D,...a});v===t&&(o.value.total=s.total||((n=s.data)==null?void 0:n.length)||0,o.value.records=[...s.data||[]])}catch{v===t&&(o.value.records=[],o.value.total=0)}finally{o.value.loading=!1}},q=e=>{const a={};return Object.entries(e).forEach(([t,n])=>{if(a[t]=n,T&&n){const s=T[t];s&&(a[t]=C.parseFieldValue(s,n))}}),a},A=e=>{var n,s,d,p,h,l,u;const a=((s=(n=c.value)==null?void 0:n.apForm)==null?void 0:s.getFieldsValue())||{},t={};Object.entries(a).forEach(([y,H])=>{P&&P.indexOf(y)>-1&&(t[y]=H)}),(p=(d=c.value)==null?void 0:d.apForm)==null||p.resetFields(),(u=(l=(h=c.value)==null?void 0:h.apForm)==null?void 0:l.setFieldsValue)==null||u.call(l,t),e==null||e()},m=e=>{f=e;const a=q(e);z(a)},B=e=>{m({...f,...e})},V=()=>{var a,t;const e=((t=(a=c.value)==null?void 0:a.apForm)==null?void 0:t.getFieldsValue(!0))||{};m({...e,current:1,pageSize:f.pageSize||F})},E=()=>{A(V)},J=()=>{m(f)},Q=e=>{const a=r.unref(o).total-e,t=Math.ceil(a/r.unref(g)),n=r.unref(i)>t?t:r.unref(i);B({current:n>0?n:1})},w=(e,a,t)=>{var h,l;const n=((l=(h=c.value)==null?void 0:h.apForm)==null?void 0:l.getFieldsValue(!0))||{};i.value=e.current,g.value=e.pageSize;const s=I.isArray(t)?[...t]:[t],d={};for(const u of s)R.includes(u.field)&&(d[C.dataIndexToStr(u.field)]=u.order);const p={};for(const u of Object.keys(a))M.includes(u)&&(p[u]=a[u]);m({...n,filter:p,sort:d,current:e.current,pageSize:e.pageSize})};r.onMounted(()=>{var a,t;const e=((t=(a=c.value)==null?void 0:a.apForm)==null?void 0:t.getFieldsValue(!0))||{};if(f={current:r.unref(i),pageSize:r.unref(g),...e},!O){const n=q(f);z(n)}});const U=r.computed(()=>r.unref(o).total===0?"-":`${r.unref(i.value)}/${Math.ceil(r.unref(o).total/r.unref(g))}`),G=r.computed(()=>({loading:r.unref(o).loading,pagination:{current:r.unref(i),pageSize:r.unref(g),total:r.unref(o).total,showSizeChanger:!0,showQuickJumper:!0,showTotal:e=>`${b("ap.apTable.pagination.totalLeft",{total:e})} ${b("ap.apTable.pagination.totalRight",{page:r.unref(U)})}`},onChange:w,dataSource:r.unref(o).records}));return{formRef:c,submit:V,reset:E,refresh:J,refreshByDelete:Q,data:o,current:i,pageSize:g,handleTableChange:w,tableProps:G}};exports.useTablePaging=N;
|
|
@@ -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
|
|
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,
|
|
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
|
-
* @
|
|
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
|
-
* @
|
|
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 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("lodash-unified"),c=(e,t,n)=>{let s={};return o.isObject(e)?Object.keys(e).forEach(a=>{o.isObject(e[a])?s[a]=c(e[a],t[a],n):s[a]=n(e[a],t)}):s=n(e,t),s},i=(e,t)=>{switch(e){case"dayjs":return t.valueOf();case"dayjsRange":return t.map(n=>n.valueOf());case"dayjsDayRange":{const[n,s]=t;return[n.startOf("day").valueOf(),s.endOf("day").valueOf()]}case"multiple":case"multipleNumber":return o.isArray(t)?t:[t];case"boolean":return t;case"object":return t;default:return t}};function f(e){return o.isArray(e)?e.join("."):e}function l(e){const t=Object.prototype.toString.call(e).match(/^\[object (.*)\]$/)[1].toLowerCase();return t==="string"&&typeof e=="object"?"object":e===null?"null":e===void 0?"undefined":t}const u=e=>l(e)==="map"?e:new Map(Object.entries(e||{})),d=e=>{const t=[],n=u(e);return n.forEach((s,a)=>{const r=n.get(a)||n.get(`${a}`);if(r){if(typeof r=="object"&&(r!=null&&r.text)){t.push({text:r==null?void 0:r.text,value:a,label:r==null?void 0:r.text,disabled:r.disabled});return}t.push({text:r,label:r,value:a})}}),t};exports.dataIndexToStr=f;exports.formatParamsValueType=c;exports.objectToMap=u;exports.parseFieldValue=i;exports.valueEnumToArray=d;
|
|
@@ -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
|
}
|
package/lib/src/utils/index.d.ts
CHANGED
|
@@ -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
|
+
};
|
package/lib/src/utils/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),a=require("lodash-unified");function f(e){return(e==null?void 0:e.parentNode)??document.body}function l(e){return typeof e<"u"}function y(e){const t={};return Object.keys(e).map(n=>{t[n]=u.unref(e[n])}),t}function d(e,t=[],n){const i=Object.assign({},e),s=Object.keys(i);for(let r=0;r<s.length;r+=1){const o=s[r];(t.includes(o)||n!=null&&n(o,i[o]))&&delete i[o]}return i}function p(e){return/^[A-Z][A-Za-z]*$/.test(e)}function c(e){if(Array.isArray(e))return e.map(t=>c(t));if(typeof e=="object"&&e!==null){const t={};for(const n in e)t[n]=c(e[n]);return u.markRaw(t)}return e}function g(e){const t={...e};for(const n of Object.keys(t))a.isUndefined(t[n])&&delete t[n];return console.log("copy",t),t}exports.convertReactiveToRaw=c;exports.getDynamicProps=y;exports.getPopupContainer=f;exports.isDef=l;exports.isPascalCase=p;exports.omitUndefined=g;exports.omitWhen=d;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("ant-design-vue"),l=require("../ap-form/index.js");require("./help-message.vue.js");require("../ap-upload/index.js");const f=require("./interfaces.js");require("../config-provider/index.js");require("./style/index.css");const h=require("../config-provider/hooks/use-namespace.js"),b=require("../config-provider/hooks/use-global-config.js"),q=require("../config-provider/hooks/use-locale.js"),N=require("../ap-form/items/select/index.vue.js"),w=require("../ap-form/items/radio/index.vue.js"),F=require("../ap-upload/apUpload.vue.js"),B=require("./help-message.vue2.js"),T=e.defineComponent({__name:"work-order-modal",props:{api:{type:Function},getOssAccess:{type:Function},prefixCls:{},visible:{type:Boolean},open:{type:Boolean},confirmLoading:{type:Boolean},title:{},closable:{type:Boolean},closeIcon:{},onOk:{type:Function},onCancel:{type:Function},"onUpdate:visible":{type:Function},"onUpdate:open":{type:Function},onChange:{type:Function},afterClose:{type:Function},centered:{type:Boolean},width:{},footer:{},okText:{},okType:{},cancelText:{},icon:{},maskClosable:{type:Boolean},forceRender:{type:Boolean},okButtonProps:{},cancelButtonProps:{},destroyOnClose:{type:Boolean},wrapClassName:{},maskTransitionName:{},transitionName:{},getContainer:{type:[String,Boolean,Function]},zIndex:{},bodyStyle:{},maskStyle:{},mask:{type:Boolean},keyboard:{type:Boolean},wrapProps:{},focusTriggerAfterClose:{type:Boolean},modalRender:{type:Function},mousePosition:{}},emits:["modalClose"],setup(_,{emit:y}){const{b:g,e:V}=h.useNamespace("work-order-modal"),u=e.ref(),o=e.ref(!1),c=e.ref(!0),s=_,v=b.useGlobalConfig("api"),{lang:x}=q.useLocale(),C=y,i=async a=>{var n,d;const t=await((d=(n=v.value)==null?void 0:n.select)==null?void 0:d.call(n,{dictCode:a,locale:x.value}));return t==null?void 0:t.map(m=>({label:m.itemText,value:m.itemValue}))},k=async()=>{var a;if(!o.value)try{o.value=!0;const t=await((a=u.value)==null?void 0:a.validateFields());await s.api(t),o.value=!1,r.message.success("操作成功"),p()}catch{o.value=!1;return}},p=()=>{c.value=!1,C("modalClose")};return(a,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(r.Modal),e.mergeProps(s,{width:600,centered:!0,open:c.value,title:"创建工单","ok-text":e.h("span",{},["确认"]),"cancel-text":e.h("span",{},["取消"]),mask:!0,"mask-closable":!0,wrapClassName:e.unref(g)(),closable:!0,onOk:k,confirmLoading:o.value,onCancel:p}),{default:e.withCtx(()=>[e.createVNode(e.unref(l.ApForm),{ref_key:"formRef",ref:u,colon:!1},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ApForm).FormItem,{label:"工单标题",name:"ticketsTitle",rules:[{required:!0,message:"不可为空"}]},{default:e.withCtx(()=>[e.createVNode(e.unref(r.Input),{placeholder:"请输入",maxlength:50,"show-count":!0})]),_:1}),e.createVNode(e.unref(N.default),{label:"工单类型",name:"ticketsType",rules:[{required:!0,message:"不可为空"}],field:{
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),r=require("ant-design-vue"),l=require("../ap-form/index.js");require("./help-message.vue.js");require("../ap-upload/index.js");const f=require("./interfaces.js");require("../config-provider/index.js");require("./style/index.css");const h=require("../config-provider/hooks/use-namespace.js"),b=require("../config-provider/hooks/use-global-config.js"),q=require("../config-provider/hooks/use-locale.js"),N=require("../ap-form/items/select/index.vue.js"),w=require("../ap-form/items/radio/index.vue.js"),F=require("../ap-upload/apUpload.vue.js"),B=require("./help-message.vue2.js"),T=e.defineComponent({__name:"work-order-modal",props:{api:{type:Function},getOssAccess:{type:Function},prefixCls:{},visible:{type:Boolean},open:{type:Boolean},confirmLoading:{type:Boolean},title:{},closable:{type:Boolean},closeIcon:{},onOk:{type:Function},onCancel:{type:Function},"onUpdate:visible":{type:Function},"onUpdate:open":{type:Function},onChange:{type:Function},afterClose:{type:Function},centered:{type:Boolean},width:{},footer:{},okText:{},okType:{},cancelText:{},icon:{},maskClosable:{type:Boolean},forceRender:{type:Boolean},okButtonProps:{},cancelButtonProps:{},destroyOnClose:{type:Boolean},wrapClassName:{},maskTransitionName:{},transitionName:{},getContainer:{type:[String,Boolean,Function]},zIndex:{},bodyStyle:{},maskStyle:{},mask:{type:Boolean},keyboard:{type:Boolean},wrapProps:{},focusTriggerAfterClose:{type:Boolean},modalRender:{type:Function},mousePosition:{}},emits:["modalClose"],setup(_,{emit:y}){const{b:g,e:V}=h.useNamespace("work-order-modal"),u=e.ref(),o=e.ref(!1),c=e.ref(!0),s=_,v=b.useGlobalConfig("api"),{lang:x}=q.useLocale(),C=y,i=async a=>{var n,d;const t=await((d=(n=v.value)==null?void 0:n.select)==null?void 0:d.call(n,{dictCode:a,locale:x.value}));return t==null?void 0:t.map(m=>({label:m.itemText,value:m.itemValue}))},k=async()=>{var a;if(!o.value)try{o.value=!0;const t=await((a=u.value)==null?void 0:a.validateFields());await s.api(t),o.value=!1,r.message.success("操作成功"),p()}catch{o.value=!1;return}},p=()=>{c.value=!1,C("modalClose")};return(a,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(r.Modal),e.mergeProps(s,{width:600,centered:!0,open:c.value,title:"创建工单","ok-text":e.h("span",{},["确认"]),"cancel-text":e.h("span",{},["取消"]),mask:!0,"mask-closable":!0,wrapClassName:e.unref(g)(),closable:!0,onOk:k,confirmLoading:o.value,onCancel:p}),{default:e.withCtx(()=>[e.createVNode(e.unref(l.ApForm),{ref_key:"formRef",ref:u,colon:!1},{default:e.withCtx(()=>[e.createVNode(e.unref(l.ApForm).FormItem,{label:"工单标题",name:"ticketsTitle",rules:[{required:!0,message:"不可为空"}]},{default:e.withCtx(()=>[e.createVNode(e.unref(r.Input),{placeholder:"请输入",maxlength:50,"show-count":!0})]),_:1}),e.createVNode(e.unref(N.default),{label:"工单类型",name:"ticketsType",rules:[{required:!0,message:"不可为空"}],field:{placeholder:"请选择",request:()=>i(e.unref(f.DictCode).TicketsType)}},null,8,["field"]),e.createVNode(e.unref(l.ApForm).FormItem,{label:"工单详情",name:"ticketsContent",rules:[{required:!0,message:"不可为空"}]},{default:e.withCtx(()=>[e.createVNode(e.unref(r.Textarea),{placeholder:"请输入",maxlength:300,"show-count":!0})]),_:1}),e.createVNode(e.unref(w.default),{label:"优先级",name:"ticketsLevel",rules:[{required:!0,message:"不可为空"}],field:{request:()=>i(e.unref(f.DictCode).TicketsLevel)}},null,8,["field"]),e.createVNode(e.unref(l.ApForm).FormItem,{name:"files"},{default:e.withCtx(()=>[e.createVNode(e.unref(F.default),{dirName:"WorkOrder",getOssAccess:s.getOssAccess,type:"multipleFile",needName:{pathKey:"filePath",nameKey:"fileName"},accept:".txt,.doc,.docx,.rtf,.pdf,.jpg,.jpeg,.png,.gif,.bmp,.tiff,.tif,.mp4,.avi,.wmv,.mov,.mkv,.xls,.xlsx,.csv,.ppt,.pptx",maxCount:10,maxSize:50,subTitle:e.h(B.default)},null,8,["getOssAccess","subTitle"])]),_:1})]),_:1},512)]),_:1},16,["open","ok-text","cancel-text","wrapClassName","confirmLoading"])]))}});exports.default=T;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aplus-frontend/ui",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "lib/index.js",
|
|
5
5
|
"module": "es/index.mjs",
|
|
6
6
|
"files": [
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"sortablejs": "^1.15.2",
|
|
61
61
|
"@aplus-frontend/oss": "^1.0.11",
|
|
62
62
|
"mime": "^4.0.3",
|
|
63
|
-
"@aplus-frontend/
|
|
64
|
-
"@aplus-frontend/
|
|
63
|
+
"@aplus-frontend/hooks": "1.0.4",
|
|
64
|
+
"@aplus-frontend/utils": "1.0.20"
|
|
65
65
|
},
|
|
66
66
|
"peerDependencies": {
|
|
67
67
|
"ant-design-vue": "^4.2.1",
|