Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
T
tokcos-socket-web-ts-user
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
小豪
tokcos-socket-web-ts-user
Commits
7c587846
提交
7c587846
authored
5月 08, 2024
作者:
Hao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add
父级
3ed4e7f7
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
186 行增加
和
94 行删除
+186
-94
.env.development
+1
-2
auto-imports.d.ts
+1
-0
index.html
+1
-1
src/axios/index.ts
+0
-1
src/components/AutomaticPrompt.vue
+30
-30
src/minxins/UploadMixin.ts
+10
-8
src/router/index.ts
+1
-1
src/store/modules/user.ts
+1
-0
src/test.ts
+7
-0
src/views/HomeView.vue
+133
-51
vite.config.ts
+1
-0
没有找到文件。
.env.development
浏览文件 @
7c587846
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
auto-imports.d.ts
浏览文件 @
7c587846
...
...
@@ -5,5 +5,6 @@
// Generated by unplugin-auto-import
export
{}
declare
global
{
const
ElLoading
:
typeof
import
(
'element-plus/es'
)[
'ElLoading'
]
const
ElMessage
:
typeof
import
(
'element-plus/es'
)[
'ElMessage'
]
}
index.html
浏览文件 @
7c587846
...
...
@@ -31,7 +31,7 @@
console
.
log
(
scaleRatio
,
fontSize
,
'scaleRatio'
)
// 4.开始缩放网页
console
.
log
(
scaleRatio
,
'scaleRatio'
)
document
.
body
.
style
=
`zoom:
${
scaleRatio
}
`
;
//
document.body.style = `zoom:${scaleRatio}`;
console
.
log
(
document
.
body
,
' document.body'
)
}
</script>
...
...
src/axios/index.ts
浏览文件 @
7c587846
...
...
@@ -6,7 +6,6 @@ const instance = axios.create({
// baseURL:'/api',
timeout
:
1000
,
// 设置请求超时时间
});
console
.
log
(
import
.
meta
.
env
,
"import.meta.env"
);
instance
.
interceptors
.
request
.
use
(
(
config
:
any
)
=>
{
// 在发送请求之前做些什么,例如添加 token
...
...
src/components/AutomaticPrompt.vue
浏览文件 @
7c587846
...
...
@@ -37,7 +37,7 @@
ref=
"elAutocomplete"
placeholder=
"输入信息"
contenteditable=
"true"
style=
"outline: none;
"
style=
"outline: none;"
@
paste
.
prevent=
"handlePaste"
@
focus=
"removeDefaultContent"
@
input=
"handleSelect"
...
...
@@ -71,6 +71,7 @@ const imgShowWidth = ref<number>(50)
const
imgShowHeight
=
ref
<
number
>
(
50
)
const
showEmotion
=
ref
<
boolean
>
(
false
)
const
handleEmotion
=
(
i
:
any
)
=>
{
console
.
log
(
i
,
'打印'
)
elAutocomplete
.
value
.
innerHTML
+=
i
inputVal
.
value
=
elAutocomplete
.
value
.
innerHTML
showEmotion
.
value
=
false
...
...
@@ -83,15 +84,7 @@ const upfile = () => {
const
fileImgChange
=
async
()
=>
{
var
e
:
any
=
window
.
event
||
event
var
oFile
=
e
.
target
.
files
[
0
]
console
.
log
(
oFile
.
type
)
if
(
oFile
.
type
==
'image/png'
)
{
await
setfileEvent
(
e
.
target
)
}
else
{
upLoadFilesHander
(
oFile
).
then
((
ress
)
=>
{
const
{
success
,
result
}:
any
=
ress
;
console
.
log
(
result
,)
})
}
await
setfileEvent
(
oFile
)
const
loading
:
any
=
ElLoading
?.
service
({
lock
:
true
,
text
:
'上传中...'
,
...
...
@@ -99,29 +92,37 @@ const fileImgChange = async () => {
})
loading
.
close
()
}
const
setfileEvent
=
async
(
clipboardData
:
any
)
=>
{
const
img
=
getPasteImageFile
(
clipboardData
.
files
)
if
(
!
img
)
{
return
}
const
uploadRes
=
await
fileToBase64
(
img
)
if
(
!
uploadRes
)
{
return
const
setfileEvent
=
async
(
file
:
any
)
=>
{
var
html
=
''
const
{
result
}:
any
=
await
upLoadFilesHander
(
file
)
const
uploadRes
=
result
if
(
!
uploadRes
)
return
if
(
file
.
type
.
includes
(
'image'
))
{
html
=
await
getImageObject
(
uploadRes
,
imgShowWidth
.
value
,
imgShowHeight
.
value
,
)
}
else
{
html
=
await
getFileObject
(
uploadRes
,
file
)
}
const
oImage
=
await
getImageObject
(
uploadRes
,
imgShowWidth
.
value
,
imgShowHeight
.
value
,
)
console
.
log
(
oImage
,
'oImage'
)
elAutocomplete
.
value
.
innerHTML
+=
oImage
.
outerHTML
inputVal
.
value
=
oImage
.
outerHTML
console
.
log
(
html
,
'html打印'
)
elAutocomplete
.
value
.
innerHTML
+=
html
.
outerHTML
inputVal
.
value
+=
html
.
outerHTML
elAutocomplete
.
value
.
focus
()
}
const
handleSelect
=
(
value
:
any
)
=>
{
inputVal
.
value
=
value
.
target
.
innerHTML
}
const
getFileObject
=
(
url
:
any
,
oFile
:
any
)
=>
{
var
aTag
=
document
.
createElement
(
'a'
)
aTag
.
href
=
url
aTag
.
download
=
oFile
.
name
aTag
.
target
=
'view_window'
aTag
.
textContent
=
oFile
.
name
return
aTag
}
const
emit
=
defineEmits
([
'updateState'
])
watch
(
inputVal
,
async
(
newValue
)
=>
{
if
(
!
newValue
)
elAutocomplete
.
value
.
innerHTML
=
''
...
...
@@ -172,13 +173,11 @@ const handlePasteImageFile = async (clipboardData: any) => {
)
cursorInsert
(
oImage
)
inputVal
.
value
=
elAutocomplete
.
value
.
innerHTML
// elAutocomplete.value.innerHTML = inputVal.value;
}
// 获取一个 image object
const
getImageObject
=
(
uploadRes
:
any
,
showWidth
:
any
,
showHeight
:
any
)
=>
{
const
oImage
=
new
Image
(
showWidth
,
showHeight
)
const
datasetFields
=
[
'width'
,
'height'
]
const
datasetSizes
:
any
=
{
width
:
'200'
,
...
...
@@ -273,8 +272,9 @@ defineExpose({
.el-autocomplete
{
width
:
100%
;
max-width
:
100%
;
height
:
calc
(
100vh
-
732
px
);
height
:
calc
(
100vh
-
60vh
-
130
px
);
overflow
:
auto
;
font-size
:
14px
;
}
.el-autocomplete
img
{
max-width
:
100%
;
/* 设置图片最大宽度为容器宽度 */
...
...
src/minxins/UploadMixin.ts
浏览文件 @
7c587846
...
...
@@ -117,7 +117,6 @@ export const upLoadHander = async (obj: any) => {
if
(
resResult
)
{
const
query
=
{};
// const res: any = await getUploadConfigInfo(query);
const
result
:
any
=
uploadMixin
.
upLoadMixinResult
;
if
(
uploadMixin
.
uploadMixinType
===
"txcos"
)
{
//走对象存储
...
...
@@ -172,18 +171,21 @@ export const upLoadHander = async (obj: any) => {
async
:
false
,
}
);
if
(
uploadRes
.
success
&&
uploadRes
.
message
)
{
let
data
=
uploadRes
.
data
;
console
.
log
(
data
,
'uploadRes'
)
if
(
data
.
success
&&
data
.
message
)
{
//保存绝对路径,不然小程序会有问题
let
url
=
uploadRes
.
message
;
url
=
uploadRes
.
message
.
replaceAll
(
"//"
,
"/"
);
const
pre
=
url
.
startsWith
(
"/"
)
?
""
:
"/"
;
url
=
`http://
${
VUE_APP_API_URL
}
/sys/common/static`
+
pre
+
url
;
console
.
log
(
url
,
"图片上传失败"
);
let
url
=
data
.
message
;
// console.log(url,'url')
// url = data.message.replaceAll("//", "/");
// const pre = url.startsWith("/") ? "" : "/";
// url = `http://${VUE_APP_API_URL}/sys/common/static` + pre + url;
// console.log(url, "图片上传成功");
obj
.
onSuccess
({
success
:
true
,
message
:
url
});
}
else
{
obj
.
onError
({
success
:
false
,
message
:
uploadRes
.
message
||
"图片上传失败"
,
message
:
data
.
message
||
"图片上传失败"
,
});
}
}
...
...
src/router/index.ts
浏览文件 @
7c587846
...
...
@@ -3,7 +3,7 @@ const routes: Array<RouteRecordRaw> = [
{
path
:
"/"
,
name
:
"home"
,
component
:
()
=>
import
(
/* @vite-ignore */
`@/views/
H
omeView.vue`
),
component
:
()
=>
import
(
/* @vite-ignore */
`@/views/
h
omeView.vue`
),
},
{
path
:
"/loging"
,
...
...
src/store/modules/user.ts
浏览文件 @
7c587846
...
...
@@ -24,6 +24,7 @@ export const useUserStore = defineStore("user", {
this
.
customerInfo
=
res
;
},
setUserInfo
(
res
:
any
)
{
console
.
log
(
res
,
'res'
)
this
.
userInfo
=
res
;
},
setUserListMessages
(
res
:
any
)
{
...
...
src/test.ts
0 → 100644
浏览文件 @
7c587846
interface
aaa
{
name
:
string
}
interface
aaa
{
age
:
number
;
}
\ No newline at end of file
src/views/HomeView.vue
浏览文件 @
7c587846
差异被折叠。
点击展开。
vite.config.ts
浏览文件 @
7c587846
...
...
@@ -48,5 +48,6 @@ export default defineConfig({
host
:
"0.0.0.0"
,
port
:
8082
,
open
:
false
,
overlay
:
true
,
},
});
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论