Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
P
park-ui
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
huang
park-ui
Commits
e1256285
提交
e1256285
authored
6月 05, 2020
作者:
huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加模块菜单
上级
d3b5272d
显示空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
63 行增加
和
32 行删除
+63
-32
announcementList.js
src/api/announcement/announcementList.js
+25
-1
index.vue
src/views/announcement/announcementList/index.vue
+38
-31
没有找到文件。
src/api/announcement/announcementList.js
浏览文件 @
e1256285
...
...
@@ -30,9 +30,33 @@ export function addAnnouncement(data) {
export
function
getAnnouncement
(
data
)
{
return
request
({
url
:
'/announcement/getAnnouncement'
,
method
:
'get'
,
method
:
'post'
,
data
:
data
})
}
// update announcement
export
function
updateAnnouncement
(
data
)
{
return
request
({
url
:
'/announcement/updateAnnouncement'
,
method
:
'post'
,
data
:
data
})
}
//delete announce
export
function
delAnnouncement
(
ids
)
{
return
request
({
url
:
'/announcement/delAnnouncement/'
+
ids
,
method
:
'delete'
})
}
//activate announcement
export
function
activateAnnouncement
(
ids
)
{
return
request
({
url
:
'/announcement/activateAnnouncement/'
+
ids
,
method
:
'get'
})
}
src/views/announcement/announcementList/index.vue
浏览文件 @
e1256285
...
...
@@ -4,7 +4,7 @@
<div
style=
"background:#eee;padding: 20px;margin-bottom: 20px"
>
<Card
:bordered=
"false"
>
<p
slot=
"title"
>
当前公告通知
</p>
<p
v-if=
"announcement==null"
>
通知公告为空哦~快去添加吧
</p>
<p
v-if=
"announcement==null"
>
通知公告为空哦~快去添加吧
或选择一个吧!!
</p>
<p
v-else
v-text=
"announcement.content"
></p>
</Card>
</div>
...
...
@@ -19,6 +19,9 @@
<el-col
:span=
"1.5"
>
<el-button
type=
"danger"
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"multiple"
@
click=
"handleDelete"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
</el-col>
<el-col
:span=
"1.5"
>
<el-button
type=
"success"
icon=
"el-icon-delete"
size=
"mini"
:disabled=
"single"
@
click=
"handleActivate"
v-hasPermi=
"['system:user:active']"
>
激活
</el-button>
</el-col>
</el-row>
<el-table
v-loading=
"loading"
:data=
"announcementList"
@
selection-change=
"handleSelectionChange"
>
...
...
@@ -29,14 +32,12 @@
<span>
{{
parseTime
(
scope
.
row
.
createTime
)
}}
</span>
</
template
>
</el-table-column>
<el-table-column
label=
"操作"
align=
"center"
width=
"180"
class-name=
"small-padding fixed-width"
>
<
template
slot-scope=
"scope"
>
<el-button
size=
"mini"
type=
"text"
icon=
"el-icon-edit"
@
click=
"handleUpdate(scope.row)"
v-hasPermi=
"['system:user:edit']"
>
修改
</el-button>
<el-button
v-if=
"scope.row.userId !== 1"
size=
"mini"
type=
"text"
icon=
"el-icon-delete"
@
click=
"handleDelete(scope.row)"
v-hasPermi=
"['system:user:remove']"
>
删除
</el-button>
</
template
>
</el-table-column>
</el-table>
<!--分页按钮组-->
<pagination
v-show=
"total>0"
:total=
"total"
:page
.
sync=
"queryParams.pageNum"
:limit
.
sync=
"queryParams.pageSize"
@
pagination=
"getList"
/>
<!-- 添加或修改公告通知对话框 -->
<el-dialog
:title=
"title"
:visible
.
sync=
"open"
width=
"600px"
append-to-body
>
<el-form
ref=
"form"
:model=
"form"
:rules=
"rules"
label-width=
"80px"
>
...
...
@@ -59,7 +60,7 @@
</div>
</template>
<
script
>
import
{
getList
,
getCurrent
,
addAnnouncement
,
getAnnouncement
}
from
"@/api/announcement/announcementList"
;
import
{
getList
,
getCurrent
,
addAnnouncement
,
getAnnouncement
,
updateAnnouncement
,
delAnnouncement
,
activateAnnouncement
}
from
"@/api/announcement/announcementList"
;
export
default
{
//页签缓存页面的name要和路由中的那么要相同,才能缓存,
//如果是自定义菜单,则页面的name和菜单管理中路由地址要相同,才能页签缓存
...
...
@@ -97,7 +98,8 @@
getList
()
{
this
.
loading
=
true
;
getList
(
this
.
queryParams
).
then
(
response
=>
{
this
.
announcementList
=
response
.
data
this
.
announcementList
=
response
.
rows
this
.
total
=
response
.
total
this
.
loading
=
false
})
},
...
...
@@ -107,6 +109,7 @@
getCurrent
().
then
(
response
=>
{
if
(
response
.
data
){
this
.
announcement
=
response
.
data
this
.
loading
=
false
}
})
},
...
...
@@ -130,14 +133,15 @@
},
//多选框选中数据
handleSelectionChange
(
selection
)
{
this
.
ids
=
selection
.
map
(
item
=>
item
.
dictI
d
)
this
.
ids
=
selection
.
map
(
item
=>
item
.
i
d
)
this
.
single
=
selection
.
length
!=
1
this
.
multiple
=
!
selection
.
length
},
/** 修改按钮操作 */
handleUpdate
(
row
)
{
//清空表单
this
.
reset
();
const
id
=
row
.
id
||
this
.
ids
const
id
=
row
.
id
||
this
.
ids
[
0
]
let
data
=
{
id
:
id
}
...
...
@@ -147,18 +151,34 @@
this
.
title
=
"修改公告通知内容"
;
});
},
/** 激活按钮操作 */
handleActivate
(
row
){
const
ids
=
row
.
id
||
this
.
ids
[
0
]
this
.
$confirm
(
'激活以在小程序端展示?'
,
"确认"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
function
()
{
return
activateAnnouncement
(
ids
);
}).
then
(()
=>
{
//重置
this
.
getCurrent
()
this
.
msgSuccess
(
"激活成功"
);
}).
catch
(
function
()
{});
},
/** 提交按钮 */
submitForm
:
function
()
{
this
.
$refs
[
"form"
].
validate
(
valid
=>
{
if
(
valid
)
{
if
(
this
.
form
.
dictId
!=
undefined
)
{
updateType
(
this
.
form
).
then
(
response
=>
{
if
(
this
.
form
.
id
!=
undefined
)
{
updateAnnouncement
(
this
.
form
).
then
(
response
=>
{
if
(
response
.
code
===
200
)
{
this
.
msgSuccess
(
"修改成功"
);
this
.
open
=
false
;
this
.
getList
();
}
else
{
this
.
msgError
(
response
.
msg
);
this
.
msgError
(
"修改失败:"
+
response
.
msg
);
}
});
}
else
{
...
...
@@ -177,30 +197,17 @@
},
/** 删除按钮操作 */
handleDelete
(
row
)
{
const
dictI
ds
=
row
.
dictId
||
this
.
ids
;
this
.
$confirm
(
'是否确认删除
字典编号为"'
+
dictIds
+
'"
的数据项?'
,
"警告"
,
{
const
i
ds
=
row
.
dictId
||
this
.
ids
;
this
.
$confirm
(
'是否确认删除
已选中
的数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
function
()
{
return
del
Type
(
dictI
ds
);
return
del
Announcement
(
i
ds
);
}).
then
(()
=>
{
this
.
getList
();
this
.
msgSuccess
(
"删除成功"
);
}).
catch
(
function
()
{});
},
/** 导出按钮操作 */
handleExport
()
{
const
queryParams
=
this
.
queryParams
;
this
.
$confirm
(
'是否确认导出所有类型数据项?'
,
"警告"
,
{
confirmButtonText
:
"确定"
,
cancelButtonText
:
"取消"
,
type
:
"warning"
}).
then
(
function
()
{
return
exportType
(
queryParams
);
}).
then
(
response
=>
{
this
.
download
(
response
.
msg
);
}).
catch
(
function
()
{});
}
}
};
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论