Merge branch 'secondStage'

This commit is contained in:
赵霄
2024-01-12 18:00:30 +08:00
20 changed files with 273 additions and 203 deletions
+1 -1
View File
@@ -103,7 +103,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id) this.imageUrl = getFileAccessHttpUrl(file.id)
+1 -1
View File
@@ -296,7 +296,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id) this.imageUrl = getFileAccessHttpUrl(file.id)
+1 -1
View File
@@ -309,7 +309,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.response.result.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
console.log(fileSuffix) console.log(fileSuffix)
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix)) { if (FILE_TYPE_IMGS.includes(fileSuffix)) {
+1 -1
View File
@@ -441,7 +441,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.response.result.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.response.result.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.name}`
console.log(fileSuffix) console.log(fileSuffix)
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix)) { if (FILE_TYPE_IMGS.includes(fileSuffix)) {
+20 -1
View File
@@ -3,14 +3,33 @@ import { USER_INFO } from '../store/mutation-types'
import { Base64 } from 'js-base64' import { Base64 } from 'js-base64'
import md5 from 'md5' import md5 from 'md5'
function fillZero (str) {
let realNum
if (str < 10) {
realNum = '0' + str
} else {
realNum = str
}
return realNum
}
/** /**
* kkFile预览文件并添加水印 * kkFile预览文件并添加水印
* @param fileUrl * @param fileUrl
*/ */
export const kkFilePreview = (fileUrl) => { export const kkFilePreview = (fileUrl) => {
const userInfo = Vue.ls.get(USER_INFO) const userInfo = Vue.ls.get(USER_INFO)
// 获取当前时间
const date = new Date()
const year = date.getFullYear()
const month = date.getMonth() + 1
const day = date.getDate()
const hour = date.getHours()
const minute = date.getMinutes()
const second = date.getSeconds()
const time = `${year}${fillZero(month)}${fillZero(day)}${fillZero(hour)}${fillZero(minute)}${fillZero(second)}`
// 水印内容 // 水印内容
const watermarkTxt = `${userInfo.username} ${userInfo.realname}` const watermarkTxt = `${userInfo.username} ${userInfo.realname} ${time}`
// 客户环境预览需要加的加密参数 // 客户环境预览需要加的加密参数
const watermarkSign = md5(watermarkTxt + 'cnhtc') const watermarkSign = md5(watermarkTxt + 'cnhtc')
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileUrl))}&watermarkTxt=${encodeURIComponent(watermarkTxt)}&watermarkSign=${watermarkSign}` const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileUrl))}&watermarkTxt=${encodeURIComponent(watermarkTxt)}&watermarkSign=${watermarkSign}`
+1 -1
View File
@@ -5,7 +5,7 @@ const getToken = () => Vue.ls.get(ACCESS_TOKEN)
// 预览pdf // 预览pdf
const previewPdf = (id) => { const previewPdf = (id) => {
const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&token=${getToken()}` const url = `${window._CONFIG.domianURL}/sys/common/view/${id}?type=view&at=${getToken()}`
return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf' return `${process.env.BASE_URL}pdfjs/web/viewer.html?file=` + encodeURIComponent(url) + '&.pdf'
} }
+37
View File
@@ -2,6 +2,9 @@ import Vue from 'vue'
import * as api from '@/api/api' import * as api from '@/api/api'
import { isURL } from '@/utils/validate' import { isURL } from '@/utils/validate'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { getFileInfo } from '@/api/api'
import { dealUrl, kkFilePreview } from './kkFilePreview'
import { previewPdf } from './previewPdf'
// import onlineCommons from '@/components/onlineForm/onlineForm' // import onlineCommons from '@/components/onlineForm/onlineForm'
// //
@@ -678,3 +681,37 @@ export function getConfusionCode (tableName, fieldName) {
} }
return '' return ''
} }
/**
* 通过文件id在当前窗口预览文件
* @param fileId
*/
export function previewFileCurrentWindowByFileId (fileId) {
return new Promise((resolve, reject) => {
getFileInfo({ id: fileId }).then(res => {
if (res.success) {
const file = res.result || {}
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
const fileSuffix = file.fileName ? file.fileName.split('.')[file.fileName.split('.').length - 1] : ''
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
reject('该文件类型不支持预览')
}
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf'
// pdf预览
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
const url = previewPdf(file.id)
window.open(url, '_self')
return
}
// 其余可预览文件仍使用KKFile进行预览
const kkFileUrl = dealUrl(fileFullUrl)
window.open(kkFileUrl, '_self')
}
})
})
}
@@ -8,7 +8,7 @@
<a-col :span="6"> <a-col :span="6">
<a-form-item :label="$t('businessSupport.questionAnswer.classify')" :labelCol="labelCol" :wrapperCol="wrapperCol"> <a-form-item :label="$t('businessSupport.questionAnswer.classify')" :labelCol="labelCol" :wrapperCol="wrapperCol">
<j-dict-select-tag <j-dict-select-tag
:placeholder="$t('pleaseEnter')+$t('businessSupport.questionAnswer.classify')" :placeholder="$t('pleaseSelect')+$t('businessSupport.questionAnswer.classify')"
dict-code="problem_library_type" dict-code="problem_library_type"
v-model="queryParam.type"> v-model="queryParam.type">
</j-dict-select-tag> </j-dict-select-tag>
@@ -128,6 +128,8 @@ import { kkFilePreview } from '@/utils/kkFilePreview'
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw'] const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf' const FILE_TYPE_PDF = 'pdf'
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
export default { export default {
name: 'QuestionAnswerList', name: 'QuestionAnswerList',
@@ -223,7 +225,15 @@ export default {
handleAttachClick (record) { handleAttachClick (record) {
// 截取文件后缀名 // 截取文件后缀名
const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : '' const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : ''
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}`
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
this.$message.loading(this.$t('uploadFile.cannotPreview')).then(() => {
this.handleDownload(record.declareFile, record.declareFileName)
})
return
}
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix)) { if (FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(record.declareFile) this.imageUrl = getFileAccessHttpUrl(record.declareFile)
@@ -240,13 +250,12 @@ export default {
window.open(url) window.open(url)
return return
} }
// word用KKfile预览 // 其余可预览文件仍使用KKFile进行预览
if (fileSuffix === 'doc' || fileSuffix === 'docx') { kkFilePreview(fileFullUrl)
kkFilePreview(fileFullUrl) },
return handleDownload (id, name) {
} // 下载文件
// 如果都不能预览就下载 downloadFile(`/sys/common/download/${id}`, name)
downloadFile(`/sys/common/download/${record.declareFile}`, record.declareFileName)
}, },
// 查看 // 查看
handleDetail (record) { handleDetail (record) {
@@ -212,7 +212,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id) this.imageUrl = getFileAccessHttpUrl(file.id)
@@ -53,6 +53,8 @@ import { kkFilePreview } from '@/utils/kkFilePreview'
const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw'] const FILE_TYPE_IMGS = ['jpg', 'jpeg', 'png', 'raw']
const FILE_TYPE_PDF = 'pdf' const FILE_TYPE_PDF = 'pdf'
// 支持预览的文件后缀
const CAN_PREVIEW_FILE_SUFFIX = ['jpg', 'jpeg', 'png', 'pdf', 'doc', 'docx', 'xls', 'xlsx', 'ppt', 'pptx']
export default { export default {
name: 'CheckReportModal', name: 'CheckReportModal',
@@ -149,7 +151,15 @@ export default {
handleRelatedMaterialClick (record) { handleRelatedMaterialClick (record) {
// 截取文件后缀名 // 截取文件后缀名
const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : '' const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : ''
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}`
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix === tt)
// 判断是否为可预览格式的文件
if (!canPreview) {
this.$message.loading(this.$t('uploadFile.cannotPreview')).then(() => {
this.handleDownload(record.declareFile, record.declareFileName)
})
return
}
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix)) { if (FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(record.declareFile) this.imageUrl = getFileAccessHttpUrl(record.declareFile)
@@ -166,13 +176,12 @@ export default {
window.open(url) window.open(url)
return return
} }
// word用KKfile预览 // 其余可预览文件仍使用KKFile进行预览
if (fileSuffix === 'doc' || fileSuffix === 'docx') { kkFilePreview(fileFullUrl)
kkFilePreview(fileFullUrl) },
return handleDownload (id, name) {
} // 下载文件
// 如果都不能预览就下载 downloadFile(`/sys/common/download/${id}`, name)
downloadFile(`/sys/common/download/${record.declareFile}`, record.declareFileName)
}, },
handleCancel () { handleCancel () {
this.close() this.close()
@@ -224,7 +224,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id) this.imageUrl = getFileAccessHttpUrl(file.id)
@@ -206,7 +206,7 @@ export default {
handleRelatedMaterialClick (record) { handleRelatedMaterialClick (record) {
// 截取文件后缀名 // 截取文件后缀名
const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : '' const fileSuffix = record.declareFileName ? record.declareFileName.split('.')[record.declareFileName.split('.').length - 1] : ''
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.declareFile}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.declareFileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (FILE_TYPE_IMGS.includes(fileSuffix)) { if (FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(record.declareFile) this.imageUrl = getFileAccessHttpUrl(record.declareFile)
@@ -283,7 +283,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id) this.imageUrl = getFileAccessHttpUrl(file.id)
@@ -121,7 +121,7 @@ export default {
const url = previewPdf(file.id) const url = previewPdf(file.id)
this.iframeSrc = url this.iframeSrc = url
} else if (fileSuffix === 'docx') { } else if (fileSuffix === 'docx') {
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// word文件仍使用KKFile进行预览 // word文件仍使用KKFile进行预览
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
this.iframeSrc = url this.iframeSrc = url
@@ -199,7 +199,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
this.imageUrl = getFileAccessHttpUrl(file.id) this.imageUrl = getFileAccessHttpUrl(file.id)
@@ -236,4 +236,4 @@ export default {
.basis-description { .basis-description {
} }
</style> </style>
@@ -378,7 +378,7 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
console.log(fileFullUrl) console.log(fileFullUrl)
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix.toLowerCase())) {
@@ -22,13 +22,14 @@
<a-input :placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionProcess.sectionNumber')" <a-input :placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionProcess.sectionNumber')"
:maxLength="50" :maxLength="50"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
v-decorator.trim="[ 'standardNo', validatorRules.sectionNumber ]" /> v-decorator.trim="[ 'clause', validatorRules.sectionNumber ]" />
</a-form-item> </a-form-item>
<!-- 标准内容或要求 --> <!-- 标准内容或要求 -->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionProcess.standardContentOrDemand')"> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" :label="$t('workCenter.esInspectionProcess.standardContentOrDemand')">
<a-input :placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionProcess.standardContentOrDemand')" <a-input :placeholder="$t('pleaseEnter') + $t('workCenter.esInspectionProcess.standardContentOrDemand')"
:maxLength="500" :maxLength="500"
type="textarea" type="textarea"
:rows="4"
@change="event => event.target.value = event.target.value.trim()" @change="event => event.target.value = event.target.value.trim()"
v-decorator.trim="[ 'requirement', validatorRules.standardContentOrDemand ]" /> v-decorator.trim="[ 'requirement', validatorRules.standardContentOrDemand ]" />
</a-form-item> </a-form-item>
@@ -58,7 +59,8 @@ import { getFileInfo } from '@/api/api'
import { previewPdf } from '@/utils/previewPdf' import { previewPdf } from '@/utils/previewPdf'
import Vue from 'vue' import Vue from 'vue'
import { ACCESS_TOKEN } from '@/store/mutation-types' import { ACCESS_TOKEN } from '@/store/mutation-types'
import { addInspectionContentTable, editInspectionContentTable, getFileByInspectId } from '@api/workCenter' import { getFileByInspectId } from '@api/workCenter'
import moment from 'moment/moment'
const Base64 = require('js-base64').Base64 const Base64 = require('js-base64').Base64
@@ -98,7 +100,7 @@ export default {
validateTrigger: 'blur' validateTrigger: 'blur'
} }
}, },
index: undefined, // 编辑的表格的下标 index: -1, // 编辑的表格的下标
iframeSrc: '' // 左侧预览的路径 iframeSrc: '' // 左侧预览的路径
} }
}, },
@@ -152,8 +154,8 @@ export default {
// pdf预览 // pdf预览
const url = previewPdf(file.id) const url = previewPdf(file.id)
this.iframeSrc = url this.iframeSrc = url
} else if (fileSuffix === 'docx') { } else if (['doc', 'docx'].includes(fileSuffix)) {
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// word文件仍使用KKFile进行预览 // word文件仍使用KKFile进行预览
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
this.iframeSrc = url this.iframeSrc = url
@@ -162,7 +164,7 @@ export default {
close () { close () {
this.visible = false this.visible = false
this.model = {} this.model = {}
this.index = undefined this.index = -1
this.iframeSrc = '' this.iframeSrc = ''
}, },
handleCancel () { handleCancel () {
@@ -170,53 +172,26 @@ export default {
}, },
// 提交并新增 // 提交并新增
handleSubmitAddAdd () { handleSubmitAddAdd () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
this.confirmLoading = true
const param = Object.assign({}, this.model, values) const param = Object.assign({}, this.model, values)
if (!param.processEsInspectId) { if (!param.createTime) {
param.processEsInspectId = this.data.id param.createTime = moment().format('YYYY-MM-DD HH:mm:ss')
} }
console.log(param) this.$emit('ok', param, this.index)
const fn = param.id ? editInspectionContentTable : addInspectionContentTable this.form.resetFields()
fn(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok', param, this.index)
this.form.resetFields()
this.model = {}
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
} }
}) })
}, },
handleOk () { handleOk () {
if (this.confirmLoading) return
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
this.confirmLoading = true
const param = Object.assign({}, this.model, values) const param = Object.assign({}, this.model, values)
if (!this.model.processEsInspectId) { if (!param.createTime) {
param.processEsInspectId = this.data.id param.createTime = moment().format('YYYY-MM-DD HH:mm:ss')
} }
console.log(param) this.$emit('ok', param, this.index)
const fn = param.id ? editInspectionContentTable : addInspectionContentTable this.close()
fn(param).then(res => {
if (res.success) {
this.$message.success(res.message)
this.$emit('ok', param, this.index)
this.close()
} else {
this.$message.warn(res.message)
}
}).finally(() => {
this.confirmLoading = false
})
} }
}) })
} }
@@ -232,7 +207,6 @@ export default {
.content-left { .content-left {
width: 60%; width: 60%;
height: 100%; height: 100%;
overflow-y: scroll;
iframe { iframe {
height: calc(100% - 20px) !important; height: calc(100% - 20px) !important;
} }
@@ -151,7 +151,7 @@ export default {
const url = previewPdf(file.id) const url = previewPdf(file.id)
this.iframeSrc = url this.iframeSrc = url
} else if (fileSuffix === 'docx') { } else if (fileSuffix === 'docx') {
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${file.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${file.fileName}`
// word文件仍使用KKFile进行预览 // word文件仍使用KKFile进行预览
const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}` const url = `${window._CONFIG.onlinePreviewDomainURL}?url=${encodeURIComponent(Base64.encode(fileFullUrl))}`
this.iframeSrc = url this.iframeSrc = url
@@ -17,7 +17,7 @@
<a-tooltip overlay-class-name="tooltip-style"> <a-tooltip overlay-class-name="tooltip-style">
<template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template> <template slot="title">{{ text || text === 0 ? text : global.emptyLine }}</template>
<div class="standard-file-div"> <div class="standard-file-div">
<a class="link-a" @click="handleLookUploadStandard(record)">{{ record.standardFile_dictText }}</a> <a class="link-a" @click="handleLookUploadStandard(record)">{{ record.fileId_dictText }}</a>
<a class="download-a" @click="handleDownloadUploadStandard(record)">{{ $t('download') }}</a> <a class="download-a" @click="handleDownloadUploadStandard(record)">{{ $t('download') }}</a>
</div> </div>
</a-tooltip> </a-tooltip>
@@ -26,106 +26,103 @@
</j-table> </j-table>
</div> </div>
<a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" class="form-add" :rules="rules" ref="ruleForm">
<div class="collapsible-panel-form"> <div class="form-flex-box">
<div class="form-flex-box collapsible-panel-form-content collapsible-content-no-head"> <!-- 标准文本 -->
<!-- 标准文本 --> <div class="box-title-text form-flex-item">
<div class="box-title-text form-flex-item"> <div class="title-text">
<div class="title-text">
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.standardText')"> <span class="title-text-text" :title="$t('workCenter.enStandardRevision.standardText')">
{{ $t('workCenter.enStandardRevision.standardText') }} {{ $t('workCenter.enStandardRevision.standardText') }}
</span> </span>
</div>
<a-form-model-item class="item-model">
<div class="online-edit-wrapper">
<!-- todo: 还不确定这里展示的是什么 -->
<p>企业标准</p>
<a-button type="primary">{{ $t('workCenter.enStandardRevision.onLineEditing') }}</a-button>
</div>
</a-form-model-item>
</div> </div>
<!-- 参会人员 --> <a-form-model-item class="item-model">
<div class="box-title-text form-flex-item"> <div class="online-edit-wrapper">
<div class="title-text"> <!-- todo: 还不确定这里展示的是什么 -->
<span class="required">*</span> <p>企业标准</p>
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.conferee')"> <a-button type="primary">{{ $t('workCenter.enStandardRevision.onLineEditing') }}</a-button>
</div>
</a-form-model-item>
</div>
<!-- 参会人员 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.conferee')">
{{ $t('workCenter.enStandardRevision.conferee') }} {{ $t('workCenter.enStandardRevision.conferee') }}
</span> </span>
</div>
<a-form-model-item class="item-model" prop="conferee">
<user-selection v-model="formInline.conferee"
:placeholder="$t('pleaseSelect')+$t('workCenter.enStandardRevision.conferee')"
:disabled="disabled"
filedName="conferee"
@nameChange="userSelectNameChange"
:nameStr="formInline.conferee_dictText"
type="checkbox"/>
</a-form-model-item>
</div> </div>
<!-- 会议纪要 --> <a-form-model-item class="item-model" prop="meetingUsers">
<div class="box-title-text form-flex-item"> <user-selection v-model="formInline.meetingUsers"
<div class="title-text"> :placeholder="$t('pleaseSelect')+$t('workCenter.enStandardRevision.conferee')"
<span class="required">*</span> :disabled="disabled"
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.meetingSummary')"> filedName="meetingUsers"
@nameChange="userSelectNameChange"
:nameStr="formInline.meetingUsers_dictText"
type="checkbox"/>
</a-form-model-item>
</div>
<!-- 会议纪要 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.meetingSummary')">
{{ $t('workCenter.enStandardRevision.meetingSummary') }} {{ $t('workCenter.enStandardRevision.meetingSummary') }}
</span> </span>
</div>
<a-form-model-item class="item-model" prop="meetingSummary">
<a-button type="primary" class="button-text" style="width: 200px" @click="clickButtonToUpload('meetingSummary')">
{{
(formInline.meetingSummary === 'null' || formInline.meetingSummary === ''
|| formInline.meetingSummary === null || formInline.meetingSummary === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div> </div>
<!-- 编制说明 --> <a-form-model-item class="item-model" prop="meetingSummary">
<div class="box-title-text form-flex-item"> <a-button type="primary" class="button-text" style="width: 200px" @click="clickButtonToUpload('meetingSummary')">
<div class="title-text"> {{
<span class="required">*</span> (formInline.meetingSummary === 'null' || formInline.meetingSummary === ''
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.compilationIllustration')"> || formInline.meetingSummary === null || formInline.meetingSummary === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
<!-- 编制说明 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.compilationIllustration')">
{{ $t('workCenter.enStandardRevision.compilationIllustration') }} {{ $t('workCenter.enStandardRevision.compilationIllustration') }}
</span> </span>
</div>
<a-form-model-item class="item-model" prop="comp_illustration">
<a-button type="primary" class="button-text" style="width: 200px" @click="clickButtonToUpload('comp_illustration')">
{{
(formInline.comp_illustration === 'null' || formInline.comp_illustration === ''
|| formInline.comp_illustration === null || formInline.comp_illustration === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div> </div>
<!-- 是否需要稽查 --> <a-form-model-item class="item-model" prop="compIllustration">
<div class="box-title-text form-flex-item"> <a-button type="primary" class="button-text" style="width: 200px" @click="clickButtonToUpload('compIllustration')">
<div class="title-text"> {{
<span class="required">*</span> (formInline.compIllustration === 'null' || formInline.compIllustration === ''
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.isNeedAudit')"> || formInline.compIllustration === null || formInline.compIllustration === undefined)
? $t('uploadFile.clickUpload')
: $t('uploadFile.viewUploadedFiles')
}}
</a-button>
</a-form-model-item>
</div>
<!-- 稽查内容 -->
<p class="base-info-inner-title">{{ $t('enterpriseStandardLibrary.standard.auditContent') }}</p>
<!-- 是否需要稽查 -->
<div class="box-title-text form-flex-item">
<div class="title-text">
<span class="required">*</span>
<span class="title-text-text" :title="$t('workCenter.enStandardRevision.isNeedAudit')">
{{ $t('workCenter.enStandardRevision.isNeedAudit') }} {{ $t('workCenter.enStandardRevision.isNeedAudit') }}
</span> </span>
</div>
<a-form-model-item class="item-model" prop="isNeedAudit">
<a-radio-group v-model="formInline.isNeedAudit">
<a-radio :value="1">
{{ $t('yes') }}
</a-radio>
<a-radio :value="2">
{{ $t('not') }}
</a-radio>
</a-radio-group>
</a-form-model-item>
</div> </div>
<a-form-model-item class="item-model" prop="inspectFlag">
<a-radio-group v-model="formInline.inspectFlag">
<a-radio value="1">
{{ $t('yes') }}
</a-radio>
<a-radio value="0">
{{ $t('not') }}
</a-radio>
</a-radio-group>
</a-form-model-item>
</div> </div>
</div> </div>
</a-form-model> </a-form-model>
<!-- 是否需要稽查选择是需要填写稽查内容否则隐藏稽查内容区域 --> <!-- 是否需要稽查选择是需要填写稽查内容否则隐藏稽查内容区域 -->
<template v-if="formInline.isNeedAudit === 1"> <template v-if="formInline.inspectFlag === '1'">
<!-- 稽查内容 -->
<p class="base-info-inner-title">{{ $t('enterpriseStandardLibrary.standard.auditContent') }}</p>
<!-- 操作区域 --> <!-- 操作区域 -->
<div v-if="!disabled" class="table-operator"> <div v-if="!disabled" class="table-operator">
<!-- 新增 --> <!-- 新增 -->
@@ -149,7 +146,7 @@
<div slot="action" slot-scope="{record, index}" class="action-span-cell"> <div slot="action" slot-scope="{record, index}" class="action-span-cell">
<a @click="handleEdit(record, index)" class="table-ope-btn" :disabled="disabled">{{ $t('edit') }}</a> <a @click="handleEdit(record, index)" class="table-ope-btn" :disabled="disabled">{{ $t('edit') }}</a>
<a-divider type="vertical" /> <a-divider type="vertical" />
<a @click="handleDelete(record.id, index)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a> <a @click="handleDelete(index)" class="table-ope-btn" :disabled="disabled">{{ $t('delete') }}</a>
</div> </div>
</j-table> </j-table>
@@ -204,32 +201,32 @@ export default {
title: this.$t('workCenter.enStandardRevision.draftingUnit'), title: this.$t('workCenter.enStandardRevision.draftingUnit'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'draftingUnit_dictText', dataIndex: 'dept_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 起草人 { // 起草人
title: this.$t('workCenter.enStandardRevision.drafter'), title: this.$t('workCenter.enStandardRevision.drafter'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'drafter_dictText', dataIndex: 'user_dictText',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 起草范围 { // 起草范围
title: this.$t('workCenter.enStandardRevision.draftingScope'), title: this.$t('workCenter.enStandardRevision.draftingScope'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'draftingScope', dataIndex: 'scope',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 截止日期 { // 截止日期
title: this.$t('expirationDate'), title: this.$t('expirationDate'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'expirationDate', dataIndex: 'deadline',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 企标文本 { // 企标文本
dataIndex: 'standardFile_dictText', dataIndex: 'fileId_dictText',
title: this.$t('workCenter.enStandardRevision.enterpriseStandardText'), title: this.$t('workCenter.enStandardRevision.enterpriseStandardText'),
scopedSlots: { customRender: 'standardFile' }, scopedSlots: { customRender: 'standardFile' },
align: 'center', align: 'center',
@@ -237,12 +234,12 @@ export default {
} }
], ],
// 起草人表格数据 // 起草人表格数据
drafterDataSource: [{id: 1, standardFile: '1715299701232504833', standardFile_dictText: '测试上传excel测试测试测试测试.xls'}], drafterDataSource: [],
drafterLoading: false, drafterLoading: false,
formInline: {}, formInline: {},
rules: { rules: {
// 参会人员 // 参会人员
conferee: [ meetingUsers: [
{ {
required: true, required: true,
message: this.$t('workCenter.enStandardRevision.conferee') + this.$t('cannotEmpty'), message: this.$t('workCenter.enStandardRevision.conferee') + this.$t('cannotEmpty'),
@@ -257,8 +254,16 @@ export default {
trigger: 'change' trigger: 'change'
} }
], ],
// 编制说明
compIllustration: [
{
required: true,
message: this.$t('workCenter.enStandardRevision.compilationIllustration') + this.$t('cannotEmpty'),
trigger: 'change'
}
],
// 是否需要稽查 // 是否需要稽查
isNeedAudit: [ inspectFlag: [
{ {
required: true, required: true,
message: this.$t('workCenter.enStandardRevision.isNeedAudit') + this.$t('cannotEmpty'), message: this.$t('workCenter.enStandardRevision.isNeedAudit') + this.$t('cannotEmpty'),
@@ -268,25 +273,35 @@ export default {
}, },
// 稽查内容表格列 // 稽查内容表格列
columns: [ columns: [
{ { // 条款
title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'), title: this.$t('enterpriseStandardLibrary.standard.subjectToClause'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'clause', dataIndex: 'clause',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ { // 标准内容和要求
title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'), title: this.$t('enterpriseStandardLibrary.standard.standardContentOrRequirements'),
align: 'center', align: 'center',
width: 180, width: 180,
dataIndex: 'requirement', dataIndex: 'requirement',
scopedSlots: { customRender: 'text' } scopedSlots: { customRender: 'text' }
}, },
{ // 整改部门
title: this.$t('enterpriseStandardLibrary.standard.rectificationDepartment'),
align: 'center',
width: 200,
dataIndex: 'rectificationDepartment',
customRender: (value, row, index) => {
return <j-select-depart v-model={this.dataSource[index].rectificationDepartment}
backDepart={true} />
}
},
{ {
title: this.$t('operation'), title: this.$t('operation'),
scopedSlots: { customRender: 'action' }, scopedSlots: { customRender: 'action' },
align: 'center', align: 'center',
width: 200 width: 150
} }
], ],
// 稽查内容表格数据 // 稽查内容表格数据
@@ -294,27 +309,27 @@ export default {
loading: false, loading: false,
fileMaxSize: undefined, fileMaxSize: undefined,
image: false, image: false,
imageUrl: '' imageUrl: '',
uploadName: ''
} }
}, },
methods: { methods: {
// 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了 // 拿到外面传进来的数据初始化,因为套了几层就不在外层初始化数据了
initData (data) { initData (data) {
// 给表格赋值,在线编辑不知道要怎么赋值? // 给表格赋值,在线编辑不知道要怎么赋值?
// this.drafterDataSource = this.drafterDataSource = data.otherDraftUserVOS
// this.dataSource = this.dataSource = data.inspectContents || []
// this.formInline = this.formInline = Object.assign({}, data)
// 给表单赋值 // 给表单赋值
// this.$nextTick(() => { this.$nextTick(() => {
// this.$refs.baseInfoForm.formInline = this.$refs.baseInfoForm.initData(data)
// }) })
}, },
// 外层要获取数据 // 外层要获取数据
getData () { getData () {
// 把数据抛出,在线编辑不知道要不要抛 // 把数据抛出,在线编辑不知道要不要抛
const data = {} const data = Object.assign({}, this.formInline)
data.dataSource = this.dataSource data.inspectContents = this.dataSource || []
data.formInline = this.formInline
return data return data
}, },
// 外层获取数据要过校验,返回false表示没有通过校验 // 外层获取数据要过校验,返回false表示没有通过校验
@@ -322,10 +337,19 @@ export default {
let data = {} let data = {}
await this.$refs.ruleForm.validate(valid => { await this.$refs.ruleForm.validate(valid => {
if (valid) { if (valid) {
if (this.dataSource && this.dataSource.length > 0) { if (this.formInline.inspectFlag === '1' && this.dataSource && this.dataSource.length > 0) {
if (this.dataSource.map(item => item.rectificationDepartment).every(item => !!item)) {
// 每一个的整改部门都填了
// 有数据可以抛出
data = Object.assign({}, this.formInline)
data.inspectContents = this.dataSource || []
} else {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
data = false
}
} else if (this.formInline.inspectFlag === '0') {
// 有数据可以抛出 // 有数据可以抛出
data.dataSource = this.dataSource data = Object.assign({}, this.formInline)
data.formInline = this.formInline
} else { } else {
this.$message.warning(this.$t('addAtLeastOneRowOfData')) this.$message.warning(this.$t('addAtLeastOneRowOfData'))
data = false data = false
@@ -339,7 +363,7 @@ export default {
// 查看企标文本 // 查看企标文本
handleLookUploadStandard (record) { handleLookUploadStandard (record) {
// 截取文件后缀名 // 截取文件后缀名
const fileSuffix = record.standardFile_dictText ? record.standardFile_dictText.split('.')[record.standardFile_dictText.split('.').length - 1].toLowerCase() : '' const fileSuffix = record.fileId_dictText ? record.fileId_dictText.split('.')[record.fileId_dictText.split('.').length - 1].toLowerCase() : ''
const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt) const canPreview = CAN_PREVIEW_FILE_SUFFIX.some(tt => fileSuffix.toLowerCase() === tt)
// 判断是否为可预览格式的文件 // 判断是否为可预览格式的文件
if (!canPreview) { if (!canPreview) {
@@ -348,10 +372,10 @@ export default {
}) })
return return
} }
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.standardFile}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.standardFile_dictText}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${record.fileId}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${record.fileId_dictText}`
// 图片预览,使用自己添加的组件 // 图片预览,使用自己添加的组件
if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix)) { if (canPreview && FILE_TYPE_IMGS.includes(fileSuffix)) {
this.imageUrl = getFileAccessHttpUrl(record.standardFile) this.imageUrl = getFileAccessHttpUrl(record.fileId)
// 获取viewer实例 // 获取viewer实例
const viewer = this.$el.querySelector('.image').$viewer const viewer = this.$el.querySelector('.image').$viewer
// 调用show方法进行显示预览图 // 调用show方法进行显示预览图
@@ -361,22 +385,17 @@ export default {
} }
// pdf预览 // pdf预览
if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) { if (canPreview && FILE_TYPE_PDF.includes(fileSuffix)) {
const url = previewPdf(record.standardFile) const url = previewPdf(record.fileId)
window.open(url) window.open(url)
return return
} }
// word用KKfile预览 // 其余可预览文件仍使用KKFile进行预览
if (canPreview && (fileSuffix === 'doc' || fileSuffix === 'docx')) { kkFilePreview(fileFullUrl)
kkFilePreview(fileFullUrl)
return
}
// 如果都不能预览就下载
downloadFile(`/sys/common/download/${record.standardFile}`, record.standardFile_dictText)
}, },
// 下载企标文本 // 下载企标文本
handleDownloadUploadStandard (record) { handleDownloadUploadStandard (record) {
// 下载文件 // 下载文件
downloadFile(`/sys/common/download/${record.standardFile}`, record.standardFile_dictText) downloadFile(`/sys/common/download/${record.fileId}`, record.fileId_dictText)
}, },
// 选择用户得到用户名 // 选择用户得到用户名
userSelectNameChange (value, fieldName) { userSelectNameChange (value, fieldName) {
@@ -384,11 +403,6 @@ export default {
}, },
// 点击文件上传 // 点击文件上传
clickButtonToUpload (fieldName) { clickButtonToUpload (fieldName) {
if (fieldName === 'uploadAttachment') {
this.fileMaxSize = 10
} else {
this.fileMaxSize = undefined
}
this.$refs.uploadFile.open(this.formInline[fieldName]) this.$refs.uploadFile.open(this.formInline[fieldName])
this.uploadName = fieldName this.uploadName = fieldName
}, },
@@ -420,7 +434,13 @@ export default {
}, },
// 稽查内容的删除 // 稽查内容的删除
handleDelete (index) { handleDelete (index) {
this.dataSource.splice(index, 1) this.$confirm({
title: this.$t('confirmDeletion'),
content: this.$t('areYouSure'),
onOk: () => {
this.dataSource.splice(index, 1)
}
})
}, },
// 稽查内容新增编辑完成 // 稽查内容新增编辑完成
checkContentOk (value, index) { checkContentOk (value, index) {
@@ -439,9 +459,10 @@ export default {
<style scoped lang="less"> <style scoped lang="less">
@import '~@assets/less/common.less'; @import '~@assets/less/common.less';
.collapsible-content-no-head {
border-top: 1px solid #E5E6EB; .form-add {
border-radius: 8px 8px 8px 8px; margin-top: 30px;
margin-bottom: 0;
} }
.online-edit-wrapper { .online-edit-wrapper {
@@ -456,6 +477,7 @@ export default {
} }
.base-info-inner-title { .base-info-inner-title {
width: 100%;
color: #1D2129; color: #1D2129;
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
@@ -158,7 +158,7 @@ export default {
getFileInfo({ id: fileId }).then(res => { getFileInfo({ id: fileId }).then(res => {
if (res.success) { if (res.success) {
const fileInfo = res.result || {} const fileInfo = res.result || {}
const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${fileInfo.id}?token=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${fileInfo.fileName}` const fileFullUrl = `${window._CONFIG.domianWebSocketURL}/sys/common/view/${fileInfo.id}?at=${Vue.ls.get(ACCESS_TOKEN)}&fullfilename=${fileInfo.fileName}`
// 截取文件后缀名 // 截取文件后缀名
const fileSuffix = (fileInfo.fileName ? fileInfo.fileName.split('.')[fileInfo.fileName.split('.').length - 1] : '').toLowerCase() const fileSuffix = (fileInfo.fileName ? fileInfo.fileName.split('.')[fileInfo.fileName.split('.').length - 1] : '').toLowerCase()
switch (fileSuffix) { switch (fileSuffix) {
@@ -261,4 +261,4 @@ export default {
justify-content: center; justify-content: center;
height: 100%; height: 100%;
} }
</style> </style>