--->2016.11.8

This commit is contained in:
wu ming 2016-11-08 14:40:03 +08:00
parent cd2b920264
commit 6c60260ef3
6 changed files with 285 additions and 95 deletions

View File

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

File diff suppressed because one or more lines are too long

View File

@ -115,7 +115,7 @@
<span class="fl box_chakan_leftinfo">信息系统名称:</span>
<p class="fl box_chakan_mininfo">{{ngDialogData.sysName}}</p>
<span class="fl box_chakan_leftinfo">信息系统版本:</span>
<p class="fl box_chakan_mininfo">{{ngDialogData.dataVersion}}</p>
<p class="fl box_chakan_mininfo">{{ngDialogData.sysVersion}}</p>
</li>
<li class="clear">
<span class="fl box_chakan_leftinfo">数据库类型:</span>
@ -163,14 +163,13 @@
</script>
<script type="text/ng-template" id="sqlView.html">
<div class="sj_new_box03">
<h2 class="sj_popup_h2 mb10">Checkout_sIndicate_321202_05.sql</h2>
<h2 class="sj_popup_h2 mb10">{{title}}_{{ngDialogData.item.areaCode}}_{{ngDialogData.item.sysCode}}.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>
<li><span class="fb">默认脚本:</span>{{ngDialogData.item[ngDialogData.type + 'StandardModified']}}</li>
<li class="sj_link">{{ngDialogData.item[ngDialogData.type + 'PathStandard']}}</li>
</ul>
<div class="fl sj_width440">
<input type="text" class="sj_txt_box02 mr5 fl">
<div class="fl sj_width440">
<button class="sj_btn_green fl" ng-click="upLoadSqlFile()">上传</button>
</div>
</div>
@ -194,9 +193,8 @@
</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">
<h2 class="sj_popup_h2 mb10">{{title}}_{{ngDialogData.item.areaCode}}_{{ngDialogData.item.sysCode}}.sql</h2>
<div class="clear mb10">
<button class="sj_btn_green fl" ng-click="sqlFileUpload()">上传</button>
</div>
<div class="sj_box_w440 mb10">
@ -210,11 +208,15 @@
</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>
<h2 class="sj_popup_h2 mb10">{{title}}_{{ngDialogData.item.areaCode}}_{{ngDialogData.item.sysCode}}.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>
<li><span class="fb">默认脚本:</span>{{ngDialogData.item[ngDialogData.type + 'StandardModified']}}</li>
<li class="sj_link">{{ngDialogData.item[ngDialogData.type + 'PathStandard']}}</li>
</ul>
<ul class="fl sj_width440">
<li><span class="fb">默认脚本:</span>{{ngDialogData.item[ngDialogData.type + 'LastModified']}}</li>
<li class="sj_link">{{ngDialogData.item[ngDialogData.type + 'PathLast']}}</li>
</ul>
<!--<div class="fl sj_width440">
<input type="text" class="sj_txt_box02 mr5 fl">
@ -241,11 +243,13 @@
</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> -->
<h2 class="sj_popup_h2 mb10">{{title}}_{{ngDialogData.item.areaCode}}_{{ngDialogData.item.sysCode}}.sql</h2>
<div class="clear mb10">
<ul class="fl sj_width440">
<li><span class="fb">默认脚本:</span>{{ngDialogData.item[ngDialogData.type + 'LastModified']}}</li>
<li class="sj_link">{{ngDialogData.item[ngDialogData.type + 'PathLast']}}</li>
</ul>
</div>
<div class="sj_box_w440 mb10">
<p ng-bind="content"></p>
</div>
@ -347,7 +351,7 @@
<span ng-repeat="item in data1.workRange">{{item}}</span>
</td>
<td class="sj_popup_midtxt">
<span ng-repeat="item in data2.workRange">{{item}}</span>
<span ng-repeat="item in data2.workRange">{{item}} </span>
</td>
<td class="sj_popup_righttxt">
<input type="checkbox" ng-show="data2.workRange && data2.workRange.length > 0" ng-click="click($event, 'workRange')">
@ -356,7 +360,7 @@
</tbody>
</table>
<div class=" clear">
<button class="sj_btn_blue fr" ng-click="replace()">更新</button>
<button class="btn pull-right sj_btn_blue" ng-disabled="checkboxItmes.length==0" ng-click="replace()">更新</button>
<button class="sj_btn_grey mr5 fr" ng-click="cancel()">取消</button>
</div>
</div>

