Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
李洋
/
消息系统
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
bf49bcf2
authored
Oct 16, 2025
by
gongyang
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
提交代码
parent
b332843d
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
29 deletions
public/js/Message/systemUpdate.js
resources/views/message/systemUpdate.blade.php
public/js/Message/systemUpdate.js
View file @
bf49bcf2
...
...
@@ -68,35 +68,26 @@ layui.use(['jquery','element', 'layer', 'form','table','laypage','laydate','laye
});
//监听头工具栏事件
table
.
on
(
'toolbar(systemUpdateList)'
,
function
(
obj
)
{
var
checkStatus
=
table
.
checkStatus
(
obj
.
config
.
id
);
var
data
=
checkStatus
.
data
;
console
.
log
(
data
);
switch
(
obj
.
event
)
{
//禁用
case
'createNotice'
:
if
(
data
.
length
==
0
)
{
layer
.
msg
(
'请至少勾选一条数据!'
);
return
;
}
var
order_ids
=
data
.
map
(
item
=>
item
.
order_id
);
Request
(
'/api/order/auditOrder'
,
'POST'
,
{
order_id
:
order_ids
.
join
(
','
),
status
:
-
3
,
dis_reason
:
reason
},
function
(
res
)
{
if
(
res
.
code
==
0
)
{
layer
.
msg
(
'操作成功'
,
{
shift
:
0
,
time
:
2000
},
function
()
{
layer
.
closeAll
();
table
.
reload
(
'list'
);
});
}
else
{
layer
.
msg
(
res
.
msg
);
}
});
break
;
// 点击按钮获取选中值
$
(
'#createNotice'
).
on
(
'click'
,
function
(){
// 获取选中数据
var
checkStatus
=
table
.
checkStatus
(
'systemUpdateList'
);
// checkStatus包含两个属性:data(选中的数组)和isAll(是否全选)
if
(
checkStatus
.
data
.
length
===
0
){
layer
.
msg
(
'请先选择数据'
);
return
;
}
// 输出选中的数据
console
.
log
(
'选中的数据:'
,
checkStatus
.
data
);
// 提取选中的ID(实际应用中常用)
var
ids
=
checkStatus
.
data
.
map
(
function
(
item
){
return
item
.
id
;
});
layer
.
msg
(
'选中的ID:'
+
ids
.
join
(
','
));
});
...
...
resources/views/message/systemUpdate.blade.php
View file @
bf49bcf2
...
...
@@ -80,7 +80,7 @@
<div
class=
"layui-btn-container"
style=
"text-align: center; margin-top: 10px;"
>
<button
lay-submit
lay-filter=
"load"
class=
"layui-btn"
>
搜索
</button>
<button
type=
"button"
class=
"layui-btn layui-btn-normal"
id=
"addData"
>
新增
</button>
<a
class=
"layui-btn layui-btn-sm layui-btn-warm"
lay-event=
"createNotice"
id=
"createNotice"
href=
"javascript:;"
>
生成公告
</a>
<a
class=
"layui-btn layui-btn-sm layui-btn-warm"
id=
"createNotice"
href=
"javascript:;"
>
生成公告
</a>
</div>
</div>
</form>
...
...
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