|
1
|
<template>
|
|
2
3
4
|
<div class="app-container authorize">
<el-card class="box-card" style="width: 30vw">
<div slot="header" class="clearfix">
|
|
5
|
<span>{{ $t("systemPermission.authorizationInformation") }}</span>
|
|
6
7
8
9
|
</div>
<el-descriptions :column="1" border>
<el-descriptions-item
label-class-name="descriptions-label"
|
|
10
|
:label="$t('systemPermission.authorize.companySoftware')"
|
|
11
12
13
14
|
>{{ customName }}
</el-descriptions-item>
<el-descriptions-item
label-class-name="descriptions-label"
|
|
15
|
:label="$t('systemPermission.authorize.authorizedVersion')"
|
|
16
17
18
19
|
>{{ customRole }}
</el-descriptions-item>
<el-descriptions-item
label-class-name="descriptions-label"
|
|
20
|
:label="$t('systemPermission.authorize.expirationDate')"
|
|
21
22
23
24
|
>{{ expireTime }}
</el-descriptions-item>
<el-descriptions-item
label-class-name="descriptions-label"
|
|
25
|
:label="$t('systemPermission.authorize.permit')"
|
|
26
|
><el-tag :type="isValid ? 'success' : 'danger'">{{
|
|
27
|
isValid ? $t("systemPermission.authorize.effective") : $t("systemPermission.authorize.invalid")
|
|
28
29
30
31
|
}}</el-tag>
</el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label=""
><el-button type="primary" size="mini" @click="btnOpenAuthorize"
|
|
32
|
>{{ $t("systemPermission.authorize.updateAuthorization") }}</el-button
|
|
33
34
35
36
37
38
39
40
41
42
|
>
</el-descriptions-item>
</el-descriptions>
</el-card>
<el-card
v-show="isShow"
class="box-card"
style="width: 30vw; margin-top: 10px"
>
<div slot="header" class="clearfix">
|
|
43
|
<span>{{ $t("systemPermission.authorize.importAuthorization") }}</span>
|
|
44
45
46
47
|
</div>
<el-descriptions :column="1" border>
<el-descriptions-item
label-class-name="descriptions-label"
|
|
48
|
:label="$t('systemPermission.authorize.enterAuthorization')"
|
|
49
50
51
52
|
><el-input type="textarea" v-model="authorize"></el-input>
</el-descriptions-item>
<el-descriptions-item label-class-name="descriptions-label" label=""
><el-button type="primary" size="mini" @click="btnUpdAuthorize"
|
|
53
|
>{{ $t("systemPermission.authorize.update") }}</el-button
|
|
54
|
><el-button type="primary" size="mini" plain @click="btnCancel"
|
|
55
|
>{{ $t("systemPermission.authorize.cancel") }}</el-button
|
|
56
57
58
59
|
>
</el-descriptions-item>
</el-descriptions>
</el-card>
|
|
60
61
62
63
|
</div>
</template>
<script>
|
|
64
65
|
import { getLicense, importLicense } from "@/api/user";
import { formatTime, showMsg } from "@/utils/index.js";
|
|
66
67
68
|
export default {
data() {
return {
|
|
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
|
customName: "",
customRole: "",
expireTime: "",
isValid: false,
authorize: "",
isShow: false,
};
},
mounted() {
this.loadLicense();
},
methods: {
loadLicense() {
getLicense().then((response) => {
this.customName = response.data.customName;
this.customRole = response.data.customRole;
this.expireTime = formatTime(
new Date(response.data.expireTime),
"{y}-{m}-{d} {h}:{i}:{s}"
);
this.isValid = response.code === "Success";
});
},
btnOpenAuthorize() {
this.isShow = true;
},
btnUpdAuthorize() {
if (this.authorize.trim() == "") {
|
|
97
|
showMsg(this.$t("systemPermission.msg.authEmpty"), false);
|
|
98
99
100
101
|
return;
}
importLicense(this.authorize).then((response) => {
if (response.code === "Success") {
|
|
102
|
showMsg(this.$t("systemPermission.msg.authSuccess"));
|
|
103
104
105
|
this.authorize = "";
this.isShow = false;
} else {
|
|
106
|
showMsg(this.$t("systemPermission.msg.authFailed"));
|
|
107
108
109
110
111
112
113
114
115
|
}
});
},
btnCancel() {
this.authorize = "";
this.isShow = false;
},
},
};
|
|
116
117
|
</script>
<style scoped>
|
|
118
119
120
|
.grid-content {
padding-top: 40px;
color: #333333;
|
|
121
122
|
}
.el-col {
|
|
123
124
125
126
|
line-height: 36px;
}
.el-tag {
font-size: 14px;
|
|
127
|
}
|
|
128
129
130
131
132
133
134
135
136
137
|
</style>
<style>
.authorize {
.descriptions-label {
text-align: right !important;
/* color:black !important; */
}
.el-textarea__inner {
min-height: 200px !important;
}
|
|
138
139
|
}
</style>
|