v3.0。beta版本,完成了数据导出前端,数据尚未绑定,导出功能不可用

This commit is contained in:
lili 2018-04-02 09:07:39 +08:00
parent 4218595a3a
commit 3ac9da8ad2
12 changed files with 1563 additions and 1303 deletions

View File

@ -9,6 +9,7 @@ declare module Configs {
static UPDATE: string;
static PUT: string;
static MOVE: string;
static CREATE_DATABASE: string;
static EXTRACT: string;
}
function createOracleInfo(array: Array<any>, id: number): {

2
defs.d.ts vendored
View File

@ -77,7 +77,6 @@
/// <reference path="d.ts/kubernetes/ts/sharedControllers.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/tabs.d.ts"/>
/// <reference path="d.ts/kubernetes/ts/templates.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>
/// <reference path="d.ts/system/ts/systemHelpers.d.ts"/>
/// <reference path="d.ts/system/ts/systemPlugin.d.ts"/>
/// <reference path="d.ts/system/ts/regionalismCodeSearch.d.ts"/>
@ -86,3 +85,4 @@
/// <reference path="d.ts/system/ts/systemCodeSearch.d.ts"/>
/// <reference path="d.ts/system/ts/systemList.d.ts"/>
/// <reference path="d.ts/system/ts/systemVerification.d.ts"/>
/// <reference path="d.ts/navigation/ts/navigationPlugin.d.ts"/>

File diff suppressed because one or more lines are too long

View File

@ -5,52 +5,53 @@
<div class="row">
<div hawtio-tabs></div>
</div>
<div class="container-content ">
<div class="container-fluid sj_fluid">
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
<p class="alert alert-info">当前没有配置汇总库信息,请配置,否则汇总操作将不可用!</p>
</div>
<div class="row mb10" ng-show="model.oracleParam.length">
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
</div>
<div class="row">
<div>
<button class="btn sj_btn_green mb10" style="color:#fff;" ng-click="create()">
<span class="glyphicon glyphicon-plus"></span> 添加
</button>
<div class="container-content ">
<div class="container-fluid sj_fluid">
<div class="row align-center mb10" ng-hide="model.oracleParam.length">
<p class="alert alert-info">当前没有配置汇总库信息,请配置,否则汇总操作将不可用!</p>
</div>
</div>
<hr>
<div class="row " style="padding-top:10px;" ng-show="tableForm && (edit || add)">
<h3 class="mb10" ng-show="edit">编辑汇总库连接信息:</h3>
<h3 class="mb10" ng-show="add">添加汇总库信息:</h3>
<div class="col-md-6 col-md-offset-1 ">
<form class="form-horizontal" novalidate="novalidate" name="validForm" ng-submit="onSubmit(tableForm)">
<div class="form-group">
<label class="col-sm-2 control-label">名称</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control " type="text" ng-model="tableForm.name" name="orcName" ng-minlength="2" ng-maxlength="20" required="required" ng-focus="tableForm.name" placeholder="请输入2-20个字符的数据名称"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcName.$invalid && submitted">
<span role="alert" ng-show="validForm.orcName.$error.required">名称不能为空</span>
<span role="alert" ng-show="!validForm.orcName.$error.required && validForm.orcName.$invalid">请输入2-20个字符的数据名称</span>
<div class="row mb10" ng-show="model.oracleParam.length">
<table class="table table-bordered table-striped sj_content_table" hawtio-simple-table="tableConfig" />
</div>
<div class="row">
<div>
<button class="btn sj_btn_green mb10" style="color:#fff;" ng-click="create()">
<span class="glyphicon glyphicon-plus"></span> 添加
</button>
<button class="btn sj_btn_green mb10" style="color:#fff;" ng-click="createGatherDababase()">
<span class="glyphicon glyphicon-plus"></span> 创建汇总库
</button>
</div>
</div>
<hr>
<div class="row " style="padding-top:10px;" ng-show="tableForm && (edit || add)">
<h3 class="mb10" ng-show="edit">编辑汇总库连接信息:</h3>
<h3 class="mb10" ng-show="add">添加汇总库信息:</h3>
<div class="col-md-6 col-md-offset-1 ">
<form class="form-horizontal" novalidate="novalidate" name="validForm" ng-submit="onSubmit(tableForm)">
<div class="form-group">
<label class="col-sm-3 control-label">名称</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control " type="text" ng-model="tableForm.name" name="orcName" ng-minlength="2" ng-maxlength="20" required="required" ng-focus="tableForm.name" placeholder="请输入2-20个字符的数据名称" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcName.$invalid && submitted">
<span role="alert" ng-show="validForm.orcName.$error.required">名称不能为空</span>
<span role="alert" ng-show="!validForm.orcName.$error.required && validForm.orcName.$invalid">请输入2-20个字符的数据名称</span>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">是否创建汇总库</label>
<div class="col-sm-10 sj_form_input ">
<select class="form-control " ng-model="tableForm.isCreateGatherOracle">
<option value=1 ng-selected="tableForm.isCreateGatherOracle==1" selected></option>
<option value=0 ng-selected="tableForm.isCreateGatherOracle==0" ></option>
</select>
</div>
</div>
<div ng-switch = "tableForm.isCreateGatherOracle">
<div ng-switch-when = "0">
<!-- <div class="form-group" ng-show="add">
<label class="col-sm-3 control-label">是否创建汇总库</label>
<div class="col-sm-9 sj_form_input ">
<select class="form-control " ng-model="tableForm.isCreateGatherOracle">
<option value=1 ng-selected="tableForm.isCreateGatherOracle==1"></option>
<option value=0 ng-selected="tableForm.isCreateGatherOracle==0" selected></option>
</select>
</div>
</div> -->
<div class="form-group">
<label class="col-sm-2 control-label">IP</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.ip" name="orcIP" ng-pattern="/((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))/" required="required" ng-focus="tableForm.ip" placeholder="oracle的IP,例如0.0.0.0"/>
<label class="col-sm-3 control-label">IP</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.ip" name="orcIP" ng-pattern="/((?:(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d)))\.){3}(?:25[0-5]|2[0-4]\d|((1\d{2})|([1-9]?\d))))/" required="required" ng-focus="tableForm.ip" placeholder="oracle的IP,例如0.0.0.0" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcIP.$invalid && submitted">
<span role="alert" ng-show="validForm.orcIP.$error.required">IP不能为空</span>
<span role="alert" ng-show="validForm.orcIP.$error.pattern">请输入正确的IP地址</span>
@ -58,168 +59,264 @@
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">端口号</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.port" name="orcPort" ng-pattern="/^([1-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/" required="required" ng-focus="tableForm.port" placeholder="oracle的的端口,1~65535"/>
<label class="col-sm-3 control-label">端口号</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.port" name="orcPort" ng-pattern="/^([1-9]|[1-9]\d|[1-9]\d{2}|[1-9]\d{3}|[1-5]\d{4}|6[0-4]\d{3}|65[0-4]\d{2}|655[0-2]\d|6553[0-5])$/" required="required" ng-focus="tableForm.port" placeholder="oracle的的端口,1~65535" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPort.$invalid && submitted">
<span role="alert" ng-show="validForm.orcPort.$error.required">端口号不能为空</span>
<span role="alert" ng-show="validForm.orcPort.$error.pattern">端口号必须为1~65535的数字</span>
</div>
</div>
</div>
</div>
</div>
<div ng-switch = "tableForm.isCreateGatherOracle">
<div ng-switch-when = "1">
<div class="form-group ">
<label class="col-sm-2 control-label">开始时间</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.startTime" name="orcStartTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.startTime" placeholder="开始时间,格式为yyyy-MM 例如2018-02"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcStartTime.$invalid && submitted">
<span role="alert" ng-show="validForm.orcStartTime.$error.required">开始时间不能为空</span>
<span role="alert" ng-show="validForm.orcStartTime.$error.pattern">格式为yyyy-MM 例如2018-02</span>
<!-- <div ng-switch="tableForm.isCreateGatherOracle">
<div ng-switch-when="1">
<div class="form-group ">
<label class="col-sm-3 control-label">开始时间</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.startTime" name="startTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.startTime" placeholder="开始时间,格式为yyyy-MM 例如2018-02" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.startTime.$invalid && submitted">
<span role="alert" ng-show="validForm.startTime.$error.required">开始时间不能为空</span>
<span role="alert" ng-show="validForm.startTime.$error.pattern">格式为yyyy-MM 例如2018-02</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束时间</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.endTime" name="orcEndTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.endTime" placeholder="结束时间,格式为yyyy-MM 例如2018-02" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcEndTime.$invalid && submitted">
<span role="alert" ng-show="validForm.orcEndTime.$error.required">结束时间不能为空</span>
<span role="alert" ng-show="validForm.orcEndTime.$error.pattern">格式为yyyy-MM 例如2018-02</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.contact" name="contact" ng-pattern="" required="required" ng-focus="tableForm.contact" placeholder="联系人" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.contact.$invalid && submitted">
<span role="alert" ng-show="validForm.contact.$error.required">联系人不能为空</span>
<span role="alert" ng-show="validForm.contact.$error.pattern">联系人为有效联系人</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系方式</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.phone" name="phone" ng-pattern="/^[1][3,4,5,7,8][0-9]{9}$/" required="required" ng-focus="tableForm.phone" placeholder="联系方式" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.phone.$invalid && submitted">
<span role="alert" ng-show="validForm.phone.$error.required">联系方式不能为空</span>
<span role="alert" ng-show="validForm.phone.$error.pattern">手机号必须为有效的手机号码</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数据版本号</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.dataVersion" name="dataVersion" ng-pattern="/^[1-9]\d*$/" required="required" ng-focus="tableForm.phone" placeholder="数据版本号" ng-init="tableForm.dataVersion=1" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.phone.$invalid && submitted">
<span role="alert" ng-show="validForm.phone.$error.required">版本号不能为空</span>
<span role="alert" ng-show="validForm.dataVersion.$error.pattern">数据版本号必须为正整数</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">编码方式</label>
<div class="col-sm-9 sj_form_input ">
<select class="form-control " ng-model="tableForm.encoding">
<option value=0 ng-selected="tableForm.encoding==GBK" selected>GBK</option>
<option value=1 ng-selected="tableForm.encoding==UTF8">UTF8</option>
</select>
</div>
</div>
</div>
</div> -->
<div class="form-group">
<label class="col-sm-3 control-label">用戶名</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.user" name="orcUser" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.user" placeholder="oracle的用户名2-15个字母、数字或下划线" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcUser.$invalid && submitted">
<span role="alert" ng-show="validForm.orcUser.$error.required">用户名不能为空</span>
<span role="alert" ng-show="validForm.orcUser.$error.pattern">用户名必须为2-15个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">结束时间</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.endTime" name="orcEndTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.endTime" placeholder="结束时间,格式为yyyy-MM 例如2018-02"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcEndTime.$invalid && submitted">
<span role="alert" ng-show="validForm.orcEndTime.$error.required">结束时间不能为空</span>
<span role="alert" ng-show="validForm.orcEndTime.$error.pattern">格式为yyyy-MM 例如2018-02</span>
<label class="col-sm-3 control-label">密码</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.password" name="orcPassword" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.password" placeholder="oracle的密码,2-15个字母、数字或下划线" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPassword.$invalid && submitted">
<span role="alert" ng-show="validForm.orcPassword.$error.required">密码不能为空</span>
<span role="alert" ng-show="validForm.orcPassword.$error.pattern">密码必须为2-15个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">联系人</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.contact" name="orcContact" ng-pattern="" required="required" ng-focus="tableForm.contact" placeholder="联系人"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcContact.$invalid && submitted">
<span role="alert" ng-show="validForm.orcContact.$error.required">联系人不能为空</span>
<span role="alert" ng-show="validForm.orcContact.$error.pattern">联系人为有效联系人</span>
<label class="col-sm-3 control-label">服务名</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.databaseName" name="orcService" ng-pattern="/^[a-zA-Z]{1,10}$/" required="required" ng-focus="tableForm.databaseName" placeholder="oracle的实例名,1-10个字母,例如ORCL" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcService.$invalid && submitted">
<span role="alert" ng-show="validForm.orcService.$error.required">服务名不能为空</span>
<span role="alert" ng-show="validForm.orcService.$error.pattern">服务名必须为1-10个字母</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">联系方式</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.phone" name="orcPhone" ng-pattern="/^[1][3,4,5,7,8][0-9]{9}$/" required="required" ng-focus="tableForm.phone" placeholder="联系方式"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPhone.$invalid && submitted">
<span role="alert" ng-show="validForm.orcPhone.$error.required">联系方式不能为空</span>
<span role="alert" ng-show="validForm.orcPhone.$error.pattern">手机号必须为有效的手机号码</span>
<label class="col-sm-3 control-label">表空间名</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.tableName" name="orcTable" ng-pattern="/^\w{1,15}$/" required="required" ng-focus="tableForm.tableName" placeholder="oracle的表空间名,1-15个字母、数字或下划线" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcTable.$invalid && submitted">
<span role="alert" ng-show="validForm.orcTable.$error.required">表空间名不能为空</span>
<span role="alert" ng-show="validForm.orcTable.$error.pattern">表空间名必须为1-15个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">编码方式</label>
<div class="col-sm-10 sj_form_input ">
<select class="form-control " ng-model="tableForm.encoding">
<option value=0 ng-selected="tableForm.encoding==GBK" selected>GBK</option>
<option value=1 ng-selected="tableForm.encoding==UTF8">UTF8</option>
<label class="col-sm-3 control-label">表后缀名</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.suffix" name="orcSuffix" ng-pattern="/^\w{1,10}$/" required="required" ng-focus="tableForm.suffix" placeholder="汇总生成新表的后缀名,1-10个字母、数字或下划线" />
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcSuffix.$invalid && submitted">
<span role="alert" ng-show="validForm.orcSuffix.$error.required">表后缀名不能为空</span>
<span role="alert" ng-show="validForm.orcSuffix.$error.pattern">表后缀名必须为1-10个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">标准表汇总库</label>
<div class="col-sm-9 sj_form_input ">
<select class="form-control " ng-model="tableForm.type">
<option value=0 ng-selected="tableForm.type==0" ng-init="tableForm.type==0"></option>
<option value=1 ng-selected="tableForm.type==1"></option>
</select>
</div>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">用戶名</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.user" name="orcUser" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.user" placeholder="oracle的用户名2-15个字母、数字或下划线"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcUser.$invalid && submitted">
<span role="alert" ng-show="validForm.orcUser.$error.required">用户名不能为空</span>
<span role="alert" ng-show="validForm.orcUser.$error.pattern">用户名必须为2-15个字母、数字或下划线</span>
</div>
<div class="form-group" style="margin-left:145px;">
<button class="btn sj_btn_blue" type='submit' style="color:#fff; margin-right:30px;">
<span class="glyphicon glyphicon-save "></span> 保存
</button>
<button class="btn sj_btn_grey" ng-click='cancel()'>
<span class="glyphicon glyphicon-remove "></span> 取消
</button>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">密码</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.password" name="orcPassword" ng-pattern="/^\w{2,15}$/" required="required" ng-focus="tableForm.password" placeholder="oracle的密码,2-15个字母、数字或下划线"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcPassword.$invalid && submitted">
<span role="alert" ng-show="validForm.orcPassword.$error.required">密码不能为空</span>
<span role="alert" ng-show="validForm.orcPassword.$error.pattern">密码必须为2-15个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">服务名</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.databaseName" name="orcService" ng-pattern="/^[a-zA-Z]{1,10}$/" required="required" ng-focus="tableForm.databaseName" placeholder="oracle的实例名,1-10个字母,例如ORCL"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcService.$invalid && submitted">
<span role="alert" ng-show="validForm.orcService.$error.required">服务名不能为空</span>
<span role="alert" ng-show="validForm.orcService.$error.pattern">服务名必须为1-10个字母</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">表空间名</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.tableName" name="orcTable" ng-pattern="/^\w{1,15}$/" required="required" ng-focus="tableForm.tableName" placeholder="oracle的表空间名,1-15个字母、数字或下划线"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcTable.$invalid && submitted">
<span role="alert" ng-show="validForm.orcTable.$error.required">表空间名不能为空</span>
<span role="alert" ng-show="validForm.orcTable.$error.pattern">表空间名必须为1-15个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">表后缀名</label>
<div class="col-sm-10 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.suffix" name="orcSuffix" ng-pattern="/^\w{1,10}$/" required="required" ng-focus="tableForm.suffix" placeholder="汇总生成新表的后缀名,1-10个字母、数字或下划线"/>
<div class="system-info-danger-red-char form-error" ng-show="validForm.orcSuffix.$invalid && submitted">
<span role="alert" ng-show="validForm.orcSuffix.$error.required">表后缀名不能为空</span>
<span role="alert" ng-show="validForm.orcSuffix.$error.pattern">表后缀名必须为1-10个字母、数字或下划线</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-2 control-label">标准表汇总库</label>
<div class="col-sm-10 sj_form_input ">
<select class="form-control " ng-model="tableForm.type">
<option value=0 ng-selected="tableForm.type==0" selected></option>
<option value=1 ng-selected="tableForm.type==1"></option>
</select>
</div>
</div>
<div class="form-group" style="margin-left:145px;">
<button class="btn sj_btn_blue" type='submit' style="color:#fff; margin-right:30px;" >
<span class="glyphicon glyphicon-save "></span> 保存
</button>
<button class="btn sj_btn_grey" ng-click='cancel()'>
<span class="glyphicon glyphicon-remove "></span> 取消
</button>
</div>
</form>
</form>
</div>
</div>
<hr>
<hr>
<div class="row " style="padding-top:10px;" ng-show="tableForm && createDatabase">
<h3 class="mb10" ng-show="createDatabase">填写创建汇总库信息:</h3>
<div class="col-md-6 col-md-offset-1 ">
<form class="form-horizontal" novalidate="novalidate" name="createDatabaseForm" ng-submit="onSubmitCreateDatabase(tableForm)">
<div class="form-group" ng-show="0">
<label class="col-sm-3 control-label">汇总库系统名称</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control " type="text" ng-model="tableForm.systemName" name="systemName" ng-minlength="2" ng-maxlength="20" required="required" ng-focus="tableForm.systemName" ng-init="tableForm.systemName='汇总库'" placeholder="请输入2-20个字符的汇总库系统名称" />
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.systemName.$invalid && submittedCreateDatabase">
<span role="alert" ng-show="createDatabaseForm.systemName.$error.required">汇总库系统名称不能为空</span>
<span role="alert" ng-show="!createDatabaseForm.systemName.$error.required && createDatabaseForm.systemName.$invalid">请输入2-20个字符的汇总库系统名称</span>
</div>
</div>
</div>
<div class="form-group ">
<label class="col-sm-3 control-label">开始时间</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.startTime" name="startTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.startTime" placeholder="开始时间,格式为yyyy-MM 例如2018-02" />
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.startTime.$invalid && submittedCreateDatabase">
<span role="alert" ng-show="createDatabaseForm.startTime.$error.required">开始时间不能为空</span>
<span role="alert" ng-show="createDatabaseForm.startTime.$error.pattern">格式为yyyy-MM 例如2018-02</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束时间</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.endTime" name="endTime" ng-pattern="/^([0-9]{4})-(0?[1-9]|1[0-2])$/" required="required" ng-focus="tableForm.endTime" placeholder="结束时间,格式为yyyy-MM 例如2018-02" />
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.endTime.$invalid && submittedCreateDatabase">
<span role="alert" ng-show="createDatabaseForm.endTime.$error.required">结束时间不能为空</span>
<span role="alert" ng-show="createDatabaseForm.endTime.$error.pattern">格式为yyyy-MM 例如2018-02</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系人</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.contact" name="contact" ng-pattern="" required="required" ng-focus="tableForm.contact" placeholder="联系人" />
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.contact.$invalid && submittedCreateDatabase">
<span role="alert" ng-show="createDatabaseForm.contact.$error.required">联系人不能为空</span>
<span role="alert" ng-show="createDatabaseForm.contact.$error.pattern">联系人为有效联系人</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">联系方式</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.phone" name="phone" ng-pattern="/^[1][3,4,5,7,8][0-9]{9}$/" required="required" ng-focus="tableForm.phone" placeholder="联系方式" />
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.phone.$invalid && submittedCreateDatabase">
<span role="alert" ng-show="createDatabaseForm.phone.$error.required">联系方式不能为空</span>
<span role="alert" ng-show="createDatabaseForm.phone.$error.pattern">手机号必须为有效的手机号码</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">数据版本号</label>
<div class="col-sm-9 sj_form_input">
<input class="system-info-danger-input form-control" type="text" ng-model="tableForm.dataVersion" name="dataVersion" ng-pattern="/^[1-9]\d*$/" required="required" ng-focus="tableForm.dataVersion" placeholder="数据版本号" ng-init="tableForm.dataVersion=1" />
<div class="system-info-danger-red-char form-error" ng-show="createDatabaseForm.dataVersion.$invalid && submittedCreateDatabase">
<span role="alert" ng-show="createDatabaseForm.dataVersion.$error.required">版本号不能为空</span>
<span role="alert" ng-show="createDatabaseForm.dataVersion.$error.pattern">数据版本号必须为正整数</span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">编码方式</label>
<div class="col-sm-9 sj_form_input ">
<select class="form-control " ng-model="createDatabaseForm.encoding">
<option value="GBK" ng-selected="createDatabaseForm.encoding==GBK" selected>GBK</option>
<option value="UTF8" ng-selected="createDatabaseForm.encoding==UTF8">UTF8</option>
</select>
</div>
</div>
<div class="form-group" style="margin-left:145px;">
<button class="btn sj_btn_blue" type='submit' style="color:#fff; margin-right:30px;">
<span class="glyphicon glyphicon-save "></span> 保存
</button>
<button class="btn sj_btn_grey" ng-click='cancelCreateDatabase()'>
<span class="glyphicon glyphicon-remove "></span> 取消
</button>
</div>
</form>
</div>
</div>
<hr>
</div>
<hr>
</div>
</div>
</div>
<style>
.form-horizontal input::-webkit-input-placeholder{
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style:normal;
}
.form-horizontal input::-moz-placeholder{
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style:normal;
}
.form-horizontal input:-moz-placeholder{
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style:normal;
}
.form-horizontal input:-ms-input-placeholder{
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style:normal;
}
.form-horizontal input::-webkit-input-placeholder {
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style: normal;
}
.form-horizontal input::-moz-placeholder {
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style: normal;
}
.form-horizontal input:-moz-placeholder {
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style: normal;
}
.form-horizontal input:-ms-input-placeholder {
font-family: "微软雅黑";
font-size: 12px;
line-height: 28px;
font-style: normal;
}
</style>

