102 lines
3.2 KiB
Plaintext
102 lines
3.2 KiB
Plaintext
@page
|
|
@model YBDevice.NWeb.Pages.Device.AppModel
|
|
@{
|
|
}
|
|
<div class="layui-card">
|
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<div class="layui-input-inline">
|
|
<input type="text" class="layui-input" name="Name" id="Name" placeholder="请输入名称" />
|
|
</div>
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button class="btn btn-primary btn-lg js-search" type="button">查询</button>
|
|
@Html.Raw(Model.viewdata.Top)
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="layui-card-body">
|
|
<table class="layui-table" id="list" lay-filter="list">
|
|
</table>
|
|
</div>
|
|
</div>
|
|
<script type="text/html" id="optpl">
|
|
@Html.Raw(Model.viewdata.Table)
|
|
</script>
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
layui.use(['common'], function () {
|
|
var common = layui.common;
|
|
common.initTable({
|
|
url: '/api/device/getdeviceapplist'
|
|
, method: 'post'
|
|
, cols: [[
|
|
{
|
|
field: 'devtype', title: '设备类型'
|
|
}
|
|
,
|
|
{
|
|
field: 'appname', title: '小程序'
|
|
}
|
|
,
|
|
{
|
|
field: 'status', title: '状态', templet: function (d) {
|
|
return StatusType[d.status];
|
|
}
|
|
}
|
|
,
|
|
{
|
|
title: '操作', templet: "#optpl", fixed: 'right'
|
|
}
|
|
]]
|
|
});
|
|
$(".js-search").on("click", function () {
|
|
common.reloadtable("list", {
|
|
where: {
|
|
queryParam: [{
|
|
"Name": 'Name',
|
|
"Type": QueryCond.Like,
|
|
"Value": $("#Name").val()
|
|
}]
|
|
}
|
|
});
|
|
});
|
|
$(".js-Add").on("click", function () {
|
|
common.dialog({
|
|
title: '添加配置',
|
|
content: '/Device/EditApp'
|
|
});
|
|
});
|
|
$("body").on("click", ".js-Edit", function () {
|
|
var id = $(this).data('id');
|
|
common.dialog({
|
|
title: '编辑配置',
|
|
content: '/Device/EditApp?id=' + id
|
|
});
|
|
});
|
|
$("body").on("click", ".js-Delete", function () {
|
|
var id = $(this).data('id');
|
|
common.confirm("确定删除?",function(){
|
|
common.ajax({
|
|
url: "/api/device/DeleteDeviceApp",
|
|
data:{
|
|
id:id
|
|
},
|
|
type:"post",
|
|
success: function (res) {
|
|
if (res.code == 0) {
|
|
common.info(res.message, function () {
|
|
$(".js-search").trigger("click");
|
|
});
|
|
} else {
|
|
common.alert(res.message);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
</script>
|
|
} |