Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
saas-manage
Overview
Overview
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
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
chehuidong
saas-manage
Commits
34b4247b
Commit
34b4247b
authored
Oct 10, 2023
by
qinjianhui
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 公告管理优化
parent
55e5bc32
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
106 additions
and
8 deletions
+106
-8
src/views/system/announceManage.vue
+106
-8
No files found.
src/views/system/announceManage.vue
View file @
34b4247b
...
...
@@ -123,6 +123,45 @@
>
</div>
</el-dialog>
<el-dialog
:visible
.
sync=
"releaseVisible"
:close-on-click-modal=
"false"
title=
"发布"
width=
"600px"
>
<el-checkbox
:indeterminate=
"isIndeterminate"
v-model=
"checkAll"
@
change=
"handleCheckAllChange"
>
全选
</el-checkbox
>
<div
style=
"margin: 15px 0"
></div>
<el-checkbox-group
v-model=
"checkedCompany"
@
change=
"handleCheckedCompanyChange"
>
<el-checkbox
style=
"width: 100px"
v-for=
"c in releaseList"
:label=
"c.id"
:key=
"c.id"
>
{{
c
.
apiName
}}
</el-checkbox
>
</el-checkbox-group>
<span
slot=
"footer"
>
<el-button
size=
"mini"
@
click=
"releaseVisible = false"
>
取消
</el-button
>
<el-button
size=
"mini"
@
click=
"confirmRelease"
type=
"primary"
>
确认
</el-button
>
</span>
</el-dialog>
</div>
</
template
>
<
script
>
...
...
@@ -135,6 +174,9 @@ export default {
components
:
{
'v-editor'
:
Editor
,
tableView
},
data
()
{
return
{
checkAll
:
false
,
isIndeterminate
:
false
,
checkedCompany
:
[],
userList
:
[],
pageSize
:
50
,
currentPage
:
1
,
...
...
@@ -166,6 +208,8 @@ export default {
content
:
''
,
priority
:
false
,
},
releaseVisible
:
false
,
releaseList
:
[],
}
},
mounted
()
{
...
...
@@ -208,13 +252,15 @@ export default {
width
:
100
,
render
:
(
item
)
=>
(
<
div
>
<
span
class
=
"icon-view icon-edit-view"
title
=
"编辑"
onClick
=
{()
=>
this
.
editDialog
(
item
)}
>
<
i
class
=
"el-icon-edit"
><
/i
>
<
/span
>
{
!
item
.
enableFlag
&&
(
<
span
class
=
"icon-view icon-edit-view"
title
=
"编辑"
onClick
=
{()
=>
this
.
editDialog
(
item
)}
>
<
i
class
=
"el-icon-edit"
><
/i
>
<
/span
>
)}
{
!
item
.
enableFlag
&&
(
<
span
class
=
"icon-view icon-primary-view"
...
...
@@ -224,6 +270,15 @@ export default {
<
i
class
=
"el-icon-s-promotion"
><
/i
>
<
/span
>
)}
{
!
item
.
enableFlag
&&
(
<
span
class
=
"icon-view icon-del-view"
title
=
"删除"
onClick
=
{()
=>
this
.
deleteAnnounces
(
item
)}
>
<
i
class
=
"el-icon-delete"
><
/i
>
<
/span
>
)}
<
/div
>
),
},
...
...
@@ -231,6 +286,20 @@ export default {
},
},
methods
:
{
handleCheckAllChange
(
val
)
{
this
.
checkedCompany
=
val
?
this
.
releaseList
.
map
((
e
)
=>
e
.
id
)
:
[]
this
.
isIndeterminate
=
false
},
handleCheckedCompanyChange
(
value
)
{
const
checkedCount
=
value
.
length
this
.
checkAll
=
checkedCount
===
this
.
releaseList
.
length
this
.
isIndeterminate
=
checkedCount
>
0
&&
checkedCount
<
this
.
releaseList
.
length
},
search
()
{
this
.
getList
()
},
...
...
@@ -329,8 +398,20 @@ export default {
},
async
release
(
item
)
{
try
{
const
res
=
await
post
(
'sys/domain/list'
)
if
(
res
.
code
!==
200
)
return
this
.
releaseList
=
res
.
data
this
.
rowId
=
item
.
id
this
.
checkedCompany
=
[]
this
.
releaseVisible
=
true
}
catch
(
e
)
{
console
.
error
(
e
)
}
},
async
deleteAnnounces
(
item
)
{
try
{
const
res
=
await
get
(
'sys/announcement/
publish
/'
+
item
.
id
,
'sys/announcement/
delete
/'
+
item
.
id
,
)
if
(
res
.
code
!==
200
)
return
this
.
$message
.
success
(
res
.
message
)
...
...
@@ -339,6 +420,23 @@ export default {
console
.
error
(
e
)
}
},
async
confirmRelease
()
{
if
(
this
.
checkedCompany
.
length
===
0
)
{
return
this
.
$message
.
warning
(
'请至少选择一条记录'
)
}
try
{
const
res
=
await
post
(
'sys/announcement/publish'
,
{
id
:
this
.
rowId
,
dataSourcelist
:
this
.
checkedCompany
,
})
if
(
res
.
code
!==
200
)
return
this
.
$message
.
success
(
res
.
message
)
this
.
releaseVisible
=
false
this
.
getList
()
}
catch
(
e
)
{
console
.
error
(
e
)
}
},
},
}
</
script
>
...
...
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