el-plus-crud 0.1.34 → 0.1.36

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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [0.1.36](https://github.com/KDJack/el-plus-crud/compare/v0.1.35...v0.1.36) (2024-04-26)
6
+
7
+ ### [0.1.35](https://github.com/KDJack/el-plus-crud/compare/v0.1.34...v0.1.35) (2024-04-23)
8
+
5
9
  ### [0.1.34](https://github.com/KDJack/el-plus-crud/compare/v0.1.33...v0.1.34) (2024-04-23)
6
10
 
7
11
  ### [0.1.33](https://github.com/KDJack/el-plus-crud/compare/v0.1.32...v0.1.33) (2024-04-23)
@@ -5991,7 +5991,7 @@ const pi = /* @__PURE__ */ lt(Kz, [["__scopeId", "data-v-45863775"]]), Hz = /* @
5991
5991
  }
5992
5992
  function L() {
5993
5993
  var b, E, C, U;
5994
- A.value = !0, (E = (b = c.desc) == null ? void 0 : b.on) != null && E.clear && typeof ((U = (C = c.desc) == null ? void 0 : C.on) == null ? void 0 : U.clear) == "function" && c.desc.on.clear(), d.value = null, M.splice(0, M.length);
5994
+ A.value = !0, (E = (b = c.desc) == null ? void 0 : b.on) != null && E.clear && typeof ((U = (C = c.desc) == null ? void 0 : C.on) == null ? void 0 : U.clear) == "function" && c.desc.on.clear(), d.value = null, c.desc.remote && M.splice(0, M.length);
5995
5995
  }
5996
5996
  return Qe(async () => {
5997
5997
  _.remote = !!c.desc.remote, p.value = await Fe(c, _), p.value.remote = !!c.desc.remote, delete p.value.disabled, v.value = !0;
@@ -7725,7 +7725,7 @@ const Fa = /* @__PURE__ */ lt(Bm, [["__scopeId", "data-v-fd8b68ee"]]), km = { cl
7725
7725
  ee.onload = function() {
7726
7726
  if (this.status == 200) {
7727
7727
  const R = document.createElement("a");
7728
- R.href = window.URL.createObjectURL(this.response), R.download = T + G, R.click(), window.URL.revokeObjectURL(q), setTimeout(() => {
7728
+ window.navigator.msSaveOrOpenBlob && typeof window.navigator.msSaveOrOpenBlob == "function" ? R.href = window.navigator.msSaveOrOpenBlob(this.response, T + G) : (R.href = window.URL.createObjectURL(this.response), R.download = T + G), R.click(), window.URL.revokeObjectURL(q), setTimeout(() => {
7729
7729
  L && L();
7730
7730
  }, 1e3);
7731
7731
  }
@@ -7889,7 +7889,7 @@ const Fa = /* @__PURE__ */ lt(Bm, [["__scopeId", "data-v-fd8b68ee"]]), km = { cl
7889
7889
  };
7890
7890
  }
7891
7891
  });
7892
- const Wm = /* @__PURE__ */ lt(Rm, [["__scopeId", "data-v-d54503c6"]]), Gm = /* @__PURE__ */ ce({
7892
+ const Wm = /* @__PURE__ */ lt(Rm, [["__scopeId", "data-v-5341de7d"]]), Gm = /* @__PURE__ */ ce({
7893
7893
  __name: "columnItem",
7894
7894
  props: {
7895
7895
  modelValue: {},
@@ -8049,6 +8049,7 @@ const Zm = /* @__PURE__ */ lt(Gm, [["__scopeId", "data-v-7550a821"]]), Km = {
8049
8049
  isIndex: { type: Boolean, default: !0 },
8050
8050
  isPager: { type: Boolean, default: !0 },
8051
8051
  pageSize: { default: 10 },
8052
+ pageSizes: {},
8052
8053
  isDialog: { type: Boolean, default: !1 },
8053
8054
  nullText: { default: "暂无数据" },
8054
8055
  isEmptyImg: { type: Boolean, default: !0 },
@@ -8435,11 +8436,11 @@ const Zm = /* @__PURE__ */ lt(Gm, [["__scopeId", "data-v-7550a821"]]), Km = {
8435
8436
  onSizeChange: gt,
8436
8437
  onCurrentChange: Ie,
8437
8438
  "current-page": +ye.current,
8438
- "page-sizes": [5, 10, 20, 50, 100],
8439
+ "page-sizes": O.pageSizes || [5, 10, 20, 50, 100],
8439
8440
  "page-size": ye.size,
8440
8441
  layout: "total, sizes, prev, pager, next, jumper",
8441
8442
  total: ye.total
8442
- }, null, 8, ["current-page", "page-size", "total"])
8443
+ }, null, 8, ["current-page", "page-sizes", "page-size", "total"])
8443
8444
  ])) : le("", !0),
8444
8445
  Ge(O.$slots, "bottom")
8445
8446
  ]);
