mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 05:13:25 +08:00
routine update
This commit is contained in:
parent
0667c04a40
commit
f3bc5fbfa5
@ -33,6 +33,11 @@ namespace OpenAuth.App
|
||||
Repository.Delete(u => ids.Contains(u.Id));
|
||||
}
|
||||
|
||||
public T Get(string id)
|
||||
{
|
||||
return Repository.FindSingle(u => u.Id == id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 如果一个类有层级结构(树状),则修改该节点时,要修改该节点的所有子节点
|
||||
/// //修改对象的级联ID,生成类似XXX.XXX.X.XX
|
||||
|
@ -13,14 +13,6 @@ namespace OpenAuth.App
|
||||
public class FlowSchemeApp :BaseApp<FlowScheme>
|
||||
{
|
||||
|
||||
|
||||
|
||||
public FlowScheme GetEntity(string keyValue)
|
||||
{
|
||||
return UnitWork.FindSingle<FlowScheme>(u => u.Id == keyValue);
|
||||
}
|
||||
|
||||
|
||||
public void UpdateState(string keyValue, int state)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
|
@ -31,6 +31,21 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return View();
|
||||
}
|
||||
|
||||
public string Get(string id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = new Response<FlowScheme> {Result = App.Get(id)};
|
||||
return JsonHelper.Instance.Serialize(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Result.Code = 500;
|
||||
Result.Message = ex.Message;
|
||||
}
|
||||
return JsonHelper.Instance.Serialize(Result);
|
||||
}
|
||||
|
||||
//添加或修改
|
||||
[System.Web.Mvc.HttpPost]
|
||||
public string Add(FlowScheme obj)
|
||||
|
@ -76,12 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-input-block">
|
||||
<button class="layui-btn" lay-submit>立即提交</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" lay-submit id="btnSubmit" lay-filter="formSubmit"/>
|
||||
</form>
|
||||
|
||||
<script type="text/javascript" src="/layui/layui.js"></script>
|
||||
|
@ -7,8 +7,10 @@
|
||||
$ = layui.jquery;
|
||||
var table = layui.table;
|
||||
var openauth = layui.openauth;
|
||||
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
var id = $.getUrlParam("id"); //ID
|
||||
var update = (id != '');
|
||||
var update = (id !=null && id != '');
|
||||
//提交的URL
|
||||
var url = "/FlowSchemes/Add";
|
||||
|
||||
@ -23,7 +25,8 @@
|
||||
view: { selectedMulti: true },
|
||||
check: {
|
||||
enable: true,
|
||||
chkStyle: "checkbox",
|
||||
chkStyle: "radio",
|
||||
radioType: "all", //整个节点一个分组
|
||||
chkboxType: { "Y": "", "N": "" } //去掉勾选时级联
|
||||
},
|
||||
data: {
|
||||
@ -40,13 +43,15 @@
|
||||
},
|
||||
callback: {
|
||||
onClick: function (event, treeId, treeNode) {
|
||||
var id = treeNode.Id;
|
||||
$.get("/forms/previewdata?id=" + id, function (data) {
|
||||
$.get("/forms/previewdata?id=" + treeNode.Id, function (data) {
|
||||
$("#frmPreview").html(data);
|
||||
});
|
||||
},
|
||||
onCheck: function (event, treeId, treeNode) {
|
||||
$("#FrmId").val(treeNode.Id);
|
||||
$.get("/forms/previewdata?id=" + treeNode.Id, function (data) {
|
||||
$("#frmPreview").html(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -119,12 +124,13 @@
|
||||
frmTree.load();
|
||||
|
||||
if (update) {
|
||||
$.get('/fllowschemes/get?id=' + id,
|
||||
$.getJSON('/flowschemes/get?id=' + id,
|
||||
function (data) {
|
||||
var obj = data.Result;
|
||||
url = "/FlowSchemes/Update";
|
||||
vm.$set('$data', data);
|
||||
flowDesignPanel.loadData(JSON.parse(data.SchemeContent));
|
||||
frmTree.setCheck(data.FrmId);
|
||||
vm.$set('$data', obj);
|
||||
flowDesignPanel.loadData(JSON.parse(obj.SchemeContent));
|
||||
frmTree.setCheck(obj.FrmId);
|
||||
});
|
||||
} else {
|
||||
vm.$set('$data',
|
||||
@ -135,10 +141,12 @@
|
||||
|
||||
|
||||
//提交数据
|
||||
form.on('submit()',
|
||||
form.on('submit(formSubmit)',
|
||||
function (data) {
|
||||
var content = flowDesignPanel.exportDataEx();
|
||||
if (content == -1) return false;
|
||||
if (content == -1) {
|
||||
return false; //阻止表单跳转。
|
||||
}
|
||||
var schemecontent = {
|
||||
SchemeContent: JSON.stringify(content)
|
||||
}
|
||||
@ -150,10 +158,14 @@
|
||||
layer.msg(result.Message);
|
||||
},
|
||||
"json");
|
||||
return false;
|
||||
});
|
||||
|
||||
submit = function() {
|
||||
$("#formEdit").submit();
|
||||
}
|
||||
//该函数供给父窗口确定时调用
|
||||
submit = function () {
|
||||
//只能用隐藏的submit btn才行,用form.submit()时data.field里没有数据
|
||||
$("#btnSubmit").click();
|
||||
}
|
||||
|
||||
//让层自适应iframe
|
||||
parent.layer.iframeAuto(index);
|
||||
})
|
@ -84,7 +84,6 @@
|
||||
yes: function (index, layero) {
|
||||
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
|
Loading…
Reference in New Issue
Block a user