Commit 98c8b50b authored by zhengke's avatar zhengke

修复 替换本地图 的比例

parent 54d70992
...@@ -21,10 +21,17 @@ class ConfigService{ ...@@ -21,10 +21,17 @@ class ConfigService{
/** /**
* 新增修改模版数据 * 新增修改模版数据
*/ */
static async SetSetTripConfig(params : any):Promise<HttpResponse>{ static async SetTripConfig(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_SetTripConfig",params) return Api.Post("triptemplate_SetTripConfig",params)
} }
/**
* 删除模版
*/
static async SetDeleteTripTemplate(params : any):Promise<HttpResponse>{
return Api.Post("triptemplate_RemoveTripTemplate",params)
}
/** /**
* 新增修改模版 * 新增修改模版
*/ */
......
...@@ -199,23 +199,46 @@ const setImgs = async () => { ...@@ -199,23 +199,46 @@ const setImgs = async () => {
maxWidth = VIEWPORT_VER_SIZE maxWidth = VIEWPORT_VER_SIZE
maxHeight = VIEWPORT_SIZE maxHeight = VIEWPORT_SIZE
} }
let tempSize = await FileService.getImageSizeWithoutDownloading(propsDatas.value.src) let tempSize = null
if(tempSize.width>maxWidth){ if(activeName.value==1||activeName.value==3){
let ratio = maxWidth/tempSize.width tempSize = await FileService.getImageSizeWithoutDownloading(propsDatas.value.src)
tempSize.width = maxWidth if(tempSize.width>maxWidth){
tempSize.height = tempSize.height*ratio let ratio = maxWidth/tempSize.width
tempSize.width = maxWidth
tempSize.height = tempSize.height*ratio
}
if(tempSize.height>maxHeight){
let ratio = maxHeight/tempSize.height
tempSize.height = maxHeight
tempSize.width = tempSize.width*ratio
}
if(y.left<0)y.left=0
if(y.top<0)y.top=0
y.width = tempSize.width
y.height = tempSize.height
}else{
var img = new Image()
img.src = propsDatas.value.src
img.onload = () => {
if(img.width>maxWidth){
let ratio = maxWidth/img.width
img.width = maxWidth
img.height = img.height*ratio
}
if(img.height>maxHeight){
let ratio = maxHeight/img.height
img.height = maxHeight
img.width = img.width*ratio
}
if(y.left<0)y.left=0
if(y.top<0)y.top=0
y.width = img.width
y.height = img.height
}
y.src = propsDatas.value.src
y.fixedRatio = true
} }
if(tempSize.height>maxHeight){
let ratio = maxHeight/tempSize.height
tempSize.height = maxHeight
tempSize.width = tempSize.width*ratio
}
if(y.left<0)y.left=0
if(y.top<0)y.top=0
y.width = tempSize.width
y.height = tempSize.height
y.src = propsDatas.value.src
y.fixedRatio = true
} }
} }
} }
......
...@@ -312,7 +312,7 @@ const SetTripTemplateConfig = async () => { ...@@ -312,7 +312,7 @@ const SetTripTemplateConfig = async () => {
TempId: queryObj.value.TempId, TempId: queryObj.value.TempId,
TempData: queryObj.value.TempData, TempData: queryObj.value.TempData,
} }
let TemplateRes = await ConfigService.SetSetTripConfig(queryMsg); let TemplateRes = await ConfigService.SetTripConfig(queryMsg);
if (TemplateRes.data.resultCode == 1) { if (TemplateRes.data.resultCode == 1) {
if(!ConfigId.value){ if(!ConfigId.value){
ConfigIdStore.value = TemplateRes.data.data.ConfigId ConfigIdStore.value = TemplateRes.data.data.ConfigId
......
...@@ -71,15 +71,17 @@ ...@@ -71,15 +71,17 @@
<div class="MarketIndexListBox bg-white rounded"> <div class="MarketIndexListBox bg-white rounded">
<div class="MarketIndexList-Hover"> <div class="MarketIndexList-Hover">
<div> <div>
<el-button type="primary" <el-button class="MarketIndexButtom" type="primary"
style="color: #ffff;" @click="getTemplate(item)">详情</el-button>
@click="getTemplate(item)">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;详情&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</el-button>
</div> </div>
<div class="q-mt-lg"> <div class="q-mt-lg">
<el-button type="primary" <el-button class="MarketIndexButtom" type="primary"
style="color: #ffff;"
@click="goToTemplate(item)">选择该模版</el-button> @click="goToTemplate(item)">选择该模版</el-button>
</div> </div>
<div class="q-mt-lg" v-if="model==1">
<el-button class="MarketIndexButtom" type="primary"
@click="deleteTemplate(item)">删除</el-button>
</div>
</div> </div>
<div class="MarketIndexList-img"> <div class="MarketIndexList-img">
<img :src="item.CoverImg" class="rounded" /> <img :src="item.CoverImg" class="rounded" />
...@@ -122,7 +124,7 @@ ...@@ -122,7 +124,7 @@
import { injectKeyTemplate } from '@/types/injectKey' import { injectKeyTemplate } from '@/types/injectKey'
import LayoutPool from './LayoutPool.vue' import LayoutPool from './LayoutPool.vue'
import { ElMessage } from "element-plus"; import { ElLoading, ElMessage, ElMessageBox } from "element-plus";
const { const {
userInfo userInfo
...@@ -136,6 +138,7 @@ import { ElMessage } from "element-plus"; ...@@ -136,6 +138,7 @@ import { ElMessage } from "element-plus";
const currentPage = ref(1 as Number); const currentPage = ref(1 as Number);
const showCurrentTemplate = ref<any>() const showCurrentTemplate = ref<any>()
const deleteLoading = ref<any>(null)
const datas = reactive({ const datas = reactive({
TemplateRow: {}, TemplateRow: {},
DetailsVisible: false, DetailsVisible: false,
...@@ -166,6 +169,39 @@ import { ElMessage } from "element-plus"; ...@@ -166,6 +169,39 @@ import { ElMessage } from "element-plus";
searchData.value.TempId = 0 searchData.value.TempId = 0
} }
// 删除模版
const deleteTemplate = (item:any) => {
ElMessageBox.confirm(
'此操作将删除该模版,是否确定?',
'提示',
{
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
try {
let queryMsg = {
TempId: item.TempId
}
deleteLoading.value = ElLoading.service()
let dataRes = ConfigService.SetDeleteTripTemplate(queryMsg);
if (dataRes.data.resultCode == 1) {
queryObj.pageIndex == 1
deleteLoading.value.close()
deleteLoading.value = null
ElMessage({
showClose: true,
message: '删除模版成功',
type: 'success',
})
queryTemplateBySearchHandler()
}
} catch (error) {}
}).catch(() => {})
}
// 查看所有子模版 // 查看所有子模版
const getTemplate = async (item:any) => { const getTemplate = async (item:any) => {
...@@ -396,6 +432,10 @@ import { ElMessage } from "element-plus"; ...@@ -396,6 +432,10 @@ import { ElMessage } from "element-plus";
margin-right: 30px; margin-right: 30px;
margin-top: 5px; margin-top: 5px;
} }
.MarketIndexButtom{
color: #ffff;
width: 92px;
}
.layout-item{ .layout-item{
width: 180px; width: 180px;
} }
......
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