Compare commits

...

26 Commits

Author SHA1 Message Date
Elijah b4cfe79bba Pull request #9: fix 打包失败 4 years ago
Elijah acc3f7552f Pull request #10: fix 打包报错 4 years ago
Elijah 54bfd928b4 Merge remote-tracking branch 'origin/release/10.0' into release/10.0 4 years ago
Elijah a4fb3758f8 fix 打包报错 4 years ago
Elijah 8bbe67d5f5 Pull request #8: fix 打包失败 4 years ago
Elijah 99115c8ae0 Merge remote-tracking branch 'origin/release/10.0' into release/10.0 4 years ago
Elijah 69a1570738 fix 打包失败 4 years ago
Lanlan a73ce35028 Pull request #7: 无jira任务 发布 4 years ago
Elijah 5e0c263d1b Pull request #6: 无jira任务 样式调整 4 years ago
Elijah 01cfbbbf5f Merge remote-tracking branch 'origin/release/10.0' into release/10.0 4 years ago
Elijah 86e8e8eb8f 无jira任务 样式调整 4 years ago
richie 44bb5c3cd2 Update .gitignore 4 years ago
richie 8b751f0af4 Creating new file encrypt.xml 4 years ago
richie 745164ac93 Creating new file build.gradle 4 years ago
richie d2a7bebb72 Creating new file build.gradle 4 years ago
richie ba66a101b0 Creating new file encrypt.xml 4 years ago
richie 078db7199b Update .gitignore 4 years ago
Lanlan e308cf5a57 Pull request #5: 无JIRA任务 插件发布,release合persist 4 years ago
Elijah 69c38c238c Pull request #4: DEC-13610 按职位分配权限适配 4 years ago
Elijah 23a331b53e DEC-13610 按职位分配权限适配 4 years ago
Frank.Qiu 0a69bdc6d8 Pull request #3: 无JIRA 修复版本号 4 years ago
congqiu afd8171fa4 无JIRA 修复版本号 4 years ago
Frank.Qiu 6a8fb2bb48 Pull request #2: DEC-13237 fix: 修复次管问题 4 years ago
congqiu 5586428f5e fix:添加finekit 4 years ago
congqiu 3821a09dc1 fix: 国际化 4 years ago
congqiu 797c67f2eb DEC-13237 fix: 修复次管问题 4 years ago
  1. 7
      .gitignore
  2. 122
      build.gradle
  3. 26
      build.xml
  4. 13
      encrypt.xml
  5. BIN
      lib/finekit-10.0-20200612.jar
  6. 14
      plugin.xml
  7. 18
      pom.xml
  8. 3
      src/main/java/com/fr/plugin/decision/role/auth/BatchRoleController.java
  9. 2
      src/main/resources/com/fr/plugin/decision/batch/role/i18n_en_US.properties
  10. 2
      src/main/resources/com/fr/plugin/decision/batch/role/i18n_ja_JP.properties
  11. 2
      src/main/resources/com/fr/plugin/decision/batch/role/i18n_ko_KR.properties
  12. 2
      src/main/resources/com/fr/plugin/decision/batch/role/i18n_zh_CN.properties
  13. 2
      src/main/resources/com/fr/plugin/decision/batch/role/i18n_zh_TW.properties
  14. 4
      src/main/resources/com/fr/plugin/decision/batch/role/plugin.min.js

7
.gitignore vendored

