yahee-components 0.0.114 → 0.0.115

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.
@@ -1,23 +1,23 @@
1
- import { defineComponent as _, toRefs as F, ref as o, reactive as H, onMounted as K } from "vue";
2
- import { CaretLeft as T, CaretRight as V } from "@element-plus/icons-vue";
3
- import { ElMessage as l, ElButton as k, ElIcon as q, ElScrollbar as j } from "element-plus";
1
+ import { defineComponent as Y, toRefs as G, ref as s, reactive as z, onMounted as J, nextTick as Q } from "vue";
2
+ import { CaretLeft as W, CaretRight as X } from "@element-plus/icons-vue";
3
+ import { ElMessage as g, ElButton as Z, ElIcon as ee, ElScrollbar as te } from "element-plus";
4
4
  import "element-plus/theme-chalk/src/base.scss";
5
5
  import "element-plus/theme-chalk/src/badge.scss";
6
6
  import "element-plus/theme-chalk/src/message.scss";
7
7
  import "element-plus/theme-chalk/src/scrollbar.scss";
8
8
  import "element-plus/theme-chalk/src/button.scss";
9
- import { useUpload as A } from "../packages/components/hooks/useUpload.js";
10
- import { useFile as R } from "../packages/components/hooks/useImg.js";
11
- import Y from "./operation-log-form.vue.js";
12
- import G from "./operation-log-content.vue.js";
13
- import z from "./operation-log-dialog.vue.js";
14
- import J from "../_virtual/dayjs.min.js";
15
- import { M2 as s } from "../utils/translate.js";
16
- import Q from "../annex-upload/annex-upload.vue.js";
17
- import W from "../node_modules/.pnpm/v3-infinite-loading@1.3.2/node_modules/v3-infinite-loading/lib/v3-infinite-loading.es.js";
9
+ import { useUpload as oe } from "../packages/components/hooks/useUpload.js";
10
+ import { useFile as ne } from "../packages/components/hooks/useImg.js";
11
+ import se from "./operation-log-form.vue.js";
12
+ import ae from "./operation-log-content.vue.js";
13
+ import ie from "./operation-log-dialog.vue.js";
14
+ import le from "../_virtual/dayjs.min.js";
15
+ import { M2 as a } from "../utils/translate.js";
16
+ import re from "../annex-upload/annex-upload.vue.js";
17
+ import ge from "../node_modules/.pnpm/v3-infinite-loading@1.3.2/node_modules/v3-infinite-loading/lib/v3-infinite-loading.es.js";
18
18
  /* empty css */
