Browse Source

Pull request #5: 无JIRA任务 插件发布,release合persist

Merge in PG/plugin-decision-batch-role from release/10.0 to persist/10.0

* commit '69c38c238c8ec69f9d21c40266babc0534fee328':
  DEC-13610 按职位分配权限适配
  无JIRA 修复版本号
persist/10.0
Lanlan 4 years ago
parent
commit
e308cf5a57
  1. BIN
      lib/finekit-10.0-20200430.jar
  2. BIN
      lib/finekit-10.0-20200612.jar
  3. 9
      plugin.xml
  4. 18
      pom.xml
  5. 3
      src/main/java/com/fr/plugin/decision/role/auth/BatchRoleController.java
  6. 4
      src/main/resources/com/fr/plugin/decision/batch/role/plugin.min.js

BIN
lib/finekit-10.0-20200430.jar

Binary file not shown.

BIN
lib/finekit-10.0-20200612.jar

Binary file not shown.

9
plugin.xml

@ -4,13 +4,14 @@
<name><![CDATA[批量授权角色]]></name> <name><![CDATA[批量授权角色]]></name>
<active>yes</active> <active>yes</active>
<hidden>no</hidden> <hidden>no</hidden>
<version>1.0.1</version> <version>1.1.0</version>
<env-version>10.0~</env-version> <env-version>10.0</env-version>
<jartime>2020-5-1</jartime> <jartime>2020-6-8</jartime>
<vendor>finereport</vendor> <vendor>finereport</vendor>
<description><![CDATA[可以批量设置角色权限]]></description> <description><![CDATA[可以批量设置角色权限]]></description>
<change-notes><![CDATA[ <change-notes><![CDATA[
<p>[2019-04-28]实现批量设置角色逻辑</p> <p>[2020-06-12]适配按职位分配权限</p>
<p>[2020-06-08]实现批量设置角色逻辑</p>
]]></change-notes> ]]></change-notes>
<function-recorder class="com.fr.plugin.decision.role.auth.BatchRoleController"/> <function-recorder class="com.fr.plugin.decision.role.auth.BatchRoleController"/>
<extra-core> <extra-core>

18
pom.xml

@ -3,27 +3,15 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<dependencies>
<dependency>
<groupId>com.fr.decision</groupId>
<artifactId>decision-feature</artifactId>
<version>10.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.fr.decision</groupId>
<artifactId>decision-feature</artifactId>
<version>10.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
<parent> <parent>
<groupId>com.fr.plugin</groupId> <groupId>com.fr.plugin</groupId>
<artifactId>starter</artifactId> <artifactId>starter</artifactId>
<version>10.0</version> <version>10.0</version>
</parent> </parent>
<packaging>jar</packaging> <packaging>jar</packaging>
<artifactId>decision.message.event</artifactId> <artifactId>plugin-decision-batch-role</artifactId>
<dependencies>
</dependencies>
<build> <build>
<!---如果要更改调试插件,改这里的配置就可以了--> <!---如果要更改调试插件,改这里的配置就可以了-->
<outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.decision.batch.role-1.0/classes</outputDirectory> <outputDirectory>${project.basedir}/../webroot/WEB-INF/plugins/plugin-com.fr.plugin.decision.batch.role-1.0/classes</outputDirectory>

3
src/main/java/com/fr/plugin/decision/role/auth/BatchRoleController.java

@ -27,6 +27,7 @@ public class BatchRoleController {
private static final String DEP = "depost"; private static final String DEP = "depost";
private static final String ROLE = "role"; private static final String ROLE = "role";
private static final String USER = "user"; private static final String USER = "user";
private static final String POST = "post";
@RequestMapping(value = "/batch/role", method = RequestMethod.POST) @RequestMapping(value = "/batch/role", method = RequestMethod.POST)
@ResponseBody @ResponseBody
@ -45,6 +46,8 @@ public class BatchRoleController {
AuthorityKit.setUserAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType()); AuthorityKit.setUserAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType());
} else if (ROLE.equals(roleType)) { } else if (ROLE.equals(roleType)) {
AuthorityKit.setCustomRoleAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType()); AuthorityKit.setCustomRoleAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType());
} else if (POST.equals(roleType)) {
AuthorityKit.setPostAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType());
} }
} }

