--信息系统验证功能

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

@ -1,4 +1,5 @@
/// <reference path="../../includes.d.ts" />
/// <reference path="customAlert.d.ts" />
declare module Configs {
function removeElementByValue(array: Array<any>, value: any, key?: string): void;
function removeElementsByValue(array: Array<any>, elements: Array<any>): void;
@ -7,4 +8,5 @@ declare module Configs {
*/
function deepCopy(object: any): any;
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="configPlugin.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 {
var TableEdit: ng.IModule;
var VolumeController: ng.IModule;
var SystemInfoController: 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="systemHelpers.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 {
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*/
.mt2{margin-top: 3px;}
.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;}
.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;}
@ -174,9 +174,9 @@ treecontrol li:hover{}
.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; }
/*查看弹框 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_box03{ width:890px; margin:0 auto; padding:20px; }
.sj_new_box03{ width:880px; margin:0 auto; }
.sj_width440{width: 440px;}
.fb{ font-weight: bold;}
.mr60{ margin-right: 60px;}

@ -149,11 +149,8 @@
</li>
<li class="clear">
<span class="fl box_chakan_leftinfo">脚本文件:</span>
<p class="fl box_chakan_maxinfo">
192.168.0.110 /home/script/
<br/> UserTablespace_321202_05.sql
<br/> Checkout_Indicate_321202_05.sql
<br/> Checkout_Pay_321202_05.sql
<p class="fl box_chakan_maxinfo">
<span ng-repeat="sql in ngDialogData.sqlList">{{sql}} <br /></span>
<br/>
</p>
</li>
@ -162,11 +159,11 @@
</div>
</script>
<script type="text/ng-template" id="headerCheckbox.html">
<input type="checkbox" ng-model="checkboxes.checked" class="select-all" value="" />
<input type="checkbox" ng-model="checkboxes.checked" class="select-all" value=" " />
</script>
<script type="text/ng-template" id="sqlView.html">
<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">
<ul class="fl sj_width440">
<li><span class="fb">默认脚本:</span>2016-01-25 12:00</li>
@ -174,23 +171,96 @@
</ul>
<div class="fl sj_width440">
<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 class="clear mb10">
<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">
<div class=" sj_box_w440 fl ml15">
<p ng-bind="new_content">
</p>
</div>
</div>
<div class=" clear">
<button class="sj_btn_blue mr5 fr">确定</button>
<button class="sj_btn_grey mr5 fr">取消</button>
<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">
<p ng-bind="standard">
</p>
</div>
<div class=" sj_box_w440 fl ml15">
<p ng-bind="unnormal">
</p>
</div>
</div>
<div class=" clear">
<button class="btn pull-right sj_btn_blue " ng-click="replace()">
替换
</button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button>
</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 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>
<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="row kubernetes-view" ng-view></div>

@ -1,5 +1,5 @@
/// <reference path="../../includes.ts"/>
/// <reference path="customAlert.ts"/>
module Configs{
export function removeElementByValue(array:Array<any> ,value:any, key?:string ){
if(key){
@ -148,4 +148,21 @@ module Configs{
$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);
}
}
}

@ -74,8 +74,8 @@ module Configs{
beforeSend: () => {
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新云盘信息,请稍等!"); //创建数据加载效果层
var target = document.getElementById('loading')
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
var target = document.getElementById('loading')
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
},
complete: (XMLHttpRequest, textStatus) => {
if(XMLHttpRequest.status == 200){
@ -141,8 +141,8 @@ module Configs{
beforeSend: () => {
Configs.create_mask(); //创建遮罩层
Kubernetes.create_locadEffect("正在更新云盘信息,请稍等!"); //创建数据加载效果层
var target = document.getElementById('loading')
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
var target = document.getElementById('loading')
spinner = new Spinner(Kubernetes.loadConfigs()).spin(target);
},
complete: (XMLHttpRequest, textStatus) => {
if(XMLHttpRequest.status == 200){

@ -1,6 +1,10 @@
/// <reference path="../../includes.ts"/>
/// <reference path="configPlugin.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{
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
$scope.editRow = (entity)=>{
@ -73,9 +77,7 @@ module Configs{
}
}]);
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
var model = $scope.ngDialogData;
//处理年月
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
}]);
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
@ -88,23 +90,168 @@ module Configs{
params: {type: $scope.ngDialogData.type},
data: JSON.stringify($scope.ngDialogData.item)
}).success(function(data,header,config,status){
$scope.old_content = data.data1;
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$scope.old_content = "获取脚本内容失败"
});
}
$scope.sqlUpload = (file) => {
$scope.upLoadSqlFile = () => {
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{
var fr = new FileReader();
fr.onloadend = (e) => {
console.log(e.target.result);
$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();
fr.onloadend = (e) =>{
$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;" />
<label class="fl mr5 " style="margin-top: 5px; font-style:nomal;">全选</label>-->
<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>
<button class="btn pull-right sj_btn_grey " ng-click="downloadFilePackage()">
<i class="glyphicon glyphicon-save"></i> 文件包导出
@ -18,11 +14,10 @@
<button class="btn pull-right sj_btn_grey " ng-click="downLoadExcelFile()">
<i class="glyphicon glyphicon-export"></i> Excel导出
</button>
<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().upLoadExcelFile(this.files);" accept="application/msexcel" />
</div>
<span class="pull-right">&nbsp;</span>
<button class="sj_btn_green fl" ng-click="upLoadExcelFile()">
<i class="glyphicon glyphicon-import"></i>Excel导入
</button>
</div>
<div ng-show="true">
<div class="col-md-12">

@ -8,8 +8,8 @@
<select class="form-control" ng-change="citySelect(x)" ng-model="x" ng-init="x='all'">
<option value="all">全部</option>
<option ng-repeat="city in cities">{{city}}</option>
</select>
</div>
</select>
</div>
<div class="row clear fl">
<select class="form-control" ng-change="countrySelect(y)" ng-model="y" ng-init="y='all'">
<option value="all">全部</option>
@ -17,22 +17,16 @@
</select>
</div>
<div class="row clear fl">
<select class="form-control" ng-change="statusSelect(z)" ng-model="z" ng-init="z='all'">
<option value="all">全部</option>
<select class="form-control" ng-change="statusSelect(z)" ng-model="z" ng-init="z='all'">
<option value="all">全部</option>
<option ng-repeat="value in status">{{value.label}}</option>
</select>
</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 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">
当前没有可以查看的数据,请点击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>
<col width="2%" />
<col width="10%" />
@ -57,29 +51,25 @@
<td title="'信息系统名称'">{{row.sysName}}</td>
<td title="'数据库类型'">{{row.dataBaseType}}</td>
<td title="'oracle用户表空间脚本'">
<button ng-show="row.userTableStatus <= 3" class="btn sj_btn" ng-click="viewSql(row, 'userTableStatus')">&nbsp;&nbsp;
<span ng-show="row.userTableStatus == 0 ">上传</span>
<span ng-show="row.userTableStatus == 1 ">查看</span>
<span ng-show="row.userTableStatus == 2 ">归档</span>
<span ng-show="row.userTableStatus == 3 ">审核</span>
</button>
<button ng-show="row.userTableStatus == 0" class="btn sj_btn" ng-click="addSql(row, 'userTableStatus')">&nbsp;&nbsp;上传</button>
<button ng-show="row.userTableStatus == 1" class="btn sj_btn" ng-click="viewSql(row, 'userTableStatus')">&nbsp;&nbsp;查看</button>
<button ng-show="row.userTableStatus == 2" class="btn sj_btn" ng-click="moveSql(row, 'userTableStatus')">&nbsp;&nbsp;归档</button>
<button ng-show="row.userTableStatus == 3" class="btn sj_btn" ng-click="verifySql(row, 'userTableStatus')">&nbsp;&nbsp;审核</button>
<span ng-show="row.userTableStatus == 4 "></span>
</td>
<td title="'支付信息标准表脚本'">
<button class="btn sj_btn" ng-click="viewSql(row, 'ckPayStatus')">&nbsp;&nbsp;
<span ng-show="row.ckPayStatus == 0 ">上传</span>
<span ng-show="row.ckPayStatus == 1 ">查看</span>
<span ng-show="row.ckPayStatus == 2 ">归档</span>
<span ng-show="row.ckPayStatus == 3 ">审核</span>
</button>
<button ng-show="row.ckPayStatus == 0" class="btn sj_btn" ng-click="addSql(row, 'ckPayStatus')">&nbsp;&nbsp;上传</button>
<button ng-show="row.ckPayStatus == 1" class="btn sj_btn" ng-click="viewSql(row, 'ckPayStatus')">&nbsp;&nbsp;查看</button>
<button ng-show="row.ckPayStatus == 2" class="btn sj_btn" ng-click="moveSql(row, 'ckPayStatus')">&nbsp;&nbsp;归档</button>
<button ng-show="row.ckPayStatus == 3" class="btn sj_btn" ng-click="verifySql(row, 'ckPayStatus')">&nbsp;&nbsp;审核</button>
<span ng-show="row.ckPayStatus == 4 "></span>
</td>
<td title="'可执行标准表脚本'">
<button class="btn sj_btn" ng-click="viewSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;
<span ng-show="row.ckIndicateStatus == 0 ">上传</span>
<span ng-show="row.ckIndicateStatus == 1 ">查看</span>
<span ng-show="row.ckIndicateStatus == 2 ">归档</span>
<span ng-show="row.ckIndicateStatus == 3 ">审核</span>
</button>
<button ng-show="row.ckIndicateStatus == 0" class="btn sj_btn" ng-click="addSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;上传</button>
<button ng-show="row.ckIndicateStatus == 1" class="btn sj_btn" ng-click="viewSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;查看</button>
<button ng-show="row.ckIndicateStatus == 2" class="btn sj_btn" ng-click="moveSql(row, 'ckIndicateStatus')">&nbsp;&nbsp;归档</button>
<button ng-show="row.ckIndicateStatus == 3" class="btn sj_btn" ng-click="verifySql(row, 'ckIndicateStatus')">&nbsp;&nbsp;审核</button>
<span ng-show="row.ckIndicateStatus == 4 "></span>
</td>
</tr>
</table>

@ -13,22 +13,46 @@
</div>
<div class="row clear fl">
<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>
</select>
</div>
<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> 校验
</button>
</div>
<div ng-show="true">
<div class="col-md-12">
<table ng-table-dynamic="tableParams with columns" class="table table-condensed table-bordered table-striped">
<tr ng-repeat="row in $data" ng-class="{'danger': row.check = '否'}">
<td ng-repeat="col in $columns">{{row[col.field]}}</td>
</tr>
</table>
<div class="col-md-12">
<table ng-show="tableData.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped">
<colgroup>
<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>
</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>

@ -2,83 +2,108 @@
/// <reference path="systemPlugin.ts"/>
/// <reference path="systemHelpers.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{
export var SystemSQLManagement = controller('SystemSQLManagement', ['$scope', '$location', '$http', '$element', '$templateCache', 'NgTableParams', 'ngDialog', 'SystemModel', ($scope, $location, $http, $element, $templateCache, NgTableParams, ngDialog, SystemModel) => {
shareInit($scope);
$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 = {
checked: false,
items: {}
};
$scope.checkboxes = {
checked: false,
items: {}
};
$scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100],
dataset: $scope.filterResult
});
$scope.citySelect = (x) =>{
if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
$scope.filterResult = [];
angular.forEach($scope.model, (item) => {
if(x == item.cityName)
$scope.filterResult.push(item);
});
$scope.tableParams.settings({
dataset: $scope.filterResult
});
}else{
$scope.countries=[];
$scope.filterResult = $scope.model;
$scope.tableParams.settings({
dataset: $scope.filterResult
});
}
}
$scope.countrySelect = (y) => {
if(y != 'all'){
var result = [];
angular.forEach($scope.filterResult, (item) => {
if(item.districtName == y)
result.push(item);
});
$scope.tableParams.settings({
dataset: result
});
}else{
$scope.tableParams.settings({
dataset: $scope.filterResult
});
}
}
$scope.statusSelect = (z) => {
var result = [];
console.log(z);
}
counts: [25, 50, 100],
dataset: $scope.model
});
$scope.citySelect = (x) => {
if($scope.z != 'all'){
$scope.statusFilter = [];
angular.forEach($scope.model, (item) => {
if($scope.status[item.sysStatus].label == $scope.z)
$scope.statusFilter.push(item)
});
}else
$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{
$scope.countries=[];
$scope.y = 'all';
$scope.cityFilter = $scope.statusFilter;
}
$scope.countryFilter = $scope.cityFilter;
$scope.tableParams.settings({
dataset: $scope.cityFilter
});
}
$scope.countrySelect = (y) => {
if(y != 'all'){
$scope.countryFilter = [];
angular.forEach($scope.cityFilter, (item) => {
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);
});
$scope.tableParams.settings({
dataset: result
});
}else{
$scope.tableParams.settings({
dataset: tmp
});
}
}
// watch for check all checkbox
$scope.$watch(function() {
return $scope.checkboxes.checked;
}, function(value) {
angular.forEach($scope.model, function(item) {
$scope.checkboxes.items[item.id] = value;
});
});
$scope.$watch(function() {
return $scope.checkboxes.checked;
}, function(value) {
angular.forEach($scope.model, function(item) {
$scope.checkboxes.items[item.id] = value;
});
});
// watch for data checkboxes
$scope.$watch(function() {
return $scope.checkboxes.items;
}, function(values) {
}, function(values) {
var checked = 0, unchecked = 0,
total = $scope.model.length;
total = $scope.model.length;
angular.forEach($scope.model, function(item) {
checked += ($scope.checkboxes.items[item.id]) || 0;
unchecked += Number((!$scope.checkboxes.items[item.id])) || 0;
@ -90,17 +115,121 @@ module System{
angular.element($element[0].getElementsByClassName("select-all")).prop("indeterminate", (checked != 0 && unchecked != 0));
}, true);
//查看
$scope.viewSql = (selected, type) => {
ngDialog.open({
template: 'sqlView.html',
controller:'Configs.SqlViewController',
width: 1005,
height: 700,
width: 1000,
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,
closeByDocument : false,
data: {type: type, item: selected },
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= [
{ 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: "districtName", title: "区/县", filter: { districtName: '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: "managerContacts", title: "联系方式", filter: { managerContacts: "text" }, show: true },
{ field: "dataBaseType", title: "数据库类型", filter: { dataBaseType: "select" }, filterData: databaseType(), show: true},
{ field: "userSql", title: "oracle用户名表空间", filter: { userSql: "select" }, filterData: booleanChoose(), show: true},
{ field: "checkSql", title: "支付信息标准表脚本", filter: { checkSql: "select" }, filterData: booleanChoose(), show: true},
{ field: "execSql", title: "可执行标准表脚本", filter: { execSql: "select" }, filterData: booleanChoose(), show: true},
{ field: "userTablespaceStatus", title: "oracle用户名表空间", filter: { userTablespaceStatus: "select" }, filterData: booleanChoose(), show: true},
{ field: "checkoutPayStatus", title: "支付信息标准表脚本", filter: { checkoutPayStatus: "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'
});
}
// 表数据
$scope.tableParams = new NgTableParams({count: 25}, {
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 = []; //获取文件名列表
angular.forEach(files, (file) => {
fileNameList.push(file.name);
@ -140,17 +216,13 @@ module System{
});
}
$scope.sqlUpload = (files) => {
console.log(files);
}
//boolean选择条件是/否
function booleanChoose(){
return [{id: '是', title: '是'}, {id: '否', title: '否'}];
}
// 数据库类型选择条件oracle/sqlServer
function databaseType(){
return [{id: 'oracle', title: 'ORACLE'}, {id: 'sqlServer', title: 'sqlServer'}];
return [{id: 'oracle', title: 'ORACLE'}, {id: 'sqlServer', title: 'SQLSERVER'}];
}
//level选择条件

@ -27,17 +27,19 @@ module System{
public systemInfoList: Array<any> = [];
public systemInfo: Array<any> = [];
public regionalismInfo: Array<any> = [];
public sqlInfo: Array<any> = []
public sqlInfo: Array<any> = [];
//public checkInfo: Array<any> = [];
public constructor(){
this.updateCodeInfo();
this.updateExcelInfo();
this.updateSqlInfo();
//this.updateCheckInfo();
//console.log(classifyCountry(this.regionalismInfo, '南京市'));
}
public updateExcelInfo(){
var result = null;
var result = [];
$.ajax({
async: false,
type: "POST",
@ -51,7 +53,7 @@ module System{
}
public updateSqlInfo(){
var result = null;
var result = [];
$.ajax({
async: false,
type: "POST",
@ -61,11 +63,11 @@ module System{
result = data.data;
}
});
this.sqlInfo = result;
this.sqlInfo = result;
}
public updateCodeInfo(){
var result=null;
var result = [];
$.ajax({
async: false,
type : "POST",
@ -76,9 +78,24 @@ module System{
}
}
});
this.regionalismInfo = result.regionalism;
this.systemInfo = result.system;
this.regionalismInfo = result["regionalism"];
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) => {

@ -3,104 +3,130 @@
/// <reference path="systemHelpers.ts"/>
/// <reference path="systemServices.ts"/>
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);
$scope.cities = classifyCity(SystemModel.regionalismInfo);
$scope.columns = [
{ field: "id", title: '序号', show: false},
{ field: "check", title: "验证结果", show: true},
{ field: "hasCollect", title: "采集", show: true },
{ 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.model = SystemModel;
$scope.tableData = null;
$scope.checkboxes = {
checked: false,
items: {}
};
// 表数据
$scope.tableParams = new NgTableParams({count: 25}, {
counts: [25, 50, 100],
dataset: $scope.filterResult
counts: [25, 50, 100],
dataset: $scope.tableData
});
$scope.citySelect = (x) =>{
if(x != 'all'){
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
$scope.filterResult = [];
angular.forEach($scope.tableData, (item) => {
if(item.city == x)
$scope.filterResult.push(item);
});
$scope.tableParams.settings({
dataset: $scope.filterResult
});
$scope.countries = classifyCountry(SystemModel.regionalismInfo, x);
$http({
url: "/java/console/api/checkout/findByCity",
method: "POST",
data: x
}).success((data, header, config, status) => {
$scope.tableData =data.data;
$scope.tableParams.settings({
dataset: $scope.tableData
});
}).error((data, header, config, status) => {
throw "请求失败"
});
}else{
$scope.countries=[];
$scope.filterResult = $scope.tableData;
$scope.tableParams.settings({
dataset: $scope.filterResult
});
$scope.countries=[];
$scope.y = "all";
$scope.tableData = null;
$scope.checkboxes = {
checked: false,
items: {}
};
}
}
$scope.countrySelect = (y) => {
if(y != 'all'){
var result = [];
angular.forEach($scope.filterResult, (item) => {
if(item.county == y)
angular.forEach($scope.tableData, (item) => {
if(item.districtName == y)
result.push(item);
});
$scope.tableParams.settings({
dataset: result
});
}else{
}else{
$scope.tableParams.settings({
dataset: $scope.filterResult
dataset: $scope.tableData
});
}
}
$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