框架重构

清除多余的业务
This commit is contained in:
橙子
2022-04-03 23:21:53 +08:00
parent f5fb2ea17b
commit f0d32af3c3
936 changed files with 213647 additions and 86 deletions

View File

@@ -0,0 +1,51 @@
var curls = {
save: _root + "codetable/SaveCommField",
getfields: _root + "system/GetCommonFiled"
}
saveFieldName.$SelectTree({
isMultiple: true,
url: curls.getfields,
maxHeight: 100,
rootIsSelect: false
})
btnCommonFiled.$Open("#divCommonFiled", {
title: "追加公共字段",
w: 600,
h: 300,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
return true;
}
},
yes: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
cfmodel.value = JSON.stringify(gridInfo);
btnProject.$Loading();
frmCommField.$Form({
url: curls.save,
callback: function (msg) {
btnProject.$CloseLoading();
if (msg.IsSuccess) {
$sugar.$CloseAll(divCommonFiled.getAttribute("dataindex"));
msg.Data.$Alert();
}
else {
"追加失败,请选择字段".$Alert();
}
}
});
} else {
"请选择一条数据".$Alert();
}
},
btn: ['追加', '关闭']
});

View File

@@ -0,0 +1,608 @@
var configs = {
url: {
Get: _root + "codetable/getcodetablelist",
getbyid: _root +"Project/GetProjectById",
Del: _root + "codetable/deleteCodetable",
GetDatabase: _root + "system/getdatabase",
Info: "/CodeTableInfo",
Save: _root + "codetable/savecodetable",
SaveImport: _root + "codetable/savecodetableimport",
Import: "/CodeTableImport",
GetTemp: _root + "system/getTemplate?type=" + hidType.value,
GetProjet: _root + "system/GetProject?typeId=" + hidType.value,
GetFileInfo: _root + "system/getFileInfo",
CreateFile: _root + "codetable/createfile",
CreateFile2: _root + "codetable/CreateFileByProjectId",
GetRazorModel: _root + "FileInfo/GetRazorModel",
UpdateEntity: _root + "codetable/UpdateEntity",
CreateTable: _root + "codetable/CreateTables",
GetProjectAll: _root + "system/GetProjectAll",
Copy: _root + "codetable/Copy",
Export: _root + "codetable/exportfile",
Tag: "/TagPropertyInfo",
SaveTagProperty: _root +"codetable/SaveTagProperty"
},
text:
{
add: "创建虚拟类",
addPath: "添加方案",
EditPath: "修改方案",
addProject: "方案生成",
addDbFirst: "导入虚拟类",
edit: "修改虚拟类",
copy: "预览复制",
tag:"配置附加属性"
},
w: {
w: "100%",
h: "100%"
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
txtDbIdName.$SelectTree({
isMultiple: false,
url: configs.url.GetDatabase,
maxHeight: 180,
rootIsSelect: false
})
txtDbIdName.onchange = function () {
btnSearch.click();
saveDbId.value = txtDbId.value;
//var tablebody = document.getElementsByClassName("fixed-table-body");
//if (tablebody.length>0)
// tablebody[0].$AddCss({ height:200})
}
btnReset.$Reset();
saveTemplateName1.$SelectTree({
isMultiple: false,
url: configs.url.GetTemp,
maxHeight: 180,
rootIsSelect: false
})
saveProjectName.$SelectTree({
isMultiple: false,
url: configs.url.GetProjet,
maxHeight: 100,
rootIsSelect: false
})
saveReferenceName.$SelectTree({
isMultiple: true,
url: configs.url.GetProjectAll,
maxHeight: 100,
rootIsSelect: false
})
saveFileInfoName.$SelectTree({
isMultiple: true,
url: configs.url.GetFileInfo,
maxHeight: 180,
rootIsSelect: false
})
saveFileInfoName.onchange = function () {
var value = saveFileInfo.value;
if (value != null && value != "") {
var ajaxParam = {
data: { id: value },
callback: function (msg) {
if (msg.IsSuccess)
{
saveFileModel.value = msg.Data;
}
else {
msg.Data.$Alert();
}
}
};
configs.url.GetRazorModel.$Ajax(ajaxParam);
}
else
{
saveFileModel.value = "[{ \"name\":\"命名空间\"}]";
}
}
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
url: configs.url.Info,
validate: function () {
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
}
else {
return true;
}
},
yes: function () {
var data = document.getElementsByTagName("iframe")[0].contentWindow.GetData();
data.DbId = txtDbId.value;
configs.url.Save.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"添加成功".$Alert();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(data) }
})
},
btn: ['保存', '关闭']
});
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
url: configs.url.Info,
format: function (msg) {
msg.url = configs.url.Info + "?id=" + divGrid.$GridInfo()[0].Id;
},
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
}
}
return true;
},
yes: function () {
var data = document.getElementsByTagName("iframe")[0].contentWindow.GetData();
data.DbId = txtDbId.value;
configs.url.Save.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"保存成功".$Alert();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(data) }
})
},
btn: ['保存', '关闭']
});
//打开导入
btnDbFirstAdd.$Open("#divOpen", {
validate: function () {
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
}
else {
return true;
}
},
title: configs.text.addDbFirst,
w: configs.w.w,
h: configs.w.h,
url: configs.url.Import,
format: function (msg) {
msg.url = configs.url.Import + "?dbId=" + txtDbId.value;
},
yes: function () {
btnDbFirstAdd.$Loading();
var data = document.getElementsByTagName("iframe")[0].contentWindow.GetData();
configs.url.SaveImport.$Ajax({
callback: function (msg) {
btnDbFirstAdd.$CloseLoading();
if (msg.IsSuccess) {
"添加成功".$Alert();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "dbid": txtDbId.value, "model": JSON.stringify(data) }
})
},
btn: ['导入', '关闭']
})
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})
btnTableToEntity.onclick = function () {
btnTableToEntity.$Loading();
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.UpdateEntity.$Ajax({
callback: function (msg) {
btnTableToEntity.$CloseLoading();
if (msg.IsSuccess) {
"更新成功".$Alert();
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo), dbid: txtDbId.value}
})
} else {
"请选择一条数据".$Alert();
btnTableToEntity.$CloseLoading();
}
}
btnTable.onclick = function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
btnTable.$Loading();
configs.url.CreateTable.$Ajax({
callback: function (msg) {
btnTable.$CloseLoading();
if (msg.IsSuccess) {
"更新成功".$Alert();
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo), dbid: txtDbId.value }
})
} else {
"请选择一条数据".$Alert();
btnTable.$CloseLoading();
}
}
btnPath.$Open("#divPath", {
title: configs.text.addPath,
w: 600,
h: 600,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
saveProjentName.value = "";
saveTemplateId1.value = "";
saveTemplateName1.value = "";
saveFileModel.value = "[{ \"name\":\"命名空间\"}]";
SaveId.value = "";
saveFileInfoName.value = "";
saveFileInfo.value = "";
saveReferenceName.value = "";
saveReference.value = "";
return true;
}
},
yes: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
SaveTable1.value = JSON.stringify(gridInfo);
btnPath.$Loading();
frmPathSave.$Form({
url: configs.url.CreateFile,
callback: function (msg) {
btnPath.$CloseLoading();
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
saveProjectName.$RestSelectTree({ url: configs.url.GetProjet })
$sugar.$Validate("clear");
msg.Message.$Alert();
if (msg.IsSuccess)
{
$sugar.$CloseAll(divPath.getAttribute("dataindex"));
}
}
}
});
} else {
"请选择一条数据".$Alert();
}
},
btn: ['创建方案', '关闭']
});
btnPathEdit.$Open("#divPath", {
title: configs.text.EditPath,
w: 600,
h: 600,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else if (saveProjectName.value == "") {
"请选择方案".$Alert();
return false;
} else {
(configs.url.getbyid + "?id=" + saveProjectId.value).$Ajax({
callback: function (msg) {
frmPathSave.$FillControls(msg.Data);
saveTemplateName1.$SelectTree("bind");
saveFileInfoName.$SelectTree("bind");
saveReferenceName.$SelectTree("bind");
}
})
return true;
}
},
yes: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
SaveTable1.value = JSON.stringify(gridInfo);
btnPath.$Loading();
frmPathSave.$Form({
url: configs.url.CreateFile,
callback: function (msg) {
btnPath.$CloseLoading();
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
saveProjectName.$RestSelectTree({ url: configs.url.GetProjet })
$sugar.$Validate("clear");
msg.Message.$Alert();
if (msg.IsSuccess) {
$sugar.$CloseAll(divPath.getAttribute("dataindex"));
}
}
}
});
} else {
"请选择一条数据".$Alert();
}
},
btn: ['修改方案', '关闭']
});
btnProject.$Open("#divProject", {
title: configs.text.addProject,
w: 600,
h: 300,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
return true;
}
},
yes: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
SaveTable2.value = JSON.stringify(gridInfo);
btnProject.$Loading();
frmProjectSave.$Form({
url: configs.url.CreateFile2,
callback: function (msg) {
btnProject.$CloseLoading();
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Message.$Alert();
}
}
});
} else {
"请选择一条数据".$Alert();
}
},
btn: ['生成方案', '关闭']
});
btnCopy.$Open("#divProject", {
title: configs.text.copy,
w: 600,
h: 300,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
return true;
}
},
yes: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
SaveTable2.value = JSON.stringify(gridInfo);
btnProject.$Loading();
frmProjectSave.$Form({
url: configs.url.Copy,
callback: function (msg) {
btnProject.$CloseLoading();
if (msg.IsSuccess) {
$sugar.$CloseAll(divProject.getAttribute("dataindex"));
btnCopyHide.click();
}
else
{
msg.Data.$Alert();
}
}
});
} else {
"请选择一条数据".$Alert();
}
},
btn: ['预览', '关闭']
});
btnCopyHide.$Open("#divCopy", {
title: configs.text.copy,
w: 1000,
h: 600,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
}
else {
btnCopy.$Loading();
frmProjectSave.$Form({
url: configs.url.Copy,
callback: function (msg) {
btnCopy.$CloseLoading();
txtCopy.value = msg.Data;
}
});
return true;
}
},
yes: function () {
"请手动复制".$Alert();
},
btn: ['预览', '关闭']
});
btnExcel.onclick = function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
btnExcel.$Loading();
configs.url.Export.$Ajax({
callback: function (msg) {
btnExcel.$CloseLoading();
if (msg.IsSuccess) {
"已经保存到根目录Excel文件夹".$Alert();
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo), dbid: txtDbId.value }
})
} else {
"请选择一条数据".$Alert();
btnExcel.$CloseLoading();
}
}
//配置附加属性
btnTagProperty.$Open("#divOpen", {
validate: function () {
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
}
else {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0)
{
"请选择一条记录".$Alert();
}
return true;
}
},
title: configs.text.tag,
w: configs.w.w,
h: configs.w.h,
url: configs.url.Tag,
format: function (msg) {
msg.url = configs.url.Tag + "?tableid=" + divGrid.$GridInfo()[0].Id;
},
yes: function () {
btnTagProperty.$Loading();
var data = document.getElementsByTagName("iframe")[0].contentWindow.GetData();
configs.url.SaveTagProperty.$Ajax({
callback: function (msg) {
btnTagProperty.$CloseLoading();
if (msg.IsSuccess) {
"保存成功".$Alert();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "dbid": txtDbId.value, "model": JSON.stringify(data) }
})
},
btn: ['保存', '关闭']
})

