Merge remote-tracking branch 'origin/dev_third_stage' into dev_third_stage
This commit is contained in:
+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",
|
||||
|
||||
+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() {
|
||||
|
||||
|
||||
+57
-8
@@ -18,18 +18,22 @@
|
||||
<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" class="detail-text-iframe" frameborder="0"></iframe>
|
||||
<iframe :src="detailUrlRight" @load="detailUrlrightLoad" class="detail-text-iframe"
|
||||
frameborder="0"></iframe>
|
||||
</div>
|
||||
<JLoading :loading="loadingRight">{{$t('dataLoading')}}</JLoading>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -39,6 +43,10 @@
|
||||
|
||||
<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',
|
||||
@@ -46,6 +54,8 @@
|
||||
return {
|
||||
detailUrlLeft: '',
|
||||
detailUrlRight: '',
|
||||
loadingLeft: false,
|
||||
loadingRight: false,
|
||||
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
|
||||
fileQuery: {}
|
||||
}
|
||||
@@ -53,13 +63,6 @@
|
||||
mounted() {
|
||||
this.fileQuery = this.$route.query
|
||||
this.onlinePreview()
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
this.$refs.iframeLeft.contentWindow.document.body.style = 'background-color:#fff'
|
||||
console.log(this.$refs.iframeLeft.contentWindow.document.body.style.backgroundColor)
|
||||
})
|
||||
}, 2000)
|
||||
|
||||
},
|
||||
methods: {
|
||||
Fallback() {
|
||||
@@ -67,13 +70,57 @@
|
||||
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()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -126,9 +173,11 @@
|
||||
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;
|
||||
|
||||
@@ -90,9 +90,10 @@
|
||||
<div class="title-text" :title="$t('uploadTime')">
|
||||
<span>{{ $t('uploadTime') }}</span>
|
||||
</div>
|
||||
<!-- :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"
|
||||
@@ -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>
|
||||
@@ -145,8 +146,8 @@
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<!-- <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>
|
||||
@@ -188,20 +189,20 @@
|
||||
<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('Administrativeprivileges')" prop="authManage">
|
||||
<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.authManage"/>
|
||||
v-model="form.authManageIdsName"/>
|
||||
</a-form-model-item>
|
||||
<a-form-model-item :label="$t('Checkthepermissions')" prop="authView">
|
||||
<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.authView"/>
|
||||
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"
|
||||
@@ -285,10 +286,10 @@ export default {
|
||||
{ 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' }
|
||||
],
|
||||
authManage: [
|
||||
authManageIdsName: [
|
||||
{ required: true, message: this.$t('PleaseSelect') + this.$t('Administrativeprivileges'), trigger: 'change' },
|
||||
],
|
||||
authView: [
|
||||
authViewIdsName: [
|
||||
{ required: true, message: this.$t('PleaseSelect') + this.$t('Checkthepermissions'), trigger: 'change' },
|
||||
],
|
||||
orderId: [
|
||||
@@ -358,6 +359,7 @@ export default {
|
||||
uploadMenuId: '',
|
||||
selectedKeys: [],
|
||||
deleteNode: false,
|
||||
authmanage:false,
|
||||
fullWidth: '',
|
||||
parameter: {},
|
||||
widthBrown: '',
|
||||
@@ -396,6 +398,7 @@ export default {
|
||||
PersonnelSelectionChange(value, id) {
|
||||
this.form[value] = id
|
||||
this.form = { ...this.form }
|
||||
console.log(this.form)
|
||||
},
|
||||
//关闭条款内容弹框
|
||||
handleCancel() {
|
||||
@@ -516,11 +519,11 @@ export default {
|
||||
this.NodeTreeItem = {
|
||||
pageX: x,
|
||||
pageY: y,
|
||||
authManage: node._props.dataRef.authManage,
|
||||
authManageIdsName: node._props.dataRef.authManageIdsName,
|
||||
authViewIds: node._props.dataRef.authViewIds,
|
||||
key: node._props.dataRef.key,
|
||||
authManageIds: node._props.dataRef.authManageIds,
|
||||
authView: node._props.dataRef.authView,
|
||||
authViewIdsName: node._props.dataRef.authViewIdsName,
|
||||
title: node._props.dataRef.title,
|
||||
folderName: node._props.dataRef.folderName,
|
||||
orderId: node._props.dataRef.orderId,
|
||||
@@ -586,8 +589,8 @@ export default {
|
||||
this.form.id = this.nodeItem.key
|
||||
this.form.authManageIds = this.nodeItem.authManageIds
|
||||
this.form.authViewIds = this.nodeItem.authViewIds
|
||||
this.form.authManage = this.nodeItem.authManage
|
||||
this.form.authView = this.nodeItem.authView
|
||||
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
|
||||
@@ -600,7 +603,7 @@ export default {
|
||||
async () => {
|
||||
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 = {
|
||||
supFolder: this.menuId
|
||||
@@ -610,7 +613,7 @@ export default {
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -644,7 +647,7 @@ export default {
|
||||
postAction(`extRepo/extRepoFolder/add`, params).then(res => {
|
||||
if (res.success) {
|
||||
this.menuRightVisible = false
|
||||
this.$message.success(this.$t('OperationSuccessful'))
|
||||
this.$message.success(res.message)
|
||||
// this.onExpand(expandId)
|
||||
this.form = {}
|
||||
this.expandedKeys.push(this.nodeItem.id)
|
||||
@@ -658,7 +661,7 @@ export default {
|
||||
this.searchQuery(JSON.parse(JSON.stringify(queryParam)))
|
||||
// eventBUs.$emit('searchReset')
|
||||
} else {
|
||||
this.$message.warning(this.$t('operationFailed'))
|
||||
this.$message.warning(res.message)
|
||||
}
|
||||
}).finally(() => {
|
||||
this.flag = false
|
||||
@@ -713,6 +716,7 @@ export default {
|
||||
getAction(this.url.list, params).then(res => {
|
||||
if (res.success) {
|
||||
this.dataSource = res.result.pageList.records || []
|
||||
this.authmanage =res.result.auth_manage
|
||||
this.total = res.result.pageList.total
|
||||
this.loading = false
|
||||
}
|
||||
@@ -834,7 +838,7 @@ export default {
|
||||
}
|
||||
deleteAction('com.jero.modules.extRepo/extRepoData/delete', { id: val.id }).then((res) => {
|
||||
if (res.success) {
|
||||
_this.$message.success(_this.$t('OperationSuccessful'))
|
||||
_this.$message.success(res.message)
|
||||
|
||||
_this.loadData(JSON.parse(JSON.stringify(queryParam)))
|
||||
} else {
|
||||
@@ -858,7 +862,7 @@ export default {
|
||||
}
|
||||
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.loadData(JSON.parse(JSON.stringify(queryParam)))
|
||||
|
||||
Reference in New Issue
Block a user