修复tags页面table问题
This commit is contained in:
parent
9121d5da62
commit
33cd8229f9
|
|
@ -9,8 +9,10 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
|
||||||
await getTags();
|
await getTags();
|
||||||
})()
|
})()
|
||||||
|
|
||||||
var dialog = null;
|
let dialog = null;
|
||||||
var addBookmarkId = -1;
|
let addBookmarkId = -1; // 新增一个书签会重新刷新页面
|
||||||
|
let timeagoInstance = timeago();
|
||||||
|
|
||||||
$scope.hoverBookmark = null;
|
$scope.hoverBookmark = null;
|
||||||
$scope.showType = "createdAt";
|
$scope.showType = "createdAt";
|
||||||
$scope.loading = true;
|
$scope.loading = true;
|
||||||
|
|
@ -27,7 +29,6 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
|
||||||
$scope.waitDelTag = {};
|
$scope.waitDelTag = {};
|
||||||
$scope.waitDelBookmark = {};
|
$scope.waitDelBookmark = {};
|
||||||
$scope.bookmarkNormalHover = false;
|
$scope.bookmarkNormalHover = false;
|
||||||
var timeagoInstance = timeago();
|
|
||||||
|
|
||||||
pubSubService.subscribe('MenuCtr.tags', $scope, function (event, data) {
|
pubSubService.subscribe('MenuCtr.tags', $scope, function (event, data) {
|
||||||
console.log('subscribe MenuCtr.tags', data);
|
console.log('subscribe MenuCtr.tags', data);
|
||||||
|
|
@ -57,7 +58,13 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
|
||||||
};
|
};
|
||||||
|
|
||||||
let reply = await get('bookmarksByTag', params);
|
let reply = await get('bookmarksByTag', params);
|
||||||
$scope.bookmarks = reply.data;
|
let bookmarks = reply.data;
|
||||||
|
for (bookmark of bookmarks) {
|
||||||
|
let tag = $scope.tags.find(tag => tag.id == bookmark.tagId);
|
||||||
|
tag && (bookmark.tagName = tag.name);
|
||||||
|
}
|
||||||
|
|
||||||
|
$scope.bookmarks = bookmarks;
|
||||||
$scope.totalPages = reply.totalPages;
|
$scope.totalPages = reply.totalPages;
|
||||||
$scope.inputPage = '';
|
$scope.inputPage = '';
|
||||||
$scope.loading = false;
|
$scope.loading = false;
|
||||||
|
|
@ -68,6 +75,14 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let id = setInterval(() => {
|
||||||
|
if (document.querySelectorAll('.need_to_be_rendered').length > 0) {
|
||||||
|
timeagoInstance.cancel();
|
||||||
|
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');
|
||||||
|
clearInterval(id);
|
||||||
|
}
|
||||||
|
}, 10);
|
||||||
|
|
||||||
pubSubService.publish('Common.menuActive', {
|
pubSubService.publish('Common.menuActive', {
|
||||||
login: true,
|
login: true,
|
||||||
index: dataService.LoginIndexTags
|
index: dataService.LoginIndexTags
|
||||||
|
|
@ -78,7 +93,7 @@ app.controller('tagsCtr', ['$scope', '$filter', '$state', '$window', '$statePara
|
||||||
duration: 1000,
|
duration: 1000,
|
||||||
});
|
});
|
||||||
addBookmarkId = -1;
|
addBookmarkId = -1;
|
||||||
});
|
}, 10);
|
||||||
};
|
};
|
||||||
|
|
||||||
$scope.changeCurrentPage = function (currentPage) {
|
$scope.changeCurrentPage = function (currentPage) {
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
<div class="content" style="cursor: move" sv-handle>
|
<div class="content" style="cursor: move" sv-handle>
|
||||||
<div class="description">
|
<div class="description">
|
||||||
<p>书签:{{ tag.bookmarkCount || 0 }}个</p>
|
<p>书签:{{ tag.bookmarkCount || 0 }}个</p>
|
||||||
<p>{{ tag.last_use }}</p>
|
<p>{{ tag.lastUse }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="extra content">
|
<div class="extra content">
|
||||||
|
|
@ -58,8 +58,8 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th class="forbid_sorted">标题</th>
|
<th class="forbid_sorted">标题</th>
|
||||||
<th class="forbid_sorted">链接</th>
|
<th class="forbid_sorted">链接</th>
|
||||||
<th style="width:90px;" ng-class="{descending: showType == 'createdAt', sorted:showType == 'createdAt'}" ng-click="getBookmarks(null, 1, 'createdAt')" title="点击可对表格进行排序">点击次数</th>
|
<th style="width:90px;" ng-class="{descending: showType == 'clickCount', sorted:showType == 'clickCount'}" ng-click="getBookmarks(null, 1, 'clickCount')" title="点击可对表格进行排序">点击次数</th>
|
||||||
<th style="width:100px;" ng-class="{descending: showType == 'clickCount', sorted:showType == 'clickCount'}" ng-click="getBookmarks(null, 1, 'clickCount')" title="点击可对表格进行排序">创建日期</th>
|
<th style="width:100px;" ng-class="{descending: showType == 'createdAt', sorted:showType == 'createdAt'}" ng-click="getBookmarks(null, 1, 'createdAt')" title="点击可对表格进行排序">添加日期</th>
|
||||||
<th style="width:100px;" ng-class="{descending: showType == 'lastClick', sorted:showType == 'lastClick'}" ng-click="getBookmarks(null, 1, 'lastClick')" title="点击可对表格进行排序">最后点击</th>
|
<th style="width:100px;" ng-class="{descending: showType == 'lastClick', sorted:showType == 'lastClick'}" ng-click="getBookmarks(null, 1, 'lastClick')" title="点击可对表格进行排序">最后点击</th>
|
||||||
<th style="width:150px;" class="forbid_sorted">分类</th>
|
<th style="width:150px;" class="forbid_sorted">分类</th>
|
||||||
<th style="width:88px;" class="forbid_sorted">操作</th>
|
<th style="width:88px;" class="forbid_sorted">操作</th>
|
||||||
|
|
@ -76,16 +76,16 @@
|
||||||
<td>
|
<td>
|
||||||
<span title="{{bookmark.url}} 点击复制链接" ng-click="copy(bookmark.url)" style="cursor:default;">{{ bookmark.url }}</span>
|
<span title="{{bookmark.url}} 点击复制链接" ng-click="copy(bookmark.url)" style="cursor:default;">{{ bookmark.url }}</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{{ bookmark.click_count }}</td>
|
<td>{{ bookmark.clickCount }}</td>
|
||||||
<td>
|
<td>
|
||||||
<span title="{{bookmark.createdAt}}" class="need_to_be_rendered" data-timeago="{{bookmark.createdAt}}"></span>
|
<span title="{{bookmark.createdAt}}" class="need_to_be_rendered" data-timeago="{{bookmark.createdAt}}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<span id="time{{bookmark.id}}" title="{{bookmark.last_click}}" class="need_to_be_rendered" data-timeago="{{bookmark.last_click}}"></span>
|
<span id="time{{bookmark.id}}" title="{{bookmark.lastClick}}" class="need_to_be_rendered" data-timeago="{{bookmark.lastClick}}"></span>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<div class="ui label" ng-repeat="tag in bookmark.tags" tag-id="{{ tag.id }}" ng-click="getBookmarks(tag.id, 1, null)">
|
<div class="ui label">
|
||||||
{{ tag.name }}
|
{{ bookmark.tagName }}
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue