save
This commit is contained in:
parent
e5fdfc2bc4
commit
22b9b7bf71
@ -12,8 +12,6 @@ use plugin\admin\app\model\Option;
|
|||||||
use Support\Exception\BusinessException;
|
use Support\Exception\BusinessException;
|
||||||
use Support\Request;
|
use Support\Request;
|
||||||
use support\Response;
|
use support\Response;
|
||||||
use function config;
|
|
||||||
use function json;
|
|
||||||
|
|
||||||
class TableController extends Base
|
class TableController extends Base
|
||||||
{
|
{
|
||||||
|
@ -116,8 +116,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 表单属性 -->
|
<!-- 表单属性 -->
|
||||||
<div class="layui-tab-item">
|
<div class="layui-tab-item">
|
||||||
|
|
||||||
@ -219,7 +217,7 @@
|
|||||||
<script src="/app/admin/component/pear/pear.js"></script>
|
<script src="/app/admin/component/pear/pear.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let create_api = '/app/admin/table/create';
|
const CREATE_API = '/app/admin/table/create';
|
||||||
|
|
||||||
// 字段设置
|
// 字段设置
|
||||||
layui.use(['table', 'common', 'popup'], function () {
|
layui.use(['table', 'common', 'popup'], function () {
|
||||||
@ -721,7 +719,7 @@
|
|||||||
syncTableData();
|
syncTableData();
|
||||||
let data = layui.form.val('create-table-form');
|
let data = layui.form.val('create-table-form');
|
||||||
layui.jquery.ajax({
|
layui.jquery.ajax({
|
||||||
url: create_api,
|
url: CREATE_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dateType: 'json',
|
dateType: 'json',
|
||||||
data: data,
|
data: data,
|
||||||
@ -739,8 +737,6 @@
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
@ -69,7 +69,7 @@
|
|||||||
<script src="/app/admin/component/pear/pear.js"></script>
|
<script src="/app/admin/component/pear/pear.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let crud_api = "/app/admin/table/crud";
|
const CRUD_API = "/app/admin/table/crud";
|
||||||
|
|
||||||
layui.use(['jquery', 'xmSelect'], function() {
|
layui.use(['jquery', 'xmSelect'], function() {
|
||||||
layui.jquery.ajax({
|
layui.jquery.ajax({
|
||||||
@ -106,7 +106,7 @@
|
|||||||
//提交事件
|
//提交事件
|
||||||
layui.form.on('submit(save)', function (data) {
|
layui.form.on('submit(save)', function (data) {
|
||||||
layui.jquery.ajax({
|
layui.jquery.ajax({
|
||||||
url: crud_api,
|
url: CRUD_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dateType: 'json',
|
dateType: 'json',
|
||||||
data: data.field,
|
data: data.field,
|
||||||
|
@ -37,13 +37,13 @@
|
|||||||
<script src="/app/admin/component/pear/pear.js"></script>
|
<script src="/app/admin/component/pear/pear.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
|
// 相关接口
|
||||||
const SELECT_API = "/app/admin/table/show";
|
const SELECT_API = "/app/admin/table/show";
|
||||||
let drop_api = "/app/admin/table/drop";
|
const DROP_API = "/app/admin/table/drop";
|
||||||
|
const VIEW_URL = "/app/admin/table/view";
|
||||||
let view_url = "/app/admin/table/view";
|
const CREATE_URL = "/app/admin/table/create";
|
||||||
let create_url = "/app/admin/table/create";
|
const MODIFY_URL = "/app/admin/table/modify";
|
||||||
let modify_url = "/app/admin/table/modify";
|
const CRUD_URL = "/app/admin/table/crud";
|
||||||
let crud_url = "/app/admin/table/crud";
|
|
||||||
|
|
||||||
layui.use(['table', 'form', 'jquery', 'common', 'popup'], function() {
|
layui.use(['table', 'form', 'jquery', 'common', 'popup'], function() {
|
||||||
let table = layui.table;
|
let table = layui.table;
|
||||||
@ -58,7 +58,7 @@
|
|||||||
title: '表名',
|
title: '表名',
|
||||||
field: 'TABLE_NAME',
|
field: 'TABLE_NAME',
|
||||||
templet: function (d) {
|
templet: function (d) {
|
||||||
return '<a class="tab-link" src="' + view_url + '?table=' + d.TABLE_NAME + '">' + d.TABLE_NAME + '</a>';
|
return '<a class="tab-link" src="' + VIEW_URL + '?table=' + d.TABLE_NAME + '">' + d.TABLE_NAME + '</a>';
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@ -151,7 +151,7 @@
|
|||||||
shade: 0.1,
|
shade: 0.1,
|
||||||
maxmin: true,
|
maxmin: true,
|
||||||
area: [common.isModile()?'100%':'98%', common.isModile()?'100%':'95%'],
|
area: [common.isModile()?'100%':'98%', common.isModile()?'100%':'95%'],
|
||||||
content: create_url
|
content: CREATE_URL
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -163,7 +163,7 @@
|
|||||||
shade: 0.1,
|
shade: 0.1,
|
||||||
maxmin: true,
|
maxmin: true,
|
||||||
area: [common.isModile()?'100%':'98%', common.isModile()?'100%':'95%'],
|
area: [common.isModile()?'100%':'98%', common.isModile()?'100%':'95%'],
|
||||||
content: modify_url + '?table=' + table
|
content: MODIFY_URL + '?table=' + table
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +175,7 @@
|
|||||||
shade: 0.1,
|
shade: 0.1,
|
||||||
maxmin: true,
|
maxmin: true,
|
||||||
area: [common.isModile()?'100%':'500px', common.isModile()?'100%':'500px'],
|
area: [common.isModile()?'100%':'500px', common.isModile()?'100%':'500px'],
|
||||||
content: crud_url + '?table=' + table
|
content: CRUD_URL + '?table=' + table
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -200,7 +200,7 @@
|
|||||||
layer.close(index);
|
layer.close(index);
|
||||||
let loading = layer.load();
|
let loading = layer.load();
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: drop_api,
|
url: DROP_API,
|
||||||
data: {tables: tables},
|
data: {tables: tables},
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
type: 'post',
|
type: 'post',
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
<script src="/app/admin/component/pear/pear.js"></script>
|
<script src="/app/admin/component/pear/pear.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
const INSERT_URL = "/app/admin/table/insert";
|
const INSERT_API = "/app/admin/table/insert";
|
||||||
|
|
||||||
<?=$form->js(3)?>
|
<?=$form->js(3)?>
|
||||||
|
|
||||||
@ -42,7 +42,7 @@
|
|||||||
//提交事件
|
//提交事件
|
||||||
layui.form.on('submit(save)', function (data) {
|
layui.form.on('submit(save)', function (data) {
|
||||||
layui.jquery.ajax({
|
layui.jquery.ajax({
|
||||||
url: INSERT_URL,
|
url: INSERT_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dateType: 'json',
|
dateType: 'json',
|
||||||
data: data.field,
|
data: data.field,
|
||||||
|
@ -221,14 +221,14 @@
|
|||||||
<script src="/app/admin/component/pear/pear.js"></script>
|
<script src="/app/admin/component/pear/pear.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|
||||||
let modify_api = '/app/admin/table/modify';
|
const MODIFY_API = '/app/admin/table/modify';
|
||||||
let schema_api = '/app/admin/table/schema';
|
const SCHEMA_API = '/app/admin/table/schema';
|
||||||
let table_name = '<?=htmlspecialchars($table)?>';
|
const TABLE_NAME = '<?=htmlspecialchars($table)?>';
|
||||||
|
|
||||||
layui.use(['jquery'], function () {
|
layui.use(['jquery'], function () {
|
||||||
let $ = layui.jquery;
|
let $ = layui.jquery;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: schema_api + '?table=' + table_name,
|
url: SCHEMA_API + '?table=' + TABLE_NAME,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (res) {
|
success: function (res) {
|
||||||
// 表信息
|
// 表信息
|
||||||
@ -681,7 +681,7 @@
|
|||||||
syncTableData();
|
syncTableData();
|
||||||
let data = layui.form.val('create-table-form');
|
let data = layui.form.val('create-table-form');
|
||||||
layui.jquery.ajax({
|
layui.jquery.ajax({
|
||||||
url: modify_api,
|
url: MODIFY_API,
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
dateType: 'json',
|
dateType: 'json',
|
||||||
data: data,
|
data: data,
|
||||||
|
Loading…
Reference in New Issue
Block a user