viewConfig.vue
6.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!--
* @Author: your name
* @Date: 2022-02-16 18:11:11
* @LastEditTime: 2022-04-15 14:24:00
* @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-wechat\src\views\appConfig\viewConfit.vue
-->
<template>
<div class="config-container">
<div class="container-header">
<span>企微自建应用配置管理</span>
<el-popover placement="bottom" width="270" trigger="hover" content="提供企微自建应用的配置管理。">
<img src="@/assets/question.png" slot="reference" class="count-item-question" />
</el-popover>
</div>
<div class="config-content">
<div class="config-list">
<div class="config-title">使用配置</div>
<div class="config-item">
<div class="item-name">应用主页:</div>
<div class="item-url">
<el-input type="text" id="appHome" readonly class="url-input" v-model="configUrl.appHome"></el-input>
<span class="item-copy" @click="copyUrl('appHome')">
复制
<img src="@/assets/copy.png" alt="" />
</span>
</div>
</div>
</div>
<div class="config-list">
<div class="config-title">消息回调</div>
<div class="config-item">
<div class="item-name">消息回调URL:</div>
<div class="item-url">
<el-input type="text" id="callbackUrl" readonly class="url-input" v-model="configUrl.callbackUrl"></el-input>
<span class="item-copy" @click="copyUrl('callbackUrl')">
复制
<img src="@/assets/copy.png" alt="" />
</span>
</div>
</div>
<div class="config-item">
<div class="item-name">消息回调Token:</div>
<div class="item-url">
<el-input type="text" id="token" readonly class="url-input" v-model="configUrl.token"></el-input>
<span class="item-copy" @click="copyUrl('token')">
复制
<img src="@/assets/copy.png" alt="" />
</span>
</div>
</div>
<div class="config-item">
<div class="item-name">消息回调EncodingAESKey:</div>
<div class="item-url">
<el-input type="text" id="encodingAesKey" readonly class="url-input" v-model="configUrl.encodingAesKey"></el-input>
<span class="item-copy" @click="copyUrl('encodingAesKey')">
复制
<img src="@/assets/copy.png" alt="" />
</span>
</div>
</div>
</div>
<div class="config-list">
<div class="config-title">应用菜单</div>
<div class="config-item" v-for="(item, index) in configUrl.agentMenuList" :key="index">
<div class="item-name">{{ item.name }}:</div>
<div class="item-url">
<el-input type="text" :id="item.name" readonly class="url-input" v-model="item.url"></el-input>
<span class="item-copy" @click="copyUrl(item.name)">
复制
<img src="@/assets/copy.png" alt="" />
</span>
</div>
</div>
<!-- <div class="config-item">
<div class="item-name">工作台:</div>
<div class="item-url">
<el-input type="text" readonly class="url-input" v-model="configUrl.callbackUrl"></el-input>
http://scrm.test.glsx.com.cn/settings/account/index
<span class="item-copy">
复制
<img src="@/assets/copy.png" alt="" />
</span>
</div>
</div> -->
</div>
</div>
<!-- <GLFooter>
<el-button type="primary" @click="handleCancel">返回</el-button>
</GLFooter> -->
</div>
</template>
<script>
export default {
name: 'ViewConfig',
data() {
return {
appId: this.$route.params.appId,
configUrl: {
agentMenuList: []
}
}
},
created() {
this.getConfig(this.appId)
},
methods: {
async getConfig(appId) {
let configData = await this.$apis.appConfig.getAgentInfo({ appId })
this.$set(this, 'configUrl', configData)
},
copyUrl(id) {
var idVal = document.getElementById(id)
idVal.select()
document.execCommand('copy')
this.$message({
message: '复制成功',
type: 'success'
})
},
handleCancel() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.config {
&-container {
margin-bottom: 64px;
}
&-content {
margin-top: 20px;
padding: 20px;
background-color: #fff;
}
&-title {
position: relative;
font-size: 16px;
font-weight: 600;
color: #333333;
line-height: 28px;
margin-left: 16px;
&::before {
content: '';
display: inline-block;
position: absolute;
left: -16px;
top: 50%;
transform: translateY(-50%);
width: 4px;
height: 4px;
background-color: #5850ff;
border-radius: 50%;
}
}
&-list {
margin-bottom: 20px;
}
&-item {
margin-top: 20px;
margin-left: 16px;
font-weight: 400;
.item-name {
line-height: 20px;
color: #333333;
font-size: 14px;
margin-bottom: 10px;
}
.item-url {
position: relative;
width: 552px;
// overflow-x: auto;
// height: 36px;
// border: 1px solid #dce5ed;
font-size: 14px;
color: #999999;
// line-height: 36px;
// padding: 0 8px;
}
.url-input {
/deep/ {
.el-input__inner {
padding-right: 66px !important;
}
}
}
.item-copy {
position: absolute;
height: calc(100% - 2px);
right: 10px;
top: 50%;
transform: translateY(-50%);
color: #5850ff;
line-height: 20px;
display: inline-flex;
align-items: center;
background-color: #fff;
padding-left: 5px;
cursor: pointer;
img {
margin-left: 4px;
}
}
}
}
</style>
<style lang="scss"></style>