View File

@@ -0,0 +1,30 @@
var configs = {
url: {
Get: _root + "DbTable/GetTableList?dbid=" + "dbId".$QueryString(),
}
};
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
//btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
//btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
function GetData()
{
var gridInfo = divGrid.$GridInfo();
return gridInfo;
}

View File

@@ -0,0 +1,142 @@
//全局变量
var mynewtable;
var selectTypeData;
var data = {
Columns:
[
["Id", "Id", "", "编号", 1, 1, 1]
]
};
//初始化方法
InitEelement();
InitEevent();
for (var i = 0; i < 8; i++) {
data.Columns.push([]);
}
//业务方法
function GetData() {
var json = {
"ClassName": $("#txtClassName").val(),
"TableName": $("#txtTableName").val(),
"Description": $("#txtDesc").val(),
"ColumnInfoList": []
};
var columns = mynewtable.getData();
if (columns != null) {
$.each(columns, function (i, v) {
if (v.length >= 7) {
var id = v[0];
var propertyName = v[1];
var fieldName = v[2];
var ctype = v[3];
var desc = v[4];
var required = v[5];
var isPk = v[6];
var isIdentity = v[7];
json.ColumnInfoList.push({
ClassProperName: propertyName,
DbColumnName: fieldName,
Required: required,
IsIdentity: isIdentity,
IsPrimaryKey: isPk,
Description: desc,
CodeType: ctype,
Id:id
});
}
})
}
return json;
}
function InitEelement() {
mynewtable = $('#examplex').editTable({
field_templates: {
'checkbox': {
html: '<input type="checkbox"/>',
getValue: function (input) {
return $(input).is(':checked');
},
setValue: function (input, value) {
if (value) {
return $(input).attr('checked', true);
}
return $(input).removeAttr('checked');
}
},
'no': {
html: '<input class="code_number" readonly type="textbox"/>',
getValue: function (input) {
return $(input).val();
},
setValue: function (input, value) {
return $(input).val(value);
}
},
'textarea': {
html: '<textarea/>',
getValue: function (input) {
return $(input).val();
},
setValue: function (input, value) {
return $(input).text(value);
}
},
'select': {
html: '<select class="selCstype"><option class="option_init"></option></select>',
getValue: function (input) {
return $(input).val();
},
setValue: function (input, value) {
var select = $(input);
select.find('option').filter(function () {
return $(this).val() == value;
}).attr('selected', true);
return select;
}
}
},
row_template: ['no','text', 'text', 'select', 'text', 'checkbox', 'checkbox', 'checkbox'],
headerCols: ['编号','实体属性', '数据字段(可不填)', "类型", '备注', '必填', '主键', '自增'],
first_row: false,
data: data.Columns,
tableClass: 'inputtable custom'
});
var ajaxParam = {
callback: function (msg) {
$(".selCstype").each(function () {
var th = $(this);
th.html("");
selectTypeData = msg.Data;
$.each(msg.Data, (function (i, v) {
th.append("<option>" + v.title + "</option>");
}));
});
}
};
(_root + "system/getdatatype").$Ajax(ajaxParam);
}
function InitEevent() {
$("#txtClassName").blur(function () {
var th = $(this);
var thVal = th.val();
var table = $("#txtTableName");
var tableValue = table.val();
if (tableValue == null || tableValue == "") {
table.val(thVal);
}
});
}
//定时方法
setInterval(function () {
var size = $(".option_init").size();
if (size > 0) {
var sel = $(".option_init").parent();
sel.html("");
$.each(selectTypeData, (function (i, v) {
sel.append("<option>" + v.title + "</option>");
}));
}
}, 600);

View File

@@ -0,0 +1,157 @@
//全局变量
var configs = { url: {Get: _root + "codetable/GetCodeTableInfo",}}
var mynewtable;
var data = {Columns:[]};
var selectTypeData;
var selectOptions;
var ajaxParam = {
callback: function (msg) {
$.each(msg.Data, (function (i, v) {
selectOptions+=("<option>" + v.title + "</option>");
}));
configs.url.Get.$Ajax({
data: { id: $sugar.$GetUrlParam("id") },
callback: function (msg) {
BindData(msg);
InitEelement();
InitEevent();
}
})
}
};
//页面初始化方法
(_root + "system/getdatatype").$Ajax(ajaxParam);
//业务方法
function GetData() {
var json = {
"ClassName": $("#txtClassName").val(),
"TableName": $("#txtTableName").val(),
"Description": $("#txtDesc").val(),
"Id": $("#txtId").val(),
"ColumnInfoList": []
};
var columns = mynewtable.getData();
if (columns != null) {
$.each(columns, function (i, v) {
if (v.length >= 7) {
var id = v[0];
var propertyName = v[1];
var fieldName = v[2];
var ctype = v[3];
var desc = v[4];
var required = v[5];
var isPk = v[6];
var isIdentity = v[7];
json.ColumnInfoList.push({
ClassProperName: propertyName,
DbColumnName: fieldName,
Required: required,
IsIdentity: isIdentity,
IsPrimaryKey: isPk,
Description: desc,
CodeType: ctype,
Id:id
});
}
})
}
return json;
}
function BindData(msg)
{
$("#txtClassName").val(msg.Data.ClassName);
$("#txtTableName").val(msg.Data.TableName);
$("#txtDesc").val(msg.Data.Description);
$("#txtId").val(msg.Data.Id);
$.each(msg.Data.ColumnInfoList, function (i, v) {
var row = [];
row.push(v.Id);
row.push(v.ClassProperName);
row.push(v.DbColumnName);
row.push(v.CodeType);
row.push(v.Description);
row.push(v.Required);
row.push(v.IsPrimaryKey);
row.push(v.IsIdentity);
data.Columns.push(row);
});
}
function InitEelement() {
mynewtable = $('#examplex').editTable({
field_templates: {
'checkbox': {
html: '<input type="checkbox"/>',
getValue: function (input) {
return $(input).is(':checked');
},
setValue: function (input, value) {
if (value) {
return $(input).attr('checked', true);
}
return $(input).removeAttr('checked');
}
},
'no': {
html: '<span/>',
getValue: function (input) {
return $(input).text();
},
setValue: function (input, value) {
return $(input).html(value);
}
},
'textarea': {
html: '<textarea/>',
getValue: function (input) {
return $(input).val();
},
setValue: function (input, value) {
return $(input).text(value);
}
},
'select': {
html: '<select class="selCstype">'+selectOptions+'</select>',
getValue: function (input) {
return $(input).val();
},
setValue: function (input, value) {
var select = $(input);
select.find('option').filter(function () {
return $(this).val() == value;
}).attr('selected', true);
return select;
}
}
},
row_template: ['no','text', 'text', 'select', 'text', 'checkbox', 'checkbox', 'checkbox'],
headerCols: ['编号','实体属性', '数据字段(可不填)', "类型", '备注', '必填', '主键', '自增'],
first_row: false,
data: data.Columns,
tableClass: 'inputtable custom'
});
}
function InitEevent() {
$("#txtClassName").blur(function () {
var th = $(this);
var thVal = th.val();
var table = $("#txtTableName");
var tableValue = table.val();
if (tableValue == null || tableValue == "") {
table.val(thVal);
}
});
}
//定时方法
setInterval(function () {
var size = $(".option_init").size();
if (size > 0) {
var sel = $(".option_init").parent();
sel.html("");
$.each(selectTypeData, (function (i, v) {
sel.append("<option>" + v.title + "</option>");
}));
}
}, 600);

