From d6734600fef60ae54477caf95ee1c5929d183ddc Mon Sep 17 00:00:00 2001 From: yutou Date: Fri, 18 Jun 2021 15:44:40 +0800 Subject: [PATCH] =?UTF-8?q?OSS=E5=A4=87=E4=BB=BD=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=E4=B8=8A=E7=BA=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/yutou/tools/ToolsApplication.java | 2 +- .../yutou/tools/utils/NasDepotManager.java | 7 +++-- web/html/body/nas/oss.html | 27 ++++++++++++------- 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/src/main/java/com/yutou/tools/ToolsApplication.java b/src/main/java/com/yutou/tools/ToolsApplication.java index c6942ca..cf7131c 100644 --- a/src/main/java/com/yutou/tools/ToolsApplication.java +++ b/src/main/java/com/yutou/tools/ToolsApplication.java @@ -5,7 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication; @SpringBootApplication public class ToolsApplication { - public static final String version="1.1.2"; + public static final String version="1.1.3"; public static void main(String[] args) { System.out.println("当前版本号:" + version); diff --git a/src/main/java/com/yutou/tools/utils/NasDepotManager.java b/src/main/java/com/yutou/tools/utils/NasDepotManager.java index 0a55823..8ebdb89 100644 --- a/src/main/java/com/yutou/tools/utils/NasDepotManager.java +++ b/src/main/java/com/yutou/tools/utils/NasDepotManager.java @@ -14,9 +14,12 @@ public class NasDepotManager { @ResponseBody @RequestMapping("/add.do") - public JSONObject addNasPath(String path) { + public JSONObject addNasPath(String path,String type) { JSONObject json=new JSONObject(); - long size=RedisTools.list_add(DEPOT_NAME, path); + JSONObject item=new JSONObject(); + item.put("path",path); + item.put("type",type); + long size=RedisTools.list_add(DEPOT_NAME,item.toJSONString()); if(size==0){ json.put("code",0); json.put("msg","添加失败"); diff --git a/web/html/body/nas/oss.html b/web/html/body/nas/oss.html index 620860a..1a40f60 100644 --- a/web/html/body/nas/oss.html +++ b/web/html/body/nas/oss.html @@ -38,16 +38,14 @@ console.log(2) let ta=table.render({ elem: "#oss", - height: 312, url: "/nas/depot/list.do", page: false, toolbar: '#topTools', parseData: function (json) { let item = []; for (let i in json.data) { - item[i] = {'item': json.data[i]} + item[i] =JSON.parse(json.data[i]) } - console.log(item) return { "code": 0, "msg": json.msg, @@ -55,15 +53,16 @@ } }, cols: [[ - {field: 'item', title: '地址', sort: true}, + {field: 'path', title: '地址', width: 400,sort: true}, + {field: 'type', title: '类型',width: 150, sort: true}, { field: "right", width: 200, toolbar: '#listTools' } ]], done:function (){ table.on('tool(myOssFilter)', function (obj) { - console.log('del') + console.log(obj.data) if (obj.event === 'del') { layer.msg(obj.data.item) - $.post('/nas/depot/remove.do',{'path':obj.data.item},function (json) { + $.post('/nas/depot/remove.do',{'path':JSON.stringify(obj.data)},function (json) { layer.msg(json.msg) }); } @@ -75,10 +74,18 @@ formType: 2, value: '/media/yutou/4t/public/', title: '请输入地址', - }, function(value, index, elem){ - $.post('/nas/depot/add.do',{'path':value},function (json) { - layer.msg(json.msg) - }); + }, function(path, index, elem){ + layer.prompt({ + formType: 2, + value: 'depot/photo/music', + title: '请选择类型', + },function (type,index,elem) { + $.post('/nas/depot/add.do',{'path':path,'type':type},function (json) { + layer.msg(json.msg) + }); + layer.close(index); + }) + layer.close(index); }); }