19
- import { findGlobalNotes as X, insertGlobalnotes as x } from "../packages/components/api/log/index.js";
20
- const be = /* @__PURE__ */ _({
19
+ import { findGlobalNotes as ce, insertGlobalnotes as P } from "../packages/components/api/log/index.js";
20
+ const Oe = /* @__PURE__ */ Y({
21
21
  name: "YaheeOperationLog",
22
22
  __name: "operation-log",
23
23
  props: {
@@ -26,112 +26,123 @@ const be = /* @__PURE__ */ _({
26
26
  topHeight: { type: Number, required: !1, default: 90 },
27
27
  ifShowDocument: { type: Boolean, required: !1, default: !0 }
28
28
  },
29
- setup(D, { expose: E }) {
30
- E();
31
- const a = D, { ifShowDocument: M } = F(a), u = o(!1), h = o(!1), c = o(!1), b = o({}), i = H({
29
+ setup(U, { expose: _ }) {
30
+ _();
31
+ const n = U, { ifShowDocument: A } = G(n), c = s(!1), I = s(!1), h = s(!1), N = s({}), i = z({
32
32
  List: [],
33
33
  LoginId: 0
34
- }), p = o(""), d = o([]), n = {
34
+ }), p = s(""), d = s([]), o = {
35
35
  PageIndex: -1,
36
36
  StartOn: "",
37
37
  EndOn: "",
38
38
  Notes: "",
39
39
  Mark: null,
40
40
  UserIds: []
41
- }, r = () => {
42
- u.value = !0;
41
+ }, l = () => {
42
+ c.value = !0;
43
43
  const e = new FormData();
44
44
  e.append(
45
45
  "filter",
46
46
  JSON.stringify({
47
- BusinessKey: a.businessKey,
48
- BusinessName: a.businessName,
49
- PageIndex: n.PageIndex,
50
- StartOn: n.StartOn,
51
- EndOn: n.EndOn,
52
- UserIds: n.UserIds,
53
- Notes: n.Notes,
54
- Mark: n.Mark
47
+ BusinessKey: n.businessKey,
48
+ BusinessName: n.businessName,
49
+ PageIndex: o.PageIndex,
50
+ StartOn: o.StartOn,
51
+ EndOn: o.EndOn,
52
+ UserIds: o.UserIds,
53
+ Notes: o.Notes,
54
+ Mark: o.Mark
55
55
  })
56
- ), X(e).then((t) => {
57
- var g;
58
- i.LoginId = t.LoginId, n.PageIndex === 0 ? i.List = t.List || [] : i.List = [...i.List || [], ...t.List || []], ((g = t == null ? void 0 : t.List) == null ? void 0 : g.length) === 0 && (h.value = !0);
56
+ ), ce(e).then((t) => {
57
+ var r;
58
+ i.LoginId = t.LoginId, o.PageIndex === 0 ? i.List = t.List || [] : i.List = [...i.List || [], ...t.List || []], ((r = t == null ? void 0 : t.List) == null ? void 0 : r.length) === 0 && (I.value = !0);
59
59
  }).finally(() => {
60
- u.value = !1;
60
+ c.value = !1;
61
61
  });
62
- }, L = () => {
63
- u.value || (u.value = !0, n.PageIndex += 1, r());
64
- }, O = (e) => {
65
- i.List = [], n.PageIndex = 0, n.StartOn = e.timeValue ? e.timeValue[0] : "", n.EndOn = e.timeValue ? e.timeValue[1] : "", n.UserIds = e.CreatedBy ? [e.CreatedBy] : [], n.Notes = e.search, n.Mark = e.Mark, r();
66
- }, B = () => {
67
- d.value.length > 0 && m(d.value[0]).then(async () => {
68
- l.success(s("上传文件成功!")), n.PageIndex = 0, d.value = [], await r(), f();
62
+ }, w = () => {
63
+ c.value || (c.value = !0, o.PageIndex += 1, l());
64
+ }, T = (e) => {
65
+ i.List = [], o.PageIndex = 0, o.StartOn = e.timeValue ? e.timeValue[0] : "", o.EndOn = e.timeValue ? e.timeValue[1] : "", o.UserIds = e.CreatedBy ? [e.CreatedBy] : [], o.Notes = e.search, o.Mark = e.Mark, l();
66
+ }, k = () => {
67
+ d.value.length > 0 && H(d.value[0]).then(async () => {
68
+ g.success(a("上传文件成功!")), o.PageIndex = 0, d.value = [], await l(), y();
69
69
  });
70
- }, S = (e) => {
71
- m(e).then(() => {
72
- l.success(s("上传文件成功!")), c.value = !1, n.PageIndex = 0, r();
70
+ }, K = (e) => {
71
+ H(e).then(() => {
72
+ g.success(a("上传文件成功!")), h.value = !1, o.PageIndex = 0, l();
73
73
  });
74
- }, m = (e) => {
74
+ }, H = (e) => {
75
75
  const t = new FormData();
76
- return t.append("BusinessKey", a.businessKey), t.append("BusinessName", a.businessName), t.append("notes", e.fileUrl), t.append("ViewTitle", e.fileName), x(t);
77
- }, w = () => {
76
+ return t.append("BusinessKey", n.businessKey), t.append("BusinessName", n.businessName), t.append("notes", e.fileUrl), t.append("ViewTitle", e.fileName), P(t);
77
+ }, q = () => {
78
78
  if (!p.value) {
79
- l.info(s("备注不能为空!"));
79
+ g.info(a("备注不能为空!"));
80
80
  return;
81
81
  }
82
82
  const e = new FormData();
83
- e.append("BusinessKey", a.businessKey), e.append("BusinessName", a.businessName), e.append("notes", p.value), e.append("ViewTitle", "备注"), x(e).then(async () => {
84
- l.success(s("添加备注成功!")), n.PageIndex = 0, p.value = "", await r(), f();
83
+ e.append("BusinessKey", n.businessKey), e.append("BusinessName", n.businessName), e.append("notes", p.value), e.append("ViewTitle", "备注"), P(e).then(async () => {
84
+ g.success(a("添加备注成功!")), o.PageIndex = 0, p.value = "", await l(), y();
85
85
  });
86
- }, P = (e) => {
86
+ }, V = (e) => {
87
87
  if (e.clipboardData || e.originalEvent) {
88
88
  if (e.clipboardData.items.length === 0) {
89
- l.error(s("复制文件到剪切板失败,请点击按钮上传!"));
89
+ g.error(a("复制文件到剪切板失败,请点击按钮上传!"));
90
90
  return;
91
91
  }
92
92
  if (e.clipboardData.files.length > 0) {
93
- c.value = !0;
93
+ h.value = !0;
94
94
  for (let t = 0; t < e.clipboardData.files.length; t++) {
95
- e.clipboardData.files[t].size / 1024 / 1024 < 100 || l.error(s("上传文件大小不能超过 100MB!"));
96
- const { name: C } = e.clipboardData.files[t];
97
- A("115", e.clipboardData.files[t]).then((U) => {
98
- b.value = {
99
- fileName: C || "",
100
- fileUrl: R({ fileId: U[0] })
95
+ e.clipboardData.files[t].size / 1024 / 1024 < 100 || g.error(a("上传文件大小不能超过 100MB!"));
96
+ const { name: m } = e.clipboardData.files[t];
97
+ oe("115", e.clipboardData.files[t]).then((b) => {
98
+ N.value = {
99
+ fileName: m || "",
100
+ fileUrl: ne({ fileId: b[0] })
101
101
  };
102
102
  }).catch(() => {
103
103
  });
104
104
  }
105
105
  }
106
106
  }
107
- }, y = o(null), f = () => {
108
- y.value.scrollTo({ top: 0, behavior: "smooth" });
109
- }, v = o(0), I = o(null);
110
- K(() => {
111
- var t;
112
- const e = (t = document.getElementsByClassName("log-form")[0]) == null ? void 0 : t.clientHeight;
113
- v.value = window.innerHeight - e - I.value.offsetHeight - a.topHeight, L();
107
+ }, E = s(null), y = () => {
108
+ E.value.scrollTo({ top: 0, behavior: "smooth" });
109
+ }, M = s(0), u = s(null);
110
+ J(() => {
111
+ var r, m;
112
+ console.log("=== onMounted 触发(DOM 已挂载但布局未完成)===");
113
+ const e = (r = document.getElementsByClassName("log-form")[0]) == null ? void 0 : r.clientHeight, t = (m = u.value) == null ? void 0 : m.offsetHeight;
114
+ console.log("【nextTick 前】logFormHeight:", e, "| textAreaHeight:", t), Q(() => {
115
+ var D, O;
116
+ const b = (D = document.getElementsByClassName("log-form")[0]) == null ? void 0 : D.clientHeight, $ = (O = u.value) == null ? void 0 : O.offsetHeight;
117
+ console.log("【nextTick 后】logFormHeight:", b, "| textAreaHeight:", $), requestAnimationFrame(() => {
118
+ var S, F, C;
119
+ const f = (S = document.getElementsByClassName("log-form")[0]) == null ? void 0 : S.clientHeight, v = (F = u.value) == null ? void 0 : F.offsetHeight, x = window.innerHeight, L = (C = document.querySelector(".yahee-operation-log")) == null ? void 0 : C.parentElement, j = L == null ? void 0 : L.clientHeight;
120
+ console.log("【rAF 后 — 最终计算】"), console.log("window.innerHeight:", x), console.log("logFormHeight:", f), console.log("textAreaHeight:", v), console.log("props.topHeight:", n.topHeight), console.log("父容器 clientHeight:", j), console.log(`算式: ${x} - ${f} - ${v} - ${n.topHeight}`);
121
+ const R = x - f - v - n.topHeight;
122
+ console.log(`结果: ${R}`), console.log("============================="), M.value = window.innerHeight - f - u.value.offsetHeight - n.topHeight, w();
123
+ });
124
+ });
114
125
  });
115
- const N = { props: a, ifShowDocument: M, loading: u, noMore: h, showDialog: c, docInfo: b, dataList: i, textareaText: p, compAnalysisFile: d, params: n, getLogMessage: r, load: L, filterChange: O, change: B, confirmUpload: S, uploadFile: m, sendEditQuill: w, handlePaste: P, infiniteList: y, scrollTop: f, boxHeight: v, logText: I, get CaretRight() {
116
- return V;
126
+ const B = { props: n, ifShowDocument: A, loading: c, noMore: I, showDialog: h, docInfo: N, dataList: i, textareaText: p, compAnalysisFile: d, params: o, getLogMessage: l, load: w, filterChange: T, change: k, confirmUpload: K, uploadFile: H, sendEditQuill: q, handlePaste: V, infiniteList: E, scrollTop: y, boxHeight: M, logText: u, get CaretRight() {
127
+ return X;
117
128
  }, get CaretLeft() {
118
- return T;
129
+ return W;
119
130
  }, get ElScrollbar() {
120
- return j;
131
+ return te;
121
132
  }, get ElIcon() {
122
- return q;
133
+ return ee;
123
134
  }, get ElButton() {
124
- return k;
125
- }, OperationLogForm: Y, OperationLogContent: G, OperationLogDialog: z, get dayjs() {
126
- return J;
135
+ return Z;
136
+ }, OperationLogForm: se, OperationLogContent: ae, OperationLogDialog: ie, get dayjs() {
137
+ return le;
127
138
  }, get M2() {
128
- return s;
129
- }, YaheeAnnexUpload: Q, get InfiniteLoading() {
130
- return W;
139
+ return a;
140
+ }, YaheeAnnexUpload: re, get InfiniteLoading() {
141
+ return ge;
131
142
  } };
132
- return Object.defineProperty(N, "__isScriptSetup", { enumerable: !1, value: !0 }), N;
143
+ return Object.defineProperty(B, "__isScriptSetup", { enumerable: !1, value: !0 }), B;
133
144
  }
134
145
  });
135
146
  export {
136
- be as default
147
+ Oe as default
137
148
  };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "yahee-components",
3
3
  "private": false,
4
- "version": "0.0.114",
4
+ "version": "0.0.115",
5
5
  "description": "深圳前海亚讯前端组件库",
6
6
  "main": "lib",
7
7
  "module": "es",
@@ -1,5 +1,5 @@
1
+ import { nextTick, DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, GlobalComponents, GlobalDirectives, ComponentInternalInstance, StyleValue, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, PropType, Ref, DebuggerEvent, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
1
2
  import { OperationLogProps } from './operation-log';
2
- import { DefineComponent, ComponentOptionsMixin, PublicProps, ComponentProvideOptions, CreateComponentPublicInstanceWithMixins, ExtractPropTypes, GlobalComponents, GlobalDirectives, ComponentInternalInstance, StyleValue, VNodeProps, AllowedComponentProps, ComponentCustomProps, Slot, ComponentPublicInstance, ComponentOptionsBase, PropType, Ref, DebuggerEvent, nextTick, WatchOptions, WatchStopHandle, ShallowUnwrapRef, ComponentCustomProperties } from 'vue';
3
3
  import { ScrollbarDirection } from 'element-plus';
4
4
  import { OnCleanup } from '@vue/reactivity';
5
5
  declare const _default: DefineComponent<OperationLogProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<OperationLogProps> & Readonly<{}>, {
@@ -247,7 +247,7 @@ declare const _default: DefineComponent<OperationLogProps, {}, {}, {}, {}, Compo
247
247
  errorCaptured?: ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void) | ((err: unknown, instance: ComponentPublicInstance | null, info: string) => boolean | void)[];
248
248
  };
249
249
  $forceUpdate: () => void;
250
- $nextTick: nextTick;
250
+ $nextTick: typeof nextTick;
251
251
  $watch<T extends string | ((...args: any) => any)>(source: T, cb: T extends (...args: any) => infer R ? (...args: [R, R, OnCleanup]) => any : (...args: [any, any, OnCleanup]) => any, options?: WatchOptions): WatchStopHandle;
252
252
  } & Readonly<{
253
253
  readonly height: string | number;