|
@@ -148,6 +148,7 @@
|
|
|
<el-upload
|
|
<el-upload
|
|
|
:disabled="isView"
|
|
:disabled="isView"
|
|
|
ref="upload"
|
|
ref="upload"
|
|
|
|
|
+ :multiple="true"
|
|
|
:action="$http.adornUrl('/admin/file/simpleUpload')"
|
|
:action="$http.adornUrl('/admin/file/simpleUpload')"
|
|
|
list-type="picture-card"
|
|
list-type="picture-card"
|
|
|
accept="image/*"
|
|
accept="image/*"
|
|
@@ -158,6 +159,9 @@
|
|
|
:on-preview="handlePicPreview">
|
|
:on-preview="handlePicPreview">
|
|
|
<i class="el-icon-plus"></i>
|
|
<i class="el-icon-plus"></i>
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
|
|
+ <div @paste="pasteImg($event)">
|
|
|
|
|
+ <textarea placeholder="点击这里,然后把图片粘贴" style="width: 100%;height: 100px;border: 1px solid #c9c9c9;border-radius: 5px;"></textarea>
|
|
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
</el-form>
|
|
</el-form>
|
|
|
<span slot="footer" class="dialog-footer">
|
|
<span slot="footer" class="dialog-footer">
|
|
@@ -174,6 +178,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import ImgUpload from '@/components/img-upload';
|
|
import ImgUpload from '@/components/img-upload';
|
|
|
import OrderInfo from "../order/orderInfo";
|
|
import OrderInfo from "../order/orderInfo";
|
|
|
|
|
+ import { uploadFile } from '@/utils/httpRequest.js'
|
|
|
export default {
|
|
export default {
|
|
|
components: {
|
|
components: {
|
|
|
ImgUpload,OrderInfo
|
|
ImgUpload,OrderInfo
|
|
@@ -305,6 +310,31 @@ export default {
|
|
|
handlePicRemove(file, fileList){
|
|
handlePicRemove(file, fileList){
|
|
|
this.fileList = fileList;
|
|
this.fileList = fileList;
|
|
|
},
|
|
},
|
|
|
|
|
+ /**
|
|
|
|
|
+ * textarea图片粘贴事件
|
|
|
|
|
+ */
|
|
|
|
|
+ pasteImg(e) {
|
|
|
|
|
+ console.log(e)
|
|
|
|
|
+ const { items } = e.clipboardData; // 获取粘贴板文件对象
|
|
|
|
|
+ if (items.length) {
|
|
|
|
|
+ for (const item of items) {
|
|
|
|
|
+ if (item.type.indexOf('image') !== -1) {
|
|
|
|
|
+ const file = item.getAsFile(); // 获取图片文件
|
|
|
|
|
+ if (file) {
|
|
|
|
|
+ uploadFile(
|
|
|
|
|
+ this.$http.adornUrl('/admin/file/simpleUpload'),
|
|
|
|
|
+ file
|
|
|
|
|
+ ).then(({ data }) => {
|
|
|
|
|
+ // this.$refs['file'].value = null // 解决上传同一图片不显示bug
|
|
|
|
|
+ // { url: this.resourcesUrl + picArray[i], response: {filePath: picArray[i] }
|
|
|
|
|
+ let obj = {url: data.resourcesUrl + data.filePath, response: {filePath: data.filePath }}
|
|
|
|
|
+ this.fileList.push(obj)
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
dialogClose(){
|
|
dialogClose(){
|
|
|
this.fileList = [];
|
|
this.fileList = [];
|
|
|
this.dataForm = {};
|
|
this.dataForm = {};
|