@ -1,5 +1,10 @@
*.iml
.idea/
lib/report/*.jar
target/
.DS_Store
.classpath
.gradle
build
local.properties
classes/
transform-classes/

122
build.gradle

@ -0,0 +1,122 @@
apply plugin: 'java'
ext {
/**
* jar的路径
* 1.jar需要打包到zip中,lib根目录下
* 2.jar仅仅是编译时需要lib下子目录下即可
*/
libPath = "$projectDir/../webroot/WEB-INF/lib"
/**
* class进行加密保护
*/
guard = false
def pluginInfo = getPluginInfo()
pluginPre = "fine-plugin"
pluginName = pluginInfo.id
pluginVersion = pluginInfo.version
outputPath = "$projectDir/../webroot/WEB-INF/plugins/plugin-" + pluginName + "-1.0/classes"
}
group = 'com.fr.plugin'
version = '10.0'
sourceCompatibility = '8'
sourceSets {
main {
java.outputDir = file(outputPath)
output.resourcesDir = file(outputPath)
}
}
ant.importBuild("encrypt.xml")
//ant变量
ant.projectDir = projectDir
ant.references["compile.classpath"] = ant.path {
fileset(dir: libPath, includes: '**/*.jar')
fileset(dir: ".",includes:"**/*.jar" )
}
classes.dependsOn('clean')
task copyFiles(type: Copy,dependsOn: 'classes'){
from outputPath
into "$projectDir/classes"
}
task preJar(type:Copy,dependsOn: guard ? 'compile_encrypt_javas' : 'compile_plain_javas'){
from "$projectDir/classes"
into "$projectDir/transform-classes"
include "**/*.*"
}
jar.dependsOn("preJar")
task makeJar(type: Jar,dependsOn: preJar){
from fileTree(dir: "$projectDir/transform-classes")
baseName pluginPre
appendix pluginName
version pluginVersion
destinationDir = file("$buildDir/libs")
doLast(){
delete file("$projectDir/classes")
delete file("$projectDir/transform-classes")
}
}
task copyFile(type: Copy,dependsOn: ["makeJar"]){
from "$buildDir/libs"
from("$projectDir/lib") {
include "*.jar"
}
from "$projectDir/plugin.xml"
into file("$buildDir/temp/plugin")
}
task zip(type:Zip,dependsOn:["copyFile"]){
from "$buildDir/temp/plugin"
destinationDir file("$buildDir/install")
baseName pluginPre
appendix pluginName
version pluginVersion
}
//build时包含哪些文件,
processResources {
// exclude everything
// *.css没效果
// exclude '**/*.css'
// except this file
// include 'xx.xml'
}
/*读取plugin.xml中的version*/
def getPluginInfo(){
def xmlFile = file("plugin.xml")
if (!xmlFile.exists()) {
return ["id":"none", "version":"1.0.0"]
}
def plugin = new XmlParser().parse(xmlFile)
def version = plugin.version[0].text()
def id = plugin.id[0].text()
return ["id":id,"version":version]
}
repositories {
mavenLocal()
maven {
url = uri('http://mvn.finedevelop.com/repository/maven-public/')
}
}
dependencies {
//使jar
implementation fileTree(dir: 'lib', include: ['**/*.jar'])
implementation fileTree(dir: libPath, include: ['**/*.jar'])
}

26
build.xml

@ -2,10 +2,8 @@
<project basedir="." default="jar" name="plugin">
<!-- JDK路径,根据自己机器上实际位置修改-->
<property name="jdk.home" value="/Library/Java/JavaVirtualMachines/jdk1.8.0_191.jdk/Contents/Home"/>
<property name="libs" value="${basedir}/lib/report"/>
<property name="libs" value="${basedir}/lib"/>
<property name="publicLibs" value=""/>
<property name="reportLibs" value="${basedir}/../env/webroot/WEB-INF/lib"/>
<property name="destLoc" value="."/>
<property name="classes" value="classes"/>
<xmlproperty file="${basedir}/plugin.xml"/>
@ -21,16 +19,13 @@
<delete dir="${classes}"/>
<delete dir="fr-plugin-${plugin-name}-${plugin-version}"/>
<xmlproperty file="${basedir}/plugin.xml"/>
<delete dir="${destLoc}/${plugin.name}"/>
<delete dir="${destLoc}/${plugin-name}"/>
</target>
<path id="compile.classpath">
<fileset dir="${libs}">
<include name="**/*.jar"/>
</fileset>
<fileset dir="${publicLibs}">
<include name="**/*.class"/>
</fileset>
<fileset dir="${reportLibs}">
<include name="**/*.jar"/>
</fileset>
</path>
@ -59,12 +54,10 @@
</target>
<target name="compile_javas">
<echo message="编译${compile_files}下的Java文件"/>
<javac destdir="${classes}" debug="false" optimize="on" source="${source_jdk_version}"
target="${target_jdk_version}"
fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}"
executable="${compile_jdk_version}/bin/javac">
<javac destdir="${classes}" debug="false" optimize="on" includeantruntime="false" source="${source_jdk_version}" target="${target_jdk_version}" fork="true" memoryMaximumSize="512m" listfiles="false" srcdir="${basedir}" executable="${compile_jdk_version}/bin/javac">
<src path="${basedir}/src/main/java"/>
<exclude name="**/.svn/**"/>
<exclude name="**/.git/**"/>
<compilerarg line="-encoding UTF8 "/>
<classpath refid="compile.classpath"/>
</javac>
@ -88,8 +81,8 @@
<param name="resources_from" value="${basedir}"/>
</antcall>
<antcall target="compile_javas">
<param name="source_jdk_version" value="1.6"/>
<param name="target_jdk_version" value="1.6"/>
<param name="source_jdk_version" value="1.7"/>
<param name="target_jdk_version" value="1.7"/>
<param name="compile_jdk_version" value="${jdk.home}"/>
<param name="compile_files" value="${basedir}/src"/>
</antcall>
@ -99,7 +92,6 @@
<param name="jar_name" value="${plugin-jar}"/>
</antcall>
<delete dir="${classes}"/>
</target>
<target name="jar" depends="super_jar">
@ -116,15 +108,13 @@
<include name="plugin.xml"/>
</fileset>
<fileset dir="${libs}">
<include name="*.jar"/>
<include name="*.dll"/>
<include name="*"/>
</fileset>
</copy>
<zip destfile="${basedir}/${plugin-folder}.zip" basedir=".">
<include name="${plugin-folder}/*.jar"/>
<include name="${plugin-folder}/*.dll"/>
<include name="${plugin-folder}/plugin.xml"/>
</zip>
<move file="${plugin-folder}.zip" todir="${destLoc}/install"/>
<move file="${plugin-folder}.zip" todir="${destLoc}/${plugin.name}"/>
</target>
</project>

13
encrypt.xml

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project>
<target name="compile_encrypt_javas" depends="copyFiles">
<echo message="加密文件"/>
<echo message="${projectDir}"/>
<taskdef name="pretreatment" classname="com.fr.plugin.pack.PluginPretreatmentTask">
<classpath refid="compile.classpath"/>
</taskdef>
<pretreatment baseDir="${projectDir}"/>
</target>
<target name="compile_plain_javas" depends="copyFiles">
</target>
</project>

BIN
lib/finekit-10.0-20200612.jar

Binary file not shown.

14
plugin.xml

@ -1,16 +1,18 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<plugin>
<id>com.fr.plugin.decision.batch.role</id>
<name><![CDATA[批量设置角色管理权限]]></name>
<name><![CDATA[批量授权角色]]></name>
<active>yes</active>
<hidden>no</hidden>
<version>1.0.1</version>
<env-version>10.0~</env-version>
<jartime>2020-4-20</jartime>
<vendor>zed</vendor>
<version>1.1.0</version>
<env-version>10.0</env-version>
<jartime>2020-6-8</jartime>
<vendor>finereport</vendor>
<description><![CDATA[可以批量设置角色权限]]></description>
<change-notes><![CDATA[
<p>[2019-04-28]实现批量设置角色逻辑</p>
<p>[2020-07-07]样式调整</p>
<p>[2020-06-12]适配按职位分配权限</p>
<p>[2020-06-08]实现批量设置角色逻辑</p>
]]></change-notes>
<function-recorder class="com.fr.plugin.decision.role.auth.BatchRoleController"/>
<extra-core>

18
pom.xml

@ -3,27 +3,15 @@
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">
<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>
<groupId>com.fr.plugin</groupId>
<artifactId>starter</artifactId>
<version>10.0</version>
</parent>
<packaging>jar</packaging>
<artifactId>decision.message.event</artifactId>
<artifactId>plugin-decision-batch-role</artifactId>
<dependencies>
</dependencies>
<build>
<!---如果要更改调试插件,改这里的配置就可以了-->
<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 ROLE = "role";
private static final String USER = "user";
private static final String POST = "post";
@RequestMapping(value = "/batch/role", method = RequestMethod.POST)
@ResponseBody
@ -45,6 +46,8 @@ public class BatchRoleController {
AuthorityKit.setUserAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType());
} else if (ROLE.equals(roleType)) {
AuthorityKit.setCustomRoleAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType());
} else if (POST.equals(roleType)) {
AuthorityKit.setPostAuth(bean.getRoleId(), bean.getAuthValue(), roleId, bean.getAuthType());
}
}

2
src/main/resources/com/fr/plugin/decision/batch/role/i18n_en_US.properties

@ -2,6 +2,6 @@ Dec-Plugin_Authority_Role_De_Authorization=Full Cancels
Dec-Plugin_Authority_Role_De_Authorization_Tip=Are you sure want to remove the administrative rights of the selected {} to all the following roles?
Dec-Plugin_Authority_Role_Full_Authorization=Full Authorize
Dec-Plugin_Authority_Role_Full_Authorization_Tip=Are you sure want to grant the selected {} administrative rights to all of the following roles?
Dec-Plugin_Authority_Role_Processing=Processing
Dec-Plugin_Authority_Role_Processing=Processing...
Dec-Plugin_Authority_Role_Processing_Fail=Processing failed
Dec-Plugin_Authority_Role_Processing_Success=Processing complete

2
src/main/resources/com/fr/plugin/decision/batch/role/i18n_ja_JP.properties

