mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-16 16:50:54 +08:00
check bugs
This commit is contained in:
parent
304e465b6b
commit
e00de72ffc
@ -16,9 +16,13 @@ namespace OpenAuth.App
|
||||
private static string temp_view = "<div style=\"{0}\"/>{1}</div>";
|
||||
|
||||
|
||||
public static string GetHtml(string contentData, string contentParse, string action)
|
||||
public static string GetHtml(string contentData, string contentParse,string frmData, string action)
|
||||
{
|
||||
var tableData = new Dictionary<string, Object>();//表单数据
|
||||
JObject tableData = null;//表单数据
|
||||
if (!string.IsNullOrEmpty(frmData))
|
||||
{
|
||||
tableData = JsonHelper.Instance.Deserialize<JObject>(frmData);
|
||||
}
|
||||
|
||||
string html = contentParse;
|
||||
foreach (var json in contentData.ToList<JObject>())
|
||||
@ -67,44 +71,67 @@ namespace OpenAuth.App
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 功能: html
|
||||
*/
|
||||
public static string GetHtml(FormResp form, string action){
|
||||
|
||||
/// <summary>
|
||||
/// 只显示编辑框
|
||||
/// </summary>
|
||||
/// <param name="form">The form.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static string GetHtml(FormResp form){
|
||||
|
||||
//action=action!=null && !""==(action)?action:"view";
|
||||
return GetHtml(form.ContentData, form.ContentParse, action);
|
||||
return GetHtml(form.ContentData, form.ContentParse,null, "");
|
||||
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 显示编辑框和里面的用户数据
|
||||
/// </summary>
|
||||
/// <param name="contentdata">The contentdata.</param>
|
||||
/// <param name="contentParse">The content parse.</param>
|
||||
/// <param name="frmData">The FRM data.</param>
|
||||
/// <returns>System.String.</returns>
|
||||
public static string Preview(string contentdata, string contentParse, string frmData)
|
||||
{
|
||||
return GetHtml(contentdata, contentParse, frmData, "view");
|
||||
}
|
||||
|
||||
//text
|
||||
private static string GetTextBox(JObject item, Dictionary<string,Object> formData,string action)
|
||||
private static string GetTextBox(JObject item, JObject formData,string action)
|
||||
{
|
||||
string temp = "<input type=\"text\" value=\"{0}\" name=\"{1}\" style=\"{2}\"/>";
|
||||
string name = item.GetValue("name").ToString();
|
||||
|
||||
string value = formData.ContainsKey(name)?formData[name].ToString():null;
|
||||
var data = formData.GetValue(name);
|
||||
string value =null;
|
||||
if (data != null)
|
||||
{
|
||||
value = data.ToString();
|
||||
}
|
||||
|
||||
if (value == null)
|
||||
value = item.GetValue("value") == null ? "" : item.GetValue("value").ToString();
|
||||
string style =item.GetValue("style") == null ? "" : item.GetValue("style").ToString();
|
||||
string temp_html = string.Format(temp, value, name, style);
|
||||
if("view"==(action))
|
||||
return string.Format(temp_view,style,value);
|
||||
else
|
||||
return temp_html;
|
||||
return temp_html;
|
||||
}
|
||||
|
||||
//TextArea
|
||||
private static string GetTextArea(JObject item, Dictionary<string,Object> formData,string action)
|
||||
private static string GetTextArea(JObject item, JObject formData,string action)
|
||||
{
|
||||
string script = "";
|
||||
if (item.GetValue("orgrich") != null && "1"==(item.GetValue("orgrich").ToString()))
|
||||
script = "orgrich=\"true\" ";
|
||||
string name = item.GetValue("name").ToString();
|
||||
|
||||
string value = formData.ContainsKey(name)?formData[name].ToString():null;
|
||||
var data = formData.GetValue(name);
|
||||
string value = null;
|
||||
if (data != null)
|
||||
{
|
||||
value = data.ToString();
|
||||
}
|
||||
|
||||
if (value == null)
|
||||
value = item.GetValue("value")== null ? "" : item.GetValue("value").ToString();
|
||||
string style = item.GetValue("style") == null ? "" : item.GetValue("style").ToString();
|
||||
@ -116,20 +143,26 @@ namespace OpenAuth.App
|
||||
|
||||
if("view"==(action))
|
||||
return string.Format(temp_view,style,value);
|
||||
else
|
||||
return temp_html;
|
||||
return temp_html;
|
||||
}
|
||||
|
||||
//Radios
|
||||
private static string GetRadios(JObject item, Dictionary<string,Object> formData,string action)
|
||||
private static string GetRadios(JObject item, JObject formData,string action)
|
||||
{
|
||||
var radiosOptions = JArray.Parse(item.GetValue("options").ToString());
|
||||
//JArray radiosOptions = item["options"] as JArray;
|
||||
string temp = "<input type=\"radio\" name=\"{0}\" value=\"{1}\" {2}>{3} ";
|
||||
string temp_html = "";
|
||||
string name = item.GetValue("name").ToString();
|
||||
string value = formData.ContainsKey(name)?formData[name].ToString():null;
|
||||
|
||||
|
||||
var data = formData.GetValue(name);
|
||||
string value = null;
|
||||
if (data != null)
|
||||
{
|
||||
value = data.ToString();
|
||||
}
|
||||
|
||||
|
||||
string cvalue_="";
|
||||
foreach (var json in radiosOptions)
|
||||
{
|
||||
@ -152,12 +185,11 @@ namespace OpenAuth.App
|
||||
|
||||
if("view"==(action))
|
||||
return string.Format(temp_view," ",cvalue_);
|
||||
else
|
||||
return temp_html;
|
||||
return temp_html;
|
||||
}
|
||||
|
||||
//Checkboxs
|
||||
private static string GetCheckboxs(JObject item, Dictionary<string,Object> formData,string action){
|
||||
private static string GetCheckboxs(JObject item, JObject formData,string action){
|
||||
string temp_html = "";
|
||||
string temp = "<input type=\"checkbox\" name=\"{0}\" value=\"{1}\" {2}>{3} ";
|
||||
|
||||
@ -167,7 +199,14 @@ namespace OpenAuth.App
|
||||
foreach (var json in checkOptions)
|
||||
{
|
||||
string name = json["name"].ToString();
|
||||
string value = formData.ContainsKey(name) ? formData[name].ToString() : null;
|
||||
|
||||
var data = formData.GetValue(name);
|
||||
string value = null;
|
||||
if (data != null)
|
||||
{
|
||||
value = data.ToString();
|
||||
}
|
||||
|
||||
string cvalue = json["value"].ToString();
|
||||
string Ischecked = "";
|
||||
if (value == null)
|
||||
@ -191,16 +230,21 @@ namespace OpenAuth.App
|
||||
|
||||
if("view"==(action))
|
||||
return string.Format(temp_view," ",view_value);
|
||||
else
|
||||
return temp_html;
|
||||
return temp_html;
|
||||
}
|
||||
|
||||
//Select(比较特殊)
|
||||
private static string GetSelect(JObject item, Dictionary<string,Object> formData, string action)
|
||||
private static string GetSelect(JObject item, JObject formData, string action)
|
||||
{
|
||||
|
||||
string name = item.GetValue("name").ToString();
|
||||
string value = formData.ContainsKey(name)?formData[name].ToString():null;
|
||||
|
||||
var data = formData.GetValue(name);
|
||||
string value = null;
|
||||
if (data != null)
|
||||
{
|
||||
value = data.ToString();
|
||||
}
|
||||
|
||||
string temp_html =item.GetValue("content").ToString();
|
||||
if (value != null)//用户设置过值
|
||||
@ -216,10 +260,17 @@ namespace OpenAuth.App
|
||||
|
||||
|
||||
//Qrcode 二维码
|
||||
private static string GetQrcode(JObject item, Dictionary<string,Object> formData, string action)
|
||||
private static string GetQrcode(JObject item, JObject formData, string action)
|
||||
{
|
||||
string name = item.GetValue("name").ToString();
|
||||
string value = formData.ContainsKey(name)?formData[name].ToString():null;
|
||||
|
||||
var data = formData.GetValue(name);
|
||||
string value = null;
|
||||
if (data != null)
|
||||
{
|
||||
value = data.ToString();
|
||||
}
|
||||
|
||||
string temp_html = "";
|
||||
string temp = "";
|
||||
string orgType = item.GetValue("orgtype").ToString();
|
||||
|
@ -121,6 +121,7 @@
|
||||
<Compile Include="Request\QueryFormListReq.cs" />
|
||||
<Compile Include="Request\QueryUserListReq.cs" />
|
||||
<Compile Include="Request\VerificationReq.cs" />
|
||||
<Compile Include="Response\FlowVerificationResp.cs" />
|
||||
<Compile Include="Response\FormResp.cs" />
|
||||
<Compile Include="Response\TableData.cs" />
|
||||
<Compile Include="RevelanceManagerApp.cs" />
|
||||
|
12
OpenAuth.App/Response/FlowVerificationResp.cs
Normal file
12
OpenAuth.App/Response/FlowVerificationResp.cs
Normal file
@ -0,0 +1,12 @@
|
||||
using OpenAuth.Repository.Domain;
|
||||
|
||||
namespace OpenAuth.App.Response
|
||||
{
|
||||
public class FlowVerificationResp :FlowInstance
|
||||
{
|
||||
public string FrmDataHtml
|
||||
{
|
||||
get { return FormUtil.Preview(FrmContentData, FrmContentParse, FrmData); }
|
||||
}
|
||||
}
|
||||
}
|
@ -46,7 +46,7 @@ namespace OpenAuth.App.Response
|
||||
/// </summary>
|
||||
public string Html
|
||||
{
|
||||
get { return FormUtil.GetHtml(this, ""); }
|
||||
get { return FormUtil.GetHtml(this); }
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ using Infrastructure;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.Request;
|
||||
using OpenAuth.App.Response;
|
||||
using OpenAuth.Mvc.Models;
|
||||
using OpenAuth.Repository.Domain;
|
||||
|
||||
@ -51,7 +52,12 @@ namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
try
|
||||
{
|
||||
var result = new Response<FlowInstance> { Result = App.Get(id) };
|
||||
var flowinstance = App.Get(id);
|
||||
|
||||
var result = new Response<FlowVerificationResp>
|
||||
{
|
||||
Result = flowinstance.MapTo<FlowVerificationResp>()
|
||||
};
|
||||
return JsonHelper.Instance.Serialize(result);
|
||||
}
|
||||
catch (Exception ex)
|
||||
|
@ -15,9 +15,8 @@
|
||||
<tr>
|
||||
<th lay-data="{checkbox:true, fixed: true}"></th>
|
||||
<th lay-data="{field:'Id', width:150}">主键Id</th>
|
||||
<th lay-data="{field:'InstanceSchemeId', width:150}">流程实例模板Id</th>
|
||||
<th lay-data="{field:'CustomName', width:150}">实例名称</th>
|
||||
<th lay-data="{field:'Code', width:150}">实例编号</th>
|
||||
<th lay-data="{field:'CustomName', width:150}">自定义名称</th>
|
||||
<th lay-data="{field:'ActivityId', width:150}">当前节点ID</th>
|
||||
<th lay-data="{field:'ActivityType', width:150}">当前节点类型(0会签节点)</th>
|
||||
<th lay-data="{field:'ActivityName', width:150}">当前节点名称</th>
|
||||
|
@ -26,20 +26,20 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" id="FlowInstanceId" name="FlowInstanceId" v-model="FlowInstanceId" />
|
||||
<input type="hidden" id="FlowInstanceId" name="FlowInstanceId" />
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审核结果</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="VerificationFinally" v-model="VerificationFinally" value="1" title="同意" checked>
|
||||
<input type="radio" name="VerificationFinally" v-model="VerificationFinally" value="2" title="不同意">
|
||||
<input type="radio" name="VerificationFinally" v-model="VerificationFinally" value="3" title="驳回">
|
||||
<input type="radio" name="VerificationFinally" value="1" title="同意" checked>
|
||||
<input type="radio" name="VerificationFinally" value="2" title="不同意">
|
||||
<input type="radio" name="VerificationFinally" value="3" title="驳回">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">审核意见</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="VerificationOpinion" v-model="VerificationOpinion"
|
||||
<input type="text" name="VerificationOpinion"
|
||||
placeholder="" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1601,7 +1601,8 @@ GooFlow.prototype={
|
||||
|
||||
},
|
||||
//载入一组数据
|
||||
loadData:function(data){
|
||||
loadData: function (data) {
|
||||
this.clearData(); //载入之前先清空数据 yubaolee
|
||||
var t=this.$editable;
|
||||
this.$editable=false;
|
||||
if(data.title) this.setTitle(data.title);
|
||||
|
@ -79,8 +79,11 @@
|
||||
callback: {
|
||||
onClick: function (event, treeId, treeNode) {
|
||||
//预览表单
|
||||
$.get("/forms/previewdata?id=" + treeNode.FrmId, function (data) {
|
||||
$("#frmPreview").html(data);
|
||||
//取表单的结构数据
|
||||
$.getJSON("/forms/get?id=" + treeNode.FrmId, function (data) {
|
||||
if (data.Code != 500) {
|
||||
$("#frmPreview").html(data.Result.Html);
|
||||
}
|
||||
});
|
||||
|
||||
//预览流程
|
||||
|
@ -8,11 +8,7 @@
|
||||
var openauth = layui.openauth;
|
||||
var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
|
||||
|
||||
var vm = new Vue({
|
||||
el: "#formEdit"
|
||||
});
|
||||
|
||||
var id = $.getUrlParam("id"); //ID
|
||||
var id = $.getUrlParam("id"); //ID
|
||||
$("#FlowInstanceId").val(id);
|
||||
|
||||
//标签切换
|
||||
@ -32,13 +28,7 @@
|
||||
function (data) {
|
||||
var obj = data.Result;
|
||||
flowDesignPanel.loadData(JSON.parse(obj.SchemeContent));
|
||||
|
||||
//取表单的结构数据
|
||||
$.getJSON("/forms/get?id=" + obj.FrmId, function (data) {
|
||||
if (data.Code != 500) {
|
||||
$("#frmPreview").html(data.Result.Html);
|
||||
}
|
||||
});
|
||||
$("#frmPreview").html(data.Result.FrmDataHtml);
|
||||
});
|
||||
|
||||
//提交数据
|
||||
|
@ -78,6 +78,10 @@
|
||||
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
@ -147,6 +151,10 @@
|
||||
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
|
@ -76,8 +76,8 @@
|
||||
var node = zTreeObj.getNodeByParam("Id", id, null);
|
||||
zTreeObj.checkNode(node, true, false);
|
||||
|
||||
$.get("/forms/previewdata?id=" + id, function (data) {
|
||||
$("#frmPreview").html(data);
|
||||
$.getJSON("/forms/get?id=" + id, function (data) {
|
||||
$("#frmPreview").html(data.Result.Html);
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -80,7 +80,11 @@
|
||||
var iframeWin = window[layero.find('iframe')[0]['name']]; //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
|
||||
iframeWin.submit();
|
||||
},
|
||||
no: function (index) {
|
||||
btn2: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
},
|
||||
cancel: function (index) {
|
||||
layer.close(index);
|
||||
mainList();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user