From 539d9ffc477d28a23a923b41fdeabc8c37c99ce6 Mon Sep 17 00:00:00 2001
From: zjj <3272660260@qq.com>
Date: 星期一, 23 九月 2024 14:43:31 +0800
Subject: [PATCH] #

---
 src/main/webapp/static/js/configType/configType.js |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/src/main/webapp/static/js/configType/configType.js b/src/main/webapp/static/js/configType/configType.js
index f6afb15..3ae58db 100644
--- a/src/main/webapp/static/js/configType/configType.js
+++ b/src/main/webapp/static/js/configType/configType.js
@@ -22,7 +22,8 @@
         cols: [[
             {type: 'checkbox', fixed: 'left'}
             ,{field: 'id', title: 'ID', sort: true,align: 'center', fixed: 'left', width: 80}
-            ,{field: 'type', align: 'center',title: '绫诲瀷'}
+            ,{field: 'type', align: 'center',title: '绫诲瀷',hide:true}
+            ,{field: 'name', align: 'center',title: '鍚嶇О'}
             ,{field: 'value', align: 'center',title: '鍊�'}
             ,{fixed: 'right', title:'鎿嶄綔', align: 'center', toolbar: '#operate', width:150}
         ]],
@@ -86,8 +87,9 @@
                     shadeClose: false,
                     content: 'configTypeAdd.html',
                     success: function(layero, index){
-                    	clearFormVal(layer.getChildFrame('#detail', index));
+                    	// clearFormVal(layer.getChildFrame('#detail', index));
                         layer.iframeAuto(index);layer.style(index, {top: (($(window).height()-layer.getChildFrame('#data-detail', index).height())/3)+"px"});
+
                     }
                 });
                 break;
@@ -171,7 +173,7 @@
     });
 
     // 鐩戝惉琛屽伐鍏蜂簨浠�
-    table.on('tool(role)', function(obj){
+    table.on('tool(configType)', function(obj){
         var data = obj.data;
         switch (obj.event) {
             // 璇︽儏
@@ -244,17 +246,26 @@
                    });
                 }
                 break;
-            case 'power':
-                roleId = data.id;
-                layer.open({
-                    type: 2,
-                    title: data.name + ' 鏉冮檺鍒嗛厤',
-                    maxmin: true,
-                    area: [top.detailWidth/2, '85%'],
-                    shadeClose: false,
-                    content: 'role_power_detail.html',
-                    success: function(layero, index){
-                    }
+            case 'delete':
+                id = data.id;
+                layer.confirm('纭畾鍒犻櫎鍚�', function(){
+                    $.ajax({
+                        url: baseUrl+"/configType/delete/auth",
+                        headers: {'token': localStorage.getItem('token')},
+                        data: {id: id},
+                        method: 'POST',
+                        traditional:true,
+                        success: function (res) {
+                            if (res.code === 200){
+                                layer.closeAll();
+                                tableReload(false);
+                            } else if (res.code === 403){
+                                top.location.href = baseUrl+"/";
+                            } else {
+                                layer.msg(res.msg)
+                            }
+                        }
+                    })
                 });
                 break;
         }
@@ -266,6 +277,7 @@
             shade: [0.5,'#000'] //0.1閫忔槑搴︾殑鑳屾櫙
         });
         var data = {
+            name: $('#type option:selected').text(),
             type: $('#type').val(),
             value: $('#value').val(),
         };

--
Gitblit v1.9.1