-
-
-
- {{row[col.field]}} |
-
-
+
+
+
+
+ 当前没有汇总数据库可以选择,请先创建,可以点击创建汇总数据库按钮进行创建或从汇总页面中的服务器数据列表中启动已创建的汇总数据库!
+
diff --git a/plugins/system/ts/sqlManagement.ts b/plugins/system/ts/sqlManagement.ts
index df7c66b0..fa22c480 100644
--- a/plugins/system/ts/sqlManagement.ts
+++ b/plugins/system/ts/sqlManagement.ts
@@ -2,83 +2,108 @@
///
///
///
+///
+///
+///
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
+ });
+ }
}])
}
\ No newline at end of file
diff --git a/plugins/system/ts/systemList.ts b/plugins/system/ts/systemList.ts
index 84e6243c..ddff4a3c 100644
--- a/plugins/system/ts/systemList.ts
+++ b/plugins/system/ts/systemList.ts
@@ -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选择条件
diff --git a/plugins/system/ts/systemServices.ts b/plugins/system/ts/systemServices.ts
index d4714c51..0ce3c745 100644
--- a/plugins/system/ts/systemServices.ts
+++ b/plugins/system/ts/systemServices.ts
@@ -27,17 +27,19 @@ module System{
public systemInfoList: Array
= [];
public systemInfo: Array = [];
public regionalismInfo: Array = [];
- public sqlInfo: Array = []
+ public sqlInfo: Array = [];
+ //public checkInfo: Array = [];
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) => {
diff --git a/plugins/system/ts/systemVerification.ts b/plugins/system/ts/systemVerification.ts
index e26406c1..86c7116b 100644
--- a/plugins/system/ts/systemVerification.ts
+++ b/plugins/system/ts/systemVerification.ts
@@ -3,104 +3,130 @@
///
///
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'
+ });
+ }
}]);
}
\ No newline at end of file