chunk-43763ee6.d5c0f96a.js 10 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-43763ee6","chunk-2d0df437"],{"88bc":function(e,t,a){(function(t){var a=1/0,r=9007199254740991,n="[object Arguments]",i="[object Function]",o="[object GeneratorFunction]",l="[object Symbol]",s="object"==typeof t&&t&&t.Object===Object&&t,c="object"==typeof self&&self&&self.Object===Object&&self,u=s||c||Function("return this")();function d(e,t,a){switch(a.length){case 0:return e.call(t);case 1:return e.call(t,a[0]);case 2:return e.call(t,a[0],a[1]);case 3:return e.call(t,a[0],a[1],a[2])}return e.apply(t,a)}function f(e,t){var a=-1,r=e?e.length:0,n=Array(r);while(++a<r)n[a]=t(e[a],a,e);return n}function m(e,t){var a=-1,r=t.length,n=e.length;while(++a<r)e[n+a]=t[a];return e}var p=Object.prototype,b=p.hasOwnProperty,h=p.toString,y=u.Symbol,v=p.propertyIsEnumerable,g=y?y.isConcatSpreadable:void 0,w=Math.max;function k(e,t,a,r,n){var i=-1,o=e.length;a||(a=O),n||(n=[]);while(++i<o){var l=e[i];t>0&&a(l)?t>1?k(l,t-1,a,r,n):m(n,l):r||(n[n.length]=l)}return n}function j(e,t){return e=Object(e),S(e,t,(function(t,a){return a in e}))}function S(e,t,a){var r=-1,n=t.length,i={};while(++r<n){var o=t[r],l=e[o];a(l,o)&&(i[o]=l)}return i}function C(e,t){return t=w(void 0===t?e.length-1:t,0),function(){var a=arguments,r=-1,n=w(a.length-t,0),i=Array(n);while(++r<n)i[r]=a[t+r];r=-1;var o=Array(t+1);while(++r<t)o[r]=a[r];return o[t]=i,d(e,this,o)}}function O(e){return E(e)||R(e)||!!(g&&e&&e[g])}function x(e){if("string"==typeof e||D(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function R(e){return A(e)&&b.call(e,"callee")&&(!v.call(e,"callee")||h.call(e)==n)}var E=Array.isArray;function N(e){return null!=e&&L(e.length)&&!$(e)}function A(e){return I(e)&&N(e)}function $(e){var t=P(e)?h.call(e):"";return t==i||t==o}function L(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}function P(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function I(e){return!!e&&"object"==typeof e}function D(e){return"symbol"==typeof e||I(e)&&h.call(e)==l}var T=C((function(e,t){return null==e?{}:j(e,f(k(t,1),x))}));e.exports=T}).call(this,a("c8ba"))},9655:function(e,t,a){"use strict";a.r(t);var r=function(){var e=this,t=e._self._c;return t("a-modal",{attrs:{title:e.title,width:1e3,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[t("a-spin",{attrs:{spinning:e.confirmLoading}},[t("a-form",{attrs:{form:e.form}},[t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则名称"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["ruleName",e.validatorRules.ruleName],expression:"['ruleName', validatorRules.ruleName]"}],attrs:{placeholder:"请输入规则名称"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则Code"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["ruleCode",e.validatorRules.ruleCode],expression:"['ruleCode', validatorRules.ruleCode]"}],attrs:{placeholder:"请输入规则Code"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则描述"}},[t("a-textarea",{directives:[{name:"decorator",rawName:"v-decorator",value:["ruleDescription",{}],expression:"['ruleDescription', {}]"}],attrs:{placeholder:"请输入规则描述"}})],1)],1),t("a-tabs",{model:{value:e.tabs.activeKey,callback:function(t){e.$set(e.tabs,"activeKey",t)},expression:"tabs.activeKey"}},[t("a-tab-pane",{key:e.tabs.design.key,attrs:{tab:"局部规则",forceRender:""}},[t("a-alert",{attrs:{type:"info",showIcon:"",message:"局部规则按照你输入的位数有序的校验。"}}),t("j-editable-table",{ref:"designTable",staticStyle:{"margin-top":"8px"},attrs:{dragSort:"",rowNumber:"",maxHeight:240,columns:e.tabs.design.columns,dataSource:e.tabs.design.dataSource},scopedSlots:e._u([{key:"action",fn:function(e){return[t("my-action-button",{attrs:{rowEvent:e}})]}}])})],1),t("a-tab-pane",{key:e.tabs.global.key,attrs:{tab:"全局规则",forceRender:""}},[t("j-editable-table",{ref:"globalTable",attrs:{dragSort:"",rowNumber:"",actionButton:"",maxHeight:240,columns:e.tabs.global.columns,dataSource:e.tabs.global.dataSource},scopedSlots:e._u([{key:"actionButtonAfter",fn:function(){return[t("a-alert",{staticStyle:{"margin-bottom":"8px"},attrs:{type:"info",showIcon:"",message:"全局规则可校验用户输入的所有字符;全局规则的优先级比局部规则的要高。"}})]},proxy:!0},{key:"action",fn:function(e){return[t("my-action-button",{attrs:{rowEvent:e,allowEmpty:""}})]}}])})],1)],1)],1)],1)},n=[],i=a("88bc"),o=a.n(i),l=a("0fea"),s=a("ca00"),c=a("e2e0"),u=a("7550");function d(e,t){return h(e)||b(e,t)||m(e,t)||f()}function f(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function m(e,t){if(e){if("string"===typeof e)return p(e,t);var a=Object.prototype.toString.call(e).slice(8,-1);return"Object"===a&&e.constructor&&(a=e.constructor.name),"Map"===a||"Set"===a?Array.from(e):"Arguments"===a||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var a=0,r=new Array(t);a<t;a++)r[a]=e[a];return r}function b(e,t){var a=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=a){var r,n,i=[],o=!0,l=!1;try{for(a=a.call(e);!(o=(r=a.next()).done);o=!0)if(i.push(r.value),t&&i.length===t)break}catch(s){l=!0,n=s}finally{try{o||null==a["return"]||a["return"]()}finally{if(l)throw n}}return i}}function h(e){if(Array.isArray(e))return e}var y={name:"SysCheckRuleModal",components:{JEditableTable:u["default"],"my-action-button":{props:{rowEvent:Object,allowEmpty:Boolean},methods:{confirmIsShow:function(){var e=this.rowEvent,t=e.index,a=e.allValues.inputValues,r=a[t];return r.digits||r.pattern},handleLineAdd:function(){var e=this.rowEvent.target;e.add()},handleLineDelete:function(){var e=this.rowEvent,t=e.rowId,a=e.target;a.removeRows(t)},renderDeleteButton:function(){var e=this.$createElement;return this.allowEmpty||this.rowEvent.index>0?this.confirmIsShow()?e("a-popconfirm",{attrs:{title:"确定要删除吗?"},on:{confirm:this.handleLineDelete}},[e("a-button",{attrs:{icon:"minus"}})]):e("a-button",{attrs:{icon:"minus"},on:{click:this.handleLineDelete}}):""}},render:function(){var e=arguments[0];return e("div",[e("a-button",{on:{click:this.handleLineAdd},attrs:{icon:"plus"}})," ",this.renderDeleteButton()])}}},data:function(){var e=this;return{title:"操作",visible:!1,model:{},labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),validatorRules:{ruleName:{rules:[{required:!0,message:"请输入规则名称!"}]},ruleCode:{rules:[{required:!0,message:"请输入规则Code!"},{validator:function(t,a,r){return Object(s["m"])("sys_check_rule","rule_code",a,e.model.id,r)}}]}},tabs:{activeKey:"design",global:{key:"global",columns:[{title:"优先级",key:"priority",width:"15%",type:c["a"].select,defaultValue:"1",options:[{title:"优先运行",value:"1"},{title:"最后运行",value:"0"}],validateRules:[]},{title:"规则(正则表达式)",key:"pattern",width:"50%",type:c["a"].input,validateRules:[{required:!0,message:"规则不能为空"},{handler:this.validatePatternHandler}]},{title:"提示文本",key:"message",width:"20%",type:c["a"].input,validateRules:[{required:!0,message:"${title}不能为空"}]},{title:"操作",key:"action",width:"15%",slotName:"action",type:c["a"].slot}],dataSource:[]},design:{key:"design",columns:[{title:"位数",key:"digits",width:"15%",type:c["a"].inputNumber,validateRules:[{required:!0,message:"${title}不能为空"},{pattern:/^[1-9]\d*$/,message:"请输入零以上的正整数"}]},{title:"规则(正则表达式)",key:"pattern",width:"50%",type:c["a"].input,validateRules:[{required:!0,message:"规则不能为空"},{handler:this.validatePatternHandler}]},{title:"提示文本",key:"message",width:"20%",type:c["a"].input,validateRules:[{required:!0,message:"${title}不能为空"}]},{title:"操作",key:"action",width:"15%",slotName:"action",type:c["a"].slot}],dataSource:[]}},url:{add:"/sys/checkRule/add",edit:"/sys/checkRule/edit"}}},created:function(){},methods:{validatePatternHandler:function(e,t,a,r,n,i){if("blur"===e||"getValues"===e)try{new RegExp(t),n(!0)}catch(o){n(!1,"请输入正确的正则表达式")}else n(!0)},add:function(){this.edit({})},edit:function(e){var t=this;this.form.resetFields(),this.tabs.activeKey=this.tabs.design.key,this.tabs.global.dataSource=[],this.tabs.design.dataSource=[{digits:"",pattern:"",message:""}],this.model=Object.assign({},e),this.visible=!0,this.$nextTick((function(){t.form.setFieldsValue(o()(t.model,"ruleName","ruleCode","ruleDescription"));var e=t.model.ruleJson;if(e){var a=JSON.parse(e),r=[],n=[],i="1";a.forEach((function(e){"*"===e.digits?r.push(Object.assign(e,{priority:i})):(i="0",n.push(e))})),t.tabs.global.dataSource=r,t.tabs.design.dataSource=n}}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var e=this;Promise.all([Object(s["a"])(new Promise((function(t,a){e.form.validateFields((function(e,r){return e?a(e):t(r)}))}))),Object(s["a"])(this.$refs.designTable.getValuesPromise),Object(s["a"])(this.$refs.globalTable.getValuesPromise)]).then((function(t){var a=d(t,3),r=a[0],n=a[1],i=a[2];if(r.type===s["c"])return Promise.reject("主表校验未通过");if(n.type===s["c"])return e.tabs.activeKey=e.tabs.design.key,Promise.reject("局部规则子表校验未通过");if(i.type===s["c"])return e.tabs.activeKey=e.tabs.global.key,Promise.reject("全局规则子表校验未通过");var c=r.data,u=i.data,f=n.data,m=[],p=[];u.forEach((function(e){e.digits="*","1"===e.priority?m.push(e):p.push(e)}));var b=m.concat(f).concat(p),h=b.map((function(e){return o()(e,"digits","pattern","message")})),y=JSON.stringify(h),v=Object.assign(e.model,c,{ruleJson:y}),g="post",w=e.url.add;return e.model.id&&(g="put",w=e.url.edit),e.confirmLoading=!0,Object(l["i"])(w,v,g)})).then((function(t){t.success?(e.$message.success(t.message),e.$emit("ok"),e.close()):e.$message.warning(t.message)})).catch((function(e){})).finally((function(){e.confirmLoading=!1}))},handleCancel:function(){this.close()}}},v=y,g=a("2877"),w=Object(g["a"])(v,r,n,!1,null,"d5e33ef6",null);t["default"]=w.exports}}]);