htui-yllkbz 1.1.12 → 1.1.13
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/demo.html +10 -0
- package/lib/htui.common.js +8858 -0
- package/lib/htui.common.js.gz +0 -0
- package/lib/htui.css +1 -0
- package/lib/htui.umd.js +8868 -0
- package/lib/htui.umd.js.gz +0 -0
- package/lib/htui.umd.min.js +28 -0
- package/lib/htui.umd.min.js.gz +0 -0
- package/package.json +3 -2
- package/src/App.vue +68 -0
- package/src/main.ts +63 -0
- package/src/packages/SelectTable/CommonTable.vue +241 -0
- package/src/packages/SelectTable/index.ts +15 -0
- package/src/packages/SelectTable/index.vue +188 -0
- package/src/packages/index.ts +35 -0
- package/src/packages/style.scss +13 -0
- package/src/packages/type.ts +55 -0
- package/src/plugins/api.ts +0 -0
- package/src/router/index.ts +41 -0
- package/src/shims-tsx.d.ts +13 -0
- package/src/shims-vue.d.ts +4 -0
- package/src/store/baseData.ts +44 -0
- package/src/store/index.ts +14 -0
- package/src/styles.scss +6 -0
- package/src/views/About.vue +3 -0
- package/src/views/Index.vue +230 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-11-15 15:00:57
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2021-11-15 15:48:37
|
|
8
|
+
*/
|
|
9
|
+
import SelectTable from "./index.vue";
|
|
10
|
+
|
|
11
|
+
(SelectTable as any).install = function (Vue: any) {
|
|
12
|
+
|
|
13
|
+
Vue.component(SelectTable.name, SelectTable);
|
|
14
|
+
};
|
|
15
|
+
export default SelectTable;
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
<!--
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-11-11 11:06:51
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2021-11-25 11:46:02
|
|
8
|
+
-->
|
|
9
|
+
<template>
|
|
10
|
+
<el-popover placement="bottom"
|
|
11
|
+
title=""
|
|
12
|
+
class="ht-popover"
|
|
13
|
+
v-model="state.visible"
|
|
14
|
+
:width="width||600"
|
|
15
|
+
@show="show"
|
|
16
|
+
@hide="hide"
|
|
17
|
+
trigger="click">
|
|
18
|
+
<div slot="reference"
|
|
19
|
+
@click="!state.config.disabled?state.visible = !state.visible:state.visible=false"
|
|
20
|
+
class="ht-contnet">
|
|
21
|
+
<el-input readonly
|
|
22
|
+
@blur="blurInput"
|
|
23
|
+
:placeholder="placeholder"
|
|
24
|
+
:disabled="state.config.disabled"
|
|
25
|
+
@focus="focusInput"
|
|
26
|
+
:suffix-icon="state.icon"
|
|
27
|
+
v-model="state.name"></el-input>
|
|
28
|
+
<el-button type="text"
|
|
29
|
+
class="ht-close"
|
|
30
|
+
v-if="state.name&&state.config.clearable"
|
|
31
|
+
@click.native.stop="clear">
|
|
32
|
+
<div><i class="el-icon-circle-close"></i></div>
|
|
33
|
+
</el-button>
|
|
34
|
+
</div>
|
|
35
|
+
<CommonTable @callback="callback"
|
|
36
|
+
:searchPlaceholder="searchPlaceholder"
|
|
37
|
+
:columns="state.columns"
|
|
38
|
+
:visible.sync="state.visible"
|
|
39
|
+
:ref="state.config.key||'ht-table'"
|
|
40
|
+
:confige="state.config"></CommonTable>
|
|
41
|
+
</el-popover>
|
|
42
|
+
</template>
|
|
43
|
+
<script lang='ts'>
|
|
44
|
+
import { Component, Prop, Vue, Watch } from "vue-property-decorator";
|
|
45
|
+
import CommonTable from "@/packages/SelectTable/CommonTable.vue";
|
|
46
|
+
import { ConfigProp } from "@/packages/type";
|
|
47
|
+
import "@/packages/style.scss";
|
|
48
|
+
interface State {
|
|
49
|
+
/** 数据状态 */
|
|
50
|
+
loading: boolean;
|
|
51
|
+
/** 输入框内容 */
|
|
52
|
+
name?: string;
|
|
53
|
+
/** icon图标 */
|
|
54
|
+
icon: string;
|
|
55
|
+
/** 是否展示弹窗 */
|
|
56
|
+
show: boolean;
|
|
57
|
+
columns?: Column[];
|
|
58
|
+
visible: boolean;
|
|
59
|
+
config: ConfigProp;
|
|
60
|
+
}
|
|
61
|
+
interface Confige {
|
|
62
|
+
url: string;
|
|
63
|
+
type: "get" | "post";
|
|
64
|
+
/* 展示的字段 */
|
|
65
|
+
text: string;
|
|
66
|
+
/** 默认值 */
|
|
67
|
+
value: string;
|
|
68
|
+
columns: Column[] | undefined;
|
|
69
|
+
}
|
|
70
|
+
interface Column {
|
|
71
|
+
key: string;
|
|
72
|
+
title: string;
|
|
73
|
+
width?: number;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
@Component({
|
|
77
|
+
components: {
|
|
78
|
+
CommonTable,
|
|
79
|
+
},
|
|
80
|
+
})
|
|
81
|
+
export default class SelectTable extends Vue {
|
|
82
|
+
/** 通用样式 */
|
|
83
|
+
@Prop() comStyle!: string;
|
|
84
|
+
@Prop() config!: string;
|
|
85
|
+
@Prop() width!: number;
|
|
86
|
+
/** 同原生placeholder */
|
|
87
|
+
@Prop() placeholder!: string;
|
|
88
|
+
/**搜索框 同原生placeholder */
|
|
89
|
+
@Prop() searchPlaceholder!: string;
|
|
90
|
+
@Prop() columns!: Column[] | undefined;
|
|
91
|
+
|
|
92
|
+
/** 数据 */
|
|
93
|
+
state: State = {
|
|
94
|
+
config: {
|
|
95
|
+
key: "",
|
|
96
|
+
disabled: false,
|
|
97
|
+
clearable: false,
|
|
98
|
+
value: "",
|
|
99
|
+
name: "",
|
|
100
|
+
ajax: {
|
|
101
|
+
url: "",
|
|
102
|
+
params: {},
|
|
103
|
+
},
|
|
104
|
+
|
|
105
|
+
text: undefined,
|
|
106
|
+
},
|
|
107
|
+
visible: false,
|
|
108
|
+
loading: false,
|
|
109
|
+
name: "",
|
|
110
|
+
show: false,
|
|
111
|
+
icon: "el-icon-arrow-down",
|
|
112
|
+
columns: [
|
|
113
|
+
{
|
|
114
|
+
key: "code",
|
|
115
|
+
title: "编码",
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
key: "name",
|
|
119
|
+
title: "名称",
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
key: "description",
|
|
123
|
+
title: "描述",
|
|
124
|
+
},
|
|
125
|
+
],
|
|
126
|
+
};
|
|
127
|
+
/** 生命周期 */
|
|
128
|
+
/** 方法 */
|
|
129
|
+
created() {
|
|
130
|
+
this.state.config = JSON.parse(this.config);
|
|
131
|
+
this.columns ? (this.state.columns = this.columns) : "";
|
|
132
|
+
//this.state.columns = this.columns??;
|
|
133
|
+
}
|
|
134
|
+
/** 显示弹层 */
|
|
135
|
+
show() {
|
|
136
|
+
this.state.icon = "el-icon-arrow-up";
|
|
137
|
+
this.state.show = true;
|
|
138
|
+
|
|
139
|
+
//
|
|
140
|
+
}
|
|
141
|
+
/** 回调 */
|
|
142
|
+
callback(row: any | undefined, type?: string) {
|
|
143
|
+
const { config } = this.state;
|
|
144
|
+
const text = config.text || "name";
|
|
145
|
+
if (row) {
|
|
146
|
+
this.state.name = row[text];
|
|
147
|
+
} else {
|
|
148
|
+
this.state.name = undefined;
|
|
149
|
+
}
|
|
150
|
+
// console.log("change", row, type);
|
|
151
|
+
this.$emit("change", row, type);
|
|
152
|
+
if (type) {
|
|
153
|
+
this.state.visible = false;
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/** 隐藏弹窗 */
|
|
157
|
+
hide() {
|
|
158
|
+
this.state.icon = "el-icon-arrow-down";
|
|
159
|
+
this.state.show = false;
|
|
160
|
+
}
|
|
161
|
+
/** 焦点移入移出 */
|
|
162
|
+
blurInput() {
|
|
163
|
+
const { show } = this.state;
|
|
164
|
+
this.state.icon = show ? "el-icon-arrow-up" : "el-icon-arrow-down";
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
focusInput() {
|
|
168
|
+
this.state.icon = "el-icon-circle-close";
|
|
169
|
+
this.state.visible = !this.state.config.disabled;
|
|
170
|
+
}
|
|
171
|
+
/** 清除内容 */
|
|
172
|
+
clear() {
|
|
173
|
+
//
|
|
174
|
+
if (!this.state.config.disabled) {
|
|
175
|
+
const ref: any = this.$refs[this.state.config.key || "ht-table"];
|
|
176
|
+
this.state.visible = false;
|
|
177
|
+
ref.clearCheck();
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
/** 监听 */
|
|
181
|
+
@Watch("config")
|
|
182
|
+
watchConfig(value: string) {
|
|
183
|
+
this.state.config = JSON.parse(value);
|
|
184
|
+
}
|
|
185
|
+
/** 计算属性 */
|
|
186
|
+
}
|
|
187
|
+
</script>
|
|
188
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-10-21 10:08:41
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2021-11-15 15:06:00
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
// 导入开关选择组件
|
|
11
|
+
import selectTable from './SelectTable/index'
|
|
12
|
+
|
|
13
|
+
// 存储组件列表
|
|
14
|
+
const components = [
|
|
15
|
+
selectTable
|
|
16
|
+
]
|
|
17
|
+
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
18
|
+
const install = function (Vue: any) {
|
|
19
|
+
// 判断是否安装
|
|
20
|
+
if ((install as any).installed) return
|
|
21
|
+
// 遍历注册全局组件
|
|
22
|
+
components.map(component => Vue.component(component.name, component))
|
|
23
|
+
}
|
|
24
|
+
// 判断是否是直接引入文件
|
|
25
|
+
if (typeof window !== 'undefined' && window.Vue) {
|
|
26
|
+
install(window.Vue)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export default {
|
|
30
|
+
// 导出的对象必须具有 install,才能被 Vue.use() 方法安装
|
|
31
|
+
install,
|
|
32
|
+
// 以下是具体的组件列表
|
|
33
|
+
selectTable
|
|
34
|
+
}
|
|
35
|
+
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* @Descripttion:
|
|
3
|
+
* @version:
|
|
4
|
+
* @Author: hutao
|
|
5
|
+
* @Date: 2021-10-25 17:05:17
|
|
6
|
+
* @LastEditors: hutao
|
|
7
|
+
* @LastEditTime: 2021-11-14 17:30:49
|
|
8
|
+
*/
|
|
9
|
+
/** 初始的默认条数 */
|
|
10
|
+
export const defalutPageSize = 10
|
|
11
|
+
/** 分页显示传入的参数
|
|
12
|
+
* @param currentPage(当前页码)
|
|
13
|
+
* @param pageSize(每页条数)
|
|
14
|
+
* @param total(总条数)
|
|
15
|
+
*/
|
|
16
|
+
export interface CurrentType {
|
|
17
|
+
currentPage: number;
|
|
18
|
+
pageSize: number;
|
|
19
|
+
total: number;
|
|
20
|
+
}
|
|
21
|
+
export interface ConfigProp {
|
|
22
|
+
/** 展示的相关列表code */
|
|
23
|
+
key: string;
|
|
24
|
+
/** 是否可用 */
|
|
25
|
+
disabled: boolean;
|
|
26
|
+
/** 清除内容 */
|
|
27
|
+
clearable?: boolean;
|
|
28
|
+
/** 默认值 */
|
|
29
|
+
value?: string; //code:"344"
|
|
30
|
+
/** value对应的匹配值 */
|
|
31
|
+
name?: string;
|
|
32
|
+
ajax: {
|
|
33
|
+
/** 请求地址 */
|
|
34
|
+
url: string;
|
|
35
|
+
/** 请求类型 */
|
|
36
|
+
type?: "get" | "post";
|
|
37
|
+
/** 头部参数 */
|
|
38
|
+
params: any;
|
|
39
|
+
/** body参数 */
|
|
40
|
+
data?: any;
|
|
41
|
+
};
|
|
42
|
+
/** 展示的内容 */
|
|
43
|
+
text?: string | number;
|
|
44
|
+
table?: {
|
|
45
|
+
rowkey?: string;
|
|
46
|
+
height?: number;
|
|
47
|
+
columns: Column[] | undefined;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
}
|
|
51
|
+
export interface Column {
|
|
52
|
+
key: string;
|
|
53
|
+
title: string;
|
|
54
|
+
width?: number;
|
|
55
|
+
}
|
|
File without changes
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RouteConfig } from "vue-router";
|
|
2
|
+
import index from "../views/Index.vue";
|
|
3
|
+
import Login from "vue-kst-auth";
|
|
4
|
+
const routes: Array<RouteConfig> = [
|
|
5
|
+
{
|
|
6
|
+
path: "/login",
|
|
7
|
+
name: "登录",
|
|
8
|
+
component: Login as any
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
path: "/",
|
|
12
|
+
name: "首页",
|
|
13
|
+
component: index,
|
|
14
|
+
children: [
|
|
15
|
+
{
|
|
16
|
+
path: "",
|
|
17
|
+
name: "",
|
|
18
|
+
meta: {
|
|
19
|
+
title:"模板首页"
|
|
20
|
+
},
|
|
21
|
+
component: () =>
|
|
22
|
+
import(/* webpackChunkName: "about" */ "../views/About.vue")
|
|
23
|
+
}
|
|
24
|
+
]
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
path: "/about",
|
|
28
|
+
name: "About",
|
|
29
|
+
// route level code-splitting
|
|
30
|
+
// this generates a separate chunk (about.[hash].js) for this route
|
|
31
|
+
// which is lazy-loaded when the route is visited.
|
|
32
|
+
component: () =>
|
|
33
|
+
import(/* webpackChunkName: "about" */ "../views/About.vue")
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
// const router = new VueRouter({
|
|
38
|
+
// routes
|
|
39
|
+
// });
|
|
40
|
+
|
|
41
|
+
export default routes;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import Vue, { VNode } from "vue";
|
|
2
|
+
|
|
3
|
+
declare global {
|
|
4
|
+
namespace JSX {
|
|
5
|
+
// tslint:disable no-empty-interface
|
|
6
|
+
interface Element extends VNode {}
|
|
7
|
+
// tslint:disable no-empty-interface
|
|
8
|
+
interface ElementClass extends Vue {}
|
|
9
|
+
interface IntrinsicElements {
|
|
10
|
+
[elem: string]: any;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
state: {
|
|
3
|
+
// "企业名称",
|
|
4
|
+
enterpriseName: "星环视界智能科技",
|
|
5
|
+
// "基本请求路径",
|
|
6
|
+
baseUrl: "",
|
|
7
|
+
/** 授权 */
|
|
8
|
+
grantedPolicies: {},
|
|
9
|
+
/** 部门人员 */
|
|
10
|
+
organizationUsers: [],
|
|
11
|
+
/** 部门 */
|
|
12
|
+
organizationUnit: [],
|
|
13
|
+
/** 人员 */
|
|
14
|
+
users: [],
|
|
15
|
+
/** 严重等级 */
|
|
16
|
+
severityLevel: [],
|
|
17
|
+
/** 资产分类 */
|
|
18
|
+
assetTypes: [],
|
|
19
|
+
/** 位置 */
|
|
20
|
+
positions: [],
|
|
21
|
+
/** 分组 */
|
|
22
|
+
grids: []
|
|
23
|
+
},
|
|
24
|
+
getters: {
|
|
25
|
+
getBaseData: (state: any) => (name: string) => state[name]
|
|
26
|
+
},
|
|
27
|
+
mutations: {
|
|
28
|
+
setBaseData(state: any, baseData: any) {
|
|
29
|
+
for (const key in baseData) {
|
|
30
|
+
if (baseData.hasOwnProperty(key) && !/(^\?)|(^?)/.test(key)) {
|
|
31
|
+
let element: string = baseData[key];
|
|
32
|
+
if (/^baseUrl/.test(key)) {
|
|
33
|
+
element = element.replace(/\/$/g, "");
|
|
34
|
+
}
|
|
35
|
+
state[key] = element;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
setBaseDataApi(state: any, payload: { key: string; value: any }) {
|
|
40
|
+
state[payload.key] = payload.value;
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
actions: {}
|
|
44
|
+
};
|
package/src/styles.scss
ADDED
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div id="index">
|
|
3
|
+
<el-container style="height: 100vh" class="index">
|
|
4
|
+
<el-header style="padding: 0; height: min-content">
|
|
5
|
+
<xhkj-layout02>
|
|
6
|
+
<router-link to="/login" slot="navEnd">注销</router-link>
|
|
7
|
+
</xhkj-layout02>
|
|
8
|
+
</el-header>
|
|
9
|
+
<el-container class="body">
|
|
10
|
+
<el-aside :width="state.collapsed ? '66px' : '230px'" class="left">
|
|
11
|
+
<!--导航菜单-->
|
|
12
|
+
<el-menu
|
|
13
|
+
:default-active="state.defaultIndex"
|
|
14
|
+
router
|
|
15
|
+
:collapse="state.collapsed"
|
|
16
|
+
:collapse-transition="false"
|
|
17
|
+
>
|
|
18
|
+
<el-menu-item index="/">
|
|
19
|
+
<i class="el-icon-s-check"></i>
|
|
20
|
+
<span slot="title">导航1</span>
|
|
21
|
+
</el-menu-item>
|
|
22
|
+
<el-menu-item index="/">
|
|
23
|
+
<i class="el-icon-s-promotion"></i>
|
|
24
|
+
<span slot="title">导航2</span>
|
|
25
|
+
</el-menu-item>
|
|
26
|
+
<el-menu-item index="/">
|
|
27
|
+
<i class="el-icon-s-order"></i>
|
|
28
|
+
<span slot="title">导航3</span>
|
|
29
|
+
</el-menu-item>
|
|
30
|
+
</el-menu>
|
|
31
|
+
<el-button
|
|
32
|
+
class="action-btn"
|
|
33
|
+
:title="state.collapsed ? '展开菜单' : '收起菜单'"
|
|
34
|
+
type="text"
|
|
35
|
+
size="medium"
|
|
36
|
+
:icon="state.collapsed ? 'el-icon-s-unfold' : 'el-icon-s-fold'"
|
|
37
|
+
@click="state.collapsed = !state.collapsed"
|
|
38
|
+
style="font-size: 16px"
|
|
39
|
+
></el-button>
|
|
40
|
+
</el-aside>
|
|
41
|
+
<el-main style="padding: 8px 0 0 15px" class="cont">
|
|
42
|
+
<router-view v-if="state.loading"></router-view>
|
|
43
|
+
</el-main>
|
|
44
|
+
</el-container>
|
|
45
|
+
</el-container>
|
|
46
|
+
<div
|
|
47
|
+
v-if="state.isLogin"
|
|
48
|
+
is="common-datas"
|
|
49
|
+
@commonDatas="commonDatas"
|
|
50
|
+
@error="error"
|
|
51
|
+
></div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<script lang="ts">
|
|
56
|
+
import { Component, Vue, Watch } from "vue-property-decorator";
|
|
57
|
+
import { baseConfig } from "vue-kst-auth";
|
|
58
|
+
interface State {
|
|
59
|
+
/** 数据状态 */
|
|
60
|
+
loading: boolean;
|
|
61
|
+
/** 是否登陆 */
|
|
62
|
+
isLogin: boolean;
|
|
63
|
+
/** 默认选中导航 */
|
|
64
|
+
defaultIndex: string;
|
|
65
|
+
/** 菜单是否收缩 */
|
|
66
|
+
collapsed: boolean;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@Component({
|
|
70
|
+
components: {},
|
|
71
|
+
})
|
|
72
|
+
export default class App extends Vue {
|
|
73
|
+
/** 数据 */
|
|
74
|
+
state: State = {
|
|
75
|
+
loading: false,
|
|
76
|
+
isLogin: false,
|
|
77
|
+
defaultIndex: "/",
|
|
78
|
+
collapsed: true,
|
|
79
|
+
};
|
|
80
|
+
/** 生命周期 */
|
|
81
|
+
created() {
|
|
82
|
+
// 动态加载引用文件
|
|
83
|
+
const files = this.$store.getters.getBaseData("files");
|
|
84
|
+
const filesKeys: string[] = Object.keys(files);
|
|
85
|
+
let heatStr = document.getElementsByTagName("head")[0].innerHTML;
|
|
86
|
+
filesKeys.forEach((cur) => {
|
|
87
|
+
const src = files[cur];
|
|
88
|
+
if (src && /\.css$/.test(src.toString())) {
|
|
89
|
+
heatStr += `<link rel="stylesheet" href="${src}?v=${Date.now()}" />`;
|
|
90
|
+
}
|
|
91
|
+
if (src && /\.ico$/.test(src.toString())) {
|
|
92
|
+
heatStr += `<link rel="icon" href="${src}">`;
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
document.getElementsByTagName("head")[0].innerHTML = heatStr;
|
|
96
|
+
this.state.isLogin = baseConfig.getLoginState() || false;
|
|
97
|
+
}
|
|
98
|
+
mounted() {
|
|
99
|
+
this.state.defaultIndex = this.$route.path;
|
|
100
|
+
}
|
|
101
|
+
/** 方法 */
|
|
102
|
+
/** 接收基础数据 */
|
|
103
|
+
commonDatas(msg: any) {
|
|
104
|
+
const [res] = msg.detail;
|
|
105
|
+
this.state.loading = true;
|
|
106
|
+
/** 授权 */
|
|
107
|
+
if (
|
|
108
|
+
res.SessionState &&
|
|
109
|
+
res.SessionState.auth &&
|
|
110
|
+
res.SessionState.auth.grantedPolicies
|
|
111
|
+
) {
|
|
112
|
+
this.$store.commit("setBaseDataApi", {
|
|
113
|
+
key: "grantedPolicies",
|
|
114
|
+
value: res.SessionState.auth.grantedPolicies,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
/** 部门人员数据 */
|
|
118
|
+
if (res.organizationUsers) {
|
|
119
|
+
this.$store.commit("setBaseDataApi", {
|
|
120
|
+
key: "organizationUsers",
|
|
121
|
+
value: res.organizationUsers.items,
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
/** 部门数据 */
|
|
125
|
+
if (res.organizationUnit) {
|
|
126
|
+
this.$store.commit("setBaseDataApi", {
|
|
127
|
+
key: "organizationUnit",
|
|
128
|
+
value: res.organizationUnit,
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
/** 人员数据 */
|
|
132
|
+
if (res.users) {
|
|
133
|
+
this.$store.commit("setBaseDataApi", {
|
|
134
|
+
key: "users",
|
|
135
|
+
value: res.users.items,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
/** 严重等级 */
|
|
139
|
+
if (res.severityLevel) {
|
|
140
|
+
this.$store.commit("setBaseDataApi", {
|
|
141
|
+
key: "severityLevel",
|
|
142
|
+
value: res.severityLevel,
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
// /** 基础数据 */
|
|
146
|
+
// if (res.baseData && res.baseData.items) {
|
|
147
|
+
// const data: any[] = res.baseData.items;
|
|
148
|
+
// // 资产分类
|
|
149
|
+
// const assetTypes = data.filter(val => val.category == "AssetCategory");
|
|
150
|
+
// this.$store.commit("setBaseDataApi", {
|
|
151
|
+
// key: "assetTypes",
|
|
152
|
+
// value: assetTypes
|
|
153
|
+
// });
|
|
154
|
+
// // 位置
|
|
155
|
+
// const positions = data.filter(val => val.category == "positions");
|
|
156
|
+
// this.$store.commit("setBaseDataApi", {
|
|
157
|
+
// key: "positions",
|
|
158
|
+
// value: positions
|
|
159
|
+
// });
|
|
160
|
+
// // 分组
|
|
161
|
+
// const grids = data.filter(val => val.category == "AlertGroup");
|
|
162
|
+
// this.$store.commit("setBaseDataApi", {
|
|
163
|
+
// key: "grids",
|
|
164
|
+
// value: grids
|
|
165
|
+
// });
|
|
166
|
+
// }
|
|
167
|
+
}
|
|
168
|
+
error() {
|
|
169
|
+
this.state.loading = true;
|
|
170
|
+
// console.log("获取基础信息错误");
|
|
171
|
+
}
|
|
172
|
+
/** 监听 */
|
|
173
|
+
@Watch("$route.path", { deep: true })
|
|
174
|
+
ondata(val: string) {
|
|
175
|
+
this.state.defaultIndex = val || "/";
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
</script>
|
|
179
|
+
|
|
180
|
+
<style lang="scss">
|
|
181
|
+
body,
|
|
182
|
+
html {
|
|
183
|
+
margin: 0;
|
|
184
|
+
padding: 0;
|
|
185
|
+
}
|
|
186
|
+
a {
|
|
187
|
+
text-decoration: none;
|
|
188
|
+
&:link {
|
|
189
|
+
color: #476ef3;
|
|
190
|
+
}
|
|
191
|
+
a:visited {
|
|
192
|
+
color: #551a8b;
|
|
193
|
+
}
|
|
194
|
+
a:hover {
|
|
195
|
+
color: #335ff7;
|
|
196
|
+
}
|
|
197
|
+
a:active {
|
|
198
|
+
color: #0000ff;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
.index {
|
|
202
|
+
background: url("/publicData/images/bg.png ") center no-repeat;
|
|
203
|
+
background-size: 100% 100%;
|
|
204
|
+
font-family: "SourceHanSansCN-Normal", "Avenir", Helvetica, Arial, sans-serif;
|
|
205
|
+
-webkit-font-smoothing: antialiased;
|
|
206
|
+
-moz-osx-font-smoothing: grayscale;
|
|
207
|
+
color: #333333;
|
|
208
|
+
font-size: 12px;
|
|
209
|
+
}
|
|
210
|
+
</style>
|
|
211
|
+
<style lang="scss" scoped>
|
|
212
|
+
.index {
|
|
213
|
+
.el-menu {
|
|
214
|
+
background: none;
|
|
215
|
+
border: none;
|
|
216
|
+
}
|
|
217
|
+
.body {
|
|
218
|
+
.left {
|
|
219
|
+
box-sizing: border-box;
|
|
220
|
+
border-right: 1px solid #e6e6e6;
|
|
221
|
+
position: relative;
|
|
222
|
+
.action-btn {
|
|
223
|
+
position: absolute;
|
|
224
|
+
bottom: 0;
|
|
225
|
+
right: 6px;
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
</style>
|