diff --git a/OpenAuth.App/Flow/FlowNode.cs b/OpenAuth.App/Flow/FlowNode.cs index 12062339..ff41c59d 100644 --- a/OpenAuth.App/Flow/FlowNode.cs +++ b/OpenAuth.App/Flow/FlowNode.cs @@ -43,4 +43,13 @@ } + public class Tag + { + public int Taged { get; set; } + public string UserId { get; set; } + public string UserName { get; set; } + public string Description { get; set; } + public string TagedTime { get; set; } + } + } diff --git a/OpenAuth.App/Flow/FlowRuntime.cs b/OpenAuth.App/Flow/FlowRuntime.cs index a4f6d94b..c39f9a30 100644 --- a/OpenAuth.App/Flow/FlowRuntime.cs +++ b/OpenAuth.App/Flow/FlowRuntime.cs @@ -239,57 +239,29 @@ namespace OpenAuth.App.Flow /// /// /// -1不通过,1等待,其它通过 - public string NodeConfluence(string nodeId, bool flag, string userId, string description = "") + public string NodeConfluence(string nodeId, Tag tag) { string res = "-1"; - try + string _nextNodeId = GetNextNodeByNodeId(nodeId);//获取下一个节点 + if (_nextNodeId != "-1") { - if (flag) + Dictionary> toLines = GetToLineDictionary(_runtimeModel.schemeContentJson); + int allnum = toLines[_nextNodeId].Count; + int i = 0; + foreach (var item in _runtimeModel.schemeContentJson.Flow.nodes) { - MakeTagNode(nodeId, 1, userId, description); - } - else - { - MakeTagNode(nodeId, -1, userId, description); - } - - string _nextNodeId = GetNextNodeByNodeId(nodeId);//获取下一个节点 - if (_nextNodeId != "-1") - { - Dictionary> toLines = GetToLineDictionary(_runtimeModel.schemeContentJson); - int allnum = toLines[_nextNodeId].Count; - int i = 0; - foreach (var item in _runtimeModel.schemeContentJson.Flow.nodes) + if (item.id.Value == _nextNodeId) { - if (item.id.Value == _nextNodeId) + if (item.setInfo.NodeConfluenceType.Value == "")//0所有步骤通过 todo:先用空格 { - if (item.setInfo.NodeConfluenceType.Value == "")//0所有步骤通过 todo:先用空格 + if (tag.Taged == 1) { - if (flag) + if (item.setInfo.ConfluenceOk == null) { - if (item.setInfo.ConfluenceOk == null) - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk = 1; - res = "1"; - } - else if (item.setInfo.ConfluenceOk.Value == (allnum - 1)) - { - res = GetNextNodeByNodeId(_nextNodeId); - if (res == "-1") - { - throw (new Exception("会签成功寻找不到下一个节点")); - } - } - else - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk++; - res = "1"; - } + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk = 1; + res = "1"; } - } - else if (item.setInfo.NodeConfluenceType.Value == "1")//1一个步骤通过即可 - { - if (flag) + else if (item.setInfo.ConfluenceOk.Value == (allnum - 1)) { res = GetNextNodeByNodeId(_nextNodeId); if (res == "-1") @@ -299,93 +271,105 @@ namespace OpenAuth.App.Flow } else { - if (item.setInfo.ConfluenceNo == null) - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo = 1; - res = "1"; - } - else if (item.setInfo.ConfluenceNo.Value == (allnum - 1)) - { - res = "-1"; - } - else - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo++; - res = "1"; - } + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk++; + res = "1"; } } - else//2按百分比计算 + } + else if (item.setInfo.NodeConfluenceType.Value == "1")//1一个步骤通过即可 + { + if (tag.Taged ==1) { - if (flag) + res = GetNextNodeByNodeId(_nextNodeId); + if (res == "-1") { - if (item.setInfo.ConfluenceOk == null) - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk = 1; - } - else - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk++; - } + throw (new Exception("会签成功寻找不到下一个节点")); } - else + } + else + { + if (item.setInfo.ConfluenceNo == null) { - if (item.setInfo.ConfluenceNo == null) - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo = 1; - } - else - { - _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo++; - } + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo = 1; + res = "1"; } - if ((item.setInfo.ConfluenceNo.Value + item.setInfo.ConfluenceOk.Value) / allnum * 100 > int.Parse(item.setInfo.NodeConfluenceRate.Value)) - { - res = GetNextNodeByNodeId(_nextNodeId); - if (res == "-1") - { - throw (new Exception("会签成功寻找不到下一个节点")); - } - } - else if ((item.setInfo.ConfluenceNo.Value + item.setInfo.ConfluenceOk.Value) == allnum) + else if (item.setInfo.ConfluenceNo.Value == (allnum - 1)) { res = "-1"; } else { + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo++; res = "1"; } } - break; } - i++; + else//2按百分比计算 + { + if (tag.Taged == 1) + { + if (item.setInfo.ConfluenceOk == null) + { + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk = 1; + } + else + { + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceOk++; + } + } + else + { + if (item.setInfo.ConfluenceNo == null) + { + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo = 1; + } + else + { + _runtimeModel.schemeContentJson.Flow.nodes[i].setInfo.ConfluenceNo++; + } + } + if ((item.setInfo.ConfluenceNo.Value + item.setInfo.ConfluenceOk.Value) / allnum * 100 > int.Parse(item.setInfo.NodeConfluenceRate.Value)) + { + res = GetNextNodeByNodeId(_nextNodeId); + if (res == "-1") + { + throw (new Exception("会签成功寻找不到下一个节点")); + } + } + else if ((item.setInfo.ConfluenceNo.Value + item.setInfo.ConfluenceOk.Value) == allnum) + { + res = "-1"; + } + else + { + res = "1"; + } + } + break; } - if (res == "-1") - { - MakeTagNode(_nextNodeId, -1, userId); - } - else if (res != "1") //则时res是会签结束节点的ID - { - MakeTagNode(_nextNodeId, 1, userId); - _runtimeModel.nextNodeId = res; - _runtimeModel.nextNodeType = GetNodeType(res); - } - else - { - _runtimeModel.nextNodeId = _nextNodeId; - _runtimeModel.nextNodeType = GetNodeType(_nextNodeId); - } - return res; + i++; + } + if (res == "-1") + { + tag.Taged = -1; + MakeTagNode(_nextNodeId, tag); + } + else if (res != "1") //则时res是会签结束节点的ID + { + tag.Taged = 1; + MakeTagNode(_nextNodeId,tag); + _runtimeModel.nextNodeId = res; + _runtimeModel.nextNodeType = GetNodeType(res); } else { - throw (new Exception("寻找不到会签下合流节点")); + _runtimeModel.nextNodeId = _nextNodeId; + _runtimeModel.nextNodeType = GetNodeType(_nextNodeId); } + return res; } - catch - { - throw; - } + + throw (new Exception("寻找不到会签下合流节点")); } /// /// 驳回节点0"前一步"1"第一步"2"某一步" 3"不处理" @@ -439,19 +423,17 @@ namespace OpenAuth.App.Flow /// 标记节点1通过,-1不通过,0驳回 /// /// - /// - /// - /// - public void MakeTagNode(string nodeId, int flag, string userId, string description = "") + public void MakeTagNode(string nodeId, Tag tag) { int i = 0; foreach (var item in _runtimeModel.schemeContentJson.nodes) { if (item.id.Value.ToString() == nodeId) { - _runtimeModel.schemeContentJson.nodes[i].setInfo.Taged = flag; - _runtimeModel.schemeContentJson.nodes[i].setInfo.UserId = userId; - _runtimeModel.schemeContentJson.nodes[i].setInfo.description = description; + _runtimeModel.schemeContentJson.nodes[i].setInfo.Taged = tag.Taged; + _runtimeModel.schemeContentJson.nodes[i].setInfo.UserId = tag.UserId; + _runtimeModel.schemeContentJson.nodes[i].setInfo.UserName = tag.UserName; + _runtimeModel.schemeContentJson.nodes[i].setInfo.Description = tag.Description; _runtimeModel.schemeContentJson.nodes[i].setInfo.TagedTime = DateTime.Now.ToString("yyyy-MM-dd HH:mm"); break; } diff --git a/OpenAuth.App/FlowInstanceApp.cs b/OpenAuth.App/FlowInstanceApp.cs index 601e5d75..1cfad14b 100644 --- a/OpenAuth.App/FlowInstanceApp.cs +++ b/OpenAuth.App/FlowInstanceApp.cs @@ -98,11 +98,18 @@ namespace OpenAuth.App FlowRuntime wfruntime = new FlowRuntime(flowInstance); - + var user = AuthUtil.GetCurrentUser().User; + var tag = new Tag + { + UserName = user.Name, + UserId = user.Id, + Description = description + }; #region ǩ if (flowInstance.ActivityType == 0)//ǩ { - wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, 1, "");//ǵǰڵͨ + tag.Taged = 1; + wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, tag);//ǵǰڵͨ ///ѰҪ˵ĽڵId string _VerificationNodeId = ""; List _nodelist = wfruntime.GetCountersigningNodeIdList(wfruntime.runtimeModel.currentNodeId); @@ -128,20 +135,19 @@ namespace OpenAuth.App { if (flag) { + tag.Taged = 1; flowInstanceOperationHistory.Content = "" + "todo name" + "" + wfruntime.runtimeModel.nodes[_VerificationNodeId].name + "" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "ͬ,ע" + description; } else { + tag.Taged = -1; flowInstanceOperationHistory.Content = "" + "todo name" + "" + wfruntime.runtimeModel.nodes[_VerificationNodeId].name + "" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "ͬ,ע" + description; } - string _Confluenceres = wfruntime.NodeConfluence(_VerificationNodeId, flag, AuthUtil.GetCurrentUser().User.Id, description); - var _data = new - { - SchemeContent = wfruntime.runtimeModel.schemeContentJson.ToString(), - wfruntime.runtimeModel.frmData - }; - switch (_Confluenceres) + + string confluenceres = wfruntime.NodeConfluence(_VerificationNodeId, tag); + + switch (confluenceres) { case "-1"://ͨ flowInstance.IsFinish = 3; @@ -157,14 +163,17 @@ namespace OpenAuth.App flowInstance.MakerList = (wfruntime.runtimeModel.nextNodeType == 4 ? "" : GetMakerList(wfruntime));//ǰڵִеϢ #region ת¼ - processTransitionHistoryEntity = new FlowInstanceTransitionHistory(); - processTransitionHistoryEntity.FromNodeId = wfruntime.runtimeModel.currentNodeId; - processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name; - processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType; - processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId; - processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name; - processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType; - processTransitionHistoryEntity.TransitionSate = 0; + + processTransitionHistoryEntity = new FlowInstanceTransitionHistory + { + FromNodeId = wfruntime.runtimeModel.currentNodeId, + FromNodeName = wfruntime.runtimeModel.currentNode.name, + FromNodeType = wfruntime.runtimeModel.currentNodeType, + ToNodeId = wfruntime.runtimeModel.nextNodeId, + ToNodeName = wfruntime.runtimeModel.nextNode.name, + ToNodeType = wfruntime.runtimeModel.nextNodeType, + TransitionSate = 0 + }; processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0); #endregion @@ -183,8 +192,8 @@ namespace OpenAuth.App { if (flag) { - wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, 1 - , AuthUtil.GetCurrentUser().User.Id, description); + tag.Taged = 1; + wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, tag); flowInstance.PreviousId = flowInstance.ActivityId; flowInstance.ActivityId = wfruntime.runtimeModel.nextNodeId; flowInstance.ActivityType = wfruntime.runtimeModel.nextNodeType; @@ -212,12 +221,15 @@ namespace OpenAuth.App else { flowInstance.IsFinish = 3; //ʾýڵ㲻ͬ - wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, -1, AuthUtil.GetUserName(), description); + tag.Taged = -1; + wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId,tag); flowInstanceOperationHistory.Content = "" + "todo name" + "" + wfruntime.runtimeModel.currentNode.name + "" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "ͬ,ע" + description; } } - #endregion + #endregion + + flowInstance.SchemeContent = JsonHelper.Instance.Serialize(wfruntime.runtimeModel.schemeContentJson); UnitWork.Update(flowInstance); UnitWork.Add(flowInstanceOperationHistory); @@ -250,7 +262,17 @@ namespace OpenAuth.App { resnode = nodeId; } - wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, 0, AuthUtil.GetUserName(), description); + + var user = AuthUtil.GetCurrentUser().User; + var tag = new Tag + { + Description = description, + Taged = 0, + UserId = user.Id, + UserName = user.Name + }; + + wfruntime.MakeTagNode(wfruntime.runtimeModel.currentNodeId, tag); flowInstance.IsFinish = 4;//4ʾأҪύ if (resnode != "") { diff --git a/OpenAuth.Mvc/OpenAuth.Mvc.csproj b/OpenAuth.Mvc/OpenAuth.Mvc.csproj index 052e3a6b..5f2afbe9 100644 --- a/OpenAuth.Mvc/OpenAuth.Mvc.csproj +++ b/OpenAuth.Mvc/OpenAuth.Mvc.csproj @@ -179,6 +179,7 @@ + diff --git a/OpenAuth.Mvc/js/bootstrap.js b/OpenAuth.Mvc/js/bootstrap.js new file mode 100644 index 00000000..2a39f76b --- /dev/null +++ b/OpenAuth.Mvc/js/bootstrap.js @@ -0,0 +1,2286 @@ +layui.define("jquery", function (exports) { + var jQuery = layui.jquery; + +/* =================================================== + * bootstrap-transition.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#transitions + * =================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) + * ======================================================= */ + + $(function () { + + $.support.transition = (function () { + + var transitionEnd = (function () { + + var el = document.createElement('bootstrap') + , transEndEventNames = { + 'WebkitTransition' : 'webkitTransitionEnd' + , 'MozTransition' : 'transitionend' + , 'OTransition' : 'oTransitionEnd otransitionend' + , 'transition' : 'transitionend' + } + , name + + for (name in transEndEventNames){ + if (el.style[name] !== undefined) { + return transEndEventNames[name] + } + } + + }()) + + return transitionEnd && { + end: transitionEnd + } + + })() + + }) + +}(jQuery);/* ========================================================== + * bootstrap-alert.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#alerts + * ========================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* ALERT CLASS DEFINITION + * ====================== */ + + var dismiss = '[data-dismiss="alert"]' + , Alert = function (el) { + $(el).on('click', dismiss, this.close) + } + + Alert.prototype.close = function (e) { + var $this = $(this) + , selector = $this.attr('data-target') + , $parent + + if (!selector) { + selector = $this.attr('href') + selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 + } + + $parent = $(selector) + + e && e.preventDefault() + + $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) + + $parent.trigger(e = $.Event('close')) + + if (e.isDefaultPrevented()) return + + $parent.removeClass('in') + + function removeElement() { + $parent + .trigger('closed') + .remove() + } + + $.support.transition && $parent.hasClass('fade') ? + $parent.on($.support.transition.end, removeElement) : + removeElement() + } + + + /* ALERT PLUGIN DEFINITION + * ======================= */ + + var old = $.fn.alert + + $.fn.alert = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('alert') + if (!data) $this.data('alert', (data = new Alert(this))) + if (typeof option == 'string') data[option].call($this) + }) + } + + $.fn.alert.Constructor = Alert + + + /* ALERT NO CONFLICT + * ================= */ + + $.fn.alert.noConflict = function () { + $.fn.alert = old + return this + } + + + /* ALERT DATA-API + * ============== */ + + $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) + +}(jQuery);/* ============================================================ + * bootstrap-button.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#buttons + * ============================================================ + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* BUTTON PUBLIC CLASS DEFINITION + * ============================== */ + + var Button = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.button.defaults, options) + } + + Button.prototype.setState = function (state) { + var d = 'disabled' + , $el = this.$element + , data = $el.data() + , val = $el.is('input') ? 'val' : 'html' + + state = state + 'Text' + data.resetText || $el.data('resetText', $el[val]()) + + $el[val](data[state] || this.options[state]) + + // push to event loop to allow forms to submit + setTimeout(function () { + state == 'loadingText' ? + $el.addClass(d).attr(d, d) : + $el.removeClass(d).removeAttr(d) + }, 0) + } + + Button.prototype.toggle = function () { + var $parent = this.$element.closest('[data-toggle="buttons-radio"]') + + $parent && $parent + .find('.active') + .removeClass('active') + + this.$element.toggleClass('active') + } + + + /* BUTTON PLUGIN DEFINITION + * ======================== */ + + var old = $.fn.button + + $.fn.button = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('button') + , options = typeof option == 'object' && option + if (!data) $this.data('button', (data = new Button(this, options))) + if (option == 'toggle') data.toggle() + else if (option) data.setState(option) + }) + } + + $.fn.button.defaults = { + loadingText: 'loading...' + } + + $.fn.button.Constructor = Button + + + /* BUTTON NO CONFLICT + * ================== */ + + $.fn.button.noConflict = function () { + $.fn.button = old + return this + } + + + /* BUTTON DATA-API + * =============== */ + + $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { + var $btn = $(e.target) + if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') + $btn.button('toggle') + }) + +}(jQuery);/* ========================================================== + * bootstrap-carousel.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#carousel + * ========================================================== + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ========================================================== */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* CAROUSEL CLASS DEFINITION + * ========================= */ + + var Carousel = function (element, options) { + this.$element = $(element) + this.$indicators = this.$element.find('.carousel-indicators') + this.options = options + this.options.pause == 'hover' && this.$element + .on('mouseenter', $.proxy(this.pause, this)) + .on('mouseleave', $.proxy(this.cycle, this)) + } + + Carousel.prototype = { + + cycle: function (e) { + if (!e) this.paused = false + if (this.interval) clearInterval(this.interval); + this.options.interval + && !this.paused + && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) + return this + } + + , getActiveIndex: function () { + this.$active = this.$element.find('.item.active') + this.$items = this.$active.parent().children() + return this.$items.index(this.$active) + } + + , to: function (pos) { + var activeIndex = this.getActiveIndex() + , that = this + + if (pos > (this.$items.length - 1) || pos < 0) return + + if (this.sliding) { + return this.$element.one('slid', function () { + that.to(pos) + }) + } + + if (activeIndex == pos) { + return this.pause().cycle() + } + + return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) + } + + , pause: function (e) { + if (!e) this.paused = true + if (this.$element.find('.next, .prev').length && $.support.transition.end) { + this.$element.trigger($.support.transition.end) + this.cycle(true) + } + clearInterval(this.interval) + this.interval = null + return this + } + + , next: function () { + if (this.sliding) return + return this.slide('next') + } + + , prev: function () { + if (this.sliding) return + return this.slide('prev') + } + + , slide: function (type, next) { + var $active = this.$element.find('.item.active') + , $next = next || $active[type]() + , isCycling = this.interval + , direction = type == 'next' ? 'left' : 'right' + , fallback = type == 'next' ? 'first' : 'last' + , that = this + , e + + this.sliding = true + + isCycling && this.pause() + + $next = $next.length ? $next : this.$element.find('.item')[fallback]() + + e = $.Event('slide', { + relatedTarget: $next[0] + , direction: direction + }) + + if ($next.hasClass('active')) return + + if (this.$indicators.length) { + this.$indicators.find('.active').removeClass('active') + this.$element.one('slid', function () { + var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) + $nextIndicator && $nextIndicator.addClass('active') + }) + } + + if ($.support.transition && this.$element.hasClass('slide')) { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $next.addClass(type) + $next[0].offsetWidth // force reflow + $active.addClass(direction) + $next.addClass(direction) + this.$element.one($.support.transition.end, function () { + $next.removeClass([type, direction].join(' ')).addClass('active') + $active.removeClass(['active', direction].join(' ')) + that.sliding = false + setTimeout(function () { that.$element.trigger('slid') }, 0) + }) + } else { + this.$element.trigger(e) + if (e.isDefaultPrevented()) return + $active.removeClass('active') + $next.addClass('active') + this.sliding = false + this.$element.trigger('slid') + } + + isCycling && this.cycle() + + return this + } + + } + + + /* CAROUSEL PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.carousel + + $.fn.carousel = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('carousel') + , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) + , action = typeof option == 'string' ? option : options.slide + if (!data) $this.data('carousel', (data = new Carousel(this, options))) + if (typeof option == 'number') data.to(option) + else if (action) data[action]() + else if (options.interval) data.pause().cycle() + }) + } + + $.fn.carousel.defaults = { + interval: 5000 + , pause: 'hover' + } + + $.fn.carousel.Constructor = Carousel + + + /* CAROUSEL NO CONFLICT + * ==================== */ + + $.fn.carousel.noConflict = function () { + $.fn.carousel = old + return this + } + + /* CAROUSEL DATA-API + * ================= */ + + $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { + var $this = $(this), href + , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 + , options = $.extend({}, $target.data(), $this.data()) + , slideIndex + + $target.carousel(options) + + if (slideIndex = $this.attr('data-slide-to')) { + $target.data('carousel').pause().to(slideIndex).cycle() + } + + e.preventDefault() + }) + +}(jQuery);/* ============================================================= + * bootstrap-collapse.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#collapse + * ============================================================= + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* COLLAPSE PUBLIC CLASS DEFINITION + * ================================ */ + + var Collapse = function (element, options) { + this.$element = $(element) + this.options = $.extend({}, $.fn.collapse.defaults, options) + + if (this.options.parent) { + this.$parent = $(this.options.parent) + } + + this.options.toggle && this.toggle() + } + + Collapse.prototype = { + + constructor: Collapse + + , dimension: function () { + var hasWidth = this.$element.hasClass('width') + return hasWidth ? 'width' : 'height' + } + + , show: function () { + var dimension + , scroll + , actives + , hasData + + if (this.transitioning || this.$element.hasClass('in')) return + + dimension = this.dimension() + scroll = $.camelCase(['scroll', dimension].join('-')) + actives = this.$parent && this.$parent.find('> .accordion-group > .in') + + if (actives && actives.length) { + hasData = actives.data('collapse') + if (hasData && hasData.transitioning) return + actives.collapse('hide') + hasData || actives.data('collapse', null) + } + + this.$element[dimension](0) + this.transition('addClass', $.Event('show'), 'shown') + $.support.transition && this.$element[dimension](this.$element[0][scroll]) + } + + , hide: function () { + var dimension + if (this.transitioning || !this.$element.hasClass('in')) return + dimension = this.dimension() + this.reset(this.$element[dimension]()) + this.transition('removeClass', $.Event('hide'), 'hidden') + this.$element[dimension](0) + } + + , reset: function (size) { + var dimension = this.dimension() + + this.$element + .removeClass('collapse') + [dimension](size || 'auto') + [0].offsetWidth + + this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') + + return this + } + + , transition: function (method, startEvent, completeEvent) { + var that = this + , complete = function () { + if (startEvent.type == 'show') that.reset() + that.transitioning = 0 + that.$element.trigger(completeEvent) + } + + this.$element.trigger(startEvent) + + if (startEvent.isDefaultPrevented()) return + + this.transitioning = 1 + + this.$element[method]('in') + + $.support.transition && this.$element.hasClass('collapse') ? + this.$element.one($.support.transition.end, complete) : + complete() + } + + , toggle: function () { + this[this.$element.hasClass('in') ? 'hide' : 'show']() + } + + } + + + /* COLLAPSE PLUGIN DEFINITION + * ========================== */ + + var old = $.fn.collapse + + $.fn.collapse = function (option) { + return this.each(function () { + var $this = $(this) + , data = $this.data('collapse') + , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) + if (!data) $this.data('collapse', (data = new Collapse(this, options))) + if (typeof option == 'string') data[option]() + }) + } + + $.fn.collapse.defaults = { + toggle: true + } + + $.fn.collapse.Constructor = Collapse + + + /* COLLAPSE NO CONFLICT + * ==================== */ + + $.fn.collapse.noConflict = function () { + $.fn.collapse = old + return this + } + + + /* COLLAPSE DATA-API + * ================= */ + + $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { + var $this = $(this), href + , target = $this.attr('data-target') + || e.preventDefault() + || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 + , option = $(target).data('collapse') ? 'toggle' : $this.data() + $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') + $(target).collapse(option) + }) + +}(jQuery);/* ============================================================ + * bootstrap-dropdown.js v2.3.2 + * http://getbootstrap.com/2.3.2/javascript.html#dropdowns + * ============================================================ + * Copyright 2013 Twitter, Inc. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ============================================================ */ + + +!function ($) { + + "use strict"; // jshint ;_; + + + /* DROPDOWN CLASS DEFINITION + * ========================= */ + + var toggle = '[data-toggle=dropdown]' + , Dropdown = function (element) { + var $el = $(element).on('click.dropdown.data-api', this.toggle) + $('html').on('click.dropdown.data-api', function () { + $el.parent().removeClass('open') + }) + } + + Dropdown.prototype = { + + constructor: Dropdown + + , toggle: function (e) { + var $this = $(this) + , $parent + , isActive + + if ($this.is('.disabled, :disabled')) return + + $parent = getParent($this) + + isActive = $parent.hasClass('open') + + clearMenus() + + if (!isActive) { + if ('ontouchstart' in document.documentElement) { + // if mobile we we use a backdrop because click events don't delegate + $('"; - $frmpreview.find('#' + item.id).attr('data-toggle', 'tooltip'); - $frmpreview.find('#' + item.id).attr('data-placement', 'bottom'); - $frmpreview.find('#' + item.id).attr('title', _row); + $('#' + item.id).attr('data-toggle', 'tooltip'); + $('#' + item.id).attr('data-placement', 'bottom'); + $('#' + item.id).attr('title', _row); } }); $('[data-toggle="tooltip"]').tooltip({ "html": true }); @@ -376,29 +242,29 @@ _popoverhtml += ''; } - $frmpreview.find('#' + item.id).attr('title', item.name); - $frmpreview.find('#' + item.id).attr('data-toggle', 'popover'); - $frmpreview.find('#' + item.id).attr('data-placement', 'bottom'); - $frmpreview.find('#' + item.id).attr('data-content', _popoverhtml); + $('#' + item.id).attr('title', item.name); + $('#' + item.id).attr('data-toggle', 'popover'); + $('#' + item.id).attr('data-placement', 'bottom'); + $('#' + item.id).attr('data-content', _popoverhtml); } else { - $frmpreview.find('#' + item.id).attr('title', item.name); - $frmpreview.find('#' + item.id).attr('data-toggle', 'popover'); - $frmpreview.find('#' + item.id).attr('data-placement', 'bottom'); - $frmpreview.find('#' + item.id).attr('data-content', "该节点未被设置"); + $('#' + item.id).attr('title', item.name); + $('#' + item.id).attr('data-toggle', 'popover'); + $('#' + item.id).attr('data-placement', 'bottom'); + $('#' + item.id).attr('data-content', "该节点未被设置"); } }); - $frmpreview.find('.GooFlow_item').popover({ html: true }); + $('.GooFlow_item').popover({ html: true }); } function labellingRedNode(id) { - $frmpreview.find('.flow-labellingnode-red').removeClass('flow-labellingnode-red'); - $frmpreview.find('#' + id).addClass('flow-labellingnode-red'); + $('.flow-labellingnode-red').removeClass('flow-labellingnode-red'); + $('#' + id).addClass('flow-labellingnode-red'); } return flowPanel; } - exports('flowlayout'); //只有这样写才能找到flowlayout??好尴尬 + exports('flowlayout'); }); diff --git a/OpenAuth.Mvc/userJs/flowInstanceOp.js b/OpenAuth.Mvc/userJs/flowInstanceOp.js index 1eba3145..579609b4 100644 --- a/OpenAuth.Mvc/userJs/flowInstanceOp.js +++ b/OpenAuth.Mvc/userJs/flowInstanceOp.js @@ -16,18 +16,20 @@ parent.layer.iframeAuto(index); }); - /*=========流程设计(begin)======================*/ - var flowDesignPanel = $('#flowPanel').flowdesign({ - height: 300, - widht: 300, - haveTool: false - }); - /*=========流程设计(end)=====================*/ - $.getJSON('/FlowInstances/get?id=' + id, function (data) { var obj = data.Result; - flowDesignPanel.loadData(JSON.parse(obj.SchemeContent)); + var schemeContent = JSON.parse(obj.SchemeContent); + var flowDesignPanel = $('#flowPanel').flowdesign({ + height: 300, + widht: 300, + haveTool: false + , isprocessing: true + , activityId: obj.ActivityId + , nodeData: schemeContent.nodes + , flowcontent:schemeContent + }); + $("#frmPreview").html(data.Result.FrmDataHtml); }); diff --git a/README.md b/README.md index 9828782b..603149ec 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,8 @@ `官方QQ交流群` 1. 484498493【已满】 -2. 626433139 +2. 626433139【将满】 +3. 566344079 `4.0版演示直达`