发表于: 2017-10-25 18:03:04

1 636


一、今日完成的事情:


Article列表

这里面的数据知道怎样请求了。

<table class="table table-striped add-table-border" style="width: 100%">
<thead>
<tr class="sheet">
<th>ID</th>
<th>名称</th>
<th>类型</th>
<th>发布时间</th>
<th>修改时间</th>
<th>发布者</th>
<th>状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<tr class="sheet" ng-repeat="self in article.ajaxData">
<td>{{$index+1}}</td>
<td>{{self.title}}</td>
<th>{{self.type}}</th>
<th>{{self.createAt | date:'yyyy-MM-dd HH:mm:ss'}}</th>
<th>{{self.updateAt | date:'yyyy-MM-dd HH:mm:ss'}}</th>
<th>{{self.author}}</th>
<th>{{self.status}}</th>
<td>
<a type="button" class="btn btn-sm ng-binding"
              ng-click=" vm.changeArticleStatus(item.id,item.status)">上线 </a>
<a type="button" class="btn btn-sm" ui-sref="field.articleDetail({id:item.id})"
              href="#/articleDetail?id=3383">编辑</a>
<a type="button" class="btn btn-sm" ng-click=" vm.delArticle(item.id,$index)">删除</a>
</td>
</tr>
</tbody>

</table>


app.controller('articleListCtrl', ['$scope', '$http', function ($scope, $http) {
$scope.article = {
ajaxData: []
};
$scope.list = function () {
var promise = $http.get('/carrots-admin-ajax/a/article/search');   //这里是请求地址 
promise.then(function (res) {
if (res.data.code === 0) {
$scope.article.ajaxData = res.data.data.articleList;
console.log(JSON.stringify($scope.article));
} else {
alert('服务器异常');
}
}, function (res) {
alert('请求错误');
})
}
$scope.list();
}])


出来的效果是这样的:


但是名称 类型 和状态  还是有点不会  不知道是不是需要这里面的数据  才可以显示出来  还是怎样~


对于过滤器 还是不会用~  


二、明天的计划:


1. 把任务6的需求 再重新梳理一遍 好做改正~

2. 基础知识不能落下。


三、遇到的问题:


以上已经说明


四、收获:


最起码知道这个页面的需求是什么  怎样才能做出来

ng-repeat   /   ng-view   /   ngRoute   /   module      ~~~~

总之是很烦的一天~  很烦   做不出东西 没思路 是很烦~~~~~~





任务进度:

demo获取:2017.10.18

demo提交:2017.10.25

是否有延期风险:   延期一天~



返回列表 返回列表
评论

    分享到