diff --git a/src/common/preview/index.js b/src/common/preview/index.js index c0e055d41..0fba21c5f 100644 --- a/src/common/preview/index.js +++ b/src/common/preview/index.js @@ -18,38 +18,48 @@ function queryConvertAtt (data) { }) } -async function preview (attId) { - const loading = Loading.service({ - lock: true, - text: '正在加载文件', - spinner: 'el-icon-loading', - }) +async function preview (attId, type) { + let loading; + if (type !== 'getUrl') { + loading = Loading.service({ + lock: true, + text: '正在加载文件', + spinner: 'el-icon-loading', + }) + } const res = await getBusStandFileByAttId({ attId }) if (res.ok && res.data) { const file = res.data + let url = '' if (file.fileSuffix.toLowerCase() === 'pdg') { if (isMobile()) { this.$message.warning('pdg文件,不支持手机端预览') + return } else { - window.open('book://ssreader/e0?url=' + file.downLoadUrl) + url = 'book://ssreader/e0?url=' + file.downLoadUrl } } else if (file.fileSuffix.toLowerCase() === 'pdf') { - window.open('./static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id)) + url = './static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + file.id) } else { // onlyoffice在线编辑文件转换为pdf预览 -> kkfileview预览乱码 if (file.onlined && file.onlined === 1) { const res = await queryConvertAtt({ attId }) if (res.ok && res.data) { - window.open('/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId)) + url = '/static/pdf/web/viewer.html?file=' + encodeURIComponent('/api/att/attFile/getFileInfo?fileId=' + res.data.attId) } else { this.$message.error('文档未转换成功或本地读取不到该文档') + return } } else { - window.open(kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(file.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(store.getters.userInfo.userName)); + url = kkFileViewUrl + '/onlinePreview?url=' + encodeURIComponent(Base64.encode(file.downLoadUrl)) + '&watermarkTxt=' + encodeURIComponent(store.getters.userInfo.userName) } } + if (type === 'getUrl') { + return url + } + window.open(url) } - loading.close() + loading && loading.close() } export default preview; diff --git a/src/components/hzwlComponents/Import.vue b/src/components/hzwlComponents/Import.vue index 6ebf1f102..90f457450 100644 --- a/src/components/hzwlComponents/Import.vue +++ b/src/components/hzwlComponents/Import.vue @@ -19,10 +19,16 @@ :action="action" :headers="headers" name="file" + :file-list="fileList" :accept="accept" :auto-upload="autoUpload" + :limit="limit" :before-upload="beforeUpload" :on-success="onSuccess" + :on-remove="onRemove" + :on-preview="onPreview" + :on-exceed="onExceed" + :on-error="onError" :show-file-list="true" > @@ -93,7 +99,21 @@ export default { manualUpload: { type: Boolean, default: false - } + }, + limit: { + type: Number, + default: 8 + }, + ids: { + required: false, + type: String, + default: '' + }, + names: { + required: false, + type: String, + default: '' + }, }, data () { return { @@ -101,10 +121,28 @@ export default { token: JSON.parse(localStorage.getItem('userInfo')).token }, importFailed: false, - importForm: {} + importForm: {}, + fileList: [], } }, + created () { + this.initFileList() + }, methods: { + initFileList () { + if (this.ids && this.ids !== '' && this.names && this.names !== '') { + const fileList = [] + const idArr = this.ids.split(',') + const nameArr = this.names.split(',') + for (let i = 0; i < idArr.length; i++) { + fileList.push({ + id: idArr[i], + name: nameArr[i] + }) + } + this.fileList = fileList + } + }, onClose () { this.$emit('update:visible', false) }, @@ -131,8 +169,25 @@ export default { return true }, // 导入标准数据成功后执行 - onSuccess (response, file) { + onSuccess (response, file, fileList) { if (response.ok) { + const fileObj = { + id: file.response.data.id, + name: file.response.data.name + } + let ids; + let names; + if (this.ids && this.ids.length > 0) { + ids = this.ids + ',' + fileObj.id + names = this.names + ',' + fileObj.name + } else { + ids = fileObj.id + names = fileObj.name + } + this.$set(this.fileList, this.fileList.length, fileObj) + this.$emit('update:ids', ids) + this.$emit('update:names', names) + this.$emit('update:visible', false) this.$emit('onSuccess') this.$message({ @@ -144,6 +199,44 @@ export default { this.importForm.content = response.message } }, + onRemove (file, fileList) { + const ids = fileList + .reduce((init, file) => init + ',' + (file.id || file.response.data.id), '') + .replace(/^,|,$/g, '') + const names = fileList + .reduce((init, file) => init + ',' + (file.name || file.response.data.name), '') + .replace(/^,|,$/g, '') + this.fileList = fileList.map(file => ({ + id: file.id || file.response.data.id, + name: file.name + })) + this.$emit('update:ids', ids) + this.$emit('update:names', names) + this.$emit('onRemove') + }, + onPreview (file) { + const id = file.id || file.response.data.id + this.$preview(id) + }, + onExceed (files, fileList) { + this.$message.warning(`当前限制上传 1 个文件,本次上传了 ${files.length} 个文件,共上传了 ${files.length + fileList.length} 个文件`); + }, + onError (err, file, fileList) { + const ids = fileList + .reduce((init, file) => init + ',' + (file.id || file.response.data.id), '') + .replace(/^,|,$/g, '') + const names = fileList + .reduce((init, file) => init + ',' + (file.name || file.response.data.name), '') + .replace(/^,|,$/g, '') + this.fileList = fileList.map(file => ({ + id: file.id || file.response.data.id, + name: file.name + })) + this.$emit('update:ids', ids) + this.$emit('update:names', names) + this.$emit('onError') + this.$message.error('上传失败') + }, ManualUpload () { this.$refs.importfile.submit(); } diff --git a/src/components/hzwlComponents/SelectFormItem.vue b/src/components/hzwlComponents/SelectFormItem.vue index fd3f0d647..0643bb230 100644 --- a/src/components/hzwlComponents/SelectFormItem.vue +++ b/src/components/hzwlComponents/SelectFormItem.vue @@ -64,6 +64,7 @@ export default { methods: { handleChange (event) { this.$emit('input', event) + this.$emit('change', event) } } } diff --git a/src/components/hzwlComponents/UploadFormItem.vue b/src/components/hzwlComponents/UploadFormItem.vue index 720cea498..d35849758 100644 --- a/src/components/hzwlComponents/UploadFormItem.vue +++ b/src/components/hzwlComponents/UploadFormItem.vue @@ -242,4 +242,12 @@ export default { .fileClass{ line-height: 22px !important; } +.add-form-item /deep/ .el-form-item__content .el-form-item__error { + padding: 3px; + top: 15px; + right: 45px !important; + left: auto; + background: #fff3f3; + z-index: 9; +} diff --git a/src/main.js b/src/main.js index 9f068e3f9..471689c71 100644 --- a/src/main.js +++ b/src/main.js @@ -41,7 +41,6 @@ import Contextmenu from 'vue-contextmenujs' // vant import vant from 'vant' import 'vant/lib/index.css' -//vant import animate from 'animate.css' import tool from './utils/tool' @@ -63,6 +62,10 @@ router.beforeEach((to, from, next) => { if (isMobile()) { if (fullPath.indexOf('phone') !== 0) { let path = fullPath.replace(fullPath.charAt(0), fullPath.charAt(0).toUpperCase()) + if (path.indexOf('BussLibraryProduct/') !== -1) { + // 产品标准流程-pc端重构,pc端路由改变而手机端路由未改变,此处让手机端跳转到正确路由 + path = path.replace('BussLibraryProduct/', 'BussLibraryProduct') + } path = '/phone' + path next({ path: path }) } diff --git a/src/pages/processCenter/pages/creatProcess/qbrk-product/bussLibraryProduct.vue b/src/pages/processCenter/pages/creatProcess/qbrk-product/bussLibraryProduct.vue new file mode 100644 index 000000000..a37dae01d --- /dev/null +++ b/src/pages/processCenter/pages/creatProcess/qbrk-product/bussLibraryProduct.vue @@ -0,0 +1,1184 @@ + + + + + diff --git a/src/pages/processCenter/pages/creatProcess/qbrk-product/components/Basic.vue b/src/pages/processCenter/pages/creatProcess/qbrk-product/components/Basic.vue new file mode 100644 index 000000000..27ef9c86e --- /dev/null +++ b/src/pages/processCenter/pages/creatProcess/qbrk-product/components/Basic.vue @@ -0,0 +1,197 @@ + + + + + diff --git a/src/pages/processCenter/pages/creatProcess/qbrk-product/components/Countersign.vue b/src/pages/processCenter/pages/creatProcess/qbrk-product/components/Countersign.vue new file mode 100644 index 000000000..41417fd64 --- /dev/null +++ b/src/pages/processCenter/pages/creatProcess/qbrk-product/components/Countersign.vue @@ -0,0 +1,357 @@ +