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