View File

@ -87,7 +87,7 @@
</th> -->
<th colspan="5" ng-show="ngDialogData.editable">
<span>是否为热区</span>
<input type="checkbox" checked="checked" name="hot" ng-model="ngDialogData.hot"/>
<input type="checkbox" checked="checked" name="hot" ng-model="ngDialogData.hot" />
</th>
</tr>
</tbody>
@ -367,70 +367,69 @@
</div>
</script>
<script type="text/ng-template" id="statusHelp.html">
<div class="sj_new_box05">
<h2 class="sj_popup_h2 mb10 mt10">帮助</h2>
<table class="sj_new_table02 mb10" cellpadding="0" cellspacing="0">
<thead >
<tr class="sj_popup_toptxt ">
<th >操作</th>
<th >归档脚本</th>
<th >新版版本</th>
<th >详细说明</th>
</tr>
</thead>
<tbody>
<tr >
<td class="sj_popup_txtbold">审核</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">保留:删除新版脚本文件,保留现有归档脚本
<br/>替换:新版脚本文件移动并覆盖原有归档脚本</td>
</tr>
<tr>
<td class="sj_popup_txtbold">上传</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">选择本地脚本文件,系统按照命名规范重命名文件并归档</td>
</tr>
<tr>
<td class="sj_popup_txtbold">归档</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">将上报的脚本文件移动到归档路径进行归档</td>
</tr>
<tr>
<td class="sj_popup_txtbold">查看</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">重新上传:选择本地脚本文件,系统按照命名规范重命名文件并覆盖现有的归档脚本</td>
</tr>
</tbody>
</table>
<div class="sj_popup_p">
<p>一键归档:待归档状态的所有脚本文件,后台一次性全部归档</p>
<p>一键审核:待审核状态的所有脚本文件,后台一次性全部替换</p>
</div>
<div class="sj_new_box05">
<h2 class="sj_popup_h2 mb10 mt10">帮助</h2>
<table class="sj_new_table02 mb10" cellpadding="0" cellspacing="0">
<thead>
<tr class="sj_popup_toptxt ">
<th>操作</th>
<th>归档脚本</th>
<th>新版版本</th>
<th>详细说明</th>
</tr>
</thead>
<tbody>
<tr>
<td class="sj_popup_txtbold">审核</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">保留:删除新版脚本文件,保留现有归档脚本
<br/>替换:新版脚本文件移动并覆盖原有归档脚本</td>
</tr>
<tr>
<td class="sj_popup_txtbold">上传</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">选择本地脚本文件,系统按照命名规范重命名文件并归档</td>
</tr>
<tr>
<td class="sj_popup_txtbold">归档</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">将上报的脚本文件移动到归档路径进行归档</td>
</tr>
<tr>
<td class="sj_popup_txtbold">查看</td>
<td class="sj_popup_txtbold"></td>
<td class="sj_popup_txtbold"></td>
<td class=" sj_popup_midtxt">重新上传:选择本地脚本文件,系统按照命名规范重命名文件并覆盖现有的归档脚本</td>
</tr>
</tbody>
</table>
<div class="sj_popup_p">
<p>一键归档:待归档状态的所有脚本文件,后台一次性全部归档</p>
<p>一键审核:待审核状态的所有脚本文件,后台一次性全部替换</p>
</div>
</div>
</script>
<script type="text/ng-template" id="uploadErrorInfo.html">
<div class="container-fluid ">
<h2 class="sj_popup_h2 mb10 fb ml15">错误信息:</h2>
<div class=" mb10" style="height:400px;overflow-y:auto;">
<table class="sj_new_table02 mb10 ml15" cellpadding="0" cellspacing="0">
<thead >
<tr class="sj_popup_toptxt ">
<th >文件名</th>
<th >错误描述</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="info in ngDialogData">
<td class="sj_popup_midtxt">{{info.name}}</td>
<td class="sj_popup_midtxt">{{info.value}}</td>
</tr>
</tbody>
</table>
<div class=" mb10" style="height:400px;overflow-y:auto;">
<table class="sj_new_table02 mb10 ml15" cellpadding="0" cellspacing="0">
<thead>
<tr class="sj_popup_toptxt ">
<th>文件名</th>
<th>错误描述</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="info in ngDialogData">
<td class="sj_popup_midtxt">{{info.name}}</td>
<td class="sj_popup_midtxt">{{info.value}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</script>
@ -441,39 +440,37 @@
<ul class="mb10" style="height:400px;overflow-y:auto;">
<li class="cl export-li">
<label class="export-label">
<input type="checkbox" ng-model="flag" class="fl" ng-click="selectAll(flag)"/>
<input type="checkbox" ng-model="flag" class="fl" ng-click="selectAll(flag)" />
<span class="ml5 mt5 fl sj_over_hid">全选</span>
</label>
</li>
<li class="cl export-li" ng-repeat = "item in data">
<li class="cl export-li" ng-repeat="item in data">
<label class="export-label">
<input type="checkbox" id = {{item.id}} ng-checked="ischeckedId(item.id)" ng-click="selectId(item.id,$event,idList)" class="fl" />
<span class="ml5 mt5 fl sj_over_hid ">{{item.cityName}}_{{item.districtName}}_{{item.systemName}}_{{item.endYear}}_{{item.submittedBatch}}</span>
<input type="checkbox" id={{item.id}} ng-checked="ischeckedId(item.id) " ng-click="selectId(item.id,$event,idList) " class="fl " />
<span class="ml5 mt5 fl sj_over_hid ">{{item.cityName}}_{{item.districtName}}_{{item.systemName}}_{{item.endYear}}_{{item.submittedBatch}}_{{item.dataVersion}}</span>
</label>
</li>
</ul>
</div>
<div class="sj_table_td05 sj-border-black mt10 padding20 border-left-none fl">
<h3 class="mb10">选择导出数据类型</h3>
<ul class="mb10" style="height:400px;overflow-y:auto;">
<li class="cl export-li" ng-repeat = "item in export">
<div class="sj_table_td05 sj-border-black mt10 padding20 border-left-none fl ">
<h3 class="mb10 ">选择导出数据类型</h3>
<ul class="mb10 " style="height:400px;overflow-y:auto; ">
<li class="cl export-li " ng-repeat="item in export ">
<label class="export-label">
<input type="checkbox" class="fl" id="{{item.type}}" ng-checked="ischeckedType(item.type)" ng-click="selectType(item.type,$event,typeList)"/>
<span class="ml5 mt5 fl sj_over_hid">{{item.exportName}}</span>
<input type="checkbox" id={{item.type}} ng-checked="ischeckedType(item.type) " ng-click="selectType(item.type,$event,typeList) " class="fl " />
<span class="ml5 mt5 fl sj_over_hid " style="width: 150px;">{{item.exportName}}</span>
<select class="ml5 mt5 fl sj_over_hid" style="width: 200px;" ng-show="item.exportName=='汇总库' " ng-init="selectGatherOracleName=gatherOracles[0].name" ng-model="selectGatherOracleName" ng-options="one.name for one in gatherOracles">
</select>
</label>
</li>
</ul>
</div>
<button class="sj_btn_blue mt20 fr" ng-click="onsubmit(idList,typeList)">保存</button>
<button class="sj_btn_grey mt20 mr5 fr" ng-click="cancel()">取消</button>
<button class="sj_btn_blue mt20 fr " ng-click="onsubmit(idList,typeList) ">保存</button>
<button class="sj_btn_grey mt20 mr5 fr " ng-click="cancel() ">取消</button>
</div>
</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>
<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>
</div>
</div>

View File

@ -3,206 +3,212 @@
/// <reference path="configsDataService.ts"/>
/// <reference path="../../developer/ts/developerNavigation.ts"/>
/// <reference path="../../developer/ts/dataManagerHelper.ts"/>
module Configs{
export class OperateType{
public static get DELETE():string {return "delete"}
public static get UPDATE():string {return "update"}
public static get PUT():string{return "put"}
public static get MOVE():string{return "move"}
public static get EXTRACT():string{return "extract"}
}
module Configs {
export class OperateType {
public static get DELETE(): string { return "delete" }
public static get UPDATE(): string { return "update" }
public static get PUT(): string { return "put" }
public static get MOVE(): string { return "move" }
public static get CREATE_DATABASE(): string { return "createDatabase" }
public static get EXTRACT(): string { return "extract" }
}
_module.controller('Configs.MenuItemController',['$scope', '$location', ($scope, $location) => {
$scope.menuItem=[{
icon: "glyphicon glyphicon-cloud-upload",
label: "数据管理配置",
title: "配置数据存储信息",
href: UrlHelpers.join(context, "/gluster-fs/setting")
},
{
icon: "glyphicon glyphicon-th-list",
label: "服务集群配置",
title: "配置服务集群信息",
href: UrlHelpers.join(context, "/kube-cluster/setting")
}]
}]);
_module.controller('Configs.MenuItemController', ['$scope', '$location', ($scope, $location) => {
$scope.menuItem = [{
icon: "glyphicon glyphicon-cloud-upload",
label: "数据管理配置",
title: "配置数据存储信息",
href: UrlHelpers.join(context, "/gluster-fs/setting")
},
{
icon: "glyphicon glyphicon-th-list",
label: "服务集群配置",
title: "配置服务集群信息",
href: UrlHelpers.join(context, "/kube-cluster/setting")
}
]
}]);
function createConfigBreadcrumbs($scope, $location, $routeParams){
var url = $location.url();
var label, title;
switch (url) {
case "/config/gluster-fs/setting":
label = "数据管理配置";
title= "配置数据存储信息";
break;
case "/config/kube-cluster/setting":
label = "服务集群配置";
title= "配置服务集群信息";
break;
default:
break;
}
function createConfigBreadcrumbs($scope, $location, $routeParams) {
var url = $location.url();
var label, title;
switch (url) {
case "/config/gluster-fs/setting":
label = "数据管理配置";
title = "配置数据存储信息";
break;
case "/config/kube-cluster/setting":
label = "服务集群配置";
title = "配置服务集群信息";
break;
default:
break;
}
return Developer.activateCurrent([{
href: url,
label: label,//item.label,
title: title//item.title
}]);
}
return Developer.activateCurrent([{
href: url,
label: label, //item.label,
title: title //item.title
}]);
}
export function createOracleInfo(array:Array<any>, id:number){
var result ={"id": id};
angular.forEach(array, (arr) => {
result[arr.field] = arr.value;
});
return result;
}
export function createOracleInfo(array: Array < any > , id: number) {
var result = { "id": id };
angular.forEach(array, (arr) => {
result[arr.field] = arr.value;
});
return result;
}
export function shareInit($scope, $location, $routeParams){
$scope. subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
$scope.mask = true;
/**
*/
$("#mask").css("position", "absolute");
$("#mask").css("background", "black");
$("#mask").css("opacity", 0.4);
$("#mask").css("filter", "progid:DXImageTransform.Microsoft.Alpha(style=4,opacity=25)");
$("#mask").css("top", "0px");
$("#mask").css("left", "0px");
$("#mask").css("width", document.body.clientWidth + document.body.scrollLeft);
$("#mask").css("height", document.body.clientHeight + document.body.scrollTop);
$("#mask").css("zIndex", 1000);
}
export function shareInit($scope, $location, $routeParams) {
$scope.subTabConfig = Developer.createCurrentSubNavBar($scope, $location, $routeParams);
$scope.mask = true;
/**
*/
$("#mask").css("position", "absolute");
$("#mask").css("background", "black");
$("#mask").css("opacity", 0.4);
$("#mask").css("filter", "progid:DXImageTransform.Microsoft.Alpha(style=4,opacity=25)");
$("#mask").css("top", "0px");
$("#mask").css("left", "0px");
$("#mask").css("width", document.body.clientWidth + document.body.scrollLeft);
$("#mask").css("height", document.body.clientHeight + document.body.scrollTop);
$("#mask").css("zIndex", 1000);
}
export function createNewObejct(array:Array<any>, obj){
var result =[];
if(obj){
angular.forEach(array, (arr) =>{
result.push({
field: arr.field,
name: arr.displayName,
value: obj[arr.field]
});
});
}else{
angular.forEach(array, (arr) =>{
result.push({
field: arr.field,
name: arr.displayName,
value: null
});
});
}
return result;
}
export function createNewObejct(array: Array < any > , obj) {
var result = [];
if (obj) {
angular.forEach(array, (arr) => {
result.push({
field: arr.field,
name: arr.displayName,
value: obj[arr.field]
});
});
} else {
angular.forEach(array, (arr) => {
result.push({
field: arr.field,
name: arr.displayName,
value: null
});
});
}
return result;
}
export function oracleInfoOperate($http, url:string, operate:string, resource, fn?: (data, status)=>void ){
if(resource === null)
throw "不能操作空资源对象";
if(angular.isArray(resource)){
var ids = [];
angular.forEach(resource, (item) => {
var id = item["id"] || item["name"] || item["_id"] || item["_key"];
ids.push(id);
});
$http({
method: "POST",
dataType: 'json',
url: UrlHelpers.join(url, operate+"s"),
data: ids,
}).success((data,header,config,status) => {
if(angular.isFunction(fn))
fn(data, header);
}).error((data,header,config,status) => {
if(angular.isFunction(fn))
fn(data, header);
});
}else{
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
var RESTfulUrl=url;
if(id == "undefined"){
RESTfulUrl = UrlHelpers.join(url, operate);
}else{
RESTfulUrl = UrlHelpers.join(url, id+"", operate);
}
export function oracleInfoOperate($http, url: string, operate: string, resource, fn ? : (data, status) => void) {
if (resource === null)
throw "不能操作空资源对象";
if (angular.isArray(resource)) {
var ids = [];
angular.forEach(resource, (item) => {
var id = item["id"] || item["name"] || item["_id"] || item["_key"];
ids.push(id);
});
$http({
method: "POST",
dataType: 'json',
url: UrlHelpers.join(url, operate + "s"),
data: ids,
}).then(function successCallback(response) {
if (angular.isFunction(fn))
fn(response.data, response.header);
}, function errorCallback(response) {
fn(response.data, response.header);
});
} else {
var id = resource["id"] || resource["name"] || resource["_id"] || resource["_key"];
var RESTfulUrl = url;
if (typeof(id) == "undefined") {
RESTfulUrl = UrlHelpers.join(url, operate);
} else {
RESTfulUrl = UrlHelpers.join(url, id + "", operate);
}
$http({
method: "POST",
dataType: 'json',
url: RESTfulUrl,
data: JSON.stringify(resource),
}).success((data,header,config,status) => {
if(angular.isFunction(fn))
fn(data, header);
// console.log("success");
// console.log(data + "_." + header + "_.." + config + "_..." + status);
// console.log("success");
}).error((data,header,config,status) => {
if(angular.isFunction(fn))
fn(data, header);
});
}
}
$http({
method: "POST",
dataType: 'json',
url: RESTfulUrl,
data: JSON.stringify(resource),
}).then(function successCallback(response) {
if (angular.isFunction(fn))
fn(response.data, response.status);
}, function errorCallback(response) {
fn(response.data, response.status);
});
// success((data,header,config,status) => {
// if(angular.isFunction(fn))
// fn(data, header);
// // console.log("success");
// // console.log(data + "_." + header + "_.." + config + "_..." + status);
// // console.log("success");
// }).error((data,header,config,status) => {
// if(angular.isFunction(fn))
// fn(data, header);
// });
}
}
export function createConfigHelperNavBar($scope, $location, $routeParams){
return Developer.activateCurrent([
{
href: UrlHelpers.join(context, "regionalism-code/searching"),
label: "行政区划检索",
title: "检索行政区划代码"
},
{
href: UrlHelpers.join(context,"system-code/searching"),
label: "系统编码检索",
title: "检索系统编码"
}
]);
}
export function createConfigHelperNavBar($scope, $location, $routeParams) {
return Developer.activateCurrent([{
href: UrlHelpers.join(context, "regionalism-code/searching"),
label: "行政区划检索",
title: "检索行政区划代码"
},
{
href: UrlHelpers.join(context, "system-code/searching"),
label: "系统编码检索",
title: "检索系统编码"
}
]);
}
export function formatVolume(volume: volume): formatedVolume{
var brick:Array<Brick> = [];
angular.forEach(volume.brick, (block:Block) => {
brick.push({
ip: block.ip.split("."),
status: block.status,
path: block.path,
editable: block.editable || false
});
});
export function formatVolume(volume: volume): formatedVolume {
var brick: Array < Brick > = [];
angular.forEach(volume.brick, (block: Block) => {
brick.push({
ip: block.ip.split("."),
status: block.status,
path: block.path,
editable: block.editable || false
});
});
return {
name: volume.name,
path: volume.path,
brick: brick,
status: volume.status,
editable: volume.editable || false,
hot: volume.hot == 0 ? true : false
}
}
return {
name: volume.name,
path: volume.path,
brick: brick,
status: volume.status,
editable: volume.editable || false,
hot: volume.hot == 0 ? true : false
}
}
export function volumesFormat(volumes: Array<volume>): Array<formatedVolume>{
var result:Array<formatedVolume> = [];
angular.forEach(volumes, (volume) => {
result.push(formatVolume(volume));
});
return result;
}
export function volumesFormat(volumes: Array < volume > ): Array < formatedVolume > {
var result: Array < formatedVolume > = [];
angular.forEach(volumes, (volume) => {
result.push(formatVolume(volume));
});
return result;
}
export interface formatedVolume{
name: string
path: string
brick: Array<Brick>;
status: boolean;
editable: boolean,
hot: boolean
}
export interface formatedVolume {
name: string
path: string
brick: Array < Brick > ;
status: boolean;
editable: boolean,
hot: boolean
}
export interface Brick{
ip: Array<string>;
status: boolean;
path: string;
editable: boolean
}
export interface Brick {
ip: Array < string > ;
status: boolean;
path: string;
editable: boolean
}
}

View File

@ -3,174 +3,227 @@
/// <reference path="configsHelper.ts"/>
/// <reference path="configsUtils.ts"/>
module Configs{
module Configs {
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout","ConfigsModel","DataModel",
($scope, $templateCache:ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel, DataModel) => {
$scope.model= ConfigsModel;
$scope.model.updateOracleParam();
$scope.submitted = false;
$scope.DataModel = DataModel;
console.log(ConfigsModel.oracleParam);
console.log("Configs00000000");
$scope.tableConfig={
data: 'model.oracleParam',
selectedItems: [],
columnDefs: [{
field: "name",
displayName: "名称"
},
{
field: "ip",
displayName: "IP"
},
{
field: "port",
displayName: "端口号"
},
{
field: "user",
displayName: "用户名"
},
{
field: "password",
displayName: "密码"
},
{
field: "databaseName",
displayName: "服务名"
},
{
field: "tableName",
displayName: "表空间名"
},
{
field: "suffix",
displayName: "表后缀"
},
{
field: "type",
displayName: "标准表汇总库",
cellTemplate: $templateCache.get("strandColumn.html")
},
{
field: "entity",
displayName: "操作",
cellTemplate: $templateCache.get("tableEdit.html")
}],
enableRowClickSelection: false,
showSelectionCheckbox: false,
multiSelect: false,
sortInfo: {
sortBy: "name",
ascending: true
}
}
shareInit($scope, $location, $routeParams);
$scope.create = () =>{
export var KubeController = controller('KubeController', ["$scope", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "ConfigsModel", "DataModel", "$modal",
($scope, $templateCache: ng.ITemplateCacheService, $location, $routeParams, $http, $timeout, ConfigsModel, DataModel, $modal) => {
$scope.model = ConfigsModel;
$scope.model.updateOracleParam();
$scope.submitted = false;
$scope.add= true;
$scope.edit = false;
$scope.tableForm = {};
$scope.tableForm["id"]=0;
$scope.tableForm["type"]=0;
$scope.tableForm["name"]='';
$scope.tableForm["ip"]='';
$scope.tableForm["port"]='';
$scope.tableForm["user"]='';
$scope.tableForm["password"]='';
$scope.tableForm["databaseName"]='';
$scope.tableForm["tableName"]='';
$scope.tableForm["suffix"]='';
$scope.submittedCreateDatabase = false;
$scope.DataModel = DataModel;
$scope.tableForm["startTime"]='';
$scope.tableForm["endTime"]='';
$scope.tableForm["contact"]='';
$scope.tableForm["phone"]='';
$scope.tableForm["isCreateGatherOracle"]=1;
}
$scope.cancel = () => {
$scope.tableForm =null;
$scope.add = false;
$scope.edit = false;
$scope.submitted = false;
}
$scope.onSubmit = (oracle) => {
if($scope.tableForm["name"]=='请输入2-20个字符的数据名称')
$scope.tableForm["name"]='';
if($scope.tableForm["ip"]=='oracle的IP,例如0.0.0.0')
$scope.tableForm["ip"]='';
if($scope.tableForm["port"]=='oracle的的端口,1~65535')
$scope.tableForm["port"]='';
if($scope.tableForm["user"]=='oracle的用户名2-15个字母、数字或下划线')
$scope.tableForm["user"]='';
if($scope.tableForm["password"]=='oracle的密码,2-15个字母、数字或下划线')
$scope.tableForm["password"]='';
if($scope.tableForm["databaseName"]=='oracle的实例名,1-10个字母,例如ORCL')
$scope.tableForm["databaseName"]='';
if($scope.tableForm["tableName"]=='oracle的表空间名,1-15个字母、数字或下划线')
$scope.tableForm["tableName"]='';
if($scope.tableForm["suffix"]=='汇总生成新表的后缀名,1-10个字母、数字或下划线')
$scope.tableForm["suffix"]='';
if($scope.tableForm["startTime"]=='开始时间,格式为yyyy-MM 例如2018-02')
$scope.tableForm["startTime"]='';
if($scope.tableForm["endTime"]=='结束时间,格式为yyyy-MM 例如2018-02')
$scope.tableForm["endTime"]='';
if($scope.tableForm["contact"]=='联系人')
$scope.tableForm["contact"]='';
if($scope.tableForm["phone"]=='联系方式')
$scope.tableForm["phone"]='';
console.log(ConfigsModel.oracleParam);
console.log("Configs00000000");
$scope.tableConfig = {
data: 'model.oracleParam',
selectedItems: [],
columnDefs: [{
field: "name",
displayName: "名称"
},
{
field: "ip",
displayName: "IP"
},
{
field: "port",
displayName: "端口号"
},
{
field: "user",
displayName: "用户名"
},
{
field: "password",
displayName: "密码"
},
{
field: "databaseName",
displayName: "服务名"
},
{
field: "tableName",
displayName: "表空间名"
},
{
field: "suffix",
displayName: "表后缀"
},
{
field: "type",
displayName: "标准表汇总库",
cellTemplate: $templateCache.get("strandColumn.html")
if($scope.validForm.$valid && $scope.validForm.$dirty){
$scope.edit = false;
$scope.add = false
console.log(oracle);
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.UPDATE, oracle, (result, status) => {
console.log(oracle);
if(status===200){
$scope.model.updateOracleParam();
}else{
throw "资源请求失败";
},
{
field: "entity",
displayName: "操作",
cellTemplate: $templateCache.get("tableEdit.html")
}
});
}else{
$scope.submitted = true;
],
enableRowClickSelection: false,
showSelectionCheckbox: false,
multiSelect: false,
sortInfo: {
sortBy: "name",
ascending: true
}
}
shareInit($scope, $location, $routeParams);
$scope.create = () => {
$scope.submitted = false;
$scope.add = true;
$scope.edit = false;
$scope.createDatabase = false;
$scope.tableForm = {};
$scope.tableForm["id"] = 0;
$scope.tableForm["type"] = 0;
$scope.tableForm["name"] = '';
$scope.tableForm["ip"] = '';
$scope.tableForm["port"] = '';
$scope.tableForm["user"] = '';
$scope.tableForm["password"] = '';
$scope.tableForm["databaseName"] = '';
$scope.tableForm["tableName"] = '';
$scope.tableForm["suffix"] = '';
}
$scope.createGatherDababase = () => {
$scope.submittedCreateDatabase = false;
$scope.add = false;
$scope.edit = false;
$scope.createDatabase = true;
$scope.tableForm = {};
$scope.tableForm["dataVersion"] = 1;
$scope.tableForm["systemName"] = '汇总库';
$scope.tableForm["startTime"] = '';
$scope.tableForm["endTime"] = '';
$scope.tableForm["contact"] = '';
$scope.tableForm["phone"] = '';
$scope.tableForm["encoding"] = 'UTF8';
}
$scope.cancel = () => {
$scope.tableForm = null;
$scope.add = false;
$scope.edit = false;
$scope.submitted = false;
}
$scope.cancelCreateDatabase = () => {
$scope.tableForm = null;
$scope.createDatabase = false;
$scope.submittedCreateDatabase = false;
}
$scope.onSubmit = (oracle) => {
if ($scope.tableForm["name"] == '请输入2-20个字符的数据名称')
$scope.tableForm["name"] = '';
if ($scope.tableForm["ip"] == 'oracle的IP,例如0.0.0.0')
$scope.tableForm["ip"] = '';
if ($scope.tableForm["port"] == 'oracle的的端口,1~65535')
$scope.tableForm["port"] = '';
if ($scope.tableForm["user"] == 'oracle的用户名2-15个字母、数字或下划线')
$scope.tableForm["user"] = '';
if ($scope.tableForm["password"] == 'oracle的密码,2-15个字母、数字或下划线')
$scope.tableForm["password"] = '';
if ($scope.tableForm["databaseName"] == 'oracle的实例名,1-10个字母,例如ORCL')
$scope.tableForm["databaseName"] = '';
if ($scope.tableForm["tableName"] == 'oracle的表空间名,1-15个字母、数字或下划线')
$scope.tableForm["tableName"] = '';
if ($scope.tableForm["suffix"] == '汇总生成新表的后缀名,1-10个字母、数字或下划线')
$scope.tableForm["suffix"] = '';
if ($scope.validForm.$valid && $scope.validForm.$dirty) {
$scope.edit = false;
$scope.add = false
console.log(oracle);
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.UPDATE, oracle, (result, status) => {
if (status == 200) {
$scope.model.updateOracleParam();
Configs.customAlert("提示", "汇总库更新成功", '', null, 0, "success");
} else if (status == 400) {
console.log(result);
Configs.customAlert("提示", "汇总库更新失败,名称不能重复", '', null, 0, "error");
} else {
console.log(result);
Configs.customAlert("提示", "汇总库配置失败: 系统异常!", '', null, 0, "error");
}
});
} else {
$scope.submitted = true;
}
}
$scope.onSubmitCreateDatabase = (oracle) => {
if ($scope.tableForm["systemName"] == '请输入2-20个字符的汇总库系统名称')
$scope.tableForm["systemName"] = '';
if ($scope.tableForm["startTime"] == '开始时间,格式为yyyy-MM 例如2018-02')
$scope.tableForm["startTime"] = '';
if ($scope.tableForm["endTime"] == '结束时间,格式为yyyy-MM 例如2018-02')
$scope.tableForm["endTime"] = '';
if ($scope.tableForm["contact"] == '联系人')
$scope.tableForm["contact"] = '';
if ($scope.tableForm["phone"] == '联系方式')
$scope.tableForm["phone"] = '';
if ($scope.createDatabaseForm.$valid && $scope.createDatabaseForm.$dirty) {
$scope.createDatabase = false;
console.log(oracle);
Configs.customAlert("提示", "准备创建汇总库,请稍后前往数据管理页面查看创建的汇总库", '', null, 0, "success");
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.CREATE_DATABASE, oracle, (result, status) => {
if (status === 200) {
Configs.customAlert("提示", "汇总库创建成功,请前往数据管理页面中启动创建的汇总库并查看参数在配置服务集群", '', null, 0, "success");
} else {
console.log(result);
Configs.customAlert("提示", "汇总库创建失败!\n" + result.msg, '', null, 0, "error");
}
});
} else {
$scope.submittedCreateDatabase = true;
}
}
$scope.$on("editRow", (event, data) => {
$scope.submitted = false;
$scope.tableForm = deepCopy(data);
$scope.edit = true;
$scope.add = false;
$scope.createDatabase = false;
//$scope.rowId = data.id
//createNewObejct($scope.tableConfig.columnDefs, data);
//removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
});
$scope.$on("deleteRow", (event, data) => {
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.DELETE, data, (result, status) => {
if (status == 200) {
$scope.model.updateOracleParam();
Configs.customAlert("提示", "汇总库删除成功", '', null, 0, "success");
} else {
console.log(result);
Configs.customAlert("提示", "汇总库配置失败: 系统异常!", '', null, 0, "error");
}
});
//removeElementByValue($scope.model, data._id, "_id");
});
}
$scope.$on("editRow", (event, data) =>{
$scope.submitted = false;
$scope.tableForm = deepCopy(data);
$scope.edit = true;
$scope.add = false;
//$scope.rowId = data.id
//createNewObejct($scope.tableConfig.columnDefs, data);
//removeElementsByValue($scope.tableForm, [{key: "name", value: "序号"},{key: "name", value: "连接状态"},{key: "name", value: "操作"}]);
}) ;
]);
$scope.$on("deleteRow", (event, data) =>{
oracleInfoOperate($http, "/java/console/api/oracle", OperateType.DELETE, data, (result, status) => {
if(status===200){
console.log("准备更新");
$scope.model.updateOracleParam();
}else{
throw "资源请求失败";
}
});
//removeElementByValue($scope.model, data._id, "_id");
});
}]);
}

