Commit d1fdc042 by 宋祥

Merge remote-tracking branch 'origin/dev' into dev

parents dcecdffd bbefcccd
package com.baosight.hggp.hg.wd.service;
import com.baosight.hggp.aspect.annotation.OperationLogAnnotation;
import com.baosight.hggp.hg.wd.domain.HGWD003;
import com.baosight.hggp.util.EiInfoUtils;
import com.baosight.hggp.util.LogUtils;
import com.baosight.hggp.util.MapUtils;
import com.baosight.hggp.util.StringUtils;
import com.baosight.iplat4j.core.ei.EiConstant;
import com.baosight.iplat4j.core.ei.EiInfo;
import com.baosight.iplat4j.core.service.impl.ServiceEPBase;
import java.util.Map;
/**
* @author LiuYang
* @version 1.0 2024/10/11
* @description 文档权限管理
*/
public class ServiceHGWD001H extends ServiceEPBase {
/**
* 画面初始化
*
* @param inInfo
* @return
*/
@Override
@OperationLogAnnotation(operModul = "文档浏览", operType = "查询", operDesc = "初始化")
public EiInfo initLoad(EiInfo inInfo) {
try {
inInfo.addBlock(EiConstant.resultBlock).addBlockMeta(new HGWD003().eiMetadata);
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "初始化失败");
}
return inInfo;
}
/**
* 查询
*
* @param inInfo
* @return
*/
public EiInfo query(EiInfo inInfo) {
try {
Map queryMap = EiInfoUtils.getFirstRow(inInfo);
String fileId = MapUtils.getString(queryMap, HGWD003.FIELD_FILE_ID);
if (StringUtils.isBlank(fileId)) {
return inInfo;
}
inInfo = super.query(inInfo, HGWD003.QUERY, new HGWD003());
} catch (Exception e) {
LogUtils.setMsg(inInfo, e, "查询节点失败");
}
return inInfo;
}
}
...@@ -120,27 +120,13 @@ $(function () { ...@@ -120,27 +120,13 @@ $(function () {
var item = node.item; var item = node.item;
var title = item.text; var title = item.text;
let icon = 'fa fa-globe' let icon = 'fa fa-globe'
if (item.label !== 'root') { switch (item.leafType) {
switch (item.type) { case 'P':
case 'company': icon = 'fa fa-clipboard'
// title = title + ' [公司]'; break;
icon = 'fa fa-building' case 'C':
break; icon = 'fa fa-folder'
case 'dept': break;
// title = title + ' [部门]';
icon = 'fa fa-users'
break;
case 'post':
// title = title + ' [岗位]';
icon = 'fa fa-user'
break;
case '1':
icon = 'fa fa-clipboard'
break;
default :
icon = 'fa fa-folder'
//icon = 'fa fa-home'
}
} }
return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>' return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>'
...@@ -304,16 +290,37 @@ $(function () { ...@@ -304,16 +290,37 @@ $(function () {
}); });
}) })
$("#auth").on("click", () => {
const orgId = $("#inqu_status-0-parentId").val();
let fileName = $("#inqu_status-0-fileName").val();
if (null == orgId || "" === orgId || "root" === orgId) {
message2("提示", "请在文档目录树选择公司节点后编辑文档目录");
return
}
let params = "&inqu_status-0-fileId=" + orgId +"&inqu_status-0-fileName="+fileName;
JSColorbox.open({
href: "HGWD001H?methodName=initLoad" + params,
title: "<div style='text-align: center;'>文档权限管理</div>",
width: "90%",
height: "90%",
callbackName: editCallback
});
})
$("#categoryTree").mousedown(function (e) { $("#categoryTree").mousedown(function (e) {
if (e.button !== 2) { if (e.button !== 2) {
return return
} }
if ("组织机构" === e.target.textContent) { if ("工程设计图" === e.target.textContent || "外来制造图" === e.target.textContent || "其他" === e.target.textContent) {
$("#isAdd").css('display', 'none');
$("#isDel").css('display', 'none'); $("#isDel").css('display', 'none');
$("#isEdit").css('display', 'none'); $("#isEdit").css('display', 'none');
$("#isAuth").css('display', 'none');
} else { } else {
$("#isAdd").css('display', 'block');
$("#isDel").css('display', 'block'); $("#isDel").css('display', 'block');
$("#isEdit").css('display', 'block'); $("#isEdit").css('display', 'block');
$("#isAuth").css('display', 'block');
} }
} }
); );
...@@ -349,6 +356,9 @@ $(function () { ...@@ -349,6 +356,9 @@ $(function () {
if (button.data("type") === "edit") { if (button.data("type") === "edit") {
$("#edit").click() $("#edit").click()
} }
if (button.data("type") === "auth") {
$("#auth").click()
}
} }
}); });
...@@ -498,7 +508,7 @@ $(function () { ...@@ -498,7 +508,7 @@ $(function () {
} }
}; };
downKeyUp(); downKeyUp();
// 查询 // 查询
$("#BTN_DELETE").on("click", deleteFunc); $("#BTN_DELETE").on("click", deleteFunc);
...@@ -798,43 +808,26 @@ function updateRelease(operStatus) { ...@@ -798,43 +808,26 @@ function updateRelease(operStatus) {
* 显示授权按钮 * 显示授权按钮
*/ */
let showAuthButton = function () { let showAuthButton = function () {
let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel; let leafType = IPLATUI.EFTree.categoryTree.selectTreeNode.leafType;
let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId; let parentId = IPLATUI.EFTree.categoryTree.selectTreeNode.fileId;
let leafLevel = IPLATUI.EFTree.categoryTree.selectTreeNode.leafLevel
// C:目录 // C:目录
if (leafType && leafType >0) { if (isBlank(leafType) || leafType != "C") {
$("#RELEASE").attr("disabled", false); let changeRecord = $("#CHANGE_RECORD");
$("#UPLOAD_FILE").attr("disabled", false); $("#RELEASE").hide();
$("#CHANGE_RECORD").attr("disabled", true); $("#UPLOAD_FILE").hide();
$("#COPY_FILE").attr("disabled", false); changeRecord.hide();
} else { $("#COPY_FILE").hide();
$("#RELEASE").attr("disabled", true); $("#COPY_PROT_FILE").hide();
$("#UPLOAD_FILE").attr("disabled", true); $("#PREVIEW").hide();
$("#CHANGE_RECORD").attr("disabled", false); $("#BATCH_DOWNLOAD").hide();
$("#COPY_FILE").attr("disabled", true);
if (!isBlank(leafLevel) && leafLevel == 0){
changeRecord.show();
}
return
} }
isProjectManager(parentId); isProjectManager(parentId);
/*let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId);
inEiInfo.set("inqu_status-0-isProjectManager", "1");
inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val());
EiCommunicator.send("HGWD003", "query", inEiInfo, {
onSuccess(ei) {
if (!isBlank(ei.getBlock("result"))){
let rows = ei.getBlock("result").getMappedRows();
if (rows.length > 0 && rows[0].isProjectManager == "1"){
$("#RELEASE").attr("disabled", false);
}else {
$("#RELEASE").attr("disabled", true);
}
}
},
onFail(errorMessage, status, e) {
NotificationUtil("执行失败!", "error");
}
}, {
async: false
});*/
} }
/** /**
...@@ -970,40 +963,39 @@ let preview = function () { ...@@ -970,40 +963,39 @@ let preview = function () {
let isProjectManager = function (parentId) { let isProjectManager = function (parentId) {
let inEiInfo = new EiInfo(); let inEiInfo = new EiInfo();
inEiInfo.set("inqu_status-0-fileId", parentId); inEiInfo.set("inqu_status-0-fileId", parentId);
//inEiInfo.set("inqu_status-0-userId", $("#inqu_status-0-userId").val()); $("#COPY_PROT_FILE").show();
$("#BATCH_DOWNLOAD").show();
EiCommunicator.send("HGWD001", "queryProjectManager", inEiInfo, { EiCommunicator.send("HGWD001", "queryProjectManager", inEiInfo, {
onSuccess(ei) { onSuccess(ei) {
if (ei.status != -1){ if (ei.status != -1){
switch (ei.extAttr.isManager) { switch (ei.extAttr.isManager) {
case 1: case 1:
$("#RELEASE").attr("disabled", false); $("#RELEASE").show();
$("#UPLOAD_FILE").attr("disabled", false); $("#UPLOAD_FILE").show();
$("#COPY_FILE").attr("disabled", false); $("#COPY_FILE").show();
$("#PREVIEW").attr("disabled", false); $("#PREVIEW").show();
break; break;
case 2: case 2:
$("#RELEASE").attr("disabled", false); $("#RELEASE").show();
$("#UPLOAD_FILE").attr("disabled", false); $("#UPLOAD_FILE").show();
$("#COPY_FILE").attr("disabled", false); $("#COPY_FILE").show();
$("#PREVIEW").attr("disabled", false); $("#PREVIEW").show();
break; break;
case 3: case 3:
$("#RELEASE").attr("disabled", true); $("#RELEASE").hide();
$("#UPLOAD_FILE").attr("disabled", false); $("#UPLOAD_FILE").show();
$("#COPY_FILE").attr("disabled", false); $("#COPY_FILE").show();
$("#PREVIEW").attr("disabled", false); $("#PREVIEW").show();
break break
default: default:
$("#RELEASE").attr("disabled", true); $("#RELEASE").hide();
$("#UPLOAD_FILE").attr("disabled", true); $("#UPLOAD_FILE").hide();
$("#COPY_FILE").attr("disabled", true); $("#COPY_FILE").hide();
$("#PREVIEW").attr("disabled", true); $("#PREVIEW").hide();
} }
} }
} }
}, { }, {async: false})
async: false
})
} }
/** /**
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
<EF:EFButton ename="add" class="fa fa-plus" layout="2"/> <EF:EFButton ename="add" class="fa fa-plus" layout="2"/>
<EF:EFButton ename="remove" class="fa fa-trash-o" layout="2"/> <EF:EFButton ename="remove" class="fa fa-trash-o" layout="2"/>
<EF:EFButton ename="edit" class="fa fa-pencil" layout="2"/> <EF:EFButton ename="edit" class="fa fa-pencil" layout="2"/>
<EF:EFButton ename="auth" class="fa fa-pencil" layout="2"/>
</div> </div>
</div> </div>
...@@ -35,8 +36,8 @@ ...@@ -35,8 +36,8 @@
</EF:EFTree> </EF:EFTree>
</div> </div>
<ul id="menumenu" style="width:90px;display: none"> <ul id="menumenu" style="width:100px;display: none">
<li data-type="create"> <li data-type="create" id="isAdd">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-plus"></span>新增 <span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-plus"></span>新增
</li> </li>
<li data-type="delete" id="isDel"> <li data-type="delete" id="isDel">
...@@ -45,6 +46,9 @@ ...@@ -45,6 +46,9 @@
<li data-type="edit" id="isEdit"> <li data-type="edit" id="isEdit">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-pencil"></span>编辑 <span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-pencil"></span>编辑
</li> </li>
<li data-type="auth" id="isAuth">
<span style="font-size: 16px; width: 16px; vertical-align: middle;" class="fa fa-pencil"></span>文档权限
</li>
</ul> </ul>
</EF:EFRegion> </EF:EFRegion>
</div> </div>
......
$(function () {
IPLATUI.EFGrid = {
"result": {
exportGrid: false, // 隐藏右侧自定义导出按钮
pageable: {
pageSize: 500,
pageSizes: [20, 50, 100, 250, 500],
},
loadComplete: function (grid) {
}
}
}
// 查询
$("#QUERY").on("click", query);
// 保存
$("#SAVE").on("click", save);
// 授权
$("#AUTH").on("click", auth);
// 删除用户
$("#REMOVE_USER").on("click", removeUser);
// 复制用户
$("#COPY_USER").on("click", copyUser);
});
/**
* 页面加载
*/
$(window).load(function () {
// 查询
query();
// 授权按钮是否可用
showAuthButton();
});
/**
* 查询
*/
let query = function () {
resultGrid.dataSource.page(1);
}
/**
* 保存
*/
let save = function () {
if (!checkSelectMain()) {
return;
}
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"保存\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "save", true);
}
});
}
/**
* 授权
*/
let auth = function () {
if (!checkSelectMain()) {
return;
}
let fileId = $("#inqu_status-0-fileId").val();
let fileName = $("#inqu_status-0-fileName").val();
let params = {
"inqu_status-0-fileId": fileId
}
JSColorbox.open({
href: "HGWD003A",
title: "<div style='text-align: center;'>正在为:【" + fileName + "】授权用户</div>",
width: "70%",
height: "80%",
params: params,
callbackName: authCallback
});
}
/**
* 授权回调
*/
let authCallback = function (res) {
// 刷新页面
query();
}
/**
* 删除授权用户
*/
let removeUser = function () {
if (!checkSelectMain()) {
return;
}
let rows = resultGrid.getCheckedRows();
if (rows.length < 1) {
message("请选择数据");
return;
}
JSUtils.confirm("确定对勾选中的[" + rows.length + "]条数据做\"取消授权用户\"操作? ", {
ok: function () {
JSUtils.submitGridsData("result", "HGWD003", "removeUser",
true
);
}
});
}
/**
* 复制授权用户
*/
let copyUser = function () {
if (!checkSelectMain()) {
return;
}
let fileId = $("#inqu_status-0-fileId").val();
let fileName = $("#inqu_status-0-fileName").val();
let params = {
"inqu_status-0-mainFileId": fileId
}
JSColorbox.open({
href: "HGWD003B",
title: "<div style='text-align: center;'>正在复制:【" + fileName + "】的授权用户...</div>",
width: "70%",
height: "80%",
params: params,
callbackName: copyUserCallback
});
}
/**
* 授权回调
*/
let copyUserCallback = function (res) {
}
/**
* 校验是否选择的目录
*/
let checkSelectMain = function () {
let fileId = $("#inqu_status-0-fileId").val();
if (isBlank(fileId)) {
message("请选择需要目录");
return false;
}
return true;
}
<%--
Created by IntelliJ IDEA.
User: 1
Date: 2024/10/11
Time: 14:31
To change this template use File | Settings | File Templates.
--%>
<!DOCTYPE html>
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="EF" tagdir="/WEB-INF/tags/EF" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<EF:EFPage title="文档权限管理">
<EF:EFRegion title="查询区" id="inqu">
<EF:EFInput cname="文件ID" ename="fileId" blockId="inqu_status" row="0" type="hidden"/>
<div class="row">
<EF:EFInput cname="文件名称" ename="fileName" blockId="inqu_status" row="0" colWidth="3"
readonly="true"/>
<EF:EFInput cname="部门名称" ename="orgCname" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="用户账号" ename="userId" blockId="inqu_status" row="0" colWidth="3"/>
<EF:EFInput cname="用户姓名" ename="userName" blockId="inqu_status" row="0" colWidth="3"/>
</div>
</EF:EFRegion>
<EF:EFRegion title="已授权用户结果集" id="result" fitHeight="true">
<EF:EFGrid blockId="result" autoDraw="override" checkMode="row" showCount="true" height="73vh">
<EF:EFColumn ename="id" cname="ID" hidden="true"/>
<EF:EFColumn ename="orgCname" cname="部门名称" enable="false" width="120" align="center"/>
<EF:EFColumn ename="userId" cname="用户账号" enable="false" width="100" align="center"/>
<EF:EFColumn ename="userName" cname="用户姓名" enable="false" width="120" align="center"/>
<EF:EFComboColumn ename="isProjectManager" cname="是否项目经理" width="100" align="center"
required="true" copy="true">
<EF:EFCodeOption codeName="hggp.common.yesNo"/>
</EF:EFComboColumn>
<EF:EFColumn ename="createdName" cname="创建人" enable="false" width="100" align="center"/>
<EF:EFColumn ename="createdTime" cname="创建时间" enable="false" width="140" align="center"
editType="datetime" parseFormats="['yyyyMMddHHmmss','yyyy-MM-dd HH:mm:ss']"/>
</EF:EFGrid>
</EF:EFRegion>
</EF:EFPage>
\ No newline at end of file
...@@ -110,25 +110,13 @@ $(function () { ...@@ -110,25 +110,13 @@ $(function () {
var title = item.text; var title = item.text;
let icon = 'fa fa-globe' let icon = 'fa fa-globe'
if (item.label !== 'root') { if (item.label !== 'root') {
switch (item.type) { switch (item.leafType) {
case 'company': case 'P':
// title = title + ' [公司]';
icon = 'fa fa-building'
break;
case 'dept':
// title = title + ' [部门]';
icon = 'fa fa-users'
break;
case 'post':
// title = title + ' [岗位]';
icon = 'fa fa-user'
break;
case '1':
icon = 'fa fa-clipboard' icon = 'fa fa-clipboard'
break; break;
default : case 'C':
icon = 'fa fa-folder' icon = 'fa fa-folder'
//icon = 'fa fa-home' break;
} }
} }
return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>' return ' <span class="' + icon + '" style="padding-right: 8px"> </span> <span class="titleClass" title="' + item.label + '">' + title + '</span>'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment