--信息系统验证功能

Web_Manager_Develope
wu ming 8 years ago
parent 464b415904
commit 702d2be8e8

@ -1,4 +1,5 @@
/// <reference path="../../includes.d.ts" /> /// <reference path="../../includes.d.ts" />
/// <reference path="customAlert.d.ts" />
declare module Configs { declare module Configs {
function removeElementByValue(array: Array<any>, value: any, key?: string): void; function removeElementByValue(array: Array<any>, value: any, key?: string): void;
function removeElementsByValue(array: Array<any>, elements: Array<any>): void; function removeElementsByValue(array: Array<any>, elements: Array<any>): void;
@ -7,4 +8,5 @@ declare module Configs {
*/ */
function deepCopy(object: any): any; function deepCopy(object: any): any;
function downloadFile($scope: any, $http: any, url: any, fn?: any): void; function downloadFile($scope: any, $http: any, url: any, fn?: any): void;
function FileInputPlugin(fn: Function, isMultiple?: boolean): void;
} }

@ -1,9 +1,16 @@
/// <reference path="../../includes.d.ts" /> /// <reference path="../../includes.d.ts" />
/// <reference path="configPlugin.d.ts" /> /// <reference path="configPlugin.d.ts" />
/// <reference path="configsDataService.d.ts" /> /// <reference path="configsDataService.d.ts" />
/// <reference path="configsUtils.d.ts" />
/// <reference path="customAlert.d.ts" />
/// <reference path="../../kubernetes/ts/kubernetesHelpers.d.ts" />
declare module Configs { declare module Configs {
var TableEdit: ng.IModule; var TableEdit: ng.IModule;
var VolumeController: ng.IModule; var VolumeController: ng.IModule;
var SystemInfoController: ng.IModule; var SystemInfoController: ng.IModule;
var SqlViewController: ng.IModule; var SqlViewController: ng.IModule;
var SqlAddController: ng.IModule;
var sqlVerificationController: ng.IModule;
var sqlMoveController: ng.IModule;
var sysVerUpdateController: ng.IModule;
} }

@ -2,6 +2,9 @@
/// <reference path="systemPlugin.d.ts" /> /// <reference path="systemPlugin.d.ts" />
/// <reference path="systemHelpers.d.ts" /> /// <reference path="systemHelpers.d.ts" />
/// <reference path="systemServices.d.ts" /> /// <reference path="systemServices.d.ts" />
/// <reference path="../../configs/ts/configsUtils.d.ts" />
/// <reference path="../../configs/ts/customAlert.d.ts" />
/// <reference path="../../kubernetes/ts/kubernetesHelpers.d.ts" />
declare module System { declare module System {
var SystemSQLManagement: ng.IModule; var SystemSQLManagement: ng.IModule;
} }

File diff suppressed because one or more lines are too long

@ -17,7 +17,7 @@ a:hover,a:active{color:#333;}
/* public*/ /* public*/
.mt2{margin-top: 3px;} .mt2{margin-top: 3px;}
.mt5{ margin-top: 5px;}.mt10{ margin-top: 10px;} .mt5{ margin-top: 5px;}.mt10{ margin-top: 10px;}
.ml5{ margin-left:5px;}.ml10{ margin-left:10px;} .ml5{ margin-left:5px;}.ml10{ margin-left:10px;}.ml15{ margin-left:15px;}
.mr5{ margin-right:5px;}.mr10{ margin-right:10px;} .mr5{ margin-right:5px;}.mr10{ margin-right:10px;}
.mb10{ margin-bottom: 10px;} .mb10{ margin-bottom: 10px;}
a.sj_btn_grey{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #fdfdfd,#e8e8e8);background-image:linear-gradient(top,#fdfdfd,#e8e8e8); border:1px solid #cecece; color:#505050;} a.sj_btn_grey{ display:inline-block; padding:0px 15px; height:30px; line-height:30px; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; background-image:-webkit-linear-gradient(top, #fdfdfd,#e8e8e8);background-image:linear-gradient(top,#fdfdfd,#e8e8e8); border:1px solid #cecece; color:#505050;}
@ -174,9 +174,9 @@ treecontrol li:hover{}
.box_chakan_mininfo{ display:inline-block; width: 250px; text-align: left; color: #666; } .box_chakan_mininfo{ display:inline-block; width: 250px; text-align: left; color: #666; }
.box_chakan_smallinfo{ display:inline-block; width: 140px; text-align: left; color: #666; } .box_chakan_smallinfo{ display:inline-block; width: 140px; text-align: left; color: #666; }
/*查看弹框 20161027byLB*/ /*查看弹框 20161027byLB*/
.sj_box_w440{ width: 430px; height: 400px; overflow-x:scroll; border:1px solid #eee; color: #666; padding:5px;} .sj_box_w440{ width: 430px; height: 400px; overflow-x:scroll; border:1px solid #eee;background: #fff; color: #666; padding:5px;}
.sj_new_box02{ width:450px; margin:0 auto; padding:20px; } .sj_new_box02{ width:450px; margin:0 auto; padding:20px; }
.sj_new_box03{ width:890px; margin:0 auto; padding:20px; } .sj_new_box03{ width:880px; margin:0 auto; }
.sj_width440{width: 440px;} .sj_width440{width: 440px;}
.fb{ font-weight: bold;} .fb{ font-weight: bold;}
.mr60{ margin-right: 60px;} .mr60{ margin-right: 60px;}

@ -150,10 +150,7 @@
<li class="clear"> <li class="clear">
<span class="fl box_chakan_leftinfo">脚本文件:</span> <span class="fl box_chakan_leftinfo">脚本文件:</span>
<p class="fl box_chakan_maxinfo"> <p class="fl box_chakan_maxinfo">
192.168.0.110 /home/script/ <span ng-repeat="sql in ngDialogData.sqlList">{{sql}} <br /></span>
<br/> UserTablespace_321202_05.sql
<br/> Checkout_Indicate_321202_05.sql
<br/> Checkout_Pay_321202_05.sql
<br/> <br/>
</p> </p>
</li> </li>
@ -166,7 +163,7 @@
</script> </script>
<script type="text/ng-template" id="sqlView.html"> <script type="text/ng-template" id="sqlView.html">
<div class="sj_new_box03"> <div class="sj_new_box03">
<h2 class="sj_popup_h2 mb10">Checkout_Indicate_321202_05.sql</h2> <h2 class="sj_popup_h2 mb10">Checkout_sIndicate_321202_05.sql</h2>
<div class="clear mb10"> <div class="clear mb10">
<ul class="fl sj_width440"> <ul class="fl sj_width440">
<li><span class="fb">默认脚本:</span>2016-01-25 12:00</li> <li><span class="fb">默认脚本:</span>2016-01-25 12:00</li>
@ -174,23 +171,96 @@
</ul> </ul>
<div class="fl sj_width440"> <div class="fl sj_width440">
<input type="text" class="sj_txt_box02 mr5 fl"> <input type="text" class="sj_txt_box02 mr5 fl">
<button class="sj_btn_green fl">上传</button> <button class="sj_btn_green fl" ng-click="upLoadSqlFile()">上传</button>
</div> </div>
</div> </div>
<div class="clear mb10"> <div class="clear mb10">
<div class="sj_box_w440 fl"> <div class="sj_box_w440 fl">
<p>SELECT '320100' AS XZQHDM, '江苏省南京市本级' AS XZQHMC, '2015' AS YSND, A.JSDE106 AS ZBCODE, A.JSDE107 AS ZB_ID, B.DE151 AS ZB_NO, B.JSDE011 AS ZBDJLXCODE, H.JSDE902 AS ZBDJLXNAME, J.JSD <p ng-bind="old_content">
</p>
</div>
<div class=" sj_box_w440 fl ml15">
<p ng-bind="new_content">
</p> </p>
</div> </div>
</div>
<div class=" clear">
<button class="btn pull-right sj_btn_blue " ng-disabled="!enable" ng-click="onOk()">
确定
</button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button>
</div>
</div>
</script>
<script type="text/ng-template" id="sqlAdd.html">
<div class="sj_new_box02">
<h2 class="sj_popup_h2 mb10">Checkout_Indicate_321202_05.sql</h2>
<div class="clear mb10">
<input type="text" class="sj_txt_box02 mr5 fl">
<button class="sj_btn_green fl" ng-click="sqlFileUpload()">上传</button>
</div>
<div class="sj_box_w440 mb10">
<p>{{content}}</p>
</div>
<div class=" clear">
<button class="btn pull-right sj_btn_blue " ng-disabled="!enable" ng-click="onOk()">确定</button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button>
</div>
</div>
</script>
<script type="text/ng-template" id="sqlVerification.html">
<div class="sj_new_box03">
<h2 class="sj_popup_h2 mb10">Checkout_sIndicate_321202_05.sql</h2>
<div class="clear mb10">
<ul class="fl sj_width440">
<li><span class="fb">默认脚本:</span>2016-01-25 12:00</li>
<li class="sj_link">/Default Script/Default Script/Default Script/Default Script/Default Script/Default Script</li>
</ul>
<!--<div class="fl sj_width440">
<input type="text" class="sj_txt_box02 mr5 fl">
<button class="sj_btn_green fl" ng-click="upLoadSqlFile()">上传</button>
</div> -->
</div>
<div class="clear mb10">
<div class="sj_box_w440 fl"> <div class="sj_box_w440 fl">
<p ng-bind="standard">
</p>
</div>
<div class=" sj_box_w440 fl ml15">
<p ng-bind="unnormal">
</p>
</div> </div>
</div> </div>
<div class=" clear"> <div class=" clear">
<button class="sj_btn_blue mr5 fr">确定</button> <button class="btn pull-right sj_btn_blue " ng-click="replace()">
<button class="sj_btn_grey mr5 fr">取消</button> 替换
</button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button>
</div>
</div> </div>
</script>
<script type="text/ng-template" id="sqlMove.html">
<div class="sj_new_box02">
<h2 class="sj_popup_h2 mb10">Checkout_Indicate_321202_05.sql</h2>
<!--<div class="clear mb10">
<input type="text" class="sj_txt_box02 mr5 fl">
<button class="sj_btn_green fl" ng-click="move()">归档</button>
</div> -->
<div class="sj_box_w440 mb10">
<p ng-bind="content"></p>
</div> </div>
<div class=" clear">
<button class="btn pull-right sj_btn_blue " ng-disabled="!content && content != ''" ng-click="move()">归档</button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button>
</div>
</div>
</script>
<script type="text/ng-template" id="sysVerificationUpdate.html">
</script> </script>
<div ng-controller="Kubernetes.TopLevel"> <div ng-controller="Kubernetes.TopLevel">
<div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over uploader="uploader" over-class="ready-drop"> <div class="wiki-icon-view" ng-controller="Kubernetes.FileDropController" nv-file-drop nv-file-over uploader="uploader" over-class="ready-drop">
<div class="row kubernetes-view" ng-view></div> <div class="row kubernetes-view" ng-view></div>

@ -1,5 +1,5 @@
/// <reference path="../../includes.ts"/> /// <reference path="../../includes.ts"/>
/// <reference path="customAlert.ts"/>
module Configs{ module Configs{
export function removeElementByValue(array:Array<any> ,value:any, key?:string ){ export function removeElementByValue(array:Array<any> ,value:any, key?:string ){
if(key){ if(key){
@ -148,4 +148,21 @@ module Configs{
$scope.errorDetails = "Request failed with status: " + status; $scope.errorDetails = "Request failed with status: " + status;
}); });
} }
export function FileInputPlugin(fn: Function, isMultiple?:boolean){
var inputObj = document.createElement('input');
inputObj.setAttribute('id','myFileInput');
inputObj.setAttribute('type','file');
inputObj.setAttribute("style",'visibility:hidden');
if(isMultiple)
inputObj.setAttribute("multiple", "multiple");
document.body.appendChild(inputObj);
inputObj.click();
inputObj.onchange = (element) =>{
fn(element.target["files"]);
var my = document.getElementById("myFileInput");
if(null != my)
document.body.removeChild(my);
}
}
} }

@ -1,6 +1,10 @@
/// <reference path="../../includes.ts"/> /// <reference path="../../includes.ts"/>
/// <reference path="configPlugin.ts"/> /// <reference path="configPlugin.ts"/>
/// <reference path="configsDataService.ts"/> /// <reference path="configsDataService.ts"/>
/// <reference path="../../configs/ts/configsUtils.ts"/>
/// <reference path="../../configs/ts/customAlert.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
module Configs{ module Configs{
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => { export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
$scope.editRow = (entity)=>{ $scope.editRow = (entity)=>{
@ -74,8 +78,6 @@ module Configs{
}]); }]);
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{ export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
var model = $scope.ngDialogData;
//处理年月
}]); }]);
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{ export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
@ -88,23 +90,168 @@ module Configs{
params: {type: $scope.ngDialogData.type}, params: {type: $scope.ngDialogData.type},
data: JSON.stringify($scope.ngDialogData.item) data: JSON.stringify($scope.ngDialogData.item)
}).success(function(data,header,config,status){ }).success(function(data,header,config,status){
$scope.old_content = data.data1;
//响应成功 //响应成功
}).error(function(data,header,config,status){ }).error(function(data,header,config,status){
//处理响应失败 //处理响应失败
$scope.old_content = "获取脚本内容失败"
}); });
} }
$scope.sqlUpload = (file) => { $scope.upLoadSqlFile = () => {
if(typeof FileReader == 'undefined'){ if(typeof FileReader == 'undefined'){
throw "浏览器不支持FileReader读取文件" throw "浏览器不支持FileReader读取文件";
}else{
Configs.FileInputPlugin((file) =>{
$scope.enable = true;
if(typeof typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else{
var fr = new FileReader();
fr.onloadend = (e) =>{
$scope.new_content = e.target["result"];
}
fr.readAsText(file[0],"UTF-8");
}
});
}
}
$scope.onOk = () => {
$scope.enable = false;
if(null == $scope.new_content || $scope.new_content == ""){
console.log("上传的内容不能为空");
$scope.closeThisDialog();
}else{ }else{
$scope.$emit("onOk",{
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.new_content,
opt: "add",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
/*$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: $scope.ngDialogData.type},
data: JSON.stringify($scope.ngDialogData.item)
}).scuess((data,header,config,status) => {
}).error((data,header,config,status) => {
});*/
//$scope.closeThisDialog();
}
}
$scope.cancel = () => {
$scope.enable = false;
$scope.closeThisDialog();
}
}]);
export var SqlAddController = controller('SqlAddController', ['$scope', '$http', ($scope, $http) => {
$scope.content = null;
$scope.sqlFileUpload = () =>{
Configs.FileInputPlugin((file) =>{
$scope.enable = true;
if(typeof typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else{
var fr = new FileReader(); var fr = new FileReader();
fr.onloadend = (e) =>{ fr.onloadend = (e) =>{
console.log(e.target.result); $scope.content = e.target["result"];
} }
fr.readAsText(file[0],"UTF-8"); fr.readAsText(file[0],"UTF-8");
} }
});
}
$scope.onOk = () => {
$scope.enable = false;
if(null ==$scope.content || $scope.content == ""){
console.log("上传的内容不能为空");
$scope.closeThisDialog();
}
else{
$scope.$emit("onOk",{
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "add",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
$scope.cancel = () => {
$scope.enable = false;
$scope.closeThisDialog();
}
}
}]);
export var sqlVerificationController = controller('sqlVerificationController', ['$scope', '$http', ($scope, $http) => {
getSqlContent();
$scope.replace = () => {
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "replace",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
function getSqlContent(){
$http({
url: "/java/console/api/filePackage/readSqlFile",
method:'POST',
params: {type: $scope.ngDialogData.type},
data: JSON.stringify($scope.ngDialogData.item)
}).success(function(data,header,config,status){
$scope.standard = data.data1;
$scope.unnormal = data.data2;
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$scope.unnormal = $scope.standard = "获取脚本内容失败";
});
}
}]);
export var sqlMoveController = controller("sqlMoveController", ['$scope', '$http', ($scope, $http) => {
getSqlContent();
$scope.move = () => {
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "replace",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
function getSqlContent(){
$http({
url: "/java/console/api/filePackage/readSqlFile",
method:'POST',
params: {type: $scope.ngDialogData.type},
data: JSON.stringify($scope.ngDialogData.item)
}).success(function(data,header,config,status){
$scope.content = data.data2;
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$scope.content = "获取脚本内容失败";
});
} }
}]); }]);
export var sysVerUpdateController = controller('sysVerUpdateController', ['$scope', ($scope) => {
}]);
} }

@ -6,10 +6,6 @@
<!--<input type="checkbox" class="fl mr5 " style="margin-top: 8px;" /> <!--<input type="checkbox" class="fl mr5 " style="margin-top: 8px;" />
<label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>--> <label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>-->
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<div class="btn pull-right sj_btn_grey ">
<a class="data_file_btn fl">脚本上传</a>
<input type="file" name="file-upload[]" id="file-uploads" onchange="angular.element(this).scope().sqlUpload(this.files);" accept="application/msexcel" multiple />
</div>
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<button class="btn pull-right sj_btn_grey " ng-click="downloadFilePackage()"> <button class="btn pull-right sj_btn_grey " ng-click="downloadFilePackage()">
<i class="glyphicon glyphicon-save"></i> 文件包导出 <i class="glyphicon glyphicon-save"></i> 文件包导出
@ -19,10 +15,9 @@
<i class="glyphicon glyphicon-export"></i> Excel导出 <i class="glyphicon glyphicon-export"></i> Excel导出
</button> </button>
<span class="pull-right">&nbsp;</span> <span class="pull-right">&nbsp;</span>
<div class="btn pull-right sj_btn_grey "> <button class="sj_btn_green fl" ng-click="upLoadExcelFile()">
<a class="data_file_btn fl">导入到服务器</a> <i class="glyphicon glyphicon-import"></i>Excel导入
<input type="file" name="file-upload[]" id="file-uploads" onchange="angular.element(this).scope().upLoadExcelFile(this.files);" accept="application/msexcel" /> </button>
</div>
</div> </div>
<div ng-show="true"> <div ng-show="true">
<div class="col-md-12"> <div class="col-md-12">

@ -22,17 +22,11 @@
<option ng-repeat="value in status">{{value.label}}</option> <option ng-repeat="value in status">{{value.label}}</option>
</select> </select>
</div> </div>
<div class="row clear fl">
<span class="pull-right">&nbsp;</span>
<button class="btn pull-right sj_btn_grey " ng-click="replaceSql()">
<i class="glyphicon glyphicon-save"></i> 文件包导出
</button>
</div>
<div class="col-md-12"> <div class="col-md-12">
<div ng-show="model.length == 0" class="alert alert-warning sj_alert-warning"> <div ng-show="model.length <= 0" class="alert alert-warning sj_alert-warning">
<span class="help-block"> <span class="help-block">
当前没有可以查看的数据,请点击Excel导入按钮导入Excel数据</span></div> 当前没有可以查看的数据,请点击Excel导入按钮导入Excel数据</span></div>
<table ng-show="model.length != 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped"> <table ng-show="model.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped">
<colgroup> <colgroup>
<col width="2%" /> <col width="2%" />
<col width="10%" /> <col width="10%" />
@ -57,29 +51,25 @@
<td title="'信息系统名称'">{{row.sysName}}</td> <td title="'信息系统名称'">{{row.sysName}}</td>
<td title="'数据库类型'">{{row.dataBaseType}}</td> <td title="'数据库类型'">{{row.dataBaseType}}</td>
<td title="'oracle用户表空间脚本'"> <td title="'oracle用户表空间脚本'">
<button ng-show="row.userTableStatus <= 3" class="btn sj_btn" ng-click="viewSql(row, 'userTableStatus')">&nbsp;&nbsp; <button ng-show="row.userTableStatus == 0" class="btn sj_btn" ng-click="addSql(row, 'userTableStatus')">&nbsp;&nbsp;上传</button>
<span ng-show="row.userTableStatus == 0 ">上传</span> <button ng-show="row.userTableStatus == 1" class="btn sj_btn" ng-click="viewSql(row, 'userTableStatus')">&nbsp;&nbsp;查看</button>
<span ng-show="row.userTableStatus == 1 ">查看</span> <button ng-show="row.userTableStatus == 2" class="btn sj_btn" ng-click="moveSql(row, 'userTableStatus')">&nbsp;&nbsp;归档</button>
<span ng-show="row.userTableStatus == 2 ">归档</span> <button ng-show="row.userTableStatus == 3" class="btn sj_btn" ng-click="verifySql(row, 'userTableStatus')">&nbsp;&nbsp;审核</button>
<span ng-show="row.userTableStatus == 3 ">审核</span>
</button>
<span ng-show="row.userTableStatus == 4 "></span> <span ng-show="row.userTableStatus == 4 "></span>
</td> </td>
<td title="'支付信息标准表脚本'"> <td title="'支付信息标准表脚本'">
<button class="btn sj_btn" ng-click="viewSql(row, 'ckPayStatus')">&nbsp;&nbsp; <button ng-show="row.ckPayStatus == 0" class="btn sj_btn" ng-click="addSql(row, 'ckPayStatus')">&nbsp;&nbsp;上传</button>
<span ng-show="row.ckPayStatus == 0 ">上传</span> <button ng-show="row.ckPayStatus == 1" class="btn sj_btn" ng-click="viewSql(row, 'ckPayStatus')">&nbsp;&nbsp;查看</button>
<span ng-show="row.ckPayStatus == 1 ">查看</span> <button ng-show="row.ckPayStatus == 2" class="btn sj_btn" ng-click="moveSql(row, 'ckPayStatus')">&nbsp;&nbsp;归档</button>
<span ng-show="row.ckPayStatus == 2 ">归档</span> <button ng-show="row.ckPayStatus == 3" class="btn sj_btn" ng-click="verifySql(row, 'ckPayStatus')">&nbsp;&nbsp;审核</button>
<span ng-show="row.ckPayStatus == 3 ">审核</span> <span ng-show="row.ckPayStatus == 4 "></span>
</button>
</td> </td>
<td title="'可执行标准表脚本'"> <td title="'可执行标准表脚本'">
<button class="btn sj_btn" ng-click="viewSql(row, 'ckIndicateStatus')">&nbsp;&nbsp; <button ng-show="row.ckIndicateStatus == 0" class="btn sj_btn" ng-click="addSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;上传</button>
<span ng-show="row.ckIndicateStatus == 0 ">上传</span> <button ng-show="row.ckIndicateStatus == 1" class="btn sj_btn" ng-click="viewSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;查看</button>
<span ng-show="row.ckIndicateStatus == 1 ">查看</span> <button ng-show="row.ckIndicateStatus == 2" class="btn sj_btn" ng-click="moveSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;归档</button>
<span ng-show="row.ckIndicateStatus == 2 ">归档</span> <button ng-show="row.ckIndicateStatus == 3" class="btn sj_btn" ng-click="verifySql(row, 'ckIndicateStatus')">&nbsp;&nbsp;审核</button>
<span ng-show="row.ckIndicateStatus == 3 ">审核</span> <span ng-show="row.ckIndicateStatus == 4 "></span>
</button>
</td> </td>
</tr> </tr>
</table> </table>

@ -13,22 +13,46 @@
</div> </div>
<div class="row clear fl"> <div class="row clear fl">
<select class="form-control" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'"> <select class="form-control" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'">
<option value="all">全部</option>
<option ng-repeat="country in countries">{{country.name}}</option> <option ng-repeat="country in countries">{{country.name}}</option>
</select> </select>
</div> </div>
<div class="row clear fl"> <div class="row clear fl">
<button class="btn pull-right sj_btn_grey " ng-click="check()"> <button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="check()">
<i class="glyphicon glyphicon-save"></i> 校验 <i class="glyphicon glyphicon-save"></i> 校验
</button> </button>
</div> </div>
<div ng-show="true">
<div class="col-md-12"> <div class="col-md-12">
<table ng-table-dynamic="tableParams with columns" class="table table-condensed table-bordered table-striped"> <table ng-show="tableData.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped">
<tr ng-repeat="row in $data" ng-class="{'danger': row.check = '否'}"> <colgroup>
<td ng-repeat="col in $columns">{{row[col.field]}}</td> <col width="2%" />
</colgroup>
<tr ng-repeat="row in $data" ng-class="{'danger': row.checkResult == '否', 'success': row.checkResult == '是'}">
<td header="'headerCheckbox.html'">
<input type="checkbox" ng-model="checkboxes.items[row.id]" />
</td>
<td title="'验证结果'">{{row.checkResult}}</td>
<td title="'采集'">{{row.collection}}</td>
<td title="'支付信息标准表'">{{row.payResultLast}}</td>
<td title="'可执行标准表'">{{row.execResultLast}}</td>
<td title="'市'">{{row.cityName}}</td>
<td title="'区/县'">{{row.districtName}}</td>
<td title="'行政区划代码'">{{row.areaCode}}</td>
<td title="'更新'">
<button ng-show="row.collUpdate == '是'" class="btn sj_btn" ng-click="update(row)">&nbsp;&nbsp;</button>
<span ng-hide="row.collUpdate == '是'"></span>
</td>
<td title="'系统名称'">{{row.sysName}}</td>
<td title="'版本号'">{{row.dataVersion}}</td>
<td title="'联系人'">{{row.departmentManager}}</td>
<td title="'联系方式'">{{row.managerContacts}}</td>
<td title="'数据库类型'">{{row.dataBaseType}}</td>
</tr> </tr>
</table> </table>
<div ng-hide="tableData.length > 0" class="col-sm-12 alert alert-warning sj_alert-warning">
<span class="help-block" >
当前没有汇总数据库可以选择,请先创建,可以点击创建汇总数据库按钮进行创建或从汇总页面中的服务器数据列表中启动已创建的汇总数据库!
</span>
</div> </div>
</div> </div>
</div> </div>

@ -2,15 +2,18 @@
/// <reference path="systemPlugin.ts"/> /// <reference path="systemPlugin.ts"/>
/// <reference path="systemHelpers.ts"/> /// <reference path="systemHelpers.ts"/>
/// <reference path="systemServices.ts"/> /// <reference path="systemServices.ts"/>
/// <reference path="../../configs/ts/configsUtils.ts"/>
/// <reference path="../../configs/ts/customAlert.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
module System{ module System{
export var SystemSQLManagement = controller('SystemSQLManagement', ['$scope', '$location', '$http', '$element', '$templateCache', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $http, $element, $templateCache, NgTableParams, ngDialog, SystemModel) => { export var SystemSQLManagement = controller('SystemSQLManagement', ['$scope', '$location', '$http', '$element', '$templateCache', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $http, $element, $templateCache, NgTableParams, ngDialog, SystemModel) => {
shareInit($scope); shareInit($scope);
$scope.cities = classifyCity(SystemModel.regionalismInfo); $scope.cities = classifyCity(SystemModel.regionalismInfo);
$scope.status = [{id: 0, label: "全部"}, {id: 1, label: "待审"}, {id: 2, label: "缺失"}, {id:3, label:"正常"}]; $scope.status = [{id: 0, label: "有缺失"}, {id: 1, label: "正常"}, {id: 2, label:"待归档"}, {id: 3, label: "待审核"}];
$scope.filterResult = $scope.model = SystemModel.sqlInfo; $scope.cityFilter = $scope.model = SystemModel.sqlInfo;
$scope.checkboxes = { $scope.checkboxes = {
checked: false, checked: false,
@ -19,34 +22,61 @@ module System{
$scope.tableParams = new NgTableParams({count: 25}, { $scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100], counts: [25, 50, 100],
dataset: $scope.filterResult dataset: $scope.model
}); });
$scope.citySelect = (x) => { $scope.citySelect = (x) => {
if(x != 'all'){ if($scope.z != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); $scope.statusFilter = [];
$scope.filterResult = [];
angular.forEach($scope.model, (item) => { angular.forEach($scope.model, (item) => {
if(x == item.cityName) if($scope.status[item.sysStatus].label == $scope.z)
$scope.filterResult.push(item); $scope.statusFilter.push(item)
}); });
$scope.tableParams.settings({ }else
dataset: $scope.filterResult $scope.statusFilter = $scope.model;
if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); //获取当前市下所有区县
$scope.cityFilter = [];
angular.forEach($scope.statusFilter, (item) => {
if(x == item.cityName)
$scope.cityFilter.push(item);
}); });
}else{ }else{
$scope.countries=[]; $scope.countries=[];
$scope.filterResult = $scope.model; $scope.y = 'all';
$scope.cityFilter = $scope.statusFilter;
}
$scope.countryFilter = $scope.cityFilter;
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: $scope.filterResult dataset: $scope.cityFilter
}); });
} }
}
$scope.countrySelect = (y) => { $scope.countrySelect = (y) => {
if(y != 'all'){ if(y != 'all'){
var result = []; $scope.countryFilter = [];
angular.forEach($scope.filterResult, (item) => { angular.forEach($scope.cityFilter, (item) => {
if(item.districtName == y) if(item.districtName == y)
$scope.countryFilter.push(item);
});
}else
$scope.countryFilter = $scope.cityFilter
$scope.tableParams.settings({
dataset: $scope.countryFilter
});
}
$scope.statusSelect = (z) => {
var tmp = [];
if($scope.x == 'all')
tmp = $scope.model;
else
tmp = $scope.countryFilter ;
var result = [];
if(z != 'all'){
angular.forEach(tmp, (item) => {
if($scope.status[item.sysStatus].label == z)
result.push(item); result.push(item);
}); });
$scope.tableParams.settings({ $scope.tableParams.settings({
@ -54,16 +84,11 @@ module System{
}); });
}else{ }else{
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: $scope.filterResult dataset: tmp
}); });
} }
} }
$scope.statusSelect = (z) => {
var result = [];
console.log(z);
}
// watch for check all checkbox // watch for check all checkbox
$scope.$watch(function() { $scope.$watch(function() {
return $scope.checkboxes.checked; return $scope.checkboxes.checked;
@ -90,17 +115,121 @@ module System{
angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0)); angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0));
}, true); }, true);
//查看
$scope.viewSql = (selected, type) => { $scope.viewSql = (selected, type) => {
ngDialog.open({ ngDialog.open({
template: 'sqlView.html', template: 'sqlView.html',
controller:'Configs.SqlViewController', controller:'Configs.SqlViewController',
width: 1005, width: 1000,
height: 700, height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
//上传
$scope.addSql = (selected, type) => {
ngDialog.open({
template: 'sqlAdd.html',
controller:'Configs.SqlAddController',
width: 600,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.verifySql = (selected, type) => {
ngDialog.open({
template: 'sqlVerification.html',
controller:'Configs.sqlVerificationController',
width: 1000,
height: 600,
scope: $scope,
closeByDocument : false,
data: {type: type, item: selected },
className: 'ngdialog-theme-default'
});
}
$scope.moveSql = (selected, type) => {
ngDialog.open({
template: 'sqlMove.html',
controller:'Configs.sqlMoveController',
width: 600,
height: 600,
scope: $scope, scope: $scope,
closeByDocument : false, closeByDocument : false,
data: {type: type, item: selected }, data: {type: type, item: selected },
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
} }
$scope.$on('onOk', (event, data) => {
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新文件,请稍等!"); //创建数据加载效果层
var target = document.getElementById('loading')
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: data.type, opt: data.opt},
data: JSON.stringify({
item: data.item,
content: data.content
})
}).success((data,header,config,status) => {
$("#load").remove();
Kubernetes.removeMask();
shareUpdate(data);
}).error((data,header,config,status) => {
});
});
$scope.$on("replace", (event, data) => {
$http({
url: "/java/console/api/filePackage/handleSqlFile",
method: "POST",
params: {type: data.type, opt: data.opt},
data: JSON.stringify({
item: data.item,
content: data.content
})
}).success((data,header,config,status) => {
shareUpdate(data);
}).error((data,header,config,status) => {
Configs.customAlert("提示", "脚本替换或归档失败!", '',null, 0, "error");
})
});
function shareUpdate (data){
$scope.filterResult = $scope.model = SystemModel.sqlInfo = data.data;
var result = [];
if($scope.x != "all"){
angular.forEach($scope.filterResult, (item) => {
if(item.cityName == $scope.x)
result.push(item);
});
$scope.filterResult = result;
result = [];
}
if($scope.y != "all"){
angular.forEach($scope.filterResult, (item) => {
if(item.districtName == $scope.y)
result.push(item);
});
$scope.filterResult = result;
result = [];
}
$scope.tableParams.settings({
dataset: $scope.filterResult
});
}
}]) }])
} }

