Commit 577c0ea4 by 陈玉兰

提交

parent 5278200a
......@@ -79,7 +79,7 @@ function rowstyler(index,row){
}
}
//展示列表
datagrid("list", ls_title, gaowj.WEB_APP_NAME + "/formmodelData_list", queryData, is_column, 60, 80);
datagrid("list", ls_title, gaowj.WEB_APP_NAME + "/formmodelData_list?tableId="+$.getUrlParam("tableId"), queryData, is_column, 60, 80);
/****/
......@@ -104,15 +104,14 @@ function formatMenu(value, data,index) {
//上浮横向菜单集里的具体菜单项(需更改)
function getOptionMenu(data,index){
var returnData= "<span class=\"icon-edit\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"editRow('"
+ index + "')\">编辑</a> | <span class=\"icon-ext-file\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deploy('"
+ index + "')\">部署</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">编辑</a> | <span class=\"icon-clear\" style=\"padding-left:20px;*width:20px;\"></span><a href=\"javascript:void(0);\" onclick=\"deleteRow('"
+ index + "')\">删除</a>";
return returnData;
}
//返回菜单集的菜单个数(需更改)
function getOptionMenuCount(){
var is_menu_count = 3;
var is_menu_count = 2;
return is_menu_count;
}
......@@ -136,14 +135,14 @@ function addRow(){
}
//加载增加子页面成功后的回调
function addUrlOnloadCallback(is_row){
is_row.MODEL_CONTENT='';
initUeditor(is_row);
}
//保存
function insertData(is_entity){
console.log(is_entity);
var tableId = $.getUrlParam("tableId");
is_entity.FIELD_TABLE_ID=tableId;
is_entity.FIELD_FLAG=is_entity.FLAG;
is_entity.FIELD_MODEL_CONTENT=is_entity.editorValue;
var v_result = formmodelModule.act.insertFormModel(is_entity);
$('#list').datagrid('reload');
......@@ -161,12 +160,17 @@ function editRow(index) {
//加载修改子页面成功后的回调
function updateUrlOnloadCallback(is_row){
var flag = is_row.FLAG;
$('input[name="FLAG"]').each(function(index,element){
if($(element).val()==flag){
$(element).prop('checked',true);
}
})
$('input[name="FLAG"]').attr("checked",'');
initUeditor(is_row);
}
function initUeditor(){
function initUeditor(is_row){
UE.delEditor('ueditId');
var ue=UE.getEditor('ueditId',{});
ue.ready(function() {
......@@ -177,7 +181,9 @@ function initUeditor(){
//保存
function updateData(is_entity){
v_result = procdefinitionModule.act.updateProcdefinition(is_entity);
is_entity.FIELD_MODEL_CONTENT=is_entity.editorValue;
is_entity.FIELD_FLAG=is_entity.FLAG;
v_result = formmodelModule.act.updateFormModel(is_entity);
$('#list').datagrid('reload');
return v_result;
}
......@@ -261,27 +267,10 @@ function refreshRow(){
$("#formmodelTab_searchForm").form('reset');
searchRow();
}
/****/
/**
* 序号:9
* 功能:查询
* 参数:
* 说明:
* 作者:高伟杰
* 时间:2016-01-22
* 单位:宁波金网
* 备注:需更改
**/
function searchRow(){
var v_query = $("#formmodelTab_searchForm").getFormVal();
$('#list').datagrid('load',v_query);
}
function design(index){
$('#list').datagrid('selectRow',index);
var is_row = $('#list').datagrid('getSelections');
$('#list').datagrid('clearSelections');
window.open('http://localhost:92/process-editor/modeler.jsp?modelId=' + is_row[0].ID);
}
......@@ -7,21 +7,20 @@
<span>表名:</span>
</td>
<td style="width: 30%">
<input class="easyui-textbox" id="TABLE_NAME" name="FIELD_TABLE_NAME" value="${is_row.TABLE_NAME}" style="width:200px" />
<input class="easyui-textbox" required="required" id="TABLE_NAME" name="FIELD_TABLE_NAME" value="${is_row.TABLE_NAME}" style="width:200px" />
</td>
<td style="width: 15%;" class="tableStyleLable">
<span>同步数据库状态:</span>
</td>
<td style="width: 30%">
<span id="IS_DBSYNCH" name="FIELD_IS_DBSYNCH" value="0"></span>
<input id="IS_DBSYNCH" name="FIELD_IS_DBSYNCH" value="0"/>
</td>
</tr>
<tr>
<td class="tableStyleLable">
<span>描述:</span>
</td>
<td colspan="3">
<input class="easyui-textbox" id="CONTENT" name="FIELD_CONTENT" value="${is_row.CONTENT}" style="width:570px" />
<input class="easyui-textbox" required="required" id="CONTENT" name="FIELD_CONTENT" value="${is_row.CONTENT}" style="width:570px" />
</td>
</tr>
</table>
......
......@@ -39,9 +39,18 @@ var ls_ywlx = 'YBYW';
* 单位:宁波金网
* 备注:需更改
**/
var is_dbsynch_data=[{CODE_ID:'0',CODE_NAME:'未同步'},{CODE_ID:'1',CODE_NAME:'已同步'}];
var is_dbsynch_data=[{CODE_ID:'0',CODE_NAME:'不同步'},{CODE_ID:'1',CODE_NAME:'同步'}];
var type_data=[{CODE_ID:'varchar',CODE_NAME:'varchar'},{CODE_ID:'int',CODE_NAME:'int'},{CODE_ID:'date',CODE_NAME:'date'}];
var type_data=[
{CODE_ID:'varchar',CODE_NAME:'varchar'},
{CODE_ID:'int',CODE_NAME:'int'},
{CODE_ID:'double',CODE_NAME:'double'},
{CODE_ID:'float',CODE_NAME:'float'},
{CODE_ID:'blob',CODE_NAME:'blob'},
{CODE_ID:'bigdecimal',CODE_NAME:'bigdecimal'},
{CODE_ID:'text',CODE_NAME:'text'},
{CODE_ID:'datetime',CODE_NAME:'datetime'},
{CODE_ID:'date',CODE_NAME:'date'}];
var list_default_field=[{
FIELD_NAME:'uuid',
......@@ -52,7 +61,9 @@ var list_default_field=[{
CONTENT:'主键UUID',
FIELD_DEFAULT:'',
TYPE:'varchar',
IS_NULL:false
FIELD_WIDTH:20,
IS_NULL:false,
IS_SHOW_LIST:false
},{
FIELD_NAME:'create_id',
LENGTH:50,
......@@ -62,7 +73,9 @@ var list_default_field=[{
CONTENT:'新建人',
FIELD_DEFAULT:'',
TYPE:'varchar',
IS_NULL:true
FIELD_WIDTH:20,
IS_NULL:true,
IS_SHOW_LIST:false
},{
FIELD_NAME:'create_time',
LENGTH:0,
......@@ -72,7 +85,9 @@ var list_default_field=[{
CONTENT:'新建时间',
FIELD_DEFAULT:'',
TYPE:'date',
IS_NULL:true
FIELD_WIDTH:20,
IS_NULL:true,
IS_SHOW_LIST:false
},{
FIELD_NAME:'update_id',
LENGTH:50,
......@@ -82,7 +97,9 @@ var list_default_field=[{
CONTENT:'更新人',
FIELD_DEFAULT:'',
TYPE:'varchar',
IS_NULL:true
FIELD_WIDTH:20,
IS_NULL:true,
IS_SHOW_LIST:false
},{
FIELD_NAME:'update_time',
LENGTH:0,
......@@ -92,7 +109,9 @@ var list_default_field=[{
CONTENT:'更新时间',
FIELD_DEFAULT:'',
TYPE:'date',
IS_NULL:true
FIELD_WIDTH:20,
IS_NULL:true,
IS_SHOW_LIST:false
}];
var tr=['<tr>',
......@@ -104,9 +123,11 @@ var tr=['<tr>',
' <td>@{point}</td>',
' <td>@{field_default}</td>',
' <td>@{type}</td>',
' <td>@{field_width}</td>',
' <td>@{is_key}</td>',
' <td>@{is_null}</td>',
' <td>@{order_num}</td>',
' <td>@{is_show_list}</td>',
'</tr>'].join("");
/****/
......@@ -122,11 +143,17 @@ var tr=['<tr>',
* 备注:需更改
**/
//定义grid列表
var ls_title="表单管理&nbsp;&nbsp;<font color='#993300'>(1、绿色表示未同步数据库&nbsp;&nbsp;2、蓝色表示已同步数据库。)</font>";
var ls_title="表单管理&nbsp;&nbsp;";
var is_column = [ [
{field : 'TABLE_NAME',title : '表名',width : 100,align : 'center'},
{field : 'CONTENT',title : '描述',width : 80,align : 'center'},
{field : 'IS_DBSYNCH',title : '是否同步到数据库',width : 100,align : 'center'},
{field : 'IS_DBSYNCH',title : '是否同步到数据库',width : 100,align : 'center',formatter:function(value,row,index){
if(value=='0'){
return "未同步";
}else{
return "同步";
}
}},
{field : 'CREATE_ID',title : '创建人员',width : 100,align : 'center'},
{field : 'CREATE_TIME',title : '创建时间',width : 100,align : 'center'},
{field : 'UPDATE_TIME',title : '更新时间',width : 100,align : 'center'},
......@@ -138,13 +165,9 @@ function dataOnLoadSuccess(){
}
//设置颜色和每行高度
function rowstyler(index,row){
if(row.STATUS == '1'){
return 'color:green;height:30px;';
}
else{
return 'color:blue;height:30px;';
}
}
//展示列表
datagrid("list", ls_title, gaowj.WEB_APP_NAME + "/formtableData_list", queryData, is_column, 60, 80);
......@@ -219,12 +242,20 @@ function initTableInsert(){
point:'小数点',
field_default:'默认值',
type:'数据类型',
field_width:'字段宽度',
is_key:'主键',
is_null:'允许空值',
order_num:'',
is_show_list:'列表显示',
})).appendTo(fieldTable);
$('#IS_DBSYNCH').html('未同步');
$('#IS_DBSYNCH').combobox({
data : is_dbsynch_data,
valueField : 'CODE_ID',
textField : 'CODE_NAME',
editable:false,
panelHeight:'auto'
});
for(var i=0;i<list_default_field.length;i++){
var tr2=tr;
......@@ -238,9 +269,11 @@ function initTableInsert(){
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />',
field_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />',
is_key:'<input type="checkbox" value="'+field.IS_KEY+'" name="LIST['+i+'].IS_KEY" '+(field.IS_KEY==true?'checked':'')+' />',
is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==false?'':'checked')+' />',
order_num:'<input class="field_order_number" type="hidden" name="LIST['+i+'].ORDER_NUM" />'
order_num:'<input class="field_order_number" type="hidden" name="LIST['+i+'].ORDER_NUM" />',
is_show_list:'<input type="checkbox" value="'+field.IS_SHOW_LIST+'" name="LIST['+i+'].IS_SHOW_LIST" '+(field.IS_SHOW_LIST==false?'':'checked')+' />'
});
$(tr2).appendTo(fieldTable);
$('input[name="LIST['+i+'].TYPE"]').combobox({
......@@ -297,9 +330,11 @@ function initTableUpdate(is_row){
point:'小数点',
field_default:'默认值',
type:'数据类型',
field_width:'字段宽度',
is_key:'主键',
is_null:'允许空值',
order_num:''
order_num:'',
is_show_list:'列表显示',
})).appendTo(fieldTable);
if(is_row.IS_DBSYNCH==0){
......@@ -319,9 +354,11 @@ function initTableUpdate(is_row){
point:'<input type="text" name="LIST['+i+'].POINT" value="'+field.POINT+'" />',
field_default:'<input type="text" name="LIST['+i+'].FIELD_DEFAULT" value="'+field.FIELD_DEFAULT+'" />',
type:'<input type="combobox" name="LIST['+i+'].TYPE" value="'+field.TYPE+'" />',
is_key:'<input type="checkbox" value="'+field.IS_KEY+'" name="LIST['+i+'].IS_KEY" '+(field.IS_KEY==true?'checked':'')+' />',
is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==false?'':'checked')+' />',
order_num:'<input class="field_order_number" type="hidden" value="'+field.ORDER_NUM+'" name="LIST['+i+'].ORDER_NUM" /><input type="hidden" value="'+field.UUID+'" name="LIST['+i+'].UUID" />'
field_width:'<input type="text" name="LIST['+i+'].FIELD_WIDTH" value="'+field.FIELD_WIDTH+'" />',
is_key:'<input type="checkbox" value="'+field.IS_KEY+'" name="LIST['+i+'].IS_KEY" '+(field.IS_KEY==1?'checked':'')+' />',
is_null:'<input type="checkbox" value="'+field.IS_NULL+'" name="LIST['+i+'].IS_NULL" '+(field.IS_NULL==0?'':'checked')+' />',
order_num:'<input class="field_order_number" type="hidden" value="'+field.ORDER_NUM+'" name="LIST['+i+'].ORDER_NUM" /><input type="hidden" value="'+field.UUID+'" name="LIST['+i+'].UUID" />',
is_show_list:'<input type="checkbox" value="'+field.IS_SHOW_LIST+'" name="LIST['+i+'].IS_SHOW_LIST" '+(field.IS_SHOW_LIST==0?'':'checked')+' />'
});
$(tr2).appendTo(fieldTable);
$('input[name="LIST['+i+'].TYPE"]').combobox({
......@@ -452,18 +489,23 @@ function addLine(){
var aa={
index:j,
opt:'<input type="checkbox" name="checkbox"/>',
field_name:'<input type="text" name="LIST['+j+'].NAME" />',
content:'<input type="text" name="LIST['+j+'].CONTENT" />',
field_name:'<input class="easyui-textbox" type="text" name="LIST['+j+'].NAME" required="true"/>',
content:'<input class="easyui-textbox" type="text" name="LIST['+j+'].CONTENT" required="required"/>',
length:'<input type="text" name="LIST['+j+'].LENGTH" value="0"/>',
point:'<input type="text" name="LIST['+j+'].POINT" value="0"/>',
point:'<input type="text" name="LIST['+j+'].POINT" value="0" />',
field_default:'<input type="text" name="LIST['+j+'].FIELD_DEFAULT" />',
type:'<input type="combobox" name="LIST['+j+'].TYPE" />',
type:'<input type="combobox" name="LIST['+j+'].TYPE" value="varchar"/>',
field_width:'<input type="text" name="LIST['+j+'].FIELD_WIDTH" value="20"/>',
is_key:'<input type="checkbox" name="LIST['+j+'].IS_KEY" />',
is_null:'<input type="checkbox" name="LIST['+j+'].IS_NULL" checked/>',
order_num:'<input class="field_order_number" type="hidden" name="LIST['+j+'].ORDER_NUM" />'
order_num:'<input class="field_order_number" type="hidden" name="LIST['+j+'].ORDER_NUM" />',
is_show_list:'<input type="checkbox" name="LIST['+j+'].IS_SHOW_LIST" />'
};
var fieldTable=$("#fieldTable");
$(replaceByJson(tr,aa)).appendTo(fieldTable);
$.parser.parse();
$('input[name="LIST['+j+'].TYPE"]').combobox({
data : type_data,
valueField : 'CODE_ID',
......
......@@ -16,4 +16,6 @@ public interface FormmodelsBusiness {
Page<Map<String, Object>> list_form_model(int pageNo, int pageSize, Map<String, Object> query)throws BusinessException ;
void delete_form_model(List<String> list)throws BusinessException;
void update_form_model(Map<String, Object> entity) throws BusinessException;
}
......@@ -2,10 +2,12 @@ package com.gaowj.business.formmodels;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.apache.commons.lang.StringUtils;
import org.apache.ibatis.session.RowBounds;
import com.gaowj.business.FormmodelsBusiness;
......@@ -93,4 +95,37 @@ public class FormmodelsBusinessImpl implements FormmodelsBusiness {
formmodelsDAO.delete_form_models(list);
}
@Override
public void update_form_model(Map<String, Object> entity)
throws BusinessException {
// TODO Auto-generated method stub
if (entity.keySet() != null) {
entity.put("UPDATE_TIME", new Date());
entity.put("UPDATE_ID", SessionUtil.getCode());
convertEntity(entity);
formmodelsDAO.update_form_models(entity);
}
}
private void convertEntity(Map<String, Object> entity, String... ignoreKeys) {
List<Map<String, Object>> updateList = new ArrayList<Map<String, Object>>();
Set<String> key = entity.keySet();
// 将map集合中的key和value 取出来分别放到list集合里
for (String str : key) {
Map<String, Object> updateMap = new HashMap<String, Object>();
for (String k : ignoreKeys) {
if (StringUtils.equalsIgnoreCase("UUID", str))
continue;
}
updateMap.put("key", str);
updateMap.put("value", entity.get(str));
updateList.add(updateMap);
}
entity.put("info", updateList);
}
}
......@@ -15,7 +15,6 @@ import com.gaowj.business.exception.BusinessException;
import com.gaowj.business.util.QueryParamUtil;
import com.gaowj.business.util.RequestUtils;
import com.gaowj.business.util.Status;
import com.gaowj.util.Property;
public class actAction extends BasicAction{
......@@ -63,4 +62,18 @@ public class actAction extends BasicAction{
return "json";
}
public String updateFormModel()throws BusinessException{
FormmodelsBusiness business = BusinessManager.getBusiness(FormmodelsBusiness.class);
Map<String, Object> entity = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
try {
entity.remove("OPETYPE");
business.update_form_model(entity);
jsonObject.putAll(Status.getStatusSuccessMessage("更新成功"));
} catch (Exception e) {
jsonObject.putAll(Status.getStatusErrorMessage("更新失败"));
e.printStackTrace();
}
return "json";
}
}
......@@ -47,8 +47,10 @@ public class dataAction extends BasicAction{
public String list() throws BusinessException {
FormmodelsBusiness business = BusinessManager.getBusiness(FormmodelsBusiness.class);
Map<String, Object> query = RequestUtils.getUpdateFieldMap(request,RequestUtils.UPDATEDATAFIELDPREFIX);
String tableId = RequestUtils.getString(request, "tableId");
try {
query = QueryParamUtil.StringToDate(query);
query.put("TABLE_ID", tableId);
Page<Map<String, Object>> pageRows = business.list_form_model(page,pageSize, query);
setPageCount((pageRows.getCount() - 1) / pageSize + 1);
Map<String, Object> data = new HashMap<String, Object>();
......
......@@ -74,6 +74,7 @@ public class actAction extends BasicAction {
if(property.getCONTENT()!=null&&""!=property.getCONTENT()){
param.put("CONTENT", property.getCONTENT());
}
param.put("FIELD_WIDTH", property.getFIELD_WIDTH());
param.put("FIELD_NAME", property.getNAME());
param.put("LENGTH",property.getLENGTH() );
param.put("POINT", property.getPOINT());
......@@ -90,6 +91,11 @@ public class actAction extends BasicAction {
}else{
param.put("IS_KEY", 1);
}
if(property.getIS_SHOW_LIST().equals("")){
param.put("IS_SHOW_LIST", 0);
}else{
param.put("IS_SHOW_LIST", 1);
}
if(property.getFIELD_DEFAULT()!=null&&""!=property.getFIELD_DEFAULT()){
param.put("FIELD_DEFAULT", property.getFIELD_DEFAULT());
}
......@@ -147,6 +153,11 @@ public class actAction extends BasicAction {
}else{
param.put("IS_KEY", 1);
}
if(property.getIS_SHOW_LIST().equals("")){
param.put("IS_SHOW_LIST", 0);
}else{
param.put("IS_SHOW_LIST", 1);
}
if(property.getFIELD_DEFAULT()!=null&&""!=property.getFIELD_DEFAULT()){
param.put("FIELD_DEFAULT", property.getFIELD_DEFAULT());
}
......
......@@ -12,7 +12,8 @@ public class Property {
private String TYPE;
private Integer ORDER_NUM;
private String UUID;
private String IS_SHOW_LIST;
private String FIELD_WIDTH;
public String getIS_KEY() {
return IS_KEY;
}
......@@ -92,6 +93,22 @@ public class Property {
public void setUUID(String uUID) {
UUID = uUID;
}
public String getIS_SHOW_LIST() {
return IS_SHOW_LIST;
}
public void setIS_SHOW_LIST(String iS_SHOW_LIST) {
IS_SHOW_LIST = iS_SHOW_LIST;
}
public String getFIELD_WIDTH() {
return FIELD_WIDTH;
}
public void setFIELD_WIDTH(String fIELD_WIDTH) {
FIELD_WIDTH = fIELD_WIDTH;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment