From 7f8037336879baa18e7f4346787ba02df3e0041c Mon Sep 17 00:00:00 2001 From: xieyu33333 Date: Wed, 2 Mar 2016 22:08:22 +0800 Subject: [PATCH] fix itk-form tpl render bug --- build/itoolkit.js | 2 +- build/itoolkit.min.js | 4 ++-- demos/itk-form.html | 1 + src/itoolkit.js | 2 +- src/pc/itk-form.tag | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) mode change 100644 => 100755 build/itoolkit.js mode change 100644 => 100755 build/itoolkit.min.js diff --git a/build/itoolkit.js b/build/itoolkit.js old mode 100644 new mode 100755 index e7a44b7..ecdacd3 --- a/build/itoolkit.js +++ b/build/itoolkit.js @@ -2942,7 +2942,6 @@ riot.tag('itk-form', '
', function(o validArr.push(e); } } - console.log(validArr); if (!validArr.length) { if (config.normalSubmit) { self.root.firstChild.setAttribute('action', action); @@ -3106,6 +3105,7 @@ riot.tag('itk-form', '
', function(o self.rules[ruleConfig] = self.rulesConfig[ruleConfig]; } } + self.update(); }; diff --git a/build/itoolkit.min.js b/build/itoolkit.min.js old mode 100644 new mode 100755 index d14802a..ef456a3 --- a/build/itoolkit.min.js +++ b/build/itoolkit.min.js @@ -1,8 +1,8 @@ /** * iToolkit v1.0.0 - * Revised in 2016-03-02 16:17:34 + * Revised in 2016-03-02 22:06:49 * Released under the ISC License. */ !function(e,t){"use strict";function n(e){var t=q(0),n=e.trim().slice(t.length).match(/^\s*(\S+?)\s*(?:,\s*(\S+))?\s+in\s+(.+)$/);return n?{key:n[1],pos:n[2],val:t+n[3]}:{val:e}}function i(e,t,n){var i={};return i[e.key]=t,e.pos&&(i[e.pos]=n),i}function a(e,t,a){f(e,"each");var r,o=v(e),l=e.outerHTML,u=!!K[o],c=K[o]||{tmpl:l},d=e.parentNode,p=document.createComment("riot placeholder"),g=[],h=m(e);d.insertBefore(p,e),a=n(a),t.one("premount",function(){d.stub&&(d=t.root),e.parentNode.removeChild(e)}).on("update",function(){var n=Y(a.val,t);F(n)||(r=n?JSON.stringify(n):"",n=n?Object.keys(n).map(function(e){return i(a,e,n[e])}):[]);for(var l=document.createDocumentFragment(),f=g.length,m=n.length;f>m;)g[--f].unmount(),g.splice(f,1);for(f=0;m>f;++f){var v=!r&&a.key?i(a,n[f],f):n[f];g[f]?g[f].update(v):(g[f]=new s(c,{parent:t,isLoop:!0,hasImpl:u,root:$.test(o)?d:e.cloneNode(),item:v},e.innerHTML),g[f]._item=v,g[f].mount(),l.appendChild(g[f].root)),g[f]._item=v}d.insertBefore(l,p),h&&(t.tags[o]=g)}).one("updated",function(){var e=Object.keys(t);k(d,function(n){1!=n.nodeType||n.isLoop||n._looped||(n._visited=!1,n._looped=!0,D(n,t,e))})})}function r(e,t,n){k(e,function(e){if(1==e.nodeType){e.isLoop=e.isLoop||e.parentNode&&e.parentNode.isLoop||e.getAttribute("each")?1:0;var i=m(e);i&&!e.isLoop&&n.push(g(i,e,t)),e.isLoop||D(e,t,[])}})}function o(e,t,n){function i(e,t,i){if(t.indexOf(q(0))>=0){var a={dom:e,expr:t};n.push(y(a,i))}}k(e,function(e){var n=e.nodeType;if(3==n&&"STYLE"!=e.parentNode.tagName&&i(e,e.nodeValue),1==n){var r=e.getAttribute("each");return r?(a(e,t,r),!1):(d(e.attributes,function(t){var n=t.name,a=n.split("__")[1];return i(e,t.value,{attr:a||n,bool:a}),a?(f(e,n),!1):void 0}),m(e)?!1:void 0)}})}function s(e,n,i){function a(){var e=T&&k?f:v||f;d(L.attributes,function(t){m[t.name]=Y(t.value,e)}),d(Object.keys(M),function(t){m[t]=Y(M[t],e)})}function s(e){for(var t in N)typeof f[t]!==H&&(f[t]=e[t])}function l(){f.parent&&k&&d(Object.keys(f.parent),function(e){var t=!~R.indexOf(e)&&~P.indexOf(e);(typeof f[e]===H||t)&&(t||P.push(e),f[e]=f.parent[e])})}function u(e){if(d(D,function(t){t[e?"mount":"unmount"]()}),v){var t=e?"on":"off";k?v[t]("unmount",f.unmount):v[t]("update",f.update)[t]("unmount",f.unmount)}}var f=O.observable(this),m=E(n.opts)||{},g=z(e.tmpl),v=n.parent,k=n.isLoop,T=n.hasImpl,N=b(n.item),S=[],D=[],L=n.root,A=e.fn,I=L.tagName.toLowerCase(),M={},P=[];A&&L._tag&&L._tag.unmount(!0),this.isMounted=!1,L.isLoop=k,L._tag=this,this._id=j++,y(this,{parent:v,root:L,opts:m,tags:{}},N),d(L.attributes,function(e){var t=e.value;q(/{.*}/).test(t)&&(M[e.name]=t)}),g.innerHTML&&!/^(select|optgroup|table|tbody|tr|col(?:group)?)$/.test(I)&&(g.innerHTML=x(g.innerHTML,i)),this.update=function(e){e=b(e),l(),e&&typeof N===B&&(s(e),N=e),y(f,e),a(),f.trigger("update",e),c(S,f),f.trigger("updated")},this.mixin=function(){d(arguments,function(e){e=typeof e===_?O.mixin(e):e,d(Object.keys(e),function(t){"init"!=t&&(f[t]=p(e[t])?e[t].bind(f):e[t])}),e.init&&e.init.bind(f)()})},this.mount=function(){if(a(),A&&A.call(f,m),o(g,f,S),u(!0),(e.attrs||T)&&(C(e.attrs,function(e,t){L.setAttribute(e,t)}),o(f.root,f,S)),(!f.parent||k)&&f.update(N),f.trigger("premount"),k&&!T)f.root=L=g.firstChild;else{for(;g.firstChild;)L.appendChild(g.firstChild);L.stub&&(f.root=L=v.root)}!f.parent||f.parent.isMounted?(f.isMounted=!0,f.trigger("mount")):f.parent.one("mount",function(){w(f.root)||(f.parent.isMounted=f.isMounted=!0,f.trigger("mount"))})},this.unmount=function(e){var n,i=L,a=i.parentNode;if(a){if(v)n=h(v),F(n.tags[I])?d(n.tags[I],function(e,t){e._id==f._id&&n.tags[I].splice(t,1)}):n.tags[I]=t;else for(;i.firstChild;)i.removeChild(i.firstChild);e?a.removeAttribute("riot-tag"):a.removeChild(i)}f.trigger("unmount"),u(),f.off("*"),L._tag=null},r(g,this,D)}function l(t,n,i,a){i[t]=function(t){var r,o=a._item,s=a.parent;if(!o)for(;s&&!o;)o=s._item,s=s.parent;t=t||e.event;try{t.currentTarget=i,t.target||(t.target=t.srcElement),t.which||(t.which=t.charCode||t.keyCode)}catch(l){}t.item=o,n.call(a,t)===!0||/radio|check/.test(i.type)||(t.preventDefault&&t.preventDefault(),t.returnValue=!1),t.preventUpdate||(r=o?h(s):a,r.update())}}function u(e,t,n){e&&(e.insertBefore(n,t),e.removeChild(t))}function c(e,t){d(e,function(e,n){var i=e.dom,a=e.attr,r=Y(e.expr,t),o=e.dom.parentNode;if(e.bool?r=r?a:!1:null==r&&(r=""),o&&"TEXTAREA"==o.tagName&&(r=(""+r).replace(/riot-/g,"")),e.value!==r){if(e.value=r,!a)return void(i.nodeValue=""+r);if(f(i,a),p(r))l(a,r,i,t);else if("if"==a){var s=e.stub,c=function(){u(s.parentNode,s,i)},d=function(){u(i.parentNode,i,s)};r?s&&(c(),i.inStub=!1,w(i)||k(i,function(e){e._tag&&!e._tag.isMounted&&(e._tag.isMounted=!!e._tag.trigger("mount"))})):(s=e.stub=s||document.createTextNode(""),i.parentNode?d():(t.parent||t).one("updated",d),i.inStub=!0)}else if(/^(show|hide)$/.test(a))"hide"==a&&(r=!r),i.style.display=r?"":"none";else if("value"==a)i.value=r;else if(L(a,M)&&a!=P)r&&i.setAttribute(a.slice(M.length),r);else{if(e.bool&&(i[a]=r,!r))return;typeof r!==B&&i.setAttribute(a,r)}}})}function d(e,t){for(var n,i=0,a=(e||[]).length;a>i;i++)n=e[i],null!=n&&t(n,i)===!1&&i--;return e}function p(e){return typeof e===W||!1}function f(e,t){e.removeAttribute(t)}function m(e){return e.tagName&&K[e.getAttribute(P)||e.tagName.toLowerCase()]}function g(e,t,n){var i,a=new s(e,{root:t,parent:n},t.innerHTML),r=v(t),o=h(n);return a.parent=o,i=o.tags[r],i?(F(i)||(o.tags[r]=[i]),~o.tags[r].indexOf(a)||o.tags[r].push(a)):o.tags[r]=a,t.innerHTML="",a}function h(e){for(var t=e;!m(t.root)&&t.parent;)t=t.parent;return t}function v(e){var t=m(e),n=e.getAttribute("name"),i=n&&n.indexOf(q(0))<0?n:t?t.name:e.tagName.toLowerCase();return i}function y(e){for(var t,n=arguments,i=1;i(<\/\1>)?/gi,t||"")}function N(e,t){return(t||document).querySelectorAll(e)}function S(e,t){return(t||document).querySelector(e)}function E(e){function t(){}return t.prototype=e,new t}function D(e,t,n){if(!e._visited){var i,a=e.getAttribute("id")||e.getAttribute("name");a&&(n.indexOf(a)<0&&(i=t[a],i?F(i)?i.push(e):t[a]=[i,e]:t[a]=e),e._visited=!0)}}function L(e,t){return e.slice(0,t.length)===t}function A(e){if(!O.render){V||(V=T("style"),V.setAttribute("type","text/css"));var t=document.head||document.getElementsByTagName("head")[0];if(V.styleSheet?V.styleSheet.cssText+=e:V.innerHTML+=e,!V._rendered)if(V.styleSheet)document.body.appendChild(V);else{var n=S("style[type=riot]");n?(n.parentNode.insertBefore(V,n),n.parentNode.removeChild(n)):t.appendChild(V)}V._rendered=!0}}function I(e,t,n){var i=K[t],a=e._innerHTML=e._innerHTML||e.innerHTML;return e.innerHTML="",i&&e&&(i=new s(i,{root:e,opts:n},a)),i&&i.mount?(i.mount(),G.push(i),i.on("unmount",function(){G.splice(G.indexOf(i),1)})):void 0}var O={version:"v2.2.4",settings:{}},j=0,M="riot-",P=M+"tag",_="string",B="object",H="undefined",W="function",$=/^(?:opt(ion|group)|tbody|col|t[rhd])$/,R=["_item","_id","update","root","mount","unmount","mixin","isMounted","isLoop","tags","parent","opts","trigger","on","off","one"],U=0|(e&&e.document||{}).documentMode,F=Array.isArray;O.observable=function(e){e=e||{};var t={},n=0;return e.on=function(i,a){return p(a)&&(typeof a.id===H&&(a._id=n++),i.replace(/\S+/g,function(e,n){(t[e]=t[e]||[]).push(a),a.typed=n>0})),e},e.off=function(n,i){return"*"==n?t={}:n.replace(/\S+/g,function(e){if(i)for(var n,a=t[e],r=0;n=a&&a[r];++r)n._id==i._id&&a.splice(r--,1);else t[e]=[]}),e},e.one=function(t,n){function i(){e.off(t,i),n.apply(e,arguments)}return e.on(t,i)},e.trigger=function(n){for(var i,a=[].slice.call(arguments,1),r=t[n]||[],o=0;i=r[o];++o)i.busy||(i.busy=1,i.apply(e,i.typed?[n].concat(a):a),r[o]!==i&&o--,i.busy=0);return t.all&&"all"!=n&&e.trigger.apply(e,["all",n].concat(a)),e},e},O.mixin=function(){var e={};return function(t,n){return n?void(e[t]=n):e[t]}}(),function(e,t,n){function i(){return s.href.split("#")[1]||""}function a(e){return e.split("/")}function r(e){e.type&&(e=i()),e!=o&&(l.trigger.apply(null,["H"].concat(a(e))),o=e)}if(n){var o,s=n.location,l=e.observable(),u=!1,c=e.route=function(e){e[0]?(s.hash=e,r(e)):l.on("H",e)};c.exec=function(e){e.apply(null,a(i()))},c.parser=function(e){a=e},c.stop=function(){u&&(n.removeEventListener?n.removeEventListener(t,r,!1):n.detachEvent("on"+t,r),l.off("*"),u=!1)},c.start=function(){u||(n.addEventListener?n.addEventListener(t,r,!1):n.attachEvent("on"+t,r),u=!0)},c.start()}}(O,"hashchange",e);var V,q=function(e){var t,n,i,a=/[{}]/g;return function(r){var o=O.settings.brackets||e;return t!==o&&(t=o,i=o.split(" "),n=i.map(function(e){return e.replace(/(?=.)/g,"\\")})),r instanceof RegExp?o===e?r:new RegExp(r.source.replace(a,function(e){return n[~~("}"===e)]}),r.global?"g":""):i[r]}}("{ }"),Y=function(){function t(e,t){return e.indexOf(q(0))<0?(e=e.replace(/\n|\r\n?/g,"\n"),function(){return e}):(e=e.replace(q(/\\{/g),"￰").replace(q(/\\}/g),"￱"),t=a(e,r(e,q(/{/),q(/}/))),e=2!==t.length||t[0]?"["+t.map(function(e,t){return t%2?n(e,!0):'"'+e.replace(/\n|\r\n?/g,"\\n").replace(/"/g,'\\"')+'"'}).join(",")+'].join("")':n(t[1]),new Function("d","return "+e.replace(/\uFFF0/g,q(0)).replace(/\uFFF1/g,q(1))+";"))}function n(e,t){return e=e.replace(/\n|\r\n?/g," ").replace(q(/^[{ ]+|[ }]+$|\/\*.+?\*\//g),""),/^\s*[\w- "']+ *:/.test(e)?"["+r(e,/["' ]*[\w- ]+["' ]*:/,/,(?=["' ]*[\w- ]+["' ]*:)|}|$/).map(function(e){return e.replace(/^[ "']*(.+?)[ "']*: *(.+?),? *$/,function(e,t,n){return n.replace(/[^&|=!><]+/g,i)+'?"'+t+'":"",'})}).join("")+'].join(" ").trim()':i(e,t)}function i(e,t){return e=e.trim(),e?"(function(v){try{v="+e.replace(l,function(e,t,n){return n?'(("'+n+s+n+")":e})+"}catch(e){}return "+(t===!0?'!v&&v!==0?"":v':"v")+"}).call(d)":""}function a(e,t){var n=[];return t.map(function(t,i){i=e.indexOf(t),n.push(e.slice(0,i),t),e=e.slice(i+t.length)}),e&&n.push(e),n}function r(e,t,n){var i,a=0,r=[],o=new RegExp("("+t.source+")|("+n.source+")","g");return e.replace(o,function(t,n,o,s){!a&&n&&(i=s),a+=n?1:-1,a||null==o||r.push(e.slice(i,s+o.length))}),r}var o={},s='"in d?d:'+(e?"window).":"global)."),l=/(['"\/])(?:[^\\]*?|\\.|.)*?\1|\.\w*|\w*:|\b(?:(?:new|typeof|in|instanceof) |(?:this|true|false|null|undefined)\b|function\s*\()|([A-Za-z_$]\w*)/g;return function(e,n){return e&&(o[e]||(o[e]=t(e)))(n)}}(),z=function(e){function t(t){var r=t&&t.match(/^\s*<([-\w]+)/),o=r&&r[1].toLowerCase(),s=i[o]||a,l=T(s);return l.stub=!0,e&&o&&(r=o.match($))?n(l,t,o,!!r[1]):l.innerHTML=t,l}function n(e,t,n,i){var r,o=T(a),s=i?"select>":"table>";o.innerHTML="<"+s+t+"e,t}(U),G=[],K={};O.tag=function(e,t,n,i,a){return p(i)&&(a=i,/^[\w\-]+\s?=/.test(n)?(i=n,n=""):i=""),n&&(p(n)?a=n:A(n)),K[e]={name:e,tmpl:t,attrs:i,fn:a},e},O.mount=function(e,t,n){function i(e){var t="";return d(e,function(e){t+=", *["+P+'="'+e.trim()+'"]'}),t}function a(){var e=Object.keys(K);return e+i(e)}function r(e){var i;if(e.tagName){!t||(i=e.getAttribute(P))&&i==t||e.setAttribute(P,t);var a=I(e,t||e.getAttribute(P)||e.tagName.toLowerCase(),n);a&&l.push(a)}else e.length&&d(e,r)}var o,s,l=[];if(typeof t===B&&(n=t,t=0),typeof e===_?("*"===e?e=s=a():e+=i(e.split(",")),o=N(e)):o=e,"*"===t){if(t=s||a(),o.tagName)o=N(t,o);else{var u=[];d(o,function(e){u.push(N(t,e))}),o=u}t=0}return o.tagName?r(o):d(o,r),l},O.update=function(){return d(G,function(e){e.update()})},O.mountTo=O.mount,O.util={brackets:q,tmpl:Y},typeof exports===B?module.exports=O:"function"==typeof define&&define.amd?define(function(){return e.riot=O}):e.riot=O}("undefined"!=typeof window?window:void 0);var utils={httpGet:function(e,t,n,i){var a=new XMLHttpRequest,e=utils.concatParams(e,t);a.open("GET",e,!0),a.send(null),a.onreadystatechange=function(){if(4===a.readyState&&(i&&"function"==typeof i&&i(),200===a.status)){var e=a.responseText;try{if("string"==typeof e)var t=JSON.parse(e);else var t=e}catch(r){alert("解析错误")}n(t)}}},httpPost:function(e,t,n,i){var a=new XMLHttpRequest;a.open("POST",e,!0),a.setRequestHeader("Content-type","application/json"),a.send(t),a.onreadystatechange=function(){if(4===a.readyState)if(i&&"function"==typeof i&&i(),200===a.status){try{var e=JSON.parse(a.responseText)}catch(t){console.log("解析错误")}n(e)}else console.log("网络错误")}},jsonp:function(e,t,n){var i=Date.now(),a=document.createElement("script"),r=document.getElementsByTagName("head")[0],e=utils.concatParams(e,t);if(t.callback)var o=e,s=t.callback;else{if(e.match(/\?/))var o=e+"&callback=jsonpCallback"+i;else var o=e+"?callback=jsonpCallback"+i;var s="jsonpCallback"+i}a.src=o,r.appendChild(a),window[s]=function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(t){}n(e)},a.onerror=function(){console.log("jsonp error")},a.onload=function(){r.removeChild(a)}},htmlEncode:function(e){var t=document.createElement("div");return t.innerHTML=e,t.innerText},concatParams:function(e,t){if(e.match(/\?/))var n="&";else var n="?";for(i in t)n=n+i+"="+t[i]+"&";return n=n.replace(/&$/,""),e+n},setCookie:function(e,t,n,i){var a=new Date,i=i||"/";a.setTime(a.getTime()+n),document.cookie=e+"="+escape(t)+";path="+i+";expires="+a.toGMTString()},transBytes:function(e){var t=["B","KB","MB","GB","TB"];if(0==e)return"n/a";var n=parseInt(Math.floor(Math.log(e)/Math.log(1024)));return 0==n?e+t[n]:(e/Math.pow(1024,n)).toFixed(1)+t[n]},transTimes:function(e){var e=parseInt(e,10),t=new Date(1e3*e),n=(new Date).getTime()/1e3,i=n-e;if(86400>i)return t.getHours()+":"+t.getMinutes();if(i>86400&&172800>i)return"昨天";if(i>172800){var a=(t.getFullYear()+"-").substring(2),r=(t.getMonth()+1<10?"0"+(t.getMonth()+1):t.getMonth()+1)+"-",o=t.getDate()<10?"0"+t.getDate():t.getDate();return a+r+o}},hasClass:function(e,t){return e.className.match(new RegExp("(\\s|^)"+t+"(\\s|$)"))},addClass:function(e,t){e.className.trim(),this.hasClass(e,t)||(e.className+=" "+t)},removeClass:function(e,t){if(utils.hasClass(e,t)){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}},toggleClass:function(e,t){if(utils.hasClass(e,t)){var n=new RegExp("(\\s|^)"+t+"(\\s|$)");e.className=e.className.replace(n," ")}else e.className+=" "+t},insertAfter:function(e,t){var n=t.parentNode;n.lastChild==t?n.appendChild(e):n.insertBefore(e,t.nextSibling)},insertAfterText:function(e,t){var n=t.parentNode;if(n.lastChild==t)n.appendChild(e);else{var i=t.nextSibling;3===i.nodeType&&(i=i.nextSibling),n.insertBefore(e,i)}},isType:function(e){return function(t){return toString.call(t)==="[object "+e+"]"}},makeArray:function(){return Array.prototype.concat(obj)},extend:function(e,t){for(var n in t)e[n]||(e[n]=t[n])},deepCopy:function(e,t){var n="[object Array]"===toString.call(e)?[]:{},t=t||n;for(var i in e)"[object Object]"===toString.call(e[i])?(t[i]={},this.deepCopy(e[i],t[i])):"[object Array]"===toString.call(e[i])?(t[i]=[],this.deepCopy(e[i],t[i])):t[i]=e[i];return t}};utils.extend(utils,{isArray:utils.isType("Array"),isObject:utils.isType("Object"),isFunction:utils.isType("Function"),isElement:function(e){return-1!==toString.call(e).indexOf("Element")}}),utils.extend(utils,{jsLoader:function(){function e(){return p++}function t(e){return e.match(/\.css\??/)}function n(t){this.uri=t,this.cid=e(),this.status=k}function i(e,t){return i.then(e,t).start(),i}function a(e){throw e}function r(e){if(e||f.length)for(var t=0;t
{ year.text }
{ month.text }
{ text }
{ day }
{ i }
','hide="{ !open }"',function(e){var t=this;t.i18n={zh_cn:{weekArr:["一","二","三","四","五","六","日"],monthArr:["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]},en_us:{weekArr:["Mo","Tu","We","Th","Fr","Sa","Su"],monthArr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]}};var n=(t.root,["itk-calendar-label","itk-calendar-input","itk-calendar-calendarIcon"]);t.mapping=function(e){if(!utils.isObject(e))throw new TypeError("Config is not a object!");for(var n in e)t[n]=e[n]},window.itkCalendarLanguage=window.itkCalendarLanguage||{},t.langMixin=function(e){if(e){for(var t in e)window.itkCalendarLanguage[t]||(window.itkCalendarLanguage[t]=e[t]);delete e}},t.initWeekList=function(e){var n=t.i18n[e]||window.itkCalendarLanguage[e];if(n)t.weekArr=n.weekArr,t.monthArr=n.monthArr;else if(!t.weekArr||!t.monthArr){var n=t.i18n.zh_cn;t.weekArr=n.weekArr,t.monthArr=n.monthArr}},t.getDaysCount=function(e,t){var n=0;switch(t){case 1:case 3:case 5:case 7:case 8:case 10:case 12:case 0:case 13:n=31;break;case 4:case 6:case 9:case 11:n=30;break;case 2:n=e%4===0&&e%100!==0||e%400===0?29:28;break;default:throw new Error("你算错了")}return n},t.drawDays=function(e){var n;n=e?new Date(e):new Date;var i=n.getMonth(),a=n.getFullYear();t.month={text:t.monthArr[i],val:i+1},t.year={text:a,val:a},i+=1;var r=t.getDaysCount(a,i),o=t.getDaysCount(a,i-1);t.getDaysCount(a,i+1);n.setDate(1);var s=n.getDay();n.setDate(r);for(var l=n.getDay(),u=[],c=0,d=s?s-1:6;d>c;c++)u.push({year:"",month:"",day:o-c});u.reverse();for(var c=0,d=r;d>c;c++)u.push({year:a,month:i,day:c+1});for(var c=0,d=l?7-l:0;d>c;c++)u.push({year:"",month:"",day:c+1});switch(u.length/7){case 4:for(var c=0;7>c;c++)u.push({year:"",month:"",day:c+1});t.overflow=!1;break;case 6:t.overflow=!0;break;default:t.overflow=!1}return u},t.initDays=function(e){var n=new Date;t.today=n.getDate(),t.toMonth=n.getMonth()+1,t.toYear=n.getFullYear(),t.defaultSelected&&(t.selectedDay=t.today,t.selectedMonth=t.toMonth,t.selectedYear=t.toYear);for(var i=t.toYear-10,a=t.toYear+11;a>i;i++)t.yearList.push(i);t.dayArr=t.drawDays(e),t.update()},t.getNum=function(e){return e>10?e:"0"+e},t.formatter=function(e){var n,i=new Date(t.selectedYear,t.selectedMonth-1,t.selectedDay,0,0,0),a=i.getTime();switch(e){case"unixTimeStamp":n=t.getUnixTimeStamp(a);break;case"timeStamp":n=t.getTimeStamp(a);break;default:if(!e)var e="yyyy/mm/dd";n=e.replace(/(yyyy|mm|dd|yy|m|d)/gi,function(e){return"yyyy"===e?t.selectedYear:"mm"===e?t.getNum(t.selectedMonth):"dd"===e?t.getNum(t.selectedDay):"yy"===e?t.selectedYear.toString().substr(2,4):"m"===e?t.selectedMonth:"d"===e?t.selectedDay:void 0})}return n},t.dayClicked=function(e){t.selectedDay=e.item.day,t.selectedMonth=e.item.month,t.selectedYear=e.item.year,t.onSelect&&t.onSelect(t.formatter,t.getYear(),t.getMonth(),t.getDay()),t.update()},t.open=!1,t.getAbsPoint=function(e){var t=e.offsetLeft,n=e.offsetTop;for(document.documentElement.offsetHeight,document.documentElement.offsetWidth;e=e.offsetParent;)t+=e.offsetLeft,n+=e.offsetTop;return{x:t,y:n}},t.location=function(e){if(t.element){var n=t.getAbsPoint(t.element);t.root.style.position="absolute",t.root.style.top=n.y+t.element.offsetHeight+"px",t.root.style.left=n.x+"px"}},t.closeIt=function(e){var i=e.target.className;e.target===t.element||n.indexOf(i)>-1||i.indexOf("itk-calendar")>-1&&-1===i.indexOf("itk-calendar-day")||(t.open=!1,t.update())},t.openIt=function(e){t.open=!0,t.update(),t.location(e)},t.unbindEvent=function(){t.element&&(document.removeEventListener("click",t.closeIt,!1),t.element.removeEventListener("click",t.openIt,!1))},t.on("mount",function(){var e=t.opts.opts||t.opts||{};if(t.yearList=[],t.mapping(e),t.langMixin(t.customLang),t.initWeekList(t.language),t.initDays(t.initTime),t.element){if(!utils.hasClass(t.element,"itk-calendar-input")&&null!==t.element.getAttribute("calendar")){var i=t.element.parentNode,a=document.createElement("label");a.className=n[0],i.insertBefore(a,t.element),utils.addClass(t.element,n[1]),a.appendChild(t.element);var r=document.createElement("span");r.className=n[2],a.appendChild(r),t.element=a}document.addEventListener("click",t.closeIt,!1),t.element.addEventListener("click",t.openIt,!1)}else t.open=!0;t.update()}),t.on("unmount",function(){t.unbindEvent()}),t.getTimeStamp=function(e){return e},t.getUnixTimeStamp=function(e){return Math.ceil(e/1e3).toString()},t.getYear=function(){return t.selectedYear},t.getMonth=function(){return t.selectedMonth},t.isBoundary=function(e,n,i){var a=t.yearList[0],r=t.yearList[t.yearList.length-1];return a>e||e>r||e===a&&0===n&&-1===i||e===r&&13===n&&1===i?!1:[e,n]},t.getDay=function(){return t.selectedDay},t.reset=function(e){t.dayArr=t.drawDays(new Date(e[0],e[1],1).getTime()),t.update()},t.nextMonth=function(){var e=t.year.val,n=t.month.val-1;e=11===n?e+1:e,n=11===n?0:n+1;var i=t.isBoundary(e,n,1);i&&t.reset(i)},t.prevMonth=function(){var e=t.month.val-1,n=t.year.val;n=0===e?n-1:n,e=0===e?11:e-1;var i=t.isBoundary(n,e,-1);i&&t.reset(i)},t.openYearList=function(){t.openList=!t.openList},t.clickYear=function(e){t.openList=!1,t.reset([e.item.i,t.month.val-1])}}),riot.tag("itk-center",'
',function(e){var t=this;t.opts.opts||t.opts;t["default"]=!1,t.on("mount",function(){var e=t.root.parentNode,n=window.getComputedStyle(e,null).position;"static"===n&&(e.style.position="relative"),t.childDom=t.root.getElementsByClassName("itk-loading")[0],t.childDom.innerHTML.trim()&&(t["default"]=!1,t.update());var i=parseInt(window.getComputedStyle(t.childDom,null).height.replace("px",""),10);t.root.style.marginTop="-"+i/2+"px"}),t.root.show=function(){t.childDom&&(t.childDom.style.display="block")},t.root.hide=function(){t.childDom&&(t.childDom.style.display="none")}}),riot.tag("date-picker","",function(e){var t=this,n=t.root,i=t.opts.opts||t.opts,a=document.scripts,r="",o="";if(i.path)r=i.path;else{for(var s=0;s",function(e){var t=this,n=t.opts.opts||t.opts,a=t.root;for(i in n)t[i]=n[i];t.getData=function(e){var e=e||{};if(a.getAttribute("data-get"))var n="httpGet";else if(a.getAttribute("data-jsonp"))var n="jsonp";utils[n](t.superDivUrl,e,function(e){for(i in e)t.data={},t.data[i]=e[i];t.update()})},t.on("mount",function(){a.style.display="block",t.superDivUrl=a.getAttribute("data-get")||a.getAttribute("data-jsonp"),t.superDivUrl&&t.getData(n.params)}),t.loadData=a.loadData=function(e,n){n=n||"data",t[n]=e,t.update()},t.reload=a.reload=function(){t.superDivUrl?t.getData(n.params):t.update()}}),riot.tag("itk-editor",'',function(e){var t,n=this,i=n.root,a=n.opts.opts||n.opts,r=document.scripts,o="",s="",l=a.type||"standard",u=a.filebrowserImageUploadUrl;a.initContent&&(t=a.initContent);var c;a.initEditor&&(c=a.initEditor);var d={};if(d.image_previewText="",d.filebrowserImageUploadUrl=u,a.editorConfig){var p=a.editorConfig;for(x in p)"image_previewText"!=x&&"filebrowserImageUploadUrl"!=x&&"initContent"!=x&&"initEditor"!=x&&(d[x]=p[x])}if(a.path)o=a.path;else{for(var f=0;f ',function(e){function t(e){s([],this)}function n(e){return Object.prototype.toString.call(e).match(/\ (.*)\]/)[1]}function a(e){var t=n(e);return"Null"===t||"Undefined"===t||"Function"===t?e:new window[t](e)}function r(e){for(var e=e,t=e.attributes,n={},i=0;io&&e.msg.push(l.minWarning(n)),!r&&o>i&&e.msg.push(l.maxWarning(i))):(o>i||n>o)&&e.msg.push(l.bpWarning(n,i)),e},l.numComparator=function(e,t){var n=parseInt(t.min,10),i=parseInt(t.max,10),a=isNaN(n),r=isNaN(i),o=+t.value;return a||r?(!a&&n>o&&e.msg.push(l.minNumWarning(n)),!r&&o>i&&e.msg.push(l.maxNumWarning(i))):(o>i||n>o)&&e.msg.push(l.numBpWarning(n,i)),e},l.one("mount",function(){if(u.style.display="block",c.realTime&&c.valid)for(var e=l.root.getElementsByTagName("form")[0].elements,n=0,i=e.length;i>n;n++){var a=e[n].type;("submit"!==a||"button"!==a)&&(e[n].addEventListener("input",t,!1),e[n].addEventListener("change",t,!1))}}),u.loadData=function(e,t){if(utils.isObject(e))for(var n in e)e[n]=a(e[n]);else e=a(e);t=t||"data",l[t]=e,l.update()},u.setData=function(e,t){l.data[t]=a(e),l.update()},l.checkExistKey=function(e,t,n){if(e.hasOwnProperty(t))if(utils.isArray(e[t]))e[t].push(n);else{var i=[];i.push(e[t]),i.push(n),e[t]=i}else e[t]=n},l.getData=u.getData=function(){for(var e=l.root.getElementsByTagName("form")[0].elements,t={},n=0;n
{ title }
',function(e){var t=this,n=t.opts.opts||t.opts;t.root;for(i in n)t[i]=n[i];n.width="string"==typeof n.width&&n.width.match("px")?n.width:n.width+"px",n.height="string"==typeof n.height&&n.height.match("px")?n.height:n.height+"px",t.width=n.width||"600px",t.height=n.height||"auto",t.on("mount",function(){var e=t.root.querySelector(".itk-modal-container"),i=t.root.querySelector(".itk-modal-title"),a=t.root.querySelector(".itk-modal-footer");t.hideFooter&&(a.style.display="none");var r=parseInt(window.getComputedStyle(i,null).height.replace("px","")),o=parseInt(window.getComputedStyle(a,null).height.replace("px",""));n.height&&(e.style.height=parseInt(t.height)-o-r-2+"px")}),document.querySelector("[modal-open-target='"+t.root.id+"']")&&(document.querySelector("[modal-open-target='"+t.root.id+"']").onclick=function(){t.root.style.display="block",t.onOpen&&t.onOpen()}),t.root.open=function(){t.root.style.display="block",t.onOpen&&t.onOpen()},t.close=t.root.close=function(){t.root.style.display="none",t.onClose&&t.onClose()},t.loadData=t.root.loadData=function(e,n){n=n||"data",t[n]=e,t.update()},t.confirm=t.root.confirm=function(e){t.onSubmit&&t.onSubmit()}}),riot.tag("itk-paginate",'
  • «
    • { page }
  • »
  • 跳转到
    请输入1~{ pageCount }之间的数字
    { pageCount } { count }
    ',function(e){var t=this,n=t.root,a=t.opts.opts||t.opts;if(t.showTip="none",t.count=a.count||0,t.pagesize=a.pagesize||20,t.pageCount=a.pageCount||Math.ceil(t.count/t.pagesize)||1,t.currentPage=a.currentPage||1,t.url=a.url||"",t.showNumber=a.showNumber||5,t.redirect=a.redirect||!0,t.showPageCount=a.showPageCount||!0,t.showItemCount=a.showItemCount||!0,t.needInit=a.needInit||!1,t.updateCurrentPage=function(){if(t.currentPage>Math.ceil(t.showNumber/2)&&t.pageCount>t.showNumber){if(t.pages=[],t.pageCount-t.currentPage>2)var e=t.currentPage-Math.ceil(t.showNumber/2),n=t.currentPage+Math.floor(t.showNumber/2);else var n=t.pageCount,e=t.pageCount-t.showNumber;for(i=e;it.showNumber){for(t.pages=[],i=0;in?t.count=0:t.count=n,t.pageCount=Math.ceil(t.count/t.pagesize)||1,t.currentPage=t.currentPage>t.pageCount?t.pageCount:t.currentPage,t.pageCount<=t.showNumber){t.pages=[];for(var r=0;r1&&t.pageChange(t.currentPage-1)}.bind(this),this.goNext=function(e){t.currentPage0?t.pageChange(parseInt(n,10)):(t.tipsLeft=t.page.offsetLeft,t.tipsTop=t.page.offsetTop+t.page.offsetHeight+8,t.showTip="block",setTimeout(function(){t.showTip="none",t.update()},1500),t.update())}.bind(this),this.changePage=function(e){var n=e.item.page;return"string"==typeof n?!1:void t.pageChange(n)}.bind(this),t.pageChange=function(e){t.currentPage!=e&&(t.currentPage=e,a.callback(e)),t.updateCurrentPage()}}),riot.tag("itk-select",'
    • { name } ×
    • { name }
    • { name }
    • 无搜索结果
    ',function(e){var t=this,n=t.opts.opts||t.opts;t.gotOptions=!1,t.chooseOnce=!0,t.init=t.root.init=function(){t.gotOptions=!1,t.update()},t.realData=[],t.root.exportData=t.realData,t.initData=t.root.initData=function(){if(t.root.querySelector("select")){var e=t.root.querySelector("select").querySelectorAll("option"),n=t.root.querySelector("select").hasAttribute("mutiple");n?t.mutiple=!0:(t.mutiple=!1,t.noSearch=!0)}if(e&&e.length&&!t.gotOptions){for(t.options=e,t.searchInput=t.root.querySelector(".itk-select-search"),t.optionsWrap=t.root.querySelector(".itk-options-container"),t.realData=[],i=0;i=n.options.length&&(n.seletedIndex=0),t.setSelectedOpt(n)):13===i?t.chooseByKeyboard(n):27===i&&t.searchInput.blur()},t.chooseByKeyboard=function(e){var t=document.createEvent("MouseEvents"),n=e.options[e.seletedIndex];t.initEvent("mousedown",!0,!0),n&&n.dispatchEvent(t)},t.clearSelectedOpt=function(e){if(e.options){var t=e.options[e.seletedIndex];e.seletedIndex>=0&&t&&(t.style.background="",t.scrollIntoView())}},t.resetSelectOpt=function(){t.clearSelectedOpt(t.searchInput),t.searchInput.seletedIndex=-1},t.setSelectedOpt=function(e){var t=e.options[e.seletedIndex];t&&(t.style.background="#eff3f8",t.scrollIntoView())}}),riot.tag("itk-slide"," ",function(e){for(var t=this,n=t.root,i=t.opts.opts||t.opts,a=document.scripts,r="",o="",s=0;s",function(e){var t=this,n=t.opts.opts||t.opts,a=t.root;t.init=function(){a.style.display="block";for(i in n)t[i]||(t[i]=n[i]);t.originData=utils.deepCopy(t.data),t.update()},t.on("mount",function(){t.init()}),t.compare=function(e,n){return e[t.orderkeyName]>n[t.orderkeyName]?1:e[t.orderkeyName]===n[t.orderkeyName]?0:-1},t.clearOrder=function(){t.ordered=!1,t.reversed=!1},t.loadData=a.loadData=function(e){return t.data=e,t.originData=utils.deepCopy(e),t.update(),t.data},t.exportData=a.exportData=function(){return t.data},t.reset=a.reset=function(){t.data=utils.deepCopy(t.originData),t.update()},t.orderBy=function(e){return function(){return t.orderkeyName=e,t.ordered!==e&&(t.reversed!==e?t.data=t.data.sort(t.compare):t.data=t.data.reverse(),t.ordered=e,t.reversed=!1,t.update()),t.data}},a.orderBy=function(e){t.orderBy(e)()},t.reverseBy=function(e){return function(){return t.orderkeyName=e,t.reversed!==e&&(t.ordered!==e?(t.data=t.data.sort(t.compare),t.data=t.data.reverse()):t.data=t.data.reverse(),t.ordered=!1,t.reversed=e,t.update()),t.data}},a.reverseBy=function(e){t.reverseBy(e)()},t.toggleBy=function(e){return t.ordered===e?t.reverseBy(e):t.orderBy(e)},a.toggleBy=function(e){t.ordered===e?a.reverseBy(e):a.orderBy(e)},t.append=function(e){return function(){t.clearOrder(),utils.isObject(e)?t.data.push(e):utils.isArray(e)&&(t.data=t.data.concat(e)),t.update()}},a.append=function(e){t.append(e)()},t.prepend=function(e){return function(){t.clearOrder(),utils.isObject(e)?t.data.unshift(e):utils.isArray(e)&&(t.data=e.concat(t.data)),t.update()}},a.prepend=function(e){t.prepend(e)()},t.deleteBy=function(e,n){return function(){if(e&&n){t.clearOrder();for(var i=0;i
    { item.name }
    ',function(e){var t=this;t.iconType=t.parent.rootConfig.iconType||"arrow",t.selectchildren=function(e,n){var i=function(e){if(e&&e.children)for(var t=0;t
    ',function(e){var t=this;if(t.config=t.opts.opts||t.opts,t.dataHandle=function(e,n,i){var e=e||[],a=n||"id",r=i||"pid",o={};e.forEach(function(e){t.config.name&&(e.name=e[t.config.name]),o[e[a]]=e});var s=[];e.forEach(function(e){var t=o[e[r]];t?(t.children||(t.children=[]),e.pnode=t,t.children.push(e)):s.push(e)});var l=function(e,n){var n=n+1;e.forEach(function(e){e.level=n-1,e.level
    { text }
    ',function(e){var t=this,n=t.root,i=t.opts.opts||t.opts;t.text=i.buttonText||"上传文件";for(var a=document.scripts,r="",o=0;o
    { title }
    ',function(e){var t=this,n=t.opts.opts||t.opts;t.root;for(i in n)t[i]=n[i];n.width="string"==typeof n.width&&n.width.match("px")?n.width:n.width+"px",n.height="string"==typeof n.height&&n.height.match("px")?n.height:n.height+"px",t.width=n.width||"600px",t.height=n.height||"auto",t.on("mount",function(){var e=t.root.querySelector(".itk-modal-container"),i=t.root.querySelector(".itk-modal-title"),a=t.root.querySelector(".itk-modal-footer");t.hideFooter&&(a.style.display="none");var r=parseInt(window.getComputedStyle(i,null).height.replace("px","")),o=parseInt(window.getComputedStyle(a,null).height.replace("px",""));n.height&&(e.style.height=parseInt(t.height)-o-r-2+"px")}),document.querySelector("[modal-open-target='"+t.root.id+"']")&&(document.querySelector("[modal-open-target='"+t.root.id+"']").onclick=function(){t.root.style.display="block",t.onOpen&&t.onOpen()}),t.root.open=function(){t.root.style.display="block",t.onOpen&&t.onOpen()},t.close=t.root.close=function(){t.root.style.display="none",t.onClose&&t.onClose()},t.loadData=t.root.loadData=function(e,n){n=n||"data",t[n]=e,t.update()},t.confirm=t.root.confirm=function(e){t.onSubmit&&t.onSubmit()}}),riot.tag("itk-paginate",'
  • «
    • { page }
  • »
  • 跳转到
    请输入1~{ pageCount }之间的数字
    { pageCount } { count }
    ',function(e){var t=this,n=t.root,a=t.opts.opts||t.opts;if(t.showTip="none",t.count=a.count||0,t.pagesize=a.pagesize||20,t.pageCount=a.pageCount||Math.ceil(t.count/t.pagesize)||1,t.currentPage=a.currentPage||1,t.url=a.url||"",t.showNumber=a.showNumber||5,t.redirect=a.redirect||!0,t.showPageCount=a.showPageCount||!0,t.showItemCount=a.showItemCount||!0,t.needInit=a.needInit||!1,t.updateCurrentPage=function(){if(t.currentPage>Math.ceil(t.showNumber/2)&&t.pageCount>t.showNumber){if(t.pages=[],t.pageCount-t.currentPage>2)var e=t.currentPage-Math.ceil(t.showNumber/2),n=t.currentPage+Math.floor(t.showNumber/2);else var n=t.pageCount,e=t.pageCount-t.showNumber;for(i=e;it.showNumber){for(t.pages=[],i=0;in?t.count=0:t.count=n,t.pageCount=Math.ceil(t.count/t.pagesize)||1,t.currentPage=t.currentPage>t.pageCount?t.pageCount:t.currentPage,t.pageCount<=t.showNumber){t.pages=[];for(var r=0;r1&&t.pageChange(t.currentPage-1)}.bind(this),this.goNext=function(e){t.currentPage0?t.pageChange(parseInt(n,10)):(t.tipsLeft=t.page.offsetLeft,t.tipsTop=t.page.offsetTop+t.page.offsetHeight+8,t.showTip="block",setTimeout(function(){t.showTip="none",t.update()},1500),t.update())}.bind(this),this.changePage=function(e){var n=e.item.page;return"string"==typeof n?!1:void t.pageChange(n)}.bind(this),t.pageChange=function(e){t.currentPage!=e&&(t.currentPage=e,a.callback(e)),t.updateCurrentPage()}}),riot.tag("itk-select",'
    • { name } ×
    • { name }
    • { name }
    • 无搜索结果
    ',function(e){var t=this,n=t.opts.opts||t.opts;t.gotOptions=!1,t.chooseOnce=!0,t.init=t.root.init=function(){t.gotOptions=!1,t.update()},t.realData=[],t.root.exportData=t.realData,t.initData=t.root.initData=function(){if(t.root.querySelector("select")){var e=t.root.querySelector("select").querySelectorAll("option"),n=t.root.querySelector("select").hasAttribute("mutiple");n?t.mutiple=!0:(t.mutiple=!1,t.noSearch=!0)}if(e&&e.length&&!t.gotOptions){for(t.options=e,t.searchInput=t.root.querySelector(".itk-select-search"),t.optionsWrap=t.root.querySelector(".itk-options-container"),t.realData=[],i=0;i=n.options.length&&(n.seletedIndex=0),t.setSelectedOpt(n)):13===i?t.chooseByKeyboard(n):27===i&&t.searchInput.blur()},t.chooseByKeyboard=function(e){var t=document.createEvent("MouseEvents"),n=e.options[e.seletedIndex];t.initEvent("mousedown",!0,!0),n&&n.dispatchEvent(t)},t.clearSelectedOpt=function(e){if(e.options){var t=e.options[e.seletedIndex];e.seletedIndex>=0&&t&&(t.style.background="",t.scrollIntoView())}},t.resetSelectOpt=function(){t.clearSelectedOpt(t.searchInput),t.searchInput.seletedIndex=-1},t.setSelectedOpt=function(e){var t=e.options[e.seletedIndex];t&&(t.style.background="#eff3f8",t.scrollIntoView())}}),riot.tag("itk-slide"," ",function(e){for(var t=this,n=t.root,i=t.opts.opts||t.opts,a=document.scripts,r="",o="",s=0;s",function(e){var t=this,n=t.opts.opts||t.opts,a=t.root;t.init=function(){a.style.display="block";for(i in n)t[i]||(t[i]=n[i]);t.originData=utils.deepCopy(t.data),t.update()},t.on("mount",function(){t.init()}),t.compare=function(e,n){return e[t.orderkeyName]>n[t.orderkeyName]?1:e[t.orderkeyName]===n[t.orderkeyName]?0:-1},t.clearOrder=function(){t.ordered=!1,t.reversed=!1},t.loadData=a.loadData=function(e){return t.data=e,t.originData=utils.deepCopy(e),t.update(),t.data},t.exportData=a.exportData=function(){return t.data},t.reset=a.reset=function(){t.data=utils.deepCopy(t.originData),t.update()},t.orderBy=function(e){return function(){return t.orderkeyName=e,t.ordered!==e&&(t.reversed!==e?t.data=t.data.sort(t.compare):t.data=t.data.reverse(),t.ordered=e,t.reversed=!1,t.update()),t.data}},a.orderBy=function(e){t.orderBy(e)()},t.reverseBy=function(e){return function(){return t.orderkeyName=e,t.reversed!==e&&(t.ordered!==e?(t.data=t.data.sort(t.compare),t.data=t.data.reverse()):t.data=t.data.reverse(),t.ordered=!1,t.reversed=e,t.update()),t.data}},a.reverseBy=function(e){t.reverseBy(e)()},t.toggleBy=function(e){return t.ordered===e?t.reverseBy(e):t.orderBy(e)},a.toggleBy=function(e){t.ordered===e?a.reverseBy(e):a.orderBy(e)},t.append=function(e){return function(){t.clearOrder(),utils.isObject(e)?t.data.push(e):utils.isArray(e)&&(t.data=t.data.concat(e)),t.update()}},a.append=function(e){t.append(e)()},t.prepend=function(e){return function(){t.clearOrder(),utils.isObject(e)?t.data.unshift(e):utils.isArray(e)&&(t.data=e.concat(t.data)),t.update()}},a.prepend=function(e){t.prepend(e)()},t.deleteBy=function(e,n){return function(){if(e&&n){t.clearOrder();for(var i=0;i
    { item.name }
    ',function(e){var t=this;t.iconType=t.parent.rootConfig.iconType||"arrow",t.selectchildren=function(e,n){var i=function(e){if(e&&e.children)for(var t=0;t
    ',function(e){var t=this;if(t.config=t.opts.opts||t.opts,t.dataHandle=function(e,n,i){var e=e||[],a=n||"id",r=i||"pid",o={};e.forEach(function(e){t.config.name&&(e.name=e[t.config.name]),o[e[a]]=e});var s=[];e.forEach(function(e){var t=o[e[r]];t?(t.children||(t.children=[]),e.pnode=t,t.children.push(e)):s.push(e)});var l=function(e,n){var n=n+1;e.forEach(function(e){e.level=n-1,e.level
    { text }
    ',function(e){var t=this,n=t.root,i=t.opts.opts||t.opts;t.text=i.buttonText||"上传文件";for(var a=document.scripts,r="",o=0;oitk-form
    console.log('beforeSubmit'); } } + itk.mount('itk-form', opts); var theForm = document.querySelector('itk-form'); diff --git a/src/itoolkit.js b/src/itoolkit.js index 32e5da8..1fc7459 100644 --- a/src/itoolkit.js +++ b/src/itoolkit.js @@ -1077,7 +1077,6 @@ riot.tag('itk-form', '
    ', function(o validArr.push(e); } } - console.log(validArr); if (!validArr.length) { if (config.normalSubmit) { self.root.firstChild.setAttribute('action', action); @@ -1241,6 +1240,7 @@ riot.tag('itk-form', '
    ', function(o self.rules[ruleConfig] = self.rulesConfig[ruleConfig]; } } + self.update(); }; diff --git a/src/pc/itk-form.tag b/src/pc/itk-form.tag index ff0a61f..599d4fa 100644 --- a/src/pc/itk-form.tag +++ b/src/pc/itk-form.tag @@ -417,7 +417,6 @@ validArr.push(e); } } - console.log(validArr); if (!validArr.length) { if (config.normalSubmit) { self.root.firstChild.setAttribute('action', action); @@ -591,6 +590,7 @@ self.rules[ruleConfig] = self.rulesConfig[ruleConfig]; } } + self.update(); };