View File

@@ -0,0 +1,109 @@
var configs = {
url: {
Get: _root + "codetable/getcodetypelist",
SaveSystem: _root + "codetable/savecodetype"
},
text:
{
add: "添加类型"
},
w: {
w: 750,
h:400
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
btnReset.$Reset();
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
validate: function () {
frmSave.$ClearControls();
saveName.removeAttribute("readOnly");
saveDbType.removeAttribute("readOnly")
saveCSharepType.removeAttribute("readOnly")
return true;
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['添加', '关闭']
});
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
gridInfo = gridInfo[0];
frmSave.$FillControls(gridInfo);
saveName.setAttribute("readOnly", true);
saveDbType.setAttribute("readOnly", true)
saveCSharepType.setAttribute("readOnly", true)
return true;
}
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['保存', '关闭']
});

View File

@@ -0,0 +1,138 @@
var configs = {
url: {
Get: _root + "CommonField/GetCommonFieldList",
Del: _root + "CommonField/DeleteCommonField",
SaveSystem: _root + "CommonField/SaveCommonField",
GetDbType: _root +"system/getdatatype?type=0"
},
text:
{
add: "添加公共字段",
edit:"修改公共字段"
},
w: {
w: 600,
h:500
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
saveCodeTypeName.$SelectTree({
isMultiple: false,
url: configs.url.GetDbType,
maxHeight: 180,
rootIsSelect: false
})
btnReset.$Reset();
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
validate: function () {
frmSave.$ClearControls();
return true;
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['添加', '关闭']
});
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
gridInfo = gridInfo[0];
frmSave.$FillControls(gridInfo);
saveCodeTypeName.$SelectTree("bind");
return true;
}
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['保存', '关闭']
});
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else
{
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})

