Commit 7df96f11 authored by 周远喜's avatar 周远喜

工序,工步内容包含图片粘贴功能。

parent eb77f52a
...@@ -249,25 +249,24 @@ export default { ...@@ -249,25 +249,24 @@ export default {
}); });
}, },
handleImg(e) { handleImg(e) {
console.warn(e); let file = null
// let file = null if (
// if ( e.clipboardData &&
// e.clipboardData && e.clipboardData.items[0] &&
// e.clipboardData.items[0] && e.clipboardData.items[0].type &&
// e.clipboardData.items[0].type && e.clipboardData.items[0].type.indexOf('image') > -1
// e.clipboardData.items[0].type.indexOf('image') > -1 ) {
// ) { //这里就是判断是否有粘贴进来的文件且文件为图片格式
// //这里就是判断是否有粘贴进来的文件且文件为图片格式 file = e.clipboardData.items[0].getAsFile()
// file = e.clipboardData.items[0].getAsFile() let reader = new FileReader()
// let reader = new FileReader() reader.readAsDataURL(file)
// reader.readAsDataURL(file) setTimeout(() => {
// setTimeout(() => { var img = '<img src="' + reader.result + '" alt=""/>'
// var img = '<img src="' + reader.result + '" alt=""/>' this.entity.taskContent += img
// this.bugForm.content += img }, 1000)
// }, 1000)
// // new R // new R
// } }
}, },
l(key) { l(key) {
key = "routing_detail" + "." + key; key = "routing_detail" + "." + key;
......
...@@ -157,26 +157,25 @@ export default { ...@@ -157,26 +157,25 @@ export default {
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
}, },
handleImg(e) { handleImg(e) {
console.warn(e); let file = null
// let file = null if (
// if ( e.clipboardData &&
// e.clipboardData && e.clipboardData.items[0] &&
// e.clipboardData.items[0] && e.clipboardData.items[0].type &&
// e.clipboardData.items[0].type && e.clipboardData.items[0].type.indexOf('image') > -1
// e.clipboardData.items[0].type.indexOf('image') > -1 ) {
// ) { //这里就是判断是否有粘贴进来的文件且文件为图片格式
// //这里就是判断是否有粘贴进来的文件且文件为图片格式 file = e.clipboardData.items[0].getAsFile()
// file = e.clipboardData.items[0].getAsFile() let reader = new FileReader()
// let reader = new FileReader() reader.readAsDataURL(file)
// reader.readAsDataURL(file) setTimeout(() => {
// setTimeout(() => { var img = '<img src="' + reader.result + '" alt=""/>'
// var img = '<img src="' + reader.result + '" alt=""/>' this.entity.taskContent += img
// this.bugForm.content += img }, 1000)
// }, 1000)
// // new R // new R
// } }
}, },
l(key) { l(key) {
key = "routing_detail" + "." + key; key = "routing_detail" + "." + key;
......
...@@ -165,26 +165,25 @@ export default { ...@@ -165,26 +165,25 @@ export default {
} }
}); });
}, },
handleImg(e) { handleImg(e) {
console.warn(e) let file = null
// let file = null if (
// if ( e.clipboardData &&
// e.clipboardData && e.clipboardData.items[0] &&
// e.clipboardData.items[0] && e.clipboardData.items[0].type &&
// e.clipboardData.items[0].type && e.clipboardData.items[0].type.indexOf('image') > -1
// e.clipboardData.items[0].type.indexOf('image') > -1 ) {
// ) { //这里就是判断是否有粘贴进来的文件且文件为图片格式
// //这里就是判断是否有粘贴进来的文件且文件为图片格式 file = e.clipboardData.items[0].getAsFile()
// file = e.clipboardData.items[0].getAsFile() let reader = new FileReader()
// let reader = new FileReader() reader.readAsDataURL(file)
// reader.readAsDataURL(file) setTimeout(() => {
// setTimeout(() => { var img = '<img src="' + reader.result + '" alt=""/>'
// var img = '<img src="' + reader.result + '" alt=""/>' this.entity.stepContent += img
// this.bugForm.content += img }, 1000)
// }, 1000)
// // new R // new R
// } }
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
......
...@@ -161,26 +161,25 @@ export default { ...@@ -161,26 +161,25 @@ export default {
} }
}); });
}, },
handleImg(e) { handleImg(e) {
console.warn(e) let file = null
// let file = null if (
// if ( e.clipboardData &&
// e.clipboardData && e.clipboardData.items[0] &&
// e.clipboardData.items[0] && e.clipboardData.items[0].type &&
// e.clipboardData.items[0].type && e.clipboardData.items[0].type.indexOf('image') > -1
// e.clipboardData.items[0].type.indexOf('image') > -1 ) {
// ) { //这里就是判断是否有粘贴进来的文件且文件为图片格式
// //这里就是判断是否有粘贴进来的文件且文件为图片格式 file = e.clipboardData.items[0].getAsFile()
// file = e.clipboardData.items[0].getAsFile() let reader = new FileReader()
// let reader = new FileReader() reader.readAsDataURL(file)
// reader.readAsDataURL(file) setTimeout(() => {
// setTimeout(() => { var img = '<img src="' + reader.result + '" alt=""/>'
// var img = '<img src="' + reader.result + '" alt=""/>' this.entity.stepContent += img
// this.bugForm.content += img }, 1000)
// }, 1000)
// // new R // new R
// } }
}, },
handleClose() { handleClose() {
this.$emit("on-close"); this.$emit("on-close");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment