You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ocr-web/dist/js/chunk-43763ee6.26290903.js

1 line
10 KiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-43763ee6"],{"88bc":function(e,t,a){(function(t){var a=1/0,n=9007199254740991,r="[object Arguments]",o="[object Function]",i="[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,n=e?e.length:0,r=Array(n);while(++a<n)r[a]=t(e[a],a,e);return r}function m(e,t){var a=-1,n=t.length,r=e.length;while(++a<n)e[r+a]=t[a];return e}var p=Object.prototype,b=p.hasOwnProperty,h=p.toString,y=u.Symbol,g=p.propertyIsEnumerable,v=y?y.isConcatSpreadable:void 0,w=Math.max;function k(e,t,a,n,r){var o=-1,i=e.length;a||(a=O),r||(r=[]);while(++o<i){var l=e[o];t>0&&a(l)?t>1?k(l,t-1,a,n,r):m(r,l):n||(r[r.length]=l)}return r}function j(e,t){return e=Object(e),S(e,t,(function(t,a){return a in e}))}function S(e,t,a){var n=-1,r=t.length,o={};while(++n<r){var i=t[n],l=e[i];a(l,i)&&(o[i]=l)}return o}function C(e,t){return t=w(void 0===t?e.length-1:t,0),function(){var a=arguments,n=-1,r=w(a.length-t,0),o=Array(r);while(++n<r)o[n]=a[t+n];n=-1;var i=Array(t+1);while(++n<t)i[n]=a[n];return i[t]=o,d(e,this,i)}}function O(e){return E(e)||$(e)||!!(v&&e&&e[v])}function x(e){if("string"==typeof e||I(e))return e;var t=e+"";return"0"==t&&1/e==-a?"-0":t}function $(e){return R(e)&&b.call(e,"callee")&&(!g.call(e,"callee")||h.call(e)==r)}var E=Array.isArray;function A(e){return null!=e&&L(e.length)&&!N(e)}function R(e){return D(e)&&A(e)}function N(e){var t=P(e)?h.call(e):"";return t==o||t==i}function L(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=n}function P(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function D(e){return!!e&&"object"==typeof e}function I(e){return"symbol"==typeof e||D(e)&&h.call(e)==l}var q=C((function(e,t){return null==e?{}:j(e,f(k(t,1),x))}));e.exports=q}).call(this,a("c8ba"))},9655:function(e,t,a){"use strict";a.r(t);var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("a-modal",{attrs:{title:e.title,width:1e3,visible:e.visible,confirmLoading:e.confirmLoading,cancelText:"关闭"},on:{ok:e.handleOk,cancel:e.handleCancel}},[a("a-spin",{attrs:{spinning:e.confirmLoading}},[a("a-form-model",{ref:"form",attrs:{model:e.model,rules:e.validatorRules}},[a("a-form-model-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则名称",prop:"ruleName"}},[a("a-input",{attrs:{placeholder:"请输入规则名称"},model:{value:e.model.ruleName,callback:function(t){e.$set(e.model,"ruleName",t)},expression:"model.ruleName"}})],1),a("a-form-model-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则Code",prop:"ruleCode"}},[a("a-input",{attrs:{placeholder:"请输入规则Code"},model:{value:e.model.ruleCode,callback:function(t){e.$set(e.model,"ruleCode",t)},expression:"model.ruleCode"}})],1),a("a-form-model-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则描述",prop:"ruleDescription"}},[a("a-textarea",{attrs:{placeholder:"请输入规则描述"},model:{value:e.model.ruleDescription,callback:function(t){e.$set(e.model,"ruleDescription",t)},expression:"model.ruleDescription"}})],1)],1),a("a-tabs",{model:{value:e.tabs.activeKey,callback:function(t){e.$set(e.tabs,"activeKey",t)},expression:"tabs.activeKey"}},[a("a-tab-pane",{key:e.tabs.design.key,attrs:{tab:"局部规则",forceRender:""}},[a("a-alert",{attrs:{type:"info",showIcon:"",message:"局部规则按照你输入的位数有序的校验。"}}),a("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[a("my-action-button",{attrs:{rowEvent:e}})]}}])})],1),a("a-tab-pane",{key:e.tabs.global.key,attrs:{tab:"全局规则",forceRender:""}},[a("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[a("a-alert",{staticStyle:{"margin-bottom":"8px"},attrs:{type:"info",showIcon:"",message:"全局规则可校验用户输入的所有字符;全局规则的优先级比局部规则的要高。"}})]},proxy:!0},{key:"action",fn:function(e){return[a("my-action-button",{attrs:{rowEvent:e,allowEmpty:""}})]}}])})],1)],1)],1)],1)},r=[],o=a("88bc"),i=a.n(o),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,n=new Array(t);a<t;a++)n[a]=e[a];return n}function b(e,t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(e)){var a=[],n=!0,r=!1,o=void 0;try{for(var i,l=e[Symbol.iterator]();!(n=(i=l.next()).done);n=!0)if(a.push(i.value),t&&a.length===t)break}catch(s){r=!0,o=s}finally{try{n||null==l["return"]||l["return"]()}finally{if(r)throw o}}return a}}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,n=a[t];return n.digits||n.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,validatorRules:{ruleName:[{required:!0,message:"请输入规则名称!"}],ruleCode:[{required:!0,message:"请输入规则Code!"},{validator:function(t,a,n){return Object(s["q"])("sys_check_rule","rule_code",a,e.model.id,n)}}]},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,n,r,o){if("blur"===e||"getValues"===e)try{new RegExp(t),r(!0)}catch(i){r(!1,"请输入正确的正则表达式")}else r(!0)},add:function(){this.edit({})},edit:function(e){var t=this;this.tabs.activeKey=this.tabs.design.key,this.tabs.global.dataSource=[],this.tabs.design.dataSource=[{digits:"",pattern:"",message:""}],this.visible=!0,this.$nextTick((function(){t.$refs.form.resetFields(),t.model=Object.assign({},e);var a=t.model.ruleJson;if(a){var n=JSON.parse(a),r=[],o=[],i="1";n.forEach((function(e){"*"===e.digits?r.push(Object.assign(e,{priority:i})):(i="0",o.push(e))})),t.tabs.global.dataSource=r,t.tabs.design.dataSource=o}}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var e=this;Promise.all([Object(s["a"])(new Promise((function(t,a){e.$refs.form.validate((function(n,r){return n?t(e.model):a(r)}))}))),Object(s["a"])(this.$refs.designTable.getValuesPromise),Object(s["a"])(this.$refs.globalTable.getValuesPromise)]).then((function(t){var a=d(t,3),n=a[0],r=a[1],o=a[2];if(n.type===s["c"])return Promise.reject("主表校验未通过");if(r.type===s["c"])return e.tabs.activeKey=e.tabs.design.key,Promise.reject("局部规则子表校验未通过");if(o.type===s["c"])return e.tabs.activeKey=e.tabs.global.key,Promise.reject("全局规则子表校验未通过");var c=n.data,u=o.data,f=r.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 i()(e,"digits","pattern","message")})),y=JSON.stringify(h),g=Object.assign(e.model,c,{ruleJson:y}),v="post",w=e.url.add;return e.model.id&&(v="put",w=e.url.edit),e.confirmLoading=!0,Object(l["h"])(w,g,v)})).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()}}},g=y,v=a("2877"),w=Object(v["a"])(g,n,r,!1,null,"717e3950",null);t["default"]=w.exports}}]);