1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-b4b1d770","chunk-e9ca8404","chunk-2d0df437"],{"4ba5":function(e,t,r){"use strict";r("9ad5")},"56cd1":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e._self._c;return t("a-drawer",{attrs:{title:"数据权限规则",width:e.drawerWidth,visible:e.visible},on:{close:e.onClose}},[t("div",{style:{padding:"10px",border:"1px solid #e9e9e9",background:"#fff"}},[t("div",{staticClass:"table-page-search-wrapper"},[t("a-form",{nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.searchQuery.apply(null,arguments)}}},[t("a-row",{attrs:{gutter:12}},[t("a-col",{attrs:{md:8,sm:8}},[t("a-form-item",{attrs:{label:"规则名称",labelCol:{span:8},wrapperCol:{span:14,offset:1}}},[t("a-input",{attrs:{placeholder:"请输入规则名称"},model:{value:e.queryParam.ruleName,callback:function(t){e.$set(e.queryParam,"ruleName",t)},expression:"queryParam.ruleName"}})],1)],1),t("a-col",{attrs:{md:8,sm:8}},[t("a-form-item",{attrs:{label:"规则值",labelCol:{span:8},wrapperCol:{span:14,offset:1}}},[t("a-input",{attrs:{placeholder:"请输入规则值"},model:{value:e.queryParam.ruleValue,callback:function(t){e.$set(e.queryParam,"ruleValue",t)},expression:"queryParam.ruleValue"}})],1)],1),t("a-col",{attrs:{md:7,sm:8}},[t("span",{staticClass:"table-page-search-submitButtons",staticStyle:{float:"left",overflow:"hidden"}},[t("a-button",{attrs:{type:"primary",icon:"search"},on:{click:e.searchQuery}},[e._v("查询")]),t("a-button",{staticStyle:{"margin-left":"8px"},attrs:{type:"primary",icon:"reload"},on:{click:e.searchReset}},[e._v("重置")])],1)])],1),t("a-row",[t("a-col",{attrs:{md:24,sm:24}},[t("a-button",{staticStyle:{"margin-bottom":"10px"},attrs:{type:"primary",icon:"plus"},on:{click:e.addPermissionRule}},[e._v("添加")])],1)],1)],1),t("a-table",{ref:"table",attrs:{rowKey:"id",size:"middle",columns:e.columns,dataSource:e.dataSource,loading:e.loading,rowClassName:e.getRowClassname},scopedSlots:e._u([{key:"action",fn:function(r,a){return t("span",{},[t("a",{on:{click:function(t){return e.handleEdit(a)}}},[t("a-icon",{attrs:{type:"edit"}}),e._v("编辑\n ")],1),t("a-divider",{attrs:{type:"vertical"}}),t("a-popconfirm",{attrs:{title:"确定删除吗?"},on:{confirm:function(){return e.handleDelete(a.id)}}},[t("a",[e._v("删除")])])],1)}}])})],1)]),t("permission-data-rule-modal",{ref:"modalForm",on:{ok:e.modalFormOk}})],1)},l=[],i=r("4ec3"),n=r("b65a"),o=r("7c33"),s=[{title:"规则名称",dataIndex:"ruleName",key:"ruleName"},{title:"规则字段",dataIndex:"ruleColumn",key:"ruleColumn"},{title:"规则值",dataIndex:"ruleValue",key:"ruleValue"},{title:"操作",dataIndex:"action",scopedSlots:{customRender:"action"},align:"center"}],u={name:"PermissionDataRuleList",mixins:[n["a"]],components:{PermissionDataRuleModal:o["default"]},data:function(){return{queryParam:{},drawerWidth:650,columns:s,permId:"",visible:!1,form:this.$form.createForm(this),loading:!1,url:{list:"/sys/permission/getPermRuleListByPermId",delete:"/sys/permission/deletePermissionRule"}}},created:function(){this.resetScreenSize()},methods:{loadData:function(){if(this.permId){var e=this;this.dataSource=[];var t=this.getQueryParams();Object(i["w"])(t).then((function(t){t.success&&(e.dataSource=t.result)}))}},edit:function(e){e.id&&(this.visible=!0,this.permId=e.id),this.queryParam={},this.queryParam.permissionId=e.id,this.visible=!0,this.loadData(),this.resetScreenSize()},addPermissionRule:function(){this.$refs.modalForm.add(this.permId),this.$refs.modalForm.title="新增"},searchQuery:function(){var e=this,t=this.getQueryParams();t.permissionId=this.permId,Object(i["H"])(t).then((function(t){t.success&&(e.dataSource=t.result)}))},searchReset:function(){this.queryParam={},this.queryParam.permissionId=this.permId,this.loadData(1)},onClose:function(){this.visible=!1},resetScreenSize:function(){var e=document.body.clientWidth;this.drawerWidth=e<500?e:650},getRowClassname:function(e){if(1!=e.status)return"data-rule-invalid"}}},c=u,d=(r("4ba5"),r("2877")),m=Object(d["a"])(c,a,l,!1,null,null,null);t["default"]=m.exports},"7c33":function(e,t,r){"use strict";r.r(t);var a=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",{directives:[{name:"show",rawName:"v-show",value:e.showRuleColumn,expression:"showRuleColumn"}],attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则字段"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["ruleColumn",e.validatorRules.ruleColumn],expression:"['ruleColumn', validatorRules.ruleColumn]"}],attrs:{placeholder:"请输入规则字段"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"条件规则"}},[t("j-dict-select-tag",{directives:[{name:"decorator",rawName:"v-decorator",value:["ruleConditions",e.validatorRules.ruleConditions],expression:"['ruleConditions', validatorRules.ruleConditions]"}],attrs:{placeholder:"请输入条件规则",triggerChange:!0,dictCode:"rule_conditions"},on:{change:e.handleChangeRuleCondition}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"规则值"}},[t("a-input",{directives:[{name:"decorator",rawName:"v-decorator",value:["ruleValue",e.validatorRules.ruleValue],expression:"['ruleValue', validatorRules.ruleValue]"}],attrs:{placeholder:"请输入规则值"}})],1),t("a-form-item",{attrs:{labelCol:e.labelCol,wrapperCol:e.wrapperCol,label:"状态"}},[t("a-radio-group",{directives:[{name:"decorator",rawName:"v-decorator",value:["status",{initialValue:"1"}],expression:"['status',{initialValue:'1'}]"}],attrs:{buttonStyle:"solid"}},[t("a-radio-button",{attrs:{value:"1"}},[e._v("有效")]),t("a-radio-button",{attrs:{value:"0"}},[e._v("无效")])],1)],1)],1)],1)],1)},l=[],i=r("0fea"),n=r("88bc"),o=r.n(n),s={name:"PermissionDataRuleModal",data:function(){return{queryParam:{},title:"操作",visible:!1,model:{},ruleConditionList:[],labelCol:{xs:{span:24},sm:{span:5}},wrapperCol:{xs:{span:24},sm:{span:16}},confirmLoading:!1,form:this.$form.createForm(this),permissionId:"",validatorRules:{ruleConditions:{rules:[{required:!0,message:"请选择条件!"}]},ruleName:{rules:[{required:!0,message:"请输入规则名称!"}]},ruleValue:{rules:[{required:!0,message:"请输入规则值!"}]},ruleColumn:{rules:[]}},url:{list:"/sys/dictItem/list",add:"/sys/permission/addPermissionRule",edit:"/sys/permission/editPermissionRule"},showRuleColumn:!0}},created:function(){},methods:{add:function(e){this.permissionId=e,this.edit({})},edit:function(e){var t=this;this.form.resetFields(),this.model=Object.assign({},e),e.permissionId?this.model.permissionId=e.permissionId:this.model.permissionId=this.permissionId,this.visible=!0,this.initRuleCondition(),this.$nextTick((function(){t.form.setFieldsValue(o()(t.model,"status","ruleName","ruleColumn","ruleConditions","ruleValue"))}))},close:function(){this.$emit("close"),this.visible=!1},handleOk:function(){var e=this,t=this;this.form.validateFields((function(r,a){if(!r){t.confirmLoading=!0;var l="",n="";e.model.id?(l+=e.url.edit,n="put"):(l+=e.url.add,n="post");var o=Object.assign(e.model,a);o.ruleColumn&&o.ruleColumn.length>0&&(o.ruleColumn=o.ruleColumn.trim()),o.ruleValue&&o.ruleValue.length>0&&(o.ruleValue=o.ruleValue.trim()),Object(i["i"])(l,o,n).then((function(e){e.success?(t.$message.success(e.message),t.$emit("ok")):t.$message.warning(e.message)})).finally((function(){t.confirmLoading=!1,t.close()}))}}))},handleCancel:function(){this.close()},initRuleCondition:function(){this.model.ruleConditions&&"USE_SQL_RULES"==this.model.ruleConditions?this.showRuleColumn=!1:this.showRuleColumn=!0},handleChangeRuleCondition:function(e){"USE_SQL_RULES"==e?(this.form.setFieldsValue({ruleColumn:""}),this.showRuleColumn=!1):this.showRuleColumn=!0}}},u=s,c=r("2877"),d=Object(c["a"])(u,a,l,!1,null,"3e96f1f8",null);t["default"]=d.exports},"88bc":function(e,t,r){(function(t){var r=1/0,a=9007199254740991,l="[object Arguments]",i="[object Function]",n="[object GeneratorFunction]",o="[object Symbol]",s="object"==typeof t&&t&&t.Object===Object&&t,u="object"==typeof self&&self&&self.Object===Object&&self,c=s||u||Function("return this")();function d(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function m(e,t){var r=-1,a=e?e.length:0,l=Array(a);while(++r<a)l[r]=t(e[r],r,e);return l}function p(e,t){var r=-1,a=t.length,l=e.length;while(++r<a)e[l+r]=t[r];return e}var f=Object.prototype,h=f.hasOwnProperty,v=f.toString,b=c.Symbol,C=f.propertyIsEnumerable,y=b?b.isConcatSpreadable:void 0,w=Math.max;function g(e,t,r,a,l){var i=-1,n=e.length;r||(r=x),l||(l=[]);while(++i<n){var o=e[i];t>0&&r(o)?t>1?g(o,t-1,r,a,l):p(l,o):a||(l[l.length]=o)}return l}function R(e,t){return e=Object(e),k(e,t,(function(t,r){return r in e}))}function k(e,t,r){var a=-1,l=t.length,i={};while(++a<l){var n=t[a],o=e[n];r(o,n)&&(i[n]=o)}return i}function S(e,t){return t=w(void 0===t?e.length-1:t,0),function(){var r=arguments,a=-1,l=w(r.length-t,0),i=Array(l);while(++a<l)i[a]=r[t+a];a=-1;var n=Array(t+1);while(++a<t)n[a]=r[a];return n[t]=i,d(e,this,n)}}function x(e){return j(e)||I(e)||!!(y&&e&&e[y])}function P(e){if("string"==typeof e||L(e))return e;var t=e+"";return"0"==t&&1/e==-r?"-0":t}function I(e){return V(e)&&h.call(e,"callee")&&(!C.call(e,"callee")||v.call(e)==l)}var j=Array.isArray;function O(e){return null!=e&&_(e.length)&&!N(e)}function V(e){return F(e)&&O(e)}function N(e){var t=q(e)?v.call(e):"";return t==i||t==n}function _(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=a}function q(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function F(e){return!!e&&"object"==typeof e}function L(e){return"symbol"==typeof e||F(e)&&v.call(e)==o}var $=S((function(e,t){return null==e?{}:R(e,m(g(t,1),P))}));e.exports=$}).call(this,r("c8ba"))},"9ad5":function(e,t,r){}}]);
|