@aplus-frontend/ui 0.0.24 → 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/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/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 +1 -1
|
@@ -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.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("./work-order-modal.vue2.js");const l=require("./work-order-modal.vue.js");function u(t,d){const o=document.getElementsByTagName("body")[0],e=document.createElement("div");o.appendChild(e),r.render(r.h(l.default,{api:t,getOssAccess:d,onModalClose:n}),e);function n(){setTimeout(()=>{r.render(null,e),o.removeChild(e)},500)}}exports.createWorkOrderModal=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("vue");require("./work-order-modal.vue2.js");const l=require("./work-order-modal.vue.js");function u(t,d){const o=document.getElementsByTagName("body")[0],e=document.createElement("div");o.appendChild(e),r.render(r.h(l.default,{api:t,getOssAccess:d,onModalClose:n,open:!0}),e);function n(){setTimeout(()=>{r.render(null,e),o.removeChild(e)},500)}}exports.createWorkOrderModal=u;
|
|
@@ -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 +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"),l=require("ant-design-vue"),s=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");require("../hooks/index.js");const b=require("../config-provider/hooks/use-namespace.js"),q=require("../config-provider/hooks/use-global-config.js"),N=require("../config-provider/hooks/use-locale.js"),w=require("../hooks/useControllableValue.js"),F=require("../ap-form/items/select/index.vue.js"),B=require("../ap-form/items/radio/index.vue.js"),V=require("../ap-upload/apUpload.vue.js"),T=require("./help-message.vue2.js"),A=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","update:open"],setup(_,{emit:y}){const{b:g,e:O}=b.useNamespace("work-order-modal"),u=y,c=e.ref(),o=e.ref(!1),n=_,v=q.useGlobalConfig("api"),{lang:C}=N.useLocale(),{value:x,updateValue:k}=w.useControllableValue(n,u,{valuePropName:"open",defaultValue:!0}),i=async a=>{var r,d;const t=await((d=(r=v.value)==null?void 0:r.select)==null?void 0:d.call(r,{dictCode:a,locale:C.value}));return t==null?void 0:t.map(m=>({label:m.itemText,value:m.itemValue}))},h=async()=>{var a;if(!o.value)try{o.value=!0;const t=await((a=c.value)==null?void 0:a.validateFields());await n.api(t),o.value=!1,l.message.success("操作成功"),p()}catch{o.value=!1;return}},p=()=>{k(!1),u("modalClose")};return(a,t)=>(e.openBlock(),e.createElementBlock("div",null,[e.createVNode(e.unref(l.Modal),e.mergeProps(n,{width:600,centered:!0,open:e.unref(x),title:"创建工单","ok-text":e.h("span",{},["确认"]),"cancel-text":e.h("span",{},["取消"]),mask:!0,"mask-closable":!0,wrapClassName:e.unref(g)(),closable:!0,onOk:h,confirmLoading:o.value,onCancel:p}),{default:e.withCtx(()=>[e.createVNode(e.unref(s.ApForm),{ref_key:"formRef",ref:c,colon:!1},{default:e.withCtx(()=>[e.createVNode(e.unref(s.ApForm).FormItem,{label:"工单标题",name:"ticketsTitle",rules:[{required:!0,message:"不可为空"}]},{default:e.withCtx(()=>[e.createVNode(e.unref(l.Input),{placeholder:"请输入",maxlength:50,"show-count":!0})]),_:1}),e.createVNode(e.unref(F.default),{label:"工单类型",name:"ticketsType",rules:[{required:!0,message:"不可为空"}],field:{placeholder:"请选择",request:()=>i(e.unref(f.DictCode).TicketsType)}},null,8,["field"]),e.createVNode(e.unref(s.ApForm).FormItem,{label:"工单详情",name:"ticketsContent",rules:[{required:!0,message:"不可为空"}]},{default:e.withCtx(()=>[e.createVNode(e.unref(l.Textarea),{placeholder:"请输入",maxlength:300,"show-count":!0})]),_:1}),e.createVNode(e.unref(B.default),{label:"优先级",name:"ticketsLevel",rules:[{required:!0,message:"不可为空"}],field:{request:()=>i(e.unref(f.DictCode).TicketsLevel)}},null,8,["field"]),e.createVNode(e.unref(s.ApForm).FormItem,{name:"files"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.default),{dirName:"WorkOrder",getOssAccess:n.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(T.default)},null,8,["getOssAccess","subTitle"])]),_:1})]),_:1},512)]),_:1},16,["open","ok-text","cancel-text","wrapClassName","confirmLoading"])]))}});exports.default=A;
|