@king-one/antdv 1.0.97 → 1.1.0

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.
Files changed (29) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/es/components/pro-contract-view/apis/pro-contract-view.api.mjs +10 -0
  3. package/dist/es/components/pro-contract-view/hooks/use-contract-view.mjs +33 -18
  4. package/dist/es/components/pro-contract-view/src/pro-contract-view.vue2.mjs +110 -23
  5. package/dist/es/components/pro-contract-view/src/types.mjs +15 -4
  6. package/dist/es/components/pro-upload/src/gd-upload.mjs +65 -59
  7. package/dist/es/components/pro-upload/src/hooks/useUpload.mjs +32 -30
  8. package/dist/es/components/pro-upload/src/props.mjs +3 -0
  9. package/dist/lib/components/pro-contract-view/apis/pro-contract-view.api.js +1 -0
  10. package/dist/lib/components/pro-contract-view/hooks/use-contract-view.js +1 -1
  11. package/dist/lib/components/pro-contract-view/src/pro-contract-view.vue2.js +1 -1
  12. package/dist/lib/components/pro-contract-view/src/types.js +1 -1
  13. package/dist/lib/components/pro-upload/src/gd-upload.js +1 -1
  14. package/dist/lib/components/pro-upload/src/hooks/useUpload.js +1 -1
  15. package/dist/lib/components/pro-upload/src/props.js +1 -1
  16. package/dist/theme-chalk/icon.css +1 -1
  17. package/dist/theme-chalk/index.css +1 -1
  18. package/dist/theme-chalk/pro-contract-view.css +1 -1
  19. package/dist/theme-chalk/pro-modal.css +1 -1
  20. package/dist/types/components/pro-contract-view/apis/pro-contract-view.api.d.ts +7 -2
  21. package/dist/types/components/pro-contract-view/hooks/use-contract-view.d.ts +16 -9
  22. package/dist/types/components/pro-contract-view/index.d.ts +26 -8
  23. package/dist/types/components/pro-contract-view/src/pro-contract-view.vue.d.ts +26 -8
  24. package/dist/types/components/pro-contract-view/src/types.d.ts +17 -7
  25. package/dist/types/components/pro-upload/index.d.ts +8 -1
  26. package/dist/types/components/pro-upload/src/gd-upload.d.ts +8 -1
  27. package/dist/types/components/pro-upload/src/hooks/useUpload.d.ts +2 -1
  28. package/dist/types/components/pro-upload/src/props.d.ts +4 -0
  29. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @king-one/antdv
2
2
 
3
+ ## 1.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - feat: useUpload 增加删除的方法
8
+
9
+ ## 1.0.98
10
+
11
+ ### Patch Changes
12
+
13
+ - feat: pro-upload 组件,增加 beforeUpload 属性
14
+
3
15
  ## 1.0.97
4
16
 
5
17
  ### Patch Changes
