优化:基础数据管理中删除表单时的警告提醒

master
Guo XIn 1 year ago
parent 2d69ed8072
commit 61584709e3
  1. 23
      shandan-basedata/src/main/resources/view/dynamicForm/formList.html

@ -14,10 +14,12 @@
<div id="form-list-table" lay-filter="form-list-table"></div> <div id="form-list-table" lay-filter="form-list-table"></div>
<script type="text/html" id="table-head-toolbar"> <script type="text/html" id="table-head-toolbar">
<div class="btn-comp"> <div class="btn-comp">
<button type="button" class="layui-btn layui-btn-sm layui-btn-warm" lay-event="newDesign">设计表单</button> <button type="button" class="layui-btn layui-btn-sm layui-btn-warm" lay-event="newDesign">设计表单
</button>
</div> </div>
<div class="search-comp"> <div class="search-comp">
<input class="layui-input" type="text" id="searchText" name="searchText" placeholder="请输入表单名称进行查询"/> <input class="layui-input" type="text" id="searchText" name="searchText"
placeholder="请输入表单名称进行查询"/>
<button type="button" class="layui-btn layui-btn-sm" lay-event="query">查 询</button> <button type="button" class="layui-btn layui-btn-sm" lay-event="query">查 询</button>
</div> </div>
</script> </script>
@ -79,7 +81,7 @@
openFormConfigLayer(id); openFormConfigLayer(id);
break; break;
case 'delete': case 'delete':
formDelete(id) formDelete(data)
break; break;
} }
} }
@ -100,7 +102,10 @@
cancel: function (index, layerObj) { cancel: function (index, layerObj) {
let iframeWin = window[layerObj.find('iframe')[0]['name']]; let iframeWin = window[layerObj.find('iframe')[0]['name']];
if (iframeWin.isChange()) { if (iframeWin.isChange()) {
layer.confirm('关闭窗口将不会保存更改的内容,是否继续关闭?', {title: '关闭表单设计器', btn: ['关闭', '取消']}, function () { layer.confirm('关闭窗口将不会保存更改的内容,是否继续关闭?', {
title: '关闭表单设计器',
btn: ['关闭', '取消']
}, function () {
layer.closeAll(); layer.closeAll();
}) })
} else { } else {
@ -132,10 +137,14 @@
/** /**
* 删除表单 * 删除表单
* @param id * @param data
*/ */
function formDelete(id) { function formDelete(data) {
layer.confirm('是否删除该表单?', {title: '删除确认', btn: ['删除', '取消']}, function (layIndex) { const {id, formId} = data;
layer.confirm(`将同时删除以下数据库表:<br/><label style="color: orange">${formId}</label><br/>是否继续删除?`, {
title: '删除确认',
btn: ['删除', '取消']
}, function (layIndex) {
postRequest(`${ctx}/dynamic-form/api/form/delete`, {id}).then(res => { postRequest(`${ctx}/dynamic-form/api/form/delete`, {id}).then(res => {
layer.close(layIndex); layer.close(layIndex);
res.flag ? showOkMsg('删除成功') : showErrorMsg(res.msg); res.flag ? showOkMsg('删除成功') : showErrorMsg(res.msg);