89 lines
2.9 KiB
Plaintext
89 lines
2.9 KiB
Plaintext
@page "{handler?}"
|
|
@model YBDevice.NWeb.Pages.Code.ListModel
|
|
@{
|
|
ViewData["Title"] = "模版列表";
|
|
}
|
|
<div class="layui-card">
|
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<button class="btn btn-primary btn-lg js-template" type="button">同步模版</button>
|
|
</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">
|
|
<a href="#" class="js-delete" title="删除模版" data-id="{{d.id}}">删除</a>
|
|
</script>
|
|
@section Scripts
|
|
{
|
|
<script type="text/javascript">
|
|
layui.use(['common','table'], function () {
|
|
var common = layui.common,table=layui.table;
|
|
common.initTable({
|
|
url: '/api/official/GetTplList'
|
|
, method: 'post'
|
|
, cols: [[
|
|
{ type:'radio'},
|
|
{
|
|
field: 'templateid', title: '模版ID'
|
|
},
|
|
{
|
|
field: 'usrversion', title: '版本'
|
|
},
|
|
{
|
|
field: 'userdesc', title: '描述'
|
|
},
|
|
{
|
|
field: 'createtime', title: '发布时间'
|
|
},
|
|
{
|
|
title: '操作', templet: "#optpl", fixed: 'right'
|
|
}
|
|
]]
|
|
});
|
|
$(".js-template").on("click", function () {
|
|
common.confirm("确定同步?", function () {
|
|
common.ajax({
|
|
url: "/api/official/SyncTpl",
|
|
success: function (res) {
|
|
if (res.code == 0) {
|
|
common.info(res.message, function () {
|
|
common.reloadtable("list");
|
|
});
|
|
} else {
|
|
common.alert(res.message);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
$("body").on("click", ".js-delete", function () {
|
|
var id = $(this).data('id');
|
|
common.confirm("确定删除此模板?", function () {
|
|
common.ajax({
|
|
url: "/api/official/DeleteTemplate?id=" + id,
|
|
success: function (res) {
|
|
if (res.code == 0) {
|
|
common.info(res.message, function () {
|
|
common.reloadtable("list");
|
|
});
|
|
} else {
|
|
common.alert(res.message);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
function getdata() {
|
|
var data = layui.table.checkStatus('list');
|
|
return data;
|
|
}
|
|
</script>
|
|
} |