@@ -0,0 +1,10 @@
1
+ const i = {
2
+ getContractPrefix: (t) => globalThis.$http.get("/contract/uri/prefix", t),
3
+ getSignPrefix: (t) => globalThis.$http.get("/sign/uri/prefix", t),
4
+ getPreviewUrl: (t, e) => globalThis.$http.get(`${t}/redirect/contract-preview-url`, e),
5
+ getFileList: (t, e) => globalThis.$http.get(`${t}/contract/file/detail/list`, e),
6
+ getFilePreview: (t, e) => globalThis.$http.get(`${t}//file/preview`, e)
7
+ };
8
+ export {
9
+ i as proContractViewApi
10
+ };
@@ -1,24 +1,39 @@
1
- import { ref as t, onMounted as i } from "vue";
2
- function s({
3
- contractId: e,
4
- prefix: o = "contract"
1
+ import { ref as o, reactive as p, onMounted as P } from "vue";
2
+ import { proContractViewApi as e } from "../apis/pro-contract-view.api.mjs";
3
+ function u({
4
+ contractId: r
5
5
  }) {
6
- const a = t([]), r = t([]);
7
- return i(() => {
8
- globalThis.$http.get(`/${o}/file/detail/list`, {
9
- Headers: {
10
- useridentity: "aaa",
11
- token: "1asd"
12
- },
13
- params: {
14
- contractId: e
15
- }
16
- });
6
+ const c = o([]), i = o([]), t = p({
7
+ contractPrefix: "",
8
+ signPrefix: "",
9
+ appToken: "",
10
+ userIdentity: ""
11
+ });
12
+ return P(async () => {
13
+ const { data: a } = await e.getContractPrefix(), { data: n } = await e.getSignPrefix();
14
+ if (a.contractUriPrefix && n.signUriPrefix) {
15
+ t.contractPrefix = a.contractUriPrefix, t.signPrefix = n.signUriPrefix;
16
+ const { data: s } = await e.getPreviewUrl(t.contractPrefix, {
17
+ params: {
18
+ contractId: r
19
+ }
20
+ });
21
+ t.userIdentity = s.userIdentity, t.appToken = s.appToken;
22
+ const { data: f } = await e.getFileList(t.signPrefix, {
23
+ headers: {
24
+ "SEAL-APP-TOKEN ": t.appToken,
25
+ userIdentity: t.userIdentity
26
+ },
27
+ params: { contractId: r }
28
+ });
29
+ i.value = f;
30
+ }
17
31
  }), {
18
- pages: a,
19
- fileList: r
32
+ pageList: c,
33
+ viewStatus: t,
34
+ fileList: i
20
35
  };
21
36
  }
22
37
  export {
23
- s as useProContractView
38
+ u as useProContractView
24
39
  };
@@ -1,35 +1,122 @@
1
- import { defineComponent as a, ref as n, computed as u, onMounted as p, createElementBlock as i, openBlock as r, normalizeClass as f, createVNode as l, createCommentVNode as m, unref as v } from "vue";
2
- import { Spin as _ } from "ant-design-vue";
3
- import { useNamespace as d } from "../../../hooks/use-namespace/index.mjs";
4
- import { ProContractViewProps as g } from "./types.mjs";
5
- const h = { key: 0 }, N = /* @__PURE__ */ a({
1
+ import { defineComponent as b, ref as u, computed as C, onMounted as V, watchEffect as z, unref as l, createElementBlock as g, openBlock as h, normalizeClass as d, createVNode as v, createCommentVNode as E, withCtx as H, createElementVNode as w, normalizeStyle as R } from "vue";
2
+ import { Spin as A } from "ant-design-vue";
3
+ import { useNamespace as B } from "../../../hooks/use-namespace/index.mjs";
4
+ import "../../index.mjs";
5
+ import { proContractViewApi as T } from "../apis/pro-contract-view.api.mjs";
6
+ import { ProContractViewProps as U } from "./types.mjs";
7
+ import { KScaleVirtualList as $ } from "../../scale-virtual-list/index.mjs";
8
+ const K = ["data-page-index"], M = ["src"], Q = /* @__PURE__ */ b({
6
9
  __name: "pro-contract-view",
7
- props: g,
8
- setup(k) {
9
- const t = n(!0), o = n(null), { b: c } = d("pro-contract-view"), s = u(() => [
10
- c()
10
+ props: U,
11
+ setup(x) {
12
+ const o = x, _ = u(null), c = u([]), y = {
13
+ itemHeight: (e) => c.value[e].size,
14
+ overscan: 3
15
+ }, p = u(!0), r = u(null), { b: N, e: m } = B("pro-contract-view"), k = C(() => [
16
+ N()
11
17
  ]);
12
- return p(() => {
13
- if (o.value) {
14
- const e = o.value.parentElement;
15
- !o.value.clientHeight && (e != null && e.offsetHeight) && (o.value.style.height = `${e == null ? void 0 : e.offsetHeight}px`);
18
+ V(() => {
19
+ if (r.value) {
20
+ const e = r.value.parentElement;
21
+ !r.value.clientHeight && (e != null && e.clientHeight) && (r.value.style.height = `${e == null ? void 0 : e.clientHeight}px`);
16
22
  }
17
- setTimeout(() => {
18
- t.value = !0;
19
- }, 1e3);
20
- }), (e, C) => (r(), i(
23
+ }), z(() => {
24
+ const { signPrefix: e, userIdentity: a, appToken: t } = o.viewStatus;
25
+ e && a && t && o.pageList.length > 0 && o.fileId && F(o.pageList);
26
+ });
27
+ function F(e, a) {
28
+ const t = l(e), i = Math.max(...t.map((s) => s.width));
29
+ let n = 1;
30
+ a && (n = Number.parseFloat((a / i).toFixed(2))), c.value = t.map((s) => {
31
+ const S = Number.parseFloat((+s.width * n).toFixed(2)), f = Number.parseFloat((+s.height * n).toFixed(2));
32
+ return {
33
+ url: "",
34
+ loaded: !1,
35
+ width: S,
36
+ height: f,
37
+ size: f + 10,
38
+ pageNum: s.pageNum
39
+ };
40
+ }), p.value = !1;
41
+ }
42
+ function I(e) {
43
+ L(e.start, e.end);
44
+ }
45
+ async function L(e, a) {
46
+ let t = e;
47
+ for (; t <= a; ) {
48
+ const i = c.value[t];
49
+ if (!i)
50
+ return;
51
+ if (!i.loaded) {
52
+ i.loaded = !0;
53
+ const n = await P(t + 1);
54
+ i.url = n;
55
+ }
56
+ t++;
57
+ }
58
+ }
59
+ async function P(e) {
60
+ const { viewStatus: a, fileId: t } = o;
61
+ return (await T.getFilePreview(a.signPrefix, {
62
+ headers: {
63
+ "SEAL-APP-TOKEN ": a.appToken,
64
+ userIdentity: a.userIdentity
65
+ },
66
+ params: {
67
+ fileId: t,
68
+ pageNum: e,
69
+ pageSize: 1,
70
+ absoluteEnable: !0
71
+ }
72
+ })).data.pages[e - 1].url;
73
+ }
74
+ return (e, a) => (h(), g(
21
75
  "div",
22
76
  {
23
77
  ref_key: "containerRef",
24
- ref: o,
25
- class: f(s.value)
78
+ ref: r,
79
+ class: d(k.value)
26
80
  },
27
81
  [
28
- l(v(_), {
82
+ v(l(A), {
29
83
  tip: "Loading...",
30
- spinning: t.value
84
+ spinning: p.value
31
85
  }, null, 8, ["spinning"]),
32
- t.value ? m("v-if", !0) : (r(), i("div", h, " 合同预览 "))
86
+ p.value ? E("v-if", !0) : (h(), g(
87
+ "div",
88
+ {
89
+ key: 0,
90
+ class: d(l(m)("content"))
91
+ },
92
+ [
93
+ v(l($), {
94
+ ref_key: "virtualListRef",
95
+ ref: _,
96
+ list: c.value,
97
+ option: y,
98
+ "onUpdate:state": I
99
+ }, {
100
+ default: H(({ index: t, item: i }) => [
101
+ w("div", {
102
+ "data-page-index": t + 1,
103
+ class: d(l(m)("content-item")),
104
+ style: R({ height: `${i.data.height}px`, width: `${i.data.width}px`, marginBottom: "10px" })
105
+ }, [
106
+ w("img", {
107
+ src: i.data.url,
108
+ width: "100%",
109
+ alt: ""
110
+ }, null, 8, M)
111
+ ], 14, K)
112
+ ]),
113
+ _: 1
114
+ /* STABLE */
115
+ }, 8, ["list"])
116
+ ],
117
+ 2
118
+ /* CLASS */
119
+ ))
33
120
  ],
34
121
  2
35
122
  /* CLASS */
@@ -37,5 +124,5 @@ const h = { key: 0 }, N = /* @__PURE__ */ a({
37
124
  }
38
125
  });
39
126
  export {
40
- N as default
127
+ Q as default
41
128
  };
@@ -1,13 +1,24 @@
1
1
  import { definePropType as e } from "../../utils/install.mjs";
2
- const t = {
2
+ const r = {
3
+ viewStatus: {
4
+ type: e(Object),
5
+ required: !0
6
+ },
3
7
  fileId: {
4
- type: e(String)
8
+ type: String
5
9
  },
6
- fileList: {
10
+ pageList: {
7
11
  type: e(Array),
8
12
  default: () => []
9
13
  }
14
+ // fileId: {
15
+ // type: definePropType<string>(String)
16
+ // },
17
+ // fileList: {
18
+ // type: definePropType<fileType[]>(Array),
19
+ // default: () => []
20
+ // }
10
21
  };
11
22
  export {
12
- t as ProContractViewProps
23
+ r as ProContractViewProps
13
24
  };
@@ -1,15 +1,15 @@
1
- import { defineComponent as F, ref as f, computed as W, watch as z, onMounted as H, createVNode as d, Fragment as g } from "vue";
2
- import { message as h, Upload as I, Spin as R } from "ant-design-vue";
3
- import { useNamespace as D } from "../../../hooks/use-namespace/index.mjs";
4
- import { KIcon as S } from "../../icon/index.mjs";
5
- import { UploadComponentProps as $ } from "./props.mjs";
6
- import { getFileExtension as m, getUploadIcon as x, getBase64 as j } from "./utils/index.mjs";
1
+ import { defineComponent as W, ref as g, computed as z, watch as H, onMounted as I, createVNode as d, Fragment as h } from "vue";
2
+ import { message as y, Upload as R, Spin as D } from "ant-design-vue";
3
+ import { useNamespace as S } from "../../../hooks/use-namespace/index.mjs";
4
+ import { KIcon as $ } from "../../icon/index.mjs";
5
+ import { UploadComponentProps as j } from "./props.mjs";
6
+ import { getFileExtension as m, getUploadIcon as x, getBase64 as q } from "./utils/index.mjs";
7
7
  import "./hooks/index.mjs";
8
- import q from "./file-list.mjs";
9
- import { useUpload as T } from "./hooks/useUpload.mjs";
10
- const A = /* @__PURE__ */ F({
8
+ import T from "./file-list.mjs";
9
+ import { useUpload as G } from "./hooks/useUpload.mjs";
10
+ const O = /* @__PURE__ */ W({
11
11
  name: "GdUpload",
12
- props: $,
12
+ props: j,
13
13
  emits: {
14
14
  "update:fileList": (e) => !0,
15
15
  // 文件上传成功
@@ -18,125 +18,131 @@ const A = /* @__PURE__ */ F({
18
18
  "upload-error": (e) => e
19
19
  },
20
20
  setup(e, {
21
- emit: c,
22
- expose: y
21
+ emit: u,
22
+ expose: v
23
23
  }) {
24
24
  const {
25
- b: v
26
- } = D("pro-upload"), l = f([]), r = f(!1), {
27
- uploadFile: b,
25
+ b
26
+ } = S("pro-upload"), l = g([]), r = g(!1), {
27
+ uploadFile: U,
28
28
  getFileDetails: N,
29
- getImgUrl: U
30
- } = T(e.http), w = W(() => {
29
+ getImgUrl: w
30
+ } = G(e.http), L = z(() => {
31
31
  if (e.disabled || l.value.length === e.maxCount) return !0;
32
- }), L = (i) => {
32
+ }), C = async (i, t) => {
33
33
  var s;
34
+ if (e.beforeUpload) {
35
+ const f = e.beforeUpload(i, t);
36
+ if (f instanceof Promise) {
37
+ if (await f === !1) return !1;
38
+ } else if (!f) return !1;
39
+ }
34
40
  const {
35
- name: t,
36
- size: n
37
- } = i, a = m(t), o = n / 1024 / 1024;
38
- return e.accept && e.accept.length > 0 && !e.accept.includes(a) ? (h.warning(`只能上传${(s = e.accept) == null ? void 0 : s.join(".")}后缀的文件!`), !1) : o > e.maxSize ? (h.warning(`上传的文件不能大于${e.maxSize}M!`), !1) : !0;
39
- }, C = async (i) => {
41
+ name: n,
42
+ size: a
43
+ } = i, c = m(n), o = a / 1024 / 1024;
44
+ return e.accept && e.accept.length > 0 && !e.accept.includes(c) ? (y.warning(`只能上传${(s = e.accept) == null ? void 0 : s.join(".")}后缀的文件!`), !1) : o > e.maxSize ? (y.warning(`上传的文件不能大于${e.maxSize}M!`), !1) : !0;
45
+ }, F = async (i) => {
40
46
  try {
41
47
  const {
42
48
  file: t
43
49
  } = i;
44
50
  r.value = !0;
45
- const n = await b({
51
+ const n = await U({
46
52
  business: e.business,
47
53
  file: t
48
54
  });
49
55
  if (r.value = !1, !n) return;
50
- const a = m(n.originName), o = x(a);
51
- if (o === "img") {
52
- const u = await j(t);
56
+ const a = m(n.originName), c = x(a);
57
+ if (c === "img") {
58
+ const s = await q(t);
53
59
  l.value.push({
54
- icon: u,
60
+ icon: s,
55
61
  id: n.id,
56
- type: o,
62
+ type: c,
57
63
  spining: !1,
58
64
  fileName: i.file.name
59
65
  });
60
66
  } else
61
67
  l.value.push({
62
- icon: o,
68
+ icon: c,
63
69
  id: n.id,
64
- type: o,
70
+ type: c,
65
71
  spining: !1,
66
72
  fileName: i.file.name
67
73
  });
68
- const s = l.value.map((u) => ({
69
- fileName: u.fileName,
70
- type: u.type,
71
- id: u.id
74
+ const o = l.value.map((s) => ({
75
+ fileName: s.fileName,
76
+ type: s.type,
77
+ id: s.id
72
78
  }));
73
- c("update:fileList", s), c("upload-success", s);
79
+ u("update:fileList", o), u("upload-success", o);
74
80
  } catch (t) {
75
- r.value = !1, c("upload-error", t);
81
+ r.value = !1, u("upload-error", t);
76
82
  }
77
83
  }, p = async (i) => {
78
84
  const t = i == null ? void 0 : i.map((a) => a.id);
79
85
  if ((t == null ? void 0 : t.length) === 0) return;
80
86
  const n = await N(t);
81
87
  for (const a of n.data) {
82
- const o = m(a.originName), s = x(o);
83
- if (s === "img") {
84
- const u = await U([a.id]);
88
+ const c = m(a.originName), o = x(c);
89
+ if (o === "img") {
90
+ const s = await w([a.id]);
85
91
  l.value.push({
86
92
  id: a.id,
87
- icon: u[a.id],
93
+ icon: s[a.id],
88
94
  fileName: a.originName,
89
95
  spining: !1,
90
- type: s
96
+ type: o
91
97
  });
92
98
  } else
93
99
  l.value.push({
94
100
  id: a.id,
95
- icon: s,
101
+ icon: o,
96
102
  fileName: a.originName,
97
103
  spining: !1,
98
- type: s
104
+ type: o
99
105
  });
100
106
  }
101
107
  };
102
- return z(() => l.value, (i) => {
108
+ return H(() => l.value, (i) => {
103
109
  const t = i.map((n) => ({
104
110
  fileName: n.fileName,
105
111
  type: n.type,
106
112
  id: n.id
107
113
  }));
108
- c("update:fileList", t), c("change", t);
114
+ u("update:fileList", t), u("change", t);
109
115
  }, {
110
116
  deep: !0
111
- }), H(async () => {
117
+ }), I(async () => {
112
118
  p(e.fileList);
113
- }), y({
119
+ }), v({
114
120
  updateFileList: p
115
121
  }), () => {
116
122
  var i;
117
123
  return d("div", {
118
- class: v(),
124
+ class: b(),
119
125
  style: {
120
126
  display: "flex",
121
127
  flexWrap: "wrap",
122
128
  alignContent: "space-between"
123
129
  }
124
- }, [d(q, {
130
+ }, [d(T, {
125
131
  http: e.http,
126
132
  itemWidth: e.itemWidth,
127
133
  itemHeight: e.itemHeight,
128
134
  list: l.value,
129
135
  "onUpdate:list": (t) => l.value = t
130
- }, null, 8, ["http", "itemWidth", "itemHeight", "list", "onUpdate:list"]), l.value.length < (e.maxCount ?? 20) ? d(I, {
136
+ }, null, 8, ["http", "itemWidth", "itemHeight", "list", "onUpdate:list"]), l.value.length < (e.maxCount ?? 20) ? d(R, {
131
137
  accept: (i = e.accept) == null ? void 0 : i.join(","),
132
- disabled: w.value,
133
- customRequest: C,
134
- beforeUpload: L,
138
+ disabled: L.value,
139
+ customRequest: F,
140
+ beforeUpload: C,
135
141
  style: {
136
142
  marginTop: "5px"
137
143
  }
138
144
  }, {
139
- default: () => d(R, {
145
+ default: () => d(D, {
140
146
  spinning: r.value
141
147
  }, {
142
148
  default: () => [d("div", {
@@ -152,18 +158,18 @@ const A = /* @__PURE__ */ F({
152
158
  justifyContent: "center",
153
159
  borderRadius: "5px"
154
160
  }
155
- }, [d(S, {
161
+ }, [d($, {
156
162
  name: "upload-icon",
157
163
  color: "#3296fa",
158
164
  size: 32
159
165
  }, null)], 4)]
160
166
  }, 8, ["spinning"]),
161
- itemRender: () => d(g, null, null),
167
+ itemRender: () => d(h, null, null),
162
168
  _: 1
163
- }, 8, ["accept", "disabled", "customRequest", "beforeUpload"]) : d(g, null, null)], 2);
169
+ }, 8, ["accept", "disabled", "customRequest", "beforeUpload"]) : d(h, null, null)], 2);
164
170
  };
165
171
  }
166
172
  });
167
173
  export {
168
- A as default
174
+ O as default
169
175
  };
@@ -1,51 +1,53 @@
1
1
  import { message as o } from "ant-design-vue";
2
- import { useHttp as d } from "./useHttp.mjs";
2
+ import { useHttp as p } from "./useHttp.mjs";
3
3
  function m(c) {
4
- const r = d(c);
4
+ const r = p(c);
5
5
  return {
6
6
  // 文件上传
7
- uploadFile: (a) => new Promise(async (e, t) => {
7
+ uploadFile: (s) => new Promise(async (a, t) => {
8
8
  try {
9
- const s = await r.getUploadUrl({
10
- params: { business: a.business }
9
+ const e = await r.getUploadUrl({
10
+ params: { business: s.business }
11
11
  });
12
- if (s.status === 0) {
13
- const n = s.data, i = new FormData();
14
- i.append("file", a.file);
15
- const l = await r.uploadFileApi(n, i);
16
- l.status === 0 ? (o.success("文件上传成功~"), e(l.data)) : (o.error(l.msg), t(l));
12
+ if (e.status === 0) {
13
+ const i = e.data, n = new FormData();
14
+ n.append("file", s.file);
15
+ const l = await r.uploadFileApi(i, n);
16
+ l.status === 0 ? (o.success("文件上传成功~"), a(l.data)) : (o.error(l.msg), t(l));
17
17
  } else
18
- o.error(s.msg), t(s);
19
- } catch (s) {
20
- console.log(s), o.error("文件上传失败,请联系管理员进行查看!"), t(s);
18
+ o.error(e.msg), t(e);
19
+ } catch (e) {
20
+ console.log(e), o.error("文件上传失败,请联系管理员进行查看!"), t(e);
21
21
  }
22
22
  }),
23
23
  // 文件下载
24
- downloadFile: (a) => new Promise(async (e, t) => {
24
+ downloadFile: (s) => new Promise(async (a, t) => {
25
25
  try {
26
- const s = a[0], n = await r.getDownloadUrlApi(a);
27
- if (n.status === 0) {
28
- const i = n.data[s];
29
- window.open(i), e(!0);
26
+ const e = s[0], i = await r.getDownloadUrlApi(s);
27
+ if (i.status === 0) {
28
+ const n = i.data[e];
29
+ window.open(n), a(!0);
30
30
  }
31
- e(!1);
32
- } catch (s) {
33
- t(s);
31
+ a(!1);
32
+ } catch (e) {
33
+ t(e);
34
34
  }
35
35
  }),
36
36
  // 获取图片的url
37
- getImgUrl: (a) => new Promise(async (e, t) => {
38
- const s = await r.getDownloadUrlApi(a);
39
- s.status === 0 ? e(s.data) : t(s);
37
+ getImgUrl: (s) => new Promise(async (a, t) => {
38
+ const e = await r.getDownloadUrlApi(s);
39
+ e.status === 0 ? a(e.data) : t(e);
40
40
  }),
41
41
  // 获取文件详情
42
- getFileDetails: async (a) => new Promise(async (e, t) => {
43
- r.getFileDetailApi({ fileIds: a }).then((s) => {
44
- s.status === 0 ? e(s) : (o.error(s.msg), t(s));
45
- }).catch((s) => {
46
- o.error(s), t(s);
42
+ getFileDetails: async (s) => new Promise(async (a, t) => {
43
+ r.getFileDetailApi({ fileIds: s }).then((e) => {
44
+ e.status === 0 ? a(e) : (o.error(e.msg), t(e));
45
+ }).catch((e) => {
46
+ o.error(e), t(e);
47
47
  });
48
- })
48
+ }),
49
+ // 删除文件
50
+ removeFiel: async (s) => await r.deleteFileApi({ params: { fileId: s } })
49
51
  };
50
52
  }
51
53
  export {
@@ -2,6 +2,9 @@ const e = {
2
2
  uploadName: {
3
3
  type: String
4
4
  },
5
+ beforeUpload: {
6
+ type: Function
7
+ },
5
8
  business: {
6
9
  type: String,
7
10
  required: !0
@@ -0,0 +1 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i={getContractPrefix:t=>globalThis.$http.get("/contract/uri/prefix",t),getSignPrefix:t=>globalThis.$http.get("/sign/uri/prefix",t),getPreviewUrl:(t,e)=>globalThis.$http.get(`${t}/redirect/contract-preview-url`,e),getFileList:(t,e)=>globalThis.$http.get(`${t}/contract/file/detail/list`,e),getFilePreview:(t,e)=>globalThis.$http.get(`${t}//file/preview`,e)};exports.proContractViewApi=i;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue");function i({contractId:t,prefix:r="contract"}){const o=e.ref([]),a=e.ref([]);return e.onMounted(()=>{globalThis.$http.get(`/${r}/file/detail/list`,{Headers:{useridentity:"aaa",token:"1asd"},params:{contractId:t}})}),{pages:o,fileList:a}}exports.useProContractView=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("vue"),r=require("../apis/pro-contract-view.api.js");function f({contractId:i}){const c=t.ref([]),a=t.ref([]),e=t.reactive({contractPrefix:"",signPrefix:"",appToken:"",userIdentity:""});return t.onMounted(async()=>{const{data:n}=await r.proContractViewApi.getContractPrefix(),{data:o}=await r.proContractViewApi.getSignPrefix();if(n.contractUriPrefix&&o.signUriPrefix){e.contractPrefix=n.contractUriPrefix,e.signPrefix=o.signUriPrefix;const{data:s}=await r.proContractViewApi.getPreviewUrl(e.contractPrefix,{params:{contractId:i}});e.userIdentity=s.userIdentity,e.appToken=s.appToken;const{data:p}=await r.proContractViewApi.getFileList(e.signPrefix,{headers:{"SEAL-APP-TOKEN ":e.appToken,userIdentity:e.userIdentity},params:{contractId:i}});a.value=p}}),{pageList:c,viewStatus:e,fileList:a}}exports.useProContractView=f;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),c=require("ant-design-vue"),s=require("../../../hooks/use-namespace/index.js"),u=require("./types.js"),a={key:0},l=e.defineComponent({__name:"pro-contract-view",props:u.ProContractViewProps,setup(p){const o=e.ref(!0),n=e.ref(null),{b:i}=s.useNamespace("pro-contract-view"),r=e.computed(()=>[i()]);return e.onMounted(()=>{if(n.value){const t=n.value.parentElement;!n.value.clientHeight&&(t!=null&&t.offsetHeight)&&(n.value.style.height=`${t==null?void 0:t.offsetHeight}px`)}setTimeout(()=>{o.value=!0},1e3)}),(t,f)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:n,class:e.normalizeClass(r.value)},[e.createVNode(e.unref(c.Spin),{tip:"Loading...",spinning:o.value},null,8,["spinning"]),o.value?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",a," 合同预览 "))],2))}});exports.default=l;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),V=require("ant-design-vue"),k=require("../../../hooks/use-namespace/index.js");require("../../index.js");const C=require("../apis/pro-contract-view.api.js"),S=require("./types.js"),b=require("../../scale-virtual-list/index.js"),P=["data-page-index"],q=["src"],z=e.defineComponent({__name:"pro-contract-view",props:S.ProContractViewProps,setup(f){const o=f,g=e.ref(null),c=e.ref([]),m={itemHeight:t=>c.value[t].size,overscan:3},u=e.ref(!0),s=e.ref(null),{b:h,e:d}=k.useNamespace("pro-contract-view"),v=e.computed(()=>[h()]);e.onMounted(()=>{if(s.value){const t=s.value.parentElement;!s.value.clientHeight&&(t!=null&&t.clientHeight)&&(s.value.style.height=`${t==null?void 0:t.clientHeight}px`)}}),e.watchEffect(()=>{const{signPrefix:t,userIdentity:a,appToken:n}=o.viewStatus;t&&a&&n&&o.pageList.length>0&&o.fileId&&w(o.pageList)});function w(t,a){const n=e.unref(t),i=Math.max(...n.map(l=>l.width));let r=1;a&&(r=Number.parseFloat((a/i).toFixed(2))),c.value=n.map(l=>{const N=Number.parseFloat((+l.width*r).toFixed(2)),p=Number.parseFloat((+l.height*r).toFixed(2));return{url:"",loaded:!1,width:N,height:p,size:p+10,pageNum:l.pageNum}}),u.value=!1}function x(t){_(t.start,t.end)}async function _(t,a){let n=t;for(;n<=a;){const i=c.value[n];if(!i)return;if(!i.loaded){i.loaded=!0;const r=await y(n+1);i.url=r}n++}}async function y(t){const{viewStatus:a,fileId:n}=o;return(await C.proContractViewApi.getFilePreview(a.signPrefix,{headers:{"SEAL-APP-TOKEN ":a.appToken,userIdentity:a.userIdentity},params:{fileId:n,pageNum:t,pageSize:1,absoluteEnable:!0}})).data.pages[t-1].url}return(t,a)=>(e.openBlock(),e.createElementBlock("div",{ref_key:"containerRef",ref:s,class:e.normalizeClass(v.value)},[e.createVNode(e.unref(V.Spin),{tip:"Loading...",spinning:u.value},null,8,["spinning"]),u.value?e.createCommentVNode("v-if",!0):(e.openBlock(),e.createElementBlock("div",{key:0,class:e.normalizeClass(e.unref(d)("content"))},[e.createVNode(e.unref(b.KScaleVirtualList),{ref_key:"virtualListRef",ref:g,list:c.value,option:m,"onUpdate:state":x},{default:e.withCtx(({index:n,item:i})=>[e.createElementVNode("div",{"data-page-index":n+1,class:e.normalizeClass(e.unref(d)("content-item")),style:e.normalizeStyle({height:`${i.data.height}px`,width:`${i.data.width}px`,marginBottom:"10px"})},[e.createElementVNode("img",{src:i.data.url,width:"100%",alt:""},null,8,q)],14,P)]),_:1},8,["list"])],2))],2))}});exports.default=z;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../utils/install.js"),t={fileId:{type:e.definePropType(String)},fileList:{type:e.definePropType(Array),default:()=>[]}};exports.ProContractViewProps=t;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../utils/install.js"),t={viewStatus:{type:e.definePropType(Object),required:!0},fileId:{type:String},pageList:{type:e.definePropType(Array),default:()=>[]}};exports.ProContractViewProps=t;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),p=require("ant-design-vue"),q=require("../../../hooks/use-namespace/index.js"),w=require("../../icon/index.js"),V=require("./props.js"),d=require("./utils/index.js");require("./hooks/index.js");const F=require("./file-list.js"),L=require("./hooks/useUpload.js"),$=i.defineComponent({name:"GdUpload",props:V.UploadComponentProps,emits:{"update:fileList":e=>!0,"upload-success":e=>e,change:e=>e,"upload-error":e=>e},setup(e,{emit:r,expose:g}){const{b:h}=q.useNamespace("pro-upload"),s=i.ref([]),f=i.ref(!1),{uploadFile:x,getFileDetails:v,getImgUrl:y}=L.useUpload(e.http),N=i.computed(()=>{if(e.disabled||s.value.length===e.maxCount)return!0}),b=a=>{var o;const{name:t,size:l}=a,n=d.getFileExtension(t),u=l/1024/1024;return e.accept&&e.accept.length>0&&!e.accept.includes(n)?(p.message.warning(`只能上传${(o=e.accept)==null?void 0:o.join(".")}后缀的文件!`),!1):u>e.maxSize?(p.message.warning(`上传的文件不能大于${e.maxSize}M!`),!1):!0},U=async a=>{try{const{file:t}=a;f.value=!0;const l=await x({business:e.business,file:t});if(f.value=!1,!l)return;const n=d.getFileExtension(l.originName),u=d.getUploadIcon(n);if(u==="img"){const c=await d.getBase64(t);s.value.push({icon:c,id:l.id,type:u,spining:!1,fileName:a.file.name})}else s.value.push({icon:u,id:l.id,type:u,spining:!1,fileName:a.file.name});const o=s.value.map(c=>({fileName:c.fileName,type:c.type,id:c.id}));r("update:fileList",o),r("upload-success",o)}catch(t){f.value=!1,r("upload-error",t)}},m=async a=>{const t=a==null?void 0:a.map(n=>n.id);if((t==null?void 0:t.length)===0)return;const l=await v(t);for(const n of l.data){const u=d.getFileExtension(n.originName),o=d.getUploadIcon(u);if(o==="img"){const c=await y([n.id]);s.value.push({id:n.id,icon:c[n.id],fileName:n.originName,spining:!1,type:o})}else s.value.push({id:n.id,icon:o,fileName:n.originName,spining:!1,type:o})}};return i.watch(()=>s.value,a=>{const t=a.map(l=>({fileName:l.fileName,type:l.type,id:l.id}));r("update:fileList",t),r("change",t)},{deep:!0}),i.onMounted(async()=>{m(e.fileList)}),g({updateFileList:m}),()=>{var a;return i.createVNode("div",{class:h(),style:{display:"flex",flexWrap:"wrap",alignContent:"space-between"}},[i.createVNode(F.default,{http:e.http,itemWidth:e.itemWidth,itemHeight:e.itemHeight,list:s.value,"onUpdate:list":t=>s.value=t},null,8,["http","itemWidth","itemHeight","list","onUpdate:list"]),s.value.length<(e.maxCount??20)?i.createVNode(p.Upload,{accept:(a=e.accept)==null?void 0:a.join(","),disabled:N.value,customRequest:U,beforeUpload:b,style:{marginTop:"5px"}},{default:()=>i.createVNode(p.Spin,{spinning:f.value},{default:()=>[i.createVNode("div",{style:{width:`${e.itemWidth}px`,height:`${e.itemHeight}px`,minWidth:"80px",minHeight:"80px",cursor:"pointer",border:"1px dashed #3296fa",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"5px"}},[i.createVNode(w.KIcon,{name:"upload-icon",color:"#3296fa",size:32},null)],4)]},8,["spinning"]),itemRender:()=>i.createVNode(i.Fragment,null,null),_:1},8,["accept","disabled","customRequest","beforeUpload"]):i.createVNode(i.Fragment,null,null)],2)}}});exports.default=$;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("vue"),p=require("ant-design-vue"),w=require("../../../hooks/use-namespace/index.js"),V=require("../../icon/index.js"),F=require("./props.js"),d=require("./utils/index.js");require("./hooks/index.js");const L=require("./file-list.js"),$=require("./hooks/useUpload.js"),C=i.defineComponent({name:"GdUpload",props:F.UploadComponentProps,emits:{"update:fileList":e=>!0,"upload-success":e=>e,change:e=>e,"upload-error":e=>e},setup(e,{emit:r,expose:h}){const{b:x}=w.useNamespace("pro-upload"),l=i.ref([]),f=i.ref(!1),{uploadFile:y,getFileDetails:v,getImgUrl:N}=$.useUpload(e.http),b=i.computed(()=>{if(e.disabled||l.value.length===e.maxCount)return!0}),U=async(a,t)=>{var o;if(e.beforeUpload){const m=e.beforeUpload(a,t);if(m instanceof Promise){if(await m===!1)return!1}else if(!m)return!1}const{name:s,size:n}=a,c=d.getFileExtension(s),u=n/1024/1024;return e.accept&&e.accept.length>0&&!e.accept.includes(c)?(p.message.warning(`只能上传${(o=e.accept)==null?void 0:o.join(".")}后缀的文件!`),!1):u>e.maxSize?(p.message.warning(`上传的文件不能大于${e.maxSize}M!`),!1):!0},q=async a=>{try{const{file:t}=a;f.value=!0;const s=await y({business:e.business,file:t});if(f.value=!1,!s)return;const n=d.getFileExtension(s.originName),c=d.getUploadIcon(n);if(c==="img"){const o=await d.getBase64(t);l.value.push({icon:o,id:s.id,type:c,spining:!1,fileName:a.file.name})}else l.value.push({icon:c,id:s.id,type:c,spining:!1,fileName:a.file.name});const u=l.value.map(o=>({fileName:o.fileName,type:o.type,id:o.id}));r("update:fileList",u),r("upload-success",u)}catch(t){f.value=!1,r("upload-error",t)}},g=async a=>{const t=a==null?void 0:a.map(n=>n.id);if((t==null?void 0:t.length)===0)return;const s=await v(t);for(const n of s.data){const c=d.getFileExtension(n.originName),u=d.getUploadIcon(c);if(u==="img"){const o=await N([n.id]);l.value.push({id:n.id,icon:o[n.id],fileName:n.originName,spining:!1,type:u})}else l.value.push({id:n.id,icon:u,fileName:n.originName,spining:!1,type:u})}};return i.watch(()=>l.value,a=>{const t=a.map(s=>({fileName:s.fileName,type:s.type,id:s.id}));r("update:fileList",t),r("change",t)},{deep:!0}),i.onMounted(async()=>{g(e.fileList)}),h({updateFileList:g}),()=>{var a;return i.createVNode("div",{class:x(),style:{display:"flex",flexWrap:"wrap",alignContent:"space-between"}},[i.createVNode(L.default,{http:e.http,itemWidth:e.itemWidth,itemHeight:e.itemHeight,list:l.value,"onUpdate:list":t=>l.value=t},null,8,["http","itemWidth","itemHeight","list","onUpdate:list"]),l.value.length<(e.maxCount??20)?i.createVNode(p.Upload,{accept:(a=e.accept)==null?void 0:a.join(","),disabled:b.value,customRequest:q,beforeUpload:U,style:{marginTop:"5px"}},{default:()=>i.createVNode(p.Spin,{spinning:f.value},{default:()=>[i.createVNode("div",{style:{width:`${e.itemWidth}px`,height:`${e.itemHeight}px`,minWidth:"80px",minHeight:"80px",cursor:"pointer",border:"1px dashed #3296fa",display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"5px"}},[i.createVNode(V.KIcon,{name:"upload-icon",color:"#3296fa",size:32},null)],4)]},8,["spinning"]),itemRender:()=>i.createVNode(i.Fragment,null,null),_:1},8,["accept","disabled","customRequest","beforeUpload"]):i.createVNode(i.Fragment,null,null)],2)}}});exports.default=C;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("ant-design-vue"),c=require("./useHttp.js");function d(u){const r=c.useHttp(u);return{uploadFile:t=>new Promise(async(a,s)=>{try{const e=await r.getUploadUrl({params:{business:t.business}});if(e.status===0){const n=e.data,i=new FormData;i.append("file",t.file);const l=await r.uploadFileApi(n,i);l.status===0?(o.message.success("文件上传成功~"),a(l.data)):(o.message.error(l.msg),s(l))}else o.message.error(e.msg),s(e)}catch(e){console.log(e),o.message.error("文件上传失败,请联系管理员进行查看!"),s(e)}}),downloadFile:t=>new Promise(async(a,s)=>{try{const e=t[0],n=await r.getDownloadUrlApi(t);if(n.status===0){const i=n.data[e];window.open(i),a(!0)}a(!1)}catch(e){s(e)}}),getImgUrl:t=>new Promise(async(a,s)=>{const e=await r.getDownloadUrlApi(t);e.status===0?a(e.data):s(e)}),getFileDetails:async t=>new Promise(async(a,s)=>{r.getFileDetailApi({fileIds:t}).then(e=>{e.status===0?a(e):(o.message.error(e.msg),s(e))}).catch(e=>{o.message.error(e),s(e)})})}}exports.useUpload=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("ant-design-vue"),c=require("./useHttp.js");function d(u){const r=c.useHttp(u);return{uploadFile:s=>new Promise(async(a,t)=>{try{const e=await r.getUploadUrl({params:{business:s.business}});if(e.status===0){const n=e.data,i=new FormData;i.append("file",s.file);const l=await r.uploadFileApi(n,i);l.status===0?(o.message.success("文件上传成功~"),a(l.data)):(o.message.error(l.msg),t(l))}else o.message.error(e.msg),t(e)}catch(e){console.log(e),o.message.error("文件上传失败,请联系管理员进行查看!"),t(e)}}),downloadFile:s=>new Promise(async(a,t)=>{try{const e=s[0],n=await r.getDownloadUrlApi(s);if(n.status===0){const i=n.data[e];window.open(i),a(!0)}a(!1)}catch(e){t(e)}}),getImgUrl:s=>new Promise(async(a,t)=>{const e=await r.getDownloadUrlApi(s);e.status===0?a(e.data):t(e)}),getFileDetails:async s=>new Promise(async(a,t)=>{r.getFileDetailApi({fileIds:s}).then(e=>{e.status===0?a(e):(o.message.error(e.msg),t(e))}).catch(e=>{o.message.error(e),t(e)})}),removeFiel:async s=>await r.deleteFileApi({params:{fileId:s}})}}exports.useUpload=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={uploadName:{type:String},business:{type:String,required:!0},proxyPrefix:{type:String},fileList:{type:Array,required:!0,default:()=>[]},accept:{type:Array},disabled:{type:Boolean,default:!1},maxSize:{type:Number,default:10},maxCount:{type:Number,default:6},http:{type:[Object,Function],required:!0},itemWidth:{type:Number,default:80},itemHeight:{type:Number,default:80}};exports.UploadComponentProps=e;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e={uploadName:{type:String},beforeUpload:{type:Function},business:{type:String,required:!0},proxyPrefix:{type:String},fileList:{type:Array,required:!0,default:()=>[]},accept:{type:Array},disabled:{type:Boolean,default:!1},maxSize:{type:Number,default:10},maxCount:{type:Number,default:6},http:{type:[Object,Function],required:!0},itemWidth:{type:Number,default:80},itemHeight:{type:Number,default:80}};exports.UploadComponentProps=e;
@@ -1 +1 @@
1
- @font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=37456) format("woff2"),url(fonts/iconfont.woff?t=20732) format("woff"),url(fonts/iconfont.ttf?t=59900) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-upload-icon:before{content:"\e617"}.icon-king-title-icon:before{content:"\e680"}
1
+ @font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=69058) format("woff2"),url(fonts/iconfont.woff?t=65842) format("woff"),url(fonts/iconfont.ttf?t=20993) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-upload-icon:before{content:"\e617"}.icon-king-title-icon:before{content:"\e680"}
@@ -1 +1 @@
1
- :root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500;display:flex;align-items:center}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=64090) format("woff2"),url(fonts/iconfont.woff?t=57883) format("woff"),url(fonts/iconfont.ttf?t=94316) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-upload-icon:before{content:"\e617"}.icon-king-title-icon:before{content:"\e680"}.king-cover-scrollbar{height:100%;width:100%;overflow:hidden;position:relative}.king-cover-scrollbar .king-cover-scrollbar-container{height:100%;width:100%;overflow:scroll;scrollbar-width:none}.king-cover-scrollbar .king-cover-scrollbar-rail{width:5px;top:2px;bottom:2px;position:absolute}.king-cover-scrollbar .king-cover-scrollbar-rail__scrollbar--vertical{position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-pro-contract-view{position:relative;border:1px solid green}.king-pro-contract-view>.ant-spin{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
1
+ :root{--king-color-white:#ffffff;--king-color-primary:#409eff;--king-color-success:#67c23a;--king-color-warning:#e6a23c;--king-color-danger:#f56c6c;--king-color-error:#f56c6c;--king-color-info:#909399;--king-transition-duration:0.3s}.king-button--primary{--king-button-text-color:var(--king-color-primary)}.king-button--success{--king-button-text-color:var(--king-color-success)}.king-button--warning{--king-button-text-color:var(--king-color-warning)}.king-button--danger{--king-button-text-color:var(--king-color-danger)}.king-button--error{--king-button-text-color:var(--king-color-error)}.king-button--info{--king-button-text-color:var(--king-color-info)}.king-button{color:var(--king-button-text-color)}.king-scrollbar{overflow:hidden;position:relative;z-index:auto;height:100%;width:100%}.king-scrollbar .king-scrollbar-container{width:100%;overflow:scroll;height:100%;min-height:inherit;max-height:inherit;scrollbar-width:none}.king-scrollbar .king-scrollbar-content{width:-moz-fit-content;width:fit-content}.king-scrollbar .king-scrollbar-rail{position:absolute}.king-scrollbar .king-scrollbar-rail--vertical{right:0;width:5px;top:2px;bottom:2px;right:4px}.king-scrollbar .king-scrollbar-rail--horizontal{bottom:2px;height:5px;left:2px;right:2px}.king-scrollbar .king-scrollbar-rail__scrollbar--vertical{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-scrollbar .king-scrollbar-rail__scrollbar--horizontal{background:rgba(0,0,0,.25);position:absolute;border-radius:5px;height:100%;cursor:pointer}.v-vl-items{width:-moz-fit-content;width:fit-content}.king-scale-virtual-list{width:100%;height:100%}.king-scale-virtual-list .king-scale-virtual-list-container{margin:0 auto;position:relative}.king-scale-virtual-list .king-scale-vittual-wrapper{width:-moz-fit-content;width:fit-content;margin:0 auto;position:absolute;left:50%}.king-pro-title{border-bottom:1px solid #ccc;font-weight:500;display:flex;align-items:center}.king-pro-title .icon{margin-right:10px}.king-pro-title--unborder{border:none}.king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:80vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}.king-pro-area-select{width:100%}@font-face{font-family:iconfont;src:url(fonts/iconfont.woff2?t=66780) format("woff2"),url(fonts/iconfont.woff?t=90554) format("woff"),url(fonts/iconfont.ttf?t=36547) format("truetype")}.king-icon{font-family:iconfont!important;font-size:16px;font-style:normal;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.icon-king-upload-icon:before{content:"\e617"}.icon-king-title-icon:before{content:"\e680"}.king-cover-scrollbar{height:100%;width:100%;overflow:hidden;position:relative}.king-cover-scrollbar .king-cover-scrollbar-container{height:100%;width:100%;overflow:scroll;scrollbar-width:none}.king-cover-scrollbar .king-cover-scrollbar-rail{width:5px;top:2px;bottom:2px;position:absolute}.king-cover-scrollbar .king-cover-scrollbar-rail__scrollbar--vertical{position:absolute;border-radius:5px;width:100%;cursor:pointer}.king-pro-contract-view{position:relative;display:flex}.king-pro-contract-view .king-pro-contract-view__content{flex:1}.king-pro-contract-view .king-pro-contract-view__content-item{border:1px solid #f0f0f0;position:relative;box-shadow:0 2px 10px 0 rgba(0,0,0,.1)}.king-pro-contract-view>.ant-spin{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
@@ -1 +1 @@
1
- .king-pro-contract-view{position:relative;border:1px solid green}.king-pro-contract-view>.ant-spin{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
1
+ .king-pro-contract-view{position:relative;display:flex}.king-pro-contract-view .king-pro-contract-view__content{flex:1}.king-pro-contract-view .king-pro-contract-view__content-item{border:1px solid #f0f0f0;position:relative;box-shadow:0 2px 10px 0 rgba(0,0,0,.1)}.king-pro-contract-view>.ant-spin{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%)}
@@ -1 +1 @@
1
- .king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:65vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}
1
+ .king-pro-modal .ant-modal-content{padding:0}.king-pro-modal .ant-modal-header{height:56px;padding-left:32px;padding-right:24px;display:flex;justify-content:space-between;align-items:center;background:#f1f7ff;border-bottom:1px solid #e6e8ea}.king-pro-modal .ant-modal-body{padding:10px 20px;max-height:80vh;overflow:auto}.king-pro-modal .ant-modal-footer{height:56px;display:flex;padding:0 16px;justify-content:flex-end;align-items:center;border-top:1px solid #e6e8ea}.king-pro-modal .ant-modal-title{flex:1}.king-pro-modal .pro-modal-title{cursor:move;width:100%}
@@ -1,3 +1,8 @@
1
- export declare const proAreaApis: {
2
- contractFiles: string;
1
+ import { AxiosRequestConfig } from 'axios';
2
+ export declare const proContractViewApi: {
3
+ getContractPrefix: (config?: AxiosRequestConfig) => Promise<any>;
4
+ getSignPrefix: (config?: AxiosRequestConfig) => Promise<any>;
5
+ getPreviewUrl: (preFix: string, config: AxiosRequestConfig) => Promise<any>;
6
+ getFileList: (preFix: string, config: AxiosRequestConfig) => Promise<any>;
7
+ getFilePreview: (signPreFix: string, config: AxiosRequestConfig) => Promise<any>;
3
8
  };
@@ -1,27 +1,34 @@
1
1
  import { Ref } from 'vue';
2
2
  interface paramsType {
3
3
  contractId: string;
4
- prefix?: string;
5
4
  header?: Recordable<any>;
6
5
  }
7
- export declare function useProContractView({ contractId, prefix }: paramsType): {
8
- pages: Ref<{
6
+ export declare function useProContractView({ contractId }: paramsType): {
7
+ pageList: Ref<{
9
8
  url: string;
10
9
  loaded: boolean;
11
- width: string;
12
- height: string;
10
+ width: number;
11
+ height: number;
13
12
  pageNum: number;
13
+ size?: number | undefined;
14
14
  }[]>;
15
+ viewStatus: {
16
+ contractPrefix: string;
17
+ signPrefix: string;
18
+ appToken: string;
19
+ userIdentity: string;
20
+ };
15
21
  fileList: Ref<{
16
- fieid: string;
22
+ fileId: string;
17
23
  fileName: string;
18
24
  total: number;
19
- pageInfoVolist: {
25
+ pageInfoVoList: {
20
26
  url: string;
21
27
  loaded: boolean;
22
- width: string;
23
- height: string;
28
+ width: number;
29
+ height: number;
24
30
  pageNum: number;
31
+ size?: number | undefined;
25
32
  }[];
26
33
  }[]>;
27
34
  };
@@ -1,25 +1,43 @@
1
1
  import { SFCWithInstall } from '../utils/install';
2
2
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
- import { fileType } from './src/types';
3
+ import { pageType } from './src/types';
4
4
  export type { ContractViewProps } from './src/types';
5
5
  export * from './hooks/use-contract-view';
6
6
  export declare const KProContractView: SFCWithInstall<DefineComponent<{
7
+ readonly viewStatus: {
8
+ readonly type: PropType<{
9
+ contractPrefix: string;
10
+ signPrefix: string;
11
+ userIdentity: string;
12
+ appToken: string;
13
+ }>;
14
+ readonly required: true;
15
+ };
7
16
  readonly fileId: {
8
- readonly type: PropType<string>;
17
+ readonly type: StringConstructor;
9
18
  };
10
- readonly fileList: {
11
- readonly type: PropType< fileType[]>;
19
+ readonly pageList: {
20
+ readonly type: PropType< pageType[]>;
12
21
  readonly default: () => never[];
13
22
  };
14
23
  }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
24
+ readonly viewStatus: {
25
+ readonly type: PropType<{
26
+ contractPrefix: string;
27
+ signPrefix: string;
28
+ userIdentity: string;
29
+ appToken: string;
30
+ }>;
31
+ readonly required: true;
32
+ };
15
33
  readonly fileId: {
16
- readonly type: PropType<string>;
34
+ readonly type: StringConstructor;
17
35
  };
18
- readonly fileList: {
19
- readonly type: PropType< fileType[]>;
36
+ readonly pageList: {
37
+ readonly type: PropType< pageType[]>;
20
38
  readonly default: () => never[];
21
39
  };
22
40
  }>>, {
23
- readonly fileList: fileType[];
41
+ readonly pageList: pageType[];
24
42
  }, {}>>;
25
43
  export default KProContractView;
@@ -1,22 +1,40 @@
1
+ import { pageType } from './types';
1
2
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
2
- import { fileType } from './types';
3
3
  declare const _default: DefineComponent<{
4
+ readonly viewStatus: {
5
+ readonly type: PropType<{
6
+ contractPrefix: string;
7
+ signPrefix: string;
8
+ userIdentity: string;
9
+ appToken: string;
10
+ }>;
11
+ readonly required: true;
12
+ };
4
13
  readonly fileId: {
5
- readonly type: PropType<string>;
14
+ readonly type: StringConstructor;
6
15
  };
7
- readonly fileList: {
8
- readonly type: PropType< fileType[]>;
16
+ readonly pageList: {
17
+ readonly type: PropType<pageType[]>;
9
18
  readonly default: () => never[];
10
19
  };
11
20
  }, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{
21
+ readonly viewStatus: {
22
+ readonly type: PropType<{
23
+ contractPrefix: string;
24
+ signPrefix: string;
25
+ userIdentity: string;
26
+ appToken: string;
27
+ }>;
28
+ readonly required: true;
29
+ };
12
30
  readonly fileId: {
13
- readonly type: PropType<string>;
31
+ readonly type: StringConstructor;
14
32
  };
15
- readonly fileList: {
16
- readonly type: PropType< fileType[]>;
33
+ readonly pageList: {
34
+ readonly type: PropType<pageType[]>;
17
35
  readonly default: () => never[];
18
36
  };
19
37
  }>>, {
20
- readonly fileList: fileType[];
38
+ readonly pageList: pageType[];
21
39
  }, {}>;
22
40
  export default _default;
@@ -1,24 +1,34 @@
1
1
  import { ExtractPublicPropTypes, PropType } from 'vue';
2
2
  export declare const ProContractViewProps: {
3
+ readonly viewStatus: {
4
+ readonly type: PropType<{
5
+ contractPrefix: string;
6
+ signPrefix: string;
7
+ userIdentity: string;
8
+ appToken: string;
9
+ }>;
10
+ readonly required: true;
11
+ };
3
12
  readonly fileId: {
4
- readonly type: PropType<string>;
13
+ readonly type: StringConstructor;
5
14
  };
6
- readonly fileList: {
7
- readonly type: PropType<fileType[]>;
15
+ readonly pageList: {
16
+ readonly type: PropType<pageType[]>;
8
17
  readonly default: () => never[];
9
18
  };
10
19
  };
11
20
  export interface pageType {
12
21
  url: string;
13
22
  loaded: boolean;
14
- width: string;
15
- height: string;
23
+ width: number;
24
+ height: number;
16
25
  pageNum: number;
26
+ size?: number;
17
27
  }
18
28
  export interface fileType {
19
- fieid: string;
29
+ fileId: string;
20
30
  fileName: string;
21
31
  total: number;
22
- pageInfoVolist: pageType[];
32
+ pageInfoVoList: pageType[];
23
33
  }
24
34
  export type ContractViewProps = ExtractPublicPropTypes<typeof ProContractViewProps>;
@@ -1,6 +1,7 @@
1
1
  import { useUpload } from './src/hooks/useUpload';
2
2
  import { SFCWithInstall } from '../utils/install';
3
3
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
4
+ import { UploadProps } from 'ant-design-vue';
4
5
  import { UploadPropsType, FileListType } from './src/types';
5
6
  export * from './src/types';
6
7
  export { useUpload };
@@ -8,6 +9,9 @@ export declare const KProUpload: SFCWithInstall<DefineComponent<{
8
9
  uploadName: {
9
10
  type: StringConstructor;
10
11
  };
12
+ beforeUpload: {
13
+ type: PropType< UploadProps["beforeUpload"]>;
14
+ };
11
15
  business: {
12
16
  type: StringConstructor;
13
17
  required: boolean;
@@ -56,6 +60,9 @@ export declare const KProUpload: SFCWithInstall<DefineComponent<{
56
60
  uploadName: {
57
61
  type: StringConstructor;
58
62
  };
63
+ beforeUpload: {
64
+ type: PropType< UploadProps["beforeUpload"]>;
65
+ };
59
66
  business: {
60
67
  type: StringConstructor;
61
68
  required: boolean;
@@ -105,7 +112,7 @@ export declare const KProUpload: SFCWithInstall<DefineComponent<{
105
112
  itemHeight: number | undefined;
106
113
  disabled: boolean;
107
114
  fileList: object[];
108
- maxSize: number | undefined;
109
115
  maxCount: number;
116
+ maxSize: number | undefined;
110
117
  }, {}>>;
111
118
  export default KProUpload;
@@ -1,9 +1,13 @@
1
+ import { UploadProps } from 'ant-design-vue';
1
2
  import { FileListType, UploadPropsType } from './types';
2
3
  import { DefineComponent, PropType, ComponentOptionsMixin, PublicProps, ExtractPropTypes } from 'vue';
3
4
  declare const _default: DefineComponent<{
4
5
  uploadName: {
5
6
  type: StringConstructor;
6
7
  };
8
+ beforeUpload: {
9
+ type: PropType<UploadProps["beforeUpload"]>;
10
+ };
7
11
  business: {
8
12
  type: StringConstructor;
9
13
  required: boolean;
@@ -52,6 +56,9 @@ declare const _default: DefineComponent<{
52
56
  uploadName: {
53
57
  type: StringConstructor;
54
58
  };
59
+ beforeUpload: {
60
+ type: PropType<UploadProps["beforeUpload"]>;
61
+ };
55
62
  business: {
56
63
  type: StringConstructor;
57
64
  required: boolean;
@@ -101,7 +108,7 @@ declare const _default: DefineComponent<{
101
108
  itemHeight: number | undefined;
102
109
  disabled: boolean;
103
110
  fileList: object[];
104
- maxSize: number | undefined;
105
111
  maxCount: number;
112
+ maxSize: number | undefined;
106
113
  }, {}>;
107
114
  export default _default;
@@ -1,6 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import { IUploadFileConfig } from '../types';
3
- import { UploadFileResType, FileDetailType } from './resType';
3
+ import { UploadFileResType, FileDetailType, ResponseType } from './resType';
4
4
  export declare function useUpload(httpConfig: AxiosInstance): {
5
5
  uploadFile: (config: IUploadFileConfig) => Promise< UploadFileResType>;
6
6
  downloadFile: (config: string[]) => Promise<boolean>;
@@ -8,4 +8,5 @@ export declare function useUpload(httpConfig: AxiosInstance): {
8
8
  getFileDetails: (config: string[]) => Promise<ReturnType<(config: {
9
9
  fileIds: string[];
10
10
  }) => Promise< FileDetailType>>>;
11
+ removeFiel: (fileId: string) => Promise< ResponseType>;
11
12
  };
@@ -1,9 +1,13 @@
1
1
  import { PropType } from 'vue';
2
+ import { UploadProps } from 'ant-design-vue/es/upload';
2
3
  import { UploadPropsType } from './types';
3
4
  export declare const UploadComponentProps: {
4
5
  uploadName: {
5
6
  type: StringConstructor;
6
7
  };
8
+ beforeUpload: {
9
+ type: PropType<UploadProps["beforeUpload"]>;
10
+ };
7
11
  business: {
8
12
  type: StringConstructor;
9
13
  required: boolean;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@king-one/antdv",
3
3
  "type": "module",
4
- "version": "1.0.97",
4
+ "version": "1.1.0",
5
5
  "description": "",
6
6
  "author": "",
7
7
  "license": "ISC",