From c3ff388274f154c6f4b489d95cf7df97e006adac Mon Sep 17 00:00:00 2001 From: HelloWorld Date: Sat, 30 Nov 2019 12:59:27 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A4=87=E5=BF=98=E5=BD=95=E5=A6=82=E6=9E=9C?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=B8=8D=E6=98=BE=E7=A4=BA=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/scripts/controllers/note-controller.js | 1 + public/views/note.html | 2 +- schema.sql | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/public/scripts/controllers/note-controller.js b/public/scripts/controllers/note-controller.js index a39a194..f07f8bf 100644 --- a/public/scripts/controllers/note-controller.js +++ b/public/scripts/controllers/note-controller.js @@ -100,6 +100,7 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind $scope.tags.forEach((tag) => { if ($scope.currentTagId === tag.id) { tagName = tag.name; + tag.ncnt += 1; } if (!$scope.currentTagId) { if (tag.name == '未分类') { diff --git a/public/views/note.html b/public/views/note.html index fe96664..8c19c93 100644 --- a/public/views/note.html +++ b/public/views/note.html @@ -1,7 +1,7 @@
{{ tag.name }} ({{ tag.ncnt || 0 }})
+ ng-click="clickTag(tag.id)" ng-show="tag.ncnt || add">{{ tag.name }} ({{ tag.ncnt || 0 }})
diff --git a/schema.sql b/schema.sql index 73b0d56..f7ae183 100644 --- a/schema.sql +++ b/schema.sql @@ -93,6 +93,6 @@ CREATE TABLE `notes` ( `content` text DEFAULT NULL, -- 备忘内容 `tag_id` int(11) DEFAULT NULL, -- 分类id `created_at` datetime DEFAULT now(), -- 创建时间 - `public` tinyint(4) DEFAULT '1', -- 是否公开 1 公开,0 不公开 + `public` tinyint(4) DEFAULT '0', -- 是否公开 1 公开,0 不公开 PRIMARY KEY (`id`) );