Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
O
on-site-service-admin-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
external
on-site-service-admin-view
Commits
931e67ee
Commit
931e67ee
authored
Jul 21, 2022
by
shangtx
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 首页通知
parent
225e0249
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
258 additions
and
0 deletions
+258
-0
notice.js
src/api/notice.js
+37
-0
HomeNotice.vue
src/views/notice/HomeNotice.vue
+129
-0
NoticeDetail.vue
src/views/notice/NoticeDetail.vue
+91
-0
UserList.vue
src/views/user/UserList.vue
+1
-0
No files found.
src/api/notice.js
0 → 100644
View file @
931e67ee
import
{
axios
}
from
'@/util/axios/request'
const
BASE_URL
=
'/home/notice'
export
function
getPage
(
data
)
{
return
axios
({
url
:
`
${
BASE_URL
}
/page`
,
method
:
'post'
,
data
})
}
export
function
getDetail
(
id
)
{
return
axios
({
url
:
`
${
BASE_URL
}
/
${
id
}
`
,
method
:
'get'
,
})
}
export
function
save
(
data
)
{
return
axios
({
url
:
`
${
BASE_URL
}
/save-or-update`
,
method
:
'post'
,
data
})
}
export
function
deleteOne
(
id
)
{
return
axios
({
url
:
`
${
BASE_URL
}
/
${
id
}
`
,
method
:
'delete'
,
})
}
\ No newline at end of file
src/views/notice/HomeNotice.vue
0 → 100644
View file @
931e67ee
<
template
>
<table-template
:soul=
"this"
>
<template
#
action=
"
{ record }">
<a-space>
<a
v-if=
"record.releaseStatus == 1 || record.releaseStatus == 3"
@
click=
"release(record)"
>
发布
</a>
<a
v-if=
"record.releaseStatus == 2"
@
click=
"revoke(record)"
>
撤销
</a>
<a
@
click=
"detail(record.id)"
>
详情
</a>
<a
style=
"color: red"
v-if=
"record.releaseStatus == 1 || record.releaseStatus == 3"
@
click=
"deleteNotice(record.id)"
>
删除
</a>
</a-space>
</
template
>
<
template
#
free
>
<NoticeDetail
ref=
"NoticeDetail"
:success=
"reset"
/>
</
template
>
</table-template>
</template>
<
script
>
import
{
TableTemplate
,
TableScript
,
SearchType
}
from
'@/components/table'
import
{
getPage
,
save
,
deleteOne
}
from
'@/api/notice'
import
NoticeDetail
from
'./NoticeDetail'
import
dayjs
from
'dayjs'
const
columns
=
[
{
title
:
'名称'
,
width
:
130
,
dataIndex
:
'title'
,
filter
:
{
type
:
SearchType
.
STRING
}
},
{
title
:
'内容'
,
dataIndex
:
'content'
},
{
title
:
'状态'
,
dataIndex
:
'releaseStatusValue'
,
width
:
100
},
{
title
:
'状态'
,
dataIndex
:
'releaseStatus'
,
filter
:
{
type
:
SearchType
.
ENUM
},
hidden
:
true
,
enum
:
'BIZ0003'
},
{
title
:
'创建时间'
,
dataIndex
:
'createTime'
,
width
:
220
,
sorter
:
true
,
filter
:
{
type
:
SearchType
.
RANGE
},
customRender
:
(
text
)
=>
dayjs
(
text
).
format
(
'YYYY-MM-DD HH:mm:ss'
)
},
{
title
:
'操作'
,
width
:
150
,
scopedSlots
:
{
customRender
:
'action'
}
}
]
export
default
{
name
:
'HomeNotice'
,
mixins
:
[
TableScript
],
components
:
{
TableTemplate
,
NoticeDetail
},
data
()
{
return
{
columns
,
useYScroll
:
true
,
title
:
'首页通知管理'
,
codes
:
[[
'BIZ0003'
],
[]]
}
},
methods
:
{
queryData
:
getPage
,
release
(
record
)
{
const
_this
=
this
this
.
$confirm
({
title
:
'是否发布此通知'
,
onOk
()
{
save
({
id
:
record
.
id
,
releaseStatus
:
2
}).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
_this
.
$message
.
success
(
'发布成功'
)
_this
.
reset
()
}
})
}
})
},
revoke
(
record
)
{
const
_this
=
this
this
.
$confirm
({
title
:
'是否撤销此通知'
,
onOk
()
{
save
({
id
:
record
.
id
,
releaseStatus
:
3
}).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
_this
.
$message
.
success
(
'撤销成功'
)
_this
.
reset
()
}
})
}
})
},
deleteNotice
(
id
)
{
const
_this
=
this
this
.
$confirm
({
title
:
'是否删除此通知'
,
onOk
()
{
deleteOne
(
id
).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
_this
.
$message
.
success
(
'删除成功'
)
_this
.
reset
()
}
})
}
})
},
detail
(
id
)
{
this
.
$refs
.
NoticeDetail
.
show
(
id
)
}
}
}
</
script
>
\ No newline at end of file
src/views/notice/NoticeDetail.vue
0 → 100644
View file @
931e67ee
<
template
>
<a-drawer
:width=
"500"
:visible=
"visible"
title=
"服务类别"
@
close=
"close"
>
<a-form
:form=
"form"
layout=
"vertical"
>
<a-form-item
label=
"名称"
>
<a-input
v-decorator=
"[
'title',
{
rules: [{ required: true }]
}
]"
/>
</a-form-item>
<a-form-item
label=
"内容(18字)"
>
<a-input
v-decorator=
"[
'content',
{
rules: [
{
required: true
},
{
max: 18
}
]
}
]"
/>
</a-form-item>
<a-form-item
label=
"排序"
>
<a-input-number
v-decorator=
"['showOrder']"
/>
</a-form-item>
</a-form>
<div
class=
"drawer-form-bottom-toolbar"
>
<a-button
:style=
"
{ marginRight: '8px' }" @click="close"> 取消
</a-button>
<a-button
type=
"primary"
@
click=
"submit"
>
保存
</a-button>
</div>
</a-drawer>
</
template
>
<
script
>
import
{
getDetail
,
save
}
from
'@/api/notice'
export
default
{
name
:
'NoticeDetail'
,
props
:
{
success
:
Function
},
data
()
{
return
{
form
:
this
.
$form
.
createForm
(
this
),
visible
:
false
,
id
:
null
,
categoryId
:
null
,
categoryName
:
''
}
},
methods
:
{
show
(
id
)
{
this
.
id
=
id
this
.
visible
=
true
if
(
id
)
{
getDetail
(
this
.
id
).
then
(({
data
})
=>
{
this
.
form
.
setFieldsValue
(
data
)
})
}
},
close
()
{
this
.
id
=
null
this
.
form
.
resetFields
()
this
.
visible
=
false
},
submit
()
{
this
.
form
.
validateFields
((
err
,
values
)
=>
{
if
(
err
)
{
return
}
const
reqData
=
{
...
values
,
id
:
this
.
id
}
save
(
reqData
).
then
(({
code
})
=>
{
if
(
code
==
200
)
{
this
.
$message
.
success
(
'保存成功'
)
this
.
close
()
this
.
success
()
}
})
})
}
}
}
</
script
>
\ No newline at end of file
src/views/user/UserList.vue
View file @
931e67ee
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
<a-menu-item
key=
"0"
>
修改为 普通用户
</a-menu-item>
<a-menu-item
key=
"0"
>
修改为 普通用户
</a-menu-item>
<a-menu-item
key=
"1"
>
修改为 客服
</a-menu-item>
<a-menu-item
key=
"1"
>
修改为 客服
</a-menu-item>
<a-menu-item
key=
"2"
>
修改为 估价员
</a-menu-item>
<a-menu-item
key=
"2"
>
修改为 估价员
</a-menu-item>
<a-menu-item
key=
"3"
>
修改为 销售
</a-menu-item>
</a-menu>
</a-menu>
</a-dropdown>
</a-dropdown>
</span>
</span>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment