|
@@ -0,0 +1,828 @@
|
|
|
+<template>
|
|
|
+ <div class="app-container">
|
|
|
+ <!-- 查询和其他操作 -->
|
|
|
+ <div class="filter-container">
|
|
|
+ <el-radio-group
|
|
|
+ v-model="type" class="filter-item" style="margin-left:10px;" size="mini"
|
|
|
+ >
|
|
|
+ <el-radio-button :label="1">尺寸不变-压缩</el-radio-button>
|
|
|
+ <el-radio-button :label="2">指定宽高压缩</el-radio-button>
|
|
|
+ <el-radio-button :label="3">比列压缩</el-radio-button>
|
|
|
+ <el-radio-button :label="4">添加文字水印</el-radio-button>
|
|
|
+ <el-radio-button :label="5">转换格式</el-radio-button>
|
|
|
+ <el-radio-button :label="6">添加图片水印</el-radio-button>
|
|
|
+ <el-radio-button :label="7">根据坐标裁剪</el-radio-button>
|
|
|
+ <el-radio-button :label="8">整屏添加文字水印</el-radio-button>
|
|
|
+ <el-radio-button :label="9">旋转</el-radio-button>
|
|
|
+ </el-radio-group>
|
|
|
+ <el-button
|
|
|
+ size="mini" type="info" class="filter-item"
|
|
|
+ style="margin-left:10px;" @click="handleReset"
|
|
|
+ >
|
|
|
+ 重置
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <!-- 查询结果 -->
|
|
|
+ <div v-tableHeight>
|
|
|
+ <div style="display: flex;align-items: stretch;height: 100%;">
|
|
|
+ <div style="flex: 1;overflow-y: auto;">
|
|
|
+ <div v-show="type === 1">
|
|
|
+ <el-form
|
|
|
+ ref="formData1"
|
|
|
+ :model="listQuery1"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect1" v-model="listResult1.urls" :upload-type="1"
|
|
|
+ :data="listQuery1" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 2">
|
|
|
+ <el-form
|
|
|
+ ref="formData2"
|
|
|
+ :model="listQuery2"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="宽" prop="width">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery2.width" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入宽"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="高" prop="height">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery2.height" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入高"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect2" v-model="listResult2.urls" :upload-type="2"
|
|
|
+ :data="listQuery2" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 3">
|
|
|
+ <el-form
|
|
|
+ ref="formData3"
|
|
|
+ :model="listQuery3"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="压缩比例" prop="scale">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery3.scale" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入压缩比例"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect3" v-model="listResult3.urls" :upload-type="3"
|
|
|
+ :data="listQuery3" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 4">
|
|
|
+ <el-form
|
|
|
+ ref="formData4"
|
|
|
+ :model="listQuery4"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="位置" prop="position">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery4.position" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入位置"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="文本" prop="waterText">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery4.waterText" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入文本"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="旋转" prop="rotate">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery4.rotate" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入旋转"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="透明度" prop="opacity">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery4.opacity" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入透明度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片质量" prop="quality">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery4.quality" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入图片质量"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect4" v-model="listResult4.urls" :upload-type="4"
|
|
|
+ :data="listQuery4" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 5">
|
|
|
+ <el-form
|
|
|
+ ref="formData5"
|
|
|
+ :model="listQuery5"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="转换后图片格式" prop="toformatImageType">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery5.toformatImageType" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入转换后图片格式"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect5" v-model="listResult5.urls" :upload-type="5"
|
|
|
+ :data="listQuery5" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 6">
|
|
|
+ <el-form
|
|
|
+ ref="formData6"
|
|
|
+ :model="listQuery6"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="宽度" prop="width">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery6.width" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入宽度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="高度" prop="height">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery6.height" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入高度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="位置" prop="position">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery6.position" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入位置"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="水印图片地址" prop="watermark">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery6.watermark" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入水印图片地址"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="透明度" prop="opacity">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery6.opacity" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入透明度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片质量" prop="quality">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery6.quality" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入图片质量"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect6" v-model="listResult6.urls" :upload-type="6"
|
|
|
+ :data="listQuery6" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 7">
|
|
|
+ <el-form
|
|
|
+ ref="formData7"
|
|
|
+ :model="listQuery7"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="起始x坐标" prop="x">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery7.x" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入起始x坐标"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="起始y坐标" prop="y">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery7.y" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入起始y坐标"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="结束x坐标" prop="x1">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery7.x1" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入结束x坐标"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="结束y坐标" prop="y1">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery7.y1" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入结束y坐标"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="是否按照比例缩放" prop="keepAspectRatio">
|
|
|
+ <el-radio-group v-model="listQuery7.keepAspectRatio">
|
|
|
+ <el-radio :label="true">是</el-radio>
|
|
|
+ <el-radio :label="false">否</el-radio>
|
|
|
+ </el-radio-group>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect7" v-model="listResult7.urls" :upload-type="7"
|
|
|
+ :data="listQuery7" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 8">
|
|
|
+ <el-form
|
|
|
+ ref="formData8"
|
|
|
+ :model="listQuery8"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="图片宽度" prop="width">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.width" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入图片宽度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片高度" prop="height">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.height" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入图片高度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="间隔宽度" prop="intervalWidth">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.intervalWidth" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入间隔宽度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="间隔高度" prop="intervalHeight">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.intervalHeight" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入间隔高度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="水印内容列表" prop="waterTextList">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.waterTextList" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入水印内容列表"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="文字大小" prop="fontSize">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.fontSize" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入文字大小"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="透明度" prop="opacity">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.opacity" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入透明度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="质量" prop="quality">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery8.quality" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入质量"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect8" v-model="listResult8.urls" :upload-type="8"
|
|
|
+ :data="listQuery8" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div v-show="type === 9">
|
|
|
+ <el-form
|
|
|
+ ref="formData9"
|
|
|
+ :model="listQuery9"
|
|
|
+ :rules="{}"
|
|
|
+ size="mini"
|
|
|
+ label-suffix=":"
|
|
|
+ label-width="96px"
|
|
|
+ >
|
|
|
+ <el-form-item label="图片宽度" prop="width">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery9.width" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入图片宽度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="图片高度" prop="height">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery9.height" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入图片高度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="角度" prop="rotate">
|
|
|
+ <el-input
|
|
|
+ v-model="listQuery9.rotate" clearable size="mini"
|
|
|
+ style="width: 200px;" placeholder="请输入角度"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="原图" prop="file">
|
|
|
+ <ImageSelect
|
|
|
+ ref="ImageSelect9" v-model="listResult9.urls" :upload-type="9"
|
|
|
+ :data="listQuery9" :limit="1"
|
|
|
+ />
|
|
|
+ </el-form-item>
|
|
|
+ </el-form>
|
|
|
+ </div>
|
|
|
+ <div style="text-align: center;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleSubmit"
|
|
|
+ >
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div style="flex: 1;padding: 0 0 0 10px;border-left: 1px dashed #000;">
|
|
|
+ <div v-if="type === 1">
|
|
|
+ <div v-if="listResult1.urls && listResult1.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult1.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult1.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 2">
|
|
|
+ <div v-if="listResult2.urls && listResult2.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult2.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult2.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 3">
|
|
|
+ <div v-if="listResult3.urls && listResult3.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult3.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult3.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 4">
|
|
|
+ <div v-if="listResult4.urls && listResult4.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult4.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult4.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 5">
|
|
|
+ <div v-if="listResult5.urls && listResult5.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult5.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult5.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 6">
|
|
|
+ <div v-if="listResult6.urls && listResult6.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult6.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult6.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 7">
|
|
|
+ <div v-if="listResult7.urls && listResult7.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult7.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult7.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 8">
|
|
|
+ <div v-if="listResult8.urls && listResult8.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult8.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult8.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ <div v-else-if="type === 9">
|
|
|
+ <div v-if="listResult9.urls && listResult9.urls.length" style="text-align: center;">
|
|
|
+ <div v-for="(item, index) in listResult9.urls.map(i => i.url)" :key="index" style="margin-bottom: 10px;">
|
|
|
+ <el-image
|
|
|
+ :src="common.seamingImgUrl(item)" style="width:180px;height:180px;margin-right: 10px;" fit="cover"
|
|
|
+ :preview-src-list="listResult9.urls.map(i => common.seamingImgUrl(i.url))"
|
|
|
+ />
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <div>图片地址:</div>
|
|
|
+ <div>{{ item && item.url }}</div>
|
|
|
+ </div>
|
|
|
+ <div style="margin-top: 10px;">
|
|
|
+ <el-button
|
|
|
+ type="primary" size="mini"
|
|
|
+ @click="handleDownload(item.url)"
|
|
|
+ >
|
|
|
+ 下载
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <span v-else>--</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import ImageSelect from '@/components/ImageSelect'
|
|
|
+// import {
|
|
|
+// updateCompressImage,
|
|
|
+// updateCompressImageWithWH,
|
|
|
+// updateCompressImageWithScale,
|
|
|
+// updateCompressAddTextWater,
|
|
|
+// updateCompressFormatImage,
|
|
|
+// updateCompressAddImageWater,
|
|
|
+// updateCompressCutImage,
|
|
|
+// updateCompressAddTextWaterFullScreen,
|
|
|
+// updateCompressRotateImage
|
|
|
+// } from '@/api/setup'
|
|
|
+import { download } from '@/utils/file'
|
|
|
+
|
|
|
+export default {
|
|
|
+ name: 'ImageProcessing',
|
|
|
+ components: {
|
|
|
+ ImageSelect
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ type: 1,
|
|
|
+
|
|
|
+ listQuery1: { }, // file: ''
|
|
|
+ listResult1: { urls: [] },
|
|
|
+
|
|
|
+ listQuery2: { width: '', height: '' }, // file: ''
|
|
|
+ listResult2: { urls: [] },
|
|
|
+
|
|
|
+ listQuery3: { scale: '' }, // file: ''
|
|
|
+ listResult3: { urls: [] },
|
|
|
+
|
|
|
+ listQuery4: { position: '', waterText: '', rotate: '', opacity: '', quality: '' }, // file: ''
|
|
|
+ listResult4: { urls: [] },
|
|
|
+
|
|
|
+ listQuery5: { toformatImageType: '' }, // file: ''
|
|
|
+ listResult5: { urls: [] },
|
|
|
+
|
|
|
+ listQuery6: { width: '', height: '', position: '', watermark: '', opacity: '', quality: '' }, // file: ''
|
|
|
+ listResult6: { urls: [] },
|
|
|
+
|
|
|
+ listQuery7: { x: '', y: '', x1: '', y1: '', keepAspectRatio: true }, // file: ''
|
|
|
+ listResult7: { urls: [] },
|
|
|
+
|
|
|
+ listQuery8: { width: '', height: '', intervalWidth: '', intervalHeight: '', waterTextList: '', fontSize: '', opacity: '', quality: '' }, // file: ''
|
|
|
+ listResult8: { urls: [] },
|
|
|
+
|
|
|
+ listQuery9: { width: '', height: '', rotate: '' }, // file: ''
|
|
|
+ listResult9: { urls: [] }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ handleSubmit() {
|
|
|
+ if (this.type === 1) {
|
|
|
+ this.$refs.ImageSelect1.$refs.upload.submit()
|
|
|
+ } else if (this.type === 2) {
|
|
|
+ this.$refs.ImageSelect2.$refs.upload.submit()
|
|
|
+ } else if (this.type === 3) {
|
|
|
+ this.$refs.ImageSelect3.$refs.upload.submit()
|
|
|
+ } else if (this.type === 4) {
|
|
|
+ this.$refs.ImageSelect4.$refs.upload.submit()
|
|
|
+ } else if (this.type === 5) {
|
|
|
+ this.$refs.ImageSelect5.$refs.upload.submit()
|
|
|
+ } else if (this.type === 6) {
|
|
|
+ this.$refs.ImageSelect6.$refs.upload.submit()
|
|
|
+ } else if (this.type === 7) {
|
|
|
+ this.$refs.ImageSelect7.$refs.upload.submit()
|
|
|
+ } else if (this.type === 8) {
|
|
|
+ this.$refs.ImageSelect8.$refs.upload.submit()
|
|
|
+ } else if (this.type === 9) {
|
|
|
+ this.$refs.ImageSelect9.$refs.upload.submit()
|
|
|
+ }
|
|
|
+ // let _api
|
|
|
+ // let params
|
|
|
+ // if (this.type === 1) {
|
|
|
+ // _api = updateCompressImage
|
|
|
+ // params = this.listQuery1
|
|
|
+ // } else if (this.type === 2) {
|
|
|
+ // _api = updateCompressImageWithWH
|
|
|
+ // params = this.listQuery2
|
|
|
+ // } else if (this.type === 3) {
|
|
|
+ // _api = updateCompressImageWithScale
|
|
|
+ // params = this.listQuery3
|
|
|
+ // } else if (this.type === 4) {
|
|
|
+ // _api = updateCompressAddTextWater
|
|
|
+ // params = this.listQuery4
|
|
|
+ // } else if (this.type === 5) {
|
|
|
+ // _api = updateCompressFormatImage
|
|
|
+ // params = this.listQuery5
|
|
|
+ // } else if (this.type === 6) {
|
|
|
+ // _api = updateCompressAddImageWater
|
|
|
+ // params = this.listQuery6
|
|
|
+ // } else if (this.type === 7) {
|
|
|
+ // _api = updateCompressCutImage
|
|
|
+ // params = this.listQuery7
|
|
|
+ // } else if (this.type === 8) {
|
|
|
+ // _api = updateCompressAddTextWaterFullScreen
|
|
|
+ // params = this.listQuery8
|
|
|
+ // } else if (this.type === 9) {
|
|
|
+ // _api = updateCompressRotateImage
|
|
|
+ // params = this.listQuery9
|
|
|
+ // }
|
|
|
+ // if (this.type && params.file) {
|
|
|
+ // const loading = this.$loading({ text: '提交中,请稍候……' })
|
|
|
+ // try {
|
|
|
+ // _api(params)
|
|
|
+ // loading.close()
|
|
|
+ // this.$message({ message: `${this.formData.id ? '编辑' : '添加'}成功!`, type: 'success' })
|
|
|
+ // this.$emit('success')
|
|
|
+ // this.visible = false
|
|
|
+ // } catch (e) {
|
|
|
+ // loading.close()
|
|
|
+ // } finally {
|
|
|
+ // loading.close()
|
|
|
+ // }
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少原图', type: 'warning' })
|
|
|
+ // return false
|
|
|
+ // }
|
|
|
+ },
|
|
|
+ handleReset() {
|
|
|
+ if (this.type === 1) {
|
|
|
+ this.listQuery1 = { }
|
|
|
+ this.listResult1 = { urls: [] }
|
|
|
+ } else if (this.type === 2) {
|
|
|
+ this.listQuery2 = { width: '', height: '' }
|
|
|
+ this.listResult2 = { urls: [] }
|
|
|
+ } else if (this.type === 3) {
|
|
|
+ this.listQuery3 = { scale: '' }
|
|
|
+ this.listResult3 = { urls: [] }
|
|
|
+ } else if (this.type === 4) {
|
|
|
+ this.listQuery4 = { position: '', waterText: '', rotate: '', opacity: '', quality: '' }
|
|
|
+ this.listResult4 = { urls: [] }
|
|
|
+ } else if (this.type === 5) {
|
|
|
+ this.listQuery5 = { toformatImageType: '' }
|
|
|
+ this.listResult5 = { urls: [] }
|
|
|
+ } else if (this.type === 6) {
|
|
|
+ this.listQuery6 = { width: '', height: '', position: '', watermark: '', opacity: '', quality: '' }
|
|
|
+ this.listResult6 = { urls: [] }
|
|
|
+ } else if (this.type === 7) {
|
|
|
+ this.listQuery7 = { x: '', y: '', x1: '', y1: '', keepAspectRatio: true }
|
|
|
+ this.listResult7 = { urls: [] }
|
|
|
+ } else if (this.type === 8) {
|
|
|
+ this.listQuery8 = { width: '', height: '', intervalWidth: '', intervalHeight: '', waterTextList: '', fontSize: '', opacity: '', quality: '' }
|
|
|
+ this.listResult8 = { urls: [] }
|
|
|
+ } else if (this.type === 9) {
|
|
|
+ this.listQuery9 = { width: '', height: '', rotate: '' }
|
|
|
+ this.listResult9 = { urls: [] }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ handleDownload(url) {
|
|
|
+ if (url) {
|
|
|
+ download(url, '处理图片', url.substring(url.lastIndexOf('.') + 1), false)
|
|
|
+ } else {
|
|
|
+ this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ }
|
|
|
+ // if (this.type === 1) {
|
|
|
+ // if (this.listResult1.url) {
|
|
|
+ // download(this.listResult1.url, '处理图片', this.listResult1.url.substring(this.listResult1.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 2) {
|
|
|
+ // if (this.listResult2.url) {
|
|
|
+ // download(this.listResult2.url, '处理图片', this.listResult2.url.substring(this.listResult2.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 3) {
|
|
|
+ // if (this.listResult3.url) {
|
|
|
+ // download(this.listResult3.url, '处理图片', this.listResult3.url.substring(this.listResult3.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 4) {
|
|
|
+ // if (this.listResult4.url) {
|
|
|
+ // download(this.listResult4.url, '处理图片', this.listResult4.url.substring(this.listResult4.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 5) {
|
|
|
+ // if (this.listResult5.url) {
|
|
|
+ // download(this.listResult5.url, '处理图片', this.listResult5.url.substring(this.listResult5.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 6) {
|
|
|
+ // if (this.listResult6.url) {
|
|
|
+ // download(this.listResult6.url, '处理图片', this.listResult6.url.substring(this.listResult6.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 7) {
|
|
|
+ // if (this.listResult7.url) {
|
|
|
+ // download(this.listResult7.url, '处理图片', this.listResult7.url.substring(this.listResult7.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 8) {
|
|
|
+ // if (this.listResult8.url) {
|
|
|
+ // download(this.listResult8.url, '处理图片', this.listResult8.url.substring(this.listResult8.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // } else if (this.type === 9) {
|
|
|
+ // if (this.listResult9.url) {
|
|
|
+ // download(this.listResult9.url, '处理图片', this.listResult9.url.substring(this.listResult9.url.lastIndexOf('.') + 1), false)
|
|
|
+ // } else {
|
|
|
+ // this.$message({ message: '缺少图片', type: 'warning' })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</script>
|
|
|
+
|
|
|
+<style lang="scss" scoped>
|
|
|
+.app-container {
|
|
|
+ padding: 20px;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+
|
|
|
+ .filter-container {
|
|
|
+ .filter-item {
|
|
|
+ display: inline-block;
|
|
|
+ vertical-align: middle;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|