View File

@@ -0,0 +1,50 @@
.table td, .table th {
padding: 2px 5px
}
.table-bordered td, .table-bordered th {
border-right: 0px solid #dee2e6;
border-left: 0px solid #dee2e6;
}
.btn-many {
padding-left: 5px;
}
.btn-many button {
margin: -0px;
border:0;
padding-left:12px;
padding-right:12px;
}
#frmProjectSave .btn {
background: #f3adad !important;
border:0 !important;
font-size:14px;
padding:6px 8px !important
}
.layui-layer-btn {
font-size:15px;
padding-top:0 !important;
}
.layui-layer-btn a {
font-size: 15px;
}
#divProject .comboTreeDropDownContainer {
height:100px
}
#frmPathSave .comboTreeDropDownContainer {
height: 100px
}
@media (max-width: 1270px)
{
.btn-many {
max-width:500px !important
}
.btn-many button{
margin-bottom:5px;
}
}

View File

@@ -0,0 +1,31 @@
#Frm_table .form-group {
margin-right: 10px;
}
#divBtn .btn {
font-size: 14px !important;
padding: 3px 4px;
background: #87979e;
border: #87979e;
}
.x_title h2 {
font-size: 16px;
font-weight: 400;
margin-top: 20px !important;
}
.t1 h2 {
font-size: 16px;
font-weight: 400;
margin-top: 5px !important;
}
.code_number {
width: 50px;
border: 0;
}
.selCstype {
border: none
}

