From eaa20cb58afc80e3612fd6e93d6f27e181a027e7 Mon Sep 17 00:00:00 2001
From: puzhibing <393733352@qq.com>
Date: 星期五, 07 四月 2023 17:38:29 +0800
Subject: [PATCH] 提交用户端开发版本

---
 management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js |   61 ++++++++++++++++++++++--------
 1 files changed, 44 insertions(+), 17 deletions(-)

diff --git a/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js b/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js
index d224124..5734e4d 100644
--- a/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js
+++ b/management/guns-admin/src/main/webapp/static/modular/system/tBroadcast/tBroadcast.js
@@ -14,11 +14,30 @@
 TBroadcast.initColumn = function () {
     return [
         {field: 'selectItem', radio: true},
-            {title: '主键', field: 'id', visible: true, align: 'center', valign: 'middle'},
-            {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'},
-            {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'},
-            {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: true, align: 'center', valign: 'middle'},
-            {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'}
+            {title: '主键', field: 'id', visible: false, align: 'center', valign: 'middle'},
+        {title: '添加时间', field: 'createTime', visible: true, align: 'center', valign: 'middle'},
+        {title: '消息内容', field: 'content', visible: true, align: 'center', valign: 'middle'},
+        {title: '是否显示', field: 'isShow', visible: true, align: 'center', valign: 'middle',
+            formatter: function (value, row) {
+                if (row.isShow){
+                    return '<span>是</span>'
+                }else {
+                    return '<span>否</span>'
+                }
+            }
+        },
+        {title: '排序', field: 'sort', visible: true, align: 'center', valign: 'middle'},
+        {title: '状态(1=正常,2=冻结,3=删除)', field: 'status', visible: false, align: 'center', valign: 'middle'},
+        {title: '操作', visible: true, align: 'center', valign: 'middle',width:150,
+            formatter: function (value, row) {
+                if (row.isShow){
+                    return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:red">下架</a>'
+                }else{
+                    return '<a href="#" onclick="TBroadcast.updateStatus('+row.id+')" style="color:blue">上架</a>' +'&nbsp;' +
+                        '<a href="#" onclick="TBroadcast.delete('+row.id+')" style="color:red">删除</a>'
+                }
+            }
+        }
     ];
 };
 
@@ -71,17 +90,15 @@
 /**
  * 删除
  */
-TBroadcast.delete = function () {
-    if (this.check()) {
-        var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) {
-            Feng.success("删除成功!");
-            TBroadcast.table.refresh();
-        }, function (data) {
-            Feng.error("删除失败!" + data.responseJSON.message + "!");
-        });
-        ajax.set("tBroadcastId",this.seItem.id);
-        ajax.start();
-    }
+TBroadcast.delete = function (id) {
+    var ajax = new $ax(Feng.ctxPath + "/tBroadcast/delete", function (data) {
+        Feng.success("删除成功!");
+        TBroadcast.table.refresh();
+    }, function (data) {
+        Feng.error("删除失败!" + data.responseJSON.message + "!");
+    });
+    ajax.set("tBroadcastId",id);
+    ajax.start();
 };
 
 /**
@@ -89,10 +106,20 @@
  */
 TBroadcast.search = function () {
     var queryData = {};
-    queryData['condition'] = $("#condition").val();
+    queryData['createTime'] = $("#createTime").val();
+    queryData['content'] = $("#content").val();
     TBroadcast.table.refresh({query: queryData});
 };
 
+/**
+ * 重置
+ */
+TBroadcast.resetSearch = function (){
+    $("#createTime").val('');
+    $("#content").val('');
+    TBroadcast.search();
+}
+
 $(function () {
     var defaultColunms = TBroadcast.initColumn();
     var table = new BSTable(TBroadcast.id, "/tBroadcast/list", defaultColunms);

--
Gitblit v1.7.1