Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tokcos-socket-web-ts
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
小豪
tokcos-socket-web-ts
Commits
0da2ba73
提交
0da2ba73
authored
5月 08, 2024
作者:
Hao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
父级
5d5d76fa
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
82 行增加
和
30 行删除
+82
-30
.env.development
+2
-2
index.html
+1
-1
src/components/AutomaticPrompt.vue
+4
-6
src/router/index.ts
+2
-2
src/test.ts
+30
-0
src/views/HomeView.vue
+42
-19
vite.config.ts
+1
-0
没有找到文件。
.env.development
浏览文件 @
0da2ba73
NODE_ENV=development
VITE_USER_APP_API_URL=192.168.31.112
\ No newline at end of file
VITE_USER_APP_API_URL=192.168.31.120
\ No newline at end of file
index.html
浏览文件 @
0da2ba73
...
...
@@ -29,7 +29,7 @@
let
fontSize
=
Math
.
floor
((
currentWidth
/
targetWidth
)
*
16
);
// 4.开始缩放网页
console
.
log
(
scaleRatio
,
fontSize
,
'scaleRatio'
)
document
.
body
.
style
=
`font-size:
${
fontSize
}
px`
;
//
document.body.style = `font-size:${fontSize}px`;
console
.
log
(
document
.
body
,
' document.body'
)
}
</script>
...
...
src/components/AutomaticPrompt.vue
浏览文件 @
0da2ba73
...
...
@@ -101,10 +101,9 @@ const fileImgChange = async () => {
}
const
setfileEvent
=
async
(
file
:
any
)
=>
{
var
html
=
''
const
{
success
,
result
}:
any
=
await
upLoadFilesHander
(
file
)
const
{
result
}:
any
=
await
upLoadFilesHander
(
file
)
const
uploadRes
=
result
if
(
!
uploadRes
)
return
console
.
log
(
file
.
type
)
if
(
file
.
type
.
includes
(
'image'
))
{
html
=
await
getImageObject
(
uploadRes
,
...
...
@@ -114,7 +113,6 @@ const setfileEvent = async (file: any) => {
}
else
{
html
=
await
getFileObject
(
uploadRes
,
file
)
}
elAutocomplete
.
value
.
innerHTML
+=
html
.
outerHTML
inputVal
.
value
+=
html
.
outerHTML
elAutocomplete
.
value
.
focus
()
...
...
@@ -190,9 +188,8 @@ const getFileObject = (url: any, oFile: any) => {
var
aTag
=
document
.
createElement
(
'a'
)
aTag
.
href
=
url
aTag
.
download
=
oFile
.
name
// aTag.setAttribute('href', url)
aTag
.
target
=
'view_window'
aTag
.
textContent
=
oFile
.
name
// aTag.setAttribute('download', oFile.name)
console
.
log
(
aTag
,
'aTag'
)
return
aTag
}
...
...
@@ -274,7 +271,8 @@ defineExpose({
}
.el-autocomplete
{
width
:
100%
;
height
:
calc
(
100vh
-
732px
);
height
:
calc
(
100vh
-
60vh
-
130px
);
font-size
:
14px
;
max-width
:
100%
;
overflow
:
auto
;
}
...
...
src/router/index.ts
浏览文件 @
0da2ba73
...
...
@@ -4,13 +4,13 @@ const routes: Array<RouteRecordRaw> = [
path
:
"/"
,
name
:
"home"
,
component
:
()
=>
import
(
/* webpackChunkName: "
about" */
"../views/H
omeView.vue"
),
import
(
/* webpackChunkName: "
home" */
"../views/h
omeView.vue"
),
},
{
path
:
"/login"
,
name
:
"login"
,
component
:
()
=>
import
(
/* webpackChunkName: "
about
" */
"../views/loginView.vue"
),
import
(
/* webpackChunkName: "
login
" */
"../views/loginView.vue"
),
},
{
path
:
"/loging"
,
...
...
src/test.ts
0 → 100644
浏览文件 @
0da2ba73
//匿名类型var
declare
var
MyPoint
:
{
x
:
number
;
y
:
number
};
//接口类型var
interface
SomePoint
{
x
:
number
;
y
:
number
;
}
declare
var
MyPoint1
:
SomePoint
;
interface
SomePoint
{
z
:
number
;
}
MyPoint1
.
z
=
4
;
//ok
//类的分解
// TypeScript的类会创建出两个类型:实例类型,定义了类型的实例具有哪些成员;构造函数类型,定义了类构造函数具有哪些类型。构造函数类型也被称做类的静态部分类型,因为它包含了类的静态成员,你可以使用typeof关键词来拿到类静态部分类型,在写声明文件时,想要把类明确的分解成实例类型和静态类型时有用且必要的。
// 下面是一个例子,从使用者的角度来看,这是两个声明是等同的:
//标准版
class
A
{
static
st
:
string
;
inst
:
number
;
constructor
(
m
:
any
){
}
}
//分解版
interface
A_Static
{
new
(
m
:
any
):
A_Instance
;
st
:
string
;
}
interface
\ No newline at end of file
src/views/HomeView.vue
浏览文件 @
0da2ba73
...
...
@@ -79,6 +79,7 @@
v-if=
"message.msgType == 3"
:class=
"getMessageClass(message)"
@
click
.
prevent=
"handleMessageClick($event)"
@
contextmenu=
"showContextMenu($event, message, callbackFn)"
>
<div
class=
"classSendLink"
>
<div
class=
"classSendDiv"
>
...
...
@@ -103,6 +104,7 @@
<div
class=
"message-container message-container-left"
v-else-if=
"message.msgType == 4"
@
contextmenu=
"showContextMenu($event, message, callbackFn)"
>
<div
class=
"inquiry-list"
>
<div
class=
"inquiry-top"
>
...
...
@@ -128,7 +130,8 @@
</div>
<div
class=
"design-requirements"
>
<div>
{{
message
.
content
.
flieName
}}
</div>
<div
class=
"img"
>
<div
class=
"img"
@
click=
"downLoad(message)"
>
<!--
<a
:href=
"message.content.flie"
>
Tech design requirements.pdf
</a>
-->
<img
:src=
"require('../assets/icon_download.png')"
/>
</div>
</div>
...
...
@@ -207,11 +210,10 @@
>
<div
style=
"width: 400px;"
>
<div
class=
"shrink-text"
@
click=
"changeiShrink"
>
<el-icon
size=
"
30
"
>
<el-icon
size=
"
15
"
>
<DArrowLeft
v-if=
"isShrink"
/>
<DArrowRight
v-if=
"!isShrink"
/>
</el-icon>
</div>
<div>
<el-header
class=
"el-header-right"
>
...
...
@@ -417,18 +419,16 @@ const defaultStyle: {
}
let
queryParams
=
ref
({})
const
connectMsg
=
()
=>
{
// const useUser = useUserStore()
const
toIp
=
`ws://
${
const
toUrl
=
`ws://
${
import
.
meta
.
env
.
VITE_USER_APP_API_URL
}
:8081?type=kf&code=
${
getUseUserStore
.
userInfo
?.
username
}
`
getUseUserStore.connect()
initWebSocket(to
Ip
)
initWebSocket(to
Url
)
getUserList()
}
onMounted(() => {
connectMsg()
})
const getUserList = (queryParams: any) => {
getUseUserStore.setUserListMessages(queryParams).then((res: any) => {
list.value = getUseUserStore.userList
...
...
@@ -608,7 +608,6 @@ const getMenuItem = (item: any) => {
//收缩
const vShrink: Directive<HTMLElement, boolean | Props> = {
mounted(el, binding) {
console.log(el, binding, '打印')
let { option } = formatCOlorOption(binding.value)
option.isUpdate && renderStyle(el, option)
},
...
...
@@ -648,17 +647,16 @@ function formatCOlorOption(val: string | Props) {
option,
}
}
const openWindow = (event: any) => {
urlDownload(event)
// window.open(event)
}
//点击消息框中的文字或者图片
const handleMessageClick = (event: any) => {
const target = event.target
if (target.tagName === 'A') {
if (target.innerHTML === '解决') {
alert('感谢您的使用')
} else if (target.innerHTML === '未解决') {
alert('很抱歉未能解决你的问题')
} else {
handleLinkClick(target.innerHTML)
}
console.log(target.href, 'tagName')
if (target.tagName == 'A') {
openWindow(target.href)
} else if (target.tagName === 'IMG') {
// 点击的图片进行放大操作
ImageViewer({
...
...
@@ -673,6 +671,23 @@ const handleMessageClick = (event: any) => {
})
}
}
// 地址下载,fileName暂无作用
const urlDownload = (url, fileName = '下载文件') => {
console.log(url, 'url')
// 创建隐藏的可下载链接
let eleLink = document.createElement('a')
eleLink.download = fileName
eleLink.style.display = 'none'
eleLink.href = url
// 触发点击
document.body.appendChild(eleLink)
eleLink.click()
// 然后移除
console.log(url, '下载url')
document.body.removeChild(eleLink)
}
const handleLinkClick = (msg: string) => {
messages.value.push({ content: msg, isSent: true })
}
...
...
@@ -683,6 +698,9 @@ const selectionChange = (arr: any) => {
return item
})
}
const downLoad = (message: any) => {
urlDownload(message.content.flieUrl)
}
</
script
>
<
style
lang=
"scss"
scoped
>
.shirnk-aside
{
...
...
@@ -693,9 +711,14 @@ const selectionChange = (arr: any) => {
position
:
absolute
;
top
:
50%
;
transform
:
translate
(
-50%
);
width
:
20px
;
height
:
20px
;
left
:
-20px
;
line-height
:
15px
;
height
:
15px
;
text-align
:
center
;
display
:
flex
;
justify-content
:
center
;
align-items
:
center
;
width
:
15px
;
left
:
-12px
;
font-size
:
10px
;
}
}
...
...
vite.config.ts
浏览文件 @
0da2ba73
...
...
@@ -23,6 +23,7 @@ export default defineConfig({
],
server
:
{
host
:
"0.0.0.0"
,
overlay
:
true
,
port
:
8082
,
open
:
false
,
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论