View File

@@ -0,0 +1 @@


View File

@@ -0,0 +1,177 @@
var configs = {
url: {
Get: _root + "database/getdatabase",
Del: _root + "database/deletedatabase",
SaveSystem: _root + "database/savedatabase",
GetDbType: _root+"system/getdbtype"
},
text:
{
add: "添加数据库连接",
edit:"修改数据库连接"
},
w: {
w: 600,
h:300
}
};
divFrom.$Form({
before: function () {
btnSearch.$Loading();
},
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
btnSearch.$CloseLoading();
}
})
btnSearch.$Button({
before: function () {
btnSearch.$Loading();
},
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
btnSearch.$CloseLoading();
}
});
saveDbTypeName.$SelectTree({
isMultiple: false,
url: configs.url.GetDbType,
maxHeight: 180,
rootIsSelect: false
})
btnReset.$Reset();
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
validate: function () {
frmSave.$ClearControls();
return true;
},
yes: function () {
btnAdd.$Loading();
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
btnAdd.$CloseLoading();
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['添加', '关闭']
});
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
gridInfo = gridInfo[0];
frmSave.$FillControls(gridInfo);
saveDbTypeName.value = saveDbType.value;
return true;
}
},
yes: function () {
btnEdit.$Loading();
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
btnEdit.$CloseLoading();
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['保存', '关闭']
});
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else
{
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})
saveDbTypeName.change = function () {
if (saveDbTypeName.value == "SqlServer")
{
saveConnection.value = "server=.;uid=sa;pwd=sasa;database=SQLSUGAR4XTEST";
}
if (saveDbTypeName.value == "MySql")
{
saveConnection.value = "server=localhost;Database=SqlSugar4xTest;Uid=root;Pwd=haosql";
}
if (saveDbTypeName.value == "Sqlite")
{
saveConnection.value = "DataSource=C:\\Demo\\SqlSugar4xTest.sqlite";
}
if (saveDbTypeName.value == "Oracle") {
saveConnection.value = "Data Source=localhost/orcl;User ID=system;Password=haha;";
}
if (saveDbTypeName.value == "PostgreSQL") {
saveConnection.value = "PORT=5432;DATABASE=SqlSugar4xTest;HOST=localhost;PASSWORD=haosql;USER ID=postgres";
}
if (saveDbTypeName.value == "Dm") {
saveConnection.value = " Server=localhost; User Id=SYSDBA; PWD=SYSDBA;DATABASE=新DB";
}
if (saveDbTypeName.value == "Kdbndp") {
saveConnection.value = " Server=127.0.0.1;Port=54321;UID=SYSTEM;PWD=system;database=SQLSUGAR4XTEST1";
}
}

View File

@@ -0,0 +1,38 @@
btnEdit2.onclick = function ()
{
btnEdit.click();
}
btnDel2.onclick = function () {
btnDel.click();
}
btnAddView.$Open("#divView", {
title: "创建类",
w: 600,
h: 350,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (txtDbId.value == null || txtDbId.value == "" || txtDbId.value == "0") {
"请选择数据库".$Alert();
return false;
} else {
return true;
}
},
yes: function () {
btnProject.$Loading();
hidviewdbid.value = txtDbId.value;
frmView.$Form({
url: _root + "codetable/CreateTableByView",
callback: function (msg) {
btnProject.$CloseLoading();
if (msg.IsSuccess) {
//ClassName.value = viewclassname.value;
$sugar.$CloseAll(divView.getAttribute("dataindex"));
btnSearch.click();
}
msg.Data.$Alert();
}
});
},
btn: ['创建类', '关闭']
});

View File

