htui-yllkbz 1.5.35 → 1.5.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.
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "htui-yllkbz",
3
- "version": "1.5.35",
3
+ "version": "1.5.36",
4
4
  "port": "8082",
5
5
  "typings": "types/index.d.ts",
6
6
  "main": "lib/htui.common.js",
@@ -4,10 +4,11 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-09-02 09:03:43
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2023-04-26 10:20:37
7
+ * @LastEditTime: 2024-11-13 14:29:20
8
8
  -->
9
9
  <template>
10
- <span @click="exportExcel" v-loading="state.loading">
10
+ <span @click="exportExcel"
11
+ v-loading="state.loading">
11
12
  <slot :loading="state.loading">
12
13
  <el-button type="primary">
13
14
  导出Excel
@@ -16,9 +17,10 @@
16
17
  </span>
17
18
  </template>
18
19
  <script lang="ts">
19
- import { Component, Prop, Vue, Watch } from 'vue-property-decorator';
20
- import { AxiosRequestConfig, Method } from 'axios';
21
- import { _axios } from 'vue-kst-auth';
20
+ import { Component, Prop, Vue, Watch } from "vue-property-decorator";
21
+ import { AxiosRequestConfig, Method } from "axios";
22
+ import { _axios } from "vue-kst-auth";
23
+ _axios.defaults.timeout = 0;
22
24
  /** 设置axios返回类型 */
23
25
  Vue.config.productionTip = false;
24
26
  interface State {
@@ -27,7 +29,7 @@ interface State {
27
29
  canExport?: boolean;
28
30
  }
29
31
  @Component({
30
- name: 'HtExport',
32
+ name: "HtExport",
31
33
  })
32
34
  export default class HtExport extends Vue {
33
35
  /** 请求方式 */
@@ -50,9 +52,9 @@ export default class HtExport extends Vue {
50
52
  /** 方法 */
51
53
  /** 手动导出 */
52
54
  handelExport(params?: object) {
53
- let fileName = this.fileName || '未知文件名.xlsx';
55
+ let fileName = this.fileName || "未知文件名.xlsx";
54
56
  let config: AxiosRequestConfig = {
55
- responseType: 'blob',
57
+ responseType: "blob",
56
58
  params: {},
57
59
  };
58
60
  if (this.params) {
@@ -63,28 +65,28 @@ export default class HtExport extends Vue {
63
65
  config = params;
64
66
  }
65
67
  if (this.url) {
66
- if (this.method === 'post') {
68
+ if (this.method === "post") {
67
69
  this.state.loading = true;
68
70
  _axios
69
- .post(this.url, config, { responseType: 'blob' })
71
+ .post(this.url, config, { responseType: "blob" })
70
72
  .then((res) => {
71
73
  const content = res.data;
72
74
  if (!this.fileName) {
73
- const headers = res.headers['content-disposition'];
75
+ const headers = res.headers["content-disposition"];
74
76
  if (!headers) {
75
- this.$notify.warning('暂无数据导出');
77
+ this.$notify.warning("暂无数据导出");
76
78
  return;
77
79
  }
78
80
  fileName = decodeURIComponent(
79
- headers.split('filename*=UTF-8')[1]
80
- ).replace("''", '');
81
+ headers.split("filename*=UTF-8")[1]
82
+ ).replace("''", "");
81
83
  }
82
84
  const blob = new Blob([content as any]);
83
- if ('download' in document.createElement('a')) {
85
+ if ("download" in document.createElement("a")) {
84
86
  // 非IE下载
85
- const elink = document.createElement('a');
87
+ const elink = document.createElement("a");
86
88
  elink.download = fileName;
87
- elink.style.display = 'none';
89
+ elink.style.display = "none";
88
90
  elink.href = URL.createObjectURL(blob);
89
91
  document.body.appendChild(elink);
90
92
  elink.click();
@@ -101,21 +103,21 @@ export default class HtExport extends Vue {
101
103
  } else {
102
104
  this.state.loading = true;
103
105
  _axios
104
- .get(this.url, { responseType: 'blob', params: config })
106
+ .get(this.url, { responseType: "blob", params: config })
105
107
  .then((res) => {
106
108
  const content = res.data;
107
109
  if (!this.fileName) {
108
- const headers = res.headers['content-disposition'];
110
+ const headers = res.headers["content-disposition"];
109
111
  fileName = decodeURIComponent(
110
- headers.split('filename*=UTF-8')[1]
111
- ).replace("''", '');
112
+ headers.split("filename*=UTF-8")[1]
113
+ ).replace("''", "");
112
114
  }
113
115
  const blob = new Blob([content as any]);
114
- if ('download' in document.createElement('a')) {
116
+ if ("download" in document.createElement("a")) {
115
117
  // 非IE下载
116
- const elink = document.createElement('a');
118
+ const elink = document.createElement("a");
117
119
  elink.download = fileName;
118
- elink.style.display = 'none';
120
+ elink.style.display = "none";
119
121
  elink.href = URL.createObjectURL(blob);
120
122
  document.body.appendChild(elink);
121
123
  elink.click();
@@ -141,7 +143,7 @@ export default class HtExport extends Vue {
141
143
  }
142
144
  }
143
145
  /** 监听 */
144
- @Watch('exportBefore', { immediate: true })
146
+ @Watch("exportBefore", { immediate: true })
145
147
  getExportBefore(canExport?: boolean) {
146
148
  this.state.canExport = canExport;
147
149
  }
@@ -4,7 +4,7 @@
4
4
  * @Author: hutao
5
5
  * @Date: 2021-11-15 14:41:40
6
6
  * @LastEditors: hutao
7
- * @LastEditTime: 2024-10-22 11:24:18
7
+ * @LastEditTime: 2024-10-22 17:11:12
8
8
  -->
9
9
  <template>
10
10
  <div>
@@ -41,7 +41,7 @@
41
41
  :showFilter="true"
42
42
  :uuId="'dhjsgdshg8989353334'"
43
43
  :configShow="true"
44
- :checked="false"
44
+ :checked="true"
45
45
  :isExpand="false"
46
46
  :height="500"
47
47
  :columns="state.columns">