@aplus-frontend/ui 0.0.1-beta.40 → 0.0.1-beta.41

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.
@@ -127,11 +127,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
127
127
  };
128
128
  destroyTooltipOnHide: {
129
129
  type: BooleanConstructor;
130
- default: any; /**
131
- * tips
132
- * 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
133
- * 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
134
- */
130
+ default: any;
135
131
  };
136
132
  align: {
137
133
  type: PropType<AlignType>;
@@ -140,7 +136,13 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
140
136
  builtinPlacements: {
141
137
  type: PropType<BuildInPlacements>;
142
138
  default: BuildInPlacements;
143
- };
139
+ }; /**
140
+ * 获取需要在查询表单中显示的字段
141
+ * 1. 在搜索表单中未隐藏
142
+ * 2. 有dataIndex(映射到value)
143
+ * 3. 有valueType 指定渲染的表单
144
+ * 4. 没有在非表单组件名单中
145
+ */
144
146
  children: ArrayConstructor;
145
147
  onVisibleChange: PropType<(vis: boolean) => void>;
146
148
  'onUpdate:visible': PropType<(vis: boolean) => void>;
@@ -1,17 +1,17 @@
1
- import { defineComponent as V, computed as d, createVNode as r, mergeProps as u, unref as t, openBlock as s, createElementBlock as f, normalizeClass as g, normalizeStyle as S, withCtx as c, Fragment as _, renderList as w, createBlock as K, resolveDynamicComponent as $, createCommentVNode as x, createElementVNode as R, renderSlot as F, createSlots as H, toDisplayString as G, normalizeProps as Q, guardReactiveProps as U } from "vue";
2
- import { Typography as J, Table as X, Tooltip as Y } from "ant-design-vue";
3
- import { ApForm as Z } from "../ap-form/index.mjs";
4
- import { apTableRenderItemMap as ee, noRenderAsFormItemValueList as T, apTableFormItemMap as ae } from "./constants.mjs";
1
+ import { defineComponent as _, computed as d, createVNode as r, mergeProps as u, unref as t, openBlock as s, createElementBlock as f, normalizeClass as b, normalizeStyle as w, withCtx as c, Fragment as K, renderList as x, createBlock as $, resolveDynamicComponent as H, createCommentVNode as R, createElementVNode as F, renderSlot as T, createSlots as G, toDisplayString as Q, normalizeProps as U, guardReactiveProps as J } from "vue";
2
+ import { Typography as X, Table as Y, Tooltip as Z } from "ant-design-vue";
3
+ import { ApForm as ee } from "../ap-form/index.mjs";
4
+ import { apTableRenderItemMap as ae, noRenderAsFormItemValueList as B, apTableFormItemMap as te } from "./constants.mjs";
5
5
  import "../config-provider/index.mjs";
6
- import { useTablePaging as te } from "./hooks/use-table-paging.mjs";
7
- import { omit as B, isUndefined as oe } from "lodash-unified";
6
+ import { useTablePaging as oe } from "./hooks/use-table-paging.mjs";
7
+ import { omit as P, isUndefined as le } from "lodash-unified";
8
8
  import "./style/ap-table.css";
9
9
  import { QuestionCircleOutlined as ne } from "@ant-design/icons-vue";
