commit
32ccc0a04b
9 changed files with 317 additions and 0 deletions
@ -0,0 +1,6 @@ |
|||||||
|
# open-JSD-10458 |
||||||
|
|
||||||
|
JSD-10458 用户管理里指定用户不可编辑和不可删除,或者指定用户不可见\ |
||||||
|
免责说明:该源码为第三方爱好者提供,不保证源码和方案的可靠性,也不提供任何形式的源码教学指导和协助!\ |
||||||
|
仅作为开发者学习参考使用!禁止用于任何商业用途!\ |
||||||
|
为保护开发者隐私,开发者信息已隐去!若原开发者希望公开自己的信息,可联系【pioneer】处理。 |
@ -0,0 +1,23 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||||
|
<plugin> |
||||||
|
<id>com.eco.plugin.xxx.3q.gc1y</id> |
||||||
|
<name><![CDATA[xxx插件]]></name> |
||||||
|
<active>yes</active> |
||||||
|
<version>1.0.2</version> |
||||||
|
<env-version>10.0</env-version> |
||||||
|
<jartime>2021-02-10</jartime> |
||||||
|
<vendor>fr.open</vendor> |
||||||
|
<main-package>com.fr.plugin</main-package> |
||||||
|
<!--用来记录这个任务的创建时间--> |
||||||
|
<description><![CDATA[ |
||||||
|
|
||||||
|
]]></description> |
||||||
|
<!--任务ID: --> |
||||||
|
<create-day>2022-6-14 20:55:05</create-day> |
||||||
|
<extra-decision> |
||||||
|
<WebResourceProvider class="com.fr.plugin.web.GC1YGC11WebResourceProvider"/> |
||||||
|
<WebResourceProvider class="com.fr.plugin.web.GC1YGC12WebResourceProvider"/> |
||||||
|
</extra-decision> |
||||||
|
<lifecycle-monitor class="com.fr.plugin.GC1YLifeCycleMonitor"/> |
||||||
|
<function-recorder class="com.fr.plugin.FunctionRecoder"/> |
||||||
|
</plugin> |
@ -0,0 +1,12 @@ |
|||||||
|
package com.fr.plugin; |
||||||
|
|
||||||
|
import com.fr.plugin.transform.ExecuteFunctionRecord; |
||||||
|
import com.fr.plugin.transform.FunctionRecorder; |
||||||
|
|
||||||
|
@FunctionRecorder |
||||||
|
public class FunctionRecoder { |
||||||
|
@ExecuteFunctionRecord |
||||||
|
public void exe(){ |
||||||
|
System.out.println("插件功能埋点,虽然不会执行,除非上架应用"); |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,17 @@ |
|||||||
|
package com.fr.plugin; |
||||||
|
|
||||||
|
import com.fr.plugin.context.PluginContext; |
||||||
|
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor; |
||||||
|
import com.fr.stable.fun.Authorize; |
||||||
|
|
||||||
|
@Authorize |
||||||
|
public class GC1YLifeCycleMonitor extends AbstractPluginLifecycleMonitor { |
||||||
|
@Override |
||||||
|
public void afterRun(PluginContext pluginContext) { |
||||||
|
} |
||||||
|
|
||||||
|
@Override |
||||||
|
public void beforeStop(PluginContext pluginContext) { |
||||||
|
|
||||||
|
} |
||||||
|
} |
@ -0,0 +1,50 @@ |
|||||||
|
package com.fr.plugin.web; |
||||||
|
|
||||||
|
import com.fr.plugin.context.PluginContexts; |
||||||
|
import com.fr.web.struct.Component; |
||||||
|
import com.fr.web.struct.Filter; |
||||||
|
import com.fr.web.struct.browser.RequestClient; |
||||||
|
import com.fr.web.struct.category.ScriptPath; |
||||||
|
import com.fr.web.struct.category.StylePath; |
||||||
|
|
||||||
|
public class GC1Component extends Component { |
||||||
|
public static final GC1Component KEY = new GC1Component(); |
||||||
|
/** |
||||||
|
* 返回需要引入的JS脚本路径 |
||||||
|
* @param client 请求客户端描述 |
||||||
|
* @return JS脚本路径 |
||||||
|
*/ |
||||||
|
public ScriptPath script( RequestClient client ) { |
||||||
|
if (PluginContexts.currentContext().isAvailable()) { |
||||||
|
// 做认证通过的事情
|
||||||
|
return ScriptPath.build("com/fr/plugin/web/js/GC1web.js"); |
||||||
|
} else { |
||||||
|
// 做认证未通过的事情
|
||||||
|
return ScriptPath.build("com/fr/plugin/web/js/webnuy.js"); |
||||||
|
} |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 返回需要引入的CSS样式路径 |
||||||
|
* @param client 请求客户端描述 |
||||||
|
* @return CSS样式路径 |
||||||
|
*/ |
||||||
|
public StylePath style( RequestClient client ) { |
||||||
|
//如果不需要就直接返回 StylePath.EMPTY;
|
||||||
|
return StylePath.build("com/fr/plugin/web/css/GC1web.css"); |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 通过给定的资源过滤器控制是否加载这个资源 |
||||||
|
* @return 资源过滤器 |
||||||
|
*/ |
||||||
|
public Filter filter() { |
||||||
|
return new Filter(){ |
||||||
|
@Override |
||||||
|
public boolean accept() { |
||||||
|
//任何情况下我们都在平台组件加载时加载我们的组件
|
||||||
|
return true; |
||||||
|
} |
||||||
|
}; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,31 @@ |
|||||||
|
package com.fr.plugin.web; |
||||||
|
|
||||||
|
import com.fr.decision.fun.impl.AbstractWebResourceProvider; |
||||||
|
import com.fr.decision.web.MainComponent; |
||||||
|
import com.fr.decision.web.LoginComponent; |
||||||
|
import com.fr.decision.web.UserComponent; |
||||||
|
import com.fr.web.struct.Atom; |
||||||
|
|
||||||
|
public class GC1YGC11WebResourceProvider extends AbstractWebResourceProvider { |
||||||
|
|
||||||
|
/** |
||||||
|
* 需要附加到的主组件 |
||||||
|
* |
||||||
|
* @return 主组件 |
||||||
|
*/ |
||||||
|
|
||||||
|
@Override |
||||||
|
public Atom attach() { |
||||||
|
return UserComponent.KEY; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 客户端所需的组件 |
||||||
|
* |
||||||
|
* @return 组件 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public Atom client() { |
||||||
|
return GC1Component.KEY; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,30 @@ |
|||||||
|
package com.fr.plugin.web; |
||||||
|
|
||||||
|
import com.fr.decision.fun.impl.AbstractWebResourceProvider; |
||||||
|
import com.fr.decision.web.MainComponent; |
||||||
|
import com.fr.decision.web.UserComponent; |
||||||
|
import com.fr.web.struct.Atom; |
||||||
|
|
||||||
|
public class GC1YGC12WebResourceProvider extends AbstractWebResourceProvider { |
||||||
|
|
||||||
|
/** |
||||||
|
* 需要附加到的主组件 |
||||||
|
* |
||||||
|
* @return 主组件 |
||||||
|
*/ |
||||||
|
|
||||||
|
@Override |
||||||
|
public Atom attach() { |
||||||
|
return MainComponent.KEY; |
||||||
|
} |
||||||
|
|
||||||
|
/** |
||||||
|
* 客户端所需的组件 |
||||||
|
* |
||||||
|
* @return 组件 |
||||||
|
*/ |
||||||
|
@Override |
||||||
|
public Atom client() { |
||||||
|
return GC1Component.KEY; |
||||||
|
} |
||||||
|
} |
@ -0,0 +1,148 @@ |
|||||||
|
console.info("GC1加载成功") |
||||||
|
var threeMember=[ |
||||||
|
"220621198601209355", |
||||||
|
"331023198811269993", |
||||||
|
"230127199308044931" |
||||||
|
] |
||||||
|
function isIgnoreUser(userName){ |
||||||
|
return threeMember.includes(userName); |
||||||
|
} |
||||||
|
//不需要可以删除下面的代码
|
||||||
|
!(function () { |
||||||
|
BI.Plugin.config(function (type, options) { |
||||||
|
}, function (type, object) { |
||||||
|
object.element.attr("类型", object.options.type); |
||||||
|
}); |
||||||
|
})(); |
||||||
|
( |
||||||
|
function() { |
||||||
|
var e = BI.inherit(BI.Widget, { |
||||||
|
props: { |
||||||
|
baseCls: "dec-user-row-tools", |
||||||
|
enable: !0, |
||||||
|
info: {}, |
||||||
|
enableEdit: !1, |
||||||
|
limited: !1, |
||||||
|
enableDelete: !1, |
||||||
|
enableDisable: !0, |
||||||
|
editControll: {} |
||||||
|
}, |
||||||
|
render: function() { |
||||||
|
var t = this |
||||||
|
, i = this.options |
||||||
|
, n = i.editControll; |
||||||
|
if(isIgnoreUser(i.username)){ |
||||||
|
return { |
||||||
|
type:"bi.default" |
||||||
|
} |
||||||
|
} |
||||||
|
return { |
||||||
|
type: "bi.grid", |
||||||
|
columns: 3, |
||||||
|
rows: 1, |
||||||
|
items: [{ |
||||||
|
column: 0, |
||||||
|
row: 0, |
||||||
|
el: { |
||||||
|
type: "bi.icon_button", |
||||||
|
$value: "edit-user", |
||||||
|
cls: "normal-edit-font dec-user-row-tools-button", |
||||||
|
title: BI.i18nText("Dec-Basic_Edit"), |
||||||
|
stopPropagation: !0, |
||||||
|
invisible: !n.enableEdit, |
||||||
|
handler: function() { |
||||||
|
var e = { |
||||||
|
type: "dec.user.edit.popup", |
||||||
|
onClickConfirm: function(e, t) { |
||||||
|
i.onEdit(e, t) |
||||||
|
}, |
||||||
|
onEdit: i.onEdit, |
||||||
|
info: i.infoGetter(), |
||||||
|
editControll: n, |
||||||
|
listeners: [{ |
||||||
|
eventName: "EVENT_CLOSE", |
||||||
|
action: function() { |
||||||
|
BI.Popovers.remove(t.getName() + "edit") |
||||||
|
} |
||||||
|
}] |
||||||
|
}; |
||||||
|
BI.Popovers.create(t.getName() + "edit", { |
||||||
|
type: "bi.popover", |
||||||
|
header: BI.i18nText("Dec-Edit_User"), |
||||||
|
body: e, |
||||||
|
width: 550, |
||||||
|
height: 500, |
||||||
|
listeners: [{ |
||||||
|
eventName: "EVENT_CLOSE", |
||||||
|
action: function() { |
||||||
|
BI.Popovers.remove(t.getName() + "edit") |
||||||
|
} |
||||||
|
}] |
||||||
|
}).open(t.getName() + "edit") |
||||||
|
} |
||||||
|
} |
||||||
|
}, { |
||||||
|
column: 1, |
||||||
|
row: 0, |
||||||
|
el: { |
||||||
|
type: "bi.center_adapt", |
||||||
|
invisible: !n.enableDisable, |
||||||
|
items: [{ |
||||||
|
type: "dec.bubble.combo", |
||||||
|
disabled: i.limited, |
||||||
|
el: { |
||||||
|
type: "bi.icon_change_button", |
||||||
|
$testId: "dec-icon-button", |
||||||
|
$value: i.enable ? "disable-user" : "enable-user", |
||||||
|
iconCls: "dec-user-row-tools-button " + (i.enable ? "disable-user-font" : "enable-user-font"), |
||||||
|
ref: function(e) { |
||||||
|
t.iconChangeButton = e |
||||||
|
}, |
||||||
|
title: function() { |
||||||
|
return i.enable ? BI.i18nText("Dec-Disable_Users") : BI.i18nText("Dec-Enable_Users") |
||||||
|
}, |
||||||
|
selected: !!i.enable |
||||||
|
}, |
||||||
|
text: function() { |
||||||
|
return i.enable ? BI.i18nText("Dec-Confirm_Disable_User") : BI.i18nText("Dec-Confirm_Enable_User") |
||||||
|
}, |
||||||
|
onClickConfirm: function() { |
||||||
|
i.enable = !i.enable, |
||||||
|
t.iconChangeButton.setIcon(i.enable ? "disable-user-font" : "enable-user-font"), |
||||||
|
i.onDisable(i.enable), |
||||||
|
this.hideView() |
||||||
|
} |
||||||
|
}] |
||||||
|
} |
||||||
|
}, { |
||||||
|
column: 2, |
||||||
|
row: 0, |
||||||
|
el: { |
||||||
|
type: "bi.center_adapt", |
||||||
|
invisible: !n.enableDelete, |
||||||
|
items: [{ |
||||||
|
type: "dec.bubble.combo", |
||||||
|
disabled: i.limited, |
||||||
|
el: { |
||||||
|
type: "bi.icon_button", |
||||||
|
$value: "delete-user", |
||||||
|
cls: "delete-user-font dec-user-row-tools-button", |
||||||
|
title: BI.i18nText("Dec-Basic_Delete") |
||||||
|
}, |
||||||
|
text: BI.i18nText("Dec-Confirm_Delete_User"), |
||||||
|
onClickConfirm: function() { |
||||||
|
this.hideView(), |
||||||
|
i.onDelete() |
||||||
|
} |
||||||
|
}] |
||||||
|
} |
||||||
|
}] |
||||||
|
} |
||||||
|
} |
||||||
|
}); |
||||||
|
e.EVENT_DELETE = "EVENT_DELETE", |
||||||
|
BI.shortcut("dec.user.row.tools.xxx", e) |
||||||
|
}()); |
||||||
|
BI.config("dec.user.row.tools", function (ob) { |
||||||
|
return BI.extend(ob, {type: "dec.user.row.tools.xxx"}); |
||||||
|
}); |
Loading…
Reference in new issue