文件
mashangyoujiu/Application/Super/View/App/appunit.html

243 行
9.0 KiB
HTML
可执行文件

此文件含有模棱两可的 Unicode 字符

此文件含有可能会与其他字符混淆的 Unicode 字符。 如果您是想特意这样的,可以安全地忽略该警告。 使用 Escape 按钮显示他们。

<!doctype html>
<html lang="en">
<!--[1.1.96]-->
<head>
<meta charset="UTF-8">
<meta name="viewport"
content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<link rel="stylesheet" href="__PUBLIC__/notice/css/notice.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui/css/layui.css"/>
</head>
<body>
<div class="bodys" style="min-width: 0">
<div class="content">
<div class="title" style="display: inline-block">|插件分类</div>
<if condition="$authArr['addunit'] neq true">
<button type="button" data-method="offset" data-type="auto" class=" layui-btn layui-btn-normal" id="addlist"
style="padding: 0 18px;margin-left: 10px">添加分类
</button>
</if>
<div class="text">
<table class="layui-table">
<colgroup>
<col width="150">
<col width="50">
<col>
</colgroup>
<thead>
<tr>
<th>插件名称</th>
<th width="30px">编辑</th>
</tr>
</thead>
<tbody>
<volist name="list" id="list">
<tr class="list">
<td>{$list.uitname}</td>
<td>
<if condition="$authArr['appeduit'] neq true">
<span style="cursor: pointer" class="edit" data-id="{$list.id}" id="edit">修改</span>
</if>
<if condition="$authArr['delunit'] neq true">
<span style="cursor: pointer" class="dels" data-id="{$list.id}">删除</span>
</if>
</td>
</tr>
</volist>
</tbody>
</table>
</div>
</div>
</div>
<!--添加页面-->
<div id="adduite" style="display: none">
<div class="layui-form-item" style="margin-top: 10%;">
<label class="layui-form-label" style="display: inline-block">插件名称</label>
<div class="layui-input-block" style="width: 190px;display: inline-block">
<input type="text" id="uitname" name="uitname" required lay-verify="required" placeholder="请输入名称"
autocomplete="off" class="layui-input">
</div>
</div>
<div class="layui-form-item" style="margin-left: 30%;margin-top: 20px">
<div class="layui-input-block">
<button class="layui-btn btns" lay-submit lay-filter="formDemo">立即提交</button>
</div>
</div>
</div>
<!--编辑页面-->
<div id="appeduit" style="display: none">
<div class="layui-form-item" style="margin-top: 10%;">
<label class="layui-form-label" style="display: inline-block">插件名称</label>
<div class="layui-input-block" style="width: 190px;display: inline-block">
<input type="text" id="uitnames" name="uitname" value="" required lay-verify="required" autocomplete="off"
class="layui-input">
</div>
</div>
<div class="layui-form-item" style="margin-left: 30%;margin-top: 20px">
<div class="layui-input-block">
<input type="hidden" id="unitid">
<button class="layui-btn" id="editss" lay-submit lay-filter="formDemo">立即提交</button>
</div>
</div>
</div>
</body>
<script type="text/javascript" src="__PUBLIC__/layui/layui.js"></script>
<script src="__PUBLIC__/user/js/jquery-2.0.3.min.js"></script>
<script>
layui.use(['form', 'layedit', 'laydate', 'table'], function () {
var layer = layui.layer;
$('#addlist').click(function () {
var index = layer.open({
type: 1,
content: $('#adduite'),
title: "插件分类",
area: ["70%", '50%'],
btnAlign: 'c',
end: function () {
}
})
})
$('.edit').click(function () {
var ids = $(this).attr('data-id');
var index = layer.open({
type: 1,
content: $('#appeduit'),
title: "插件分类",
area: ["70%", '50%'],
btnAlign: 'c',
success: function () {
console.log(ids);
$.ajax({
url: "{:U('addunit')}",
data: {
ids: ids,
},
type: 'post',
success: function (res) {
console.log(res);
if (res.status == 1) {
$('#unitid').val(res.id);
$('#uitnames').val(res.uitname);
}
},
error: function (error) {
console.log(error);
}
})
}
})
})
$('#editss').click(function () {
var id = $('#unitid').val();
var uitname = $('#uitnames').val();
console.log(id);
if (!uitname) {
layer.open({
title: '警告!'
, content: '请输入插件名称!'
});
} else {
$.ajax({
url: "{:U('appeduit')}",
data: {
id: id,
uitname: uitname,
},
type: 'post',
success: function (res) {
if (res.status == 1) {
layer.msg(res.msg, {time: 1000}, function () {
layer.closeAll();
window.location.reload();
})
} else {
layer.msg(res.msg, {time: 1000});
}
},
error: function (error) {
console.log(error);
}
})
}
})
$('.btns').click(function () {
var uitname = $('#uitname').val();
$.ajax({
url: "{:U('addunit')}",
data: {
uitname: uitname,
},
type: 'post',
success: function (res) {
console.log(res);
if (res.status == 1) {
layer.msg(res.msg, {time: 1000}, function () {
layer.closeAll();
window.location.reload();
})
} else {
layer.msg(res.msg, {time: 1000});
}
},
error: function (error) {
console.log(error);
}
})
})
$('.dels').click(function () {
let _this = this;
top.layer.open({
content: '确定删除?'
, btn: ['确定', '取消']
, yes: function (index, layero) {
//按钮【按钮一】的回调
$.post("{:U('App/delunit')}", {id: $(_this).attr('data-id')}, function (res) {
if (res.status == 1) {
$(_this).parents('.list').remove();
top.layer.msg(res.msg, {
icon: 1,
time: 1000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
layer.close(index);
});
} else {
top.layer.msg(res.msg, {
icon: 2,
time: 1000 //2秒关闭(如果不配置,默认是3秒)
}, function () {
layer.close(index);
});
}
})
}
, btn2: function (index, layero) {
//按钮【按钮二】的回调
//return false 开启该代码可禁止点击该按钮关闭
}
, cancel: function () {
//右上角关闭回调
//return false 开启该代码可禁止点击该按钮关闭
}
});
})
})
</script>
</html>