@ -17,7 +17,7 @@ module System{
// 表头显示的信息 // 表头显示的信息
$scope.columns= [ $scope.columns= [
{ field: 'id', title: '操作', show: true}, { field: 'id', title: '操作', show: true},
{ field: "updateExcelInfo", title: "采集对象", filter: { updateExcelInfo: "select" }, filterData: booleanChoose(), show: true }, { field: "collection", title: "采集对象", filter: { collection: "select" }, filterData: booleanChoose(), show: true },
{ field: "cityName", title: "市", filter: { cityName: 'text' }, show: true }, { field: "cityName", title: "市", filter: { cityName: 'text' }, show: true },
{ field: "districtName", title: "区/县", filter: { districtName: 'text' }, show: true }, { field: "districtName", title: "区/县", filter: { districtName: 'text' }, show: true },
{ field: "areaCode", title: "行政区划代码", filter: {areaCode: 'text'}, show: true }, { field: "areaCode", title: "行政区划代码", filter: {areaCode: 'text'}, show: true },
@ -26,9 +26,9 @@ module System{
{ field: "departmentManager", title: "联系人", filter: { departmentManager: "text" }, show: true }, { field: "departmentManager", title: "联系人", filter: { departmentManager: "text" }, show: true },
{ field: "managerContacts", title: "联系方式", filter: { managerContacts: "text" }, show: true }, { field: "managerContacts", title: "联系方式", filter: { managerContacts: "text" }, show: true },
{ field: "dataBaseType", title: "数据库类型", filter: { dataBaseType: "select" }, filterData: databaseType(), show: true}, { field: "dataBaseType", title: "数据库类型", filter: { dataBaseType: "select" }, filterData: databaseType(), show: true},
{ field: "userSql", title: "oracle用户名表空间", filter: { userSql: "select" }, filterData: booleanChoose(), show: true}, { field: "userTablespaceStatus", title: "oracle用户名表空间", filter: { userTablespaceStatus: "select" }, filterData: booleanChoose(), show: true},
{ field: "checkSql", title: "支付信息标准表脚本", filter: { checkSql: "select" }, filterData: booleanChoose(), show: true}, { field: "checkoutPayStatus", title: "支付信息标准表脚本", filter: { checkoutPayStatus: "select" }, filterData: booleanChoose(), show: true},
{ field: "execSql", title: "可执行标准表脚本", filter: { execSql: "select" }, filterData: booleanChoose(), show: true}, { field: "checkoutIndicateStatus", title: "可执行标准表脚本", filter: { checkoutIndicateStatus: "select" }, filterData: booleanChoose(), show: true},
]; ];
// 点击查看按钮事件处理函数 // 点击查看按钮事件处理函数
@ -42,7 +42,6 @@ module System{
className: 'ngdialog-theme-default' className: 'ngdialog-theme-default'
}); });
} }
// 表数据 // 表数据
$scope.tableParams = new NgTableParams({count: 25}, { $scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100], counts: [25, 50, 100],
@ -50,7 +49,84 @@ module System{
}); });
// 文件上传 // 文件上传
$scope.upLoadExcelFile = (files) =>{ $scope.upLoadExcelFile = () => {
Configs.FileInputPlugin((files) =>{
var fileNameList = []; //获取文件名列表
angular.forEach(files, (file) => {
fileNameList.push(file.name);
});
Configs.create_mask();
Kubernetes.create_locadEffect("正在上传文件...");
var target = document.getElementById('loading');
var spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
var r = new Resumable({
target:'/java/console/api/fileOperation/file/upload',
chunkSize:1*1024*1024,
simultaneousUploads:4,
testChunks: false,
throttleProgressCallbacks:1,
method: "octet"
/*headers: {
"Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
}*/
});
if(!r.support){
throw "当前浏览器不支持Resumable.js文件上传";
}else{
angular.forEach(files, (file) => {
r.addFile(file);
})
r.on('fileAdded', function(file){
r.upload();
});
r.on('complete', function(){
$('#loadmsg').html("所以文件上传完毕,正在读取文件中的数据,此过程时间可能会较长,请稍等...");
$.ajax({
type: "POST",
url: UrlHelpers.join("/java/console/api/fileOperation/importExcel"),
timeout: 8000 * fileNameList.length,
dataType: 'json',
data: JSON.stringify(fileNameList),
contentType: "application/json; charset=utf-8",
complete: (XMLHttpRequest, textStatus) =>{
$("#load").remove();
Kubernetes.removeMask();
if(XMLHttpRequest.status == 200){
Configs.customAlert("提示", "操作成功: 本次excel文件录入成功", '',null, 0, "success");
}else{
Configs.customAlert("提示", "操作失败: 本次excel文件录入失败", '',null, 0, "error");
}
},
success : (data) =>{
$scope.model = SystemModel.systemInfoList = data.data;
$scope.tableParams.settings({
dataset: $scope.model
});
},
error: (MLHttpRequest, textStatus, errorThrown) =>{
//Configs.customAlert("提示", "操作失败: 本次excel文件录入失败, " + textStatus, '',null, 0, "error");
}
});
});
r.on('fileProgress', function(file){
$('#loadmsg').html("上传文件:" + file.fileName + " " + Math.floor(r.progress()*100) + '%');
//Kubernetes.create_locadEffect("上传文件:" + file.name + " " + Math.floor(r.progress()*100) + '%'); //创建数据加载效果层
});
//解决不同重复选择相同文件
var element = document.getElementById("file-uploads");
if(null != element)
element.outerHTML = element.outerHTML;
}
}, true);
}
$scope.upLoadExcelFiles = (files) =>{
var fileNameList = []; //获取文件名列表 var fileNameList = []; //获取文件名列表
angular.forEach(files, (file) => { angular.forEach(files, (file) => {
fileNameList.push(file.name); fileNameList.push(file.name);
@ -140,17 +216,13 @@ module System{
}); });
} }
$scope.sqlUpload = (files) => {
console.log(files);
}
//boolean选择条件是/否 //boolean选择条件是/否
function booleanChoose(){ function booleanChoose(){
return [{id: '是', title: '是'}, {id: '否', title: '否'}]; return [{id: '是', title: '是'}, {id: '否', title: '否'}];
} }
// 数据库类型选择条件oracle/sqlServer // 数据库类型选择条件oracle/sqlServer
function databaseType(){ function databaseType(){
return [{id: 'oracle', title: 'ORACLE'}, {id: 'sqlServer', title: 'sqlServer'}]; return [{id: 'oracle', title: 'ORACLE'}, {id: 'sqlServer', title: 'SQLSERVER'}];
} }
//level选择条件 //level选择条件

@ -27,17 +27,19 @@ module System{
public systemInfoList: Array<any> = []; public systemInfoList: Array<any> = [];
public systemInfo: Array<any> = []; public systemInfo: Array<any> = [];
public regionalismInfo: Array<any> = []; public regionalismInfo: Array<any> = [];
public sqlInfo: Array<any> = [] public sqlInfo: Array<any> = [];
//public checkInfo: Array<any> = [];
public constructor(){ public constructor(){
this.updateCodeInfo(); this.updateCodeInfo();
this.updateExcelInfo(); this.updateExcelInfo();
this.updateSqlInfo(); this.updateSqlInfo();
//this.updateCheckInfo();
//console.log(classifyCountry(this.regionalismInfo, '南京市')); //console.log(classifyCountry(this.regionalismInfo, '南京市'));
} }
public updateExcelInfo(){ public updateExcelInfo(){
var result = null; var result = [];
$.ajax({ $.ajax({
async: false, async: false,
type: "POST", type: "POST",
@ -51,7 +53,7 @@ module System{
} }
public updateSqlInfo(){ public updateSqlInfo(){
var result = null; var result = [];
$.ajax({ $.ajax({
async: false, async: false,
type: "POST", type: "POST",
@ -65,7 +67,7 @@ module System{
} }
public updateCodeInfo(){ public updateCodeInfo(){
var result=null; var result = [];
$.ajax({ $.ajax({
async: false, async: false,
type : "POST", type : "POST",
@ -76,9 +78,24 @@ module System{
} }
} }
}); });
this.regionalismInfo = result.regionalism; this.regionalismInfo = result["regionalism"];
this.systemInfo = result.system; this.systemInfo = result["system"];
} }
/*public updateCheckInfo(){
var result = null;
$.ajax({
async: false,
type : "POST",
url : "/java/console/api/checkout/findAll",
success : function(data) {
if(data){
result = data.data;
}
}
});
this.checkInfo = result;
}*/
} }
_module.factory('SystemModel', ['$rootScope', '$http', ($rootScope, $http) => { _module.factory('SystemModel', ['$rootScope', '$http', ($rootScope, $http) => {

@ -3,90 +3,52 @@
/// <reference path="systemHelpers.ts"/> /// <reference path="systemHelpers.ts"/>
/// <reference path="systemServices.ts"/> /// <reference path="systemServices.ts"/>
module System{ module System{
export var SystemVerificationController = controller('SystemVerificationController', ['$scope', '$location', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $templateCache, Upload, NgTableParams, ngDialog, SystemModel) => { export var SystemVerificationController = controller('SystemVerificationController', ['$scope', '$location', '$http', '$templateCache', 'Upload', 'NgTableParams', 'ngDialog', 'SystemModel', '$element', ($scope, $location, $http, $templateCache, Upload, NgTableParams, ngDialog, SystemModel, $element) => {
shareInit($scope); shareInit($scope);
$scope.cities = classifyCity(SystemModel.regionalismInfo); $scope.cities = classifyCity(SystemModel.regionalismInfo);
$scope.model = SystemModel;
$scope.columns = [ $scope.tableData = null;
{ field: "id", title: '序号', show: false}, $scope.checkboxes = {
{ field: "check", title: "验证结果", show: true}, checked: false,
{ field: "hasCollect", title: "采集", show: true }, items: {}
{ field: "hasCheckSql", title: "支付信息标准表", show: true }, };
{ field: "hasExecSql", title: "可执行标准表", show: true },
{ field: "city", title: "市", show: true },
{ field: "county", title: "区/县", show: true },
{ field: "regionalismCode", title: "行政区划代码", show: true },
{ field: "systemCode", title: "信息系统代码", show: true },
{ field: "contactsPerson", title: "联系人", show: true },
{ field: "contactsMethod", title: "联系方式", show: true },
{ field: "databaseType", title: "数据库类型", show: true}
];
$scope.tableData = []
$scope.tableData.push({
id: 1,
checkResult: '是',
hasCollect: '是',
hasCheckSql: '是',
hasExecSql: '是',
city: '南京市',
county: '玄武区',
regionalismCode: '320105',
systemCode: '2',
contactsPerson: '文豆豆',
contactsMethod: '15578203146',
databaseType: 'oracle'
},
{
id: 2,
checkResult: '否',
hasCollect: '是',
hasCheckSql: '否',
hasExecSql: '是',
city: '连云港市',
county: '浦口区',
regionalismCode: '320105',
systemCode: '6',
contactsPerson: '文豆豆',
contactsMethod: '15578203147',
databaseType: 'sqlServer'
});
console.log($scope.tableData);
$scope.filterResult = $scope.tableData;
// 表数据 // 表数据
$scope.tableParams = new NgTableParams({count: 25}, { $scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100], counts: [25, 50, 100],
dataset: $scope.filterResult dataset: $scope.tableData
}); });
$scope.citySelect = (x) =>{ $scope.citySelect = (x) =>{
if(x != 'all'){ if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x); $scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
$scope.filterResult = []; $http({
angular.forEach($scope.tableData, (item) => { url: "/java/console/api/checkout/findByCity",
if(item.city == x) method: "POST",
$scope.filterResult.push(item); data: x
}); }).success((data, header, config, status) => {
$scope.tableData =data.data;
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: $scope.filterResult dataset: $scope.tableData
});
}).error((data, header, config, status) => {
throw "请求失败"
}); });
}else{ }else{
$scope.countries=[]; $scope.countries=[];
$scope.filterResult = $scope.tableData; $scope.y = "all";
$scope.tableParams.settings({ $scope.tableData = null;
dataset: $scope.filterResult $scope.checkboxes = {
}); checked: false,
items: {}
};
} }
} }
$scope.countrySelect = (y) => { $scope.countrySelect = (y) => {
if(y != 'all'){ if(y != 'all'){
var result = []; var result = [];
angular.forEach($scope.filterResult, (item) => { angular.forEach($scope.tableData, (item) => {
if(item.county == y) if(item.districtName == y)
result.push(item); result.push(item);
}); });
$scope.tableParams.settings({ $scope.tableParams.settings({
@ -94,13 +56,77 @@ module System{
}); });
}else{ }else{
$scope.tableParams.settings({ $scope.tableParams.settings({
dataset: $scope.filterResult dataset: $scope.tableData
}); });
} }
} }
$scope.check = () => { $scope.check = () => {
console.log($scope.tableParams.data[0]); var filter = [];
if($scope.tableData && $scope.tableData.length > 0){
angular.forEach($scope.tableData, (item) => {
if($scope.checkboxes.items[item.id])
filter.push(item);
});
$http({
url: "/java/console/api/checkout/checkList",
method: "POST",
data: filter
}).success((data, header, config, status) => {
$scope.tableData =data.data;
$scope.tableParams.settings({
dataset: $scope.tableData
});
}).error((data, header, config, status) => {
throw "请求失败"
});
}
}
// watch for check all checkbox
$scope.$watch(function() {
return $scope.checkboxes.checked;
}, function(value) {
angular.forEach($scope.tableData, function(item) {
$scope.checkboxes.items[item.id] = value;
});
});
// watch for data checkboxes
$scope.$watch(function() {
return $scope.checkboxes.items;
}, function(values) {
$scope.checkable = false;
for(var index in values){
if(values[index] == true){
$scope.checkable = true;
break;
}
}
var checked = 0, unchecked = 0, total = -1;
if($scope.tableData && ($scope.tableData instanceof Array))
total = $scope.tableData.length;
angular.forEach($scope.tableData, function(item) {
checked += ($scope.checkboxes.items[item.id]) || 0;
unchecked += Number(!$scope.checkboxes.items[item.id]) || 0;
});
if ((unchecked == 0) || (checked == 0)) {
$scope.checkboxes.checked = (checked == total);
}
// grayed checkbox
angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0));
}, true);
$scope.update = (entity) => {
ngDialog.open({
template: 'sysVerificationUpdate.html',
controller: 'Configs.sysVerUpdateController',
width: 790,
height: 800,
closeByDocument: false,
data: entity,
className: 'ngdialog-theme-default'
});
} }
}]); }]);
} }
Loading…
Cancel
Save