@@ -0,0 +1,131 @@
var configs = {
url: {
Get: _root + "fileinfo/getfileinfolist",
Del: _root + "fileinfo/deletefileinfo",
SaveSystem: _root + "fileinfo/savefileinfo",
getNetVersion: _root +"system/getgoodnetversion"
},
text:
{
add: "添加文件",
edit:"修改文件"
},
w: {
w: 600,
h:550
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
btnReset.$Reset();
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
validate: function () {
frmSave.$ClearControls();
return true;
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['添加', '关闭']
});
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
gridInfo = gridInfo[0];
frmSave.$FillControls(gridInfo);
return true;
}
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['保存', '关闭']
});
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else
{
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})

View File

@@ -0,0 +1,74 @@
var configs = {
url: {
Get: _root + "Project/getProjectlist",
Del: _root + "Project/deleteProject",
SaveSystem: _root + "Project/saveProject",
GetType: _root + "system/GetTemplateType"
},
text:
{
add: "添加方案",
edit: "修改方案"
},
w: {
w: 600,
h:450
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
txtModelIdName.$SelectTree({
isMultiple: false,
url: configs.url.GetType,
maxHeight: 180,
rootIsSelect: true
})
btnReset.$Reset();
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})

View File

@@ -0,0 +1,139 @@
var configs = {
url: {
Get: _root + "TagProperty/GetTagPropertyList",
Del: _root + "TagProperty/DeleteTagProperty",
SaveSystem: _root + "TagProperty/SaveTagProperty",
// GetDbType: _root + "system/GetTagPropertyType"
},
text:
{
add: "添加扩展属性",
edit: "修改扩展属性"
},
w: {
w: 1200,
h: 640
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
//saveTagPropertyTypeName.$SelectTree({
// isMultiple: false,
// url: configs.url.GetDbType,
// maxHeight: 180,
// rootIsSelect: false
//})
btnReset.$Reset();
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
validate: function () {
frmSave.$ClearControls();
return true;
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['添加', '关闭']
});
//btnParameter.$Open("#divRemark", {
// title: "参数说明",
// w: 550,
// h: configs.w.h,
//})
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
gridInfo = gridInfo[0];
frmSave.$FillControls(gridInfo);
return true;
}
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['保存', '关闭']
});
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else {
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})

View File

@@ -0,0 +1,141 @@
var configs = {
url: {
Get: _root + "Template/GetTemplateList",
Del: _root + "Template/DeleteTemplate",
SaveSystem: _root + "Template/SaveTemplate",
GetDbType: _root +"system/GetTemplateType"
},
text:
{
add: "添加模版",
edit:"修改模版"
},
w: {
w: 1200,
h:570
}
};
divFrom.$Form({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
})
btnSearch.$Button({
url: configs.url.Get,
callback: function (msg) {
msg.Data.Dblfunc = function () {
btnEdit.click();
};
divGrid.$Grid(msg.Data);
}
});
saveTemplateTypeName.$SelectTree({
isMultiple: false,
url: configs.url.GetDbType,
maxHeight: 180,
rootIsSelect: false
})
btnReset.$Reset();
btnAdd.$Open("#divOpen", {
title: configs.text.add,
w: configs.w.w,
h: configs.w.h,
validate: function () {
frmSave.$ClearControls();
return true;
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['添加', '关闭']
});
btnParameter.$Open("#divRemark", {
title:"参数说明",
w: 550,
h: configs.w.h,
})
btnEdit.$Open("#divOpen", {
title: configs.text.edit,
w: configs.w.w,
h: configs.w.h,
validate: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length == 0) {
"请选择记录".$Alert();
return false;
} else {
gridInfo = gridInfo[0];
frmSave.$FillControls(gridInfo);
return true;
}
},
yes: function () {
frmSave.$Form({
url: configs.url.SaveSystem,
callback: function (msg) {
if (msg.IsKeyValuePair) {
$sugar.$Validate(msg.Data, "save");
} else {
$sugar.$Validate("clear");
msg.Data.$Alert();
if (msg.IsSuccess) {
btnSearch.click();
$sugar.$CloseAll(divOpen.getAttribute("dataindex"));
}
}
}
});
},
btn: ['保存', '关闭']
});
btnDel.$Confirm({
title: "是否删除记录",
ok: function () {
var gridInfo = divGrid.$GridInfo();
if (gridInfo.length > 0) {
configs.url.Del.$Ajax({
callback: function (msg) {
if (msg.IsSuccess) {
"删除成功".$Alert();
btnSearch.click();
}
else
{
msg.Data.$Alert();
}
},
data: { "model": JSON.stringify(gridInfo) }
})
} else {
"请选择一条数据".$Alert();
}
}
})