微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

angularjs 自定义指令 弹出框

  • define(['app','../cons/serviceCons','../services/httpHandler'],
  • function(app,serviceCons) {
  • 'use strict';
  • app.directive('wcsTaskSearch',['wcs.ops.request','wcsDialog',
  • function(request,wcsDialog) {
  • return {
  • restrict: "A",
  • scope: {
  • taskId: "=",
  • },
  • replace: true,
  • //templateUrl:'common/template/taskSearch.html',
  • controller: ['$scope',
  • function($scope) {}],
  • link: function(scope,element,attrs) {
  • var taskSearch = function() {};
  • taskSearch.prototype = {
  • loading: false,
  • critical: {},
  • totalCount: 0,
  • currentPage: 1,
  • pageSize: 10,
  • searchData: [],
  • search: function(critical,flag) {
  • this.searchData = [];
  • this.critical = critical;
  • if (!flag) {
  • this.currentPage = 1;
  • }
  • critical.pageIndex = this.currentPage;
  • critical.pageSize = this.pageSize;
  • this.loading = true;
  • var _this = this;
  • //console.log(critical);
  • request.sendRequestWithUrl(serviceCons.localServiceUrl + '/ops/taskMgr/taskList',{
  • params: critical
  • }).then(function(resp) {
  • if (resp.data.errorCode == '0') {
  • _this.totalCount = resp.data.data.totalCount;
  • _this.searchData = resp.data.data.data || [];
  • }
  • _this.loading = false;
  • });
  • },
  • pageChanged: function() {
  • this.search(this.critical,1);
  • }
  • };
  • var showTaskDialog = function() {
  • wcsDialog.showDialogByUrl('common/template/taskSearchDialog.html',null,{
  • task: new taskSearch()
  • }).result.then(function(result) {
  • if (result) {
  • scope.taskId = result.TASK_ID;
  • }
  • });
  • };
  • $(element).on("click",showTaskDialog);
  • }
  • };
  • }]);
  • });- 这里是列表文本

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