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

This commit is contained in:
zyx.net
2022-08-11 11:50:00 +08:00
4 changed files with 89 additions and 9 deletions
@@ -64,8 +64,8 @@ public class SarFileCompareInfoController extends JeroController<SarFileCompareI
@RequestParam(name = "cut", defaultValue = "cn") String cut, HttpServletRequest req) { @RequestParam(name = "cut", defaultValue = "cn") String cut, HttpServletRequest req) {
QueryWrapper<SarFileCompareInfo> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareInfo, req.getParameterMap()); QueryWrapper<SarFileCompareInfo> queryWrapper = QueryGenerator.initQueryWrapper(sarFileCompareInfo, req.getParameterMap());
LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();
queryWrapper.eq("create_by", sysUser.getUsername()).or().eq("release_state", ReleaseConditionEnum.DRAFT.getValue()); queryWrapper.eq("create_by", sysUser.getUsername()).or().eq("release_state", ReleaseConditionEnum.PUBLISHED.getValue());
Page<SarFileCompareInfo> page = new Page<SarFileCompareInfo>(pageNo, pageSize); Page<SarFileCompareInfo> page = new Page<>(pageNo, pageSize);
IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper); IPage<SarFileCompareInfo> pageList = sarFileCompareInfoService.page(page, queryWrapper);
for (SarFileCompareInfo info : pageList.getRecords()) { for (SarFileCompareInfo info : pageList.getRecords()) {
info.setReleaseStateTitle(ReleaseConditionEnum.getTextByValue(info.getReleaseState(), cut)); info.setReleaseStateTitle(ReleaseConditionEnum.getTextByValue(info.getReleaseState(), cut));
@@ -229,14 +229,14 @@ public class SarFileCompareInfoServiceImpl extends ServiceImpl<SarFileCompareInf
String id = UUID.randomUUID().toString(); String id = UUID.randomUUID().toString();
sarFileCompareInfo.setId(id); sarFileCompareInfo.setId(id);
sarFileCompareInfo.setFileIdLeft(leftInfo.getId()); sarFileCompareInfo.setFileIdLeft(leftInfo.getId());
sarFileCompareInfo.setFileKeyLeft(leftInfo.getFileId()); sarFileCompareInfo.setFileKeyLeft(leftInfo.getConnectId());
sarFileCompareInfo.setFileNameLeft(leftInfo.getFileName()); sarFileCompareInfo.setFileNameLeft(leftInfo.getFileName());
sarFileCompareInfo.setTitleLeft(leftInfo.getTitle()); sarFileCompareInfo.setTitleLeft(leftInfo.getTitle());
sarFileCompareInfo.setFileTypeLeft(leftInfo.getFileType()); sarFileCompareInfo.setFileTypeLeft(leftInfo.getFileType());
sarFileCompareInfo.setSerialNumberLeft(leftInfo.getSerialNumber()); sarFileCompareInfo.setSerialNumberLeft(leftInfo.getSerialNumber());
sarFileCompareInfo.setFileIdRight(rightInfo.getId()); sarFileCompareInfo.setFileIdRight(rightInfo.getId());
sarFileCompareInfo.setFileKeyRight(rightInfo.getFileId()); sarFileCompareInfo.setFileKeyRight(rightInfo.getConnectId());
sarFileCompareInfo.setFileNameRight(rightInfo.getFileName()); sarFileCompareInfo.setFileNameRight(rightInfo.getFileName());
sarFileCompareInfo.setFileTypeRight(rightInfo.getFileType()); sarFileCompareInfo.setFileTypeRight(rightInfo.getFileType());
sarFileCompareInfo.setTitleRight(rightInfo.getTitle()); sarFileCompareInfo.setTitleRight(rightInfo.getTitle());
@@ -64,6 +64,7 @@
</div> </div>
<a-form-model-item class="itemModel" prop="endTime"> <a-form-model-item class="itemModel" prop="endTime">
<a-date-picker class="box-input" <a-date-picker class="box-input"
:disabledDate="disabledDate"
:placeholder="$t('PleaseSelect')+$t('closingDate')" :placeholder="$t('PleaseSelect')+$t('closingDate')"
@change="dateChange('endTime')" @change="dateChange('endTime')"
:getCalendarContainer="(trigger) => trigger.parentNode" :getCalendarContainer="(trigger) => trigger.parentNode"
@@ -347,6 +348,9 @@
} }
}) })
}, },
disabledDate(current) {
return current && current < moment().subtract(1, 'day')
},
pageOnChange(page) { pageOnChange(page) {
this.pageNo = page this.pageNo = page
this.getList() this.getList()
@@ -78,6 +78,18 @@
v-if="record.createBy == userInfoQuery.username && record.releaseState == 'draft'" v-if="record.createBy == userInfoQuery.username && record.releaseState == 'draft'"
@click="deleteData(record)">{{$t('delete')}}</a> @click="deleteData(record)">{{$t('delete')}}</a>
</span> </span>
<span slot="serialNumberRight" :title="text" slot-scope="text,record">
<a @click="serialNumberRightClick(record)">{{text}}</a>
</span>
<span slot="serialNumberLeft" :title="text" slot-scope="text,record">
<a @click="serialNumberLeftClick(record)">{{text}}</a>
</span>
<span slot="fileNameLeft" :title="text" slot-scope="text,record">
<a @click="fileNameLeftClick(record)">{{text}}</a>
</span>
<span slot="fileNameRight" :title="text" slot-scope="text,record">
<a @click="fileNameRightClick(record)">{{text}}</a>
</span>
</a-table> </a-table>
<div class="page" v-if="dataSource && dataSource.length > 0"> <div class="page" v-if="dataSource && dataSource.length > 0">
<a-pagination <a-pagination
@@ -96,8 +108,9 @@
</template> </template>
<script> <script>
import { getAction, postAction, deleteAction } from '@/api/manage' import { getAction, postAction, deleteAction, downloadFile } from '@/api/manage'
import { mapGetters } from 'vuex' import { mapGetters } from 'vuex'
import { Base64 } from 'js-base64'
export default { export default {
name: 'index', name: 'index',
@@ -112,6 +125,7 @@
loading: false, loading: false,
dataSource: [], dataSource: [],
selectedRowKeys: [], selectedRowKeys: [],
downLoadFileUrl: window._CONFIG['domianPreviewURL'] + '/sys/common/download',
total: 0, total: 0,
pageSize: 10, pageSize: 10,
pageNo: 1, pageNo: 1,
@@ -123,13 +137,17 @@
title: this.$t('standard') + 1, title: this.$t('standard') + 1,
align: 'center', align: 'center',
dataIndex: 'serialNumberLeft', dataIndex: 'serialNumberLeft',
width: 170 width: 170,
ellipsis: true,
scopedSlots: { customRender: 'serialNumberLeft' }
}, },
{ {
title: this.$t('title') + 1, title: this.$t('title') + 1,
align: 'center', align: 'center',
dataIndex: 'titleLeft', dataIndex: 'titleLeft',
width: 170 width: 170,
ellipsis: true,
scopedSlots: { customRender: 'serialNumberLeft' }
}, },
{ {
title: this.$t('TextStatus'), title: this.$t('TextStatus'),
@@ -143,18 +161,23 @@
align: 'center', align: 'center',
width: 270, width: 270,
ellipsis: true, ellipsis: true,
dataIndex: 'fileNameLeft' dataIndex: 'fileNameLeft',
scopedSlots: { customRender: 'fileNameLeft' }
}, },
{ {
title: this.$t('standard') + 2, title: this.$t('standard') + 2,
align: 'center', align: 'center',
dataIndex: 'serialNumberRight', dataIndex: 'serialNumberRight',
ellipsis: true,
scopedSlots: { customRender: 'serialNumberRight' },
width: 170 width: 170
}, },
{ {
title: this.$t('title') + 2, title: this.$t('title') + 2,
align: 'center', align: 'center',
dataIndex: 'titleRight', dataIndex: 'titleRight',
scopedSlots: { customRender: 'serialNumberRight' },
ellipsis: true,
width: 170 width: 170
}, },
{ {
@@ -169,7 +192,8 @@
align: 'center', align: 'center',
width: 270, width: 270,
ellipsis: true, ellipsis: true,
dataIndex: 'fileNameRight' dataIndex: 'fileNameRight',
scopedSlots: { customRender: 'fileNameRight' }
}, },
{ {
title: this.$t('releaseSituation'), title: this.$t('releaseSituation'),
@@ -350,6 +374,58 @@
}) })
} }
}) })
},
serialNumberRightClick(row) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: {
id: row.fileKeyRight
}
})
window.open(newUrl.href, '_blank')
},
serialNumberLeftClick(row) {
let newUrl = this.$router.resolve({
path: '/docManage/library/detail',
query: {
id: row.fileKeyLeft
}
})
window.open(newUrl.href, '_blank')
},
fileNameLeftClick(row) {
let fileName = row.fileNameLeft
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + row.fileIdLeft + '&userName=' + this.userInfo().username))
} else if (fileSuffix === '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdLeft + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdLeft + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', row.fileNameLeft, { id: row.fileIdLeft })
}
},
fileNameRightClick(row) {
let fileName = row.fileNameRight
let index1 = fileName.lastIndexOf('.')
let index2 = fileName.length
let fileSuffix = fileName.substring(index1, index2)
if (fileSuffix === '.pdf') {
window.open('/pdf/web/viewer.html?file=' + encodeURIComponent('/jero-boot/sys/common/pdf/viewFile?id=' + row.fileIdRight + '&userName=' + this.userInfo().username))
} else if (fileSuffix === '.docx') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdRight + fileSuffix)
window.open(url, '_blank')
} else if (fileSuffix === '.xlsx' || fileSuffix === '.xls') {
let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + row.fileIdRight + fileSuffix)
window.open(url, '_blank')
} else {
downloadFile('/sys/common/downLoadFile', row.fileNameRight, { id: row.fileIdRight })
}
} }
} }
} }