htui-yllkbz 1.5.35 → 1.5.37
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/lib/htui.common.js +136 -109
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +136 -109
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +12 -12
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +57 -57
- package/src/App.vue +7 -8
- package/src/packages/HtBaseData/index.vue +155 -264
- package/src/packages/HtExport/index.vue +27 -25
- package/src/packages/HtSelectBaseData/index.vue +10 -37
- package/src/packages/HtSelectUser/index.vue +10 -21
- package/src/packages/HtShowBaseData/index.vue +29 -19
- package/src/views/About.vue +2 -2
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-09-02 09:03:43
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2024-11-13 14:29:20
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
|
-
<span @click="exportExcel"
|
|
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
|
|
20
|
-
import { AxiosRequestConfig, Method } from
|
|
21
|
-
import { _axios } from
|
|
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:
|
|
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 ||
|
|
55
|
+
let fileName = this.fileName || "未知文件名.xlsx";
|
|
54
56
|
let config: AxiosRequestConfig = {
|
|
55
|
-
responseType:
|
|
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 ===
|
|
68
|
+
if (this.method === "post") {
|
|
67
69
|
this.state.loading = true;
|
|
68
70
|
_axios
|
|
69
|
-
.post(this.url, config, { responseType:
|
|
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[
|
|
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(
|
|
80
|
-
).replace("''",
|
|
81
|
+
headers.split("filename*=UTF-8")[1]
|
|
82
|
+
).replace("''", "");
|
|
81
83
|
}
|
|
82
84
|
const blob = new Blob([content as any]);
|
|
83
|
-
if (
|
|
85
|
+
if ("download" in document.createElement("a")) {
|
|
84
86
|
// 非IE下载
|
|
85
|
-
const elink = document.createElement(
|
|
87
|
+
const elink = document.createElement("a");
|
|
86
88
|
elink.download = fileName;
|
|
87
|
-
elink.style.display =
|
|
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:
|
|
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[
|
|
110
|
+
const headers = res.headers["content-disposition"];
|
|
109
111
|
fileName = decodeURIComponent(
|
|
110
|
-
headers.split(
|
|
111
|
-
).replace("''",
|
|
112
|
+
headers.split("filename*=UTF-8")[1]
|
|
113
|
+
).replace("''", "");
|
|
112
114
|
}
|
|
113
115
|
const blob = new Blob([content as any]);
|
|
114
|
-
if (
|
|
116
|
+
if ("download" in document.createElement("a")) {
|
|
115
117
|
// 非IE下载
|
|
116
|
-
const elink = document.createElement(
|
|
118
|
+
const elink = document.createElement("a");
|
|
117
119
|
elink.download = fileName;
|
|
118
|
-
elink.style.display =
|
|
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(
|
|
146
|
+
@Watch("exportBefore", { immediate: true })
|
|
145
147
|
getExportBefore(canExport?: boolean) {
|
|
146
148
|
this.state.canExport = canExport;
|
|
147
149
|
}
|
|
@@ -10,45 +10,17 @@
|
|
|
10
10
|
<template>
|
|
11
11
|
<div>
|
|
12
12
|
<template v-if="!readonly">
|
|
13
|
-
<el-select
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
></el-select>
|
|
20
|
-
<HtBaseData
|
|
21
|
-
v-else
|
|
22
|
-
:org="org"
|
|
23
|
-
ref="htBaseData"
|
|
24
|
-
:size="size"
|
|
25
|
-
:appendToBody="appendToBody"
|
|
26
|
-
:only-parent="onlyParent"
|
|
27
|
-
:parent-id="parentId"
|
|
28
|
-
:placeholder="placeholder"
|
|
29
|
-
:hide-code="hideCode"
|
|
30
|
-
:disabled="disabled"
|
|
31
|
-
:com-class="
|
|
32
|
-
heightAuto
|
|
33
|
-
? 'component-item-heightAuto ht-item-common'
|
|
34
|
-
: 'component-item-height ht-item-common'
|
|
35
|
-
"
|
|
36
|
-
com-style="background:#fff"
|
|
37
|
-
:config-json="configJson"
|
|
38
|
-
@change="getCommonData"
|
|
39
|
-
></HtBaseData>
|
|
13
|
+
<el-select value="" v-if="!dataTypeId" :disabled="disabled" style="width:100%" placeholder="请选择"></el-select>
|
|
14
|
+
<HtBaseData v-else :org="org" ref="htBaseData" :size="size" :appendToBody="appendToBody" :only-parent="onlyParent"
|
|
15
|
+
:parent-id="parentId" :placeholder="placeholder" :hide-code="hideCode" :disabled="disabled" :com-class="heightAuto
|
|
16
|
+
? 'component-item-heightAuto ht-item-common'
|
|
17
|
+
: 'component-item-height ht-item-common'
|
|
18
|
+
" com-style="background:#fff" :config-json="configJson" @change="getCommonData"></HtBaseData>
|
|
40
19
|
</template>
|
|
41
20
|
<div v-else>
|
|
42
|
-
<HtShowBaseData
|
|
43
|
-
:
|
|
44
|
-
:
|
|
45
|
-
:show-all-level="showAllLevels"
|
|
46
|
-
:base-data-id="!byCode ? value : undefined"
|
|
47
|
-
:base-data-value="byCode ? value : undefined"
|
|
48
|
-
:base-data-info="true"
|
|
49
|
-
com-style="font-size:12px"
|
|
50
|
-
style="font-size:12px"
|
|
51
|
-
>
|
|
21
|
+
<HtShowBaseData :hide-code="hideCode" :dataTypeId="dataTypeId" :isTag="isTag" :show-all-level="showAllLevels"
|
|
22
|
+
:base-data-id="!byCode ? value : undefined" :base-data-value="byCode ? value : undefined" :base-data-info="true"
|
|
23
|
+
com-style="font-size:12px" style="font-size:12px">
|
|
52
24
|
</HtShowBaseData>
|
|
53
25
|
|
|
54
26
|
<!-- <div is='common-datas-info-id'
|
|
@@ -79,6 +51,7 @@ interface State {
|
|
|
79
51
|
export default class HtSelectBaseData extends Vue {
|
|
80
52
|
@Prop() value!: string;
|
|
81
53
|
@Prop() org?: string;
|
|
54
|
+
@Prop() isTag?: boolean;
|
|
82
55
|
@Prop() size?: string;
|
|
83
56
|
@Prop() heightAuto?: string;
|
|
84
57
|
@Prop() placeholder?: string;
|
|
@@ -4,31 +4,19 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-12-30 14:29:14
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2024-
|
|
7
|
+
* @LastEditTime: 2024-12-17 17:39:06
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<span v-if="readonly">
|
|
11
|
-
<HtShowBaseData v-if="value"
|
|
12
|
-
:user-id="userId"
|
|
13
|
-
:org="org"></HtShowBaseData>
|
|
11
|
+
<HtShowBaseData :isTag="isTag" v-if="value" :user-id="userId" :org="org"></HtShowBaseData>
|
|
14
12
|
<span v-else> </span>
|
|
15
13
|
</span>
|
|
16
|
-
<HtBaseData v-else
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
com-style="background:#fff"
|
|
23
|
-
:showLocked="showLocked"
|
|
24
|
-
:appendToBody="appendToBody"
|
|
25
|
-
:config-json="configJson"
|
|
26
|
-
:com-class="
|
|
27
|
-
heightAuto
|
|
28
|
-
? 'component-item-heightAuto ht-item-common'
|
|
29
|
-
: 'component-item-height ht-item-common'
|
|
30
|
-
"
|
|
31
|
-
@change="searchCommonData"></HtBaseData>
|
|
14
|
+
<HtBaseData v-else :size="size" :org="org" ref="htBaseData" :placeholder="placeholder" :disabled="disabled"
|
|
15
|
+
com-style="background:#fff" :showLocked="showLocked" :appendToBody="appendToBody" :config-json="configJson"
|
|
16
|
+
:com-class="heightAuto
|
|
17
|
+
? 'component-item-heightAuto ht-item-common'
|
|
18
|
+
: 'component-item-height ht-item-common'
|
|
19
|
+
" @change="searchCommonData"></HtBaseData>
|
|
32
20
|
</template>
|
|
33
21
|
<script lang="ts">
|
|
34
22
|
import { Component, Prop, Vue } from "vue-property-decorator";
|
|
@@ -54,7 +42,8 @@ export default class HtSelectUser extends Vue {
|
|
|
54
42
|
@Prop() disabled?: boolean;
|
|
55
43
|
@Prop() heightAuto?: boolean;
|
|
56
44
|
@Prop() placeholder?: string;
|
|
57
|
-
|
|
45
|
+
/** 是否已tag形式展示 */
|
|
46
|
+
@Prop() isTag?: boolean;
|
|
58
47
|
/** 是否可以清除 */
|
|
59
48
|
@Prop() clearable?: boolean;
|
|
60
49
|
@Prop({ default: true }) show?: boolean;
|
|
@@ -8,32 +8,42 @@
|
|
|
8
8
|
</template>
|
|
9
9
|
<!-- 部门 -->
|
|
10
10
|
<template v-if="departmentId">
|
|
11
|
-
<span class="item"
|
|
12
|
-
v-for="item in departmentData"
|
|
13
|
-
:key="item">
|
|
11
|
+
<span class="item" v-for="item in departmentData" :key="item">
|
|
14
12
|
{{ getorgById(item).displayName || empty }}
|
|
15
13
|
</span>
|
|
16
14
|
</template>
|
|
17
15
|
<!-- 用户 -->
|
|
18
|
-
<template v-if="userId">
|
|
19
|
-
<span class="item"
|
|
20
|
-
v-for="item in userData"
|
|
21
|
-
:key="item.id">
|
|
16
|
+
<!-- <template v-if="userId">
|
|
17
|
+
<span class="item" v-for="item in userData" :key="item.id">
|
|
22
18
|
{{ item.value || empty }}
|
|
23
19
|
</span>
|
|
20
|
+
</template> -->
|
|
21
|
+
<!-- 用户 -->
|
|
22
|
+
<template v-if="userId && !isTag">
|
|
23
|
+
|
|
24
|
+
<span class="item ht-show-user ht-show-user-span" v-for="(item, key) in userData" :key="item.id">
|
|
25
|
+
<span>{{ item.value || empty }}</span>
|
|
26
|
+
<span v-show="userData.length - 1 !== key">,</span>
|
|
27
|
+
</span>
|
|
28
|
+
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<template v-if="userId && isTag">
|
|
32
|
+
<div class="ht-show-user ht-show-user-tags">
|
|
33
|
+
<el-tag :size="'mini'" style="margin:0 4px 0 0" type="primary" v-for="(item) in userData" :key="item.id">{{
|
|
34
|
+
item.value || empty
|
|
35
|
+
}}</el-tag>
|
|
36
|
+
</div>
|
|
24
37
|
</template>
|
|
25
38
|
<!-- 角色 -->
|
|
26
39
|
<template v-if="roleId">
|
|
27
|
-
<span class="item"
|
|
28
|
-
v-for="item in roleData"
|
|
29
|
-
:key="item.id">
|
|
40
|
+
<span class="item" v-for="item in roleData" :key="item.id">
|
|
30
41
|
{{ item.name || empty }}
|
|
31
42
|
</span>
|
|
32
43
|
</template>
|
|
33
44
|
<!-- 基础数据,以id查找 -->
|
|
34
45
|
<template v-if="baseDataId !== undefined && baseDataId !== null">
|
|
35
|
-
<span class="item"
|
|
36
|
-
v-if="baseDataItem[baseDataId]">
|
|
46
|
+
<span class="item" v-if="baseDataItem[baseDataId]">
|
|
37
47
|
<!-- {{ baseDataItem[baseDataId].name || empty }}
|
|
38
48
|
<span v-if="baseDataInfo&&!hideCode">
|
|
39
49
|
({{ baseDataItem[baseDataId].value || empty }})
|
|
@@ -44,15 +54,13 @@
|
|
|
44
54
|
</template>
|
|
45
55
|
<!-- 基础数据,以value查找 -->
|
|
46
56
|
<template v-if="baseDataValue">
|
|
47
|
-
<span class="item"
|
|
48
|
-
v-if="dataTypeId && baseDataItem[`${dataTypeId}_${baseDataValue}`]">
|
|
57
|
+
<span class="item" v-if="dataTypeId && baseDataItem[`${dataTypeId}_${baseDataValue}`]">
|
|
49
58
|
{{ baseDataItem[`${dataTypeId}_${baseDataValue}`].name || empty }}
|
|
50
59
|
<!-- <span v-if="baseDataInfo && !hideCode">
|
|
51
60
|
({{ baseDataItem[baseDataValue].value || empty }})
|
|
52
61
|
</span> -->
|
|
53
62
|
</span>
|
|
54
|
-
<span class="item"
|
|
55
|
-
v-else-if="baseDataItem[baseDataValue]">
|
|
63
|
+
<span class="item" v-else-if="baseDataItem[baseDataValue]">
|
|
56
64
|
{{ baseDataItem[baseDataValue].name || empty }}
|
|
57
65
|
<span v-if="baseDataInfo && !hideCode">
|
|
58
66
|
({{ baseDataItem[baseDataValue].value || empty }})
|
|
@@ -62,8 +70,7 @@
|
|
|
62
70
|
</template>
|
|
63
71
|
<!-- 基础数据,以namg查找 -->
|
|
64
72
|
<template v-if="baseDataName">
|
|
65
|
-
<span class="item"
|
|
66
|
-
v-if="baseDataItem[baseDataName]">
|
|
73
|
+
<span class="item" v-if="baseDataItem[baseDataName]">
|
|
67
74
|
{{ baseDataItem[baseDataName].name || empty }}
|
|
68
75
|
<span v-if="baseDataInfo && !hideCode">
|
|
69
76
|
({{ baseDataItem[baseDataName].value || empty }})
|
|
@@ -143,6 +150,8 @@ export default class CommonDatas extends Vue {
|
|
|
143
150
|
@Prop() showAllLevel?: boolean;
|
|
144
151
|
/** 隐藏编码 */
|
|
145
152
|
@Prop() hideCode?: boolean;
|
|
153
|
+
/** 是否已tag形式展示 */
|
|
154
|
+
@Prop() isTag?: boolean;
|
|
146
155
|
/** 显示角色信息 */
|
|
147
156
|
@Prop() roleId?: string;
|
|
148
157
|
/** 显示部门信息 */
|
|
@@ -341,8 +350,9 @@ export default class CommonDatas extends Vue {
|
|
|
341
350
|
<style lang="scss" scoped>
|
|
342
351
|
.show-common-item {
|
|
343
352
|
display: inline-block;
|
|
353
|
+
|
|
344
354
|
.item {
|
|
345
|
-
|
|
355
|
+
+.item {
|
|
346
356
|
padding-left: 10px;
|
|
347
357
|
}
|
|
348
358
|
}
|
package/src/views/About.vue
CHANGED
|
@@ -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:
|
|
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="
|
|
44
|
+
:checked="true"
|
|
45
45
|
:isExpand="false"
|
|
46
46
|
:height="500"
|
|
47
47
|
:columns="state.columns">
|