htui-yllkbz 1.3.22 → 1.3.25
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 +6294 -4361
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -1
- package/lib/htui.umd.js +6294 -4361
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +4 -4
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +4 -2
- package/src/App.vue +73 -18
- package/src/main.ts +10 -0
- package/src/packages/HtBaseData/index.vue +24 -11
- package/src/packages/index.ts +2 -1
- package/src/plugins/oidc-client.ts +37 -0
- package/src/views/About.vue +3 -1
package/lib/htui.umd.min.js.gz
CHANGED
|
Binary file
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "htui-yllkbz",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.25",
|
|
4
|
+
"port": "8082",
|
|
4
5
|
"typings": "types/index.d.ts",
|
|
5
6
|
"main": "lib/htui.common.js",
|
|
6
7
|
"style": "lib/htui.css",
|
|
@@ -23,9 +24,10 @@
|
|
|
23
24
|
"core-js": "^3.6.5",
|
|
24
25
|
"element-ui": "^2.14.1",
|
|
25
26
|
"html2canvas": "1.0.0-rc.1",
|
|
26
|
-
"htui-yllkbz": "^1.
|
|
27
|
+
"htui-yllkbz": "^1.3.24",
|
|
27
28
|
"mavon-editor": "^2.10.4",
|
|
28
29
|
"moment": "^2.29.1",
|
|
30
|
+
"oidc-client": "^1.11.5",
|
|
29
31
|
"vue": "^2.6.11",
|
|
30
32
|
"vue-class-component": "^7.2.3",
|
|
31
33
|
"vue-kst-auth": "^2.1.15",
|
package/src/App.vue
CHANGED
|
@@ -4,36 +4,36 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-15 14:41:40
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime:
|
|
7
|
+
* @LastEditTime: 2022-05-10 10:39:13
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div id="app">
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
url: '/asset-model/api/app/asset-model-instance',
|
|
21
|
-
},
|
|
22
|
-
text:'name',
|
|
23
|
-
})"></SelectTable>
|
|
24
|
-
|
|
11
|
+
<el-button type=""
|
|
12
|
+
@click="test">测试</el-button>
|
|
13
|
+
<HtSelectBaseData dataTypeId="chengbenzhongxin"
|
|
14
|
+
v-model="state.value"
|
|
15
|
+
@change="change"></HtSelectBaseData>
|
|
16
|
+
<HtSelectBaseData dataTypeId="positions"
|
|
17
|
+
:multiple="false"
|
|
18
|
+
v-model="state.value"
|
|
19
|
+
@change="change"></HtSelectBaseData>
|
|
25
20
|
<router-view></router-view>
|
|
26
21
|
</div>
|
|
27
22
|
</template>
|
|
28
23
|
|
|
29
24
|
<script lang="ts">
|
|
30
25
|
import { Component, Vue } from "vue-property-decorator";
|
|
31
|
-
import
|
|
32
|
-
|
|
26
|
+
import HtSelectBaseData from "@/packages/HtSelectBaseData";
|
|
27
|
+
import { mgr } from "@/plugins/oidc-client";
|
|
33
28
|
@Component({
|
|
34
|
-
components: {
|
|
29
|
+
components: {
|
|
30
|
+
HtSelectBaseData,
|
|
31
|
+
},
|
|
35
32
|
})
|
|
36
33
|
export default class App extends Vue {
|
|
34
|
+
state = {
|
|
35
|
+
value: undefined,
|
|
36
|
+
};
|
|
37
37
|
/** 生命周期 */
|
|
38
38
|
created() {
|
|
39
39
|
// 动态加载引用文件
|
|
@@ -51,6 +51,61 @@ export default class App extends Vue {
|
|
|
51
51
|
});
|
|
52
52
|
document.getElementsByTagName("head")[0].innerHTML = heatStr;
|
|
53
53
|
}
|
|
54
|
+
change() {
|
|
55
|
+
// console.log("eeee", e);
|
|
56
|
+
}
|
|
57
|
+
test(e: any) {
|
|
58
|
+
//mgr.removeUser();
|
|
59
|
+
// mgr.events.
|
|
60
|
+
//console.log("eeee", mgr.getUser().then(res));
|
|
61
|
+
// mgr.getUser().then((res) => {
|
|
62
|
+
// console.log("eeee", res);
|
|
63
|
+
// });
|
|
64
|
+
|
|
65
|
+
e.preventDefault();
|
|
66
|
+
e.stopPropagation();
|
|
67
|
+
|
|
68
|
+
mgr.signoutRedirect();
|
|
69
|
+
// mgr.revokeAccessToken();
|
|
70
|
+
// mgr.signoutCallback(window.location.href, true).then((res) => {
|
|
71
|
+
// alert;
|
|
72
|
+
// console.log("rrres", res);
|
|
73
|
+
// //
|
|
74
|
+
// });
|
|
75
|
+
mgr.signinRedirect();
|
|
76
|
+
// mgr.signoutRedirectCallback().then(() => {
|
|
77
|
+
// mgr.getUser().then((user) => {
|
|
78
|
+
// console.log("user", user);
|
|
79
|
+
// });
|
|
80
|
+
// });
|
|
81
|
+
// console.log("ttt", tt, mgr.getUser());
|
|
82
|
+
// });
|
|
83
|
+
//mgr.signinSilent();
|
|
84
|
+
// mgr.removeUser().then((res) => {
|
|
85
|
+
// console.log("rres", res);
|
|
86
|
+
// mgr.signinRedirect();
|
|
87
|
+
// });
|
|
88
|
+
// mgr.signoutRedirect(); //退出登录
|
|
89
|
+
//mgr.removeUser();
|
|
90
|
+
// mgr.signoutRedirectCallback().then((res) => {
|
|
91
|
+
// console.log("res", res);
|
|
92
|
+
// }); //登录
|
|
93
|
+
// mgr.getUser(); //获取用户信息
|
|
94
|
+
// mgr.signinRedirectCallback(); //callback
|
|
95
|
+
// mgr.revokeAccessToken();
|
|
96
|
+
//mgr.
|
|
97
|
+
//mgr.signoutPopup();
|
|
98
|
+
//mgr.signinPopup();
|
|
99
|
+
// mgr.signoutRedirectCallback(window.location.href).then((res) => {
|
|
100
|
+
// //window.location.href = window.location.href;
|
|
101
|
+
// console.log("res", res);
|
|
102
|
+
// // mgr.signinRedirect();
|
|
103
|
+
// });
|
|
104
|
+
// mgr.signoutRedirect();
|
|
105
|
+
//mgr.clearStaleState();
|
|
106
|
+
// mgr.signinRedirectCallback(window.location.href);
|
|
107
|
+
// mgr.signinRedirect();
|
|
108
|
+
}
|
|
54
109
|
}
|
|
55
110
|
</script>
|
|
56
111
|
|
package/src/main.ts
CHANGED
|
@@ -1,14 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-11-15 14:41:40
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2022-04-29 17:05:53
|
|
8
|
+
*/
|
|
1
9
|
import Vue from "vue";
|
|
2
10
|
import App from "./App.vue";
|
|
3
11
|
import VueRouter from "vue-router";
|
|
4
12
|
import routes from "./router";
|
|
5
13
|
import store from "./store";
|
|
6
14
|
import ElementUI from "element-ui";
|
|
15
|
+
import HtUi from "htui-yllkbz";
|
|
7
16
|
import "./styles.scss";
|
|
8
17
|
import { _axios, baseConfig } from "vue-kst-auth";
|
|
9
18
|
// import axios from "axios";
|
|
10
19
|
Vue.use(ElementUI);
|
|
11
20
|
Vue.use(VueRouter);
|
|
21
|
+
Vue.use(HtUi);
|
|
12
22
|
|
|
13
23
|
/** 设置axios返回类型 */
|
|
14
24
|
Vue.config.productionTip = false;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div>
|
|
3
|
+
|
|
3
4
|
<!-- 选择部门 -->
|
|
4
5
|
<template v-if="
|
|
5
6
|
state.configJson['departmentId'] &&
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
}"
|
|
29
30
|
@click.native="selectClick($event)"
|
|
30
31
|
ref="departmentId"
|
|
31
|
-
@change="setSelctData('departmentId')"
|
|
32
|
+
@change="setSelctData('departmentId',$event)"
|
|
32
33
|
:options="organizationUsersTree">
|
|
33
34
|
</el-cascader>
|
|
34
35
|
<el-cascader-panel v-if="state.configJson['departmentId'].panel"
|
|
@@ -47,7 +48,7 @@
|
|
|
47
48
|
multiple: state.configJson['departmentId'].multiple,
|
|
48
49
|
}"
|
|
49
50
|
ref="departmentId"
|
|
50
|
-
@change="setSelctData('departmentId')"
|
|
51
|
+
@change="setSelctData('departmentId',$event)"
|
|
51
52
|
:options="organizationUsersTree">
|
|
52
53
|
<template slot-scope="{ data }">
|
|
53
54
|
<span>{{ data.label }}</span>
|
|
@@ -116,7 +117,7 @@
|
|
|
116
117
|
}"
|
|
117
118
|
ref="departmentUser"
|
|
118
119
|
@click.native="selectClick($event)"
|
|
119
|
-
@change="setSelctData('departmentUser')"
|
|
120
|
+
@change="setSelctData('departmentUser',$event)"
|
|
120
121
|
:options="organizationUsersTreeUser">
|
|
121
122
|
<template slot-scope="{ data }">
|
|
122
123
|
<p class="ht-user-dot"
|
|
@@ -163,7 +164,7 @@
|
|
|
163
164
|
multiple: state.configJson['departmentUser'].multiple,
|
|
164
165
|
}"
|
|
165
166
|
ref="departmentUser"
|
|
166
|
-
@change="setSelctData('departmentUser')"
|
|
167
|
+
@change="setSelctData('departmentUser',$event)"
|
|
167
168
|
:options="organizationUsersTreeUser">
|
|
168
169
|
<template slot-scope="{ data }">
|
|
169
170
|
<p class="ht-user-dot"
|
|
@@ -281,10 +282,10 @@
|
|
|
281
282
|
multiple: state.configJson[item.code].multiple,
|
|
282
283
|
}"
|
|
283
284
|
:ref="`${item.code}`"
|
|
284
|
-
@change="setSelctData(item.code)"
|
|
285
|
+
@change="setSelctData(item.code,$event)"
|
|
285
286
|
:options="getbaseDataInfo[item.id]"></el-cascader>
|
|
286
287
|
<el-cascader-panel v-else
|
|
287
|
-
@click.native="selectClick($event)"
|
|
288
|
+
@click.native="selectClick($event,)"
|
|
288
289
|
:placeholder="`请选择${item.name}`"
|
|
289
290
|
class="component-item"
|
|
290
291
|
:key="item.id"
|
|
@@ -300,7 +301,7 @@
|
|
|
300
301
|
multiple: state.configJson[item.code].multiple,
|
|
301
302
|
}"
|
|
302
303
|
:ref="`${item.code}`"
|
|
303
|
-
@change="setSelctData(item.code)"
|
|
304
|
+
@change="setSelctData(item.code,$event)"
|
|
304
305
|
:options="getbaseDataInfo[item.id]"></el-cascader-panel>
|
|
305
306
|
</template>
|
|
306
307
|
</template>
|
|
@@ -650,15 +651,27 @@ export default class CommonDatas extends Vue {
|
|
|
650
651
|
// });
|
|
651
652
|
}
|
|
652
653
|
/** 设置下拉数据(级联选择) */
|
|
653
|
-
setSelctData(key: string) {
|
|
654
|
+
setSelctData(key: string, e?: string) {
|
|
655
|
+
const value = e ? e : this.state.selectVal[key];
|
|
654
656
|
const ref: any | undefined = (this.$refs[key] as any)[0] || this.$refs[key];
|
|
655
|
-
|
|
657
|
+
|
|
658
|
+
let checkList = [];
|
|
659
|
+
if (ref && ref.getCheckedNodes() && ref.getCheckedNodes()[0] !== null) {
|
|
660
|
+
checkList = ref.getCheckedNodes();
|
|
661
|
+
} else if (
|
|
662
|
+
ref &&
|
|
663
|
+
ref.getCheckedNodes() &&
|
|
664
|
+
ref.getCheckedNodes()[0] === null
|
|
665
|
+
) {
|
|
666
|
+
checkList = [ref.panel.getNodeByValue(value)];
|
|
667
|
+
}
|
|
668
|
+
|
|
656
669
|
/** 过滤在多选模式下,Tag时触发删除 */
|
|
657
670
|
const checkNodes = checkList.filter((item: any) => {
|
|
658
|
-
return
|
|
671
|
+
return value?.includes(item.data.id);
|
|
659
672
|
});
|
|
660
|
-
this.state.selectValData[key] = [];
|
|
661
673
|
if (checkNodes && checkNodes.length && checkNodes[0] !== null) {
|
|
674
|
+
this.state.selectValData[key] = [];
|
|
662
675
|
checkNodes.forEach(
|
|
663
676
|
(item: { data?: { id: string; name: string } } | undefined) => {
|
|
664
677
|
const { data } = item || { data: "" };
|
package/src/packages/index.ts
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-10-21 10:08:41
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-05-05 09:12:46
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
// 导入组件
|
|
@@ -28,6 +28,7 @@ import HtBaseData from './HtBaseData/index'
|
|
|
28
28
|
|
|
29
29
|
|
|
30
30
|
|
|
31
|
+
|
|
31
32
|
// 存储组件列表
|
|
32
33
|
const components = [HtBaseData, HtSelectTable, HtPagination, HtTable, HtExport, HtUpload, HtMd, HtCountDown, HtUploadFiles, HtSelectBaseData, HtSelectOrg, HtSelectUser, HtShowBaseData, HtOrgInfo]
|
|
33
34
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/camelcase */
|
|
2
|
+
/*
|
|
3
|
+
* @Descripttion:
|
|
4
|
+
* @version:
|
|
5
|
+
* @Author: hutao
|
|
6
|
+
* @Date: 2022-05-06 17:56:08
|
|
7
|
+
* @LastEditors: hutao
|
|
8
|
+
* @LastEditTime: 2022-05-09 14:20:45
|
|
9
|
+
*/
|
|
10
|
+
import Oidc from "oidc-client";
|
|
11
|
+
function getCurrentUrl() {
|
|
12
|
+
let href = window.location.pathname;
|
|
13
|
+
if (href.charAt(href.length - 1) === '/') {
|
|
14
|
+
href = href.substring(0, href.length - 1)
|
|
15
|
+
}
|
|
16
|
+
console.log('href', href, window.location);
|
|
17
|
+
console.log('window.location.host + href', window.location.origin + href);
|
|
18
|
+
return window.location.origin + href
|
|
19
|
+
}
|
|
20
|
+
export const mgr = new Oidc.UserManager({
|
|
21
|
+
// authority: "oauth2/api",//认证服务器
|
|
22
|
+
authority: "http://192.168.3.237:44318",//认证服务器
|
|
23
|
+
client_id: "AuthServer_App", //表示客户端的ID,必选项
|
|
24
|
+
//redirect_uri: "http://192.168.3.113:8082/product_architecture", //表示重定向URI,认证服务器回调的客户端页面。可选项
|
|
25
|
+
redirect_uri: getCurrentUrl(), //表示重定向URI,认证服务器回调的客户端页面。可选项
|
|
26
|
+
// redirect_uri: "http://192.168.3.252:4200", //表示重定向URI,认证服务器回调的客户端页面。可选项
|
|
27
|
+
response_type: "code", // response_type:表示授权类型,必选项
|
|
28
|
+
userStore: new Oidc.WebStorageStateStore({ store: window.localStorage }),
|
|
29
|
+
scope: "offline_access AuthServer", //scope:表示申请的权限范围,可选项
|
|
30
|
+
post_logout_redirect_uri: getCurrentUrl(),
|
|
31
|
+
automaticSilentRenew: false,
|
|
32
|
+
|
|
33
|
+
extraQueryParams: {
|
|
34
|
+
_tenant: 'default'
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
});
|
package/src/views/About.vue
CHANGED
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* @Author: hutao
|
|
5
5
|
* @Date: 2021-11-15 14:41:40
|
|
6
6
|
* @LastEditors: hutao
|
|
7
|
-
* @LastEditTime: 2022-
|
|
7
|
+
* @LastEditTime: 2022-05-09 10:05:08
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div>
|
|
11
|
+
...................
|
|
11
12
|
<HtSelectUser :value="['be12db32-1718-a43d-1cf8-39f97d1d872f','5f2d6558-4e98-9054-413f-39fc4c63ebac','959f6988-a74b-f6f7-0fb6-3a0314e0eaad']"
|
|
12
13
|
:multiple="true"></HtSelectUser>
|
|
13
14
|
<!-- <el-button type=""
|
|
@@ -60,6 +61,7 @@ import { Component, Vue } from "vue-property-decorator";
|
|
|
60
61
|
import HtTable from "@/packages/HtTable/index.vue";
|
|
61
62
|
import HtCountDown from "@/packages/HtCountDown/index.vue";
|
|
62
63
|
import HtSelectUser from "@/packages/HtSelectUser/index.vue";
|
|
64
|
+
|
|
63
65
|
import "htui-yllkbz/lib/htui.css";
|
|
64
66
|
interface State {
|
|
65
67
|
/** 数据状态 */
|