10
- import { useNamespace as le } from "../config-provider/hooks/use-namespace.mjs";
11
- import { useGlobalConfig as re } from "../config-provider/hooks/use-global-config.mjs";
12
- const de = {
10
+ import { useNamespace as re } from "../config-provider/hooks/use-namespace.mjs";
11
+ import { useGlobalConfig as de } from "../config-provider/hooks/use-global-config.mjs";
12
+ const se = {
13
13
  key: 0
14
- }, Ce = /* @__PURE__ */ V({
14
+ }, Se = /* @__PURE__ */ _({
15
15
  name: "ApTable",
16
16
  __name: "ap-table",
17
17
  props: {
@@ -120,39 +120,43 @@ const de = {
120
120
  default: "middle"
121
121
  }
122
122
  },
123
- setup(P) {
124
- const o = P, {
125
- e: b,
123
+ setup(I) {
124
+ const o = I, {
125
+ e: h,
126
126
  b: m
127
- } = le("ap-table"), I = re("uiMode"), y = d(() => {
128
- var n;
129
- let a = ((n = o.columns) == null ? void 0 : n.filter((e) => !e.hideInTable)) || [];
127
+ } = re("ap-table"), v = de("uiMode"), y = d(() => {
128
+ var l;
129
+ let a = ((l = o.columns) == null ? void 0 : l.filter((e) => !e.hideInTable)) || [];
130
130
  return a = a.map((e) => ({
131
131
  ...e,
132
132
  customRender({
133
- value: l,
134
- ...p
133
+ value: n,
134
+ ...i
135
135
  }) {
136
- var C;
136
+ var S;
137
+ let g;
137
138
  if (e.customRender)
138
- return e.customRender({
139
- value: l,
140
- ...p,
139
+ g = e.customRender({
140
+ value: n,
141
+ ...i,
141
142
  column: e
142
143
  });
143
- const L = ee[e.valueType || "text"], W = ((C = e.fieldProps) == null ? void 0 : C.field) || e.fieldProps || {}, q = e.valueType === "switch", A = e.valueType === "index", M = q ? {
144
- checked: l
145
- } : {
146
- value: A ? p.index + 1 : l
147
- };
148
- return j(e, l, r(L, u(B(W, ["request"]), M, {
149
- mode: "read"
150
- }), null));
144
+ else {
145
+ const W = ae[e.valueType || "text"], q = ((S = e.fieldProps) == null ? void 0 : S.field) || e.fieldProps || {}, A = e.valueType === "switch", M = e.valueType === "index", V = A ? {
146
+ checked: n
147
+ } : {
148
+ value: M ? i.index + 1 : n
149
+ };
150
+ g = r(W, u(P(q, ["request"]), V, {
151
+ mode: "read"
152
+ }), null);
153
+ }
154
+ return L(e, n, g);
151
155
  }
152
156
  })), a;
153
- }), h = d(() => {
154
- var a, n;
155
- return ((n = (a = o.columns) == null ? void 0 : a.filter((e) => !e.hideInSearch && e.dataIndex && e.valueType && !T.includes(e.valueType))) == null ? void 0 : n.map((e) => ({
157
+ }), C = d(() => {
158
+ var a, l;
159
+ return ((l = (a = o.columns) == null ? void 0 : a.filter((e) => !e.hideInSearch && e.dataIndex && e.valueType && !B.includes(e.valueType))) == null ? void 0 : l.map((e) => ({
156
160
  ...e,
157
161
  fieldProps: {
158
162
  ...e.fieldProps || {},
@@ -160,81 +164,81 @@ const de = {
160
164
  name: e.dataIndex
161
165
  }
162
166
  }))) || [];
163
- }), v = d(() => t(y).filter((a) => a.sorter === !0).map((a) => a.dataIndex)), k = d(() => t(y).filter((a) => a.filters && !a.onFilter).map((a) => a.dataIndex)), {
164
- formRef: z,
165
- submit: E,
166
- reset: N,
167
- tableProps: i,
168
- handleTableChange: D
169
- } = te({
167
+ }), k = d(() => t(y).filter((a) => a.sorter === !0).map((a) => a.dataIndex)), z = d(() => t(y).filter((a) => a.filters && !a.onFilter).map((a) => a.dataIndex)), {
168
+ formRef: E,
169
+ submit: N,
170
+ reset: D,
171
+ tableProps: p,
172
+ handleTableChange: O
173
+ } = oe({
170
174
  async request(a) {
171
175
  var e;
172
- const n = await ((e = o.request) == null ? void 0 : e.call(o, a));
176
+ const l = await ((e = o.request) == null ? void 0 : e.call(o, a));
173
177
  return {
174
- data: (n == null ? void 0 : n.data) || [],
175
- total: (n == null ? void 0 : n.total) || 0
178
+ data: (l == null ? void 0 : l.data) || [],
179
+ total: (l == null ? void 0 : l.total) || 0
176
180
  };
177
181
  },
178
- filterFields: t(k),
179
- sortFields: t(v),
182
+ filterFields: t(z),
183
+ sortFields: t(k),
180
184
  defaultParams: o.params,
181
185
  defaultData: o.defaultData,
182
186
  manual: o.manual,
183
187
  defaultCurrent: o.pagination ? o.pagination.defaultCurrent : void 0,
184
188
  defaultPageSize: o.pagination ? o.pagination.defaultPageSize : void 0,
185
189
  formatParams: o.beforeSearchSubmit
186
- }), O = d(() => ({
190
+ }), j = d(() => ({
187
191
  ...o,
188
- ...t(i),
189
- loading: oe(o.loading) ? t(i).loading : o.loading,
190
- pagination: o.pagination === !1 ? !1 : t(i).pagination
192
+ ...t(p),
193
+ loading: le(o.loading) ? t(p).loading : o.loading,
194
+ pagination: o.pagination === !1 ? !1 : t(p).pagination
191
195
  }));
192
- function j(a, n, e) {
193
- return T.includes(a.valueType) ? e : a.copyable || a.ellipsis ? r(J.Text, {
194
- copyable: {
195
- text: n,
196
+ function L(a, l, e) {
197
+ return B.includes(a.valueType) ? e : a.copyable || a.ellipsis ? r(X.Text, {
198
+ copyable: a.copyable ? {
199
+ text: l,
196
200
  tooltip: !1
197
- },
198
- ellipsis: {
199
- tooltip: n
200
- },
201
+ } : !1,
202
+ ellipsis: a.ellipsis ? {
203
+ tooltip: l
204
+ } : !1,
201
205
  content: e
202
206
  }, null) : e;
203
207
  }
204
- return (a, n) => (s(), f("div", {
205
- class: g(a.card ? null : t(m)("wrapper"))
206
- }, [a.searchForm !== !1 && h.value.length > 0 ? (s(), f("div", {
208
+ return (a, l) => (s(), f("div", {
209
+ class: b(a.card ? null : t(m)("wrapper"))
210
+ }, [a.searchForm !== !1 && C.value.length > 0 ? (s(), f("div", {
207
211
  key: 0,
208
- class: g(a.card ? t(b)("search-wrapper") : null),
209
- style: S(a.searchFormWrapperStyle)
210
- }, [r(t(Z).SearchForm, u(a.searchForm || {}, {
212
+ class: b(a.card ? t(h)("search-wrapper") : null),
213
+ style: w(a.searchFormWrapperStyle)
214
+ }, [r(t(ee).SearchForm, u(a.searchForm || {}, {
211
215
  ref_key: "formRef",
212
- ref: z,
216
+ ref: E,
213
217
  "custom-reset": "",
214
- onSubmit: t(E),
215
- onReset: t(N),
216
- "submit-loading": t(i).loading
218
+ onSubmit: t(N),
219
+ onReset: t(D),
220
+ "submit-loading": t(p).loading
217
221
  }), {
218
- default: c(() => [(s(!0), f(_, null, w(h.value, (e) => (s(), K($(e.customRenderFormItem ? e.customRenderFormItem(e) : t(ae)[e.valueType || "text"]), u({
222
+ default: c(() => [(s(!0), f(K, null, x(C.value, (e) => (s(), $(H(e.customRenderFormItem ? e.customRenderFormItem(e) : t(te)[e.valueType || "text"]), u({
219
223
  key: e.dataIndex,
220
224
  ref_for: !0
221
225
  }, e.fieldProps || {}, {
222
226
  span: e.span
223
227
  }), null, 16, ["span"]))), 128))]),
224
228
  _: 1
225
- }, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : x("", !0), R("div", {
226
- class: g(a.card ? t(b)("table-wrapper") : null),
227
- style: S(a.tableWrapperStyle)
228
- }, [F(a.$slots, "title"), r(t(X), u({
229
- class: t(I) === "admin" ? t(m)("table-admin") : t(m)("table")
230
- }, O.value, {
231
- onChange: t(D),
229
+ }, 16, ["onSubmit", "onReset", "submit-loading"])], 6)) : R("", !0), F("div", {
230
+ class: b(a.card ? t(h)("table-wrapper") : null),
231
+ style: w(a.tableWrapperStyle)
232
+ }, [T(a.$slots, "title"), r(t(Y), u({
233
+ class: t(v) === "admin" ? t(m)("table-admin") : t(m)("table")
234
+ }, j.value, {
235
+ onChange: t(O),
232
236
  columns: y.value
233
- }), H({
237
+ }), G({
234
238
  headerCell: c(({
235
239
  column: e,
236
- title: l
237
- }) => [e.tooltip ? (s(), f("span", de, [R("span", null, G(l), 1), r(t(Y), {
240
+ title: n
241
+ }) => [e.tooltip ? (s(), f("span", se, [F("span", null, Q(n), 1), r(t(Z), {
238
242
  title: e.tooltip,
239
243
  placement: "bottom"
240
244
  }, {
@@ -245,14 +249,14 @@ const de = {
245
249
  }
246
250
  })]),
247
251
  _: 2
248
- }, 1032, ["title"])])) : x("", !0)]),
252
+ }, 1032, ["title"])])) : R("", !0)]),
249
253
  _: 2
250
- }, [w(t(B)(a.$slots, "title"), (e, l) => ({
251
- name: l,
252
- fn: c((p) => [F(a.$slots, l, Q(U(p || {})))])
254
+ }, [x(t(P)(a.$slots, "title"), (e, n) => ({
255
+ name: n,
256
+ fn: c((i) => [T(a.$slots, n, U(J(i || {})))])
253
257
  }))]), 1040, ["class", "onChange", "columns"])], 6)], 2));
254
258
  }
255
259
  });
256
260
  export {
257
- Ce as default
261
+ Se as default
258
262
  };
@@ -135,7 +135,7 @@ const oe = /* @__PURE__ */ F({
135
135
  }, {
136
136
  default: l(() => [
137
137
  t(e(P), {
138
- placeholder: "请选择",
138
+ placeholder: "请输入",
139
139
  maxlength: 300,
140
140
  "show-count": !0
141
141
  })
@@ -127,11 +127,7 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
127
127
  };
128
128
  destroyTooltipOnHide: {
129
129
  type: BooleanConstructor;
130
- default: any; /**
131
- * tips
132
- * 通常情况下,表格渲染是不需要请求网络数据的,因此这里删掉request,
133
- * 如果需要做映射,可以在外部发起一次网络请求,然后使用valueEnum设置匹配枚举。
134
- */
130
+ default: any;
135
131
  };
136
132
  align: {
137
133
  type: PropType<AlignType>;
@@ -140,7 +136,13 @@ declare const _default: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefau
140
136
  builtinPlacements: {
141
137
  type: PropType<BuildInPlacements>;
142
138
  default: BuildInPlacements;
143
- };
139
+ }; /**
140
+ * 获取需要在查询表单中显示的字段
141
+ * 1. 在搜索表单中未隐藏
142
+ * 2. 有dataIndex(映射到value)
143
+ * 3. 有valueType 指定渲染的表单
144
+ * 4. 没有在非表单组件名单中
145
+ */
144
146
  children: ArrayConstructor;
145
147
  onVisibleChange: PropType<(vis: boolean) => void>;
146
148
  'onUpdate:visible': PropType<(vis: boolean) => void>;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),p=require("ant-design-vue"),q=require("../ap-form/index.js"),d=require("./constants.js");require("../config-provider/index.js");const N=require("./hooks/use-table-paging.js"),c=require("lodash-unified");require("./style/ap-table.css");const V=require("@ant-design/icons-vue"),E=require("../config-provider/hooks/use-namespace.js"),z=require("../config-provider/hooks/use-global-config.js"),D={key:0},L=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"}},setup(y){const t=y,{e:f,b:u}=E.useNamespace("ap-table"),b=z.useGlobalConfig("uiMode"),i=e.computed(()=>{var o;let n=((o=t.columns)==null?void 0:o.filter(a=>!a.hideInTable))||[];return n=n.map(a=>({...a,customRender({value:r,...s}){var g;if(a.customRender)return a.customRender({value:r,...s,column:a});const F=d.apTableRenderItemMap[a.valueType||"text"],T=((g=a.fieldProps)==null?void 0:g.field)||a.fieldProps||{},k=a.valueType==="switch",I=a.valueType==="index",v=k?{checked:r}:{value:I?s.index+1:r};return P(a,r,e.createVNode(F,e.mergeProps(c.omit(T,["request"]),v,{mode:"read"}),null))}})),n}),m=e.computed(()=>{var n,o;return((o=(n=t.columns)==null?void 0:n.filter(a=>!a.hideInSearch&&a.dataIndex&&a.valueType&&!d.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:o.map(a=>({...a,fieldProps:{...a.fieldProps||{},label:a.title,name:a.dataIndex}})))||[]}),h=e.computed(()=>e.unref(i).filter(n=>n.sorter===!0).map(n=>n.dataIndex)),C=e.computed(()=>e.unref(i).filter(n=>n.filters&&!n.onFilter).map(n=>n.dataIndex)),{formRef:S,submit:w,reset:x,tableProps:l,handleTableChange:B}=N.useTablePaging({async request(n){var a;const o=await((a=t.request)==null?void 0:a.call(t,n));return{data:(o==null?void 0:o.data)||[],total:(o==null?void 0:o.total)||0}},filterFields:e.unref(C),sortFields:e.unref(h),defaultParams:t.params,defaultData:t.defaultData,manual:t.manual,defaultCurrent:t.pagination?t.pagination.defaultCurrent:void 0,defaultPageSize:t.pagination?t.pagination.defaultPageSize:void 0,formatParams:t.beforeSearchSubmit}),R=e.computed(()=>({...t,...e.unref(l),loading:c.isUndefined(t.loading)?e.unref(l).loading:t.loading,pagination:t.pagination===!1?!1:e.unref(l).pagination}));function P(n,o,a){return d.noRenderAsFormItemValueList.includes(n.valueType)?a:n.copyable||n.ellipsis?e.createVNode(p.Typography.Text,{copyable:{text:o,tooltip:!1},ellipsis:{tooltip:o},content:a},null):a}return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(n.card?null:e.unref(u)("wrapper"))},[n.searchForm!==!1&&m.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.card?e.unref(f)("search-wrapper"):null),style:e.normalizeStyle(n.searchFormWrapperStyle)},[e.createVNode(e.unref(q.ApForm).SearchForm,e.mergeProps(n.searchForm||{},{ref_key:"formRef",ref:S,"custom-reset":"",onSubmit:e.unref(w),onReset:e.unref(x),"submit-loading":e.unref(l).loading}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(m.value,a=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.customRenderFormItem?a.customRenderFormItem(a):e.unref(d.apTableFormItemMap)[a.valueType||"text"]),e.mergeProps({key:a.dataIndex,ref_for:!0},a.fieldProps||{},{span:a.span}),null,16,["span"]))),128))]),_:1},16,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(n.card?e.unref(f)("table-wrapper"):null),style:e.normalizeStyle(n.tableWrapperStyle)},[e.renderSlot(n.$slots,"title"),e.createVNode(e.unref(p.Table),e.mergeProps({class:e.unref(b)==="admin"?e.unref(u)("table-admin"):e.unref(u)("table")},R.value,{onChange:e.unref(B),columns:i.value}),e.createSlots({headerCell:e.withCtx(({column:a,title:r})=>[a.tooltip?(e.openBlock(),e.createElementBlock("span",D,[e.createElementVNode("span",null,e.toDisplayString(r),1),e.createVNode(e.unref(p.Tooltip),{title:a.tooltip,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(V.QuestionCircleOutlined),{style:{color:"#0070ff","padding-left":"4px"}})]),_:2},1032,["title"])])):e.createCommentVNode("",!0)]),_:2},[e.renderList(e.unref(c.omit)(n.$slots,"title"),(a,r)=>({name:r,fn:e.withCtx(s=>[e.renderSlot(n.$slots,r,e.normalizeProps(e.guardReactiveProps(s||{})))])}))]),1040,["class","onChange","columns"])],6)],2))}});exports.default=L;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("ant-design-vue"),N=require("../ap-form/index.js"),d=require("./constants.js");require("../config-provider/index.js");const V=require("./hooks/use-table-paging.js"),f=require("lodash-unified");require("./style/ap-table.css");const E=require("@ant-design/icons-vue"),z=require("../config-provider/hooks/use-namespace.js"),D=require("../config-provider/hooks/use-global-config.js"),L={key:0},O=e.defineComponent({name:"ApTable",__name:"ap-table",props:{dropdownPrefixCls:{},loading:{type:[Boolean,Object],default:void 0},bordered:{type:Boolean,default:!1},locale:{},onChange:{},onResizeColumn:{},rowSelection:{},getPopupContainer:{},scroll:{},sortDirections:{default:()=>["ascend","descend"]},showSorterTooltip:{type:[Boolean,Object],default:!0},prefixCls:{},rowKey:{default:"key"},tableLayout:{},rowClassName:{},title:{},footer:{},id:{},showHeader:{type:Boolean,default:!0},components:{},customRow:{},customHeaderRow:{},direction:{},expandFixed:{type:[String,Boolean],default:!1},expandColumnWidth:{},expandedRowKeys:{},defaultExpandedRowKeys:{},expandedRowRender:{},expandRowByClick:{type:Boolean,default:!1},expandIcon:{},onExpand:{},onExpandedRowsChange:{},defaultExpandAllRows:{type:Boolean,default:!1},indentSize:{default:15},expandIconColumnIndex:{},showExpandColumn:{type:Boolean,default:!0},expandedRowClassName:{},childrenColumnName:{default:"children"},rowExpandable:{},sticky:{type:[Boolean,Object]},transformCellText:{},columns:{},card:{type:Boolean,default:!1},params:{},searchFormRender:{},request:{},onLoad:{},defaultData:{},onLoadingChange:{},searchForm:{type:[Boolean,Object],default:void 0},beforeSearchSubmit:{},pagination:{type:[Boolean,Object],default:void 0},searchFormWrapperStyle:{},tableWrapperStyle:{},manual:{type:Boolean,default:!1},size:{default:"middle"}},setup(b){const t=b,{e:m,b:u}=z.useNamespace("ap-table"),h=D.useGlobalConfig("uiMode"),i=e.computed(()=>{var o;let n=((o=t.columns)==null?void 0:o.filter(a=>!a.hideInTable))||[];return n=n.map(a=>({...a,customRender({value:l,...s}){var y;let p;if(a.customRender)p=a.customRender({value:l,...s,column:a});else{const T=d.apTableRenderItemMap[a.valueType||"text"],k=((y=a.fieldProps)==null?void 0:y.field)||a.fieldProps||{},I=a.valueType==="switch",v=a.valueType==="index",q=I?{checked:l}:{value:v?s.index+1:l};p=e.createVNode(T,e.mergeProps(f.omit(k,["request"]),q,{mode:"read"}),null)}return F(a,l,p)}})),n}),g=e.computed(()=>{var n,o;return((o=(n=t.columns)==null?void 0:n.filter(a=>!a.hideInSearch&&a.dataIndex&&a.valueType&&!d.noRenderAsFormItemValueList.includes(a.valueType)))==null?void 0:o.map(a=>({...a,fieldProps:{...a.fieldProps||{},label:a.title,name:a.dataIndex}})))||[]}),C=e.computed(()=>e.unref(i).filter(n=>n.sorter===!0).map(n=>n.dataIndex)),S=e.computed(()=>e.unref(i).filter(n=>n.filters&&!n.onFilter).map(n=>n.dataIndex)),{formRef:w,submit:x,reset:B,tableProps:r,handleTableChange:R}=V.useTablePaging({async request(n){var a;const o=await((a=t.request)==null?void 0:a.call(t,n));return{data:(o==null?void 0:o.data)||[],total:(o==null?void 0:o.total)||0}},filterFields:e.unref(S),sortFields:e.unref(C),defaultParams:t.params,defaultData:t.defaultData,manual:t.manual,defaultCurrent:t.pagination?t.pagination.defaultCurrent:void 0,defaultPageSize:t.pagination?t.pagination.defaultPageSize:void 0,formatParams:t.beforeSearchSubmit}),P=e.computed(()=>({...t,...e.unref(r),loading:f.isUndefined(t.loading)?e.unref(r).loading:t.loading,pagination:t.pagination===!1?!1:e.unref(r).pagination}));function F(n,o,a){return d.noRenderAsFormItemValueList.includes(n.valueType)?a:n.copyable||n.ellipsis?e.createVNode(c.Typography.Text,{copyable:n.copyable?{text:o,tooltip:!1}:!1,ellipsis:n.ellipsis?{tooltip:o}:!1,content:a},null):a}return(n,o)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(n.card?null:e.unref(u)("wrapper"))},[n.searchForm!==!1&&g.value.length>0?(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(n.card?e.unref(m)("search-wrapper"):null),style:e.normalizeStyle(n.searchFormWrapperStyle)},[e.createVNode(e.unref(N.ApForm).SearchForm,e.mergeProps(n.searchForm||{},{ref_key:"formRef",ref:w,"custom-reset":"",onSubmit:e.unref(x),onReset:e.unref(B),"submit-loading":e.unref(r).loading}),{default:e.withCtx(()=>[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(g.value,a=>(e.openBlock(),e.createBlock(e.resolveDynamicComponent(a.customRenderFormItem?a.customRenderFormItem(a):e.unref(d.apTableFormItemMap)[a.valueType||"text"]),e.mergeProps({key:a.dataIndex,ref_for:!0},a.fieldProps||{},{span:a.span}),null,16,["span"]))),128))]),_:1},16,["onSubmit","onReset","submit-loading"])],6)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(n.card?e.unref(m)("table-wrapper"):null),style:e.normalizeStyle(n.tableWrapperStyle)},[e.renderSlot(n.$slots,"title"),e.createVNode(e.unref(c.Table),e.mergeProps({class:e.unref(h)==="admin"?e.unref(u)("table-admin"):e.unref(u)("table")},P.value,{onChange:e.unref(R),columns:i.value}),e.createSlots({headerCell:e.withCtx(({column:a,title:l})=>[a.tooltip?(e.openBlock(),e.createElementBlock("span",L,[e.createElementVNode("span",null,e.toDisplayString(l),1),e.createVNode(e.unref(c.Tooltip),{title:a.tooltip,placement:"bottom"},{default:e.withCtx(()=>[e.createVNode(e.unref(E.QuestionCircleOutlined),{style:{color:"#0070ff","padding-left":"4px"}})]),_:2},1032,["title"])])):e.createCommentVNode("",!0)]),_:2},[e.renderList(e.unref(f.omit)(n.$slots,"title"),(a,l)=>({name:l,fn:e.withCtx(s=>[e.renderSlot(n.$slots,l,e.normalizeProps(e.guardReactiveProps(s||{})))])}))]),1040,["class","onChange","columns"])],6)],2))}});exports.default=O;
@@ -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:{fieldProps:{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;
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:{fieldProps:{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.1-beta.40",
3
+ "version": "0.0.1-beta.41",
4
4
  "main": "lib/index.js",
5
5
  "module": "es/index.mjs",
6
6
  "files": [