合并分支 'master' 到 'fix_bug_first_stage'
Master 查看合并请求 laws-nio/laws-weilai!118
This commit is contained in:
@@ -440,7 +440,7 @@ CREATE TABLE `laws_weilai`.`doc_translation` (
|
||||
PRIMARY KEY (`id`) USING BTREE
|
||||
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '文档翻译表' ROW_FORMAT = Dynamic;
|
||||
|
||||
-- 文档翻译-源语言数据字典
|
||||
-- 文档翻译-源语言数据字典 2022-7-25 已同步生产环境
|
||||
INSERT INTO `laws_weilai`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `dict_en_name`, `is_tag_dict`, `is_read_only`, `attribute_type`, `order_num`) VALUES ('1550306517749547010', '文档翻译-翻译语言-源语言', 'source_language', '文档翻译-翻译语言-源语言', 0, 'admin', '2022-07-22 10:27:32', 'admin', '2022-07-22 10:29:17', NULL, NULL, 1, 0, '1', 2);
|
||||
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('155030756958032691412', '1550306517749547010', '中文', 'zh', '中文', 2, 1, 'admin', '2022-07-22 10:31:43', 'admin', '2022-07-22 10:31:59', 1, NULL, NULL, '0', 'Chinese');
|
||||
@@ -459,7 +459,7 @@ INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_v
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('15503119403009474586', '1550306517749547010', '朝鲜语', 'ko', '朝鲜语', 15, 1, 'admin', '2022-07-22 10:49:05', NULL, NULL, 1, NULL, NULL, '0', 'Korean');
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('15503120084961361947', '1550306517749547010', '越南语', 'vi', '越南语', 16, 1, 'admin', '2022-07-22 10:49:21', NULL, NULL, 1, NULL, NULL, '0', 'Vietnamese');
|
||||
|
||||
-- 文档翻译-目标语言数据字典
|
||||
-- 文档翻译-目标语言数据字典 2022-7-25 已同步生产环境
|
||||
INSERT INTO `laws_weilai`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `dict_en_name`, `is_tag_dict`, `is_read_only`, `attribute_type`, `order_num`) VALUES ('1550306581909815297', '文档翻译-翻译语言-目标语言', 'target_language', '文档翻译-翻译语言-目标语言', 0, 'admin', '2022-07-22 10:27:47', 'admin', '2022-07-22 10:29:13', NULL, NULL, 1, 0, '1', 1);
|
||||
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('15503075695803269141', '1550306581909815297', '中文', 'zh', '中文', 2, 1, 'admin', '2022-07-22 10:31:43', 'admin', '2022-07-22 10:31:59', 1, NULL, NULL, '0', 'Chinese');
|
||||
@@ -478,19 +478,74 @@ INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_v
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1550311940300947458', '1550306581909815297', '朝鲜语', 'ko', '朝鲜语', 15, 1, 'admin', '2022-07-22 10:49:05', NULL, NULL, 1, NULL, NULL, '0', 'Korean');
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1550312008496136194', '1550306581909815297', '越南语', 'vi', '越南语', 16, 1, 'admin', '2022-07-22 10:49:21', NULL, NULL, 1, NULL, NULL, '0', 'Vietnamese');
|
||||
|
||||
-- 文档翻译-发布情况数据字典
|
||||
-- 文档翻译-发布情况数据字典 2022-7-25 已同步生产环境
|
||||
INSERT INTO `laws_weilai`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `dict_en_name`, `is_tag_dict`, `is_read_only`, `attribute_type`, `order_num`) VALUES ('1550314527293128705', '文档翻译-发布情况', 'release_condition', '文档翻译-发布情况', 0, 'admin', '2022-07-22 10:59:21', 'admin', '2022-07-22 11:01:07', NULL, NULL, 1, 0, '1', 2);
|
||||
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1550314666682433537', '1550314527293128705', '已发布', 'published', '已发布', 1, 1, 'admin', '2022-07-22 10:59:55', NULL, NULL, 1, NULL, NULL, '0', 'Have published');
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1550314731320852482', '1550314527293128705', '草稿', 'draft', '草稿', 2, 1, 'admin', '2022-07-22 11:00:10', NULL, NULL, 1, NULL, NULL, '0', 'Draft');
|
||||
|
||||
-- 文档翻译-翻译结果数据字典
|
||||
-- 文档翻译-翻译结果数据字典 2022-7-25 已同步生产环境
|
||||
INSERT INTO `laws_weilai`.`sys_dict` (`id`, `dict_name`, `dict_code`, `description`, `del_flag`, `create_by`, `create_time`, `update_by`, `update_time`, `type`, `dict_en_name`, `is_tag_dict`, `is_read_only`, `attribute_type`, `order_num`) VALUES ('1550314971079852034', '文档翻译-翻译结果', 'translation_result', '文档翻译-翻译结果', 0, 'admin', '2022-07-22 11:01:07', NULL, NULL, NULL, NULL, 1, 0, '1', 1);
|
||||
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1550315090797871105', '1550314971079852034', '翻译中', 'In the translation', '翻译中', 1, 1, 'admin', '2022-07-22 11:01:36', NULL, NULL, 1, NULL, NULL, '0', 'In the translation');
|
||||
INSERT INTO `laws_weilai`.`sys_dict_item` (`id`, `dict_id`, `item_text`, `item_value`, `description`, `sort_order`, `status`, `create_by`, `create_time`, `update_by`, `update_time`, `is_tag_dict`, `is_read_only`, `attribute_type`, `del_flag`, `en_name`) VALUES ('1550315193285689345', '1550314971079852034', '翻译完成', 'Translation done', '翻译完成', 2, 1, 'admin', '2022-07-22 11:02:00', NULL, NULL, 1, NULL, NULL, '0', 'Translation done');
|
||||
|
||||
-- 文档翻译表-增加字段 编号、标题
|
||||
-- 文档翻译表-增加字段 编号、标题 2022-7-25 已同步生产环境
|
||||
ALTER TABLE `laws_weilai`.`doc_translation`
|
||||
ADD COLUMN `serial_number` varchar(255) NULL COMMENT '编号' AFTER `buss_document_library_id`,
|
||||
ADD COLUMN `title` varchar(255) NULL COMMENT '标题' AFTER `serial_number`;
|
||||
|
||||
-- 菜单管理 添加上报库按钮 2022-07-28
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552487817415819266', '1552487412749369345', '自定义导出', NULL, NULL, NULL, NULL, 2, 'report:detail:export:custom', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:55:14', NULL, NULL, 0, 0, '1', 0, 'Custom Export');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552487616038895618', '1552487412749369345', '常规导出', NULL, NULL, NULL, NULL, 2, 'report:detail:export:normal', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:54:26', NULL, NULL, 0, 0, '1', 0, 'Normal Export');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552487412749369345', '1539429224550457346', '查看', NULL, NULL, NULL, NULL, 2, 'report:detail:list', '1', 1.00, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2022-07-28 10:53:38', NULL, NULL, 0, 0, '1', 0, 'Detail');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552487236076896257', '1539429224550457346', '导出历史', NULL, NULL, NULL, NULL, 2, 'params:report:history', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:52:56', NULL, NULL, 0, 0, '1', 0, 'Export History');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552484580440735746', '1539426795780005889', '批量删除', NULL, NULL, NULL, NULL, 2, 'report:exportTemplate:deleteBatch', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:42:22', NULL, NULL, 0, 0, '1', 0, 'Batch Delete');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552484462484324353', '1539426795780005889', '删除', NULL, NULL, NULL, NULL, 2, 'report:exportTemplate:delete', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:41:54', NULL, NULL, 0, 0, '1', 0, 'Delete');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552484292065558530', '1539426795780005889', '编辑', NULL, NULL, NULL, NULL, 2, 'report:exportTemplate:edit', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:41:14', NULL, NULL, 0, 0, '1', 0, 'Edit');
|
||||
INSERT INTO `laws_weilai`.`sys_permission`(`id`, `parent_id`, `name`, `url`, `component`, `component_name`, `redirect`, `menu_type`, `perms`, `perms_type`, `sort_no`, `always_show`, `icon`, `is_route`, `is_leaf`, `keep_alive`, `hidden`, `description`, `create_by`, `create_time`, `update_by`, `update_time`, `del_flag`, `rule_flag`, `status`, `internal_or_external`, `menu_en`) VALUES ('1552484136976973825', '1539426795780005889', '新增', NULL, NULL, NULL, NULL, 2, 'report:exportTemplate:add', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-07-28 10:40:37', NULL, NULL, 0, 0, '1', 0, 'Add');
|
||||
UPDATE `laws_weilai`.`sys_permission` SET `parent_id` = '1516964175944798210', `name` = '上报库管理', `url` = '/escalationlibrary', `component` = 'parameter/escalationlibrary/index', `component_name` = NULL, `redirect` = NULL, `menu_type` = 1, `perms` = 'params:report:page', `perms_type` = '1', `sort_no` = 3.00, `always_show` = 0, `icon` = NULL, `is_route` = 1, `is_leaf` = 0, `keep_alive` = 0, `hidden` = 0, `description` = NULL, `create_by` = 'admin', `create_time` = '2022-06-22 10:05:03', `update_by` = 'admin', `update_time` = '2022-07-28 10:52:00', `del_flag` = 0, `rule_flag` = 0, `status` = '1', `internal_or_external` = 0, `menu_en` = 'Escalation library management' WHERE `id` = '1539429224550457346';
|
||||
UPDATE `laws_weilai`.`sys_permission` SET `parent_id` = '1516964175944798210', `name` = '参数导出模板管理', `url` = '/Parameterexport', `component` = 'parameter/parameterexport/index', `component_name` = NULL, `redirect` = NULL, `menu_type` = 1, `perms` = 'report:exportTemplate:page', `perms_type` = '1', `sort_no` = 2.00, `always_show` = 0, `icon` = NULL, `is_route` = 1, `is_leaf` = 0, `keep_alive` = 0, `hidden` = 0, `description` = NULL, `create_by` = 'admin', `create_time` = '2022-06-22 09:55:24', `update_by` = 'admin', `update_time` = '2022-07-28 10:40:02', `del_flag` = 0, `rule_flag` = 0, `status` = '1', `internal_or_external` = 0, `menu_en` = 'Parameter export template management' WHERE `id` = '1539426795780005889';
|
||||
|
||||
-- 角色表-增加对外报告管理员角色 2022-7-28 已同步生产环境
|
||||
INSERT INTO `sys_role` VALUES ('1552536424587862017', '对外报告管理员', 'ExternalReportsManager', '对外报告文件夹列表的管理员', 'admin', '2022-7-28 14:08:23', NULL, NULL, NULL, NULL);
|
||||
|
||||
-- 菜单管理 添加对外报告文件夹管理按钮权限 2022-07-28 已同步生产环境
|
||||
INSERT INTO `sys_permission` VALUES ('1552182885208608770', '1549937961282908162', '对外报告文件夹管理', '', NULL, NULL, NULL, 2, 'externalReports:folder', '1', 1.00, 0, NULL, 1, 1, 0, 0, NULL, 'admin', '2022-7-27 14:43:33', NULL, NULL, 0, 0, '1', 0, 'External Report Folder Management ');
|
||||
|
||||
-- 对外报告文件夹表 2022-7-29 已同步生产环境
|
||||
DROP TABLE IF EXISTS `ext_repo_folder`;
|
||||
CREATE TABLE `ext_repo_folder` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`folder_name` varchar(255) DEFAULT NULL COMMENT '文件夹名称',
|
||||
`order_id` int(11) DEFAULT NULL COMMENT '文件夹排序',
|
||||
`sup_folder` varchar(36) DEFAULT NULL COMMENT '所属文件夹',
|
||||
`auth_view_ids_name` varchar(2000) DEFAULT NULL COMMENT '查看权限人员',
|
||||
`auth_manage_ids_name` varchar(2000) DEFAULT NULL COMMENT '管理权限人员',
|
||||
`auth_view_ids` varchar(2000) DEFAULT NULL COMMENT '查看权限人员id',
|
||||
`auth_manage_ids` varchar(2000) DEFAULT NULL COMMENT '管理权限人员id',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
INSERT INTO `ext_repo_folder` VALUES ('1552846304994131970', 'admin', '2022-07-01 11:11:11', 'admin', '2022-11-11 11:11:11', 'A01', '文件夹', '1', 'root', '', '', '', '');
|
||||
|
||||
-- 对外报告数据表 2022-7-29 已同步生产环境
|
||||
DROP TABLE IF EXISTS `ext_repo_data`;
|
||||
CREATE TABLE `ext_repo_data` (
|
||||
`id` varchar(36) NOT NULL,
|
||||
`create_by` varchar(50) DEFAULT NULL COMMENT '创建人',
|
||||
`create_time` datetime DEFAULT NULL COMMENT '创建日期',
|
||||
`update_by` varchar(50) DEFAULT NULL COMMENT '更新人',
|
||||
`update_time` datetime DEFAULT NULL COMMENT '更新日期',
|
||||
`sys_org_code` varchar(64) DEFAULT NULL COMMENT '所属部门',
|
||||
`file_key` varchar(255) DEFAULT NULL COMMENT '文件标识',
|
||||
`file_name` varchar(255) DEFAULT NULL COMMENT '文件名称',
|
||||
`file_description` varchar(255) DEFAULT NULL COMMENT '文件说明',
|
||||
`sup_folder` varchar(36) DEFAULT NULL COMMENT '所属文件夹',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
+1
-1
@@ -14,7 +14,7 @@ public enum CollectManifestUserTypeEnum {
|
||||
DRE("填写人", "Dre People","dre"),
|
||||
STUDIO("R&H Studio","R&H Studio","studio"),
|
||||
MANAGER("R&H Manager","R&H Manager","manager"),
|
||||
ADMIN("系统管理员","Administrator","admin"),
|
||||
ADMIN("系统","Administrator","admin"),
|
||||
GUEST("游客", "Guest","guest");
|
||||
|
||||
String name;
|
||||
|
||||
+6
-1
@@ -676,6 +676,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
map.put("db_field_name", paramsConfigEO.getId());
|
||||
map.put("db_field_txt", paramsConfigEO.getConfigName());
|
||||
map.put("type", true); //配置列 标识
|
||||
map.put("isLock", paramsConfigEO.getIsLock()); //配置列 冻结标识
|
||||
listConfig.add(map);
|
||||
}
|
||||
|
||||
@@ -1544,7 +1545,7 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
Map<String, String> msgMap = new HashMap<>();
|
||||
msgMap.put("nioNumber", paramsCollectManifestEO.getNioNumber());
|
||||
msgMap.put("state", paramsCollectManifestEO.getState());
|
||||
msgMap.put("state", "1");
|
||||
msgMap.put("type", "1");
|
||||
msgMapList.add(msgMap);
|
||||
}
|
||||
|
||||
@@ -1581,6 +1582,10 @@ public class ParamsCollectManifestEOServiceImpl extends ServiceImpl<ParamsCollec
|
||||
String content = connectBuilder.substring(0, connectBuilder.toString().length() - 1) + " and other parameter items, please enter the link to handle it.";
|
||||
|
||||
SysUser sysUser = sysUserService.getUserByName(sdt);
|
||||
if(sysUser == null){
|
||||
continue;
|
||||
}
|
||||
|
||||
String[] thirdIds = new String[1];
|
||||
thirdIds[0] = sysUser.getThirdId();
|
||||
String urlParamsStr = parseUrlParams(paramsManifestEO);
|
||||
|
||||
+6
-5
@@ -13,6 +13,7 @@ import com.jero.modules.system.util.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -51,7 +52,7 @@ public class ParamsExportTemplateEOController extends JeroController<ParamsExpor
|
||||
@AutoLog(value = "参数导出模板表-分页列表查询")
|
||||
@ApiOperation(value="参数导出模板表-分页列表查询", notes="参数导出模板表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
// @RequiresPermissions("report:exportTemplate:page")
|
||||
@RequiresPermissions("report:exportTemplate:page")
|
||||
public Result<?> queryPageList(ParamsExportTemplateEO paramsExportTemplateEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@@ -111,7 +112,7 @@ public class ParamsExportTemplateEOController extends JeroController<ParamsExpor
|
||||
@AutoLog(value = "参数导出模板表-添加")
|
||||
@ApiOperation(value="参数导出模板表-添加", notes="参数导出模板表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
// @RequiresPermissions("report:exportTemplate:add")
|
||||
@RequiresPermissions("report:exportTemplate:add")
|
||||
public Result<?> add(@Validated @RequestBody ParamsExportTemplateEO paramsExportTemplateEO) {
|
||||
boolean isSuccess = paramsExportTemplateEOService.add(paramsExportTemplateEO);
|
||||
if (isSuccess) {
|
||||
@@ -130,7 +131,7 @@ public class ParamsExportTemplateEOController extends JeroController<ParamsExpor
|
||||
@AutoLog(value = "参数导出模板表-编辑")
|
||||
@ApiOperation(value="参数导出模板表-编辑", notes="参数导出模板表-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
// @RequiresPermissions("report:exportTemplate:edit")
|
||||
@RequiresPermissions("report:exportTemplate:edit")
|
||||
public Result<?> edit(@Validated @RequestBody ParamsExportTemplateEO paramsExportTemplateEO) {
|
||||
boolean isSuccess = paramsExportTemplateEOService.editById(paramsExportTemplateEO);
|
||||
if (isSuccess) {
|
||||
@@ -149,7 +150,7 @@ public class ParamsExportTemplateEOController extends JeroController<ParamsExpor
|
||||
@AutoLog(value = "参数导出模板表-通过id删除")
|
||||
@ApiOperation(value="参数导出模板表-通过id删除", notes="参数导出模板表-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
// @RequiresPermissions("report:exportTemplate:delete")
|
||||
@RequiresPermissions("report:exportTemplate:delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
boolean isSuccess = paramsExportTemplateEOService.deleteById(id);
|
||||
if (isSuccess) {
|
||||
@@ -168,7 +169,7 @@ public class ParamsExportTemplateEOController extends JeroController<ParamsExpor
|
||||
@AutoLog(value = "参数导出模板表-批量删除")
|
||||
@ApiOperation(value="参数导出模板表-批量删除", notes="参数导出模板表-批量删除")
|
||||
@PostMapping(value = "/deleteBatch")
|
||||
// @RequiresPermissions("report:exportTemplate:deleteBatch")
|
||||
@RequiresPermissions("report:exportTemplate:deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
boolean isSuccess = paramsExportTemplateEOService.deleteByIds(Arrays.asList(ids.split(",")));
|
||||
if (isSuccess) {
|
||||
|
||||
+9
-8
@@ -20,6 +20,7 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@@ -64,7 +65,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
@AutoLog(value = "上报库参数项-表头中英文切换")
|
||||
@ApiOperation(value="上报库参数项-表头中英文切换", notes="上报库参数项-表头中英文切换")
|
||||
@GetMapping(value = "/getHeader")
|
||||
// @RequiresPermissions("report:detail:list")
|
||||
@RequiresPermissions("report:detail:list")
|
||||
public Result<List<Map<String, Object>>> getHeader(@RequestParam(name = "paramsManifestId") String paramsManifestId,
|
||||
@RequestParam(name = "flag") String flag,
|
||||
@RequestParam(name = "cut") String cut) {
|
||||
@@ -80,7 +81,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
@AutoLog(value = "上报库参数项-列表查询")
|
||||
@ApiOperation(value="上报库参数项-列表查询", notes="上报库参数项-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
// @RequiresPermissions("report:detail:list")
|
||||
@RequiresPermissions("report:detail:list")
|
||||
public Result<?> queryList(ParamsReportDetailEO paramsReportDetailEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="100") Integer pageSize,
|
||||
@@ -105,7 +106,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
|
||||
@ApiOperation(value = "上报库参数项-常规导出")
|
||||
@GetMapping(value = "/exportNormal")
|
||||
// @RequiresPermissions("report:detail:export:normal")
|
||||
@RequiresPermissions("report:detail:export:normal")
|
||||
public void exportNormal(ParamsReportDetailVO paramsReportDetailVO,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
@@ -121,7 +122,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
@AutoLog(value = "上报库参数项-配置下拉选项(常规导出)")
|
||||
@ApiOperation(value="上报库参数项-配置下拉选项(常规导出)", notes="上报库参数项-配置下拉选项(常规导出)")
|
||||
@GetMapping(value = "/getConfigLabelList")
|
||||
// @RequiresPermissions("report:detail:export:normal")
|
||||
@RequiresPermissions("report:detail:export:normal")
|
||||
public Result<?> getConfigLableList(ParamsReportDetailVO paramsReportDetailVO) {
|
||||
List<Map<String, String>> configLabelList = paramsReportDetailEOService.getConfigLabelList(paramsReportDetailVO);
|
||||
return Result.OK(configLabelList);
|
||||
@@ -136,7 +137,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
@AutoLog(value = "上报库参数项-配置下拉选项(自定义导出)")
|
||||
@ApiOperation(value="上报库参数项-配置下拉选项(自定义导出)", notes="上报库参数项-配置下拉选项(自定义导出)")
|
||||
@GetMapping(value = "/getConfigLabelListCustom")
|
||||
// @RequiresPermissions("report:detail:export:custom")
|
||||
@RequiresPermissions("report:detail:export:custom")
|
||||
public Result<?> getConfigLableListCustom(ParamsReportDetailVO paramsReportDetailVO) {
|
||||
List<Map<String, String>> configLabelList = paramsReportDetailEOService.getConfigLabelList(paramsReportDetailVO);
|
||||
return Result.OK(configLabelList);
|
||||
@@ -151,7 +152,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
@AutoLog(value = "上报库参数项-导出模板下拉选项")
|
||||
@ApiOperation(value="上报库参数项-导出模板下拉选项", notes="上报库参数项-导出模板下拉选项")
|
||||
@GetMapping(value = "/getTemplateLabelList")
|
||||
// @RequiresPermissions("report:detail:export:custom")
|
||||
@RequiresPermissions("report:detail:export:custom")
|
||||
public Result<?> getTemplateLabelList() {
|
||||
List<Map<String, String>> templateLabelList = paramsReportDetailEOService.getTemplateLabelList();
|
||||
return Result.OK(templateLabelList);
|
||||
@@ -159,7 +160,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
|
||||
@ApiOperation(value = "上报库参数项-自定义导出")
|
||||
@GetMapping(value = "/exportCustom")
|
||||
// @RequiresPermissions("report:detail:export:custom")
|
||||
@RequiresPermissions("report:detail:export:custom")
|
||||
public void exportCustom(ParamsReportDetailVO paramsReportDetailVO,
|
||||
HttpServletResponse response,
|
||||
HttpServletRequest request) {
|
||||
@@ -190,7 +191,7 @@ public class ParamsReportDetailEOController extends JeroController<ParamsReportD
|
||||
@AutoLog(value = "上报库参数配置-查看单个详情")
|
||||
@ApiOperation(value="上报库参数配置-查看单个详情", notes="上报库参数配置-查看单个详情")
|
||||
@GetMapping(value = "/getConfig")
|
||||
// @RequiresPermissions("report:detail:list")
|
||||
@RequiresPermissions("report:detail:list")
|
||||
public Result<ParamsReportConfigEO> getById(@RequestParam(name = "id") String id) {
|
||||
ParamsReportConfigEO paramsReportConfigEO = paramsReportConfigEOService.getById(id);
|
||||
return Result.OK(paramsReportConfigEO);
|
||||
|
||||
+3
-2
@@ -13,6 +13,7 @@ import com.jero.modules.system.util.StringUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.shiro.authz.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
@@ -53,7 +54,7 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
|
||||
@AutoLog(value = "上报库-分页列表查询")
|
||||
@ApiOperation(value="上报库-分页列表查询", notes="上报库-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
// @RequiresPermissions("params:report:page")
|
||||
@RequiresPermissions("params:report:page")
|
||||
public Result<?> queryPageList(ParamsReportEO paramsReportEO,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@@ -82,7 +83,7 @@ public class ParamsReportEOController extends JeroController<ParamsReportEO, IPa
|
||||
@AutoLog(value = "上报库-导出历史分页查询")
|
||||
@ApiOperation(value="上报库-导出历史分页查询", notes="上报库-导出历史分页查询")
|
||||
@GetMapping(value = "/exportHistoryPage")
|
||||
// @RequiresPermissions("params:report:history")
|
||||
@RequiresPermissions("params:report:history")
|
||||
public Result<?> exportHistoryPage(ParamsReportExportHistoryEO paramsReportExportHistoryEO,
|
||||
@RequestParam(name="cut") String cut,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
|
||||
+8
-2
@@ -43,10 +43,16 @@
|
||||
AND cert_category LIKE CONCAT(CONCAT('%',#{paramsReportDetailEO.certCategory}),'%')
|
||||
</if>
|
||||
<if test="paramsReportDetailEO.sdt !=null and paramsReportDetailEO.sdt !=''">
|
||||
AND sdt LIKE CONCAT(CONCAT('%',#{paramsReportDetailEO.sdt}),'%')
|
||||
AND sdt in
|
||||
<foreach collection="paramsReportDetailEO.sdt.split(',')" index="" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramsReportDetailEO.dre !=null and paramsReportDetailEO.dre !=''">
|
||||
AND dre LIKE CONCAT(CONCAT('%',#{paramsReportDetailEO.dre}),'%')
|
||||
AND dre in
|
||||
<foreach collection="paramsReportDetailEO.dre.split(',')" index="" item="item" open="(" close=")" separator=",">
|
||||
#{item}
|
||||
</foreach>
|
||||
</if>
|
||||
<if test="paramsReportDetailEO.paramsManifestId !=null and paramsReportDetailEO.paramsManifestId !=''">
|
||||
AND params_manifest_id = #{paramsReportDetailEO.paramsManifestId}
|
||||
|
||||
+1
@@ -53,6 +53,7 @@ public interface IParamsReportDetailEOService extends IService<ParamsReportDetai
|
||||
// 自定义导出-word模板
|
||||
void exportCustomWord(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
// 自定义导出-excel模板
|
||||
void exportCustomExcel(ParamsReportDetailVO paramsReportDetailVO, HttpServletResponse response, HttpServletRequest request);
|
||||
|
||||
}
|
||||
|
||||
+13
-2
@@ -36,11 +36,14 @@ import com.jero.modules.system.service.ISysDictItemService;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.poi.hssf.util.HSSFColor;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.apache.poi.ss.usermodel.WorkbookFactory;
|
||||
import org.apache.poi.util.IOUtils;
|
||||
import org.apache.poi.xssf.usermodel.*;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.docx4j.Docx4J;
|
||||
import org.docx4j.openpackaging.exceptions.Docx4JException;
|
||||
import org.docx4j.openpackaging.packages.SpreadsheetMLPackage;
|
||||
import org.docx4j.openpackaging.packages.WordprocessingMLPackage;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
@@ -795,6 +798,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
// 查询导出数据
|
||||
List<Map> allParamsInfoList = queryForExportCustom(paramsReportDetailVO);
|
||||
HashMap<String, String> params = (HashMap<String, String>) allParamsInfoList.get(0);
|
||||
List<Map<String, Object>> imgListAll = (List<Map<String, Object>>) allParamsInfoList.get(1).get("imgListAll");
|
||||
|
||||
String templateUrl = "";
|
||||
ParamsExportTemplateEO paramsExportTemplateEO = paramsExportTemplateEOService.getById(paramsReportDetailVO.getExportTemplateId());
|
||||
@@ -820,7 +824,14 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
InputStream wordTemplate = CosBootUtil.download(templateUrl);
|
||||
// com.qcloud.cos.utils.IOUtils.copy(wordTemplate, wordOS);
|
||||
|
||||
ExcelUtil.variableReplace(wordTemplate, wordOS, params);
|
||||
// 替换占位符内容
|
||||
// docx4j方式
|
||||
InputStream excelTemplate = CosBootUtil.download(templateUrl);
|
||||
SpreadsheetMLPackage pkg = SpreadsheetMLPackage.load(wordTemplate);
|
||||
Workbook workbook = WorkbookFactory.create(excelTemplate);
|
||||
ExcelUtil.replacePictureBatchPOI(workbook, pkg, imgListAll);
|
||||
ExcelUtil.variableReplace(pkg, params);
|
||||
pkg.save(wordOS);
|
||||
|
||||
}
|
||||
|
||||
@@ -1285,7 +1296,7 @@ public class ParamsReportDetailEOServiceImpl extends ServiceImpl<ParamsReportDet
|
||||
if (Date.class.equals(field.getType())) {
|
||||
Date date = (Date) o;
|
||||
String pattern = "";
|
||||
if ("deadline".equals(varName)) {
|
||||
if ("syncTime".equals(varName)) {
|
||||
pattern = "yyyy-MM-dd";
|
||||
} else {
|
||||
pattern = "yyyy-MM-dd HH:mm:ss";
|
||||
|
||||
+26
-7
@@ -4,13 +4,12 @@ import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.modules.docTranslation.entity.DocTranslationEO;
|
||||
import com.jero.modules.docTranslation.service.IDocTranslationEOService;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -21,7 +20,6 @@ import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 文档翻译表
|
||||
* @Author: jero-boot
|
||||
@@ -53,9 +51,7 @@ public class DocTranslationEOController extends JeroController<DocTranslationEO,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
@RequestParam(name="cut", defaultValue="cn") String cut,
|
||||
HttpServletRequest req) {
|
||||
QueryWrapper<DocTranslationEO> queryWrapper = QueryGenerator.initQueryWrapper(docTranslationEO, req.getParameterMap());
|
||||
Page<DocTranslationEO> page = new Page<DocTranslationEO>(pageNo, pageSize);
|
||||
IPage<DocTranslationEO> pageList = docTranslationEOService.page(page, queryWrapper);
|
||||
IPage<DocTranslationEO> pageList = docTranslationEOService.queryPageList(docTranslationEO,pageNo,pageSize,cut,req);
|
||||
return Result.OK(cut,pageList);
|
||||
}
|
||||
|
||||
@@ -168,4 +164,27 @@ public class DocTranslationEOController extends JeroController<DocTranslationEO,
|
||||
return super.importExcel(request, response, DocTranslationEO.class);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新文档翻译表发布情况
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档翻译表-批量更新发布情况")
|
||||
@ApiOperation(value="文档翻译表-批量更新发布情况", notes="文档翻译表-批量更新发布情况")
|
||||
@PostMapping(value = "/updateRleaseConditionBatch")
|
||||
public Result<?> updateRleaseConditionBatch(@RequestBody JSONObject json) {
|
||||
return this.docTranslationEOService.updateRleaseConditionBatch(json);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量更新文档翻译表状态
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "文档翻译表-查询文本状态下拉选项")
|
||||
@ApiOperation(value="文档翻译表-查询文本状态下拉选项", notes="文档翻译表-查询文本状态下拉选项")
|
||||
@GetMapping(value = "/queryTextStatusVal")
|
||||
public Result<?> queryTextStatusVal() {
|
||||
return this.docTranslationEOService.queryTextStatusVal();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+4
-1
@@ -2,6 +2,7 @@ package com.jero.modules.docTranslation.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import lombok.Data;
|
||||
@@ -73,10 +74,12 @@ public class DocTranslationEO implements Serializable {
|
||||
private String title;
|
||||
|
||||
/**文本状态*/
|
||||
@Dict(dicCode = "state")
|
||||
//@Dict(dicCode = "state")
|
||||
@Excel(name = "文本状态", width = 15)
|
||||
@ApiModelProperty(value = "文本状态")
|
||||
private java.lang.String textStatus;
|
||||
@TableField(exist = false)
|
||||
private String textStatus_dictText;
|
||||
|
||||
/**文件名称*/
|
||||
@Excel(name = "文件名称", width = 15)
|
||||
|
||||
+29
@@ -1,7 +1,12 @@
|
||||
package com.jero.modules.docTranslation.service;
|
||||
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.modules.docTranslation.entity.DocTranslationEO;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -58,4 +63,28 @@ public interface IDocTranslationEOService extends IService<DocTranslationEO> {
|
||||
* @return
|
||||
*/
|
||||
List<DocTranslationEO> queryList();
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param docTranslationEO
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param cut
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
IPage<DocTranslationEO> queryPageList(DocTranslationEO docTranslationEO, Integer pageNo, Integer pageSize, String cut, HttpServletRequest req);
|
||||
|
||||
/**
|
||||
* 批量更新发布情况
|
||||
* @param json
|
||||
* @return
|
||||
*/
|
||||
Result<?> updateRleaseConditionBatch(JSONObject json);
|
||||
|
||||
/**
|
||||
* 查询文本状态下拉选项(文档库中,文件类型字段)
|
||||
* @return
|
||||
*/
|
||||
Result<?> queryTextStatusVal();
|
||||
}
|
||||
|
||||
+99
@@ -1,20 +1,40 @@
|
||||
package com.jero.modules.docTranslation.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.constant.enums.ModuleEnum;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.generater.modules.online.cgform.entity.OnlCgformField;
|
||||
import com.jero.generater.modules.online.cgform.service.impl.OnlCgformFieldServiceImpl;
|
||||
import com.jero.modules.docTranslation.entity.DocTranslationEO;
|
||||
import com.jero.modules.docTranslation.enums.ReleaseConditionEnum;
|
||||
import com.jero.modules.docTranslation.enums.TranslationResultEnum;
|
||||
import com.jero.modules.docTranslation.mapper.DocTranslationEOMapper;
|
||||
import com.jero.modules.docTranslation.service.IDocTranslationEOService;
|
||||
import com.jero.modules.docTranslation.utils.TranslationDocumentUtils;
|
||||
import com.jero.modules.document.enums.FieldTypeEnum;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import me.zhyd.oauth.utils.StringUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.transaction.annotation.Propagation;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
|
||||
/**
|
||||
* @Description: 文档翻译表
|
||||
* @Author: jero-boot
|
||||
@@ -25,6 +45,8 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
|
||||
public class DocTranslationEOServiceImpl extends ServiceImpl<DocTranslationEOMapper, DocTranslationEO> implements IDocTranslationEOService {
|
||||
|
||||
@Autowired
|
||||
private OnlCgformFieldServiceImpl onlCgformFieldService;
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -103,4 +125,81 @@ public class DocTranslationEOServiceImpl extends ServiceImpl<DocTranslationEOMap
|
||||
public List<DocTranslationEO> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<DocTranslationEO> queryPageList(DocTranslationEO docTranslationEO, Integer pageNo, Integer pageSize, String cut, HttpServletRequest req) {
|
||||
Page<DocTranslationEO> page = new Page<DocTranslationEO>(pageNo, pageSize);
|
||||
|
||||
QueryWrapper<DocTranslationEO> queryWrapper = QueryGenerator.initQueryWrapper(docTranslationEO, req.getParameterMap());
|
||||
// 获取当前登录人
|
||||
LoginUser currentUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
/**
|
||||
* 数据权限:自己创建的、或发布情况为“已发布”的数据
|
||||
*/
|
||||
queryWrapper.lambda().and(query -> {
|
||||
query.eq(DocTranslationEO::getCreateBy,currentUser.getUsername());
|
||||
query.or(o -> {
|
||||
o.eq(DocTranslationEO::getReleaseCondition,ReleaseConditionEnum.PUBLISHED.getValue());
|
||||
});
|
||||
});
|
||||
queryWrapper.lambda().orderByDesc(DocTranslationEO::getCreateTime);
|
||||
IPage<DocTranslationEO> result = this.page(page, queryWrapper);
|
||||
disposeData(result.getRecords(),cut);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 处理数据
|
||||
* @param datas
|
||||
* @param cut
|
||||
*/
|
||||
public void disposeData(List<DocTranslationEO> datas,String cut){
|
||||
if(CollectionUtils.isNotEmpty(datas)){
|
||||
for (DocTranslationEO data : datas) {
|
||||
String textStatus_dictText = "";
|
||||
OnlCgformField fileTypeField = this.onlCgformFieldService.queryById(data.getTextStatus());
|
||||
if (ObjectUtil.isNotEmpty(fileTypeField)) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
textStatus_dictText = fileTypeField.getDbFieldTxt();
|
||||
} else {
|
||||
textStatus_dictText = fileTypeField.getDbFieldEnName();
|
||||
}
|
||||
}
|
||||
data.setTextStatus_dictText(textStatus_dictText);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> updateRleaseConditionBatch(JSONObject json) {
|
||||
String ids = json.getString("ids");
|
||||
// 值对应枚举类 ReleaseConditionEnum 发布published 或撤回draft
|
||||
String releaseCondition = json.getString("releaseCondition");
|
||||
if (StringUtils.isNotEmpty(ids)) {
|
||||
List<DocTranslationEO> docTranslationEOList = new ArrayList<>();
|
||||
|
||||
List<String> idList = Arrays.asList(ids.split(","));
|
||||
idList.forEach(id -> {
|
||||
DocTranslationEO docTranslationEO = new DocTranslationEO();
|
||||
docTranslationEO.setId(id);
|
||||
docTranslationEO.setReleaseCondition(releaseCondition);
|
||||
docTranslationEOList.add(docTranslationEO);
|
||||
});
|
||||
this.updateBatchById(docTranslationEOList);
|
||||
}
|
||||
return new Result<>().success("操作成功!");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Result<?> queryTextStatusVal() {
|
||||
List<OnlCgformField> fieldList = this.onlCgformFieldService.getFieldList(ModuleEnum.DOCUMENT_LIBRARY.getValue());
|
||||
List<OnlCgformField> result = fieldList.stream().filter(field -> {
|
||||
boolean flag = false;
|
||||
if(org.apache.commons.lang3.StringUtils.equals(field.getFieldShowType(), FieldTypeEnum.FILE.getValue())){
|
||||
flag = true;
|
||||
}
|
||||
return flag;
|
||||
}).collect(Collectors.toList());
|
||||
return Result.OK(result);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -140,11 +140,11 @@ public class TranslationDocumentUtils {
|
||||
}
|
||||
try {
|
||||
FileOutputStream out = new FileOutputStream(newFile);
|
||||
out.write(translateAfter.getBytes("UTF-8"));
|
||||
out.close();
|
||||
|
||||
MultipartFile multipartFile = createMfileByPath(translateAfterFilePath);
|
||||
ossFile = iossFileService.uploadLocalOfCos(multipartFile, "", null, null);
|
||||
out.write(translateAfter.getBytes("UTF-8"));
|
||||
out.close();
|
||||
} catch (FileNotFoundException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
|
||||
+2
-2
@@ -3189,7 +3189,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
//您订阅的XXX已被修改
|
||||
content = "In the "+category + " " + serialNumber+" you subscribed to, has been modified,Please pay attention to check.";
|
||||
String contentInfo = "In the "+category + " " + href+" you subscribed to, "+sysUser.getUsername()+" changed the "+ href + " " + sbStr.toString();
|
||||
String msgTitle = serialNumber + " you subsribed to has been updated";
|
||||
String msgTitle = serialNumber + " you subscribed to has been updated";
|
||||
//封装消息的实体类
|
||||
SysAnnouncement sysAnnouncement = getSysAnnouncement(userIdListUpdate, msgTitle, content, contentInfo,MessageTypeEnum.READ.getValue(),MessageTypeEnum.SYSTEMATIC_NOTIFICATION.getName());
|
||||
sysAnnouncementService.saveAnnouncement(sysAnnouncement);
|
||||
@@ -3411,7 +3411,7 @@ public class BussDocumentLibraryEOServiceImpl extends ServiceImpl<BussDocumentLi
|
||||
}
|
||||
String fieldStr = fieldSb.substring(0, fieldSb.length() - 1);
|
||||
|
||||
String field = " osf.id,bdl.serial_number,bdl.title,bdl.title_en,bdl.state,osf.file_name,osf.connect_id," + fieldStr
|
||||
String field = " osf.id,bdl.id as \"buss_document_library_id\",bdl.serial_number,bdl.title,bdl.title_en,bdl.state,osf.file_name,osf.connect_id," + fieldStr
|
||||
+ " from oss_file osf join buss_document_library bdl" + join.toString();
|
||||
|
||||
//查询条件
|
||||
|
||||
+271
@@ -0,0 +1,271 @@
|
||||
package com.jero.modules.extRepo.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoDataPage;
|
||||
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
||||
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 对外报告数据表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "对外报告数据表")
|
||||
@RestController
|
||||
@RequestMapping("/com.jero.modules.extRepo/extRepoData")
|
||||
@Slf4j
|
||||
public class ExtRepoDataController extends JeroController<ExtRepoData, IExtRepoDataService> {
|
||||
@Autowired
|
||||
private IExtRepoDataService extRepoDataService;
|
||||
|
||||
@Autowired
|
||||
private IExtRepoFolderService extRepoFolderService;
|
||||
|
||||
|
||||
private final SimpleDateFormat sdf = new SimpleDateFormat("yyy-MM-dd HH:mm:ss");
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param extRepoData
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-分页列表查询")
|
||||
@ApiOperation(value = "对外报告数据表-分页列表查询", notes = "对外报告数据表-分页列表查询")
|
||||
@GetMapping(value = "/page")
|
||||
public Result<?> queryPageList(ExtRepoData extRepoData,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
LambdaQueryWrapper<ExtRepoData> queryWrapper = new LambdaQueryWrapper<>();
|
||||
Page<ExtRepoData> page = new Page<>(pageNo, pageSize);
|
||||
// 文件名称模糊查询
|
||||
String fileName = req.getParameter("fileName");
|
||||
if (StringUtils.isNotBlank(fileName)) {
|
||||
queryWrapper.like(ExtRepoData::getFileName, fileName);
|
||||
}
|
||||
// 上传人模糊查询
|
||||
String createBy = req.getParameter("createBy");
|
||||
if (StringUtils.isNotBlank(createBy)) {
|
||||
queryWrapper.like(ExtRepoData::getCreateBy, createBy);
|
||||
}
|
||||
// 更新时间查询
|
||||
String createTime = req.getParameter("time");
|
||||
if (StringUtils.isNotBlank(createTime)) {
|
||||
String[] createTimeArr = createTime.split(",");
|
||||
if (createTimeArr.length >= 2) {
|
||||
queryWrapper.between(ExtRepoData::getCreateTime, createTimeArr[0], createTimeArr[1]);
|
||||
}
|
||||
}
|
||||
queryWrapper.eq(ExtRepoData::getSupFolder, extRepoData.getSupFolder());
|
||||
IPage<ExtRepoData> pageList = extRepoDataService.page(page, queryWrapper);
|
||||
ExtRepoDataPage res = new ExtRepoDataPage(extRepoFolderService.haveManageAuth(extRepoData.getSupFolder()), pageList);
|
||||
return Result.OK(res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-列表查询")
|
||||
@ApiOperation(value = "对外报告数据表-列表查询", notes = "对外报告数据表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ExtRepoData>> queryList() {
|
||||
List<ExtRepoData> list = extRepoDataService.queryList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param extRepoData
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-添加")
|
||||
@ApiOperation(value = "对外报告数据表-添加", notes = "对外报告数据表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ExtRepoData extRepoData,
|
||||
@RequestParam("cut") String cut) {
|
||||
if (extRepoFolderService.haveManageAuth(extRepoData.getSupFolder())) {
|
||||
log.info("对外报告数据表收到文件添加请求,开始处理文件:【" + sdf.format(new Date()) + "】");
|
||||
int res = extRepoDataService.add(extRepoData);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("添加成功:" + res + "条数据!");
|
||||
} else {
|
||||
return Result.OK("success:" + res + "data!");
|
||||
}
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param extRepoData
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-编辑")
|
||||
@ApiOperation(value = "对外报告数据表-编辑", notes = "对外报告数据表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ExtRepoData extRepoData,
|
||||
@RequestParam("cut") String cut) {
|
||||
ExtRepoData erd = extRepoDataService.queryById(extRepoData.getId());
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) {
|
||||
extRepoData.setSupFolder(erd.getSupFolder());
|
||||
extRepoDataService.editById(extRepoData);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("添加成功!");
|
||||
} else {
|
||||
return Result.OK("success!");
|
||||
}
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-通过id删除")
|
||||
@ApiOperation(value = "对外报告数据表-通过id删除", notes = "对外报告数据表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam("id") String id,
|
||||
@RequestParam("cut") String cut) {
|
||||
ExtRepoData erd = extRepoDataService.queryById(id);
|
||||
if (null != erd) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
if (extRepoFolderService.isManager() || sysUser.getUsername().equals(erd.getCreateBy())) {
|
||||
extRepoDataService.deleteById(id);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("删除成功!");
|
||||
} else {
|
||||
return Result.OK("Delete success!");
|
||||
}
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
return Result.error("Delete Error!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-批量删除")
|
||||
@ApiOperation(value = "对外报告数据表-批量删除", notes = "对外报告数据表-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam("ids") String ids,
|
||||
@RequestParam("cut") String cut) {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<String> idsList = Arrays.asList(ids.split(","));
|
||||
for (String id : idsList) {
|
||||
ExtRepoData erd = extRepoDataService.queryById(id);
|
||||
if (null != erd && !extRepoFolderService.isManager() && !sysUser.getUsername().equals(erd.getCreateBy())) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
}
|
||||
this.extRepoDataService.deleteByIds(idsList);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("删除成功!");
|
||||
} else {
|
||||
return Result.OK("Delete success!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告数据表-通过id查询")
|
||||
@ApiOperation(value = "对外报告数据表-通过id查询", notes = "对外报告数据表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id) {
|
||||
ExtRepoData extRepoData = extRepoDataService.queryById(id);
|
||||
if (extRepoData == null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(extRepoData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param extRepoData
|
||||
*/
|
||||
@RequestMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, ExtRepoData extRepoData) {
|
||||
return super.exportXls(request, extRepoData, ExtRepoData.class, "对外报告数据表");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, ExtRepoData.class);
|
||||
}
|
||||
|
||||
}
|
||||
+158
@@ -0,0 +1,158 @@
|
||||
package com.jero.modules.extRepo.controller;
|
||||
|
||||
import com.jero.common.api.vo.Result;
|
||||
import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.constant.enums.CutEnum;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.modules.extRepo.entity.ERFTreeData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
||||
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 对外报告文件夹表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags = "对外报告文件夹表")
|
||||
@RestController
|
||||
@RequestMapping("/extRepo/extRepoFolder")
|
||||
@Slf4j
|
||||
public class ExtRepoFolderController extends JeroController<ExtRepoFolder, IExtRepoFolderService> {
|
||||
@Autowired
|
||||
private IExtRepoFolderService extRepoFolderService;
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告文件夹表-列表查询")
|
||||
@ApiOperation(value = "对外报告文件夹表-列表查询", notes = "对外报告文件夹表-列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<List<ERFTreeData>> queryList() {
|
||||
List<ERFTreeData> list = extRepoFolderService.queryTreeList();
|
||||
return Result.OK(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param extRepoFolder
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告文件夹表-添加")
|
||||
@ApiOperation(value = "对外报告文件夹表-添加", notes = "对外报告文件夹表-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@Validated @RequestBody ExtRepoFolder extRepoFolder,
|
||||
@RequestParam("cut") String cut) {
|
||||
if (extRepoFolderService.haveManageAuth(extRepoFolder.getSupFolder())) {
|
||||
extRepoFolderService.add(extRepoFolder);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("添加成功!");
|
||||
} else {
|
||||
return Result.OK("success!");
|
||||
}
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param extRepoFolder
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告文件夹表-编辑")
|
||||
@ApiOperation(value = "对外报告文件夹表-编辑", notes = "对外报告文件夹表-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
public Result<?> edit(@Validated @RequestBody ExtRepoFolder extRepoFolder,
|
||||
@RequestParam("cut") String cut) {
|
||||
if (extRepoFolderService.haveManageAuth(extRepoFolder.getId())) {
|
||||
extRepoFolderService.editById(extRepoFolder);
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("编辑成功!");
|
||||
} else {
|
||||
return Result.OK("success!");
|
||||
}
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告文件夹表-通过id删除")
|
||||
@ApiOperation(value = "对外报告文件夹表-通过id删除", notes = "对外报告文件夹表-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam("cut") String cut) {
|
||||
if (extRepoFolderService.haveManageAuth(id)) {
|
||||
List<ExtRepoFolder> resList = extRepoFolderService.getListBySupFolder(id);
|
||||
if (resList.isEmpty()) {
|
||||
extRepoFolderService.deleteById(id);
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("请先删除子文件夹!");
|
||||
} else {
|
||||
return Result.error("Please Delete Subfolder First!");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("没有权限!");
|
||||
} else {
|
||||
return Result.error("No Permission!");
|
||||
}
|
||||
}
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.OK("删除成功!");
|
||||
} else {
|
||||
return Result.OK("success!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@AutoLog(value = "对外报告文件夹表-通过id查询")
|
||||
@ApiOperation(value = "对外报告文件夹表-通过id查询", notes = "对外报告文件夹表-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name = "id", required = true) String id,
|
||||
@RequestParam("cut") String cut) {
|
||||
ExtRepoFolder extRepoFolder = extRepoFolderService.queryById(id);
|
||||
if (extRepoFolder == null) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
return Result.error("未找到对应数据");
|
||||
} else {
|
||||
return Result.error("No Data!");
|
||||
}
|
||||
}
|
||||
return Result.OK(extRepoFolder);
|
||||
}
|
||||
}
|
||||
+178
@@ -0,0 +1,178 @@
|
||||
package com.jero.modules.extRepo.entity;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 对外报告文件夹 树结构实体类
|
||||
*/
|
||||
public class ERFTreeData implements Comparable<ERFTreeData> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 页面显示的名称 对应 folder_name
|
||||
*/
|
||||
private String title;
|
||||
|
||||
private String folderName;
|
||||
|
||||
/**
|
||||
* 文件夹ID 对应 id
|
||||
*/
|
||||
private String key;
|
||||
|
||||
/**
|
||||
* 层级,设定最多4级
|
||||
*/
|
||||
private int level;
|
||||
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private int orderId;
|
||||
|
||||
|
||||
/**
|
||||
* 是否显示
|
||||
*/
|
||||
private boolean display = false;
|
||||
|
||||
|
||||
/**
|
||||
* 查看权限人员
|
||||
*/
|
||||
private String authViewIdsName = "";
|
||||
|
||||
/**
|
||||
* 管理权限人员
|
||||
*/
|
||||
private String authManageIdsName = "";
|
||||
|
||||
/**
|
||||
* 查看权限人员id
|
||||
*/
|
||||
private String authViewIds = "";
|
||||
|
||||
/**
|
||||
* 管理权限人员id
|
||||
*/
|
||||
private String authManageIds = "";
|
||||
|
||||
/**
|
||||
* 子文件夹
|
||||
*/
|
||||
private List<ERFTreeData> children = new ArrayList<ERFTreeData>();
|
||||
|
||||
public ERFTreeData() {
|
||||
}
|
||||
|
||||
public ERFTreeData(String title, String key, int level, int orderId) {
|
||||
this.title = title;
|
||||
this.folderName = title;
|
||||
this.key = key;
|
||||
this.level = level;
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getKey() {
|
||||
return key;
|
||||
}
|
||||
|
||||
public void setKey(String key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public int getLevel() {
|
||||
return level;
|
||||
}
|
||||
|
||||
public void setLevel(int level) {
|
||||
this.level = level;
|
||||
}
|
||||
|
||||
public List<ERFTreeData> getChildren() {
|
||||
return children;
|
||||
}
|
||||
|
||||
public void setChildren(List<ERFTreeData> children) {
|
||||
this.children = children;
|
||||
}
|
||||
|
||||
public int getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(int orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public boolean isDisplay() {
|
||||
return display;
|
||||
}
|
||||
|
||||
public void setDisplay(boolean display) {
|
||||
this.display = display;
|
||||
}
|
||||
|
||||
public String getFolderName() {
|
||||
return folderName;
|
||||
}
|
||||
|
||||
public void setFolderName(String folderName) {
|
||||
this.folderName = folderName;
|
||||
}
|
||||
|
||||
public String getAuthViewIdsName() {
|
||||
return authViewIdsName;
|
||||
}
|
||||
|
||||
public void setAuthViewIdsName(String authViewIdsName) {
|
||||
this.authViewIdsName = authViewIdsName;
|
||||
}
|
||||
|
||||
public String getAuthManageIdsName() {
|
||||
return authManageIdsName;
|
||||
}
|
||||
|
||||
public void setAuthManageIdsName(String authManageIdsName) {
|
||||
this.authManageIdsName = authManageIdsName;
|
||||
}
|
||||
|
||||
public String getAuthViewIds() {
|
||||
return authViewIds;
|
||||
}
|
||||
|
||||
public void setAuthViewIds(String authViewIds) {
|
||||
this.authViewIds = authViewIds;
|
||||
}
|
||||
|
||||
public String getAuthManageIds() {
|
||||
return authManageIds;
|
||||
}
|
||||
|
||||
public void setAuthManageIds(String authManageIds) {
|
||||
this.authManageIds = authManageIds;
|
||||
}
|
||||
|
||||
public void sortChildren() {
|
||||
Collections.sort(children);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(@NotNull ERFTreeData o) {
|
||||
return this.orderId - o.orderId;
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.jero.modules.extRepo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 对外报告数据表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("ext_repo_data")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ext_repo_data对象", description="对外报告数据表")
|
||||
public class ExtRepoData implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private java.lang.String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private java.lang.String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private java.lang.String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private java.lang.String sysOrgCode;
|
||||
|
||||
/**文件标识*/
|
||||
@Excel(name = "文件标识", width = 15)
|
||||
@ApiModelProperty(value = "文件标识")
|
||||
private java.lang.String fileKey;
|
||||
|
||||
/**文件名称*/
|
||||
@Excel(name = "文件名称", width = 15)
|
||||
@ApiModelProperty(value = "文件名称")
|
||||
private java.lang.String fileName;
|
||||
|
||||
/**文件说明*/
|
||||
@Excel(name = "文件说明", width = 15)
|
||||
@ApiModelProperty(value = "文件说明")
|
||||
private java.lang.String fileDescription;
|
||||
|
||||
/**所属文件夹*/
|
||||
@Excel(name = "所属文件夹", width = 15)
|
||||
@ApiModelProperty(value = "所属文件夹")
|
||||
private java.lang.String supFolder;
|
||||
|
||||
}
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
package com.jero.modules.extRepo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
|
||||
public class ExtRepoDataPage {
|
||||
|
||||
/**
|
||||
* 此页面是否有管理权限
|
||||
*/
|
||||
private boolean auth_manage;
|
||||
|
||||
/**
|
||||
* 数据列表
|
||||
*/
|
||||
private IPage<ExtRepoData> pageList;
|
||||
|
||||
public ExtRepoDataPage() {
|
||||
}
|
||||
|
||||
public ExtRepoDataPage(boolean auth_manage, IPage<ExtRepoData> pageList) {
|
||||
this.auth_manage = auth_manage;
|
||||
this.pageList = pageList;
|
||||
}
|
||||
|
||||
public boolean isAuth_manage() {
|
||||
return auth_manage;
|
||||
}
|
||||
|
||||
public void setAuth_manage(boolean auth_manage) {
|
||||
this.auth_manage = auth_manage;
|
||||
}
|
||||
|
||||
public IPage<ExtRepoData> getPageList() {
|
||||
return pageList;
|
||||
}
|
||||
|
||||
public void setPageList(IPage<ExtRepoData> pageList) {
|
||||
this.pageList = pageList;
|
||||
}
|
||||
}
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
package com.jero.modules.extRepo.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
* @Description: 对外报告文件夹表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-27
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("ext_repo_folder")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="ext_repo_folder对象", description="对外报告文件夹表")
|
||||
public class ExtRepoFolder implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
|
||||
/**创建日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建日期")
|
||||
private java.util.Date createTime;
|
||||
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
|
||||
/**更新日期*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新日期")
|
||||
private java.util.Date updateTime;
|
||||
|
||||
/**所属部门*/
|
||||
@ApiModelProperty(value = "所属部门")
|
||||
private String sysOrgCode;
|
||||
|
||||
/**文件夹名称*/
|
||||
@Excel(name = "文件夹名称", width = 15)
|
||||
@ApiModelProperty(value = "文件夹名称")
|
||||
private String folderName;
|
||||
|
||||
/**文件夹排序*/
|
||||
@Excel(name = "文件夹排序", width = 15)
|
||||
@ApiModelProperty(value = "文件夹排序")
|
||||
private Integer orderId;
|
||||
|
||||
/**所属文件夹*/
|
||||
@Excel(name = "所属文件夹", width = 15)
|
||||
@ApiModelProperty(value = "所属文件夹")
|
||||
private String supFolder;
|
||||
|
||||
/**查看权限人员*/
|
||||
@Excel(name = "查看权限人员", width = 15)
|
||||
@ApiModelProperty(value = "查看权限人员")
|
||||
private String authViewIdsName;
|
||||
|
||||
/**管理权限人员*/
|
||||
@Excel(name = "管理权限人员", width = 15)
|
||||
@ApiModelProperty(value = "管理权限人员")
|
||||
private String authManageIdsName;
|
||||
|
||||
/**查看权限人员id*/
|
||||
@Excel(name = "查看权限人员id", width = 15)
|
||||
@ApiModelProperty(value = "查看权限人员id")
|
||||
private String authViewIds;
|
||||
|
||||
/**管理权限人员id*/
|
||||
@Excel(name = "管理权限人员id", width = 15)
|
||||
@ApiModelProperty(value = "管理权限人员id")
|
||||
private String authManageIds;
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
package com.jero.modules.extRepo.enums;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public enum ExtRepoMamagerRoleIdEnum {
|
||||
MANAGER_ID("系统管理员", "Administrator", "admin", "f6817f48af4fb3af11b9e8bf182f618b", 1),
|
||||
ERMANAGER_ID("对外报告管理员", "ExternalReportsManager", "ExternalReportsManager", "1552536424587862017", 2);
|
||||
|
||||
String name;
|
||||
String enName;
|
||||
String value;
|
||||
String id;
|
||||
Integer order;
|
||||
|
||||
ExtRepoMamagerRoleIdEnum(String name, String enName, String value, String id, Integer order) {
|
||||
this.name = name;
|
||||
this.enName = enName;
|
||||
this.value = value;
|
||||
this.id = id;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEnName() {
|
||||
return enName;
|
||||
}
|
||||
|
||||
public void setEnName(String enName) {
|
||||
this.enName = enName;
|
||||
}
|
||||
|
||||
public String getValue() {
|
||||
return value;
|
||||
}
|
||||
|
||||
public void setValue(String value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getOrder() {
|
||||
return order;
|
||||
}
|
||||
|
||||
public void setOrder(Integer order) {
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public static List<String> getIdList() {
|
||||
List<String> idList = new ArrayList<>();
|
||||
ExtRepoMamagerRoleIdEnum[] values = values();
|
||||
for (ExtRepoMamagerRoleIdEnum ermriEnum : values) {
|
||||
idList.add(ermriEnum.getId());
|
||||
}
|
||||
return idList;
|
||||
}
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.extRepo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
|
||||
/**
|
||||
* @Description: 对外报告数据表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ExtRepoDataMapper extends BaseMapper<ExtRepoData> {
|
||||
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.jero.modules.extRepo.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
||||
|
||||
/**
|
||||
* @Description: 对外报告文件夹表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface ExtRepoFolderMapper extends BaseMapper<ExtRepoFolder> {
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.extRepo.mapper.ExtRepoDataMapper">
|
||||
<resultMap id="ExtRepoDataResultMap" type="com.jero.modules.extRepo.entity.ExtRepoData">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="file_key" property="fileKey" />
|
||||
<result column="file_name" property="fileName" />
|
||||
<result column="file_description" property="fileDescription" />
|
||||
<result column="sup_folder" property="supFolder" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.jero.modules.extRepo.mapper.ExtRepoFolderMapper">
|
||||
<resultMap id="ExtRepoFolderResultMap" type="com.jero.modules.extRepo.entity.ExtRepoFolder">
|
||||
<id column="id" property="id" />
|
||||
<result column="create_by" property="createBy" />
|
||||
<result column="create_time" property="createTime" />
|
||||
<result column="update_by" property="updateBy" />
|
||||
<result column="update_time" property="updateTime" />
|
||||
<result column="sys_org_code" property="sysOrgCode" />
|
||||
<result column="folder_name" property="folderName" />
|
||||
<result column="order_id" property="orderId" />
|
||||
<result column="sup_folder" property="supFolder" />
|
||||
<result column="auth_view_ids_name" property="authViewIdsName" />
|
||||
<result column="auth_manage_ids_name" property="authManageIdsName" />
|
||||
<result column="auth_view_ids" property="authViewIdsName" />
|
||||
<result column="auth_manage_ids" property="authManageIdsName" />
|
||||
</resultMap>
|
||||
</mapper>
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
package com.jero.modules.extRepo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 对外报告数据表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IExtRepoDataService extends IService<ExtRepoData> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param extRepoData
|
||||
* @return
|
||||
*/
|
||||
int add(ExtRepoData extRepoData);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param extRepoData
|
||||
* @return
|
||||
*/
|
||||
void editById(ExtRepoData extRepoData);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
void deleteByIds(List<String> ids);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ExtRepoData queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ExtRepoData> queryList();
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
package com.jero.modules.extRepo.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.extRepo.entity.ERFTreeData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 对外报告文件夹表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IExtRepoFolderService extends IService<ExtRepoFolder> {
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param extRepoFolder
|
||||
* @return
|
||||
*/
|
||||
void add(ExtRepoFolder extRepoFolder);
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param extRepoFolder
|
||||
* @return
|
||||
*/
|
||||
void editById(ExtRepoFolder extRepoFolder);
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
void deleteById(String id);
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
ExtRepoFolder queryById(String id);
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ExtRepoFolder> queryList();
|
||||
|
||||
/**
|
||||
* 查询返回树结构
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
List<ERFTreeData> queryTreeList();
|
||||
|
||||
|
||||
/**
|
||||
* 是否有管理权限
|
||||
*
|
||||
* @param folderId
|
||||
* @return
|
||||
*/
|
||||
boolean haveManageAuth(String folderId);
|
||||
|
||||
/**
|
||||
* 是否有查看权限
|
||||
*
|
||||
* @param folderId
|
||||
* @return
|
||||
*/
|
||||
boolean haveViewAuth(String folderId);
|
||||
|
||||
/**
|
||||
* 是否管理员
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isManager();
|
||||
|
||||
/**
|
||||
* 查找子文件夹
|
||||
*
|
||||
* @param supFolder
|
||||
* @return
|
||||
*/
|
||||
List<ExtRepoFolder> getListBySupFolder(String supFolder);
|
||||
}
|
||||
+128
@@ -0,0 +1,128 @@
|
||||
package com.jero.modules.extRepo.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoData;
|
||||
import com.jero.modules.extRepo.mapper.ExtRepoDataMapper;
|
||||
import com.jero.modules.extRepo.service.IExtRepoDataService;
|
||||
import com.jero.modules.oss.entity.OSSFile;
|
||||
import com.jero.modules.oss.service.IOSSFileService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 对外报告数据表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ExtRepoDataServiceImpl extends ServiceImpl<ExtRepoDataMapper, ExtRepoData> implements IExtRepoDataService {
|
||||
|
||||
@Autowired
|
||||
private IOSSFileService ossFileService;
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param extRepoData
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public int add(ExtRepoData extRepoData) {
|
||||
//返回成功数量
|
||||
int res = 0;
|
||||
Date now = new Date();
|
||||
// 根据fileKey查找文件
|
||||
String fileIds = extRepoData.getFileKey();
|
||||
if (StringUtils.isNotBlank(fileIds)) {
|
||||
String[] fileIdsArr = fileIds.split(",");
|
||||
for (String fid : fileIdsArr) {
|
||||
OSSFile ossFile = ossFileService.getById(fid);
|
||||
if (ObjectUtil.isNotEmpty(ossFile)) {
|
||||
String fileName = ossFile.getFileName();
|
||||
extRepoData.setFileName(fileName);
|
||||
ExtRepoData erd = extRepoDataCopy(extRepoData, fid, now);
|
||||
save(erd);
|
||||
res++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private ExtRepoData extRepoDataCopy(ExtRepoData extRepoData, String key, Date now) {
|
||||
ExtRepoData res = new ExtRepoData();
|
||||
res.setId(extRepoData.getId());
|
||||
res.setCreateBy(extRepoData.getCreateBy());
|
||||
res.setCreateTime(now);
|
||||
res.setUpdateBy(extRepoData.getUpdateBy());
|
||||
res.setUpdateTime(now);
|
||||
res.setSysOrgCode(extRepoData.getSysOrgCode());
|
||||
res.setFileKey(key);
|
||||
res.setFileName(extRepoData.getFileName());
|
||||
res.setFileDescription(extRepoData.getFileDescription());
|
||||
res.setSupFolder(extRepoData.getSupFolder());
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param extRepoData
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ExtRepoData extRepoData) {
|
||||
Date now = new Date();
|
||||
extRepoData.setUpdateTime(now);
|
||||
saveOrUpdate(extRepoData);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
removeById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteByIds(List<String> ids) {
|
||||
removeByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ExtRepoData queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ExtRepoData> queryList() {
|
||||
return list();
|
||||
}
|
||||
}
|
||||
+367
@@ -0,0 +1,367 @@
|
||||
package com.jero.modules.extRepo.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.common.exception.JeroBootException;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.modules.extRepo.entity.ERFTreeData;
|
||||
import com.jero.modules.extRepo.entity.ExtRepoFolder;
|
||||
import com.jero.modules.extRepo.enums.ExtRepoMamagerRoleIdEnum;
|
||||
import com.jero.modules.extRepo.mapper.ExtRepoFolderMapper;
|
||||
import com.jero.modules.extRepo.service.IExtRepoFolderService;
|
||||
import com.jero.modules.system.entity.SysUserRole;
|
||||
import com.jero.modules.system.service.ISysUserRoleService;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.apache.shiro.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @Description: 对外报告文件夹表
|
||||
* @Author: jero-boot
|
||||
* @Date: 2022-07-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class ExtRepoFolderServiceImpl extends ServiceImpl<ExtRepoFolderMapper, ExtRepoFolder> implements IExtRepoFolderService {
|
||||
@Autowired
|
||||
private ISysUserRoleService sysUserRoleService;
|
||||
/**
|
||||
* 一级文件夹的supFolder统一存root
|
||||
*/
|
||||
private static final String superFolder = "root";
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
* @param extRepoFolder
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void add(ExtRepoFolder extRepoFolder) {
|
||||
try {
|
||||
if (StringUtils.isEmpty(extRepoFolder.getSupFolder())) {
|
||||
//一级文件夹的supFolder统一存root,方便以后查找
|
||||
extRepoFolder.setSupFolder(superFolder);
|
||||
}
|
||||
Date now = new Date();
|
||||
extRepoFolder.setCreateTime(now);
|
||||
extRepoFolder.setUpdateTime(now);
|
||||
// LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
// extRepoFolder.setAuthManageName(extRepoFolder.getAuthManageName() + "," + sysUser.getUsername());
|
||||
// extRepoFolder.setAuthManageIds(extRepoFolder.getAuthManageIds() + "," + sysUser.getId());
|
||||
extRepoFolder.setAuthManageIdsName(extRepoFolder.getAuthManageIdsName());
|
||||
extRepoFolder.setAuthManageIds(extRepoFolder.getAuthManageIds());
|
||||
save(extRepoFolder);
|
||||
editOrderId(extRepoFolder);
|
||||
} catch (Exception ex) {
|
||||
log.error("添加对外报告文件夹失败:" + ex.getMessage());
|
||||
throw new JeroBootException("添加文件夹失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 同级文件夹,修改顺序号
|
||||
*
|
||||
* @param extRepoFolder
|
||||
*/
|
||||
private void editOrderId(ExtRepoFolder extRepoFolder) throws Exception {
|
||||
List<ExtRepoFolder> list = getListBySupFolder(extRepoFolder.getSupFolder());
|
||||
for (ExtRepoFolder erf : list) {
|
||||
if (erf.getOrderId() >= extRepoFolder.getOrderId() && !erf.getId().equals(extRepoFolder.getId())) {
|
||||
erf.setOrderId(erf.getOrderId() + 1);
|
||||
updateById(erf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ExtRepoFolder> getListBySupFolder(String supFolder) {
|
||||
ExtRepoFolder erf = new ExtRepoFolder();
|
||||
erf.setSupFolder(supFolder);
|
||||
QueryWrapper<ExtRepoFolder> queryWrapper = QueryGenerator.initQueryWrapper(erf, new HashMap<>());
|
||||
return this.list(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新
|
||||
*
|
||||
* @param extRepoFolder
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void editById(ExtRepoFolder extRepoFolder) {
|
||||
try {
|
||||
//原有的记录
|
||||
ExtRepoFolder erf_orig = queryById(extRepoFolder.getId());
|
||||
Date now = new Date();
|
||||
extRepoFolder.setUpdateTime(now);
|
||||
saveOrUpdate(extRepoFolder);
|
||||
editOrderId(extRepoFolder);
|
||||
editAuth(erf_orig, extRepoFolder);
|
||||
} catch (Exception ex) {
|
||||
log.error("修改对外报告文件夹失败:" + ex.getMessage());
|
||||
throw new JeroBootException("修改文件夹失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改所有关联文件夹的权限
|
||||
*/
|
||||
private void editAuth(ExtRepoFolder erf_orig, ExtRepoFolder erf_new) throws Exception {
|
||||
//管理权限
|
||||
Map<String, String> authManage_orig = getAuthMap(erf_orig.getAuthManageIdsName(), erf_orig.getAuthManageIds());
|
||||
Map<String, String> authManage_new = getAuthMap(erf_new.getAuthManageIdsName(), erf_new.getAuthManageIds());
|
||||
//增加管理权限的人
|
||||
Map<String, String> addManageRole = getDefMap(authManage_new, authManage_orig);
|
||||
//删除管理权限的人
|
||||
Map<String, String> delManageRole = getDefMap(authManage_orig, authManage_new);
|
||||
|
||||
//查看权限
|
||||
Map<String, String> authView_orig = getAuthMap(erf_orig.getAuthViewIdsName(), erf_orig.getAuthViewIds());
|
||||
Map<String, String> authView_new = getAuthMap(erf_new.getAuthViewIdsName(), erf_new.getAuthViewIds());
|
||||
//增加查看权限的人
|
||||
Map<String, String> addViewRole = getDefMap(authView_new, authView_orig);
|
||||
//删除查看权限的人
|
||||
Map<String, String> delViewRole = getDefMap(authView_orig, authView_new);
|
||||
|
||||
List<ExtRepoFolder> allSubFolder = getAllSubFolder(erf_orig.getId());
|
||||
//存储变化的对象
|
||||
List<ExtRepoFolder> updateFolder = new ArrayList<ExtRepoFolder>();
|
||||
for (ExtRepoFolder erf : allSubFolder) {
|
||||
boolean isChange = false;
|
||||
Map<String, String> authManage_erf = getAuthMap(erf.getAuthManageIdsName(), erf.getAuthManageIds());
|
||||
Map<String, String> authView_erf = getAuthMap(erf.getAuthViewIdsName(), erf.getAuthViewIds());
|
||||
for (String add : addManageRole.keySet()) {
|
||||
if (!authManage_erf.keySet().contains(add)) {
|
||||
authManage_erf.put(add, addManageRole.get(add));
|
||||
isChange = true;
|
||||
}
|
||||
}
|
||||
for (String del : delManageRole.keySet()) {
|
||||
//如果是创建人 不能删除管理权限
|
||||
if (authManage_erf.keySet().contains(del)) {
|
||||
if (!del.equals(erf_orig.getCreateBy())) {
|
||||
authManage_erf.remove(del);
|
||||
isChange = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (String add : addViewRole.keySet()) {
|
||||
if (!authView_erf.keySet().contains(add)) {
|
||||
authView_erf.put(add, addViewRole.get(add));
|
||||
isChange = true;
|
||||
}
|
||||
}
|
||||
for (String del : delViewRole.keySet()) {
|
||||
if (authView_erf.keySet().contains(del)) {
|
||||
authView_erf.remove(del);
|
||||
isChange = true;
|
||||
}
|
||||
}
|
||||
erf.setAuthManageIdsName(StringUtils.join(authManage_erf.keySet(), ","));
|
||||
erf.setAuthManageIds(StringUtils.join(authManage_erf.values(), ","));
|
||||
erf.setAuthViewIdsName(StringUtils.join(authView_erf.keySet(), ","));
|
||||
erf.setAuthViewIds(StringUtils.join(authView_erf.values(), ","));
|
||||
if (isChange) {
|
||||
updateFolder.add(erf);
|
||||
}
|
||||
}
|
||||
if (updateFolder.size() > 0) {
|
||||
updateBatchById(updateFolder);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 得到列表新增元素集合
|
||||
*
|
||||
* @param mapA
|
||||
* @param mapB
|
||||
* @return
|
||||
*/
|
||||
private Map<String, String> getDefMap(Map<String, String> mapA, Map<String, String> mapB) {
|
||||
Map<String, String> res = new HashMap<String, String>();
|
||||
for (String s : mapA.keySet()) {
|
||||
if (StringUtils.isNotBlank(s) && !mapB.keySet().contains(s)) {
|
||||
res.put(s, mapA.get(s));
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private List<ExtRepoFolder> getAllSubFolder(String folderId) {
|
||||
List<ExtRepoFolder> resList = getListBySupFolder(folderId);
|
||||
List<ExtRepoFolder> subList = new ArrayList<ExtRepoFolder>();
|
||||
for (ExtRepoFolder erf : resList) {
|
||||
subList.addAll(getAllSubFolder(erf.getId()));
|
||||
}
|
||||
resList.addAll(subList);
|
||||
return resList;
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public void deleteById(String id) {
|
||||
try {
|
||||
removeById(id);
|
||||
} catch (Exception ex) {
|
||||
log.error("删除对外报告文件夹失败:" + ex.getMessage());
|
||||
throw new JeroBootException("删除文件夹失败!");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public ExtRepoFolder queryById(String id) {
|
||||
return getById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ExtRepoFolder> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
/**
|
||||
* 列表查询
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public List<ERFTreeData> queryTreeList() {
|
||||
try {
|
||||
List<ExtRepoFolder> list = queryList();
|
||||
List<ERFTreeData> res = getSubFolder(superFolder, list, 1);
|
||||
Collections.sort(res);
|
||||
return res;
|
||||
} catch (Exception ex) {
|
||||
log.error("查询对外报告文件夹失败:" + ex.getMessage());
|
||||
throw new JeroBootException("查询文件夹失败!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查找子文件夹,生成树结构
|
||||
*
|
||||
* @param supId
|
||||
* @param list
|
||||
* @param level 前端需要知道当前文件夹在哪一层
|
||||
* @return
|
||||
*/
|
||||
private List<ERFTreeData> getSubFolder(String supId, List<ExtRepoFolder> list, int level) throws Exception {
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
List<ERFTreeData> resList = new ArrayList<ERFTreeData>();
|
||||
for (ExtRepoFolder erf : list) {
|
||||
if (supId.equals(erf.getSupFolder())) {
|
||||
ERFTreeData date = new ERFTreeData(erf.getFolderName(), erf.getId(), level, erf.getOrderId());
|
||||
//检查有没有权限查看
|
||||
date.setDisplay(haveViewAuth(erf.getSupFolder()));
|
||||
int childLevel = date.getLevel() + 1;
|
||||
date.setAuthManageIdsName(erf.getAuthManageIdsName());
|
||||
date.setAuthManageIds(erf.getAuthManageIds());
|
||||
date.setAuthViewIdsName(erf.getAuthViewIdsName());
|
||||
date.setAuthViewIds(erf.getAuthViewIds());
|
||||
date.setChildren(getSubFolder(erf.getId(), list, childLevel));
|
||||
date.sortChildren();
|
||||
resList.add(date);
|
||||
}
|
||||
}
|
||||
return resList;
|
||||
}
|
||||
|
||||
private List<String> getStringList(String listStr) {
|
||||
List<String> res = new ArrayList<String>();
|
||||
if (null != listStr) {
|
||||
res = Arrays.asList(listStr.split(","));
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private Map<String, String> getAuthMap(String strKey, String strValue) {
|
||||
Map<String, String> resMap = new HashMap<String, String>();
|
||||
List<String> keyList = getStringList(strKey);
|
||||
List<String> valueList = getStringList(strValue);
|
||||
for (int i = 0; i < keyList.size(); i++) {
|
||||
resMap.put(keyList.get(i), valueList.get(i));
|
||||
}
|
||||
return resMap;
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断是否是文件夹管理员角色
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean isManager() {
|
||||
LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); // 获取当前登录用户
|
||||
// 查询当前登录用户角色
|
||||
List<SysUserRole> userRoles = sysUserRoleService.list(new QueryWrapper<SysUserRole>().lambda().eq(SysUserRole::getUserId, loginUser.getId())); // 查询用户所有角色
|
||||
List<String> userRoleIds = new ArrayList<>(); // 用户管理员/对外报告管理员
|
||||
if (CollectionUtil.isNotEmpty(userRoles)) {
|
||||
List<String> roleIdList = ExtRepoMamagerRoleIdEnum.getIdList();
|
||||
List<String> userRoleIdList = userRoles.stream().map(SysUserRole::getRoleId).collect(Collectors.toList());
|
||||
userRoleIds = roleIdList.stream().filter(e -> userRoleIdList.contains(e)).collect(Collectors.toList());
|
||||
return !CollectionUtil.isEmpty(userRoleIds);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有管理权限
|
||||
*
|
||||
* @param folderId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public boolean haveManageAuth(String folderId) {
|
||||
boolean res = false;
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
res = isManager();
|
||||
ExtRepoFolder erf = queryById(folderId);
|
||||
if (null != erf) {
|
||||
res = res || getStringList(erf.getAuthManageIds()).contains(sysUser.getId());
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否有查看权限
|
||||
*
|
||||
* @param folderId
|
||||
* @return
|
||||
*/
|
||||
public boolean haveViewAuth(String folderId) {
|
||||
boolean res = false;
|
||||
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
|
||||
res = isManager();
|
||||
ExtRepoFolder erf = queryById(folderId);
|
||||
if (null != erf) {
|
||||
res = res || getStringList(erf.getAuthManageIds()).contains(sysUser.getId())
|
||||
|| getStringList(erf.getAuthViewIds()).contains(sysUser.getId());
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
/*
|
||||
* Copyright 2013 Haulmont
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
package com.jero.modules.project.util;
|
||||
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.xlsx4j.sml.Cell;
|
||||
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
public class CellReference implements Comparable {
|
||||
public static final Pattern CELL_COORDINATES_PATTERN = Pattern.compile("([A-z]+)([0-9]+)");
|
||||
private int column;
|
||||
private int row;
|
||||
private String sheet;
|
||||
|
||||
public CellReference(String sheet, int row, int column) {
|
||||
this.column = column;
|
||||
this.row = row;
|
||||
this.sheet = sheet;
|
||||
}
|
||||
|
||||
public CellReference(String sheet, String cellRef) {
|
||||
Matcher matcher = CELL_COORDINATES_PATTERN.matcher(cellRef);
|
||||
if (matcher.find()) {
|
||||
column = XlsxUtils.getNumberFromColumnReference(matcher.group(1));
|
||||
row = Integer.valueOf(matcher.group(2));
|
||||
this.sheet = sheet;
|
||||
} else {
|
||||
throw new RuntimeException(String.format("Wrong cell %s", cellRef));
|
||||
}
|
||||
}
|
||||
|
||||
public CellReference(String sheet, Cell cell) {
|
||||
this(sheet, cell.getR());
|
||||
}
|
||||
|
||||
public CellReference shift(int downShift, int rightShift) {
|
||||
row += downShift;
|
||||
column += rightShift;
|
||||
return this;
|
||||
}
|
||||
|
||||
public CellReference move(int row, int col) {
|
||||
this.row = row;
|
||||
this.column = col;
|
||||
return this;
|
||||
}
|
||||
|
||||
public String toReference() {
|
||||
return XlsxUtils.getColumnReferenceFromNumber(getColumn()) + getRow();
|
||||
}
|
||||
|
||||
public int getColumn() {
|
||||
return column;
|
||||
}
|
||||
|
||||
public int getRow() {
|
||||
return row;
|
||||
}
|
||||
|
||||
public String getSheet() {
|
||||
return sheet;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
|
||||
CellReference that = (CellReference) o;
|
||||
|
||||
if (column != that.column) return false;
|
||||
if (row != that.row) return false;
|
||||
if (sheet != null ? !sheet.equals(that.sheet) : that.sheet != null) return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int result = column;
|
||||
result = 31 * result + row;
|
||||
result = 31 * result + (sheet != null ? sheet.hashCode() : 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Object o) {
|
||||
if (o instanceof CellReference) {
|
||||
int rows = ObjectUtils.compare(row, ((CellReference) o).row);
|
||||
int columns = ObjectUtils.compare(column, ((CellReference) o).column);
|
||||
return rows != 0 ? rows : columns;
|
||||
|
||||
} else {
|
||||
throw new IllegalArgumentException("Could not compare with " + o);
|
||||
}
|
||||
}
|
||||
}
|
||||
+371
-44
@@ -1,50 +1,384 @@
|
||||
package com.jero.modules.project.util;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.io.FileUtils;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.Row;
|
||||
import org.apache.poi.ss.usermodel.Sheet;
|
||||
import org.apache.poi.ss.usermodel.Workbook;
|
||||
import org.docx4j.XmlUtils;
|
||||
import org.docx4j.dml.*;
|
||||
import org.docx4j.dml.spreadsheetdrawing.*;
|
||||
import org.docx4j.openpackaging.io.SaveToZipFile;
|
||||
import org.docx4j.openpackaging.io3.stores.PartStore;
|
||||
import org.docx4j.openpackaging.packages.SpreadsheetMLPackage;
|
||||
import org.docx4j.openpackaging.parts.DrawingML.Drawing;
|
||||
import org.docx4j.openpackaging.parts.Part;
|
||||
import org.docx4j.openpackaging.parts.PartName;
|
||||
import org.docx4j.openpackaging.parts.Parts;
|
||||
import org.docx4j.openpackaging.parts.SpreadsheetML.JaxbSmlPart;
|
||||
import org.docx4j.openpackaging.parts.SpreadsheetML.WorkbookPart;
|
||||
import org.docx4j.openpackaging.parts.SpreadsheetML.WorksheetPart;
|
||||
import org.docx4j.openpackaging.parts.WordprocessingML.BinaryPartAbstractImage;
|
||||
import org.docx4j.openpackaging.parts.relationships.Namespaces;
|
||||
import org.docx4j.openpackaging.parts.relationships.RelationshipsPart;
|
||||
import org.docx4j.relationships.Relationship;
|
||||
import org.xlsx4j.sml.Cell;
|
||||
import org.xlsx4j.sml.SheetData;
|
||||
import org.xlsx4j.sml.Worksheet;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.xml.bind.JAXBException;
|
||||
import javax.xml.bind.util.JAXBResult;
|
||||
import javax.xml.transform.Source;
|
||||
import javax.xml.transform.Templates;
|
||||
import javax.xml.transform.TransformerFactory;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
@Slf4j
|
||||
public class ExcelUtil {
|
||||
|
||||
public static void main(String[] args) throws Exception {
|
||||
String inputfilepath = "D:\\text\\072001自定义模板.xlsx";
|
||||
SpreadsheetMLPackage pkg = SpreadsheetMLPackage.load(new File(inputfilepath));
|
||||
WorksheetPart worksheet = pkg.getWorkbookPart().getWorksheet(0);
|
||||
JAXBResult result = XmlUtils.prepareJAXBResult(worksheet.getJAXBContext());
|
||||
// .createWorksheetPart(new PartName("/xl/worksheets/sheet1.xml"), "Sheet1", 1);
|
||||
JaxbSmlPart smlPart = (JaxbSmlPart)pkg.getParts().get(new PartName("/xl/sharedStrings.xml")); // 获取所有sheet中的文本
|
||||
Parts parts = pkg.getParts();
|
||||
System.out.println("mmmmmmm");
|
||||
|
||||
/*JAXBResult result = XmlUtils.prepareJAXBResult(worksheet.getJAXBContext());
|
||||
Map<String, Object> transformParameters = new HashMap<>();
|
||||
transformParameters.put("NIO 07200103", "dfasdfas");
|
||||
|
||||
// InputStream smlPart = pkg.getParts().get(new PartName("/xl/sharedStrings.xml")); // 获取所有sheet
|
||||
|
||||
Source xsltSource = new StreamSource(new File("D:\\text\\sharedStrings.xml"));
|
||||
TransformerFactory transFact = TransformerFactory.newInstance();
|
||||
Templates cachedXSLT = transFact.newTemplates(xsltSource);
|
||||
|
||||
pkg.getWorkbookPart().transform(cachedXSLT,transformParameters,result);
|
||||
pkg.getWorkbookPart().transform(cachedXSLT,transformParameters,result);*/
|
||||
|
||||
// variableReplace();
|
||||
// xlsx4JAddImage();
|
||||
|
||||
WorkbookPart workbookPart = pkg.getWorkbookPart();
|
||||
WorksheetPart sheet = workbookPart.getWorksheet(0);
|
||||
Worksheet ws = sheet.getContents();
|
||||
SheetData data = ws.getSheetData();
|
||||
System.out.println("mmmmmmm");
|
||||
}
|
||||
|
||||
public static void replacePictureBatchPOI(Workbook workbook, SpreadsheetMLPackage pkg, List<Map<String, Object>> imgListAll) throws Exception {
|
||||
//获取全部sheet页中表格
|
||||
Sheet sheet=null;
|
||||
int partNameNum = 0;
|
||||
for (int i = 0; i < workbook.getNumberOfSheets(); i++) {//获取每个Sheet表
|
||||
sheet = workbook.getSheetAt(i);
|
||||
WorksheetPart worksheetPart = (WorksheetPart) pkg.getParts().get(new PartName("/xl/worksheets/" + sheet.getSheetName().toLowerCase() + ".xml"));
|
||||
partNameNum++;
|
||||
|
||||
//获得数据的总行数
|
||||
int totalRowNum = sheet.getLastRowNum();
|
||||
|
||||
//获得所有数据
|
||||
for (int x = 0; x < totalRowNum; x++) {
|
||||
//获得第x行对象
|
||||
Row row = sheet.getRow(x);
|
||||
if (!(row == null)) {
|
||||
//获得总列数
|
||||
int cellLength = row.getLastCellNum();
|
||||
//如果x行里的所有单元格
|
||||
for (int y = 0; y < cellLength; y++) {
|
||||
|
||||
org.apache.poi.ss.usermodel.Cell cell = row.getCell(y);
|
||||
if(ObjectUtil.isNull(cell)) {
|
||||
continue;
|
||||
}
|
||||
String cellValue = cell.getStringCellValue();
|
||||
|
||||
for (Map<String, Object> imgMap : imgListAll) {
|
||||
String key = (String) imgMap.get("key");
|
||||
String text = (String) imgMap.get("text");
|
||||
byte[] bytes = (byte[]) imgMap.get("bytes");
|
||||
if (("${" + key + "}").equals(cellValue)) {
|
||||
putImagePOI(worksheetPart, pkg, cell, bytes, sheet.getSheetName().toLowerCase(), String.valueOf(partNameNum));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public static void replacePictureBatch(SpreadsheetMLPackage pkg,List<Map<String, Object>> imgListAll) throws Exception {
|
||||
Parts parts = pkg.getParts();
|
||||
Map<PartName, Part> map = parts.getParts();
|
||||
|
||||
for (Map.Entry<PartName, Part> partMap : map.entrySet()) {
|
||||
int partNameNum = 0;
|
||||
if (partMap.getValue() instanceof WorksheetPart) {
|
||||
String partName = String.valueOf(partMap.getKey());
|
||||
WorksheetPart worksheetPart = (WorksheetPart) partMap.getValue();
|
||||
SheetData sheetData = worksheetPart.getJaxbElement().getSheetData();
|
||||
partNameNum++;
|
||||
|
||||
for (org.xlsx4j.sml.Row r : sheetData.getRow() ) { // 循环表格行
|
||||
for (Cell c : r.getC()) { // 循环表格单元格
|
||||
Object cellValue = c.getV(); // 获取单元格数内容
|
||||
|
||||
if (cellValue instanceof String) {
|
||||
for (Map<String, Object> imgMap : imgListAll) {
|
||||
String key = (String) imgMap.get("key");
|
||||
String text = (String) imgMap.get("text");
|
||||
byte[] bytes = (byte[]) imgMap.get("bytes");
|
||||
|
||||
if (("${" + key + "}").equals(cellValue)) {
|
||||
c.setV(text);
|
||||
putImage(worksheetPart, pkg, c, bytes, partName, String.valueOf(partNameNum));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void putImagePOI(WorksheetPart worksheetPart, SpreadsheetMLPackage pkg, org.apache.poi.ss.usermodel.Cell newCell, byte[] bytes, String sheetName, String partName) throws Exception {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
|
||||
BufferedImage bufferedImage = ImageIO.read(in);
|
||||
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(pkg, worksheetPart, bytes);
|
||||
String imagePartName = imagePart.getPartName().getName();
|
||||
|
||||
PartName drawingPart = new PartName(worksheetPart.getPartName().getName().replace("worksheets/" + sheetName, "drawings/drawing" + partName));
|
||||
Drawing drawing = (Drawing) pkg.getParts().get(drawingPart);
|
||||
int currentId = 0;
|
||||
if (drawing == null) {
|
||||
drawing = new Drawing(drawingPart);
|
||||
drawing.setContents(new org.docx4j.dml.spreadsheetdrawing.CTDrawing());
|
||||
Relationship relationship = worksheetPart.addTargetPart(drawing);
|
||||
org.xlsx4j.sml.CTDrawing smlDrawing = new org.xlsx4j.sml.CTDrawing();
|
||||
smlDrawing.setId(relationship.getId());
|
||||
smlDrawing.setParent(worksheetPart.getContents());
|
||||
worksheetPart.getContents().setDrawing(smlDrawing);
|
||||
} else {
|
||||
currentId = drawing.getContents().getEGAnchor().size();
|
||||
}
|
||||
|
||||
CTTwoCellAnchor anchor = new CTTwoCellAnchor();
|
||||
anchor.setFrom(new CTMarker());
|
||||
anchor.getFrom().setCol(newCell.getColumnIndex());
|
||||
anchor.getFrom().setRow(newCell.getRowIndex());
|
||||
anchor.setTo(new CTMarker());
|
||||
anchor.getTo().setCol(newCell.getColumnIndex() + 1);
|
||||
anchor.getTo().setRow(newCell.getRowIndex() + 1);
|
||||
|
||||
CTPicture picture = new CTPicture();
|
||||
|
||||
CTBlipFillProperties blipFillProperties = new CTBlipFillProperties();
|
||||
blipFillProperties.setStretch(new CTStretchInfoProperties());
|
||||
blipFillProperties.getStretch().setFillRect(new CTRelativeRect());
|
||||
blipFillProperties.setBlip(new CTBlip());
|
||||
blipFillProperties.getBlip().setEmbed("rId" + (currentId + 1));
|
||||
blipFillProperties.getBlip().setCstate(STBlipCompression.NONE);
|
||||
|
||||
picture.setBlipFill(blipFillProperties);
|
||||
|
||||
CTNonVisualDrawingProps nonVisualDrawingProps = new CTNonVisualDrawingProps();
|
||||
nonVisualDrawingProps.setId(currentId + 2);
|
||||
nonVisualDrawingProps.setName(imagePartName.substring(imagePartName.lastIndexOf("/") + 1));
|
||||
nonVisualDrawingProps.setDescr(nonVisualDrawingProps.getName());
|
||||
|
||||
CTNonVisualPictureProperties nonVisualPictureProperties = new CTNonVisualPictureProperties();
|
||||
nonVisualPictureProperties.setPicLocks(new CTPictureLocking());
|
||||
nonVisualPictureProperties.getPicLocks().setNoChangeAspect(true);
|
||||
CTPictureNonVisual nonVisualPicture = new CTPictureNonVisual();
|
||||
|
||||
nonVisualPicture.setCNvPr(nonVisualDrawingProps);
|
||||
nonVisualPicture.setCNvPicPr(nonVisualPictureProperties);
|
||||
|
||||
picture.setNvPicPr(nonVisualPicture);
|
||||
|
||||
CTShapeProperties shapeProperties = new CTShapeProperties();
|
||||
CTTransform2D transform2D = new CTTransform2D();
|
||||
transform2D.setOff(new CTPoint2D());
|
||||
transform2D.setExt(new CTPositiveSize2D());
|
||||
shapeProperties.setXfrm(transform2D);
|
||||
shapeProperties.setPrstGeom(new CTPresetGeometry2D());
|
||||
shapeProperties.getPrstGeom().setPrst(STShapeType.RECT);
|
||||
shapeProperties.getPrstGeom().setAvLst(new CTGeomGuideList());
|
||||
CTPositiveSize2D positivesize2D = new CTPositiveSize2D();
|
||||
transform2D.setExt(positivesize2D);
|
||||
positivesize2D.setCx( XlsxUtils.convertPxToEmu(bufferedImage.getWidth()) );
|
||||
positivesize2D.setCy( XlsxUtils.convertPxToEmu(bufferedImage.getHeight()) );
|
||||
|
||||
picture.setSpPr(shapeProperties);
|
||||
|
||||
anchor.setPic(picture);
|
||||
anchor.setClientData(new CTAnchorClientData());
|
||||
anchor.setEditAs(STEditAs.ONE_CELL);
|
||||
drawing.getContents().getEGAnchor().add(anchor);
|
||||
|
||||
Relationship rel = new Relationship();
|
||||
rel.setId("rId" + (currentId + 1));
|
||||
rel.setType(Namespaces.IMAGE);
|
||||
rel.setTarget(imagePartName);
|
||||
|
||||
drawing.getRelationshipsPart().addRelationship(rel);
|
||||
RelationshipsPart relPart = drawing.getRelationshipsPart();
|
||||
pkg.getParts().remove(relPart.getPartName());
|
||||
pkg.getParts().put(relPart);
|
||||
pkg.getParts().remove(drawing.getPartName());
|
||||
pkg.getParts().put(drawing);
|
||||
}
|
||||
|
||||
private static void putImage(WorksheetPart worksheetPart, SpreadsheetMLPackage pkg, Cell newCell, byte[] bytes, String sheetName, String partName) throws Exception {
|
||||
ByteArrayInputStream in = new ByteArrayInputStream(bytes);
|
||||
BufferedImage bufferedImage = ImageIO.read(in);
|
||||
|
||||
BinaryPartAbstractImage imagePart = BinaryPartAbstractImage.createImagePart(pkg, worksheetPart, bytes);
|
||||
CTTwoCellAnchor anchor = new CTTwoCellAnchor();
|
||||
anchor.setFrom(new CTMarker());
|
||||
CellReference cellReference = new CellReference("", newCell.getR());
|
||||
anchor.getFrom().setCol(cellReference.getColumn() - 1);
|
||||
anchor.getFrom().setRow(cellReference.getRow() - 1);
|
||||
anchor.setTo(new CTMarker());
|
||||
anchor.getTo().setCol(cellReference.getColumn());
|
||||
anchor.getTo().setRow(cellReference.getRow());
|
||||
|
||||
PartName drawingPart = new PartName(worksheetPart.getPartName().getName().replace("worksheets/" + sheetName, "drawings/drawing" + partName));
|
||||
String imagePartName = imagePart.getPartName().getName();
|
||||
Drawing drawing = (Drawing) pkg.getParts().get(drawingPart);
|
||||
int currentId = 0;
|
||||
if (drawing == null) {
|
||||
drawing = new Drawing(drawingPart);
|
||||
drawing.setContents(new org.docx4j.dml.spreadsheetdrawing.CTDrawing());
|
||||
Relationship relationship = worksheetPart.addTargetPart(drawing);
|
||||
org.xlsx4j.sml.CTDrawing smlDrawing = new org.xlsx4j.sml.CTDrawing();
|
||||
smlDrawing.setId(relationship.getId());
|
||||
smlDrawing.setParent(worksheetPart.getContents());
|
||||
worksheetPart.getContents().setDrawing(smlDrawing);
|
||||
} else {
|
||||
currentId = drawing.getContents().getEGAnchor().size();
|
||||
}
|
||||
|
||||
CTPicture picture = new CTPicture();
|
||||
|
||||
CTBlipFillProperties blipFillProperties = new CTBlipFillProperties();
|
||||
blipFillProperties.setStretch(new CTStretchInfoProperties());
|
||||
blipFillProperties.getStretch().setFillRect(new CTRelativeRect());
|
||||
blipFillProperties.setBlip(new CTBlip());
|
||||
blipFillProperties.getBlip().setEmbed("rId" + (currentId + 1));
|
||||
blipFillProperties.getBlip().setCstate(STBlipCompression.PRINT);
|
||||
|
||||
picture.setBlipFill(blipFillProperties);
|
||||
|
||||
CTNonVisualDrawingProps nonVisualDrawingProps = new CTNonVisualDrawingProps();
|
||||
nonVisualDrawingProps.setId(currentId + 2);
|
||||
nonVisualDrawingProps.setName(imagePartName.substring(imagePartName.lastIndexOf("/") + 1));
|
||||
nonVisualDrawingProps.setDescr(nonVisualDrawingProps.getName());
|
||||
|
||||
CTNonVisualPictureProperties nonVisualPictureProperties = new CTNonVisualPictureProperties();
|
||||
nonVisualPictureProperties.setPicLocks(new CTPictureLocking());
|
||||
nonVisualPictureProperties.getPicLocks().setNoChangeAspect(true);
|
||||
CTPictureNonVisual nonVisualPicture = new CTPictureNonVisual();
|
||||
|
||||
nonVisualPicture.setCNvPr(nonVisualDrawingProps);
|
||||
nonVisualPicture.setCNvPicPr(nonVisualPictureProperties);
|
||||
|
||||
picture.setNvPicPr(nonVisualPicture);
|
||||
|
||||
CTShapeProperties shapeProperties = new CTShapeProperties();
|
||||
CTTransform2D transform2D = new CTTransform2D();
|
||||
transform2D.setOff(new CTPoint2D());
|
||||
transform2D.setExt(new CTPositiveSize2D());
|
||||
shapeProperties.setXfrm(transform2D);
|
||||
shapeProperties.setPrstGeom(new CTPresetGeometry2D());
|
||||
shapeProperties.getPrstGeom().setPrst(STShapeType.RECT);
|
||||
shapeProperties.getPrstGeom().setAvLst(new CTGeomGuideList());
|
||||
CTPositiveSize2D positivesize2D = new CTPositiveSize2D();
|
||||
transform2D.setExt(positivesize2D);
|
||||
positivesize2D.setCx( XlsxUtils.convertPxToEmu(bufferedImage.getWidth()) );
|
||||
positivesize2D.setCy( XlsxUtils.convertPxToEmu(bufferedImage.getHeight()) );
|
||||
|
||||
picture.setSpPr(shapeProperties);
|
||||
|
||||
anchor.setPic(picture);
|
||||
anchor.setClientData(new CTAnchorClientData());
|
||||
|
||||
drawing.getContents().getEGAnchor().add(anchor);
|
||||
|
||||
Relationship rel = new Relationship();
|
||||
rel.setId("rId" + (currentId + 1));
|
||||
rel.setType(Namespaces.IMAGE);
|
||||
rel.setTarget(imagePartName);
|
||||
|
||||
drawing.getRelationshipsPart().addRelationship(rel);
|
||||
RelationshipsPart relPart = drawing.getRelationshipsPart();
|
||||
pkg.getParts().remove(relPart.getPartName());
|
||||
pkg.getParts().put(relPart);
|
||||
pkg.getParts().remove(drawing.getPartName());
|
||||
pkg.getParts().put(drawing);
|
||||
}
|
||||
|
||||
private static String getWmlTemplateString(JaxbSmlPart smlPart) {
|
||||
String wmlTemplateString = null;
|
||||
PartStore partStore = smlPart.getPackage().getSourcePartStore();
|
||||
String name = smlPart.getPartName().getName();
|
||||
try {
|
||||
InputStream is = partStore.loadPart(
|
||||
name.substring(1));
|
||||
if (is == null) {
|
||||
log.warn(name + " missing from part store");
|
||||
} else {
|
||||
log.info("Lazily unmarshalling " + name);
|
||||
// wmlTemplateString = convertStreamToString(is);
|
||||
|
||||
// This seems to be about 5% faster than the Scanner approach
|
||||
wmlTemplateString = IOUtils.toString(is, "UTF-8");
|
||||
List<String> placeholderList = new ArrayList<>();
|
||||
getAllPlaceholderElementFromObject(wmlTemplateString, 0, placeholderList);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(), e);
|
||||
|
||||
} finally {
|
||||
return wmlTemplateString;
|
||||
}
|
||||
}
|
||||
|
||||
private static List<String> getAllPlaceholderElementFromObject(String wmlTemplateString, int offset, List<String> placeholderList) {
|
||||
|
||||
int startKey = wmlTemplateString.indexOf("${", offset);
|
||||
if (startKey == -1)
|
||||
return null;
|
||||
else {
|
||||
int keyEnd = wmlTemplateString.indexOf('}', startKey);
|
||||
String placeHolder = wmlTemplateString.substring(startKey, keyEnd + 1);
|
||||
if (isPlaceholder(placeHolder)) {
|
||||
placeholderList.add(placeHolder);
|
||||
}
|
||||
return getAllPlaceholderElementFromObject(wmlTemplateString, keyEnd + 1, placeholderList);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 判断字符串是否有${}占位符
|
||||
*
|
||||
* @param str 需要判断的字符串
|
||||
* @return 是否字符串是否有${}占位符
|
||||
* @author liyawei
|
||||
*/
|
||||
private static boolean isPlaceholder(String str) {
|
||||
if (str != null && !str.isEmpty()) {
|
||||
Pattern pattern = Pattern.compile("([$]\\{[A-Za-z0-9./ -]+\\})"); // 识别范围 认证模块专用
|
||||
Matcher m = pattern.matcher(str);
|
||||
return m.find();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void xlsx4JAddImage() throws Exception {
|
||||
@@ -88,17 +422,11 @@ public class ExcelUtil {
|
||||
System.out.println("\n\n done .. " + outputfilepath);
|
||||
}
|
||||
|
||||
public static void variableReplace(InputStream is, OutputStream os, HashMap<String, String> mappings) throws Exception {
|
||||
|
||||
SpreadsheetMLPackage opcPackagepkg = SpreadsheetMLPackage.load(is);
|
||||
|
||||
public static void variableReplace(SpreadsheetMLPackage pkg, HashMap<String, String> mappings) throws Exception {
|
||||
// Be sure to get the part which actually contains your variables!
|
||||
JaxbSmlPart smlPart = (JaxbSmlPart)opcPackagepkg.getParts().get(new PartName("/xl/sharedStrings.xml")); // 获取所有sheet
|
||||
JaxbSmlPart smlPart = (JaxbSmlPart)pkg.getParts().get(new PartName("/xl/sharedStrings.xml")); // 获取所有sheet
|
||||
//JaxbSmlPart smlPart = (JaxbSmlPart)opcPackagepkg.getParts().get(new PartName("/xl/worksheets/sheet1.xml"));
|
||||
smlPart.variableReplace(mappings);
|
||||
|
||||
// Save it
|
||||
opcPackagepkg.save(os);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -128,14 +456,14 @@ public class ExcelUtil {
|
||||
CTBlip blip = dmlObjectFactory.createCTBlip();
|
||||
blipfillproperties.setBlip(blip);
|
||||
blip.setCstate(org.docx4j.dml.STBlipCompression.NONE);
|
||||
blip.setEmbed( imageRelID );
|
||||
blip.setEmbed( imageRelID ); //-------
|
||||
// Create object for extLst
|
||||
CTOfficeArtExtensionList officeartextensionlist = dmlObjectFactory.createCTOfficeArtExtensionList();
|
||||
blip.setExtLst(officeartextensionlist);
|
||||
// Create object for ext
|
||||
CTOfficeArtExtension officeartextension = dmlObjectFactory.createCTOfficeArtExtension();
|
||||
officeartextensionlist.getExt().add( officeartextension);
|
||||
officeartextension.setUri( "{28A0092B-C50C-407E-A947-70E740481C1C}");
|
||||
officeartextension.setUri( "{28A0092B-C50C-407E-A947-70E740481C1C}"); //------
|
||||
blip.setLink( "");
|
||||
// Create object for stretch
|
||||
CTStretchInfoProperties stretchinfoproperties = dmlObjectFactory.createCTStretchInfoProperties();
|
||||
@@ -143,10 +471,10 @@ public class ExcelUtil {
|
||||
// Create object for fillRect
|
||||
CTRelativeRect relativerect = dmlObjectFactory.createCTRelativeRect();
|
||||
stretchinfoproperties.setFillRect(relativerect);
|
||||
relativerect.setR( new Integer(0) );
|
||||
relativerect.setT( new Integer(0) );
|
||||
relativerect.setL( new Integer(0) );
|
||||
relativerect.setB( new Integer(0) );
|
||||
relativerect.setR( new Integer(0) ); //------
|
||||
relativerect.setT( new Integer(0) ); //------
|
||||
relativerect.setL( new Integer(0) ); //------
|
||||
relativerect.setB( new Integer(0) ); //------
|
||||
// Create object for spPr
|
||||
CTShapeProperties shapeproperties = dmlObjectFactory.createCTShapeProperties();
|
||||
picture.setSpPr(shapeproperties);
|
||||
@@ -157,13 +485,13 @@ public class ExcelUtil {
|
||||
// Create object for off
|
||||
CTPoint2D point2d = dmlObjectFactory.createCTPoint2D();
|
||||
transform2d.setOff(point2d);
|
||||
point2d.setY( 0 );
|
||||
point2d.setX( 0 );
|
||||
point2d.setY( 0 ); //------
|
||||
point2d.setX( 0 ); //------
|
||||
// Create object for ext
|
||||
CTPositiveSize2D positivesize2d = dmlObjectFactory.createCTPositiveSize2D();
|
||||
transform2d.setExt(positivesize2d);
|
||||
positivesize2d.setCx( 714375 );
|
||||
positivesize2d.setCy( 714375 );
|
||||
positivesize2d.setCx( 714375 ); //------
|
||||
positivesize2d.setCy( 714375 ); //------
|
||||
// Create object for prstGeom
|
||||
CTPresetGeometry2D presetgeometry2d = dmlObjectFactory.createCTPresetGeometry2D();
|
||||
shapeproperties.setPrstGeom(presetgeometry2d);
|
||||
@@ -177,9 +505,9 @@ public class ExcelUtil {
|
||||
// Create object for cNvPr
|
||||
CTNonVisualDrawingProps nonvisualdrawingprops = dmlObjectFactory.createCTNonVisualDrawingProps();
|
||||
picturenonvisual.setCNvPr(nonvisualdrawingprops);
|
||||
nonvisualdrawingprops.setDescr( "");
|
||||
nonvisualdrawingprops.setName( "Picture 1");
|
||||
nonvisualdrawingprops.setId( 2 );
|
||||
nonvisualdrawingprops.setDescr( ""); //------
|
||||
nonvisualdrawingprops.setName( "Picture 1"); //------
|
||||
nonvisualdrawingprops.setId( 2 ); //------
|
||||
// Create object for cNvPicPr
|
||||
CTNonVisualPictureProperties nonvisualpictureproperties = dmlObjectFactory.createCTNonVisualPictureProperties();
|
||||
picturenonvisual.setCNvPicPr(nonvisualpictureproperties);
|
||||
@@ -190,18 +518,18 @@ public class ExcelUtil {
|
||||
// Create object for to
|
||||
CTMarker marker = dmlspreadsheetdrawingObjectFactory.createCTMarker();
|
||||
twocellanchor.setTo(marker);
|
||||
marker.setCol(1);
|
||||
marker.setColOff( 104775 );
|
||||
marker.setRow(3);
|
||||
marker.setRowOff( 142875 );
|
||||
marker.setCol(1); //------
|
||||
marker.setColOff( 104775 ); //------
|
||||
marker.setRow(3); //------
|
||||
marker.setRowOff( 142875 ); //------
|
||||
// Create object for from
|
||||
CTMarker marker2 = dmlspreadsheetdrawingObjectFactory.createCTMarker();
|
||||
twocellanchor.setFrom(marker2);
|
||||
marker2.setCol(0);
|
||||
marker2.setColOff( 0 );
|
||||
marker2.setRow(0);
|
||||
marker2.setRowOff( 0 );
|
||||
twocellanchor.setEditAs(STEditAs.fromValue("name"));
|
||||
marker2.setCol(0); //------
|
||||
marker2.setColOff( 0 ); //------
|
||||
marker2.setRow(0); //------
|
||||
marker2.setRowOff( 0 ); //------
|
||||
twocellanchor.setEditAs(STEditAs.ONE_CELL);
|
||||
|
||||
// return drawingWrapped;
|
||||
return drawing;
|
||||
@@ -264,5 +592,4 @@ public class ExcelUtil {
|
||||
XmlUtils.unmarshalString(openXML));
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Copyright 2013 Haulmont
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||
* use this file except in compliance with the License. You may obtain a copy of
|
||||
* the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
* License for the specific language governing permissions and limitations under
|
||||
* the License.
|
||||
*/
|
||||
package com.jero.modules.project.util;
|
||||
|
||||
public final class XlsxUtils {
|
||||
|
||||
private static final long PX_PER_INCH = 96;
|
||||
private static final long EMU_PER_INCH = 914400;
|
||||
|
||||
private XlsxUtils() {
|
||||
}
|
||||
|
||||
public static int getNumberFromColumnReference(String columnReference) {
|
||||
int sum = 0;
|
||||
|
||||
for (int i = 0; i < columnReference.length(); i++) {
|
||||
char c = columnReference.charAt(i);
|
||||
int number = ((int) c) - 64 - 1;
|
||||
|
||||
int pow = columnReference.length() - i - 1;
|
||||
sum += Math.pow(26, pow) * (number + 1);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
public static String getColumnReferenceFromNumber(int number) {
|
||||
int remain = 0;
|
||||
StringBuilder ref = new StringBuilder();
|
||||
do {
|
||||
|
||||
remain = (number - 1) % 26;
|
||||
number = (number - 1) / 26;
|
||||
|
||||
ref.append((char) (remain + 64 + 1));
|
||||
} while (number > 0);
|
||||
|
||||
return ref.reverse().toString();
|
||||
}
|
||||
|
||||
public static long convertPxToEmu(long px) {
|
||||
return px * EMU_PER_INCH / PX_PER_INCH;
|
||||
}
|
||||
}
|
||||
+4
-2
@@ -183,8 +183,10 @@ public class LawsMonthlyReportWriteEOController extends JeroController<LawsMonth
|
||||
@AutoLog(value = "月报整合导出zip")
|
||||
@ApiOperation(value = "月报整合导出zip", notes = "月报整合导出zip")
|
||||
@RequestMapping(value = "/exportMonthlyReport", method = RequestMethod.GET)
|
||||
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) throws IOException {
|
||||
return lawsMonthlyReportWriteEOService.exportMonthlyReport(lawsMonthlyReportWriteEO);
|
||||
public void exportMonthlyReport(HttpServletResponse response,
|
||||
HttpServletRequest request,
|
||||
LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) throws IOException {
|
||||
lawsMonthlyReportWriteEOService.exportMonthlyReport(response,request,lawsMonthlyReportWriteEO);
|
||||
}
|
||||
|
||||
@ApiOperation(value="带入标准信息--分页", notes="带入标准信息--分页")
|
||||
|
||||
+4
-2
@@ -3,9 +3,9 @@ package com.jero.modules.report.service;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.report.entity.LawsMonthlyReportWriteEO;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@@ -77,7 +77,9 @@ public interface ILawsMonthlyReportWriteEOService extends IService<LawsMonthlyRe
|
||||
Integer pageSize,
|
||||
HttpServletRequest req);
|
||||
|
||||
ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO);
|
||||
void exportMonthlyReport(HttpServletResponse response,
|
||||
HttpServletRequest request,
|
||||
LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO);
|
||||
|
||||
IPage queryPageDocument(Map<String, Object> parameter);
|
||||
}
|
||||
|
||||
+136
-12
@@ -1,5 +1,7 @@
|
||||
package com.jero.modules.report.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ZipUtil;
|
||||
import com.aliyuncs.utils.IOUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@@ -32,15 +34,19 @@ import com.jero.modules.system.service.impl.SysDictItemServiceImpl;
|
||||
import com.jero.modules.system.util.StringUtils;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.aspectj.util.FileUtil;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Date;
|
||||
@@ -327,7 +333,9 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResponseEntity<byte[]> exportMonthlyReport(LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
|
||||
public void exportMonthlyReport(HttpServletResponse response,
|
||||
HttpServletRequest request,
|
||||
LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO) {
|
||||
ResponseEntity<byte[]> result = null;
|
||||
//获取数据
|
||||
LambdaQueryWrapper<LawsMonthlyReportWriteEO> wrapper = new LambdaQueryWrapper<>();
|
||||
@@ -353,17 +361,35 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
fileTemp.delete();
|
||||
}
|
||||
fileTemp.mkdirs();
|
||||
createWord(path,lawsMonthlyReportWriteEOS,lawsMonthlyReportTitleTemplateEOS);
|
||||
OutputStream os = null;
|
||||
try {
|
||||
createWord(path,lawsMonthlyReportWriteEOS,lawsMonthlyReportTitleTemplateEOS);
|
||||
ZipUtil.zip(path, path + ".zip");
|
||||
//文件
|
||||
os = response.getOutputStream();
|
||||
FileInputStream fis = new FileInputStream(path + ".zip");
|
||||
os = response.getOutputStream();
|
||||
|
||||
int len = 0;
|
||||
while ((len = fis.read()) != -1) {
|
||||
os.write(len);
|
||||
}
|
||||
os.flush();
|
||||
} catch (Exception e) {
|
||||
|
||||
}finally {
|
||||
IOUtils.closeQuietly(os);
|
||||
File file = new File(uploadpath + "/tempZip");
|
||||
FileUtil.deleteContents(file);
|
||||
File fileTem = new File(uploadpath + "/tempZip.zip");
|
||||
FileUtil.deleteContents(fileTem);
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*创建word文件
|
||||
* @param path
|
||||
* @param lawsMonthlyReportWriteEOS 列表数据
|
||||
* @param lawsMonthlyReportTitleTemplateEOS 章节目录
|
||||
@@ -371,32 +397,130 @@ public class LawsMonthlyReportWriteEOServiceImpl extends ServiceImpl<LawsMonthly
|
||||
private void createWord(String path,
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS){
|
||||
//一级菜单
|
||||
List<String> parentIdList = lawsMonthlyReportTitleTemplateEOS.stream().map(LawsMonthlyReportTitleTemplateEO::getParentId).distinct().collect(Collectors.toList());
|
||||
LambdaQueryWrapper<LawsMonthlyReportTitleTemplateEO> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.in(LawsMonthlyReportTitleTemplateEO::getId,parentIdList).orderByAsc(LawsMonthlyReportTitleTemplateEO::getSort);
|
||||
List<LawsMonthlyReportTitleTemplateEO> reportTitleOneList = lawsMonthlyReportTitleTemplateEOService.list(wrapper);
|
||||
//蔚来汽车法规月报-202004-主页面-CN
|
||||
//NIO Monthly Report on Automobile Regulations-202004-Main Page-EN
|
||||
String memoriesChapterCN = path + File.separator +"蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"主页面-CN.docx";
|
||||
String memoriesChapterEN = path + File.separator +"NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth()+"-Main Page-EN.docx";
|
||||
String titleCN = "蔚来汽车法规月报" + lawsMonthlyReportWriteEOS.get(0).getMonth();
|
||||
String titleEN = "NIO Monthly Report on Automobile Regulations-" + lawsMonthlyReportWriteEOS.get(0).getMonth();
|
||||
|
||||
File wordFile = new File(memoriesChapterCN);
|
||||
File wordFileEn = new File(memoriesChapterEN);
|
||||
if(!wordFile.exists()){
|
||||
try {
|
||||
wordFile.getParentFile().mkdirs();
|
||||
wordFile.createNewFile();
|
||||
} catch (IOException e) {
|
||||
log.error("文件《"+memoriesChapterCN+"》创建失败");
|
||||
log.error("文件《"+titleCN+"》创建失败");
|
||||
}
|
||||
}
|
||||
|
||||
try (XWPFDocument document = new XWPFDocument();
|
||||
FileOutputStream out = new FileOutputStream(wordFile)) {
|
||||
WordUtil.exportWord(document, memoriesChapterCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
|
||||
|
||||
|
||||
try {
|
||||
//主页面中文版
|
||||
XWPFDocument document = new XWPFDocument();
|
||||
FileOutputStream out = new FileOutputStream(wordFile);
|
||||
word(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, titleCN, document,CutEnum.CN.getValue());
|
||||
document.write(out);
|
||||
//主页面英文版
|
||||
XWPFDocument documentEn = new XWPFDocument();
|
||||
FileOutputStream outCn = new FileOutputStream(wordFileEn);
|
||||
word(lawsMonthlyReportWriteEOS, lawsMonthlyReportTitleTemplateEOS, reportTitleOneList, titleEN, documentEn,CutEnum.EN.getValue());
|
||||
documentEn.write(outCn);
|
||||
} catch (IOException e) {
|
||||
log.error("文件创建异常,异常信息为:" + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
private void word(List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOS,
|
||||
List<LawsMonthlyReportTitleTemplateEO> lawsMonthlyReportTitleTemplateEOS,
|
||||
List<LawsMonthlyReportTitleTemplateEO> reportTitleOneList,
|
||||
String titleCN,
|
||||
XWPFDocument document,
|
||||
String cut) {
|
||||
String content = "";
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
content = "主要内容";
|
||||
}else{
|
||||
content = "Content";
|
||||
}
|
||||
WordUtil.exportWord(document, titleCN, null, ParagraphAlignment.CENTER, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
WordUtil.exportWord(document, content, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
int oneCount = 1;
|
||||
|
||||
for (LawsMonthlyReportTitleTemplateEO lawsMonthlyReportTitleTemplateEO : reportTitleOneList) {
|
||||
int twoCount = 1;
|
||||
String oneNumber = intToRoman(oneCount);
|
||||
//一级标题
|
||||
String oneTitle = "";
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
oneTitle = lawsMonthlyReportTitleTemplateEO.getTitleCn();
|
||||
}else{
|
||||
oneTitle = lawsMonthlyReportTitleTemplateEO.getTitleEn();
|
||||
}
|
||||
WordUtil.exportWord(document, oneNumber+" "+oneTitle, null, ParagraphAlignment.LEFT, 0, 12, false, true, "Microsoft YaHei UI");
|
||||
oneCount++;
|
||||
List<LawsMonthlyReportTitleTemplateEO> reportTitleTwoList = lawsMonthlyReportTitleTemplateEOS.stream().filter(e -> e.getParentId().equals(lawsMonthlyReportTitleTemplateEO.getId())).collect(Collectors.toList());
|
||||
|
||||
|
||||
for (LawsMonthlyReportTitleTemplateEO monthlyReportTitleTemplateEO : reportTitleTwoList) {
|
||||
int reportCount = 1;
|
||||
//子标题对应的月报填写的内容
|
||||
List<LawsMonthlyReportWriteEO> lawsMonthlyReportWriteEOList = lawsMonthlyReportWriteEOS.stream().filter(e -> monthlyReportTitleTemplateEO.getId().equals(e.getMemoriesChapter())).collect(Collectors.toList());
|
||||
String twoNumber = intToRoman(twoCount);
|
||||
twoNumber = oneNumber+"."+twoNumber;
|
||||
|
||||
//二级标题
|
||||
String twoTitle = "";
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
twoTitle = monthlyReportTitleTemplateEO.getTitleCn();
|
||||
}else{
|
||||
twoTitle = monthlyReportTitleTemplateEO.getTitleEn();
|
||||
}
|
||||
WordUtil.exportWord(document, twoNumber+" "+twoTitle, null, ParagraphAlignment.LEFT, 2, 12, false, true, "Microsoft YaHei UI");
|
||||
twoCount++;
|
||||
|
||||
for (LawsMonthlyReportWriteEO lawsMonthlyReportWriteEO : lawsMonthlyReportWriteEOList) {
|
||||
//月报内容标题
|
||||
String reportTitle = "";
|
||||
if(CutEnum.CN.getValue().equals(cut)){
|
||||
reportTitle = lawsMonthlyReportWriteEO.getTitleCn();
|
||||
}else{
|
||||
reportTitle = lawsMonthlyReportWriteEO.getTitleEn();
|
||||
}
|
||||
WordUtil.exportWord(document, reportCount+". "+reportTitle, null, ParagraphAlignment.LEFT, 6, 10, false, false, "Microsoft YaHei UI");
|
||||
reportCount++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 数字转罗马字
|
||||
* @param num
|
||||
* @return
|
||||
*/
|
||||
public String intToRoman(int num) {
|
||||
int[] values = {1000, 900, 500, 400, 100, 90, 50, 40, 10, 9, 5, 4, 1};
|
||||
String[] symbols = {"M", "CM", "D", "CD", "C", "XC", "L", "XL", "X", "IX", "V", "IV", "I"};
|
||||
StringBuffer ss=new StringBuffer();
|
||||
for (int i=0;i<values.length;i++){
|
||||
while (num>=values[i]){
|
||||
num=num-values[i];
|
||||
ss.append(symbols[i]);
|
||||
}
|
||||
if (num==0){
|
||||
return ss.toString();
|
||||
}
|
||||
}
|
||||
System.out.println(ss);
|
||||
return ss.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage queryPageDocument(Map<String, Object> parameter) {
|
||||
String cut = (String) parameter.get("cut");//中英文切换标识
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
"jsencrypt": "^3.0.0-rc.1",
|
||||
"lodash.get": "^4.4.2",
|
||||
"lodash.pick": "^4.4.0",
|
||||
"mammoth": "^1.4.21",
|
||||
"md5": "^2.2.1",
|
||||
"nprogress": "^0.2.0",
|
||||
"tinymce": "^5.3.2",
|
||||
|
||||
@@ -1174,4 +1174,23 @@ module.exports = {
|
||||
convertFailed:'Convert Failed',
|
||||
standardData:'Standard Data',
|
||||
Theorganization:'The Organization',
|
||||
Addingfolder:'Adding a folder',
|
||||
Addingsubfolders:'Adding Subfolders',
|
||||
Editfolder:'Edit Folder',
|
||||
Deletefolders:'Delete Folders',
|
||||
Foldername:'Folder Name',
|
||||
Folderpermissions:'Folder Permissions',
|
||||
Folderorder:'Folder Order',
|
||||
Downloadprivileges:'Download Privileges',
|
||||
Openpersonnel:'Open Personnel',
|
||||
originalText:'Original Text',
|
||||
translatedText:'Translated Text',
|
||||
Administrativeprivileges:'Administrativ Pprivileges',
|
||||
Checkthepermissions:'Check The Permissions',
|
||||
onlyFilesUploaded:'Only.Docx,.Doc files can be uploaded',
|
||||
selectDirectorylocation: 'Please select the directory location to add the folder',
|
||||
Fileuploaded:'File uploaded, please wait',
|
||||
uploadedbyyourself:'You can only delete files and data uploaded by yourself',
|
||||
Fileuploaded:'File uploading, please wait',
|
||||
doNotHavePermissionDeleteData:'Do not have permission to delete this data,'
|
||||
}
|
||||
@@ -178,9 +178,9 @@ module.exports = {
|
||||
MenuType: '菜单类型',
|
||||
menu: '菜单',
|
||||
ButtonsPermissions: '按钮/权限',
|
||||
ConventionalExport:'常规导出',
|
||||
CustomExport:'自定义导出',
|
||||
CustomTemplateName:'自定义模板名称',
|
||||
ConventionalExport: '常规导出',
|
||||
CustomExport: '自定义导出',
|
||||
CustomTemplateName: '自定义模板名称',
|
||||
assembly: '组件',
|
||||
route: '路径',
|
||||
AddSubmenu: '添加子菜单',
|
||||
@@ -393,8 +393,8 @@ module.exports = {
|
||||
StandardDetails: '标准详情',
|
||||
whole: '全部',
|
||||
DocumentLibrary: '文档库',
|
||||
GeneralExportInformation:'常规导出信息',
|
||||
CustomizeExportInformation:'自定义导出信息',
|
||||
GeneralExportInformation: '常规导出信息',
|
||||
CustomizeExportInformation: '自定义导出信息',
|
||||
DocumentComparisonLibrary: '文档对比库',
|
||||
weekly: '周报',
|
||||
SyncLibrary: '同步至文档库',
|
||||
@@ -577,6 +577,7 @@ module.exports = {
|
||||
documentSplitTemplate: '文档拆分模板',
|
||||
batSetting: '批量设置',
|
||||
selectDirectoryTerms: '请选择添加条款的目录位置',
|
||||
selectDirectorylocation: '请选择添加文件夹的目录位置',
|
||||
OnlyWordItem: '只有GSO文件类型,才能拆分pdf文件,请重新选择文件',
|
||||
OnlyWord: '只能导入word文件',
|
||||
labelAreaDeleted: '若进行删除,则该展示区域下标签项都将被删除',
|
||||
@@ -688,11 +689,11 @@ module.exports = {
|
||||
listConfirmation: '清单确认',
|
||||
ListConfirmationDeadline: '清单确认截止时间',
|
||||
dataConfirmation: '请选择清单确认状态为未发起或拒绝的数据,以及法规工程师、认证工程师不为空',
|
||||
pleaseSelectinitiatedOrRejected:'请选择清单确认状态为未发起或拒绝的数据',
|
||||
TheEngineerAndCertification:'的法规工程师、认证工程师不能为空',
|
||||
pleaseSelectinitiatedOrRejected: '请选择清单确认状态为未发起或拒绝的数据',
|
||||
TheEngineerAndCertification: '的法规工程师、认证工程师不能为空',
|
||||
taskDataConfirmation: '请选择清单确认状态为接受及任务确认状态为未发起或拒绝的数据,以及工程接口人不为空',
|
||||
theProjectContactEmpty:'的工程接口人不能为空',
|
||||
PleaseTaskConfirmationRejected:'请选择清单确认状态为接受及任务确认状态为未发起或拒绝的数据',
|
||||
theProjectContactEmpty: '的工程接口人不能为空',
|
||||
PleaseTaskConfirmationRejected: '请选择清单确认状态为接受及任务确认状态为未发起或拒绝的数据',
|
||||
pleaseSelectPersonFirst: '请先选择人员',
|
||||
onlyOnePersonCanBeSelected: '只能选择一个人员',
|
||||
overrule: '驳回',
|
||||
@@ -750,7 +751,7 @@ module.exports = {
|
||||
// 参数收集
|
||||
MaintainConfigureInfo: '维护配置信息',
|
||||
ParameteItemCollectionList: '参数项收集清单',
|
||||
ParameterViewPage:'参数项查看页',
|
||||
ParameterViewPage: '参数项查看页',
|
||||
Areyousureparameteritems: '确认提交所选参数项嘛?',
|
||||
Theselectedconfiguration: '参数清单中参数项均为待发起收集或变更时,才能添加配置',
|
||||
NoConfigurationNotStart: '未添加任何配置,无法开始收集,请检查',
|
||||
@@ -817,10 +818,10 @@ module.exports = {
|
||||
releaseVersion: '发布版本',
|
||||
parameterTemplate: '参数模板',
|
||||
contentDescription: '内容说明',
|
||||
WhetherMergeParameters:'是否合并参数',
|
||||
merge:'合并',
|
||||
nonjoinder:'不合并',
|
||||
MergeSeparator:'合并分隔符',
|
||||
WhetherMergeParameters: '是否合并参数',
|
||||
merge: '合并',
|
||||
nonjoinder: '不合并',
|
||||
MergeSeparator: '合并分隔符',
|
||||
parameterTemplateExportName: '参数项列表',
|
||||
parameterDataExport: '参数项导出数据',
|
||||
// 参数收集结束
|
||||
@@ -983,10 +984,10 @@ module.exports = {
|
||||
documentLibraryDetails: '文档库详情',
|
||||
question: '催办',
|
||||
ConfirmQuestion: '确认催办?',
|
||||
OnlyOrTaskconfirmationOut:'只有清单确认状态或任务确认状态为待确认时才可以进行催办',
|
||||
disableInput:'禁止输入',
|
||||
taskConfirmationDeadline:'任务确认截止时间',
|
||||
taskConfirmationResponsiblePerson:'责任人任务确认',
|
||||
OnlyOrTaskconfirmationOut: '只有清单确认状态或任务确认状态为待确认时才可以进行催办',
|
||||
disableInput: '禁止输入',
|
||||
taskConfirmationDeadline: '任务确认截止时间',
|
||||
taskConfirmationResponsiblePerson: '责任人任务确认',
|
||||
or: '或',
|
||||
warningTime: '预警时间',
|
||||
RegulationMonthlyManagement: '法规月报管理',
|
||||
@@ -1025,23 +1026,23 @@ module.exports = {
|
||||
closingDate: '截止日期',
|
||||
viewProcess: '查看流程',
|
||||
evaluationResults: '评估结果',
|
||||
regulatoryTechnicalEvaluationResults:'法规技术评估结果',
|
||||
Assessor:'评估人',
|
||||
collectionOfRegulatoryOpinions:'法规意见收集',
|
||||
collectionOfRegulatoryOpinionsProcess:'法规意见收集流程',
|
||||
feedbackInformation:'反馈信息',
|
||||
relevantSections:'相关章节',
|
||||
questionsSuggestions:'问题/建议',
|
||||
regulatoryTechnicalEvaluationResults: '法规技术评估结果',
|
||||
Assessor: '评估人',
|
||||
collectionOfRegulatoryOpinions: '法规意见收集',
|
||||
collectionOfRegulatoryOpinionsProcess: '法规意见收集流程',
|
||||
feedbackInformation: '反馈信息',
|
||||
relevantSections: '相关章节',
|
||||
questionsSuggestions: '问题/建议',
|
||||
link: '链接',
|
||||
reason:'理由',
|
||||
planNoChinese:'计划号',
|
||||
feedbackPoint:'反馈点',
|
||||
standardNameCn:'标准名称中文',
|
||||
standardNameEn:'标准名称英文',
|
||||
deadlineForComments:'征求意见截止日期',
|
||||
proposedTime:'提出时间',
|
||||
standardNo:'标准编号',
|
||||
implemenDate:'实施日期',
|
||||
reason: '理由',
|
||||
planNoChinese: '计划号',
|
||||
feedbackPoint: '反馈点',
|
||||
standardNameCn: '标准名称中文',
|
||||
standardNameEn: '标准名称英文',
|
||||
deadlineForComments: '征求意见截止日期',
|
||||
proposedTime: '提出时间',
|
||||
standardNo: '标准编号',
|
||||
implemenDate: '实施日期',
|
||||
// 上报库
|
||||
Enable: '启用',
|
||||
Latestupdatetime: '最新更新时间',
|
||||
@@ -1078,7 +1079,7 @@ module.exports = {
|
||||
Btext: '文本+下拉多选',
|
||||
Ctext: '文本+附件',
|
||||
Dtext: '下拉单选+附件',
|
||||
Etext:'下拉多选+附件',
|
||||
Etext: '下拉多选+附件',
|
||||
Ftext: '文本+下拉单选+附件',
|
||||
Gtext: '标题',
|
||||
Nnothing: '无',
|
||||
@@ -1178,4 +1179,121 @@ module.exports = {
|
||||
convertFailed:'转换失败',
|
||||
standardData:'标准数据',
|
||||
Theorganization:'组织机构',
|
||||
Addingfolder:'新增文件夹',
|
||||
Addingsubfolders:'新增子文件夹',
|
||||
Editfolder:'编辑文件夹',
|
||||
Deletefolders:'删除文件夹',
|
||||
Foldername:'文件夹名称',
|
||||
Folderpermissions:'文件夹权限',
|
||||
Folderorder:'文件夹顺序',
|
||||
Downloadprivileges:'下载权限',
|
||||
Openpersonnel:'开放人员',
|
||||
originalText:'原文',
|
||||
translatedText:'译文',
|
||||
Administrativeprivileges:'管理权限',
|
||||
Checkthepermissions:'查看权限',
|
||||
onlyFilesUploaded:'只能上传.docx、.doc文件',
|
||||
uploadedbyyourself:'只能删除自己上传的文件数据',
|
||||
Fileuploaded:'文件上传中,请稍后',
|
||||
English: '英文',
|
||||
requiredParametersEmpty: '必填参数不能为空',
|
||||
theResponsiblePersonAndDeadlineClank: '的责任人、截止时间不能为空',
|
||||
bringInTheProjectInterface: '带入工程接口人',
|
||||
theCurrentListSaved: '当前列表数据已全部提交,无法进行暂存',
|
||||
defaultTemplate: '默认模板',
|
||||
newRequestCommentListTemplate: '新征求意见清单模板',
|
||||
NewReleasedStandardTemplate: '新发布标准模板',
|
||||
pleaseSelectStandard: '请选择标准',
|
||||
theResponsiblePersonEmpty: '的责任人不能为空',
|
||||
theDeadlineEmpty: '的截止时间不能为空',
|
||||
theDeliveryTypeCannotBeEmpty: '的交付物类型不能为空',
|
||||
For: '针对于',
|
||||
markedRejection: '标注的驳回意见',
|
||||
RegulationListConfirmationTask: '清单确认任务',
|
||||
RegulationListConfirmationNotification: '清单确认通知',
|
||||
RegulationTaskConfirmation: '任务确认任务',
|
||||
DesignComplianceTask: '设计符合性任务',
|
||||
PreHomoTask: 'Pre-Homo任务',
|
||||
ValidationTask: '验证符合性任务',
|
||||
DesignComplianceNotification: '设计符合性通知',
|
||||
PreHomoNotification: 'Pre-Homo通知',
|
||||
ValidationComplianceNotification: '验证符合性通知',
|
||||
RegulationTaskConfirmationNotification: '任务确认通知',
|
||||
evaluationMethod: '评估方式',
|
||||
uploadRelevantMaterials: '相关资料上传',
|
||||
RelevantMaterials: '相关资料',
|
||||
processBackground: '流程背景',
|
||||
selectedStandard: '所选标准',
|
||||
standardDecompositionDocument: '带入标准分解单',
|
||||
pleaseSelectStandardFirst: '请先选择标准',
|
||||
evaluatorFeedback: '评估人反馈',
|
||||
nameTechnicalDocument: '技术文件名称',
|
||||
chapter: '章节',
|
||||
problemDescription: '问题说明',
|
||||
filingExternalOpinions: '对外意见归档',
|
||||
initiateProcessForCurrentStandard: '针对当前标准发起流程',
|
||||
engineerFeedbackResults: '工程师反馈结果',
|
||||
fileExport: '文件导出',
|
||||
feedbackTime: '反馈时间',
|
||||
regulatoryTechnologyAssessmentProcess: '法规技术评估流程',
|
||||
feedbackEvaluation: '反馈评估',
|
||||
clauseEvaluation: '条款评估',
|
||||
standardDocuments: '标准文件',
|
||||
pleaseCompleteTheEvaluationMethodorEvaluator: '请补全列表中评估方式或评估人',
|
||||
reviewComments: '审核意见',
|
||||
PleaseCompleteList: '请补全列表中符合性结果',
|
||||
sponsorFeedback: '发起人反馈',
|
||||
processNumber: '流程编号',
|
||||
processName: '流程名称',
|
||||
feedbackResults: '反馈结果',
|
||||
theDoesNotSupportPreview: '当前文件格式不支持预览',
|
||||
releaseSituation: '发布情况',
|
||||
comparisonResults: '对比结果',
|
||||
Published: '已发布',
|
||||
initiateComparison: '发起对比',
|
||||
translationLanguage: '翻译语言',
|
||||
translationResults: '翻译结果',
|
||||
conversionTime: '转换时间',
|
||||
category: '类别',
|
||||
RegulatoryProcessEvaluationResults: '法规流程评估结果',
|
||||
ViewConformanceResults: '查看符合性结果',
|
||||
CommentsCollectionResultsForReference: '意见收集结果参考',
|
||||
TechnicalEvaluationResultsForReference: '技术评估结果参考',
|
||||
ComplianceConfirmationRecord: '符合性确认记录',
|
||||
complianceConfirmation: '符合性确认',
|
||||
Deriveconformanceresults: '导出符合性结果',
|
||||
Regulatorycompliancekanban: '法规符合性看板',
|
||||
noComparisonDocumentSelected: '未选择对比文档',
|
||||
RemarkInfo: '备注信息',
|
||||
initiateDocumentComparison: '发起文档对比',
|
||||
comparativeComments: '对比评论',
|
||||
viewTheComparisonResults: '查看对比结果',
|
||||
addFullTextComment: '添加全文评论',
|
||||
turnOffAutomaticMatching: '关闭自动匹配',
|
||||
exportComparisonReport: '导出对比报告',
|
||||
comparisonDifferenceComment: '对比差异评论',
|
||||
fullTextComments: '全文评论',
|
||||
fileDeclaration: '文件说明',
|
||||
FileForDetails: '文件详情',
|
||||
Converting: '转换中',
|
||||
convertNetwork: '转换完成',
|
||||
convertFailed: '转换失败',
|
||||
standardData: '标准数据',
|
||||
Theorganization: '组织机构',
|
||||
Addingfolder: '新增文件夹',
|
||||
Addingsubfolders: '新增子文件夹',
|
||||
Editfolder: '编辑文件夹',
|
||||
Deletefolders: '删除文件夹',
|
||||
Foldername: '文件夹名称',
|
||||
Folderpermissions: '文件夹权限',
|
||||
Folderorder: '文件夹顺序',
|
||||
Downloadprivileges: '下载权限',
|
||||
Openpersonnel: '开放人员',
|
||||
originalText: '原文',
|
||||
translatedText: '译文',
|
||||
Administrativeprivileges: '管理权限',
|
||||
Checkthepermissions: '查看权限',
|
||||
onlyFilesUploaded: '只能上传.docx、.doc文件',
|
||||
uploadedbyyourself: '只能删除自己上传的文件数据',
|
||||
doNotHavePermissionDeleteData: '没有权限删除此数据'
|
||||
}
|
||||
@@ -99,6 +99,7 @@
|
||||
this.$route.path == '/TaskPlanList' ||
|
||||
this.$route.path == '/documentDataComparison' ||
|
||||
this.$route.path == '/comparisonResults' ||
|
||||
this.$route.path == '/documentTranslationResults' ||
|
||||
this.$route.path == '/initiateDocumentComparison' ||
|
||||
this.$route.path == '/evaluationProcess' ||
|
||||
this.$route.path == '/evaluationResultsClause' ||
|
||||
|
||||
@@ -21,7 +21,8 @@
|
||||
{{ text }}
|
||||
</span>
|
||||
<div :slot="'titleName'+(index+1)" v-for="(item,index) in content">
|
||||
<span style='padding-right: 20px'>{{ item.db_field_txt }} </span>
|
||||
<span v-if='item.isLock == 1' style='padding-right: 20px'><a-icon type="lock" theme="twoTone" two-tone-color="#00B3BE" /></span>
|
||||
<span style='padding-right: 10px;margin-left: -16px'>{{ item.db_field_txt }} </span>
|
||||
<a-button @click='onClickSee(item)'>{{$t('See')}}</a-button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<div>
|
||||
<a-modal v-model="visible" :maskClosable="false" :footer="[]" :title="title">
|
||||
<a-upload-dragger
|
||||
accept='*.*'
|
||||
:accept='accept'
|
||||
:disabled="disabled"
|
||||
class="ant-upload-list"
|
||||
:class="{'uploadFile':isUploadFile}"
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
export default {
|
||||
name: 'file',
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple'],
|
||||
props: ['disableds', 'disabled', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'isMultiple', 'restrictUploads'],
|
||||
data() {
|
||||
return {
|
||||
visible: false,
|
||||
@@ -48,7 +48,8 @@
|
||||
myfileList: [],
|
||||
isLoding: false,
|
||||
cut: '',
|
||||
multiple: true
|
||||
multiple: true,
|
||||
accept: ''
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -67,6 +68,7 @@
|
||||
if (this.isMultiple) {
|
||||
this.multiple = false
|
||||
}
|
||||
this.accept = this.restrictUploads ? '.docx,.doc' : '*.*'
|
||||
// console.log(this.thisFileType,this.thisFileSize,this.thisFileUploadUrl);
|
||||
},
|
||||
methods: {
|
||||
@@ -84,10 +86,23 @@
|
||||
},
|
||||
beforeUpload(file, fileList) {
|
||||
// let thisFileType = this.thisFileType.replace(/\s+/g, "");
|
||||
console.log(file)
|
||||
this.fileTypeSatus = true
|
||||
if (this.isMultiple) {
|
||||
if ((this.myfileList && this.myfileList.length == 1) || this.myfileList && this.myfileList.length > 1) {
|
||||
this.$message.warning('只能上传一个文件')
|
||||
this.$message.warning(this.$t('onlyOnefileUploaded'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
if (this.restrictUploads) {
|
||||
let fileName = file.name
|
||||
let index1 = fileName.lastIndexOf('.')
|
||||
let index2 = fileName.length
|
||||
let fileSuffix = fileName.substring(index1, index2)
|
||||
if (fileSuffix == '.docx' || fileSuffix == '.doc') {
|
||||
|
||||
} else {
|
||||
this.$message.warning(this.$t('onlyFilesUploaded'))
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -387,6 +387,11 @@ export const constantRouterMap = [
|
||||
name: 'initiateDocumentComparison',
|
||||
component: () => import(/* webpackChunkName: "user" */ '@/views/documentTools/documentComparison/components/initiateComparison')
|
||||
},
|
||||
{
|
||||
path: '/documentTranslationResults',
|
||||
name: 'documentTranslationResults',
|
||||
component: () => import(/* webpackChunkName: "user" */ '@/views/documentTools/documentTranslation/components/documentTranslationResults')
|
||||
},
|
||||
{
|
||||
path: '/documentDataComparison',
|
||||
name: 'documentDataComparison',
|
||||
|
||||
+14
-4
@@ -94,7 +94,8 @@
|
||||
//url传参严格按照当前命名
|
||||
url: {
|
||||
deleteBatch: '/report/lawsMonthlyReportWriteEO/deleteBatch',
|
||||
list:'/report/lawsMonthlyReportWriteEO/page',
|
||||
list: '/report/lawsMonthlyReportWriteEO/page',
|
||||
exportData: '/report/lawsMonthlyReportWriteEO/exportMonthlyReport'
|
||||
},
|
||||
loading: false,
|
||||
dataSource: [],
|
||||
@@ -161,7 +162,7 @@
|
||||
methods: {
|
||||
dateChange(item) {
|
||||
this.queryParam[item.db_field_name] = this.queryParam[item.db_field_name] ? moment(this.queryParam[item.db_field_name]).format('YYYY-MM') : ''
|
||||
this.queryParam = {...this.queryParam}
|
||||
this.queryParam = { ...this.queryParam }
|
||||
},
|
||||
searchQuery() {
|
||||
this.pageNo = 1
|
||||
@@ -170,7 +171,7 @@
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.queryParam.month = moment(new Date()).format('YYYY-MM')
|
||||
this.queryParam = {...this.queryParam}
|
||||
this.queryParam = { ...this.queryParam }
|
||||
this.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
@@ -219,7 +220,15 @@
|
||||
this.$refs.fillTableRef.getData()
|
||||
},
|
||||
monthlyIntegrationAndExportClick() {
|
||||
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
let query = {
|
||||
ids: selectedRowKeys.join(','),
|
||||
...this.queryParam
|
||||
}
|
||||
downloadFile(this.url.exportData, this.$t('monthlyReportRegulations') + '.zip', query, this.Deselect)
|
||||
},
|
||||
Deselect() {
|
||||
this.selectedRowKeys = []
|
||||
},
|
||||
addContentClick() {
|
||||
this.$refs.fillAddRef.add()
|
||||
@@ -323,6 +332,7 @@
|
||||
height: 38px;
|
||||
/*margin-top: 2px;*/
|
||||
}
|
||||
|
||||
.text-operation {
|
||||
margin-right: 8px;
|
||||
}
|
||||
|
||||
+6
-1
@@ -147,6 +147,7 @@
|
||||
return {
|
||||
formInline: {},
|
||||
rules: {},
|
||||
loading: false,
|
||||
gData: [
|
||||
{
|
||||
title: '0-0sdf dsfdsfdsfdsfds',
|
||||
@@ -175,7 +176,10 @@
|
||||
|
||||
},
|
||||
viewTheComparisonResultsClick() {
|
||||
|
||||
let newUrl = this.$router.resolve({
|
||||
path: '/comparisonResults'
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
},
|
||||
addFullTextCommentClick() {
|
||||
|
||||
@@ -306,6 +310,7 @@
|
||||
text-align: right;
|
||||
padding: 0 32px;
|
||||
box-sizing: border-box;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.detail-content-content-left {
|
||||
|
||||
@@ -257,7 +257,10 @@
|
||||
window.open(newUrl.href, '_blank')
|
||||
},
|
||||
subscribe() {
|
||||
|
||||
let newUrl = this.$router.resolve({
|
||||
path: '/documentDataComparison'
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
},
|
||||
edit() {
|
||||
|
||||
|
||||
+64
-44
@@ -42,10 +42,10 @@
|
||||
<a-table
|
||||
:columns="columns"
|
||||
rowKey="id"
|
||||
:scroll="{x: '100%'}"
|
||||
:scroll="{x: '100%',y:'calc(100vh - 440px)'}"
|
||||
:data-source="dataList"
|
||||
:pagination="false"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
|
||||
:row-selection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange,columnTitle:' ' }"
|
||||
:loading="loading">
|
||||
|
||||
</a-table>
|
||||
@@ -68,38 +68,22 @@
|
||||
<span class="Required-One">*</span>
|
||||
<span class="title-text-text-One" :title="$t('translationLanguage')">{{$t('translationLanguage')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="translationLanguage">
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
class="box-input-One"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="formInline.translationLanguage">
|
||||
<a-select-option v-for="(item, key) in LanguageList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="sourceLanguage">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline.sourceLanguage"
|
||||
@input="handleInput('sourceLanguage')"
|
||||
:placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="source_language"/>
|
||||
</a-form-model-item>
|
||||
<span class="text-icon-One">
|
||||
<a-icon type="arrow-right" style="font-size: 20px"/>
|
||||
</span>
|
||||
<a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="translationLanguageOne">
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
class="box-input-One"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="formInline.translationLanguageOne">
|
||||
<a-select-option v-for="(item, key) in LanguageList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-form-model-item class="itemModel-One" style="width: calc(50% - 20px)" prop="targetLanguage">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline.targetLanguage"
|
||||
@input="handleInput('targetLanguage')"
|
||||
:placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="target_language"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -127,14 +111,14 @@
|
||||
selectedRowKeys: [],
|
||||
formInline: {},
|
||||
rules: {
|
||||
translationLanguage: [
|
||||
sourceLanguage: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('translationLanguage') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
translationLanguageOne: [
|
||||
targetLanguage: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('translationLanguage') + this.$t('cannotEmpty'),
|
||||
@@ -166,19 +150,19 @@
|
||||
},
|
||||
{
|
||||
title: this.$t('TextStatus'),
|
||||
dataIndex: 'TextStatus',
|
||||
dataIndex: 'state',
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: this.$t('fileName'),
|
||||
dataIndex: 'fileName',
|
||||
dataIndex: 'file_name',
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
},
|
||||
{
|
||||
title: this.$t('textInformation'),
|
||||
dataIndex: 'textInformation',
|
||||
dataIndex: 'text_info',
|
||||
align: 'center',
|
||||
ellipsis: true
|
||||
}
|
||||
@@ -189,19 +173,27 @@
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
fieldList: [],
|
||||
queryConditionVOList: []
|
||||
selectedRowKeysRecord: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
||||
},
|
||||
methods: {
|
||||
handleInput(value) {
|
||||
this.$nextTick(() => {
|
||||
this.formInline = { ...this.formInline }
|
||||
this.$refs.ruleForm.validateField([value])
|
||||
})
|
||||
},
|
||||
addModel() {
|
||||
this.visible = true
|
||||
this.queryParam = {}
|
||||
this.selectedRowKeys = []
|
||||
// this.replacePage()
|
||||
this.replacePage()
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ruleForm.clearValidate()
|
||||
})
|
||||
},
|
||||
searchQuery() {
|
||||
this.pageNo = 1
|
||||
@@ -222,13 +214,16 @@
|
||||
this.replacePage()
|
||||
},
|
||||
replacePage() {
|
||||
let pageNo = JSON.parse(JSON.stringify(this.pageNo))
|
||||
let pageSize = JSON.parse(JSON.stringify(this.pageSize))
|
||||
let query = {
|
||||
pageNo: this.pageNo,
|
||||
pageSize: this.pageSize,
|
||||
pageNo: pageNo + '',
|
||||
pageSize: pageSize + '',
|
||||
type: 'doc',
|
||||
...this.queryParam
|
||||
}
|
||||
this.loading = true
|
||||
postAction('', query).then((res) => {
|
||||
postAction('document/bussDocumentLibraryEO/ocrPageInfo', query).then((res) => {
|
||||
if (res.success) {
|
||||
this.dataList = res.result.records || []
|
||||
this.total = res.result.total
|
||||
@@ -240,8 +235,15 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelectChange(value) {
|
||||
onSelectChange(value, record) {
|
||||
this.selectedRowKeys = value
|
||||
if (this.selectedRowKeys.length > 1) {
|
||||
this.selectedRowKeys.shift()
|
||||
}
|
||||
this.selectedRowKeysRecord = record.filter(res => {
|
||||
return res.id == this.selectedRowKeys[0]
|
||||
})
|
||||
this.selectedRowKeysRecord = [...this.selectedRowKeysRecord]
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
@@ -250,9 +252,27 @@
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
let query = {
|
||||
...this.formInline,
|
||||
serialNumber: this.selectedRowKeysRecord[0].serial_number,
|
||||
title: this.selectedRowKeysRecord[0].title,
|
||||
fileName: this.selectedRowKeysRecord[0].file_name,
|
||||
textStatus: this.selectedRowKeysRecord[0].text_info_id,
|
||||
sourceFileId:this.selectedRowKeysRecord[0].id,
|
||||
bussDocumentLibraryId:this.selectedRowKeysRecord[0].buss_document_library_id
|
||||
}
|
||||
this.confirmLoading = true
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
this.visible = false
|
||||
postAction('/docTranslation/docTranslationEO/add', query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.$emit('RetrieveFilesListForm')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
@@ -18,11 +18,11 @@
|
||||
<span class="title-text-text"
|
||||
:title="$t('file')">{{$t('file')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="file">
|
||||
<a-form-model-item class="itemModel" prop="sourceFileId">
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload('file')">
|
||||
{{ (formInline.file === 'null' || formInline.file === '' ||
|
||||
formInline.file == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
@click="clickButtonToUpload('sourceFileId')">
|
||||
{{ (formInline.sourceFileId === 'null' || formInline.sourceFileId === '' ||
|
||||
formInline.sourceFileId == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
@@ -34,10 +34,10 @@
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text" :title="$t('standard')">{{$t('standard')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="standard">
|
||||
<a-form-model-item class="itemModel" prop="serialNumber">
|
||||
<a-input class="box-input"
|
||||
readonly
|
||||
v-model="formInline.standard"
|
||||
v-model="formInline.serialNumber"
|
||||
@click.native="standardClick"
|
||||
:placeholder="$t('PleaseSelect')+$t('standard')"/>
|
||||
</a-form-model-item>
|
||||
@@ -49,17 +49,17 @@
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text" :title="$t('TextStatus')">{{$t('TextStatus')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="translationResults">
|
||||
<a-form-model-item class="itemModel" prop="textStatus">
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('TextStatus')"
|
||||
class="box-input"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="formInline.translationResults">
|
||||
v-model="formInline.textStatus">
|
||||
<a-select-option v-for="(item, key) in translationResultsList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
:value="item.id">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.dbFieldTxt">
|
||||
{{ item.dbFieldTxt }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
@@ -72,45 +72,29 @@
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text" :title="$t('translationLanguage')">{{$t('translationLanguage')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="translationLanguage">
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
class="box-input"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="formInline.translationLanguage">
|
||||
<a-select-option v-for="(item, key) in LanguageList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="sourceLanguage">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline.sourceLanguage"
|
||||
@input="handleInput('sourceLanguage')"
|
||||
:placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="source_language"/>
|
||||
</a-form-model-item>
|
||||
<span class="text-icon">
|
||||
<a-icon type="arrow-right" style="font-size: 20px"/>
|
||||
</span>
|
||||
<a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="translationLanguageOne">
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
class="box-input"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="formInline.translationLanguageOne">
|
||||
<a-select-option v-for="(item, key) in LanguageList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<a-form-model-item class="itemModel" style="width: calc(50% - 20px)" prop="targetLanguage">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline.targetLanguage"
|
||||
@input="handleInput('targetLanguage')"
|
||||
:placeholder="$t('PleaseSelect')+$t('translationLanguage')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="target_language"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-modal>
|
||||
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess"/>
|
||||
<uploadFile ref="uploadFile" :restrictUploads="true" :isMultiple="true" @uploadSuccess="uploadSuccess"/>
|
||||
<standardData ref="standardDataRef" @standardDataForm="standardDataForm"/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -133,35 +117,35 @@
|
||||
confirmLoading: false,
|
||||
formInline: {},
|
||||
rules: {
|
||||
file: [
|
||||
sourceFileId: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('file') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
standard: [
|
||||
serialNumber: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('standard') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
translationResults: [
|
||||
textStatus: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('TextStatus') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
translationLanguage: [
|
||||
sourceLanguage: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('translationLanguage') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
translationLanguageOne: [
|
||||
targetLanguage: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('translationLanguage') + this.$t('cannotEmpty'),
|
||||
@@ -175,8 +159,18 @@
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getTextStatus()
|
||||
},
|
||||
methods: {
|
||||
getTextStatus() {
|
||||
getAction('/docTranslation/docTranslationEO/queryTextStatusVal', {}).then((res) => {
|
||||
if (res.success) {
|
||||
this.translationResultsList = res.result || []
|
||||
} else {
|
||||
this.translationResultsList = []
|
||||
}
|
||||
})
|
||||
},
|
||||
add() {
|
||||
this.visible = true
|
||||
this.formInline = {}
|
||||
@@ -193,18 +187,16 @@
|
||||
handleOk() {
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
let ids = JSON.parse(JSON.stringify(this.ids))
|
||||
let query = {
|
||||
ids: ids.join(','),
|
||||
...this.formInline
|
||||
}
|
||||
this.confirmLoading = true
|
||||
postAction(this.url.setBatch, query).then((res) => {
|
||||
postAction('/docTranslation/docTranslationEO/add', query).then((res) => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.visible = false
|
||||
this.confirmLoading = false
|
||||
this.$emit('batSettingList')
|
||||
this.$emit('addModelForm')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.confirmLoading = false
|
||||
@@ -232,20 +224,36 @@
|
||||
/** 上传文件的回调 */
|
||||
uploadSuccess(data) {
|
||||
let attIdList = []
|
||||
let fileName = []
|
||||
if (data && data.length > 0) {
|
||||
data.map(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
fileName.push(item.fileName)
|
||||
})
|
||||
}
|
||||
/** 赋值给当前对应的表单文件 */
|
||||
this.formInline[this.uploadName] = attIdList.join(',')
|
||||
this.formInline.fileName = fileName.join(',')
|
||||
this.formInline = { ...this.formInline }
|
||||
this.$nextTick(() => {
|
||||
if (this.formInline[this.uploadName]) {
|
||||
this.$refs.ruleForm.validateField([this.uploadName])
|
||||
}
|
||||
})
|
||||
},
|
||||
standardClick() {
|
||||
this.$refs.standardDataRef.addModel()
|
||||
},
|
||||
standardDataForm() {
|
||||
|
||||
standardDataForm(row) {
|
||||
this.formInline.serialNumber = row.serial_number
|
||||
this.formInline.title = row.title
|
||||
this.formInline.bussDocumentLibraryId = row.id
|
||||
this.formInline = { ...this.formInline }
|
||||
this.$nextTick(() => {
|
||||
if (this.formInline.serialNumber) {
|
||||
this.$refs.ruleForm.validateField(['serialNumber'])
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+221
@@ -0,0 +1,221 @@
|
||||
<template>
|
||||
<div class="doc-detail">
|
||||
<div class="doc-detail-wrap">
|
||||
<div class="doc-detail-header" style="position: fixed;top: 0">
|
||||
<div class="doc-detail-title">
|
||||
<span style="line-height: 66px;display: inline-block;float: left" @click="Fallback">
|
||||
<a-icon type="arrow-left" style="margin-right: 6px;"/>
|
||||
</span>
|
||||
<span> {{$t('DocumentTranslation')}}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style="padding-top: 68px;background: #fff">
|
||||
<div class="detail-content">
|
||||
<div class="detail-content-left">
|
||||
<div class="detail-text-top">
|
||||
{{$t('originalText')}}
|
||||
</div>
|
||||
<div class="detail-text">
|
||||
<iframe :src="detailUrlLeft"
|
||||
ref="iframeLeft"
|
||||
@load="detailUrlLeftLoad"
|
||||
sandbox="allow-same-origin allow-scripts"
|
||||
id="iframe-left"
|
||||
class="detail-text-iframe" frameborder="0"></iframe>
|
||||
</div>
|
||||
<JLoading :loading="loadingLeft">{{$t('dataLoading')}}</JLoading>
|
||||
</div>
|
||||
<div class="detail-content-right">
|
||||
<div class="detail-text-top">
|
||||
{{$t('translatedText')}}
|
||||
</div>
|
||||
<div class="detail-text">
|
||||
<iframe :src="detailUrlRight" @load="detailUrlrightLoad" class="detail-text-iframe"
|
||||
frameborder="0"></iframe>
|
||||
</div>
|
||||
<JLoading :loading="loadingRight">{{$t('dataLoading')}}</JLoading>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { Base64 } from 'js-base64'
|
||||
import mammoth from 'mammoth'
|
||||
import axios from 'axios'
|
||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||
import Vue from 'vue'
|
||||
|
||||
export default {
|
||||
name: 'documentTranslationResults',
|
||||
data() {
|
||||
return {
|
||||
detailUrlLeft: '',
|
||||
detailUrlRight: '',
|
||||
loadingLeft: false,
|
||||
loadingRight: false,
|
||||
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
|
||||
fileQuery: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.fileQuery = this.$route.query
|
||||
this.onlinePreview()
|
||||
},
|
||||
methods: {
|
||||
Fallback() {
|
||||
this.$router.push({
|
||||
path: '/documentTranslation'
|
||||
})
|
||||
},
|
||||
detailUrlLeftLoad() {
|
||||
this.loadingLeft = false
|
||||
},
|
||||
detailUrlrightLoad() {
|
||||
this.loadingRight = false
|
||||
},
|
||||
onlinePreview() {
|
||||
let fileName = this.fileQuery.fileName
|
||||
let index1 = fileName.lastIndexOf('.')
|
||||
let index2 = fileName.length
|
||||
let fileSuffix = fileName.substring(index1, index2)
|
||||
this.loadingLeft = true
|
||||
this.loadingRight = true
|
||||
// this.readExcelFromRemoteFileLeft(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
|
||||
// this.readExcelFromRemoteFileRight(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
|
||||
this.detailUrlLeft = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.sourceFileId + fileSuffix)
|
||||
this.detailUrlRight = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + this.fileQuery.targetFileId + fileSuffix)
|
||||
},
|
||||
readExcelFromRemoteFileLeft: function(url) {
|
||||
var vm = this
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('get', url, true)
|
||||
xhr.responseType = 'arraybuffer'
|
||||
xhr.onload = function() {
|
||||
if (xhr.status == 200) {
|
||||
mammoth.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) })
|
||||
.then(function(resultObject) {
|
||||
vm.$nextTick(() => {
|
||||
vm.detailUrlLeft = resultObject.value
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
xhr.send()
|
||||
},
|
||||
readExcelFromRemoteFileRight: function(url) {
|
||||
var vm = this
|
||||
var xhr = new XMLHttpRequest()
|
||||
xhr.open('get', url, true)
|
||||
xhr.responseType = 'arraybuffer'
|
||||
xhr.onload = function() {
|
||||
if (xhr.status == 200) {
|
||||
mammoth.convertToHtml({ arrayBuffer: new Uint8Array(xhr.response) })
|
||||
.then(function(resultObject) {
|
||||
vm.$nextTick(() => {
|
||||
vm.detailUrlRight = resultObject.value
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
xhr.send()
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="less" scoped>
|
||||
@import '~@assets/less/common.less';
|
||||
|
||||
.doc-detail {
|
||||
background: #fff;
|
||||
height: 100%;
|
||||
|
||||
.doc-detail-wrap {
|
||||
.doc-detail-header {
|
||||
width: 100%;
|
||||
z-index: 1000;
|
||||
height: 68px;
|
||||
line-height: 68px;
|
||||
padding: 0 0 0 32px;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
border-bottom: 2px #eff1f3 solid;
|
||||
background: #fff;
|
||||
|
||||
.doc-detail-title {
|
||||
display: inline-block;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
font-size: 20px;
|
||||
font-weight: 400;
|
||||
color: #040B29;
|
||||
line-height: 68px;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.detail-content {
|
||||
padding: 32px;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.detail-content-left {
|
||||
width: calc(50% - 12px);
|
||||
height: calc(100vh - 130px);
|
||||
float: left;
|
||||
border: 1px solid #CED0D8;
|
||||
padding: 24px 32px;
|
||||
box-sizing: border-box;
|
||||
overflow: auto;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.detail-content-right {
|
||||
position: relative;
|
||||
float: left;
|
||||
width: calc(50% - 12px);
|
||||
padding: 24px 32px;
|
||||
margin-left: 24px;
|
||||
height: calc(100vh - 130px);
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #CED0D8;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
.detail-text-top {
|
||||
height: 30px;
|
||||
font-size: 18px;
|
||||
font-weight: 400;
|
||||
color: #040B29;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.detail-text {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: #040B29;
|
||||
height: calc(100vh - 230px);
|
||||
}
|
||||
|
||||
.page {
|
||||
text-align: right;
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.detail-text-iframe {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
border-width: 0px;
|
||||
}
|
||||
</style>
|
||||
<style>
|
||||
.detail-text-iframe .container {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
@@ -157,7 +157,7 @@
|
||||
total: 0,
|
||||
fieldList: [],
|
||||
queryConditionVOList: [],
|
||||
selectedRowKeysRecord:[],
|
||||
selectedRowKeysRecord: []
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
@@ -214,12 +214,12 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelectChange(value) {
|
||||
onSelectChange(value,record) {
|
||||
this.selectedRowKeys = value
|
||||
if (this.selectedRowKeys.length > 1) {
|
||||
this.selectedRowKeys.shift()
|
||||
}
|
||||
this.selectedRowKeysRecord = record.filter(res=>{
|
||||
this.selectedRowKeysRecord = record.filter(res => {
|
||||
return res.id == this.selectedRowKeys[0]
|
||||
})
|
||||
this.selectedRowKeysRecord = [...this.selectedRowKeysRecord]
|
||||
@@ -229,8 +229,7 @@
|
||||
},
|
||||
handleSubmit() {
|
||||
if (this.selectedRowKeys && this.selectedRowKeys.length > 0) {
|
||||
this.confirmLoading = true
|
||||
let selectedRowKeys = JSON.parse(JSON.stringify(this.selectedRowKeys))
|
||||
this.$emit('standardDataForm', this.selectedRowKeysRecord[0])
|
||||
this.visible = false
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
|
||||
@@ -26,19 +26,10 @@
|
||||
<div class="title-text" :title="$t('translationResults')">
|
||||
<span>{{$t('translationResults')}}</span>
|
||||
</div>
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('translationResults')"
|
||||
class="box-input"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="queryParam.translationResults">
|
||||
<a-select-option v-for="(item, key) in translationResultsList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<j-dict-select-tag class="box-input" v-model="queryParam.translationResult"
|
||||
:placeholder="$t('PleaseSelect')+$t('translationResults')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="translation_result"/>
|
||||
</div>
|
||||
</a-col>
|
||||
<template v-if="toggleSearchStatus">
|
||||
@@ -47,19 +38,10 @@
|
||||
<div class="title-text" :title="$t('releaseSituation')">
|
||||
<span>{{$t('releaseSituation')}}</span>
|
||||
</div>
|
||||
<a-select :placeholder="$t('PleaseSelect')+$t('releaseSituation')"
|
||||
class="box-input"
|
||||
:getPopupContainer="triggerNode=> triggerNode.parentNode"
|
||||
allowClear
|
||||
v-model="queryParam.flowStatus">
|
||||
<a-select-option v-for="(item, key) in gatherResultList"
|
||||
:key="key"
|
||||
:value="item.value">
|
||||
<span style="display: inline-block;width: 100%" :title=" item.name">
|
||||
{{ item.name }}
|
||||
</span>
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
<j-dict-select-tag class="box-input" v-model="queryParam.releaseCondition"
|
||||
:placeholder="$t('PleaseSelect')+$t('releaseSituation')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" dictCode="release_condition"/>
|
||||
</div>
|
||||
</a-col>
|
||||
</template>
|
||||
@@ -105,13 +87,24 @@
|
||||
<!-- -->
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<a class="text-operation" @click="viewClick(record)">{{$t('view')}}</a>
|
||||
<a class="text-operation" @click="checkClick(record)">{{$t('check')}}</a>
|
||||
<a class="text-operation"
|
||||
@click="subscribe(record)">
|
||||
{{!record.state || record.state == 0 ? $t('release') :$t('withdraw')}}
|
||||
<!-- <a class="text-operation" @click="checkClick(record)">{{$t('check')}}</a>-->
|
||||
<a class="text-operation"
|
||||
v-if="record.createBy == userInfoQuery.username"
|
||||
@click="subscribe(record)">
|
||||
{{!record.releaseCondition || record.releaseCondition == 'draft' ? $t('release') :$t('withdraw')}}
|
||||
</a>
|
||||
<a class="text-operation" @click="downloadData(record)">{{$t('download')}}</a>
|
||||
<a class="text-operation" @click="deleteData(record)">{{$t('delete')}}</a>
|
||||
<a class="text-operation"
|
||||
v-if="record.translationResult == 'Translation done'"
|
||||
@click="downloadData(record)">{{$t('download')}}</a>
|
||||
<a class="text-operation"
|
||||
v-if="record.createBy == userInfoQuery.username && record.releaseCondition == 'draft'"
|
||||
@click="deleteData(record)">{{$t('delete')}}</a>
|
||||
</span>
|
||||
<span slot="translationLanguage" slot-scope="text,record"
|
||||
:title="record.sourceLanguage_dictText +' -- '+record.targetLanguage_dictText">
|
||||
<span class="translationLanguageText" style="margin-top: -2px">{{record.sourceLanguage_dictText}}</span>
|
||||
<a-icon class="translationLanguageText" type="arrow-right" style="font-size: 16px"/>
|
||||
<span class="translationLanguageText">{{record.targetLanguage_dictText}}</span>
|
||||
</span>
|
||||
</a-table>
|
||||
<div class="page" v-if="dataSource && dataSource.length > 0">
|
||||
@@ -133,9 +126,11 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getAction, postAction } from '@/api/manage'
|
||||
import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
|
||||
import addModel from './components/addModel'
|
||||
import RetrieveFilesList from './components/RetrieveFilesList'
|
||||
import eventBUs from '../../../common/event'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
@@ -147,8 +142,8 @@
|
||||
return {
|
||||
//url传参严格按照当前命名
|
||||
url: {
|
||||
list: '',
|
||||
deleteBatch: ''
|
||||
list: '/docTranslation/docTranslationEO/page',
|
||||
deleteBatch: '/docTranslation/docTranslationEO/deleteBatch'
|
||||
},
|
||||
toggleSearchStatus: false,
|
||||
loading: false,
|
||||
@@ -158,30 +153,8 @@
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
queryParam: {},
|
||||
gatherResultList: [
|
||||
{
|
||||
value: '1',
|
||||
name: this.$t('draft')
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
name: this.$t('Published')
|
||||
}
|
||||
],
|
||||
translationResultsList: [
|
||||
{
|
||||
value: '1',
|
||||
name: this.$t('Converting')
|
||||
},
|
||||
{
|
||||
value: '2',
|
||||
name: this.$t('convertNetwork')
|
||||
},
|
||||
{
|
||||
value: '3',
|
||||
name: this.$t('convertFailed')
|
||||
}
|
||||
],
|
||||
userInfoQuery: {},
|
||||
selectedRowKeysRecord: [],
|
||||
columns: [
|
||||
{
|
||||
title: this.$t('standard'),
|
||||
@@ -200,7 +173,7 @@
|
||||
align: 'center',
|
||||
width: 170,
|
||||
ellipsis: true,
|
||||
dataIndex: 'TextStatus'
|
||||
dataIndex: 'textStatus_dictText'
|
||||
},
|
||||
{
|
||||
title: this.$t('fileName'),
|
||||
@@ -212,13 +185,14 @@
|
||||
{
|
||||
title: this.$t('translationLanguage'),
|
||||
align: 'center',
|
||||
dataIndex: 'translationLanguage',
|
||||
width: 170
|
||||
dataIndex: 'targetLanguage_dictText',
|
||||
width: 240,
|
||||
scopedSlots: { customRender: 'translationLanguage' }
|
||||
},
|
||||
{
|
||||
title: this.$t('translationResults'),
|
||||
align: 'center',
|
||||
dataIndex: 'translationResults',
|
||||
dataIndex: 'translationResult_dictText',
|
||||
width: 170
|
||||
},
|
||||
{
|
||||
@@ -226,14 +200,14 @@
|
||||
align: 'center',
|
||||
width: 170,
|
||||
ellipsis: true,
|
||||
dataIndex: 'conversionTime'
|
||||
dataIndex: 'translationTime'
|
||||
},
|
||||
{
|
||||
title: this.$t('releaseSituation'),
|
||||
align: 'center',
|
||||
width: 170,
|
||||
ellipsis: true,
|
||||
dataIndex: 'releaseSituation'
|
||||
dataIndex: 'releaseCondition_dictText'
|
||||
},
|
||||
{
|
||||
title: this.$t('operation'),
|
||||
@@ -247,12 +221,16 @@
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.userInfoQuery = this.userInfo()
|
||||
},
|
||||
methods: {
|
||||
...mapGetters(['userInfo']),
|
||||
addModelForm() {
|
||||
this.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
RetrieveFilesListForm() {
|
||||
this.pageNo = 1
|
||||
this.getList()
|
||||
},
|
||||
handleToggleSearch() {
|
||||
@@ -299,20 +277,52 @@
|
||||
}
|
||||
})
|
||||
},
|
||||
onSelectChange(value) {
|
||||
onSelectChange(value, record) {
|
||||
this.selectedRowKeys = value
|
||||
this.selectedRowKeysRecord = record
|
||||
},
|
||||
viewClick(row) {
|
||||
|
||||
let newUrl = this.$router.resolve({
|
||||
path: '/documentTranslationResults',
|
||||
query: {
|
||||
targetFileId: row.targetFileId,
|
||||
sourceFileId: row.sourceFileId,
|
||||
fileName: row.fileName
|
||||
}
|
||||
})
|
||||
window.open(newUrl.href, '_blank')
|
||||
},
|
||||
checkClick(row) {
|
||||
|
||||
// checkClick(row) {
|
||||
//
|
||||
// },
|
||||
downloadData(fileQuery) {
|
||||
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.targetFileId })
|
||||
},
|
||||
downloadData() {
|
||||
|
||||
},
|
||||
subscribe() {
|
||||
|
||||
subscribe(record) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: record.releaseCondition == 'draft' ? _this.$t('confirmRelease') : _this.$t('confirmWithdraw'),
|
||||
onOk() {
|
||||
let releaseCondition = ''
|
||||
if (record.releaseCondition == 'draft') {
|
||||
releaseCondition = 'published'
|
||||
} else {
|
||||
releaseCondition = 'draft'
|
||||
}
|
||||
let query = {
|
||||
releaseCondition: releaseCondition,
|
||||
ids: record.id
|
||||
}
|
||||
postAction('/docTranslation/docTranslationEO/updateRleaseConditionBatch', query).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.getList()
|
||||
} else {
|
||||
_this.$message.warning(_this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
uploadClick() {
|
||||
this.$refs.addModelRef.add()
|
||||
@@ -320,15 +330,45 @@
|
||||
RetrieveFilesClick() {
|
||||
this.$refs.RetrieveFilesListRef.addModel()
|
||||
},
|
||||
BatchDelete(){
|
||||
|
||||
BatchDelete() {
|
||||
if (this.selectedRowKeys.length > 0) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: _this.$t('ConfirmBatchDeletion'),
|
||||
onOk() {
|
||||
let idList = []
|
||||
let selectedRowKeysRecord = JSON.parse(JSON.stringify(_this.selectedRowKeysRecord))
|
||||
for (let i = 0; i < selectedRowKeysRecord.length; i++) {
|
||||
if (selectedRowKeysRecord[i].createBy == _this.userInfo().username &&
|
||||
selectedRowKeysRecord[i].releaseCondition == 'draft') {
|
||||
idList.push(selectedRowKeysRecord[i].id)
|
||||
}
|
||||
}
|
||||
if (idList.length > 0) {
|
||||
deleteAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.selectedRowKeys = []
|
||||
_this.getList()
|
||||
} else {
|
||||
_this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
} else {
|
||||
_this.$message.warning(_this.$t('doNotHavePermissionDeleteData'))
|
||||
}
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectLeastOne'))
|
||||
}
|
||||
},
|
||||
deleteData(val) {
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: _this.$t('ConfirmDelete'),
|
||||
onOk() {
|
||||
getAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
|
||||
deleteAction(_this.url.deleteBatch, { ids: val.id }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.getList()
|
||||
@@ -398,4 +438,9 @@
|
||||
color: red;
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.translationLanguageText {
|
||||
margin-right: 4px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
@@ -1,104 +1,108 @@
|
||||
<template>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:maskClosable="false"
|
||||
:width="800"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@cancel="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form>
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
:title="$t('parameterTemplate')">{{$t('parameterTemplate')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="paramsTemplateName">
|
||||
<a-input class="box-input"
|
||||
:disabled="disabled"
|
||||
v-model.trim="formInline.paramsTemplateName"
|
||||
:placeholder="$t('PleaseEnter')+$t('parameterTemplate')"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text" :title="$t('zoneOfApplication')">{{$t('zoneOfApplication')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="region">
|
||||
<j-dict-select-tag class="box-input" v-model="formInline.region"
|
||||
:disabled="disabled"
|
||||
:placeholder="$t('PleaseSelect')+$t('zoneOfApplication')"
|
||||
:type="'select'"
|
||||
:triggerChange="false" :dictCode="'region'"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="title-text-text"
|
||||
:title="$t('contentDescription')">{{$t('contentDescription')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="description">
|
||||
<a-input class="box-input add-input"
|
||||
type="textarea"
|
||||
:disabled="disabled"
|
||||
v-model="formInline.description"
|
||||
:placeholder="$t('PleaseEnter')+$t('contentDescription')"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-modal>
|
||||
<div>
|
||||
<a-modal
|
||||
:title="title"
|
||||
:maskClosable="false"
|
||||
:width="800"
|
||||
placement="right"
|
||||
:closable="true"
|
||||
@cancel="handleCancel"
|
||||
:visible="visible"
|
||||
style="height: 100%;overflow: auto;padding-bottom: 53px;">
|
||||
<a-spin :tip="this.$t('Fileuploaded')" :spinning='spinning'>
|
||||
<a-form>
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
:title="$t('fileName')">{{$t('fileName')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="fileKey">
|
||||
<a-button type="primary" class="button-text"
|
||||
@click="clickButtonToUpload('fileKey')">
|
||||
{{ (formInline.fileKey === 'null' || formInline.fileKey === '' ||
|
||||
formInline.fileKey == null) ? $t('clickUpload') : $t('viewUploadedFiles')
|
||||
}}
|
||||
</a-button>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<!-- <span class="Required">*</span>-->
|
||||
<span class="title-text-text" :title="$t('fileDeclaration')">{{$t('fileDeclaration')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="fileDescription">
|
||||
<a-input class="box-input add-input"
|
||||
type="textarea"
|
||||
:placeholder="$t('PleaseEnter')+$t('fileDeclaration')"
|
||||
v-model="formInline.fileDescription"/>
|
||||
</a-form-model-item>
|
||||
</div>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-form>
|
||||
</a-spin>
|
||||
<div class="drawer-bootom-button">
|
||||
<a-button style="margin-right: .8rem" @click="handleCancel">{{$t('cancel')}}</a-button>
|
||||
<a-button @click="handleSubmit" type="primary" :loading="confirmLoading">{{$t('submit')}}</a-button>
|
||||
</div>
|
||||
</a-modal>
|
||||
<uploadFile ref="uploadFile" @uploadSuccess="uploadSuccess" :disabled='disabled'/>
|
||||
<!-- <div class="loading-box" v-if="spinning">-->
|
||||
<!-- <div class="loading-content">-->
|
||||
<!-- <a-icon class="loading" type="loading"/>-->
|
||||
<!-- <div class="loading-tips">-->
|
||||
<!-- {{this.$t('Fileuploaded')}}...-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import PersonnelSelection from '@/components/PersonnelSelection/index'
|
||||
import { getAction, postAction, downloadFile, putAction } from '@/api/manage'
|
||||
import uploadFile from '@/components/uploadFile/file'
|
||||
|
||||
export default {
|
||||
name: 'addModel',
|
||||
components: {
|
||||
PersonnelSelection
|
||||
PersonnelSelection,
|
||||
uploadFile
|
||||
},
|
||||
props: ['url'],
|
||||
// props: ['url'],
|
||||
data() {
|
||||
return {
|
||||
formInline: {},
|
||||
confirmLoading: false,
|
||||
spinning: false,
|
||||
menuId:'',
|
||||
visible: false,
|
||||
url: {
|
||||
add: 'com.jero.modules.extRepo/extRepoData/add',
|
||||
edit: 'com.jero.modules.extRepo/extRepoData/edit',
|
||||
},
|
||||
rules: {
|
||||
paramsTemplateName:[
|
||||
{ required: true, message: this.$t('PleaseEnter')+this.$t('parameterTemplate'), trigger: 'blur' },
|
||||
{ min:1, max: 50, message: this.$t('cantExeed')+'50'+this.$t('characters'), trigger: 'blur' },
|
||||
fileDescription:[
|
||||
// { required: true, message: this.$t('PleaseEnter')+this.$t('fileDeclaration'), trigger: 'blur' },
|
||||
{ min:1, max: 200, message: this.$t('cantExeed')+'200'+this.$t('characters'), trigger: 'blur' },
|
||||
],
|
||||
description:[
|
||||
{ min:1, max: 300, message: this.$t('cantExeed')+'300'+this.$t('characters'), trigger: 'blur' },
|
||||
fileKey: [
|
||||
{
|
||||
required: true,
|
||||
message: this.$t('fileName') + this.$t('cannotEmpty'),
|
||||
trigger: 'change'
|
||||
}
|
||||
],
|
||||
state: [
|
||||
{ required: true, message: this.$t('PleaseSelect')+this.$t('status'), trigger: 'change' },
|
||||
],
|
||||
region: [
|
||||
{ required: true, message: this.$t('PleaseSelect')+this.$t('zoneOfApplication'), trigger: 'change' },
|
||||
]
|
||||
},
|
||||
disabled: false,
|
||||
projectNameList: [],
|
||||
@@ -118,9 +122,11 @@ export default {
|
||||
}
|
||||
})
|
||||
},
|
||||
addModel() {
|
||||
addModel(menuId) {
|
||||
this.visible = true
|
||||
this.title = this.$t('UploadFile')
|
||||
this.disabled = false
|
||||
this.menuId = menuId
|
||||
this.formInline = {}
|
||||
this.$nextTick(() => {
|
||||
this.$refs['ruleForm'].clearValidate()
|
||||
@@ -129,20 +135,24 @@ export default {
|
||||
editModel(value) {
|
||||
this.visible = true
|
||||
this.title = this.$t('edit')
|
||||
this.disabled = true
|
||||
this.$nextTick(() => {
|
||||
this.formInline = value
|
||||
this.$refs['ruleForm'].clearValidate()
|
||||
})
|
||||
},
|
||||
handleCancel() {
|
||||
this.visible = false
|
||||
if(this.spinning == true){
|
||||
this.visible = true
|
||||
return
|
||||
}else{
|
||||
this.visible = false
|
||||
}
|
||||
},
|
||||
handleSubmit() {
|
||||
if(this.formInline.paramsTemplateName !== undefined) {
|
||||
this.formInline.paramsTemplateName = this.formInline.paramsTemplateName.trim()
|
||||
}
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
this.spinning = true
|
||||
let url = ''
|
||||
let Action
|
||||
if (this.formInline.id) {
|
||||
@@ -152,21 +162,23 @@ export default {
|
||||
url = this.url.add
|
||||
Action = postAction
|
||||
}
|
||||
this.formInline.supFolder = this.menuId
|
||||
let query = JSON.parse(JSON.stringify(this.formInline))
|
||||
Object.keys(query).forEach(res => {
|
||||
if (query[res] && query[res] instanceof Array) {
|
||||
query[res] = query[res].join(',')
|
||||
}
|
||||
})
|
||||
this.confirmLoading = true
|
||||
Action(url, query).then((res) => {
|
||||
if (res.success) {
|
||||
this.confirmLoading = false
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.spinning = false
|
||||
// this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.$message.success(res.message)
|
||||
this.visible = false
|
||||
this.$emit('addModelList')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.spinning = false
|
||||
this.$message.warning(res.message)
|
||||
this.confirmLoading = false
|
||||
}
|
||||
})
|
||||
@@ -186,6 +198,30 @@ export default {
|
||||
projectNameChange(value){
|
||||
console.log(value)
|
||||
},
|
||||
/** 上传文件的回调 */
|
||||
uploadSuccess(data) {
|
||||
let attIdList = []
|
||||
if (data && data.length > 0) {
|
||||
data.map(item => {
|
||||
attIdList.push(item.id || data.name)
|
||||
})
|
||||
}
|
||||
/** 赋值给当前对应的表单文件 */
|
||||
this.formInline[this.uploadName] = attIdList.join(',')
|
||||
this.formInline = { ...this.formInline }
|
||||
},
|
||||
clickButtonToUpload(item) {
|
||||
this.$refs.uploadFile.perentHandleFunc()
|
||||
this.$refs.uploadFile.visible = true
|
||||
this.uploadName = item
|
||||
getAction('sys/common/getFileInfos', { id: this.formInline[item] }).then((res) => {
|
||||
if (res.success) {
|
||||
this.$refs.uploadFile.perentHandleFunc(res.result)
|
||||
} else {
|
||||
this.$refs.uploadFile.perentHandleFunc()
|
||||
}
|
||||
})
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -306,4 +342,40 @@ export default {
|
||||
.ant-input-disabled {
|
||||
color: rgba(0, 0, 0, 0.65) !important;
|
||||
}
|
||||
</style>
|
||||
<style scoped lang="less">
|
||||
.loading-box {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: 9999900;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
border-radius: 8px;
|
||||
user-select: none;
|
||||
|
||||
.loading-content {
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
left: 50%;
|
||||
color: #21c9cc;
|
||||
transform: translate(-50%, -50%);
|
||||
text-align: center;
|
||||
|
||||
.loading {
|
||||
font-size: 28px;
|
||||
}
|
||||
|
||||
.spin-loading {
|
||||
animation: rotating 2s linear infinite;
|
||||
}
|
||||
|
||||
.loading-tips {
|
||||
margin-top: 5px;
|
||||
font-size: 16px;
|
||||
color: #21c9cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -8,7 +8,6 @@
|
||||
<a-input-search style="margin-bottom: 8px" :placeholder="$t('NodeQuickLookup')" @change="onLeftChange"
|
||||
@search="onSearch"/>
|
||||
<a-tree
|
||||
v-if="gData.length>0"
|
||||
:selected-keys="selectedKeys"
|
||||
:expanded-keys.sync="expandedKeys"
|
||||
:auto-expand-parent="autoExpandParent"
|
||||
@@ -44,17 +43,18 @@
|
||||
<template #overlay>
|
||||
<a-menu
|
||||
@click="({ key: menuKey }) => onContextMenuClick(treeKey, menuKey, record)">
|
||||
<a-menu-item key="1" @click="orgAdd" v-has="'split:sarFileSplitMenu:add'">{{$t('newNode')}}
|
||||
<a-menu-item key="1" @click="orgAdd" v-has="'externalReports:folder'">{{$t('Addingfolder')}}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="2" @click="orgEdit" v-has="'split:sarFileSplitMenu:update'">
|
||||
{{$t('modifyNode')}}
|
||||
<a-menu-item key="4" @click="orgAdds" v-if="deleteNode"
|
||||
v-has="'externalReports:folder'">{{$t('Addingsubfolders')}}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="2" @click="orgEdit" v-has="'externalReports:folder'">
|
||||
{{$t('Editfolder')}}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="3" @click="orgDelete"
|
||||
v-has="'split:sarFileSplitMenu:delete'">{{$t('deleteNode')}}
|
||||
</a-menu-item>
|
||||
<a-menu-item key="4" @click="orgDelete" v-if="deleteNode"
|
||||
v-has="'split:sarFileSplitMenu:delete'">{{$t('add')}}
|
||||
v-has="'externalReports:folder'">{{$t('Deletefolders')}}
|
||||
</a-menu-item>
|
||||
|
||||
</a-menu>
|
||||
</template>
|
||||
</a-dropdown>
|
||||
@@ -82,7 +82,7 @@
|
||||
<span>{{$t('uploadedBy')}}</span>
|
||||
</div>
|
||||
<a-input class="box-input" style='width: 264px' :placeholder="$t('PleaseEnter')+$t('uploadedBy')"
|
||||
v-model="queryParams.uploadedBy"></a-input>
|
||||
v-model="queryParams.createBy"></a-input>
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
@@ -90,13 +90,14 @@
|
||||
<div class="title-text" :title="$t('uploadTime')">
|
||||
<span>{{ $t('uploadTime') }}</span>
|
||||
</div>
|
||||
<a-date-picker class="box-input"
|
||||
<!-- :placeholder="$t('PleaseSelect')+$t('uploadTime')"-->
|
||||
<a-range-picker
|
||||
style='width: 264px'
|
||||
:placeholder="$t('PleaseSelect')+$t('uploadTime')"
|
||||
|
||||
@change="onChange"
|
||||
format="YYYY-MM-DD"
|
||||
:getCalendarContainer="(trigger) => trigger.parentNode"
|
||||
v-model="queryParams.uploadTime"
|
||||
v-model="queryParams.time"
|
||||
:disabled="false"/>
|
||||
</div>
|
||||
</a-col>
|
||||
@@ -115,11 +116,11 @@
|
||||
</div>
|
||||
<div class="table-operator" style="overflow:hidden;margin-bottom: 20px">
|
||||
<div style="float: right;margin-bottom: 0px;margin-left: 20px">
|
||||
<div class="operator-text" @click="handleuploadFile()">
|
||||
<div class="operator-text" @click="handleuploadFile()" v-if='authmanage'>
|
||||
<a-icon type="import"/>
|
||||
{{ $t('UploadFile') }}
|
||||
</div>
|
||||
<div class="operator-text" @click="handleDel()">
|
||||
<div class="operator-text" @click="handleDel()" v-if='authmanage'>
|
||||
<a-icon type="delete"/>
|
||||
{{ $t('BatchDelete') }}
|
||||
</div>
|
||||
@@ -143,10 +144,10 @@
|
||||
</a>
|
||||
</span>
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<a class="text-operation" @click="handlelist(record)">{{$t('view')}}</a>
|
||||
<!-- <a class="text-operation" @click="handlelist(record)">{{$t('view')}}</a>-->
|
||||
<a class="text-operation" @click="download(record)">{{$t('download')}}</a>
|
||||
<a class="text-operation" @click="handleEdit(record)">{{$t('edit')}}</a>
|
||||
<a class="text-operation" @click="batchDel(record)">{{$t('delete')}}</a>
|
||||
<a class="text-operation" @click="handleEdit(record)" v-if='authmanage'>{{$t('edit')}}</a>
|
||||
<a class="text-operation" @click="batchDel(record)" v-if='authmanage'>{{$t('delete')}}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
@@ -163,13 +164,14 @@
|
||||
/>
|
||||
</div>
|
||||
<!-- 上传文件-->
|
||||
<addModel :url="url" ref="addModelRef" @addModelList="addModelList"/>
|
||||
<addModel ref="addModelRef" @addModelList="addModelList"/>
|
||||
<!-- 文件详情-->
|
||||
<handleModel :url="url" ref="handleModelRef" />
|
||||
<!-- 添加节点-->
|
||||
<a-modal
|
||||
class="add-menus"
|
||||
:title="menuTitle"
|
||||
:width="600"
|
||||
:visible="menuRightVisible"
|
||||
:confirm-loading="confirmLoading"
|
||||
@cancel="handleCancelMenuRight"
|
||||
@@ -184,16 +186,28 @@
|
||||
:label-col="labelCol"
|
||||
:wrapper-col="wrapperCol"
|
||||
>
|
||||
<a-form-model-item :label="$t('clauseNo')" prop="name">
|
||||
<a-input v-model="form.name" :placeholder="$t('PleaseEnter')+$t('clauseNo')"/>
|
||||
<a-form-model-item :label="$t('Foldername')" prop="folderName">
|
||||
<a-input class="box-input add-input" v-model="form.folderName" :placeholder="$t('PleaseEnter')+$t('Foldername')"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="$t('clauseName')" prop="itemName">
|
||||
<a-input v-model="form.itemName" :placeholder="$t('PleaseEnter')+$t('clauseName')"/>
|
||||
<a-form-model-item :label="$t('Administrativeprivileges')" prop="authManageIdsName">
|
||||
<PersonnelSelection class="box-input add-input"
|
||||
:personneQuery="form"
|
||||
:query="{db_field_name:'authManageIds',db_field_txt:$t('Administrativeprivileges')}"
|
||||
@change="PersonnelSelectionChange"
|
||||
v-model="form.authManageIdsName"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="$t('serialNumber')" prop="displaySeq">
|
||||
<a-input-number v-model="form.displaySeq" :min="1" :max="99999"
|
||||
:placeholder="$t('PleaseEnter')+$t('serialNumber')" :formatter="limitNumber"
|
||||
:parser="limitNumber" style="width: 100%"/>
|
||||
<a-form-model-item :label="$t('Checkthepermissions')" prop="authViewIdsName">
|
||||
<PersonnelSelection
|
||||
class="box-input add-input"
|
||||
:personneQuery="form"
|
||||
:query="{db_field_name:'authViewIds',db_field_txt:$t('Checkthepermissions')}"
|
||||
@change="PersonnelSelectionChange"
|
||||
v-model="form.authViewIdsName"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="$t('Folderorder')" prop="orderId">
|
||||
<a-input-number v-model="form.orderId" :min="1" :max="99999" class="box-input add-input"
|
||||
:placeholder="$t('PleaseEnter')+$t('Folderorder')" :formatter="limitNumber"
|
||||
:parser="limitNumber" />
|
||||
<!-- <a-input-number v-model="rowCount" :min="1" :placeholder="$t('pleaseEnter')+$t('numberRows')" :formatter="limitNumber" :parser="limitNumber" />-->
|
||||
</a-form-model-item>
|
||||
</a-form-model>
|
||||
@@ -210,7 +224,7 @@
|
||||
<script>
|
||||
import addModel from './components/addModel'
|
||||
import handleModel from './components/handle'
|
||||
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
|
||||
import { getAction, postAction, downloadFile, deleteAction,putAction } from '@/api/manage'
|
||||
import globalAdvancedQuery from '@/components/globalAdvancedQuery/index'
|
||||
// import exportTree from '@/components/exportTree/index'
|
||||
import axios from 'axios'
|
||||
@@ -220,13 +234,14 @@ import Vue from 'vue'
|
||||
import moment from 'moment'
|
||||
import eventBUs from '@/common/event'
|
||||
import { mapGetters } from 'vuex'
|
||||
import PersonnelSelection from '@/components/PersonnelSelection/index'
|
||||
|
||||
export default {
|
||||
name: 'SplitDetail',
|
||||
components: {
|
||||
addModel,
|
||||
handleModel,
|
||||
// exportTree,
|
||||
PersonnelSelection,
|
||||
globalAdvancedQuery
|
||||
// ImportFile
|
||||
},
|
||||
@@ -242,6 +257,7 @@ export default {
|
||||
},
|
||||
pageSize: 10,
|
||||
pageNo: 1,
|
||||
disabled:false,
|
||||
total: 0,
|
||||
tableData: [],
|
||||
selectedRowKeys: [],
|
||||
@@ -266,16 +282,18 @@ export default {
|
||||
menuRightVisible: false,
|
||||
form: {},
|
||||
rules: {
|
||||
name: [
|
||||
{ required: true, message: this.$t('PleaseEnter') + this.$t('clauseNo'), trigger: 'blur' },
|
||||
{ min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' }
|
||||
folderName: [
|
||||
{ required: true, message: this.$t('PleaseEnter') + this.$t('Foldername'), trigger: 'blur' },
|
||||
{ min: 1, max: 50, message: this.$t('cantExeed') + '50' + this.$t('characters'), trigger: 'blur' }
|
||||
],
|
||||
itemName: [
|
||||
{ required: true, message: this.$t('PleaseEnter') + this.$t('clauseName'), trigger: 'blur' },
|
||||
{ min: 1, max: 200, message: this.$t('cantExeed') + '200' + this.$t('characters'), trigger: 'blur' }
|
||||
authManageIdsName: [
|
||||
{ required: true, message: this.$t('PleaseSelect') + this.$t('Administrativeprivileges'), trigger: 'change' },
|
||||
],
|
||||
displaySeq: [
|
||||
{ required: true, message: this.$t('PleaseEnter') + this.$t('serialNumber'), trigger: 'blur' }
|
||||
authViewIdsName: [
|
||||
{ required: true, message: this.$t('PleaseSelect') + this.$t('Checkthepermissions'), trigger: 'change' },
|
||||
],
|
||||
orderId: [
|
||||
{ required: true, message: this.$t('PleaseEnter') + this.$t('Folderorder'), trigger: 'blur' }
|
||||
// { min: 1, max: 99999, message: this.$t('cantExeed') + '99999' + this.$t('characters'), trigger: 'blur' },
|
||||
]
|
||||
},
|
||||
@@ -300,17 +318,17 @@ export default {
|
||||
{
|
||||
title: this.$t('fileName'),
|
||||
align: 'center',
|
||||
dataIndex: 'serialNumber',
|
||||
dataIndex: 'fileName',
|
||||
},
|
||||
{
|
||||
title: this.$t('fileDeclaration'),
|
||||
align: 'center',
|
||||
dataIndex: 'title',
|
||||
dataIndex: 'fileDescription',
|
||||
},
|
||||
{
|
||||
title: this.$t('uploadedBy'),
|
||||
align: 'center',
|
||||
dataIndex: 'state_dicText',
|
||||
dataIndex: 'createBy',
|
||||
},
|
||||
// {
|
||||
// title: this.$t('category'),
|
||||
@@ -320,7 +338,7 @@ export default {
|
||||
{
|
||||
title: this.$t('uploadTime'),
|
||||
align: 'center',
|
||||
dataIndex: 'technologyTerritory_dicText',
|
||||
dataIndex: 'createTime',
|
||||
width: 250
|
||||
},
|
||||
{
|
||||
@@ -332,7 +350,7 @@ export default {
|
||||
}
|
||||
],
|
||||
url: {
|
||||
list: 'project/lawsComplianceBoard/page',
|
||||
list: 'com.jero.modules.extRepo/extRepoData/page',
|
||||
getSysCategoryTree: '/sys/category/getSysCategoryTree',
|
||||
},
|
||||
ids: '',
|
||||
@@ -341,6 +359,7 @@ export default {
|
||||
uploadMenuId: '',
|
||||
selectedKeys: [],
|
||||
deleteNode: false,
|
||||
authmanage:false,
|
||||
fullWidth: '',
|
||||
parameter: {},
|
||||
widthBrown: '',
|
||||
@@ -362,28 +381,11 @@ export default {
|
||||
const that = this
|
||||
let client = ''
|
||||
let width = ''
|
||||
// this.widthBrown = window.screenWidth || document.body.clientWidth;
|
||||
// let iframeTop= document.querySelector('.split-detail-left').getBoundingClientRect().top
|
||||
// document.querySelector('.split-detail-left').style.height = this.brownHeight-iframeTop-24 + 'px'
|
||||
// console.log(iframeTop,'iframeTop2222')
|
||||
// document.querySelector('.split-detail-table .ant-table-content').style.width = width - 20 + 'px'
|
||||
// window.addEventListener('resize', () => {
|
||||
// that.screenWidth = window.screenWidth || document.body.clientWidth;
|
||||
// client = document.querySelector('.split-detail-table .ant-table-content').getBoundingClientRect()
|
||||
// // console.log('screenWidth',that.screenWidth)
|
||||
// width = that.screenWidth - client.left
|
||||
// document.querySelector('.split-detail-table .ant-table-content').style.width = width - 20 + 'px'
|
||||
// iframeTop= document.querySelector('.split-detail-left').getBoundingClientRect().top
|
||||
// console.log(iframeTop,'iframeTop111')
|
||||
// document.querySelector('.split-detail-left').style.height = this.brownHeight-iframeTop-24 + 'px'
|
||||
// }, false);
|
||||
|
||||
|
||||
this.userData = this.userInfo()
|
||||
this.infoId = this.$route.query.infoId
|
||||
console.log('info', this.$route.query)
|
||||
// this.infoId = this.$route.query.infoId
|
||||
// console.log('info', this.$route.query)
|
||||
this.loadMenuData()
|
||||
this.loadData()
|
||||
// this.loadData()
|
||||
this.generateList(this.gData)
|
||||
},
|
||||
methods: {
|
||||
@@ -393,6 +395,11 @@ export default {
|
||||
this.contentVisible = true
|
||||
this.contentValue = val
|
||||
},
|
||||
PersonnelSelectionChange(value, id) {
|
||||
this.form[value] = id
|
||||
this.form = { ...this.form }
|
||||
console.log(this.form)
|
||||
},
|
||||
//关闭条款内容弹框
|
||||
handleCancel() {
|
||||
this.contentVisible = false
|
||||
@@ -446,13 +453,21 @@ export default {
|
||||
},
|
||||
//获取左侧目录数据
|
||||
loadMenuData() {
|
||||
let params = {
|
||||
infoId: this.infoId
|
||||
}
|
||||
// let params = {
|
||||
// infoId: this.infoId
|
||||
// }
|
||||
this.loading = true
|
||||
getAction(`split/sarFileSplitMenu/getSplitMenusByInfoId`, params).then(res => {
|
||||
getAction(`extRepo/extRepoFolder/list`, {}).then(res => {
|
||||
if (res.success) {
|
||||
this.data = this.toTree(res.result)
|
||||
// this.data = this.toTree(res.result)
|
||||
this.data = res.result
|
||||
this.menuId = this.data[0].key
|
||||
console.log(this.menuId)
|
||||
let queryParam = {
|
||||
supFolder: this.menuId
|
||||
|
||||
}
|
||||
this.loadData(JSON.parse(JSON.stringify(queryParam)))
|
||||
this.gData = [...this.data]
|
||||
Object.assign(this, {
|
||||
expandedKeys: this.expandedKeys,
|
||||
@@ -464,51 +479,54 @@ export default {
|
||||
})
|
||||
},
|
||||
//将数据拼成树形结构
|
||||
toTree(config) {
|
||||
// 删除 所有 children,以防止多次调用
|
||||
config.forEach(function(item) {
|
||||
delete item.children
|
||||
})
|
||||
// 将数据存储为 以 id 为 KEY 的 map 索引数据列
|
||||
let map = {}
|
||||
config.forEach((item) => {
|
||||
item.label = item.name
|
||||
item.key = item.id
|
||||
item.title = item.name + (item.itemName ? ' ' + item.itemName : '')
|
||||
map[item.id] = item
|
||||
})
|
||||
let val = []
|
||||
config.forEach((item) => {
|
||||
// 以当前遍历项,的pid,去map对象中找到索引的id
|
||||
let parent = map[item.pid]
|
||||
// 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中
|
||||
if (parent) {
|
||||
(parent.children || (parent.children = [])).push(item)
|
||||
} else {
|
||||
//如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中,作为顶级
|
||||
val.push(item)
|
||||
}
|
||||
})
|
||||
return val
|
||||
},
|
||||
// toTree(config) {
|
||||
// // 删除 所有 children,以防止多次调用
|
||||
// config.forEach(function(item) {
|
||||
// delete item.children
|
||||
// })
|
||||
// // 将数据存储为 以 id 为 KEY 的 map 索引数据列
|
||||
// let map = {}
|
||||
// config.forEach((item) => {
|
||||
// item.label = item.title
|
||||
// item.key = item.key
|
||||
// item.title = item.title
|
||||
// map[item.key] = item
|
||||
// })
|
||||
// let val = []
|
||||
// config.forEach((item) => {
|
||||
// // 以当前遍历项,的pid,去map对象中找到索引的id
|
||||
// let parent = map[item.orderId]
|
||||
// // 如果找到索引,那么说明此项不在顶级当中,那么需要把此项添加到,他对应的父级中
|
||||
// if (parent) {
|
||||
// (parent.children || (parent.children = [])).push(item)
|
||||
// } else {
|
||||
// //如果没有在map中找到对应的索引ID,那么直接把 当前的item添加到 val结果集中,作为顶级
|
||||
// val.push(item)
|
||||
// }
|
||||
// })
|
||||
// return val
|
||||
// },
|
||||
//鼠标右键
|
||||
rightClick({ event, node }) {
|
||||
|
||||
this.deleteNode = node._props.dataRef.pid ? false : true
|
||||
this.deleteNode = node._props.dataRef.level == 4 ? false : true
|
||||
// console.log('eee',event,node)
|
||||
// this.NodeTreeItemVisible=true
|
||||
const x =
|
||||
event.currentTarget.offsetLeft + event.currentTarget.clientWidth
|
||||
const y = event.currentTarget.offsetTop
|
||||
console.log(node._props.dataRef)
|
||||
this.NodeTreeItem = {
|
||||
pageX: x,
|
||||
pageY: y,
|
||||
id: node._props.dataRef.id,
|
||||
name: node._props.dataRef.name,
|
||||
itemName: node._props.dataRef.itemName,
|
||||
displaySeq: node._props.dataRef.displaySeq,
|
||||
authManageIdsName: node._props.dataRef.authManageIdsName,
|
||||
authViewIds: node._props.dataRef.authViewIds,
|
||||
key: node._props.dataRef.key,
|
||||
authManageIds: node._props.dataRef.authManageIds,
|
||||
authViewIdsName: node._props.dataRef.authViewIdsName,
|
||||
title: node._props.dataRef.title,
|
||||
pid: node._props.dataRef.pid || null
|
||||
folderName: node._props.dataRef.folderName,
|
||||
orderId: node._props.dataRef.orderId,
|
||||
}
|
||||
this.nodeItem = JSON.parse(JSON.stringify(this.NodeTreeItem))
|
||||
// this.form.pid=this.NodeTreeItem.id
|
||||
@@ -535,12 +553,10 @@ export default {
|
||||
this.uploadMenuId = selectedKeys[0]
|
||||
this.selectedKeys = selectedKeys
|
||||
let queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
supFolder: this.menuId
|
||||
|
||||
}
|
||||
this.parameter.info_id = this.infoId
|
||||
this.parameter.menu_id = this.menuId
|
||||
this.parameter.supFolder = this.menuId
|
||||
// eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
@@ -549,21 +565,34 @@ export default {
|
||||
},
|
||||
//树形新增
|
||||
orgAdd() {
|
||||
this.menuTitle = this.$t('add')
|
||||
this.menuTitle = this.$t('Addingfolder')
|
||||
this.isEdit = false
|
||||
this.form = {}
|
||||
let supFolder = ''
|
||||
this.supFolder = this.nodeItem.key
|
||||
this.menuRightVisible = true
|
||||
|
||||
},
|
||||
orgAdds(){
|
||||
this.menuTitle = this.$t('Addingsubfolders')
|
||||
this.isEdit = false
|
||||
this.form = {}
|
||||
let supFolder = ''
|
||||
this.supFolder = this.nodeItem.key
|
||||
this.menuRightVisible = true
|
||||
},
|
||||
//树形修改
|
||||
orgEdit() {
|
||||
this.menuTitle = this.$t('edit')
|
||||
this.menuTitle = this.$t('Editfolder')
|
||||
this.isEdit = true
|
||||
this.form.id = this.nodeItem.id
|
||||
this.form.pid = this.nodeItem.pid
|
||||
this.form.name = this.nodeItem.name
|
||||
this.form.itemName = this.nodeItem.itemName
|
||||
this.form.displaySeq = this.nodeItem.displaySeq
|
||||
let supFolder = ''
|
||||
this.form.id = this.nodeItem.key
|
||||
this.form.authManageIds = this.nodeItem.authManageIds
|
||||
this.form.authViewIds = this.nodeItem.authViewIds
|
||||
this.form.authManageIdsName = this.nodeItem.authManageIdsName
|
||||
this.form.authViewIdsName = this.nodeItem.authViewIdsName
|
||||
this.form.folderName = this.nodeItem.folderName
|
||||
this.form.orderId = this.nodeItem.orderId
|
||||
this.menuRightVisible = true
|
||||
},
|
||||
//树形删除
|
||||
@@ -572,20 +601,19 @@ export default {
|
||||
content: this.$t('deleteNodes'),
|
||||
onOk:
|
||||
async () => {
|
||||
getAction(`split/sarFileSplitMenu/deleteMenu`, { id: this.nodeItem.id }).then(res => {
|
||||
deleteAction(`extRepo/extRepoFolder/delete`, { id: this.nodeItem.key }).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.$message.success(res.message)
|
||||
this.loadMenuData()
|
||||
let queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
supFolder: this.menuId
|
||||
|
||||
}
|
||||
// eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -603,62 +631,56 @@ export default {
|
||||
handleCancelMenuRight() {
|
||||
this.menuRightVisible = false
|
||||
},
|
||||
//增加条款确定
|
||||
//增加文件夹确定
|
||||
hideModalMenuRight() {
|
||||
|
||||
let expandId = []
|
||||
expandId.push(this.form.pid)
|
||||
if (!this.isEdit) {
|
||||
let params = {
|
||||
infoId: this.infoId,
|
||||
pid: this.nodeItem.id,
|
||||
...this.form
|
||||
}
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
// console.log('parms',this.params)
|
||||
if (!this.flag) {
|
||||
this.flag = true
|
||||
postAction(`split/sarFileSplitMenu/addMenu`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.menuRightVisible = false
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
// this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.expandedKeys.push(this.nodeItem.id)
|
||||
// console.log('expandedKeys1111',this.expandedKeys)
|
||||
this.loadMenuData()
|
||||
let queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
|
||||
}
|
||||
// eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
}).finally(() => {
|
||||
this.flag = false
|
||||
this.menuRightVisible = false
|
||||
})
|
||||
}
|
||||
let params = {
|
||||
supFolder: this.supFolder,
|
||||
...this.form
|
||||
}
|
||||
})
|
||||
this.$refs.ruleForm.validate(valid => {
|
||||
if (valid) {
|
||||
|
||||
// console.log('parms',this.params)
|
||||
if (!this.flag) {
|
||||
this.flag = true
|
||||
postAction(`extRepo/extRepoFolder/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.menuRightVisible = false
|
||||
this.$message.success(res.message)
|
||||
// this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.expandedKeys.push(this.nodeItem.id)
|
||||
// console.log('expandedKeys1111',this.expandedKeys)
|
||||
this.loadMenuData()
|
||||
let queryParam = {
|
||||
supFolder: this.menuId
|
||||
|
||||
}
|
||||
// eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.flag = false
|
||||
this.menuRightVisible = false
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
} else {
|
||||
let params = {
|
||||
info_id: this.infoId,
|
||||
...this.form
|
||||
}
|
||||
if (!this.flag) {
|
||||
this.flag = true
|
||||
// console.log('parms',params)
|
||||
putAction(`split/sarFileSplitMenu/updateMenu`, params).then(res => {
|
||||
putAction(`extRepo/extRepoFolder/edit`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.loadMenuData()
|
||||
} else {
|
||||
@@ -677,20 +699,25 @@ export default {
|
||||
},
|
||||
addModelList() {
|
||||
this.pageNo = 1
|
||||
this.loadData()
|
||||
let queryParam = {
|
||||
supFolder: this.menuId
|
||||
|
||||
}
|
||||
this.loadData(JSON.parse(JSON.stringify(queryParam)))
|
||||
},
|
||||
//获取列表数据
|
||||
loadData(item) {
|
||||
this.queryParams.supFolder = this.menuId
|
||||
let params = {
|
||||
...this.queryParams,
|
||||
...item,
|
||||
info_id: this.infoId
|
||||
}
|
||||
this.loading = true
|
||||
postAction(this.url.list, params).then(res => {
|
||||
getAction(this.url.list, params).then(res => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.records || []
|
||||
this.total = res.result.total
|
||||
this.dataSource = res.result.pageList.records || []
|
||||
this.authmanage =res.result.auth_manage
|
||||
this.total = res.result.pageList.total
|
||||
this.loading = false
|
||||
}
|
||||
})
|
||||
@@ -698,6 +725,9 @@ export default {
|
||||
//搜索
|
||||
searchQuery(item) {
|
||||
this.pageNo = 1
|
||||
if(this.queryParams.time){
|
||||
this.queryParams.time = this.queryParams.time.join(',')
|
||||
}
|
||||
this.loadData(item)
|
||||
},
|
||||
//清空
|
||||
@@ -737,8 +767,7 @@ export default {
|
||||
// console.log('data111',data)
|
||||
if (status === 'success') {
|
||||
let queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
supFolder: this.menuId
|
||||
|
||||
}
|
||||
this.loadMenuData()
|
||||
@@ -766,25 +795,15 @@ export default {
|
||||
this.parameter.info_id = this.infoId
|
||||
this.parameter.menu_id = this.menuId
|
||||
},
|
||||
//导出
|
||||
handleExportManage() {
|
||||
if (JSON.stringify(this.parameter) == '{}') {
|
||||
this.parameter.info_id = this.infoId
|
||||
this.parameter.menu_id = this.menuId
|
||||
onChange(value,dateString){
|
||||
if (this.queryParams.time && this.queryParams.time.length > 0) {
|
||||
let dateOne = moment(dateString[0]).format('YYYY-MM-DD')
|
||||
let dateTwo = moment(dateString[1]).format('YYYY-MM-DD')
|
||||
this.queryParams.time = [dateOne, dateTwo]
|
||||
} else {
|
||||
this.queryParams.time = []
|
||||
// this.queryParamOne[item + '_name'] = []
|
||||
}
|
||||
// console.log('menuId',this.menuId)
|
||||
let dateName = moment(new Date()).format('YYYY-MM-DD HH-mm-ss')
|
||||
let name = this.$route.query.infoNumber + ' ' + dateName + '.zip'
|
||||
let query = {
|
||||
exportName: this.$route.query.infoNumber + ' ' + dateName,
|
||||
idList: this.selectedRowKeys.join(','),
|
||||
parameter: this.parameter
|
||||
}
|
||||
|
||||
downloadFile('split/sarFileSplitItems/exportSplitInfoZip', name, query, this.selectClear)
|
||||
},
|
||||
onChange(){
|
||||
|
||||
},
|
||||
selectClear() {
|
||||
this.$refs.splitDetailTabel.selectedRowKeys = []
|
||||
@@ -800,18 +819,30 @@ export default {
|
||||
handleEdit(item) {
|
||||
this.$refs.addModelRef.editModel(JSON.parse(JSON.stringify(item)))
|
||||
},
|
||||
//下载
|
||||
download(item){
|
||||
let query = {
|
||||
id: item.fileKey
|
||||
}
|
||||
downloadFile('/sys/common/downLoadFile', item.fileName, query, this.Deselect)
|
||||
},
|
||||
//删除
|
||||
batchDel(val) {
|
||||
console.log(this.menuId)
|
||||
let _this = this
|
||||
this.$confirm({
|
||||
content: _this.$t('ConfirmDelete'),
|
||||
onOk() {
|
||||
getAction(_this.url.deleteBatch, { id: val.id }).then((res) => {
|
||||
let queryParam = {
|
||||
supFolder: _this.menuId
|
||||
}
|
||||
deleteAction('com.jero.modules.extRepo/extRepoData/delete', { id: val.id }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.getList()
|
||||
_this.$message.success(res.message)
|
||||
|
||||
_this.loadData(JSON.parse(JSON.stringify(queryParam)))
|
||||
} else {
|
||||
_this.$message.warning(_this.$t('operationFailed'))
|
||||
_this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -825,11 +856,16 @@ export default {
|
||||
content: _this.$t('ConfirmBatchDeletion'),
|
||||
onOk() {
|
||||
let idList = JSON.parse(JSON.stringify(_this.selectedRowKeys))
|
||||
getAction(_this.url.deleteBatch, { ids: idList.join(',') }).then((res) => {
|
||||
let queryParam = {
|
||||
supFolder: _this.menuId
|
||||
|
||||
}
|
||||
deleteAction('com.jero.modules.extRepo/extRepoData/deleteBatch', { ids: idList.join(',') }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.$message.success(res.message)
|
||||
_this.selectedRowKeys = []
|
||||
_this.getList()
|
||||
|
||||
_this.loadData(JSON.parse(JSON.stringify(queryParam)))
|
||||
} else {
|
||||
_this.$message.warning(res.message)
|
||||
}
|
||||
@@ -844,72 +880,6 @@ export default {
|
||||
sumber() {
|
||||
this.loadMenuData()
|
||||
},
|
||||
//删除
|
||||
deleteClick(val) {
|
||||
let params = {
|
||||
ids: val.id
|
||||
}
|
||||
this.$confirm({
|
||||
title: this.$t('areYouSure'),
|
||||
content: '',
|
||||
onOk:
|
||||
async () => {
|
||||
axios({
|
||||
url: '/jero-boot/split/sarFileSplitItems/batchDeleteItems',
|
||||
method: 'post',
|
||||
data: params,
|
||||
transformRequest: [function(data) {
|
||||
// Do whatever you want to transform the data
|
||||
let ret = ''
|
||||
for (let it in data) {
|
||||
ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
|
||||
}
|
||||
return ret
|
||||
}],
|
||||
headers: {
|
||||
'Content-Type': 'application/x-www-form-urlencoded',
|
||||
'X-Access-Token': this.token
|
||||
}
|
||||
})
|
||||
.then((res) => {
|
||||
if (res.data.success) {
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.loadMenuData()
|
||||
let queryParam = {
|
||||
menu_id: this.menuId,
|
||||
info_id: this.infoId
|
||||
|
||||
}
|
||||
// eventBUs.$emit('searchQuery', JSON.parse(JSON.stringify(queryParam)))
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.log(error)
|
||||
})
|
||||
|
||||
|
||||
// postAction(`split/sarFileSplitItems/batchDeleteItems`,params).then(res=> {
|
||||
// if(res.success){
|
||||
// this.$message.success(this.$t('OperationSuccessful'))
|
||||
// // if(this.selecIds.length==this.tableData.length&&this.queryParams.pageNo!=1){
|
||||
// // this.queryParams.pageNo=this.queryParams.pageNo-1
|
||||
// // }
|
||||
// // this.loadData()
|
||||
// this.loadMenuData()
|
||||
// eventBUs.$emit('searchReset')
|
||||
// }else{
|
||||
// this.$message.warning(this.$t('operationFailed'))
|
||||
// }
|
||||
// })
|
||||
},
|
||||
onCancel() {
|
||||
}
|
||||
})
|
||||
},
|
||||
//选择框
|
||||
onSelectChange(selectedRowKeys, rows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
@@ -930,7 +900,12 @@ export default {
|
||||
},
|
||||
// 上传文件
|
||||
handleuploadFile(e) {
|
||||
this.$refs.addModelRef.addModel()
|
||||
if (this.menuId) {
|
||||
this.$refs.addModelRef.addModel(this.menuId)
|
||||
} else {
|
||||
this.$message.warning(this.$t('selectDirectorylocation'))
|
||||
}
|
||||
|
||||
},
|
||||
onSearch() {
|
||||
let self = this
|
||||
|
||||
@@ -48,8 +48,8 @@
|
||||
</a>
|
||||
</span>
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<a class="text-operation" @click="handlecody(record)">{{$t('Exporthistory')}}</a>
|
||||
<a class="text-operation" @click="deleteLib(record)">{{$t('See')}}</a>
|
||||
<a class="text-operation" @click="handlecody(record)" v-has="'params:report:history'">{{$t('Exporthistory')}}</a>
|
||||
<a class="text-operation" @click="deleteLib(record)" v-has="'report:detail:list'">{{$t('See')}}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('certificationCategory')">
|
||||
<span class="Required">*</span>
|
||||
<span>{{$t('certificationCategory')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="certCategory">
|
||||
@@ -35,6 +36,7 @@
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text" :title="$t('configure')">
|
||||
<span class="Required">*</span>
|
||||
<span>{{$t('configure')}}</span>
|
||||
</div>
|
||||
<a-form-model-item class="itemModel" prop="configIds">
|
||||
@@ -59,6 +61,7 @@
|
||||
<a-col :span="12">
|
||||
<div class="box-title-text">
|
||||
<div class="title-text">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
:title="$t('WhetherMergeParameters')">{{$t('WhetherMergeParameters')}}</span>
|
||||
</div>
|
||||
|
||||
@@ -81,11 +81,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<div @click="ConventionalExport" class="operator-text" v-has="'params:template:add'">
|
||||
<div @click="ConventionalExport" class="operator-text" v-has="'report:detail:export:normal'">
|
||||
<!-- <a-icon type="plus"/>-->
|
||||
{{$t('ConventionalExport')}}
|
||||
</div>
|
||||
<div @click="CustomExport" class="operator-text" v-has="'params:template:delete'">
|
||||
<div @click="CustomExport" class="operator-text" v-has="'report:detail:export:custom'">
|
||||
<!-- <a-icon type="delete"/>-->
|
||||
{{$t('CustomExport')}}
|
||||
</div>
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
</a-form>
|
||||
</div>
|
||||
<div class="table-operator">
|
||||
<div @click="handleAdd" class="operator-text" v-has="'params:template:add'">
|
||||
<div @click="handleAdd" class="operator-text" v-has="'report:exportTemplate:add'">
|
||||
<a-icon type="plus"/>
|
||||
{{$t('newlyAdded')}}
|
||||
</div>
|
||||
<div @click="handleDel" class="operator-text" v-has="'params:template:delete'">
|
||||
<div @click="handleDel" class="operator-text" v-has="'report:exportTemplate:deleteBatch'">
|
||||
<a-icon type="delete"/>
|
||||
{{$t('BatchDelete')}}
|
||||
</div>
|
||||
@@ -47,8 +47,8 @@
|
||||
{{ text && text.length > 100 ? text.slice(0, 99) + '...' : text }}
|
||||
</span>
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<a class="text-operation" v-has="'params:template:edit'" @click="edit(record)">{{$t('edit')}}</a>
|
||||
<a class="text-operation" v-has="'params:template:delete'" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
|
||||
<a class="text-operation" v-has="'report:exportTemplate:edit'" @click="edit(record)">{{$t('edit')}}</a>
|
||||
<a class="text-operation" v-has="'report:exportTemplate:delete'" @click="deleteLib(record)">{{$t('deleteLib')}}</a>
|
||||
</span>
|
||||
</a-table>
|
||||
</div>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="Virtual-detail-header" style="position: fixed;top: 0">
|
||||
<div class="Virtual-detail-title">
|
||||
<span>
|
||||
{{$t('ParameteItemCollectionList')}}({{$t(this.$route.query.projectName)}}) — {{$t(this.paramsManifest.title)}}
|
||||
{{$t('ParameteItemCollectionList')}}({{$t(this.$route.query.projectName)}}) — {{$t(this.$route.query.title)}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@@ -108,7 +108,7 @@
|
||||
<!-- // R&H Manager manager-->
|
||||
<!-- // 系统管理员 admin-->
|
||||
<!-- // 游客 guest-->
|
||||
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight" v-if='currentPersonRole == "homo" || currentPersonRole == "sdt"'>
|
||||
<a-popconfirm overlayClassName='popconfirm' placement="bottomRight" v-if='currentPersonRole == "homo"'>
|
||||
<template slot="title" id="popconfirm">
|
||||
<!-- 添加-->
|
||||
<div @click="handleAdd" class="operator-text-title" v-if='currentPersonRole == "homo"'>
|
||||
@@ -121,10 +121,9 @@
|
||||
<!-- {{$t('distributionAndCollection')}}-->
|
||||
<!-- </div>-->
|
||||
<!-- 导出-->
|
||||
<div @click="handleExport" class="operator-text-title"
|
||||
v-if='currentPersonRole == "homo" || currentPersonRole == "sdt"'>
|
||||
<div @click="handleExport" class="operator-text-title" v-if='currentPersonRole == "homo"'>
|
||||
<a-icon type="export"/>
|
||||
{{$t('export')}}
|
||||
{{$t('dataExport')}}
|
||||
</div>
|
||||
<!-- 一键下发收集 -->
|
||||
<div @click="defOneclickCollection" class="operator-text-title" v-if='currentPersonRole == "homo"'>
|
||||
@@ -171,6 +170,11 @@
|
||||
<a-icon type="copy"/>
|
||||
{{$t('Assignedby')}}
|
||||
</div>
|
||||
<!-- 导出-->
|
||||
<div @click="handleExport" class="operator-text" v-if='currentPersonRole == "sdt"'>
|
||||
<a-icon type="export"/>
|
||||
{{$t('dataExport')}}
|
||||
</div>
|
||||
<!-- 引用参数-->
|
||||
<div @click="referenceparameter" class="operator-text" v-if='currentPersonRole == "dre" '>
|
||||
<a-icon type="plus"/>
|
||||
@@ -194,7 +198,7 @@
|
||||
</div>
|
||||
<!-- 强制撤回-->
|
||||
<div @click="compulsoryWithdrawaljurisdiction" class="operator-text"
|
||||
v-if='currentPersonRole == "homo" || currentPersonRole == "sdt" ||currentPersonRole == "dre"'>
|
||||
v-if='currentPersonRole == "homo" || currentPersonRole == "sdt"'>
|
||||
<a-icon type="delete"/>
|
||||
{{$t('CompulsoryWithdrawal')}}
|
||||
</div>
|
||||
@@ -204,7 +208,7 @@
|
||||
v-if="!this.$route.query.it"
|
||||
@click="roleSwitchingClick">
|
||||
<a-icon type="select"/>
|
||||
{{ $t('roleSwitching') }}
|
||||
{{ $t('roleSwitching') }} ({{ $t(this.rolename)}})
|
||||
</div>
|
||||
</div>
|
||||
<div style="width: 100%">
|
||||
@@ -584,6 +588,7 @@
|
||||
configureareaVisible: false, // 配置的彈框
|
||||
pageNo: 1,
|
||||
pageSize: 10,
|
||||
rolename:'',
|
||||
total: 0,
|
||||
selectedRowKeysArray: '',
|
||||
templatetitle: '',
|
||||
@@ -643,7 +648,6 @@
|
||||
mounted() {
|
||||
this.GetgetLoginUserType()
|
||||
console.log(this.currentPersonRole)
|
||||
// this.LoginUserType()
|
||||
setTimeout(() => {
|
||||
if (this.currentPersonRole == 'dre') {
|
||||
this.handlePreservation()
|
||||
@@ -690,6 +694,11 @@
|
||||
this.visibleRoleSwitching = false
|
||||
this.confirmLoadingRoleSwitching = false
|
||||
localStorage.setItem('currentPersonRole', JSON.stringify(this.formInlineRoleSwitching.roleSwitchingCode))
|
||||
this.RoleType.forEach((item,index) => {
|
||||
if(item.value == this.currentPersonRole){
|
||||
this.rolename = item.label
|
||||
}
|
||||
})
|
||||
this.selectedRowKeysValue = []
|
||||
} else {
|
||||
this.confirmLoadingRoleSwitching = false
|
||||
@@ -1025,6 +1034,11 @@
|
||||
this.currentPersonRole = currentPersonRole || userType || val[0].value
|
||||
}
|
||||
this.RoleType = val
|
||||
this.RoleType.forEach((item,index) => {
|
||||
if(item.value == this.currentPersonRole){
|
||||
this.rolename = item.label
|
||||
}
|
||||
})
|
||||
this.formInlineRoleSwitching.roleSwitchingCode = currentPersonRole || userType || val[0].value
|
||||
this.formInlineRoleSwitching = { ...this.formInlineRoleSwitching }
|
||||
},
|
||||
@@ -1088,6 +1102,7 @@
|
||||
_this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.areaVisibleFreeze = false
|
||||
this.$refs.CollectionTabel.getTableList()
|
||||
this.$refs.CollectionTabel.getHeader()
|
||||
} else {
|
||||
this.textLoading = false
|
||||
_this.$message.warning(this.$t('operationFailed'))
|
||||
@@ -1103,7 +1118,7 @@
|
||||
},
|
||||
getFreeze(callback) {
|
||||
let _this = this
|
||||
let param = { paramsManifestId: this.paramsManifest.id, configFlag: 1 }
|
||||
let param = { paramsManifestId: this.$route.query.id, configFlag: 1 }
|
||||
axios({
|
||||
url: '/jero-boot/params/collectManifest/getConfigLableList',
|
||||
method: 'post',
|
||||
@@ -1659,7 +1674,6 @@
|
||||
cursor: pointer;
|
||||
border-radius: 4px;
|
||||
}
|
||||
|
||||
.operator-text-title {
|
||||
cursor: pointer;
|
||||
margin-right: 22px;
|
||||
@@ -1808,4 +1822,9 @@
|
||||
.text-wraning{
|
||||
word-break: break-word;
|
||||
}
|
||||
</style>
|
||||
<style lang='less'>
|
||||
.ant-popover-message-title{
|
||||
margin-bottom: -30px;
|
||||
}
|
||||
</style>
|
||||
@@ -33,9 +33,9 @@
|
||||
</div>
|
||||
</a-col>
|
||||
<a-col :md="6" :sm="8">
|
||||
<div class="box-title-text">
|
||||
<div class="box-title-text tree-select">
|
||||
<div class="title-text" :title="$t('technicalField')">
|
||||
<span>{{ $t('technicalField') }}</span>
|
||||
<span>{{$t('technicalField')}}</span>
|
||||
</div>
|
||||
<a-tree-select
|
||||
tree-node-filter-prop="title"
|
||||
@@ -48,10 +48,6 @@
|
||||
tree-checkable
|
||||
:placeholder="$t('PleaseSelect')+$t('technicalField')"
|
||||
/>
|
||||
<!-- <j-dict-select-tag class="box-input" v-model="queryParam.technologyTerritory"-->
|
||||
<!-- :placeholder="$t('PleaseSelect')+$t('technicalField')"-->
|
||||
<!-- :type="'select'"-->
|
||||
<!-- :triggerChange="false" :dictCode="'duty_territory'"/>-->
|
||||
</div>
|
||||
</a-col>
|
||||
<span style="float: right;overflow: hidden;margin-right: 11px" class="table-page-search-submitButtons">
|
||||
|
||||
Reference in New Issue
Block a user