zf-dbs 0.1.12 → 0.1.13

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,4 +1,4 @@
1
- import { defineComponent as j, useSlots as $, ref as B, onMounted as m, watch as N, onUnmounted as q, unref as v, openBlock as C, createElementBlock as z, normalizeClass as F, normalizeStyle as M, toDisplayString as P, createBlock as G, resolveDynamicComponent as L, withCtx as Q, renderSlot as O, normalizeProps as R, guardReactiveProps as W, createTextVNode as k, mergeProps as Z } from "vue";
1
+ import { defineComponent as j, useSlots as m, ref as $, onMounted as B, watch as N, onUnmounted as q, unref as v, openBlock as C, createElementBlock as z, normalizeClass as F, normalizeStyle as M, toDisplayString as P, createBlock as L, resolveDynamicComponent as G, withCtx as Q, renderSlot as O, normalizeProps as R, guardReactiveProps as W, createTextVNode as k, mergeProps as Z } from "vue";
2
2
  import { _ as H } from "./CHgC5LLL.mjs";
3
3
  var b = {
4
4
  Linear: {
@@ -357,7 +357,7 @@ const ne = /* @__PURE__ */ j({
357
357
  style: { default: "" }
358
358
  },
359
359
  setup(e) {
360
- const t = e, i = $(), n = B({
360
+ const t = e, i = m(), n = $({
361
361
  value: "",
362
362
  prefix: "",
363
363
  number: "",
@@ -413,8 +413,9 @@ const ne = /* @__PURE__ */ j({
413
413
  n.value.value = p.value, n.value.number = p.number, n.value.negativeFlag = !!p.negative, n.value.integer = p.integer, n.value.decimalFull = p.decimalFull, n.value.decimal = p.decimal, n.value.decimalDecimal = p.decimal.length;
414
414
  }).start(), h();
415
415
  }
416
- return m(() => {
417
- d(0, t.value);
416
+ return B(() => {
417
+ const o = s(t.value).decimal.length;
418
+ d(0 .toFixed(o), t.value);
418
419
  }), N(() => t.value, (o, f) => {
419
420
  f !== o && d(f, o);
420
421
  }), q(() => {
@@ -423,7 +424,7 @@ const ne = /* @__PURE__ */ j({
423
424
  key: 0,
424
425
  class: F(t.class),
425
426
  style: M(t.style)
426
- }, P(v(n).value), 7)) : t.tag ? (C(), G(L(t.tag), {
427
+ }, P(v(n).value), 7)) : t.tag ? (C(), L(G(t.tag), {
427
428
  key: 1,
428
429
  class: F(t.class),
429
430
  style: M(t.style)
@@ -438,7 +439,7 @@ const ne = /* @__PURE__ */ j({
438
439
  k(P(v(n).value), 1)
439
440
  ], !0);
440
441
  }
441
- }), D = /* @__PURE__ */ H(ne, [["__scopeId", "data-v-3243bcbd"]]), ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
442
+ }), D = /* @__PURE__ */ H(ne, [["__scopeId", "data-v-27baf3ce"]]), ae = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
442
443
  __proto__: null,
443
444
  ZfTweenNumber: D,
444
445
  default: D
@@ -1,8 +1,8 @@
1
- import { ref as v, defineComponent as z, reactive as S, computed as q, provide as C, unref as i, openBlock as c, createElementBlock as u, createVNode as y, withCtx as b, createElementVNode as l, renderSlot as f, normalizeStyle as k } from "vue";
2
- import { Z as H } from "./zkyql-F5.mjs";
3
- import { _ as W } from "./CHgC5LLL.mjs";
1
+ import { ref as v, defineComponent as S, reactive as z, computed as C, provide as b, unref as i, openBlock as c, createElementBlock as l, createVNode as y, withCtx as W, createElementVNode as u, renderSlot as f, normalizeStyle as H } from "vue";
2
+ import { Z as k } from "./zkyql-F5.mjs";
3
+ import { _ as E } from "./CHgC5LLL.mjs";
4
4
  const a = v(null);
5
- function j(o) {
5
+ function O(o) {
6
6
  return a.value = Object.assign({
7
7
  appTitle: "zf-dbs template",
8
8
  appHeight: 1080,
@@ -11,34 +11,34 @@ function j(o) {
11
11
  useScale: !0,
12
12
  useStretch: !1,
13
13
  useUE: !1,
14
+ sign: void 0,
14
15
  pollingInterval: 1e3 * 60 * 5,
15
- requestBaseURL: "",
16
- requestUseMock: !1,
17
- requestFormatCodeKey: "code",
18
- requestFormatMessageKey: "message",
19
- requestFormatDataKey: "data",
20
- requestSuccessCode: [200, "200"],
21
- requestErrorAuthCode: [],
22
- requestErrorAuthHandle: void 0,
23
- requestErrorIgnoreMessageCode: [],
24
- requestTokenCacheKey: "token",
25
- requestTokenHeaderKey: "Authorization",
26
- requestAutoGetTokenHandle: () => !1,
27
- sign: void 0
16
+ request: {
17
+ baseURL: "",
18
+ formatCodeKey: "",
19
+ formatMessageKey: "",
20
+ formatDataKey: "",
21
+ checkSuccessCode: [200],
22
+ errorAuthCode: [401],
23
+ errorAuthHandle: void 0,
24
+ showErrorMessage: !0,
25
+ errorIgnoreMessageCode: [],
26
+ handleToken: void 0
27
+ }
28
28
  }, o), a;
29
29
  }
30
- function E() {
30
+ function M() {
31
31
  if (!a.value)
32
32
  throw new Error("请先调用 defineConfig 进行配置");
33
33
  return a;
34
34
  }
35
- const A = {
35
+ const x = {
36
36
  key: 0,
37
37
  class: "app"
38
- }, M = { class: "app__view" }, T = { class: "app__view" }, F = /* @__PURE__ */ z({
38
+ }, A = { class: "app__view" }, R = { class: "app__view" }, T = /* @__PURE__ */ S({
39
39
  __name: "zf-app",
40
40
  setup(o) {
41
- const e = E(), n = S({
41
+ const e = M(), n = z({
42
42
  width: window.innerWidth,
43
43
  height: window.innerHeight
44
44
  });
@@ -52,45 +52,45 @@ const A = {
52
52
  return Math.abs(m - p) < Math.abs(w - p) ? h : d;
53
53
  });
54
54
  }
55
- const r = q(() => {
55
+ const r = C(() => {
56
56
  const t = [
57
57
  ...e.value.appWidths?.map((s) => ({ width: s, height: e.value.appHeight })) ?? [],
58
58
  { width: e.value.appWidth, height: e.value.appHeight }
59
59
  ];
60
60
  return _(n, t);
61
61
  });
62
- return C("pageSize", r), (t, s) => i(e).useScale ? (c(), u("div", A, [
63
- y(i(H), {
62
+ return b("pageSize", r), (t, s) => i(e).useScale ? (c(), l("div", x, [
63
+ y(i(k), {
64
64
  width: i(r).width,
65
65
  height: i(r).height,
66
66
  mode: i(e).useStretch ? "scaleToFill" : "aspectFit"
67
67
  }, {
68
- default: b(() => [
69
- l("div", M, [
68
+ default: W(() => [
69
+ u("div", A, [
70
70
  f(t.$slots, "default", {}, void 0, !0)
71
71
  ])
72
72
  ]),
73
73
  _: 3
74
74
  }, 8, ["width", "height", "mode"])
75
- ])) : (c(), u("div", {
75
+ ])) : (c(), l("div", {
76
76
  key: 1,
77
77
  class: "app",
78
- style: k({ width: `${i(e).appWidth}px`, height: `${i(e).appHeight}px` })
78
+ style: H({ width: `${i(e).appWidth}px`, height: `${i(e).appHeight}px` })
79
79
  }, [
80
- l("div", T, [
80
+ u("div", R, [
81
81
  f(t.$slots, "default", {}, void 0, !0)
82
82
  ])
83
83
  ], 4));
84
84
  }
85
- }), g = /* @__PURE__ */ W(F, [["__scopeId", "data-v-29b93127"]]), B = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
85
+ }), g = /* @__PURE__ */ E(T, [["__scopeId", "data-v-29b93127"]]), Z = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
86
86
  __proto__: null,
87
87
  ZfApp: g,
88
88
  default: g
89
89
  }, Symbol.toStringTag, { value: "Module" }));
90
90
  export {
91
- B as _,
91
+ Z as _,
92
92
  a as c,
93
- j as d,
94
- E as u,
93
+ O as d,
94
+ M as u,
95
95
  g as z
96
96
  };
@@ -1,4 +1,4 @@
1
- import { z as p, z as e } from "../chunks/OYzm_MFq.mjs";
1
+ import { z as p, z as e } from "../chunks/D91KXUFh.mjs";
2
2
  export {
3
3
  p as ZfApp,
4
4
  e as default
@@ -1,4 +1,4 @@
1
- import { z as f, z as r } from "../chunks/slXKdM5n.mjs";
1
+ import { z as f, z as r } from "../chunks/BHHE86vT.mjs";
2
2
  export {
3
3
  f as ZfTweenNumber,
4
4
  r as default
package/dist/index.d.ts CHANGED
@@ -4,15 +4,12 @@ import { AxiosRequestConfig } from 'axios';
4
4
  import { ComponentOptionsMixin } from 'vue';
5
5
  import type { ComputedRef as ComputedRef_2 } from 'vue';
6
6
  import { DefineComponent } from 'vue';
7
- import type { DefineRequestGetOptions } from './type';
8
- import type { DefineRequestOptions } from './type';
7
+ import type { DefineRequestOptions } from './define-request';
9
8
  import { EventListener as EventListener_2 } from 'zf-utilz';
10
9
  import { PropType as PropType_2 } from 'vue';
11
10
  import { PublicProps } from 'vue';
12
11
  import type { Ref as Ref_2 } from 'vue';
13
- import type { RequestError } from './type';
14
- import type { RequestInstance } from './type';
15
- import type { RequestResult } from './type';
12
+ import type { RequestResult } from './define-request';
16
13
  import type { UnwrapNestedRefs } from 'vue';
17
14
 
18
15
  declare type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
@@ -90,42 +87,12 @@ declare type Config = {
90
87
  useStretch: boolean;
91
88
  /** 是否嵌入到 UE 中 */
92
89
  useUE: boolean;
93
- /** 轮询间隔 */
94
- pollingInterval: number;
95
- /** API 请求接口基础路径 */
96
- requestBaseURL: string;
97
- /** API 请求是否启用 Mock */
98
- requestUseMock: boolean;
99
- /** API 请求格式 Code Key */
100
- requestFormatCodeKey: string;
101
- /** API 请求格式提示消息 Key */
102
- requestFormatMessageKey: string;
103
- /** API 请求格式数据 Key */
104
- requestFormatDataKey: string;
105
- /** API 请求成功 Code */
106
- requestSuccessCode: string | number | (string | number)[];
107
- /** API 请求认证失败需要鉴权 Code */
108
- requestErrorAuthCode: string | number | (string | number)[];
109
- /** API 请求认证失败处理方法 */
110
- requestErrorAuthHandle?: (error: RequestError) => void;
111
- /** API 请求错误忽略提示消息 Code */
112
- requestErrorIgnoreMessageCode: string | number | (string | number)[];
113
- /** API 请求错误消息翻译 */
114
- requestErrorMessageTranslation?: Record<string, string>;
115
- /** API Token 存储 Key */
116
- requestTokenCacheKey: string;
117
- /** API 请求 Header Token Key */
118
- requestTokenHeaderKey: string;
119
- /** API Token 获取方法自动处理 */
120
- requestAutoGetTokenHandle?: () => ({
121
- token: string;
122
- expires: number;
123
- } | Promise<{
124
- token: string;
125
- expires: number;
126
- }>);
127
90
  /** 配置签名 */
128
91
  sign?: string;
92
+ /** 轮询间隔 */
93
+ pollingInterval: number;
94
+ /** 接口请求 */
95
+ request: DefineRequestOptions;
129
96
  /** 其他配置 */
130
97
  [key: string]: any;
131
98
  };
@@ -137,8 +104,6 @@ export default _default;
137
104
 
138
105
  export declare function defineConfig(value: Partial<Config>): globalThis.Ref<Config>;
139
106
 
140
- export declare function defineRequest(options: DefineRequestOptions | DefineRequestGetOptions): RequestInstance;
141
-
142
107
  declare type DefineService = <Params = undefined, Result = RequestResult>(handle: Service<Params, Result>) => Service<Params, Result>;
143
108
 
144
109
  export declare const defineService: DefineService;
@@ -155,27 +120,9 @@ export declare function getConfig(): {
155
120
  useScale: boolean;
156
121
  useStretch: boolean;
157
122
  useUE: boolean;
158
- pollingInterval: number;
159
- requestBaseURL: string;
160
- requestUseMock: boolean;
161
- requestFormatCodeKey: string;
162
- requestFormatMessageKey: string;
163
- requestFormatDataKey: string;
164
- requestSuccessCode: string | number | (string | number)[];
165
- requestErrorAuthCode: string | number | (string | number)[];
166
- requestErrorAuthHandle?: ((error: RequestError) => void) | undefined;
167
- requestErrorIgnoreMessageCode: string | number | (string | number)[];
168
- requestErrorMessageTranslation?: Record<string, string> | undefined;
169
- requestTokenCacheKey: string;
170
- requestTokenHeaderKey: string;
171
- requestAutoGetTokenHandle?: (() => {
172
- token: string;
173
- expires: number;
174
- } | Promise<{
175
- token: string;
176
- expires: number;
177
- }>) | undefined;
178
123
  sign?: string | undefined;
124
+ pollingInterval: number;
125
+ request: any;
179
126
  };
180
127
 
181
128
  declare class Polling<T = any> {
@@ -193,7 +140,7 @@ declare class Polling<T = any> {
193
140
  stop(): void;
194
141
  }
195
142
 
196
- export declare const request: Omit<AxiosInstance, "request" | "get" | "delete" | "head" | "post" | "put" | "patch"> & {
143
+ export declare const request: Omit<AxiosInstance, "request" | "delete" | "get" | "head" | "post" | "put" | "patch"> & {
197
144
  <T = string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | (string | number | boolean | any | {
198
145
  [key: string]: string | number | boolean | any | any | null | undefined;
199
146
  } | null | undefined)[] | {