View File

@ -80,7 +80,8 @@ module Configs{
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
}]);
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
$scope.title = shareInit($scope.ngDialogData);
$scope.content = "";
getSqlContent();
function getSqlContent(){
@ -111,6 +112,14 @@ module Configs{
fr.onloadend = (e) =>{
$scope.new_content = e.target["result"];
}
fr.onloadstart = () =>{
$scope.$apply(() =>{
$scope.content = "正在读取数据请稍等...";
});
$scope.content = "正在读取数据请稍等...";
}
fr.readAsText(file[0],"UTF-8");
}
});
@ -130,17 +139,7 @@ module Configs{
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.closeThisDialog();
}
}
@ -151,7 +150,8 @@ module Configs{
}]);
export var SqlAddController = controller('SqlAddController', ['$scope', '$http', ($scope, $http) => {
$scope.content = null;
$scope.content = "";
$scope.title = shareInit($scope.ngDialogData);
$scope.sqlFileUpload = () =>{
Configs.FileInputPlugin((file) =>{
$scope.enable = true;
@ -162,6 +162,14 @@ module Configs{
fr.onloadend = (e) =>{
$scope.content = e.target["result"];
}
fr.onloadstart = () =>{
$scope.$apply(() =>{
$scope.content = "正在读取数据请稍等...";
});
$scope.content = "正在读取数据请稍等...";
}
fr.readAsText(file[0],"UTF-8");
}
});
@ -182,17 +190,19 @@ module Configs{
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
}
}
$scope.cancel = () => {
$scope.enable = false;
$scope.closeThisDialog();
}
}
$scope.cancel = () => {
$scope.enable = false;
$scope.closeThisDialog();
}
}]);
export var sqlVerificationController = controller('sqlVerificationController', ['$scope', '$http', ($scope, $http) => {
getSqlContent();
$scope.title = shareInit($scope.ngDialogData);
$scope.replace = () => {
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
@ -222,7 +232,7 @@ module Configs{
export var sqlMoveController = controller("sqlMoveController", ['$scope', '$http', ($scope, $http) => {
getSqlContent();
$scope.title = shareInit($scope.ngDialogData);
$scope.move = () => {
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
@ -251,16 +261,16 @@ module Configs{
}]);
export var sysVerUpdateController = controller('sysVerUpdateController', ['$scope', '$http', ($scope, $http) => {
var checkboxItmes = [];
$scope.checkboxItmes = [];
$scope.click = ($event, name) => {
if($event.target.checked){
if(checkboxItmes.indexOf(name) == -1)
checkboxItmes.push(name)
if($scope.checkboxItmes.indexOf(name) == -1)
$scope.checkboxItmes.push(name)
}
else{
for(var i= 0; i < checkboxItmes.length; i++){
if(checkboxItmes[i] === name){
checkboxItmes.splice(i,1);
for(var i= 0; i < $scope.checkboxItmes.length; i++){
if($scope.checkboxItmes[i] === name){
$scope.checkboxItmes.splice(i,1);
break;
}
}
@ -269,24 +279,12 @@ module Configs{
getData();
$scope.replace = () => {
console.log(checkboxItmes);
$scope.replace = () => {
$scope.requestBody = $scope.data1;
angular.forEach(checkboxItmes, (item) => {
angular.forEach($scope.checkboxItmes, (item) => {
$scope.requestBody[item] = $scope.data2[item];
});
$http({
url: "/java/console/api/checkout/update",
method:'POST',
data: JSON.stringify($scope.requestBody)
}).success(function(data,header,config,status){
if(header == 200)
Configs.customAlert("提示", "操作成功!", '',null, 0, "success");
else
Configs.customAlert("提示", "操作失败!", '',null, 0, "error");
}).error(function(data,header,config,status){
Configs.customAlert("提示", "操作失败:发生请求失败,不能删除!", '',null, 0, "error");
});
$scope.$emit("updateRow", $scope.requestBody);
$scope.closeThisDialog();
}
@ -309,4 +307,23 @@ module Configs{
});
}
}]);
function shareInit(ngDialogData) {
var title = "";
if(ngDialogData.type != 'undefined'){
switch (ngDialogData.type) {
case "userTableStatus" :
title = "UserTablespace";
break;
case "ckPayStatus":
title = "Chechout_Pay"
break;
case "ckIndicateStatus":
title = "Chechout_Indicate"
break;
}
}
return title;
}
}

View File

@ -7,13 +7,13 @@
</div>
<div class="row clear fl">
<select class="form-control" ng-change="citySelect(x)" ng-model="x" ng-init="x='all'">
<option value="all">全部</option>
<option value="all">请选择市级</option>
<option ng-repeat="city in cities">{{city}}</option>
</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>
<option value="all">请选择区/县</option>
<option ng-repeat="country in countries">{{country.name}}</option>
</select>
</div>
@ -22,6 +22,11 @@
<i class="glyphicon glyphicon-save"></i> 校验
</button>
</div>
<div class="row clear fl">
<button class="btn pull-right sj_btn_grey " ng-disabled="!checkable" ng-click="deleteRows()">
<i class="glyphicon glyphicon-save"></i> 删除
</button>
</div>
<div class="col-md-12">
<table ng-show="tableData.length > 0" ng-table="tableParams" class="table table-condensed table-bordered table-striped">
<colgroup>
@ -51,7 +56,7 @@
</table>
<div ng-hide="tableData.length > 0" class="col-sm-12 alert alert-warning sj_alert-warning">
<span class="help-block" >
当前没有汇总数据库可以选择,请先创建,可以点击创建汇总数据库按钮进行创建或从汇总页面中的服务器数据列表中启动已创建的汇总数据库
当前没有选择需要校验的数据,请选择需要校验的数据
</span>
</div>
</div>

View File

@ -2,6 +2,8 @@
/// <reference path="systemPlugin.ts"/>
/// <reference path="systemHelpers.ts"/>
/// <reference path="systemServices.ts"/>
/// <reference path="../../configs/ts/configsUtils.ts"/>
module System{
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);
@ -61,6 +63,38 @@ module System{
}
}
$scope.deleteRows = () =>{
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/deleteList",
method: "POST",
data: filter
}).success((data, header, config, status) => {
$scope.tableData = data.data;
var result = [];
if($scope.y != 'all'){
angular.forEach($scope.tableData, (item) =>{
if(item.districtName == $scope.y)
result.push(item);
});
}else{
result = $scope.tableData;
}
$scope.tableParams.settings({
dataset: result
});
}).error((data, header, config, status) => {
throw "请求失败"
});
}
}
$scope.check = () => {
var filter = [];
if($scope.tableData && $scope.tableData.length > 0){
@ -73,9 +107,19 @@ module System{
method: "POST",
data: filter
}).success((data, header, config, status) => {
$scope.tableData =data.data;
$scope.tableData = data.data;
var result = [];
if($scope.y != 'all'){
angular.forEach($scope.tableData, (item) =>{
if(item.districtName == $scope.y)
result.push(item);
});
}else{
result = $scope.tableData;
}
$scope.tableParams.settings({
dataset: $scope.tableData
dataset: result
});
}).error((data, header, config, status) => {
throw "请求失败"
@ -125,8 +169,36 @@ module System{
height: 600,
closeByDocument: false,
data: entity,
scope: $scope,
className: 'ngdialog-theme-default'
});
}
}
$scope.$on('updateRow', (event, data) => {
$http({
url: "/java/console/api/checkout/update",
method:'POST',
data: JSON.stringify(data)
}).success(function(data,header,config,status){
if(header == 200){
Configs.customAlert("提示", "操作成功!", '',null, 0, "success");
var result = [];
if($scope.y != 'all'){
angular.forEach(data.data, (item) => {
if($scope.y == item.districtName)
result.push(item);
})
}else
result = data.data;
$scope.tableParams.settings({
dataset: result
});
}
else
Configs.customAlert("提示", "操作失败!", '',null, 0, "error");
}).error(function(data,header,config,status){
Configs.customAlert("提示", "操作失败:发生请求失败,不能删除!", '',null, 0, "error");
});
});
}]);
}