@jnrs/vue-core 1.2.13 → 1.2.15

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/README.md CHANGED
@@ -188,7 +188,7 @@ Vue 组件
188
188
  | 属性名 | 描述 | 类型 | 默认值 |
189
189
  |--------|------|------|--------|
190
190
  | importTemplateApi | 下载导入模板文件的 api 函数 | `() => Promise<Blob>` | — |
191
- | importApi | 数据导入 api 函数 | `(data: FormData) => Promise<IBusinessResponse>` | — |
191
+ | importApi | 数据导入 api 函数 | `(data: FormData) => Promise<IFullResponse>` | — |
192
192
  | importFieldName | 数据导入的字段名 | `string` | `'file'` |
193
193
  | importParams | 导入的参数 | `Record<string, unknown>` | — |
194
194
  | fileUploadConfig | 导入的文件上传配置 | `{ accept: string; limit: number }` | `{ accept: '.xls,.xlsx', limit: 1 }` |
@@ -1,12 +1,12 @@
1
1
  import { UploadRawFile, UploadFile, FormInstance } from 'element-plus';
2
2
  import { IAttachment } from '../types/base';
3
3
  import { nextTick } from 'vue';
4
- type MixedUploadFile = IAttachment | UploadRawFile | Blob;
4
+ export type MixedUploadFile = IAttachment | UploadRawFile | Blob;
5
5
  export interface Props {
6
6
  /**
7
7
  * 绑定的模型值(文件列表),默认为空数组
8
8
  */
9
- modelValue: MixedUploadFile[];
9
+ modelValue?: MixedUploadFile[];
10
10
  /**
11
11
  * 上传的文件字段名,默认为 'file'
12
12
  */
@@ -1,4 +1,4 @@
1
- import { IBusinessResponse } from '@jnrs/shared';
1
+ import { IFullResponse } from '@jnrs/shared';
2
2
  import { ElSize, ElButtonType } from '../types/base';
3
3
  import { nextTick } from 'vue';
4
4
  export interface Props {
@@ -9,7 +9,7 @@ export interface Props {
9
9
  /**
10
10
  * 数据导入 api 函数
11
11
  */
12
- importApi?: (data: FormData) => Promise<IBusinessResponse>;
12
+ importApi?: (data: FormData) => Promise<IFullResponse>;
13
13
  /**
14
14
  * 数据导入的字段名
15
15
  */
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".jn_globalSetting_header{margin-bottom:0;padding-bottom:20px}.jn_globalSetting_item[data-v-2b8b00a5]{margin-bottom:20px}.jn_imageView[data-v-1e2b2aae]{display:block;width:100%;height:100%}.jn_imageView .jn_imageView_error[data-v-1e2b2aae]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:.8em;line-height:1.1em;text-align:center;filter:opacity(.7)}.jn_image_view_icon[data-v-1e2b2aae]:hover{color:var(--jnrs-color-primary);transform:scale(1.2);transition:all .3s ease}.jn_fileView[data-v-a380f9e9]{display:block;width:100%;height:100%;line-height:1em;cursor:pointer}.jn_fileView:hover .jn_fileView_button[data-v-a380f9e9]{color:var(--jnrs-color-primary)}.jn_fileView .jn_fileView_fileName[data-v-a380f9e9]{font-size:.8em;color:var(--jnrs-font-primary-06);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.jn_fileView .jn_fileView_button[data-v-a380f9e9]{height:auto;padding:0;text-decoration:underline;font-size:.9em;transition:all .3s ease}.jn_fileUpload[data-v-7e67b4eb]{position:relative;width:100%;color:var(--jnrs-font-primary-06)}.jn_fileUpload[data-v-7e67b4eb] .el-upload-dragger{padding:30px 0 10px}.jn_fileUpload .jn_uploadTips[data-v-7e67b4eb]{display:block;width:100%;margin-top:5px;line-height:1.2em}.jn_fileUpload .jn_uploadTips span[data-v-7e67b4eb]{display:inline-block;margin-right:10px}.jn_fileUpload .jn_uploadTips b[data-v-7e67b4eb]{color:var(--el-color-danger, #ff3300)}.jn_fileUpload .jn_uploadTips_isDrag[data-v-7e67b4eb]{position:absolute;top:4px;left:0;text-align:center}.jn_fileUpload .jn_fileList[data-v-7e67b4eb]{width:100%}.jn_fileUpload .jn_fileList .jn_fileLis_item[data-v-7e67b4eb]{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:8px;padding:5px 0;border:1px solid var(--jnrs-font-primary-03);background:var(--jnrs-background-primary)}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_left[data-v-7e67b4eb]{flex:1;position:relative;display:flex;align-items:center;justify-content:flex-start;padding-right:50px;line-height:1.1em}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_right[data-v-7e67b4eb]{flex-shrink:0;width:60px;display:flex;align-items:center;justify-content:flex-end;padding-right:4px}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_index[data-v-7e67b4eb]{flex-shrink:0;width:20px;height:20px;line-height:20px;text-align:center}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_icon[data-v-7e67b4eb]{flex-shrink:0;width:20px;height:20px}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_name[data-v-7e67b4eb]{padding:0 4px;word-break:break-all}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_size[data-v-7e67b4eb]{position:absolute;right:0;width:50px;color:#999;white-space:nowrap;text-align:right}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn[data-v-7e67b4eb]{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:20px;height:20px;margin:0 2px;border-radius:3px;font-size:16px;color:var(--el-color-primary, #5887f7);transition:all .3s ease;cursor:pointer}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn[data-v-7e67b4eb]:hover{background-color:var(--jnrs-card-primary)}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn_danger[data-v-7e67b4eb]{color:var(--el-color-danger, #ff3300)}.jnImportAndExport_button.is-text[data-v-447ad008]{padding:0}.jnImportAndExport_underlineBtn[data-v-447ad008]{display:inline-block;margin-right:36px;color:#3697fc;text-decoration:underline;cursor:pointer}.jnImportAndExport_underlineBtn[data-v-447ad008]:hover{opacity:.8}.jn_table[data-v-1671453b]{width:100%}.jn_table[data-v-1671453b] .jn_table_header{color:var(--jnrs-font-primary)!important;background:var(--jnrs-background-head)!important}.jn_table[data-v-1671453b] .jn_table_header .cell{padding:0 8px;line-height:1.2em}.jn_selectTemplate[data-v-6ec9d84c]{display:flex;align-items:center;font-size:0}.jn_selectTemplate .jn_select[data-v-6ec9d84c]{flex:1;right:-1px;z-index:1}.jn_selectTemplate .jn_select[data-v-6ec9d84c] .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.jn_selectTemplate .jn_select_button[data-v-6ec9d84c]{border-radius:0 3px 3px 0}.jn_selectTemplate .jn_select_button[data-v-6ec9d84c]:hover{z-index:1}.t_select_button_only[data-v-6ec9d84c]{margin-left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.jn_dialog_header[data-v-6ec9d84c]{display:flex;align-items:center}[data-v-6ec9d84c] .el-input__validateIcon{display:none}[data-v-6ec9d84c] th .el-checkbox--small{display:none!important}[data-v-6ec9d84c] .el-table__row{cursor:pointer}.tableIsSingle[data-v-6ec9d84c] .el-checkbox__inner{border-radius:50%}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
1
+ (function(){"use strict";try{if(typeof document<"u"){var e=document.createElement("style");e.appendChild(document.createTextNode(".jn_globalSetting_header{margin-bottom:0;padding-bottom:20px}.jn_globalSetting_item[data-v-2b8b00a5]{margin-bottom:20px}.jn_imageView[data-v-1e2b2aae]{display:block;width:100%;height:100%}.jn_imageView .jn_imageView_error[data-v-1e2b2aae]{display:flex;align-items:center;justify-content:center;width:100%;height:100%;font-size:.8em;line-height:1.1em;text-align:center;filter:opacity(.7)}.jn_image_view_icon[data-v-1e2b2aae]:hover{color:var(--jnrs-color-primary);transform:scale(1.2);transition:all .3s ease}.jn_fileView[data-v-a380f9e9]{display:block;width:100%;height:100%;line-height:1em;cursor:pointer}.jn_fileView:hover .jn_fileView_button[data-v-a380f9e9]{color:var(--jnrs-color-primary)}.jn_fileView .jn_fileView_fileName[data-v-a380f9e9]{font-size:.8em;color:var(--jnrs-font-primary-06);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.jn_fileView .jn_fileView_button[data-v-a380f9e9]{height:auto;padding:0;text-decoration:underline;font-size:.9em;transition:all .3s ease}.jn_fileUpload[data-v-0d09f340]{position:relative;width:100%;color:var(--jnrs-font-primary-06)}.jn_fileUpload[data-v-0d09f340] .el-upload-dragger{padding:30px 0 10px}.jn_fileUpload .jn_uploadTips[data-v-0d09f340]{display:block;width:100%;margin-top:5px;line-height:1.2em}.jn_fileUpload .jn_uploadTips span[data-v-0d09f340]{display:inline-block;margin-right:10px}.jn_fileUpload .jn_uploadTips b[data-v-0d09f340]{color:var(--el-color-danger, #ff3300)}.jn_fileUpload .jn_uploadTips_isDrag[data-v-0d09f340]{position:absolute;top:4px;left:0;text-align:center}.jn_fileUpload .jn_fileList[data-v-0d09f340]{width:100%}.jn_fileUpload .jn_fileList .jn_fileLis_item[data-v-0d09f340]{display:flex;align-items:center;justify-content:space-between;width:100%;margin-top:8px;padding:5px 0;border:1px solid var(--jnrs-font-primary-03);background:var(--jnrs-background-primary)}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_left[data-v-0d09f340]{flex:1;position:relative;display:flex;align-items:center;justify-content:flex-start;padding-right:50px;line-height:1.1em}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_right[data-v-0d09f340]{flex-shrink:0;width:60px;display:flex;align-items:center;justify-content:flex-end;padding-right:4px}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_index[data-v-0d09f340]{flex-shrink:0;width:20px;height:20px;line-height:20px;text-align:center}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_icon[data-v-0d09f340]{flex-shrink:0;width:20px;height:20px}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_name[data-v-0d09f340]{padding:0 4px;word-break:break-all}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_size[data-v-0d09f340]{position:absolute;right:0;width:50px;color:#999;white-space:nowrap;text-align:right}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn[data-v-0d09f340]{flex-shrink:0;display:flex;align-items:center;justify-content:center;width:20px;height:20px;margin:0 2px;border-radius:3px;font-size:16px;color:var(--el-color-primary, #5887f7);transition:all .3s ease;cursor:pointer}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn[data-v-0d09f340]:hover{background-color:var(--jnrs-card-primary)}.jn_fileUpload .jn_fileList .jn_fileLis_item .fileLis_item_btn_danger[data-v-0d09f340]{color:var(--el-color-danger, #ff3300)}.jnImportAndExport_button.is-text[data-v-2c37f37f]{padding:0}.jnImportAndExport_underlineBtn[data-v-2c37f37f]{display:inline-block;margin-right:36px;color:#3697fc;text-decoration:underline;cursor:pointer}.jnImportAndExport_underlineBtn[data-v-2c37f37f]:hover{opacity:.8}.jn_table[data-v-1671453b]{width:100%}.jn_table[data-v-1671453b] .jn_table_header{color:var(--jnrs-font-primary)!important;background:var(--jnrs-background-head)!important}.jn_table[data-v-1671453b] .jn_table_header .cell{padding:0 8px;line-height:1.2em}.jn_selectTemplate[data-v-6ec9d84c]{display:flex;align-items:center;font-size:0}.jn_selectTemplate .jn_select[data-v-6ec9d84c]{flex:1;right:-1px;z-index:1}.jn_selectTemplate .jn_select[data-v-6ec9d84c] .el-select__wrapper{border-top-right-radius:0;border-bottom-right-radius:0}.jn_selectTemplate .jn_select_button[data-v-6ec9d84c]{border-radius:0 3px 3px 0}.jn_selectTemplate .jn_select_button[data-v-6ec9d84c]:hover{z-index:1}.t_select_button_only[data-v-6ec9d84c]{margin-left:0;border-top-left-radius:3px;border-bottom-left-radius:3px}.jn_dialog_header[data-v-6ec9d84c]{display:flex;align-items:center}[data-v-6ec9d84c] .el-input__validateIcon{display:none}[data-v-6ec9d84c] th .el-checkbox--small{display:none!important}[data-v-6ec9d84c] .el-table__row{cursor:pointer}.tableIsSingle[data-v-6ec9d84c] .el-checkbox__inner{border-radius:50%}")),document.head.appendChild(e)}}catch(i){console.error("vite-plugin-css-injected-by-js",i)}})();
2
2
  import { defineComponent as H, ref as B, createBlock as U, openBlock as h, unref as i, withCtx as f, createElementVNode as p, createVNode as v, toDisplayString as y, isRef as zt, createElementBlock as E, Fragment as X, renderList as ee, createTextVNode as D, computed as N, normalizeStyle as Ie, createCommentVNode as P, renderSlot as le, withDirectives as ke, normalizeClass as Pe, vShow as Vt, nextTick as te, withModifiers as Be, watch as Ae, onMounted as Ft, mergeProps as Xt } from "vue";
3
3
  import { storeToRefs as Ht } from "pinia";
4
4
  import { ElDrawer as xt, ElSwitch as Ot, ElRadioGroup as Ee, ElRadio as pe, ElImage as Kt, ElIcon as L, ElButton as V, ElDialog as mt, ElUpload as Mt, vLoading as De, ElMessage as G, ElForm as vt, ElFormItem as Rt, ElMessageBox as Ke, ElLoading as Qe, ElPagination as ht, ElTable as It, ElTableColumn as fe, ElSelect as Gt, ElOption as Nt, ElCheckbox as Jt } from "element-plus";
@@ -367,7 +367,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
367
367
  duration: 3e3
368
368
  }), !1;
369
369
  const Q = e.modelValue;
370
- Q.push(r.raw), a("update:modelValue", Q), te(() => {
370
+ Q?.push(r.raw), a("update:modelValue", Q), te(() => {
371
371
  e.formRef && e.validateFieldName && e.formRef.validateField(e.validateFieldName), s.value?.clearFiles(), n.value = !1;
372
372
  });
373
373
  }
@@ -376,13 +376,13 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
376
376
  }), g = (r) => {
377
377
  e.downloadFileFn?.(r);
378
378
  }, w = (r) => {
379
- const o = e.modelValue, A = e.modelValue.findIndex((Q) => {
379
+ const o = e.modelValue, A = e.modelValue?.findIndex((Q) => {
380
380
  if ("id" in r && "id" in Q)
381
381
  return Q.id === r.id;
382
382
  if ("uid" in r && "uid" in Q)
383
383
  return Q.uid === r.uid;
384
384
  });
385
- A !== -1 && o.splice(A, 1), a("update:modelValue", o), te(() => {
385
+ A !== void 0 && A !== -1 && o?.splice(A, 1), a("update:modelValue", o), te(() => {
386
386
  e.formRef && e.validateFieldName && e.formRef.validateField(e.validateFieldName);
387
387
  });
388
388
  };
@@ -506,7 +506,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
506
506
  ]) : P("", !0)
507
507
  ]));
