Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
glsx-business
/
website-middleground
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 78cc3786
authored
Oct 17, 2024
by
胡悦
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
提交
1 parent
dced7328
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
9 deletions
src/components/Menu/index.vue
src/router/routes.ts
src/views/investorRelated/components/AddForm.vue
src/views/news/components/AddForm.vue
src/views/news/index.vue
src/components/Menu/index.vue
View file @
78cc378
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-07-24 20:28:10
* @Date: 2024-07-24 20:28:10
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2024-10-17 1
6:09:34
* @LastEditTime: 2024-10-17 1
7:38:27
-->
-->
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
...
@@ -16,11 +16,12 @@ const route = useRoute();
...
@@ -16,11 +16,12 @@ const route = useRoute();
let
defaultSelectedKeys
=
ref
([
''
]);
let
defaultSelectedKeys
=
ref
([
''
]);
const
menuList
=
ref
(
staticRoutes
.
filter
(
item
=>
item
.
isMenu
));
const
menuList
=
ref
(
staticRoutes
.
filter
(
item
=>
item
.
isMenu
));
onBeforeMount
(()
=>
{
onBeforeMount
(()
=>
{
console
.
log
(
route
.
path
)
console
.
log
(
route
)
if
(
route
.
path
==
'/login'
)
{
if
(
route
.
path
==
'/login'
)
{
defaultSelectedKeys
.
value
=
[
'/investorRelated'
]
defaultSelectedKeys
.
value
=
[
'/investorRelated'
]
}
else
{
}
else
{
defaultSelectedKeys
.
value
=
[
route
.
path
]
const
_parentPath
=
staticRoutes
.
find
(
item
=>
item
.
path
===
route
.
path
)?.
parentPath
defaultSelectedKeys
.
value
=
[
_parentPath
]
}
}
})
})
</
script
>
</
script
>
...
...
src/router/routes.ts
View file @
78cc378
...
@@ -20,12 +20,14 @@ const staticRoutes = Object.freeze([
...
@@ -20,12 +20,14 @@ const staticRoutes = Object.freeze([
id
:
'1'
,
id
:
'1'
,
name
:
'投资者相关'
,
name
:
'投资者相关'
,
path
:
'/investorRelated'
,
path
:
'/investorRelated'
,
parentPath
:
'/investorRelated'
,
component
:
()
=>
import
(
'views/investorRelated/index.vue'
),
component
:
()
=>
import
(
'views/investorRelated/index.vue'
),
isMenu
:
true
,
isMenu
:
true
,
icon
:
'icon-user'
,
icon
:
'icon-user'
,
children
:
[]
children
:
[]
},
},
{
{
parentPath
:
'/investorRelated'
,
name
:
'新增公告'
,
name
:
'新增公告'
,
path
:
'/investorRelated/addInvnotice'
,
path
:
'/investorRelated/addInvnotice'
,
component
:
()
=>
import
(
'views/investorRelated/addInvnotice.vue'
),
component
:
()
=>
import
(
'views/investorRelated/addInvnotice.vue'
),
...
@@ -33,12 +35,14 @@ const staticRoutes = Object.freeze([
...
@@ -33,12 +35,14 @@ const staticRoutes = Object.freeze([
{
{
id
:
'2'
,
id
:
'2'
,
name
:
'新闻动态'
,
name
:
'新闻动态'
,
parentPath
:
'/news'
,
path
:
'/news'
,
path
:
'/news'
,
component
:
()
=>
import
(
'views/news/index.vue'
),
component
:
()
=>
import
(
'views/news/index.vue'
),
isMenu
:
true
,
isMenu
:
true
,
icon
:
'icon-public'
icon
:
'icon-public'
},
},
{
{
parentPath
:
'/news'
,
name
:
'新增动态'
,
name
:
'新增动态'
,
path
:
'/news/addNews'
,
path
:
'/news/addNews'
,
component
:
()
=>
import
(
'views/news/AddNews.vue'
),
component
:
()
=>
import
(
'views/news/AddNews.vue'
),
...
...
src/views/investorRelated/components/AddForm.vue
View file @
78cc378
...
@@ -289,6 +289,9 @@ const findById = async () => {
...
@@ -289,6 +289,9 @@ const findById = async () => {
};
};
// if (query.value.id) findById()
// if (query.value.id) findById()
getList
();
getList
();
const
back
=
()
=>
{
router
.
go
(
-
1
)
}
/** 自定义上传 */
/** 自定义上传 */
// 图片的
// 图片的
const
customRequest
=
(
option
:
RequestOption
)
=>
{
const
customRequest
=
(
option
:
RequestOption
)
=>
{
...
@@ -695,6 +698,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
...
@@ -695,6 +698,7 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
</div>
</div>
<a-form-item>
<a-form-item>
<a-button type="
primary
" html-type="
submit
">提交</a-button>
<a-button type="
primary
" html-type="
submit
">提交</a-button>
<a-button class="
back
" @click="
back
">取消</a-button>
<!-- <a-button @click="
getParams
">获取参数</a-button> -->
<!-- <a-button @click="
getParams
">获取参数</a-button> -->
</a-form-item>
</a-form-item>
</a-form>
</a-form>
...
@@ -715,6 +719,10 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
...
@@ -715,6 +719,10 @@ const onBeforeRemove = (fileItem: FileItem, modelName: string) => {
}
}
}
}
.
back
{
margin
-
left
:
16
px
;
}
.
add
-
btn
{
.
add
-
btn
{
color
:
#
195
ffe
;
color
:
#
195
ffe
;
font
-
size
:
14
px
;
font
-
size
:
14
px
;
...
...
src/views/news/components/AddForm.vue
View file @
78cc378
...
@@ -65,7 +65,7 @@ const handleSubmit = () => {
...
@@ -65,7 +65,7 @@ const handleSubmit = () => {
let
api
=
'gw.api.news.information.add'
let
api
=
'gw.api.news.information.add'
if
(
params
.
id
)
api
=
'gw.api.news.information.update'
if
(
params
.
id
)
api
=
'gw.api.news.information.update'
const
res
=
await
req
(
api
,
params
)
const
res
=
await
req
(
api
,
params
)
res
?
Message
.
success
(
'
提交成功'
)
:
Message
.
error
(
'提交
失败'
)
res
?
Message
.
success
(
'
数据保存成功'
)
:
Message
.
error
(
'数据保存
失败'
)
if
(
res
)
router
.
go
(
-
1
)
if
(
res
)
router
.
go
(
-
1
)
}
}
})
})
...
@@ -75,11 +75,11 @@ const handleSubmit = () => {
...
@@ -75,11 +75,11 @@ const handleSubmit = () => {
const
customRequest
=
(
option
:
RequestOption
,
name
:
string
)
=>
{
const
customRequest
=
(
option
:
RequestOption
,
name
:
string
)
=>
{
const
{
onProgress
,
onError
,
onSuccess
,
fileItem
}
=
option
;
const
{
onProgress
,
onError
,
onSuccess
,
fileItem
}
=
option
;
if
(
name
==
'pcImg'
)
{
if
(
name
==
'pcImg'
)
{
const
size
=
fileItem
.
file
.
size
/
1024
;
const
size
=
fileItem
.
file
.
size
/
1024
/
1024
;
console
.
log
(
size
)
console
.
log
(
size
)
if
(
size
>
200
)
{
if
(
size
>
1
)
{
form
.
value
[
name
]
=
[]
form
.
value
[
name
]
=
[]
return
data
.
value
.
errMeg
=
'文件大小不能超过
200K
'
;
return
data
.
value
.
errMeg
=
'文件大小不能超过
1M
'
;
}
else
{
}
else
{
data
.
value
.
errMeg
=
''
;
data
.
value
.
errMeg
=
''
;
}
}
...
@@ -283,7 +283,7 @@ onBeforeUnmount(() => {
...
@@ -283,7 +283,7 @@ onBeforeUnmount(() => {
正在上传
正在上传
</div>
</div>
<div
class=
"tips err-tips"
v-if=
"data.errMeg"
>
{{
data
.
errMeg
}}
</div>
<div
class=
"tips err-tips"
v-if=
"data.errMeg"
>
{{
data
.
errMeg
}}
</div>
<div
class=
"tips"
v-else
>
图片建议尺寸368*244px,大小在
200K
以内
</div>
<div
class=
"tips"
v-else
>
图片建议尺寸368*244px,大小在
1M
以内
</div>
</div>
</div>
</a-form-item>
</a-form-item>
<a-form-item
<a-form-item
...
...
src/views/news/index.vue
View file @
78cc378
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
* @Author: huyue
* @Author: huyue
* @Date: 2024-07-23 16:43:07
* @Date: 2024-07-23 16:43:07
* @LastEditors: huyue
* @LastEditors: huyue
* @LastEditTime: 2024-10-17 1
5:27:23
* @LastEditTime: 2024-10-17 1
7:47:54
-->
-->
<
script
lang=
"ts"
setup
>
<
script
lang=
"ts"
setup
>
import
{
ref
}
from
'vue'
import
{
ref
}
from
'vue'
...
@@ -43,6 +43,7 @@ const columns = [
...
@@ -43,6 +43,7 @@ const columns = [
{
{
title
:
"发布时间"
,
title
:
"发布时间"
,
dataIndex
:
"publishTime"
,
dataIndex
:
"publishTime"
,
slotName
:
'publishTime'
,
},
},
{
{
title
:
"操作"
,
title
:
"操作"
,
...
@@ -112,6 +113,7 @@ getTableData()
...
@@ -112,6 +113,7 @@ getTableData()
</div>
</div>
<a-table
class=
"table"
:columns=
"columns"
:data=
"tableData"
row-key=
"id"
:pagination=
"false"
:bordered=
"false"
>
<a-table
class=
"table"
:columns=
"columns"
:data=
"tableData"
row-key=
"id"
:pagination=
"false"
:bordered=
"false"
>
<template
#
index=
"
{ rowIndex }">
{{
data
.
page
.
pageSize
*
(
data
.
page
.
pageNum
-
1
)
+
rowIndex
+
1
}}
</
template
>
<template
#
index=
"
{ rowIndex }">
{{
data
.
page
.
pageSize
*
(
data
.
page
.
pageNum
-
1
)
+
rowIndex
+
1
}}
</
template
>
<
template
#
publishTime=
"{ record }"
>
{{
record
.
publishTime
||
'-'
}}
</
template
>
<
template
#
operation=
"{ record }"
>
<
template
#
operation=
"{ record }"
>
<a-popconfirm
:content=
"'是否确认下架'"
@
ok=
"publishOrDown(record)"
>
<a-popconfirm
:content=
"'是否确认下架'"
@
ok=
"publishOrDown(record)"
>
<!--
<a-button
type=
"text"
v-if=
"record.systemPublishStatus === 1 || record.systemPublishStatus === 2"
>
发布
</a-button>
-->
<!--
<a-button
type=
"text"
v-if=
"record.systemPublishStatus === 1 || record.systemPublishStatus === 2"
>
发布
</a-button>
-->
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment