From e5de4e24fa0f9d1a133c613243fbb4c68fb3a3b8 Mon Sep 17 00:00:00 2001
From: luxiaotao1123 <t1341870251@63.com>
Date: 星期一, 12 九月 2022 16:06:56 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/cstmr/cstmr.js |   49 ++++++++++++++++++++++++++-----------------------
 1 files changed, 26 insertions(+), 23 deletions(-)

diff --git a/src/main/webapp/static/js/cstmr/cstmr.js b/src/main/webapp/static/js/cstmr/cstmr.js
index 6069426..e9ae79d 100644
--- a/src/main/webapp/static/js/cstmr/cstmr.js
+++ b/src/main/webapp/static/js/cstmr/cstmr.js
@@ -1,13 +1,16 @@
 var pageCurr;
 layui.config({
     base: baseUrl + "/static/layui/lay/modules/"
-}).use(['table','laydate', 'form', 'admin'], function(){
+}).extend({
+    dropdown: 'dropdown/dropdown',
+}).use(['table','laydate', 'form', 'admin', 'xmSelect', 'dropdown', 'element'], function(){
     var table = layui.table;
     var $ = layui.jquery;
     var layer = layui.layer;
     var layDate = layui.laydate;
     var form = layui.form;
     var admin = layui.admin;
+    var xmSelect = layui.xmSelect;
 
     // 鏁版嵁娓叉煋
     tableIns = table.render({
@@ -19,8 +22,8 @@
         limits: [15, 30, 50, 100, 200, 500],
         cellMinWidth: 100,
         height: 'full-120',
-        size: 'sm',
-        skin: 'nob',
+        // size: 'sm',
+        skin: 'line',
         cols: [[
             {type: 'checkbox'}
             // ,{field: 'id', align: 'center',title: 'ID'}
@@ -76,6 +79,24 @@
         }
     });
 
+    // 娣诲姞
+    $("#cstmrAddBtn").click(function () {
+        showEditModel();
+    });
+
+    // 鍒犻櫎
+    form.on('submit(cstmrDel)', function (data) {
+        let checkStatus = layui.table.checkStatus('cstmr').data;
+        if (checkStatus.length === 0) {
+            layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
+            return;
+        }
+        del(checkStatus.map(function (d) {
+            return d.id;
+        }));
+    });
+
+
     // 鐩戝惉鎺掑簭浜嬩欢
     table.on('sort(cstmr)', function (obj) {
         var searchData = {};
@@ -90,24 +111,6 @@
         });
     });
 
-    // 鐩戝惉澶村伐鍏锋爮浜嬩欢
-    table.on('toolbar(cstmr)', function (obj) {
-        var checkStatus = table.checkStatus(obj.config.id).data;
-        switch(obj.event) {
-            case 'addData':
-                showEditModel();
-                break;
-            case 'deleteData':
-               if (checkStatus.length === 0) {
-                   layer.msg('璇烽�夋嫨瑕佸垹闄ょ殑鏁版嵁', {icon: 2});
-                   return;
-               }
-               del(checkStatus.map(function (d) {
-                   return d.id;
-               }));
-               break;
-        }
-    });
 
     // 鐩戝惉琛屽伐鍏蜂簨浠�
     table.on('tool(cstmr)', function(obj){
@@ -126,8 +129,8 @@
     function showEditModel(mData) {
         admin.open({
             type: 1,
-            area: '600px',
-            title: (mData ? '淇敼' : '娣诲姞') + '璁㈠崟鐘舵��',
+            area: '1500px',
+            title: (mData ? '淇敼' : '娣诲姞') + '鐢叉柟鍗曚綅',
             content: $('#editDialog').html(),
             success: function (layero, dIndex) {
                 layDateRender(mData);

--
Gitblit v1.9.1