View File

@ -5,423 +5,445 @@
/// <reference path="../../configs/ts/customAlert.ts"/>
/// <reference path="../../kubernetes/ts/kubernetesHelpers.ts"/>
module Configs{
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
$scope.editRow = (entity)=>{
$scope.$emit('editRow', entity);
}
$scope.deleteRowOne ={
show: false,
item: null,
open: (entity) => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = true;
deleteRowOne.item = entity;
},
onOk: () => {
var deleteRowOne = $scope.deleteRowOne;
$scope.$emit('deleteRow', deleteRowOne.item);
},
onCancel: () => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = false;
deleteRowOne.item = null;
}
}
}]);
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
$scope.submitted = false;
$scope.status = $scope.ngDialogData.status;
$scope. cancel = () =>{
$scope.closeThisDialog();
$scope.submitted = false;
}
$scope.deleteBrock = (volume:volume, brock) => {
if(volume.brick.length>1)
deleteBrock(volume, brock);
else
$scope.showMessage = true;
}
$scope.addBrock = (volume) => {
var block = {
ip: "", //存储块的机器ip地址
path: "", //存储块路径
status: false, //存储块的状态
editable:true
};
addBrock(volume, block);
$scope.showMessage = false;
}
$scope.stopVolume = (volume) =>{
volume.status = false;
}
$scope.startVolume = (volume) =>{
volume.status = true;
}
$scope.onSubmit = (entity) => {
console.log(entity);
if($scope.volumeForm.$valid){
$scope.$emit('update', entity);
$scope.closeThisDialog();
}else{
$scope.submitted = true;
}
}
}]);
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) =>{
}]);
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) =>{
$scope.title = shareInit($scope.ngDialogData);
$scope.content = "";
getSqlContent();
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.old_content = data.data1;
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$scope.old_content = "获取脚本内容失败"
});
}
$scope.upLoadSqlFile = () => {
if(typeof FileReader == 'undefined'){
throw "浏览器不支持FileReader读取文件";
}else{
Configs.FileInputPlugin((file) =>{
if(typeof typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else{
var fr = new FileReader();
fr.onloadend = (e) =>{
$scope.new_content = e.target["result"];
$scope.enable = true;
}
fr.onloadstart = () =>{
$scope.$apply(() =>{
$scope.content = "正在读取数据请稍等...";
});
$scope.content = "正在读取数据请稍等...";
}
fr.readAsText(file[0],"GBK");
}
});
}
}
$scope.onOk = () => {
$scope.enable = false;
if(null == $scope.new_content || $scope.new_content == ""){
console.log("上传的内容不能为空");
$scope.closeThisDialog();
}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();
}
}
$scope.cancel = () => {
$scope.enable = false;
$scope.closeThisDialog();
}
}]);
export var SqlAddController = controller('SqlAddController', ['$scope', '$http', ($scope, $http) => {
$scope.content = "";
$scope.title = shareInit($scope.ngDialogData);
$scope.sqlFileUpload = () =>{
Configs.FileInputPlugin((file) =>{
if(typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else{
var fr = new FileReader();
fr.onloadend = (e) =>{
$scope.content = e.target["result"];
$scope.enable = true;
}
fr.onloadstart = () =>{
$scope.$apply(() =>{
$scope.content = "正在读取数据请稍等...";
});
$scope.content = "正在读取数据请稍等...";
}
fr.readAsText(file[0],"GBK");
}
});
}
$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.title = shareInit($scope.ngDialogData);
$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 = "获取脚本内容失败";
});
}
$scope.cancel = () => {
//$scope.closeThisDialog();
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "delete",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
}]);
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",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "replace",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
$scope.cancel = () => {
$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', '$http', ($scope, $http) => {
$scope.checkboxItmes = [];
$scope.click = ($event, name) => {
if($event.target.checked){
if($scope.checkboxItmes.indexOf(name) == -1)
$scope.checkboxItmes.push(name)
}
else{
for(var i= 0; i < $scope.checkboxItmes.length; i++){
if($scope.checkboxItmes[i] === name){
$scope.checkboxItmes.splice(i,1);
break;
}
}
}
}
getData();
$scope.replace = () => {
$scope.requestBody = $scope.data1;
angular.forEach($scope.checkboxItmes, (item) => {
$scope.requestBody[item] = $scope.data2[item];
});
$scope.$emit("updateRow", $scope.requestBody);
$scope.closeThisDialog();
}
$scope.cancel = () => {
$scope.closeThisDialog();
}
function getData(){
$http({
url: "/java/console/api/checkout/findDetails",
method:'POST',
data: JSON.stringify($scope.ngDialogData)
}).success(function(data,header,config,status){
$scope.data1 = data.data1;
$scope.data2 = data.data2;
//响应成功
}).error(function(data,header,config,status){
//处理响应失败
$scope.content = "获取脚本内容失败";
});
}
}]);
export var dataExportController = controller("dataExportController", ['$scope', '$http', 'DataModel', 'ConfigsModel', ($scope, $http, DataModel:Developer.DataModelService, ConfigsModel:Configs.ConfigsModelService ) => {
$scope.model = DataModel;
$scope.data = DataModel.data;
$scope.export = [{"type":1,"exportName":"原始数据"},{"type":2,"exportName":"汇总库"},{"type":3,"exportName":"标准表抽取脚本"}];
$scope.idList = [];
$scope.typeList= [];
$scope.flag = false;
$scope.ischeckedId = function(id){
return $scope.idList.indexOf(id)>=0;
}
$scope.selectId = function(id, event){
var action = event.target;
if(action.checked){
if($scope.idList.indexOf(id) == -1){
$scope.idList.push(id);
return $scope.idList;
}
}else{
var idx = $scope.idList.indexOf(id);
if(idx != -1){
$scope.idList.splice(idx,1);
return $scope.idList;
}
}
}
$scope.ischeckedType = function(type){
return $scope.typeList.indexOf(type)>=0;
module Configs {
export var TableEdit = controller('TableEdit', ['$scope', ($scope) => {
$scope.editRow = (entity) => {
$scope.$emit('editRow', entity);
}
$scope.selectType = function(type, event){
var action = event.target;
if(action.checked){
if($scope.typeList.indexOf(type) == -1){
$scope.typeList.push(type);
return $scope.typeList;
}
}else{
var idx = $scope.typeList.indexOf(type);
if(idx != -1){
$scope.typeList.splice(idx,1);
return $scope.typeList;
}
$scope.deleteRowOne = {
show: false,
item: null,
open: (entity) => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = true;
deleteRowOne.item = entity;
},
onOk: () => {
var deleteRowOne = $scope.deleteRowOne;
$scope.$emit('deleteRow', deleteRowOne.item);
},
onCancel: () => {
var deleteRowOne = $scope.deleteRowOne;
deleteRowOne.show = false;
deleteRowOne.item = null;
}
}
}]);
export var VolumeController = controller('VolumeController', ['$scope', '$http', ($scope, $http) => {
$scope.submitted = false;
$scope.status = $scope.ngDialogData.status;
$scope.cancel = () => {
$scope.closeThisDialog();
$scope.submitted = false;
}
$scope.deleteBrock = (volume: volume, brock) => {
if (volume.brick.length > 1)
deleteBrock(volume, brock);
else
$scope.showMessage = true;
}
$scope.addBrock = (volume) => {
var block = {
ip: "", //存储块的机器ip地址
path: "", //存储块路径
status: false, //存储块的状态
editable: true
};
addBrock(volume, block);
$scope.showMessage = false;
}
$scope.stopVolume = (volume) => {
volume.status = false;
}
$scope.startVolume = (volume) => {
volume.status = true;
}
$scope.onSubmit = (entity) => {
console.log(entity);
if ($scope.volumeForm.$valid) {
$scope.$emit('update', entity);
$scope.closeThisDialog();
} else {
$scope.submitted = true;
}
}
}]);
export var SystemInfoController = controller('SystemInfoController', ['$scope', ($scope) => {}]);
export var SqlViewController = controller('SqlViewController', ['$scope', '$http', ($scope, $http) => {
$scope.title = shareInit($scope.ngDialogData);
$scope.content = "";
getSqlContent();
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.old_content = data.data1;
//响应成功
}).error(function(data, header, config, status) {
//处理响应失败
$scope.old_content = "获取脚本内容失败"
});
}
$scope.upLoadSqlFile = () => {
if (typeof FileReader == 'undefined') {
throw "浏览器不支持FileReader读取文件";
} else {
Configs.FileInputPlugin((file) => {
if (typeof typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else {
var fr = new FileReader();
fr.onloadend = (e) => {
$scope.new_content = e.target["result"];
$scope.enable = true;
}
fr.onloadstart = () => {
$scope.$apply(() => {
$scope.content = "正在读取数据请稍等...";
});
$scope.content = "正在读取数据请稍等...";
}
fr.readAsText(file[0], "GBK");
}
});
}
}
$scope.selectAll = function(flag){
if($scope.flag){
flag = false;
angular.forEach($scope.data, function(item, index){
$scope.idList.push(item.id);
});
return $scope.idList;
}else{
flag = true;
$scope.idList = [];
return $scope.idList;
}
}
$scope.onOk = () => {
$scope.enable = false;
if (null == $scope.new_content || $scope.new_content == "") {
console.log("上传的内容不能为空");
$scope.closeThisDialog();
} 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();
}
}
$scope.cancel = () => {
$scope.enable = false;
$scope.closeThisDialog();
}
}]);
export var SqlAddController = controller('SqlAddController', ['$scope', '$http', ($scope, $http) => {
$scope.content = "";
$scope.title = shareInit($scope.ngDialogData);
$scope.sqlFileUpload = () => {
Configs.FileInputPlugin((file) => {
if (typeof FileReader == 'undefined')
throw "浏览器不支持FileReader读取文件";
else {
var fr = new FileReader();
fr.onloadend = (e) => {
$scope.content = e.target["result"];
$scope.enable = true;
}
fr.onloadstart = () => {
$scope.$apply(() => {
$scope.content = "正在读取数据请稍等...";
});
$scope.content = "正在读取数据请稍等...";
}
fr.readAsText(file[0], "GBK");
}
});
}
$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.title = shareInit($scope.ngDialogData);
$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 = "获取脚本内容失败";
});
}
$scope.cancel = () => {
//$scope.closeThisDialog();
$scope.$emit("replace", {
url: "/java/console/api/filePackage/handleSqlFile",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "delete",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
}]);
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",
item: $scope.ngDialogData.item,
content: $scope.content,
opt: "replace",
type: $scope.ngDialogData.type
});
$scope.closeThisDialog();
}
$scope.cancel = () => {
$scope.closeThisDialog();
}
$scope.onsubmit = (idList , typeList) => {
function getSqlContent() {
$http({
url: "/oracle/exportData",
method:'POST',
data: idList,typeList,
}).success(function(data,header,config,status){
console.log(data + "__" + header);
}).error(function(data,header,config,status){
console.log("获取脚本内容失败");
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', '$http', ($scope, $http) => {
$scope.checkboxItmes = [];
$scope.click = ($event, name) => {
if ($event.target.checked) {
if ($scope.checkboxItmes.indexOf(name) == -1)
$scope.checkboxItmes.push(name)
} else {
for (var i = 0; i < $scope.checkboxItmes.length; i++) {
if ($scope.checkboxItmes[i] === name) {
$scope.checkboxItmes.splice(i, 1);
break;
}
}
}
}
getData();
$scope.replace = () => {
$scope.requestBody = $scope.data1;
angular.forEach($scope.checkboxItmes, (item) => {
$scope.requestBody[item] = $scope.data2[item];
});
$scope.$emit("updateRow", $scope.requestBody);
$scope.closeThisDialog();
}
$scope.cancel = () => {
$scope.closeThisDialog();
}
function getData() {
$http({
url: "/java/console/api/checkout/findDetails",
method: 'POST',
data: JSON.stringify($scope.ngDialogData)
}).success(function(data, header, config, status) {
$scope.data1 = data.data1;
$scope.data2 = data.data2;
//响应成功
}).error(function(data, header, config, status) {
//处理响应失败
$scope.content = "获取脚本内容失败";
});
}
}]);
export var dataExportController = controller("dataExportController", ['$scope', '$http', 'DataModel', 'ConfigsModel', ($scope, $http, DataModel: Developer.DataModelService, ConfigsModel: Configs.ConfigsModelService) => {
$scope.model = DataModel;
$scope.data = DataModel.data;
$scope.gatherOracles=ConfigsModel.oracleParam;
$scope.export = [{ "type": 1, "exportName": "原始数据" }, { "type": 2, "exportName": "汇总库" }, { "type": 3, "exportName": "标准表抽取脚本" }];
$scope.idList = [];
$scope.typeList = [];
$scope.flag = false;
$scope.ischeckedId = function(id) {
return $scope.idList.indexOf(id) >= 0;
}
$scope.selectId = function(id, event) {
var action = event.target;
if (action.checked) {
if ($scope.idList.indexOf(id) == -1) {
$scope.idList.push(id);
return $scope.idList;
}
} else {
var idx = $scope.idList.indexOf(id);
if (idx != -1) {
$scope.idList.splice(idx, 1);
return $scope.idList;
}
}
}
$scope.ischeckedType = function(type) {
return $scope.typeList.indexOf(type) >= 0;
}
$scope.selectType = function(type, event) {
var action = event.target;
if (action.checked) {
if ($scope.typeList.indexOf(type) == -1) {
$scope.typeList.push(type);
return $scope.typeList;
}
} else {
var idx = $scope.typeList.indexOf(type);
if (idx != -1) {
$scope.typeList.splice(idx, 1);
return $scope.typeList;
}
}
}
$scope.selectAll = function(flag) {
if ($scope.flag) {
flag = false;
angular.forEach($scope.data, function(item, index) {
$scope.idList.push(item.id);
});
return $scope.idList;
} else {
flag = true;
$scope.idList = [];
return $scope.idList;
}
}
$scope.cancel = () => {
$scope.closeThisDialog();
}
$scope.onsubmit = (idList, typeList) => {
if (!idList.length) {
Configs.customAlert("提示", "请选择需要导出的数据", '', null, 0, "error");
return;
}
if (!typeList.length) {
Configs.customAlert("提示", "请选择需要导出的类型", '', null, 0, "error");
return;
}
var formData = {};
formData['idList'] = idList;
formData['typeList'] = typeList;
$.ajax({
async: false,
type: "POST",
contentType: "application/x-www-form-urlencoded",
url: UrlHelpers.join("/java/console/api/oracle/exportData"),
dataType: 'json',
data: { "idList": idList, "typeList": typeList },
// data: { "idList": idList, "typeList": typeList },
// data: JSON.stringify(formData),
success: (data) => {
Configs.customAlert("提示", "操作成功: 本次合计新增了" + data, '', null, 0, "success");
},
error: (data) => {
Configs.customAlert("提示", "操作成功: 本次合计新增了" + data, '', null, 0, "error");
}
});
$scope.closeThisDialog();
}
}]);
function shareInit(ngDialogData) {
var title = "";
if(ngDialogData.type != 'undefined'){
switch (ngDialogData.type) {
case "userTableStatus" :
title = "UserTablespace";
break;
case "ckPayStatus":
title = "Chechout_Pay"
break;
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;
}
case "ckIndicateStatus":
title = "Chechout_Indicate"
break;
}
}
return title;
}
}

