large-model-component 1.0.0 → 1.0.2
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/README.md +1 -1
- package/dist/img/blue_tip.2d17b827.png +0 -0
- package/dist/large-model-component.common.js +9094 -141318
- package/dist/large-model-component.common.js.map +1 -1
- package/dist/large-model-component.css +1 -1
- package/dist/large-model-component.umd.js +9098 -141322
- package/dist/large-model-component.umd.js.map +1 -1
- package/dist/large-model-component.umd.min.js +6 -31
- package/dist/large-model-component.umd.min.js.map +1 -1
- package/docs/comps/README.md +1 -1
- package/package.json +10 -16
- package/packages/footer/footer.vue +346 -0
- package/packages/footer/index.js +2 -0
- package/packages/header/header.vue +516 -0
- package/packages/header/index.js +3 -0
- package/packages/index.js +7 -3
- package/packages/model/index.js +3 -0
- package/packages/{largeModel/index.vue → model/model.vue} +25 -64
- package/packages/upload/index.js +2 -0
- package/packages/upload/src/ajax.js +156 -0
- package/packages/upload/src/index.vue +329 -0
- package/packages/upload/src/upload-dragger.vue +70 -0
- package/packages/upload/src/upload-list.vue +94 -0
- package/packages/upload/src/upload.vue +274 -0
- package/src/App.vue +240 -2
- package/src/assets/blue_tip.png +0 -0
- package/src/assets/gray_tip.png +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/HelloWorld.vue +59 -0
- package/{packages/largeModel → src/components}/contentFold.vue +13 -0
- package/src/main.js +0 -5
- package/src/utils/request.js +3 -11
- package/tests/unit/example.spec.js +12 -0
- package/.env +0 -2
- package/.env.development +0 -2
- package/.env.production +0 -2
- package/dist/css/248.e455a0b7.css +0 -1
- package/dist/css/712.3716bdaf.css +0 -1
- package/dist/css/792.3716bdaf.css +0 -1
- package/dist/img/ai-chart.167a7713.png +0 -0
- package/dist/img/scrol-bg.f446933a.png +0 -0
- package/dist/img/zhijing-model.6a81c5a7.png +0 -0
- package/dist/large-model-component.common.712.js +0 -73
- package/dist/large-model-component.common.712.js.map +0 -1
- package/dist/large-model-component.umd.792.js +0 -73
- package/dist/large-model-component.umd.792.js.map +0 -1
- package/dist/large-model-component.umd.min.248.js +0 -2
- package/dist/large-model-component.umd.min.248.js.map +0 -1
- package/packages/largeModel/index.js +0 -2
- package/src/assets/css/app.css +0 -3255
- package/src/assets/css/chunk-vendors.css +0 -2071
- package/src/assets/css/github-markdown.css +0 -985
- package/src/router/index.js +0 -20
- package/src/store/index.js +0 -26
- package/src/utils/auth.js +0 -48
- package/src/utils/index.js +0 -111
- package/src/utils/spceialistConfig.js +0 -44
- package/src/utils/tool.js +0 -4
- package/src/utils/validate.js +0 -20
- /package/{packages/largeModel → src/utils}/pubsub.js +0 -0
- /package/{packages/largeModel → src/utils}/wsconnecter.js +0 -0
|
@@ -0,0 +1,516 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="navigation">
|
|
3
|
+
<div class="logo">
|
|
4
|
+
<img :src="logoUrl" @click="jumpLink(domainUrl, '0')" loading="lazy"/>
|
|
5
|
+
</div>
|
|
6
|
+
<div v-if="useSlot" class="column">
|
|
7
|
+
<slot></slot>
|
|
8
|
+
</div>
|
|
9
|
+
<div v-else class="column">
|
|
10
|
+
<div
|
|
11
|
+
:class="['column-item', { activeColumn: item.columnLink === activeTabLink }]"
|
|
12
|
+
v-for="(item, index) in columns"
|
|
13
|
+
:key="index"
|
|
14
|
+
>
|
|
15
|
+
<div class="item-title">
|
|
16
|
+
<span v-if="item.child.length !== 0">{{ item.columnName }}</span>
|
|
17
|
+
<span v-else @click="jumpLink(item.columnLink, item.runType)">{{ item.columnName }}</span>
|
|
18
|
+
</div>
|
|
19
|
+
|
|
20
|
+
<div class="titleStacked">
|
|
21
|
+
<ul class="ulBack">
|
|
22
|
+
<li
|
|
23
|
+
v-for="(child, index) in item.child"
|
|
24
|
+
class="liStyle liStyleBorder"
|
|
25
|
+
@click="jumpLink(child.columnLink, child.runType)"
|
|
26
|
+
>
|
|
27
|
+
{{ child.columnName }}
|
|
28
|
+
</li>
|
|
29
|
+
</ul>
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<div class="user">
|
|
35
|
+
<div v-if="showWorkBench" class="workbench" @click="goToWorkBench()">工作台</div>
|
|
36
|
+
<div v-if="userName" class="userInfo">
|
|
37
|
+
<div class="user_box">
|
|
38
|
+
<div class="boxShow">
|
|
39
|
+
<svg
|
|
40
|
+
width="24"
|
|
41
|
+
height="24"
|
|
42
|
+
viewBox="0 0 32 32"
|
|
43
|
+
version="1.1"
|
|
44
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
45
|
+
xmlns:xlink="http://www.w3.org/1999/xlink"
|
|
46
|
+
>
|
|
47
|
+
<title>用户</title>
|
|
48
|
+
<g id="门户" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
|
|
49
|
+
<g
|
|
50
|
+
id="门户展示-列表"
|
|
51
|
+
transform="translate(-1864.000000, -14.000000)"
|
|
52
|
+
fill-rule="nonzero"
|
|
53
|
+
>
|
|
54
|
+
<g id="编组-2" transform="translate(1864.000000, 14.000000)">
|
|
55
|
+
<circle id="椭圆形" cx="16" cy="16" r="16"></circle>
|
|
56
|
+
<g id="download" transform="translate(8.000000, 6.000000)" fill="#111111">
|
|
57
|
+
<path
|
|
58
|
+
d="M8.41057817,15.9983436 C8.10196301,16.0018058 7.79205942,16.0212191 7.482,16.057 C7.48146725,16.049642 7.48092091,16.0422857 7.48036097,16.0349309 C5.3035271,16.2311728 3.2500542,17.2191848 1.73039832,18.847 C1.48602866,19.1078039 1.12108456,19.218427 0.773036936,19.1371986 C0.424989313,19.0559702 0.146714881,18.7952308 0.0430369276,18.4531986 C-0.0606410258,18.1111663 0.0260286478,17.7398039 0.27039832,17.479 C2.34812512,15.2561793 5.25572425,13.9961473 8.29839832,13.9999912 L8.399,14.001 L8.5,13.9999912 C11.4299824,13.9962896 14.2347102,15.1645773 16.2937617,17.2359973 L16.528,17.479 C16.7723697,17.7398039 16.8590393,18.1111663 16.7553614,18.4531986 C16.6516834,18.7952308 16.373409,19.0559702 16.0253614,19.1371986 C15.6773138,19.218427 15.3123697,19.1078039 15.068,18.847 C13.5483214,17.2191605 11.4948098,16.2311432 9.3188441,16.0342463 L9.31639832,16.057 L9.31639832,16.057 C9.11438991,16.0336882 8.91244764,16.017324 8.71088475,16.0077922 Z M8.25039832,0 C11.702178,0 14.5003983,2.79822031 14.5003983,6.25 C14.5003983,9.70177969 11.702178,12.5 8.25039832,12.5 C4.79861863,12.5 2.00039832,9.70177969 2.00039832,6.25 C2.00039832,2.79822031 4.79861863,0 8.25039832,0 Z M8.25039832,2 C6.73201955,2 5.32897969,2.8100454 4.5697903,4.12499998 C3.81060091,5.43995457 3.81060091,7.06004543 4.5697903,8.37500002 C5.32897969,9.6899546 6.73201955,10.5 8.25039832,10.5 C10.5976085,10.5 12.5003983,8.59721016 12.5003983,6.25 C12.5003983,3.90278984 10.5976085,2 8.25039832,2 Z"
|
|
59
|
+
id="形状"
|
|
60
|
+
></path>
|
|
61
|
+
</g>
|
|
62
|
+
</g>
|
|
63
|
+
</g>
|
|
64
|
+
</g>
|
|
65
|
+
</svg>
|
|
66
|
+
</div>
|
|
67
|
+
<div class="navStacked">
|
|
68
|
+
<ul class="ulBack">
|
|
69
|
+
<li class="liStyleEnd"></li>
|
|
70
|
+
<li class="liStyle liStyleBorder">{{ userName }}</li>
|
|
71
|
+
<li
|
|
72
|
+
v-for="(link, index) in userLinks"
|
|
73
|
+
class="liStyle liStyleBorder"
|
|
74
|
+
@click="jumpLink(link.link_url, link.way)"
|
|
75
|
+
>
|
|
76
|
+
{{ link.link_name }}
|
|
77
|
+
</li>
|
|
78
|
+
<li class="liStyle" @click="logout()">退出登录</li>
|
|
79
|
+
<li class="liStyleEnd"></li>
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
<div v-if="token !== ''" class="message">
|
|
83
|
+
<el-badge :value="msgCountInfo.unReadCnt">
|
|
84
|
+
<img
|
|
85
|
+
:src="msgCountInfo.unReadCnt > 0 ? require('@/assets/blue_tip.png') : require('@/assets/gray_tip.png')"
|
|
86
|
+
class="badge-image"
|
|
87
|
+
alt=""
|
|
88
|
+
@click="handleJump"/>
|
|
89
|
+
</el-badge>
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
</div>
|
|
93
|
+
<div class="login" v-else @click="jumpLink(loginUrl, '0')">登录/注册</div>
|
|
94
|
+
</div>
|
|
95
|
+
</div>
|
|
96
|
+
</template>
|
|
97
|
+
|
|
98
|
+
<script>
|
|
99
|
+
import {EventSourcePolyfill} from 'event-source-polyfill';
|
|
100
|
+
import axios from "axios";
|
|
101
|
+
|
|
102
|
+
export default {
|
|
103
|
+
name: 'iipHeader',
|
|
104
|
+
props: {
|
|
105
|
+
showWorkBench: {
|
|
106
|
+
type: Boolean,
|
|
107
|
+
default: false,
|
|
108
|
+
},
|
|
109
|
+
logoUrl: {
|
|
110
|
+
type: String,
|
|
111
|
+
default: '',
|
|
112
|
+
},
|
|
113
|
+
loginUrl: {
|
|
114
|
+
type: String,
|
|
115
|
+
default: '',
|
|
116
|
+
},
|
|
117
|
+
columns: {
|
|
118
|
+
type: Array,
|
|
119
|
+
default: () => [],
|
|
120
|
+
},
|
|
121
|
+
userName: {
|
|
122
|
+
type: String,
|
|
123
|
+
default: '',
|
|
124
|
+
},
|
|
125
|
+
userLinks: {
|
|
126
|
+
type: Array,
|
|
127
|
+
default: () => {
|
|
128
|
+
let url = '';
|
|
129
|
+
if (typeof window !== 'undefined') {
|
|
130
|
+
url = window.location.origin + '/account-web/';
|
|
131
|
+
} else {
|
|
132
|
+
url = '';
|
|
133
|
+
}
|
|
134
|
+
return [
|
|
135
|
+
{
|
|
136
|
+
link_name: '账号中心',
|
|
137
|
+
link_url: url,
|
|
138
|
+
way: '1',
|
|
139
|
+
},
|
|
140
|
+
];
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
domainUrl: {
|
|
144
|
+
type: String,
|
|
145
|
+
default: () => {
|
|
146
|
+
let url = '';
|
|
147
|
+
if (typeof window !== 'undefined') {
|
|
148
|
+
url = window.location.origin;
|
|
149
|
+
} else {
|
|
150
|
+
url = '';
|
|
151
|
+
}
|
|
152
|
+
return url;
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
useSlot: {
|
|
156
|
+
type: Boolean,
|
|
157
|
+
default: false,
|
|
158
|
+
},
|
|
159
|
+
token: {
|
|
160
|
+
type: String,
|
|
161
|
+
default: '',
|
|
162
|
+
}
|
|
163
|
+
},
|
|
164
|
+
data() {
|
|
165
|
+
return {
|
|
166
|
+
activeTabLink: '',
|
|
167
|
+
msgCountInfo: {
|
|
168
|
+
readCnt: 0, // 已读
|
|
169
|
+
unReadCnt: 0, // 未读
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
},
|
|
173
|
+
mounted() {
|
|
174
|
+
if (this.token !== '') {
|
|
175
|
+
this.startEventSource()
|
|
176
|
+
this.getCount()
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
created() {
|
|
180
|
+
this.activeTab();
|
|
181
|
+
},
|
|
182
|
+
methods: {
|
|
183
|
+
activeTab() {
|
|
184
|
+
if (typeof window !== 'undefined') {
|
|
185
|
+
const pathName = window.location.pathname;
|
|
186
|
+
this.columns.map((column) => {
|
|
187
|
+
if (column.columnLink.indexOf(pathName) > -1 && pathName !== '/' && pathName !== '/service-web/') {
|
|
188
|
+
if (!this.activeTabLink) {
|
|
189
|
+
this.activeTabLink = column.columnLink;
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
if (column.child && column.child.length > 0) {
|
|
193
|
+
column.child.map((childColumn) => {
|
|
194
|
+
if (childColumn.columnLink.indexOf(pathName) > -1 && pathName !== '/' && pathName !== '/service-web/') {
|
|
195
|
+
if (!this.activeTabLink) {
|
|
196
|
+
this.activeTabLink = column.columnLink;
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
},
|
|
205
|
+
jumpLink(url, way) {
|
|
206
|
+
if (url && url.indexOf('http') > -1) {
|
|
207
|
+
window.open(url, way == '0' ? '_self' : '_blank');
|
|
208
|
+
} else {
|
|
209
|
+
window.open(window.location.origin + url, way == '0' ? '_self' : '_blank');
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
logout() {
|
|
213
|
+
this.$emit('log-out');
|
|
214
|
+
},
|
|
215
|
+
goToWorkBench() {
|
|
216
|
+
this.$emit('go-work-bench');
|
|
217
|
+
},
|
|
218
|
+
apiRequestWithToken(method, url, data) {
|
|
219
|
+
return axios({
|
|
220
|
+
method: method,
|
|
221
|
+
url: url,
|
|
222
|
+
data: data, // 仅当method为POST或PUT时需要使用data,对于GET则使用params或URL查询字符串。
|
|
223
|
+
headers: {
|
|
224
|
+
'Authorization': 'Bearer ' + this.token,
|
|
225
|
+
'Content-Type': 'application/json' // 根据需要添加其他头部信息,例如Content-Type。
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
},
|
|
229
|
+
getCount() {
|
|
230
|
+
this.apiRequestWithToken('get', `${window.location.origin}/gateway/manage/message/my/message/read/count`)
|
|
231
|
+
// this.apiRequestWithToken('get', `http://dev.inspuriip.com:8083/gateway/manage/message/my/message/read/count`)
|
|
232
|
+
.then(res => {
|
|
233
|
+
console.log('res==>', res);
|
|
234
|
+
if (res.data && res.data.code === 200) {
|
|
235
|
+
this.msgCountInfo.readCnt = res.data.data.readCnt
|
|
236
|
+
this.msgCountInfo.unReadCnt = res.data.data.unReadCnt
|
|
237
|
+
console.log('msgCountInfo', this.msgCountInfo)
|
|
238
|
+
}
|
|
239
|
+
})
|
|
240
|
+
.catch(error => {
|
|
241
|
+
console.error(error);
|
|
242
|
+
});
|
|
243
|
+
},
|
|
244
|
+
startEventSource() {
|
|
245
|
+
if (!this.eventSource) {
|
|
246
|
+
const url = `${window.location.origin}/gateway/manage/message/sse/connect`
|
|
247
|
+
this.eventSource = new EventSourcePolyfill(url, {
|
|
248
|
+
headers: {
|
|
249
|
+
Authorization: 'Bearer ' + this.token,
|
|
250
|
+
}
|
|
251
|
+
})
|
|
252
|
+
this.eventSource.onopen = this.handleOpen
|
|
253
|
+
this.eventSource.onmessage = this.handleMessage
|
|
254
|
+
this.eventSource.onerror = this.handleError
|
|
255
|
+
}
|
|
256
|
+
},
|
|
257
|
+
|
|
258
|
+
handleOpen(event) {
|
|
259
|
+
console.log('connect success', event)
|
|
260
|
+
},
|
|
261
|
+
handleMessage(event) {
|
|
262
|
+
console.log('接收到消息', event.data)
|
|
263
|
+
const data = event.data
|
|
264
|
+
if (data === 'success') {
|
|
265
|
+
this.$message.success('您有新的消息请注意及时查看~')
|
|
266
|
+
this.getCount()
|
|
267
|
+
}
|
|
268
|
+
},
|
|
269
|
+
handleError(event) {
|
|
270
|
+
const time = new Date().toISOString()
|
|
271
|
+
console.log('connect error', time, event)
|
|
272
|
+
},
|
|
273
|
+
stopEventSource() {
|
|
274
|
+
if (this.eventSource) {
|
|
275
|
+
this.eventSource.close()
|
|
276
|
+
this.eventSource = null
|
|
277
|
+
}
|
|
278
|
+
},
|
|
279
|
+
handleJump() {
|
|
280
|
+
window.open(`${window.location.origin}/message-manage-web/messageCenter/myMessage`, '_blank');
|
|
281
|
+
},
|
|
282
|
+
},
|
|
283
|
+
beforeDestroy() {
|
|
284
|
+
this.stopEventSource()
|
|
285
|
+
},
|
|
286
|
+
};
|
|
287
|
+
</script>
|
|
288
|
+
<style lang="scss" scoped>
|
|
289
|
+
.custom-badge ::v-deep(.el-badge__content) {
|
|
290
|
+
background-color: transparent; /* 隐藏默认背景 */
|
|
291
|
+
border: none; /* 移除边框 */
|
|
292
|
+
padding: 0; /* 去除内边距 */
|
|
293
|
+
font-size: 0; /* 隐藏默认文本 */
|
|
294
|
+
transform: translate(80%, -80%); /* 调整图片位置 */
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.badge-image {
|
|
298
|
+
width: 20px; /* 控制图片大小 */
|
|
299
|
+
height: 20px;
|
|
300
|
+
display: block; /* 确保图片正确渲染 */
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.navigation {
|
|
304
|
+
width: 100%;
|
|
305
|
+
height: 72px;
|
|
306
|
+
background: #ffffff;
|
|
307
|
+
box-shadow: 8px 8px 20px 0px rgba(55, 99, 170, 0.1);
|
|
308
|
+
display: flex;
|
|
309
|
+
|
|
310
|
+
.logo {
|
|
311
|
+
width: 330px;
|
|
312
|
+
line-height: 72px;
|
|
313
|
+
|
|
314
|
+
img {
|
|
315
|
+
margin-left: 24px;
|
|
316
|
+
height: 32px;
|
|
317
|
+
vertical-align: middle;
|
|
318
|
+
cursor: pointer;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
|
|
322
|
+
.column {
|
|
323
|
+
flex: 1;
|
|
324
|
+
height: 100%;
|
|
325
|
+
display: flex;
|
|
326
|
+
|
|
327
|
+
.column-item {
|
|
328
|
+
position: relative;
|
|
329
|
+
padding-right: 48px;
|
|
330
|
+
|
|
331
|
+
.item-title {
|
|
332
|
+
height: 48px;
|
|
333
|
+
padding-top: 24px;
|
|
334
|
+
font-size: 14px;
|
|
335
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
|
336
|
+
font-weight: 400;
|
|
337
|
+
color: #3d485d;
|
|
338
|
+
line-height: 24px;
|
|
339
|
+
cursor: pointer;
|
|
340
|
+
|
|
341
|
+
&:hover {
|
|
342
|
+
font-weight: 600;
|
|
343
|
+
color: #064eab;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
|
|
347
|
+
.item-title:hover + .titleStacked {
|
|
348
|
+
display: block;
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
.titleStacked {
|
|
352
|
+
display: none;
|
|
353
|
+
position: absolute;
|
|
354
|
+
top: 72px;
|
|
355
|
+
|
|
356
|
+
.ulBack {
|
|
357
|
+
list-style: none;
|
|
358
|
+
min-width: 100px;
|
|
359
|
+
background-color: #fff;
|
|
360
|
+
border: 1px solid #E4E4E4;
|
|
361
|
+
padding-inline-start: 0px;
|
|
362
|
+
|
|
363
|
+
padding-left: 5px;
|
|
364
|
+
padding-right: 5px;
|
|
365
|
+
|
|
366
|
+
.liStyleBorder {
|
|
367
|
+
border-bottom: 1px solid #E4E4E4;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
.liStyle {
|
|
371
|
+
text-align: center;
|
|
372
|
+
margin-top: 10px;
|
|
373
|
+
|
|
374
|
+
font-size: 14px;
|
|
375
|
+
height: 32px;
|
|
376
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
|
377
|
+
font-weight: 400;
|
|
378
|
+
color: #5b606a;
|
|
379
|
+
}
|
|
380
|
+
|
|
381
|
+
.liStyle:hover {
|
|
382
|
+
background-color: #ebf3fe;
|
|
383
|
+
color: #064eab;
|
|
384
|
+
cursor: pointer;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
.liStyleEnd {
|
|
388
|
+
height: 10px;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
.titleStacked:hover {
|
|
394
|
+
display: block;
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
.activeColumn {
|
|
399
|
+
.item-title {
|
|
400
|
+
color: #1772f6;
|
|
401
|
+
font-weight: bolder;
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
.user {
|
|
407
|
+
display: flex;
|
|
408
|
+
width: 200px;
|
|
409
|
+
height: 72px;
|
|
410
|
+
padding-top: 16px;
|
|
411
|
+
padding-right: 32px;
|
|
412
|
+
justify-content: flex-end;
|
|
413
|
+
text-align: center;
|
|
414
|
+
cursor: pointer;
|
|
415
|
+
|
|
416
|
+
.workbench {
|
|
417
|
+
height: 24px;
|
|
418
|
+
font-size: 14px;
|
|
419
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
|
420
|
+
font-weight: 400;
|
|
421
|
+
color: #3d485d;
|
|
422
|
+
line-height: 24px;
|
|
423
|
+
padding-right: 24px;
|
|
424
|
+
padding-top: 8px;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
.userInfo {
|
|
428
|
+
position: relative;
|
|
429
|
+
font-size: 18px;
|
|
430
|
+
font-family: PingFangSC-Medium, PingFang SC;
|
|
431
|
+
padding-top: 8px;
|
|
432
|
+
|
|
433
|
+
.user_box {
|
|
434
|
+
display: flex;
|
|
435
|
+
flex-direction: row;
|
|
436
|
+
|
|
437
|
+
.boxShow {
|
|
438
|
+
margin-right: 10px;
|
|
439
|
+
|
|
440
|
+
img {
|
|
441
|
+
width: 24px;
|
|
442
|
+
height: 24px;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
.boxShow:hover + .navStacked {
|
|
447
|
+
display: block;
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
.navStacked {
|
|
451
|
+
display: none;
|
|
452
|
+
position: absolute;
|
|
453
|
+
top: 30px;
|
|
454
|
+
left: -40px;
|
|
455
|
+
z-index: 9999;
|
|
456
|
+
|
|
457
|
+
.ulBack {
|
|
458
|
+
list-style: none;
|
|
459
|
+
width: 100px;
|
|
460
|
+
background-color: #fff;
|
|
461
|
+
border: 1px solid #E4E4E4;
|
|
462
|
+
padding-inline-start: 0px;
|
|
463
|
+
|
|
464
|
+
.liStyleBorder {
|
|
465
|
+
border-bottom: 1px solid #E4E4E4;
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
.liStyle {
|
|
469
|
+
text-align: center;
|
|
470
|
+
padding: 5px;
|
|
471
|
+
font-size: 14px;
|
|
472
|
+
font-family: PingFangSC-Regular, PingFang SC;
|
|
473
|
+
font-weight: 400;
|
|
474
|
+
color: #5b606a;
|
|
475
|
+
|
|
476
|
+
width: 100%;
|
|
477
|
+
overflow: hidden;
|
|
478
|
+
text-overflow: ellipsis;
|
|
479
|
+
box-sizing: border-box;
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
.liStyle:hover {
|
|
483
|
+
background-color: #ebf3fe;
|
|
484
|
+
color: #064eab;
|
|
485
|
+
cursor: pointer;
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
.liStyleEnd {
|
|
489
|
+
height: 10px;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
.navStacked:hover {
|
|
495
|
+
display: block;
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
.login {
|
|
502
|
+
font-family: PingFangSC-Medium, PingFang SC;
|
|
503
|
+
background: #064eab;
|
|
504
|
+
width: 100px;
|
|
505
|
+
height: 24px;
|
|
506
|
+
padding-top: 8px;
|
|
507
|
+
padding-bottom: 8px;
|
|
508
|
+
font-size: 14px;
|
|
509
|
+
|
|
510
|
+
font-weight: 400;
|
|
511
|
+
color: #ffffff;
|
|
512
|
+
line-height: 24px;
|
|
513
|
+
}
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
</style>
|
package/packages/index.js
CHANGED
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
// 定义 install 方法,接收 Vue 作为参数。如果使用 use 注册插件,则所有的组件都将被注册
|
|
3
3
|
// 统一导出
|
|
4
4
|
// 导入颜色选择器组件
|
|
5
|
-
import
|
|
5
|
+
import iipHeader from './header';
|
|
6
|
+
import iipFooter from './footer';
|
|
7
|
+
import iipUpload from './upload';
|
|
6
8
|
|
|
7
9
|
// 存储组件列表
|
|
8
|
-
const components = [
|
|
10
|
+
const components = [iipHeader, iipFooter, iipUpload];
|
|
9
11
|
const install = function (Vue, options = {}) {
|
|
10
12
|
// 全局注册所有的组件
|
|
11
13
|
components.forEach((item) => {
|
|
@@ -23,5 +25,7 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
23
25
|
|
|
24
26
|
export default {
|
|
25
27
|
install,
|
|
26
|
-
|
|
28
|
+
iipHeader,
|
|
29
|
+
iipFooter,
|
|
30
|
+
iipUpload,
|
|
27
31
|
};
|
|
@@ -161,20 +161,17 @@
|
|
|
161
161
|
|
|
162
162
|
<div class="input-tools">
|
|
163
163
|
<div class="left-tools">
|
|
164
|
-
<
|
|
165
|
-
|
|
166
|
-
<
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
/>
|
|
176
|
-
</div>
|
|
177
|
-
</el-tooltip>
|
|
164
|
+
<div class="upload-trigger">
|
|
165
|
+
<i class="el-icon-paperclip tool-icon" :class="{ 'tool-icon-disabled': loading }"></i>
|
|
166
|
+
<input
|
|
167
|
+
type="file"
|
|
168
|
+
id="fileInput"
|
|
169
|
+
@change="handleFileChange"
|
|
170
|
+
accept=".pdf,.doc,.docx,.txt,.pptx,.ppt,.xls,.xlsx,.png,.jpg,.jpeg,.gif,.webp,image/*"
|
|
171
|
+
:disabled="loading"
|
|
172
|
+
multiple
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
178
175
|
</div>
|
|
179
176
|
<el-button
|
|
180
177
|
type="primary"
|
|
@@ -206,15 +203,11 @@ import {
|
|
|
206
203
|
conversationPage,
|
|
207
204
|
deleteHistory,
|
|
208
205
|
historyDetail,
|
|
209
|
-
loginCas,
|
|
210
206
|
quickAccess as getQuickAccessApi,
|
|
211
207
|
suggestive,
|
|
212
208
|
votePort
|
|
213
209
|
} from "@/api/user";
|
|
214
|
-
import ContentFold from
|
|
215
|
-
|
|
216
|
-
const TOKEN_KEY = 'Industrial-Access-Token';
|
|
217
|
-
const CAS_LOGIN_URL = 'https://dticts.paas.casicloud.com/cas/login?service=';
|
|
210
|
+
import ContentFold from "@/components/contentFold";
|
|
218
211
|
|
|
219
212
|
const ALLOWED_EXTENSIONS = ['pdf', 'doc', 'docx', 'txt', 'pptx', 'ppt', 'xls', 'xlsx', 'jpg', 'jpeg', 'png', 'gif', 'webp'];
|
|
220
213
|
const MAX_FILE_SIZE = 10 * 1024 * 1024; // 10M
|
|
@@ -262,8 +255,7 @@ export default {
|
|
|
262
255
|
return this.pageParams.hasMore && !this.isSearching;
|
|
263
256
|
}
|
|
264
257
|
},
|
|
265
|
-
|
|
266
|
-
await this.handleCasCallback();
|
|
258
|
+
mounted() {
|
|
267
259
|
this.$nextTick(() => {
|
|
268
260
|
this.initScrollListener();
|
|
269
261
|
});
|
|
@@ -276,44 +268,6 @@ export default {
|
|
|
276
268
|
}
|
|
277
269
|
},
|
|
278
270
|
methods: {
|
|
279
|
-
// 处理 CAS 回调:如果 URL 带有 ticket,则用它换取 token
|
|
280
|
-
async handleCasCallback() {
|
|
281
|
-
const urlParams = new URLSearchParams(window.location.search);
|
|
282
|
-
const ticket = urlParams.get('ticket');
|
|
283
|
-
if (!ticket) return;
|
|
284
|
-
|
|
285
|
-
try {
|
|
286
|
-
// serviceUrl 是去掉 ticket 参数后的当前页面地址
|
|
287
|
-
const serviceUrl = window.location.origin + window.location.pathname;
|
|
288
|
-
const res = await loginCas({ ticket, serviceUrl });
|
|
289
|
-
const token = res.data?.data?.token;
|
|
290
|
-
if (token) {
|
|
291
|
-
localStorage.setItem(TOKEN_KEY, token);
|
|
292
|
-
// ticket 换取 token 成功后自动打开弹窗
|
|
293
|
-
this.openDialog();
|
|
294
|
-
}
|
|
295
|
-
} catch (e) {
|
|
296
|
-
console.error('CAS 登录失败:', e);
|
|
297
|
-
} finally {
|
|
298
|
-
// 清除 URL 中的 ticket 参数,避免刷新重复请求
|
|
299
|
-
const cleanUrl = window.location.origin + window.location.pathname;
|
|
300
|
-
window.history.replaceState({}, '', cleanUrl);
|
|
301
|
-
}
|
|
302
|
-
},
|
|
303
|
-
|
|
304
|
-
// 打开组件前先做 CAS 认证
|
|
305
|
-
open() {
|
|
306
|
-
window.location.href = CAS_LOGIN_URL + encodeURIComponent(location.href);
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
// CAS 认证完成后真正打开弹窗(由 handleCasCallback 成功后调用,或 token 已存在时直接调用)
|
|
310
|
-
openDialog() {
|
|
311
|
-
this.dialogVisible = true;
|
|
312
|
-
this.$nextTick(() => {
|
|
313
|
-
this.initData();
|
|
314
|
-
this.initScrollListener();
|
|
315
|
-
});
|
|
316
|
-
},
|
|
317
271
|
async stopGeneration() {
|
|
318
272
|
if (this.abortController && !this.abortController.signal.aborted) {
|
|
319
273
|
console.log('=== 触发停止生成 ===');
|
|
@@ -369,6 +323,13 @@ export default {
|
|
|
369
323
|
container.removeEventListener('scroll', this.handleHistoryScroll);
|
|
370
324
|
}
|
|
371
325
|
},
|
|
326
|
+
open() {
|
|
327
|
+
this.dialogVisible = true;
|
|
328
|
+
this.$nextTick(() => {
|
|
329
|
+
this.initData();
|
|
330
|
+
this.initScrollListener();
|
|
331
|
+
});
|
|
332
|
+
},
|
|
372
333
|
async initData() {
|
|
373
334
|
await this.getQuickAccess();
|
|
374
335
|
await this.changeFaq();
|
|
@@ -552,7 +513,7 @@ export default {
|
|
|
552
513
|
|
|
553
514
|
const parseFileList = this.files
|
|
554
515
|
.filter(f => f.type === 'document' && f.status === 'completed')
|
|
555
|
-
.map(f => ({
|
|
516
|
+
.map(f => ({fileId: f.id, fileName: f.name, markdown: f.parsedContent}));
|
|
556
517
|
const imageFiles = this.files
|
|
557
518
|
.filter(f => f.type === 'image' && f.status === 'completed')
|
|
558
519
|
.map(f => f.rawFile);
|
|
@@ -607,10 +568,10 @@ export default {
|
|
|
607
568
|
const decoder = new TextDecoder('utf-8');
|
|
608
569
|
|
|
609
570
|
while (true) {
|
|
610
|
-
const {
|
|
571
|
+
const {done, value} = await reader.read();
|
|
611
572
|
if (done) break;
|
|
612
573
|
|
|
613
|
-
const chunk = decoder.decode(value, {
|
|
574
|
+
const chunk = decoder.decode(value, {stream: true});
|
|
614
575
|
if (chunk) {
|
|
615
576
|
this.appendAnswer(chunk);
|
|
616
577
|
}
|
|
@@ -622,7 +583,7 @@ export default {
|
|
|
622
583
|
} catch (error) {
|
|
623
584
|
if (error.name === 'AbortError') {
|
|
624
585
|
console.log('请求已中止');
|
|
625
|
-
}else{
|
|
586
|
+
} else {
|
|
626
587
|
console.error('请求失败:', error);
|
|
627
588
|
this.loading = false;
|
|
628
589
|
const lastItem = this.conversation.dialogue[this.conversation.dialogue.length - 1];
|
|
@@ -632,7 +593,7 @@ export default {
|
|
|
632
593
|
lastItem.isStreaming = false;
|
|
633
594
|
}
|
|
634
595
|
}
|
|
635
|
-
}finally {
|
|
596
|
+
} finally {
|
|
636
597
|
this.loading = false;
|
|
637
598
|
this.abortController = null;
|
|
638
599
|
this.isCancelled = false;
|