4
src/main/resources/com/fr/plugin/decision/batch/role/plugin.min.js vendored

@ -1,2 +1,2 @@
/** simple-template 20-05-09 17:10:41 */ /** simple-template 20-06-12 16:47:27 */
!function(){var t=BI.inherit(BI.BasicButton,{props:{baseCls:"",text:"",items:[{value:!0,text:BI.i18nText("Dec-Plugin_Authority_Role_Full_Authorization")},{value:!1,text:BI.i18nText("Dec-Plugin_Authority_Role_De_Authorization")}]},render:function(){var e=this,t=this.options;return{type:"bi.center_adapt",items:[{type:"bi.combo",trigger:"click",adjustXOffset:60,adjustYOffset:-8,el:{type:"bi.vertical_adapt",height:36,items:[{type:"bi.label",text:t.text,ref:function(t){e.text=t}},{type:"bi.icon_button",height:16,tgap:5,cls:"trigger-triangle-font",ref:function(t){e.trigger=t}}]},popup:{el:{type:"bi.vertical",items:[{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,items:t.items,textAlign:"center",listeners:[{eventName:BI.IconComboPopup.EVENT_CHANGE,action:function(){e.combo.hideView(),e.fireEvent("EVENT_CHANGE",this.getValue()[0]),this.setValue()}}]}]}},ref:function(t){e.combo=t}}]}},doHighLight:function(){this.text.doHighLight()},unHighLight:function(){this.text.unHighLight()}});BI.shortcut("dec.plugin.role.list.header.auth",t)}(),Dec.Utils=Dec.Utils||{},BI.extend(Dec.Utils,{setPluginRoleAuthority:function(t,e){Dec.reqPost("/batch/role",t,e)}}),function(){var t=BI.inherit(BI.NodeButton,{props:{baseCls:"dec-expander-trigger bi-background",texts:[],items:[],iconWidth:30},_store:function(){return BI.Models.getModel("dec.model.plugin.role.trigger")},watch:{status:function(t){this.statusMasker&&this.statusMasker.setStatus(t)}},render:function(){var e=this,i=this.options;return{type:"bi.htape",items:[{el:{type:"dec.screening.combo",ref:function(t){e.combo=t},text:i.texts.all,defaultValue:1,items:[{text:i.texts.all,iconCls1:"check-mark-e-font",value:1},{text:i.texts.onlyOpen,iconCls1:"check-mark-e-font",value:2}],listeners:[{eventName:"EVENT_CHANGE",action:function(){}}]}},{el:{type:"bi.button_group",ref:function(t){e.authItemsGroup=t},layouts:[{type:"bi.right_vertical_adapt"}],items:this._formatItems(i.items)},width:300},{el:{type:"dec.display.selector",ref:function(t){e.displaySelecter=t},items:i.items,listeners:[{eventName:"EVENT_CHANGE",action:function(t){i.onAuthItemsChange(t)}}]},width:30},{type:"bi.default",width:i.iconWidth}]}},_formatItems:function(t){var i=this,o=[];return BI.each(t,function(t,e){e.selected&&o.push(BI.extend({type:"dec.plugin.role.list.header.auth",width:i.options.itemWidth,listeners:[{eventName:"EVENT_CHANGE",action:function(t){i._doAuth(t)}}]},e))}),o},_doAuth:function(e){var i=this,t=BI.i18nText(e?"Dec-Plugin_Authority_Role_Full_Authorization_Tip":"Dec-Plugin_Authority_Role_De_Authorization_Tip",this.model.carrierText);BI.Msg.confirm(BI.i18nText("BI-Basic_Sure"),t,function(t){t&&i._startSet(e)})},_startSet:function(t){var e=this,i=BI.UUID();BI.Maskers.create(i,null,{render:{type:"dec.test.status",waitingText:BI.i18nText("Dec-Plugin_Authority_Role_Processing"),successText:BI.i18nText("Dec-Plugin_Authority_Role_Processing_Success"),failText:BI.i18nText("Dec-Plugin_Authority_Role_Processing_Fail"),listeners:[{eventName:"EVENT_CLOSE",action:function(){BI.Maskers.hide(i),BI.Maskers.remove(i)}}],ref:function(t){e.statusMasker=t}}}),BI.Maskers.show(i),e.store.doAuthorization(t)},doHighLight:function(i){var t=this.authItemsGroup.getAllButtons();BI.each(t,function(t,e){e.getValue()===i?e.doHighLight():e.unHighLight()})},unHighLight:function(){var t=this.authItemsGroup.getAllButtons();BI.each(t,function(t,e){e.unHighLight()})},populate:function(t){this.options.authItems=t,this.authItemsGroup.populate(this._formatItems(t))}});t.EVENT_CHANGE="EVENT_CHANGE",t.EVENT_RESIZE="EVENT_RESIZE",BI.shortcut("dec.plugin.role.list.header",t)}(),function(){var t=BI.inherit(Fix.Model,{state:function(){return{status:{}}},context:["keyword","entityInfo","carrierInfo"],computed:{carrierText:function(){var t=this.model.carrierInfo.carrierType;return t===DecCst.Authority.CARRIER_TYPE.USER?BI.i18nText("Dec-Basic_User"):t===DecCst.Authority.CARRIER_TYPE.DEPOST?BI.i18nText("Dec-Department"):t===DecCst.Authority.CARRIER_TYPE.ROLE?BI.i18nText("Dec-Role"):""}},actions:{doAuthorization:function(t){var e=this;Dec.Utils.setPluginRoleAuthority({roleType:this.model.carrierInfo.carrierType,roleId:this.model.carrierInfo.carrierId,authType:2,authValue:t?2:1,keyword:this.model.keyword},function(t){e.model.status=t,BI.isNotNull(t.data)&&(e.model.carrierInfo=BI.extend({},e.model.carrierInfo))})}}});BI.model("dec.model.plugin.role.trigger",t)}(),BI.config("dec.role.expander",function(t){return BI.Services.getService("dec.service.global").isAdmin()?BI.extend(t,{header:"dec.plugin.role.list.header"}):t}); !function(){var t=BI.inherit(BI.BasicButton,{props:{baseCls:"",text:"",items:[{value:!0,text:BI.i18nText("Dec-Plugin_Authority_Role_Full_Authorization")},{value:!1,text:BI.i18nText("Dec-Plugin_Authority_Role_De_Authorization")}]},render:function(){var e=this,t=this.options;return{type:"bi.center_adapt",items:[{type:"bi.combo",trigger:"click",adjustXOffset:60,adjustYOffset:-8,el:{type:"bi.vertical_adapt",height:36,items:[{type:"bi.label",text:t.text,ref:function(t){e.text=t}},{type:"bi.icon_button",height:16,tgap:5,cls:"trigger-triangle-font",ref:function(t){e.trigger=t}}]},popup:{el:{type:"bi.vertical",items:[{type:"bi.text_value_combo_popup",chooseType:BI.ButtonGroup.CHOOSE_TYPE_SINGLE,items:t.items,textAlign:"center",listeners:[{eventName:BI.IconComboPopup.EVENT_CHANGE,action:function(){e.combo.hideView(),e.fireEvent("EVENT_CHANGE",this.getValue()[0]),this.setValue()}}]}]}},ref:function(t){e.combo=t}}]}},doHighLight:function(){this.text.doHighLight()},unHighLight:function(){this.text.unHighLight()}});BI.shortcut("dec.plugin.role.list.header.auth",t)}(),Dec.Utils=Dec.Utils||{},BI.extend(Dec.Utils,{setPluginRoleAuthority:function(t,e){Dec.reqPost("/batch/role",t,e)}}),function(){var t=BI.inherit(BI.NodeButton,{props:{baseCls:"dec-expander-trigger bi-background",texts:[],items:[],iconWidth:30},_store:function(){return BI.Models.getModel("dec.model.plugin.role.trigger")},watch:{status:function(t){this.statusMasker&&this.statusMasker.setStatus(t)}},render:function(){var e=this,i=this.options;return{type:"bi.htape",items:[{el:{type:"dec.screening.combo",ref:function(t){e.combo=t},text:i.texts.all,defaultValue:1,items:[{text:i.texts.all,iconCls1:"check-mark-e-font",value:1},{text:i.texts.onlyOpen,iconCls1:"check-mark-e-font",value:2}],listeners:[{eventName:"EVENT_CHANGE",action:function(){}}]}},{el:{type:"bi.button_group",ref:function(t){e.authItemsGroup=t},layouts:[{type:"bi.right_vertical_adapt"}],items:this._formatItems(i.items)},width:300},{el:{type:"dec.display.selector",ref:function(t){e.displaySelecter=t},items:i.items,listeners:[{eventName:"EVENT_CHANGE",action:function(t){i.onAuthItemsChange(t)}}]},width:30},{type:"bi.default",width:i.iconWidth}]}},_formatItems:function(t){var i=this,n=[];return BI.each(t,function(t,e){e.selected&&n.push(BI.extend({type:"dec.plugin.role.list.header.auth",width:i.options.itemWidth,listeners:[{eventName:"EVENT_CHANGE",action:function(t){i._doAuth(t)}}]},e))}),n},_doAuth:function(e){var i=this,t=BI.i18nText(e?"Dec-Plugin_Authority_Role_Full_Authorization_Tip":"Dec-Plugin_Authority_Role_De_Authorization_Tip",this.model.carrierText);BI.Msg.confirm(BI.i18nText("BI-Basic_Sure"),t,function(t){t&&i._startSet(e)})},_startSet:function(t){var e=this,i=BI.UUID();BI.Maskers.create(i,null,{render:{type:"dec.test.status",waitingText:BI.i18nText("Dec-Plugin_Authority_Role_Processing"),successText:BI.i18nText("Dec-Plugin_Authority_Role_Processing_Success"),failText:BI.i18nText("Dec-Plugin_Authority_Role_Processing_Fail"),listeners:[{eventName:"EVENT_CLOSE",action:function(){BI.Maskers.hide(i),BI.Maskers.remove(i)}}],ref:function(t){e.statusMasker=t}}}),BI.Maskers.show(i),e.store.doAuthorization(t)},doHighLight:function(i){var t=this.authItemsGroup.getAllButtons();BI.each(t,function(t,e){e.getValue()===i?e.doHighLight():e.unHighLight()})},unHighLight:function(){var t=this.authItemsGroup.getAllButtons();BI.each(t,function(t,e){e.unHighLight()})},populate:function(t){this.options.authItems=t,this.authItemsGroup.populate(this._formatItems(t))}});t.EVENT_CHANGE="EVENT_CHANGE",t.EVENT_RESIZE="EVENT_RESIZE",BI.shortcut("dec.plugin.role.list.header",t)}(),function(){var t=BI.inherit(Fix.Model,{state:function(){return{status:{}}},context:["keyword","entityInfo","carrierInfo"],computed:{carrierText:function(){var i="",n=this.model.carrierInfo.carrierType;return BI.some(BI.Constants.getConstant("dec.constant.authority.member.selector.tabs"),function(t,e){if(n===e.value)return i=e.text,!0}),i}},actions:{doAuthorization:function(t){var e=this;Dec.Utils.setPluginRoleAuthority({roleType:this.model.carrierInfo.carrierType,roleId:this.model.carrierInfo.carrierId,authType:2,authValue:t?2:1,keyword:this.model.keyword},function(t){e.model.status=t,BI.isNotNull(t.data)&&(e.model.carrierInfo=BI.extend({},e.model.carrierInfo))})}}});BI.model("dec.model.plugin.role.trigger",t)}(),BI.config("dec.role.expander",function(t){return BI.Services.getService("dec.service.global").isAdmin()?BI.extend(t,{header:"dec.plugin.role.list.header"}):t});
Loading…
Cancel
Save