@das-fed/ui 6.4.0-dev.68 → 6.4.0-dev.69

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@das-fed/ui",
3
- "version": "6.4.0-dev.68",
3
+ "version": "6.4.0-dev.69",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./index.js",
@@ -26,7 +26,7 @@
26
26
  "@antv/x6-plugin-snapline": "^2.1.7",
27
27
  "@antv/x6-plugin-transform": "^2.1.8",
28
28
  "@antv/x6-vue-shape": "^2.1.2",
29
- "@das-fed/cli": "6.4.0-dev.68",
29
+ "@das-fed/cli": "6.4.0-dev.69",
30
30
  "@element-plus/icons-vue": "^2.3.1",
31
31
  "@types/lodash": "^4.14.194",
32
32
  "@types/lodash-es": "^4.17.9",
@@ -56,9 +56,9 @@
56
56
  "vue-tsc": "^2.0.29"
57
57
  },
58
58
  "dependencies": {
59
- "@das-fed/ui": "6.4.0-dev.68",
60
- "@das-fed/utils": "6.4.0-dev.68",
61
- "@das-fed/web": "6.4.0-dev.68",
59
+ "@das-fed/ui": "6.4.0-dev.69",
60
+ "@das-fed/utils": "6.4.0-dev.69",
61
+ "@das-fed/web": "6.4.0-dev.69",
62
62
  "@wangeditor/editor": "^5.1.23",
63
63
  "@wangeditor/editor-for-vue": "^5.1.12",
64
64
  "@wangeditor/plugin-upload-attachment": "^1.1.0",
@@ -1,9 +1,8 @@
1
- import { Ref } from 'vue';
2
1
  export declare const useExport: (props: any, emits: any) => {
3
- showProgressDialog: Ref<boolean, boolean>;
4
- progressTitle: Ref<string, string>;
5
- percent: Ref<number, number>;
6
- progressStatus: Ref<string, string>;
7
- progressLoading: Ref<boolean, boolean>;
2
+ showProgressDialog: import("vue").Ref<boolean, boolean>;
3
+ progressTitle: import("vue").Ref<string, string>;
4
+ percent: import("vue").Ref<number, number>;
5
+ progressStatus: import("vue").Ref<string, string>;
6
+ progressLoading: import("vue").Ref<boolean, boolean>;
8
7
  exportList: (params: any, bodyParams: any) => void;
9
8
  };
@@ -1,15 +1,15 @@
1
1
  import '@das-fed/ui/packages/business-components/export-button/style.css';
2
2
  import { withInstall as X } from "@das-fed/utils/with-install/index";
3
- import { ref as p, defineComponent as G, computed as J, watch as I, openBlock as K, createElementBlock as Q, createVNode as T, unref as h, withCtx as B, renderSlot as W, createTextVNode as Z, toDisplayString as ee, createCommentVNode as te, isRef as S } from "vue";
4
- import { t as g, i18n as $, setI18nRule as se } from "@das-fed/web/packages/i18n/index";
5
- import { DasDialog as ae } from "@das-fed/ui/packages/components/dialog/index";
6
- import { DasProgress as oe } from "@das-fed/ui/packages/components/progress/index";
7
- import { DasButton as re } from "@das-fed/ui/packages/components/button/index";
8
- import { iotProgress as le } from "@das-fed/utils/api-services/modules/iot";
9
- import z from "dayjs";
3
+ import { ref as p, defineComponent as G, computed as J, watch as S, openBlock as K, createElementBlock as Q, createVNode as z, unref as k, withCtx as B, renderSlot as W, createTextVNode as Z, toDisplayString as ee, createCommentVNode as te, isRef as L } from "vue";
4
+ import { t as g, currentLang as se, i18n as $, setI18nRule as ae } from "@das-fed/web/packages/i18n/index";
5
+ import { DasDialog as oe } from "@das-fed/ui/packages/components/dialog/index";
6
+ import { DasProgress as re } from "@das-fed/ui/packages/components/progress/index";
7
+ import { DasButton as le } from "@das-fed/ui/packages/components/button/index";
8
+ import { iotProgress as ne } from "@das-fed/utils/api-services/modules/iot";
9
+ import D from "dayjs";
10
10
  import { DasMessage as P } from "@das-fed/ui/packages/components/message/index";
11
- import { getConfig as L } from "@das-fed/utils/config";
12
- let H = (a = 21) => {
11
+ import { getConfig as M } from "@das-fed/utils/config";
12
+ let Y = (a = 21) => {
13
13
  let l = "", e = crypto.getRandomValues(new Uint8Array(a));
14
14
  for (; a--; ) {
15
15
  let s = e[a] & 63;
@@ -17,34 +17,34 @@ let H = (a = 21) => {
17
17
  }
18
18
  return l;
19
19
  };
20
- const ne = le.get("progress"), ue = (a) => {
21
- let l = p(!1), e = p(!1), s = p(""), i = p(0), o = p("normal"), m = p(!1), c, x = p(""), n = p(""), d = p(""), f = p(""), v = p(!1), k = p(""), w;
22
- const Y = () => {
23
- n.value = "", d.value = "", f.value = "", v.value = !1, k.value = "";
24
- }, O = async (t, u = "", y = "") => {
25
- o.value = "normal", i.value = 0, s.value = y || g("导出进度"), e.value = !0;
20
+ const ue = ne.get("progress"), ie = (a) => {
21
+ let l = p(!1), e = p(!1), s = p(""), i = p(0), o = p("normal"), m = p(!1), c, x = p(""), n = p(""), d = p(""), f = p(""), v = p(!1), w = p(""), y;
22
+ const _ = () => {
23
+ n.value = "", d.value = "", f.value = "", v.value = !1, w.value = "";
24
+ }, F = async (t, u = "", h = "") => {
25
+ o.value = "normal", i.value = 0, s.value = h || g("导出进度"), e.value = !0;
26
26
  const b = await (t == null ? void 0 : t());
27
27
  if (!b.status) {
28
28
  e.value = !1, o.value = "error";
29
29
  return;
30
30
  }
31
- _(b.taskId, "action", "");
32
- }, F = async (t, u = "", y = "") => {
31
+ T(b.taskId, "action", "");
32
+ }, O = async (t, u = "", h = "") => {
33
33
  o.value = "normal", i.value = 0, s.value = g("导出进度"), e.value = !0;
34
34
  const b = await (t == null ? void 0 : t());
35
35
  if (!b.status) {
36
36
  e.value = !1, o.value = "error";
37
37
  return;
38
38
  }
39
- z().format("YYYYMMDDHHmmss") + "", _(b.taskId, "export", u || "", y);
40
- }, _ = async (t, u, y, b = "") => {
41
- m.value = !0, V(t, u, y, b), c = setTimeout(() => {
39
+ D().format("YYYYMMDDHHmmss") + "", T(b.taskId, "export", u || "", h);
40
+ }, T = async (t, u, h, b = "") => {
41
+ m.value = !0, V(t, u, h, b), c = setTimeout(() => {
42
42
  }, 50);
43
- }, D = () => {
43
+ }, N = () => {
44
44
  clearTimeout(c), c = null, e.value = !1;
45
- }, V = async (t, u = "export", y, b = "") => {
46
- var R, U, E;
47
- const [j, r] = await ne("", {
45
+ }, V = async (t, u = "export", h, b = "") => {
46
+ var R, U, I;
47
+ const [j, r] = await ue("", {
48
48
  url: `progress/${t}`
49
49
  }).run();
50
50
  if (j) {
@@ -54,8 +54,8 @@ const ne = le.get("progress"), ue = (a) => {
54
54
  i.value = r.percentage;
55
55
  const C = u == "export" ? g("导出") : g("导入");
56
56
  if (i.value == 100)
57
- if (x.value = r, m.value = !1, D(), u == "export")
58
- r.status == 1 ? (o.value = "success", M(`${L().baseURL}/oss${r.filePath}`, y, b), m.value = !1, a("success")) : r.status == 2 && (f.value = r.message || `${C}${g("失败")}`, P.error({
57
+ if (x.value = r, m.value = !1, N(), u == "export")
58
+ r.status == 1 ? (o.value = "success", H(`${M().baseURL}/oss${r.filePath}`, h, b), m.value = !1, a("success")) : r.status == 2 && (f.value = r.message || `${C}${g("失败")}`, P.error({
59
59
  message: r.message || `${C}${g("失败")}`,
60
60
  grouping: !0,
61
61
  repeatNum: 1
@@ -63,18 +63,18 @@ const ne = le.get("progress"), ue = (a) => {
63
63
  else if (u == "import") {
64
64
  if (r.filePath) {
65
65
  o.value = "error";
66
- const q = (R = w.name) == null ? void 0 : R.substr(w.name.indexOf("."));
67
- (U = w.name) == null || U.replace(/(.*\/)*([^.]+).*/gi, "$2"), v.value = !0;
68
- const A = (E = r.filePath) == null ? void 0 : E.replace(/(.*\/)*([^.]+).*/gi, "$2");
69
- n.value = `${A}${q}`, d.value = w.sizeText, f.value = g("部分数据校验不通过,请下载附件并修改,重新导入!"), k.value = `${L().baseURL}/oss${r.filePath}`;
66
+ const q = (R = y.name) == null ? void 0 : R.substr(y.name.indexOf("."));
67
+ (U = y.name) == null || U.replace(/(.*\/)*([^.]+).*/gi, "$2"), v.value = !0;
68
+ const A = (I = r.filePath) == null ? void 0 : I.replace(/(.*\/)*([^.]+).*/gi, "$2");
69
+ n.value = `${A}${q}`, d.value = y.sizeText, f.value = g("部分数据校验不通过,请下载附件并修改,重新导入!"), w.value = `${M().baseURL}/oss${r.filePath}`;
70
70
  }
71
- N(r.status, C), r.status == 1 && (l.value = !1), a("success");
71
+ E(r.status, C), r.status == 1 && (l.value = !1), a("success");
72
72
  } else u == "action" && (o.value = "success");
73
73
  else
74
74
  c && r.status != 2 ? c = setTimeout(() => {
75
- V(t, u, y, b);
76
- }, 50) : (x.value = r, m.value = !1, N(r.status, C), D(), v.value = !0, f.value = (r == null ? void 0 : r.message) || "");
77
- }, N = (t, u) => {
75
+ V(t, u, h, b);
76
+ }, 50) : (x.value = r, m.value = !1, E(r.status, C), N(), v.value = !0, f.value = (r == null ? void 0 : r.message) || "");
77
+ }, E = (t, u) => {
78
78
  t == 1 ? (o.value = "success", P.success({
79
79
  message: g("business-components_export-success-tip", u),
80
80
  grouping: !0,
@@ -101,18 +101,18 @@ const ne = le.get("progress"), ue = (a) => {
101
101
  errorFileSize: d,
102
102
  errorMessage: f,
103
103
  errorImport: v,
104
- errorFilePath: k,
105
- fileExport: F,
106
- fileAction: O,
104
+ errorFilePath: w,
105
+ fileExport: O,
106
+ fileAction: F,
107
107
  generateUniqueName: (t) => {
108
108
  const u = t == null ? void 0 : t.substr(t.indexOf("."));
109
- return `${t == null ? void 0 : t.replace(/(.*\/)*([^.]+).*/gi, "$2")}${H()}${u}`;
109
+ return `${t == null ? void 0 : t.replace(/(.*\/)*([^.]+).*/gi, "$2")}${Y()}${u}`;
110
110
  },
111
- downloadFile: M,
112
- resetStataus: Y,
113
- checkProgress: _
111
+ downloadFile: H,
112
+ resetStataus: _,
113
+ checkProgress: T
114
114
  };
115
- }, M = (a, l, e = "xlsx") => {
115
+ }, H = (a, l, e = "xlsx") => {
116
116
  const s = new XMLHttpRequest();
117
117
  s.open("get", a), s.setRequestHeader("Content-Type", "application/json; charset=UTF-8"), s.responseType = "blob", s.onload = function(i) {
118
118
  const o = new Blob([this.response], {
@@ -125,20 +125,22 @@ const ne = le.get("progress"), ue = (a) => {
125
125
  c.href = m, c.download = l, c.click(), window.URL.revokeObjectURL(m);
126
126
  }
127
127
  }, s.send();
128
- }, ie = (a, l) => {
129
- const { showProgressDialog: e, progressTitle: s, percent: i, progressStatus: o, progressLoading: m, fileExport: c } = ue(l), x = p({}), n = p({}), d = (v, k) => {
128
+ }, pe = (a, l) => {
129
+ const { showProgressDialog: e, progressTitle: s, percent: i, progressStatus: o, progressLoading: m, fileExport: c } = ie(l), x = p({}), n = p({}), d = (v, w) => {
130
130
  x.value = {
131
131
  ...v
132
132
  }, n.value = {
133
- ...k
133
+ ...w
134
134
  };
135
- const w = `${a.exportFileName}${z().format("YYYYMMDD")}-${z().format("HHmmss")}.${a.fileType}`;
136
- c(f, w, a.fileType);
135
+ let y = `${D().format("YYYYMMDD")}-${D().format("HHmmss")}.${a.fileType}`;
136
+ se.value === "en" && !/s$/.test(a.exportFileName) && (y = " " + y);
137
+ const _ = `${a.exportFileName}${y}`;
138
+ c(f, _, a.fileType);
137
139
  }, f = async () => {
138
- let v = H();
140
+ let v = Y();
139
141
  a.taskIdPosition === "params" && (x.value.taskId = v), a.taskIdPosition === "body" && (n.value.taskId = v);
140
- const [k, w] = await a.exportFun(n.value, { params: x.value }).run();
141
- return k ? { status: !1 } : { status: !0, taskId: v };
142
+ const [w, y] = await a.exportFun(n.value, { params: x.value }).run();
143
+ return w ? { status: !1 } : { status: !0, taskId: v };
142
144
  };
143
145
  return {
144
146
  showProgressDialog: e,
@@ -148,7 +150,7 @@ const ne = le.get("progress"), ue = (a) => {
148
150
  progressLoading: m,
149
151
  exportList: d
150
152
  };
151
- }, pe = { class: "das-export-button" }, me = /* @__PURE__ */ G({
153
+ }, me = { class: "das-export-button" }, ce = /* @__PURE__ */ G({
152
154
  __name: "App",
153
155
  props: {
154
156
  modelValue: {},
@@ -165,25 +167,25 @@ const ne = le.get("progress"), ue = (a) => {
165
167
  emits: ["update:modelValue", "update:bodyParams", "success"],
166
168
  setup(a, { emit: l }) {
167
169
  const e = a, s = l;
168
- J(() => e.exportFileName || g("导出表")), I(e.modelValue, (n) => {
170
+ J(() => e.exportFileName || g("导出表")), S(e.modelValue, (n) => {
169
171
  s("update:modelValue", n);
170
- }), I(e.bodyParams, (n) => {
172
+ }), S(e.bodyParams, (n) => {
171
173
  s("update:bodyParams", n);
172
174
  });
173
- const { showProgressDialog: i, percent: o, progressStatus: m, exportList: c } = ie(e, s), x = [$("正在导出中...").value, $("导出失败").value, $("导出成功").value];
174
- return (n, d) => (K(), Q("div", pe, [
175
- T(h(re), {
175
+ const { showProgressDialog: i, percent: o, progressStatus: m, exportList: c } = pe(e, s), x = [$("正在导出中...").value, $("导出失败").value, $("导出成功").value];
176
+ return (n, d) => (K(), Q("div", me, [
177
+ z(k(le), {
176
178
  block: n.block,
177
179
  size: "middle",
178
180
  disabled: n.disabled,
179
181
  "btn-type": e.btnType,
180
182
  ghost: n.ghost,
181
- onClick: d[0] || (d[0] = (f) => h(c)(e.modelValue, e.bodyParams))
183
+ onClick: d[0] || (d[0] = (f) => k(c)(e.modelValue, e.bodyParams))
182
184
  }, {
183
185
  default: B(() => [
184
186
  W(n.$slots, "default", {}, () => [
185
187
  Z(
186
- ee(h($)("导出").value),
188
+ ee(k($)("导出").value),
187
189
  1
188
190
  /* TEXT */
189
191
  )
@@ -193,22 +195,22 @@ const ne = le.get("progress"), ue = (a) => {
193
195
  /* FORWARDED */
194
196
  }, 8, ["block", "disabled", "btn-type", "ghost"]),
195
197
  te(" 进度弹窗 "),
196
- T(h(ae), {
198
+ z(k(oe), {
197
199
  size: "mini",
198
- title: h($)("导出进度").value,
200
+ title: k($)("导出进度").value,
199
201
  "is-feedback-img": !1,
200
- modelValue: h(i),
201
- "onUpdate:modelValue": d[2] || (d[2] = (f) => S(i) ? i.value = f : null),
202
+ modelValue: k(i),
203
+ "onUpdate:modelValue": d[2] || (d[2] = (f) => L(i) ? i.value = f : null),
202
204
  "append-to-body": !0,
203
205
  type: "feedback"
204
206
  }, {
205
207
  default: B(() => [
206
- T(h(oe), {
207
- modelValue: h(o),
208
- "onUpdate:modelValue": d[1] || (d[1] = (f) => S(o) ? o.value = f : null),
208
+ z(k(re), {
209
+ modelValue: k(o),
210
+ "onUpdate:modelValue": d[1] || (d[1] = (f) => L(o) ? o.value = f : null),
209
211
  style: { "margin-top": "35px" },
210
212
  type: "circle",
211
- status: h(m),
213
+ status: k(m),
212
214
  textMap: x
213
215
  }, null, 8, ["modelValue", "status"])
214
216
  ]),
@@ -217,12 +219,12 @@ const ne = le.get("progress"), ue = (a) => {
217
219
  }, 8, ["title", "modelValue"])
218
220
  ]));
219
221
  }
220
- }), ce = (a, l) => {
222
+ }), de = (a, l) => {
221
223
  const e = a.__vccOpts || a;
222
224
  for (const [s, i] of l)
223
225
  e[s] = i;
224
226
  return e;
225
- }, de = /* @__PURE__ */ ce(me, [["__scopeId", "data-v-49f0bb05"]]), fe = {
227
+ }, fe = /* @__PURE__ */ de(ce, [["__scopeId", "data-v-49f0bb05"]]), ge = {
226
228
  导出表: { "zh-CN": "导出表", en: "Export Table", _appCode: "framework" },
227
229
  导出失败: { "zh-CN": "导出失败", en: "Export Failed", _appCode: "framework" },
228
230
  导出成功: { "zh-CN": "导出成功", en: "Export Successful", _appCode: "framework" },
@@ -243,9 +245,9 @@ const ne = le.get("progress"), ue = (a) => {
243
245
  _appCode: "framework"
244
246
  }
245
247
  };
246
- se(fe);
247
- const _e = X(de);
248
+ ae(ge);
249
+ const Te = X(fe);
248
250
  export {
249
- _e as DasExportButton,
250
- _e as default
251
+ Te as DasExportButton,
252
+ Te as default
251
253
  };