@@ -135,7 +135,10 @@ function clear() {
135
135
  isClear.value = true
136
136
  props.desc?.on?.clear && typeof props.desc?.on?.clear === 'function' && props.desc.on.clear()
137
137
  oldQuery.value = null
138
- options.splice(0, options.length)
138
+ // 只有远程查询的才清空
139
+ if (props.desc.remote) {
140
+ options.splice(0, options.length)
141
+ }
139
142
  }
140
143
 
141
144
  onBeforeMount(async () => {
@@ -85,7 +85,7 @@
85
85
  </el-table>
86
86
  </div>
87
87
  <div class="bottom-page-static-info" v-if="isPager || tableConfig.statistic">
88
- <el-pagination class="page-info" small @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="+pageInfo.current" :page-sizes="[5, 10, 20, 50, 100]" :page-size="pageInfo.size" layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total" />
88
+ <el-pagination class="page-info" small @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="+pageInfo.current" :page-sizes="pageSizes || [5, 10, 20, 50, 100]" :page-size="pageInfo.size" layout="total, sizes, prev, pager, next, jumper" :total="pageInfo.total" />
89
89
  </div>
90
90
  <slot name="bottom"></slot>
91
91
  </div>
@@ -131,6 +131,8 @@ const props = withDefaults(
131
131
  isPager?: boolean
132
132
  // 每页显示条数
133
133
  pageSize?: number
134
+ // 分页选项
135
+ pageSizes?: number[]
134
136
  // 是否在弹框中
135
137
  isDialog?: boolean
136
138
  // 空占位文本
@@ -202,9 +202,13 @@ async function handelDownload({ callBack }: IBtnBack, index: number) {
202
202
  xhr.onload = function () {
203
203
  if (this.status == 200) {
204
204
  const aLink = document.createElement('a')
205
- aLink.href = window.URL.createObjectURL(this.response)
206
- // 自定义文件名
207
- aLink.download = fileName + suffix
205
+ // 优化下载兼容性
206
+ if ((window.navigator as any).msSaveOrOpenBlob && typeof (window.navigator as any).msSaveOrOpenBlob === 'function') {
207
+ aLink.href = (window.navigator as any).msSaveOrOpenBlob(this.response, fileName + suffix)
208
+ } else {
209
+ aLink.href = window.URL.createObjectURL(this.response)
210
+ aLink.download = fileName + suffix
211
+ }
208
212
  aLink.click()
209
213
  window.URL.revokeObjectURL(url)
210
214
  setTimeout(() => {
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "el-plus-crud",
3
3
  "description": "采用Vue3 + TS,封装的element-plus数据驱动表单、列表组件",
4
4
  "author": "K.D.Jack",
5
- "version": "0.1.34",
5
+ "version": "0.1.36",
6
6
  "license": "MIT",
7
7
  "private": false,
8
8
  "main": "dist/el-plus-crud.mjs",