|
@@ -584,6 +584,22 @@
|
|
|
<el-button type="primary" @click="statusDialogConfirm">确 定</el-button>
|
|
|
</template>
|
|
|
</el-dialog>
|
|
|
+ <normal-dialog
|
|
|
+ :show-dialog="showCopyFile"
|
|
|
+ :title="'复制信息'"
|
|
|
+ :width="'35%'"
|
|
|
+ @confirm="confirmUpload()"
|
|
|
+ @cancel="showCopyFile=false"
|
|
|
+ >
|
|
|
+ <div class="file-dialog">
|
|
|
+ <el-form ref="form" label-width="80px">
|
|
|
+ <el-form-item label="图片名称">
|
|
|
+ <el-input v-model="imageName" />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ <img :src="imageUrl" class="image-url">
|
|
|
+ </div>
|
|
|
+ </normal-dialog>
|
|
|
</el-container>
|
|
|
<el-button id="pasteUpload" type="primary" style="display: none" @click="pasteUpload">upload</el-button>
|
|
|
</div>
|
|
@@ -605,6 +621,7 @@ import {
|
|
|
settingQueryBizModuleList
|
|
|
} from '@/api/defectManage.js'
|
|
|
import Dropdown from './dropdown.vue'
|
|
|
+import normalDialog from '@/components/dialog/normalDialog'
|
|
|
import axios from 'axios'
|
|
|
|
|
|
document.body.onpaste = function(event) {
|
|
@@ -625,7 +642,8 @@ document.body.onpaste = function(event) {
|
|
|
export default {
|
|
|
name: 'BugDetails',
|
|
|
components: {
|
|
|
- Dropdown
|
|
|
+ Dropdown,
|
|
|
+ normalDialog
|
|
|
},
|
|
|
mixins: [fackClickOutSide],
|
|
|
props: {
|
|
@@ -718,6 +736,9 @@ export default {
|
|
|
{ required: true, message: '请输入Reopen原因', trigger: 'blur' }
|
|
|
]
|
|
|
},
|
|
|
+ showCopyFile: false, // 复制文件对话框
|
|
|
+ imageName: null,
|
|
|
+ imageUrl: null,
|
|
|
uploadButton: this.drawerShow
|
|
|
}
|
|
|
},
|
|
@@ -747,6 +768,9 @@ export default {
|
|
|
height -= 130
|
|
|
this.height = height + 'px'
|
|
|
}
|
|
|
+ if (this.type === 'page') {
|
|
|
+ this.uploadButton = true
|
|
|
+ }
|
|
|
},
|
|
|
mounted() {
|
|
|
this.bugGetEnum()
|
|
@@ -1171,15 +1195,24 @@ export default {
|
|
|
return res
|
|
|
})
|
|
|
},
|
|
|
- async pasteUpload() {
|
|
|
+ pasteUpload() {
|
|
|
if (!this.uploadButton) {
|
|
|
return false
|
|
|
}
|
|
|
- const res = await this.update(window.uploadFiles[0])
|
|
|
- console.log(res)
|
|
|
+ if (window.uploadFiles[0]) {
|
|
|
+ const reader = new FileReader()
|
|
|
+ reader.readAsDataURL(window.uploadFiles[0])
|
|
|
+ reader.onload = () => {
|
|
|
+ this.imageUrl = reader.result
|
|
|
+ }
|
|
|
+ this.showCopyFile = true
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async confirmUpload() {
|
|
|
+ const res = await this.updateFile(window.uploadFiles[0])
|
|
|
const data = res.data
|
|
|
const item = {
|
|
|
- name: data.originResult.md5 + '.png' || '',
|
|
|
+ name: this.imageName || '',
|
|
|
url: 'http:' + data.url
|
|
|
}
|
|
|
this.fileList.push(item)
|
|
@@ -1193,7 +1226,7 @@ export default {
|
|
|
this.bugUpdate(this.bug, 'accessory')
|
|
|
window.uploadFiles = null
|
|
|
},
|
|
|
- update(file) {
|
|
|
+ updateFile(file) {
|
|
|
const param = new FormData() // 创建form对象
|
|
|
param.append('file', file)// 通过append向form对象添加数据
|
|
|
const config = {
|
|
@@ -1402,4 +1435,12 @@ export default {
|
|
|
color:#F56C6C;
|
|
|
position: absolute;
|
|
|
}
|
|
|
+.file-dialog {
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
+.image-url {
|
|
|
+ width: 50%;
|
|
|
+}
|
|
|
</style>
|