View File

@ -296,7 +296,6 @@ module Developer {
console.log("selected");
var exitedItems = Kubernetes.checkForCreateOracle($scope.model.transferTasks, items);
console.log(items);
console.log(12313132);
for (var i = 0; i < items.length; ++i) {
// code...
if (items[i].dataBaseType != 'ORACLE') {

View File

@ -233,7 +233,6 @@
</div>
</div>
</script>
<script type="text/ng-template" id="taskRecordEdit.html">
<div class="ngCellText" ng-init="entity=row.entity" ng-controller="Kubernetes.TaskRecordEdit">
<button class="btn sj_btn" style="border:0;background:none;" ng-click="showDeleteOne.open(entity)" ng-disabled="entity.status == 1 || entity.status == 0">
@ -252,16 +251,15 @@
<!-- <div style="height:80%;" class="ngCellText progress" ng-init="entity=row.entity"> -->
<div ng-init="entity=row.entity">
<div style="position:relative;text-align:right;width:100%;height:25px">
<span></span>
<span></span>
</div>
<div ng-show="entity.status!==3" class="progress-bar progress-bar-success active sj_progress_bar " role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="0" aria-valuemax="100" style="text-align:left;height:15px;width: {{entity.process}}%">
<!-- <span class="sj_progress_font">{{entity.process}}%</span> -->
<!-- <span class="sj_progress_font">{{entity.process}}%</span> -->
</div>
<div style="position:relative;text-align:right;width:100%;height:15px;line-height:90%">
<span>{{entity.process}}%</span>
<span>{{entity.process}}%</span>
</div>
<!-- <div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active sj_progress_bar" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="30" aria-valuemax="100" style="width: 100%" title="{{entity.process}}%">
<!-- <div ng-show="entity.status ===3" class="progress-bar progress-bar-danger active sj_progress_bar" role="progressbar" aria-valuenow="{{entity.process}}" aria-valuemin="30" aria-valuemax="100" style="width: 100%" title="{{entity.process}}%">
<span class="sj_progress_font">{{entity.process}}%</span>
</div> -->
</div>
@ -318,13 +316,35 @@
</div>
</script>
<script type="text/ng-template" id="isExistHot.html">
<div class="ngCellText" ng-init="entity=row.entity">
<div ng-show="true" title="是否是标准表汇总库">
<div class="ngCellText" ng-init="entity=row.entity">
<div ng-show="true" title="是否在热区">
<span ng-show="entity.existHotData == 0">&nbsp;</span>
<span ng-show="entity.existHotData == 1">&nbsp;</span>
</div>
</div>
</script>
<script type="text/ng-template" id="modal.html">
<div>
<div class="modal-header">
<h3 class="modal-title" align="center">
标题信息
</h3>
</div>
<div class="modal-body">
<div align="center">
{{data}}
</div>
</div>
<div class="modal-footer">
<button class="btn btn-primary" ng-click="ok()">
确认
</button>
<button class="btn btn-warning" ng-click="cancel()">
退出
</button>
</div>
</div>
</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>

View File

@ -4,54 +4,54 @@
module Kubernetes {
export var ReplicationControllerController = controller("ReplicationControllerController",
["$scope", "KubernetesModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesState,
$templateCache:ng.ITemplateCacheService, $location:ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
export var ReplicationControllerController = controller("ReplicationControllerController", ["$scope", "KubernetesModel", "KubernetesState", "$templateCache", "$location", "$routeParams", "$http", "$timeout", "KubernetesApiURL",
($scope, KubernetesModel: Kubernetes.KubernetesModelService, KubernetesState,
$templateCache: ng.ITemplateCacheService, $location: ng.ILocationService, $routeParams, $http, $timeout, KubernetesApiURL) => {
$scope.kubernetes = KubernetesState;
$scope.model = KubernetesModel;
$scope.rawModel = null
$scope.kubernetes = KubernetesState;
$scope.model = KubernetesModel;
$scope.rawModel = null
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
Kubernetes.initShared($scope, $location, $http, $timeout, $routeParams, KubernetesModel, KubernetesState, KubernetesApiURL);
$scope.itemConfig = {
properties: {
'^\\/labels$': {
template: $templateCache.get('labelTemplate.html')
$scope.itemConfig = {
properties: {
'^\\/labels$': {
template: $templateCache.get('labelTemplate.html')
}
}
};
$scope.$on('kubernetesModelUpdated', () => {
updateData();
});
$scope.$on('$routeUpdate', ($event) => {
updateData();
});
$scope.$watch('model.pods', (newValue, oldValue) => {
updateData();
}, true);
$scope.flipRaw = () => {
$scope.rawMode = !$scope.rawMode;
Core.$apply($scope);
};
updateData();
function updateData() {
if ($scope.dirty) {
return;
}
$scope.id = $routeParams["id"];
$scope.item = $scope.model.getReplicationController(KubernetesState.selectedNamespace, $scope.id);
if ($scope.item) {
$scope.rawModel = toRawYaml($scope.item);
}
Core.$apply($scope);
}
}
}
};
$scope.$on('kubernetesModelUpdated', () => {
updateData();
});
$scope.$on('$routeUpdate', ($event) => {
updateData();
});
$scope.$watch('model.pods', (newValue, oldValue) => {
updateData();
}, true);
$scope.flipRaw = () => {
$scope.rawMode = !$scope.rawMode;
Core.$apply($scope);
};
updateData();
function updateData() {
if ($scope.dirty) {
return;
}
$scope.id = $routeParams["id"];
$scope.item = $scope.model.getReplicationController(KubernetesState.selectedNamespace, $scope.id);
if ($scope.item) {
$scope.rawModel = toRawYaml($scope.item);
}
Core.$apply($scope);
}
}]);
]);
}

View File

@ -166,6 +166,7 @@ module System {
});
}
//boolean选择条件是/否
function booleanChoose() {
return [{ id: '是', title: '是' }, { id: '否', title: '否' }];