508
508
  }
509
- }), dn = /* @__PURE__ */ Y(An, [["__scopeId", "data-v-7e67b4eb"]]), fn = /* @__PURE__ */ H({
509
+ }), dn = /* @__PURE__ */ Y(An, [["__scopeId", "data-v-0d09f340"]]), fn = /* @__PURE__ */ H({
510
510
  __name: "JnImportAndExport",
511
511
  props: {
512
512
  importTemplateApi: { type: Function },
@@ -724,7 +724,7 @@ const ga = { class: "jn_globalSetting_item" }, ma = { class: "jn_globalSetting_i
724
724
  ], 64)) : P("", !0)
725
725
  ], 64));
726
726
  }
727
- }), Pr = /* @__PURE__ */ Y(fn, [["__scopeId", "data-v-447ad008"]]), gn = { style: { opacity: "0.7", "font-size": "0.9em" } }, mn = { key: 1 }, Br = /* @__PURE__ */ H({
727
+ }), Pr = /* @__PURE__ */ Y(fn, [["__scopeId", "data-v-2c37f37f"]]), gn = { style: { opacity: "0.7", "font-size": "0.9em" } }, mn = { key: 1 }, Br = /* @__PURE__ */ H({
728
728
  __name: "JnDatetime",
729
729
  props: {
730
730
  value: { default: "" },
@@ -64,10 +64,10 @@ export declare function useWebSocket(options: UseWebSocketOptions): {
64
64
  onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
65
65
  onopen: ((this: WebSocket, ev: Event) => any) | null;
66
66
  readonly protocol: string;
67
- readonly readyState: number;
67
+ readonly readyState: 0 | 1 | 2 | 3;
68
68
  readonly url: string;
69
69
  close: (code?: number, reason?: string) => void;
70
- send: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => void;
70
+ send: (data: BufferSource | Blob | string) => void;
71
71
  readonly CONNECTING: 0;
72
72
  readonly OPEN: 1;
73
73
  readonly CLOSING: 2;
@@ -90,10 +90,10 @@ export declare function useWebSocket(options: UseWebSocketOptions): {
90
90
  onmessage: ((this: WebSocket, ev: MessageEvent) => any) | null;
91
91
  onopen: ((this: WebSocket, ev: Event) => any) | null;
92
92
  readonly protocol: string;
93
- readonly readyState: number;
93
+ readonly readyState: 0 | 1 | 2 | 3;
94
94
  readonly url: string;
95
95
  close: (code?: number, reason?: string) => void;
96
- send: (data: string | ArrayBufferLike | Blob | ArrayBufferView) => void;
96
+ send: (data: BufferSource | Blob | string) => void;
97
97
  readonly CONNECTING: 0;
98
98
  readonly OPEN: 1;
99
99
  readonly CLOSING: 2;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jnrs/vue-core",
3
- "version": "1.2.13",
3
+ "version": "1.2.15",
4
4
  "description": "巨能前端工程化开发,Vue 专用核心功能包。",
5
5
  "keywords": [
6
6
  "jnrs",
@@ -58,7 +58,7 @@
58
58
  "vue": "^3.5.22",
59
59
  "vue-i18n": "^11.2.8",
60
60
  "vue-router": "^4.5.1",
61
- "@jnrs/shared": "1.1.18"
61
+ "@jnrs/shared": "1.1.23"
62
62
  },
63
63
  "devDependencies": {
64
64
  "@vitejs/plugin-vue": "^6.0.1",