@ -2,6 +2,6 @@ Dec-Plugin_Authority_Role_De_Authorization=\u5168\u90E8\u89E3\u9664
Dec-Plugin_Authority_Role_De_Authorization_Tip=\u786E\u5B9A\u89E3\u9664\u5DF2\u9009{}\u5BF9\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u6743\u9650\uFF1F
Dec-Plugin_Authority_Role_Full_Authorization=\u5168\u90E8\u6388\u6743
Dec-Plugin_Authority_Role_Full_Authorization_Tip=\u786E\u5B9A\u6388\u4E88\u5DF2\u9009{}\u5BF9\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u6743\u9650\uFF1F
Dec-Plugin_Authority_Role_Processing=\u5904\u7406\u4E2D
Dec-Plugin_Authority_Role_Processing=\u5904\u7406\u4E2D...
Dec-Plugin_Authority_Role_Processing_Fail=\u5904\u7406\u5931\u8D25
Dec-Plugin_Authority_Role_Processing_Success=\u5904\u7406\u5B8C\u6210

2
src/main/resources/com/fr/plugin/decision/batch/role/i18n_ko_KR.properties

@ -2,6 +2,6 @@ Dec-Plugin_Authority_Role_De_Authorization=\u5168\u90E8\u89E3\u9664
Dec-Plugin_Authority_Role_De_Authorization_Tip=\u786E\u5B9A\u89E3\u9664\u5DF2\u9009{}\u5BF9\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u6743\u9650\uFF1F
Dec-Plugin_Authority_Role_Full_Authorization=\u5168\u90E8\u6388\u6743
Dec-Plugin_Authority_Role_Full_Authorization_Tip=\u786E\u5B9A\u6388\u4E88\u5DF2\u9009{}\u5BF9\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u6743\u9650\uFF1F
Dec-Plugin_Authority_Role_Processing=\u5904\u7406\u4E2D
Dec-Plugin_Authority_Role_Processing=\u5904\u7406\u4E2D...
Dec-Plugin_Authority_Role_Processing_Fail=\u5904\u7406\u5931\u8D25
Dec-Plugin_Authority_Role_Processing_Success=\u5904\u7406\u5B8C\u6210

2
src/main/resources/com/fr/plugin/decision/batch/role/i18n_zh_CN.properties

@ -2,6 +2,6 @@ Dec-Plugin_Authority_Role_De_Authorization=\u5168\u90E8\u89E3\u9664
Dec-Plugin_Authority_Role_De_Authorization_Tip=\u786E\u5B9A\u89E3\u9664\u5DF2\u9009{}\u5BF9\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u6743\u9650\uFF1F
Dec-Plugin_Authority_Role_Full_Authorization=\u5168\u90E8\u6388\u6743
Dec-Plugin_Authority_Role_Full_Authorization_Tip=\u786E\u5B9A\u6388\u4E88\u5DF2\u9009{}\u5BF9\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u6743\u9650\uFF1F
Dec-Plugin_Authority_Role_Processing=\u5904\u7406\u4E2D
Dec-Plugin_Authority_Role_Processing=\u5904\u7406\u4E2D...
Dec-Plugin_Authority_Role_Processing_Fail=\u5904\u7406\u5931\u8D25
Dec-Plugin_Authority_Role_Processing_Success=\u5904\u7406\u5B8C\u6210

2
src/main/resources/com/fr/plugin/decision/batch/role/i18n_zh_TW.properties

@ -2,6 +2,6 @@ Dec-Plugin_Authority_Role_De_Authorization=\u5168\u90E8\u89E3\u9664
Dec-Plugin_Authority_Role_De_Authorization_Tip=\u78BA\u5B9A\u89E3\u9664\u5DF2\u9078{}\u5C0D\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u8A31\u53EF\u6B0A\uFF1F
Dec-Plugin_Authority_Role_Full_Authorization=\u5168\u90E8\u6388\u6B0A
Dec-Plugin_Authority_Role_Full_Authorization_Tip=\u78BA\u5B9A\u6388\u4E88\u5DF2\u9078{}\u5C0D\u4EE5\u4E0B\u6240\u6709\u89D2\u8272\u7684\u7BA1\u7406\u8A31\u53EF\u6B0A\uFF1F
Dec-Plugin_Authority_Role_Processing=\u8655\u7406\u4E2D
Dec-Plugin_Authority_Role_Processing=\u8655\u7406\u4E2D...
Dec-Plugin_Authority_Role_Processing_Fail=\u8655\u7406\u5931\u6557
Dec-Plugin_Authority_Role_Processing_Success=\u8655\u7406\u5B8C\u6210

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

@ -1,2 +1,2 @@
/** simple-template 20-05-06 15:14:46 */
!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.extend(t,{header:"dec.plugin.role.list.header"})});
/** simple-template 20-07-07 14:35:18 */
!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,t=this.options;return{type:"bi.htape",items:[{el:{type:"dec.screening.combo",ref:function(t){e.combo=t},text:t.texts.all,defaultValue:1,items:[{text:t.texts.all,iconCls1:"check-mark-e-font",value:1},{text:t.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(t.items)},width:300,rgap:30}]}},_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});
Loading…
Cancel
Save