Commit 7fcf002a authored by “yiyousong”'s avatar “yiyousong”

perf: 修改皮肤分辨率适配

parent 3d0d8e24
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="call-out-skin-across" class="call-out-skin-across"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -87,7 +90,7 @@ export default { ...@@ -87,7 +90,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -99,36 +102,14 @@ export default { ...@@ -99,36 +102,14 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤图片
// filterImg(val) {
// let url = "";
// this.skinFieldList
// .filter((v) => {
// return v.fieldType === "2";
// })
// .forEach((v) => {
// if (v.fieldName !== "" && v.fieldName === val) {
// url = v.fieldValue;
// }
// });
// return url;
// },
// // 过滤颜色
// filterColor(val) {
// let str = "";
// this.skinFieldList
// .filter((v) => {
// return v.fieldType === "1";
// })
// .forEach((v) => {
// if (v.fieldName !== "" && v.fieldName === val) {
// str = v.fieldValue;
// }
// });
// return str;
// },
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
let arr = this.skinFieldList.filter((v) => { let arr = this.skinFieldList.filter((v) => {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="call-out-skin-across" class="call-out-skin-across"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -131,6 +131,9 @@ ...@@ -131,6 +131,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -142,7 +145,7 @@ export default { ...@@ -142,7 +145,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -154,6 +157,13 @@ export default { ...@@ -154,6 +157,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
class="centralize-across" class="centralize-across"
:id="componentsId" :id="componentsId"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -84,7 +84,7 @@ ...@@ -84,7 +84,7 @@
<div <div
class="vertical-skin" class="vertical-skin"
:id="componentsId" :id="componentsId"
v-else-if="imageResolution === '2'" v-else-if="resolution === '1080x1920'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -195,6 +195,9 @@ ...@@ -195,6 +195,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -206,7 +209,7 @@ export default { ...@@ -206,7 +209,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -250,36 +253,14 @@ export default { ...@@ -250,36 +253,14 @@ export default {
], ],
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤图片
// filterImg(val) {
// let url = "";
// this.skinFieldList
// .filter((v) => {
// return v.fieldType === "2";
// })
// .forEach((v) => {
// if (v.fieldName !== "" && v.fieldName === val) {
// url = v.fieldValue;
// }
// });
// return url;
// },
// // 过滤颜色
// filterColor(val) {
// let str = "";
// this.skinFieldList
// .filter((v) => {
// return v.fieldType === "1";
// })
// .forEach((v) => {
// if (v.fieldName !== "" && v.fieldName === val) {
// str = v.fieldValue;
// }
// });
// return str;
// },
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
let arr = this.skinFieldList.filter((v) => { let arr = this.skinFieldList.filter((v) => {
......
...@@ -22,9 +22,12 @@ ...@@ -22,9 +22,12 @@
v-for="(v, i) in previewList" v-for="(v, i) in previewList"
:key="v.id" :key="v.id"
> >
<!-- <div class="resolution">
{{ v.imageResolution }}
</div> -->
<img :src="v.previewImagePath" /> <img :src="v.previewImagePath" />
<div class="name"> <div class="name">
{{ v.name }} {{ v.name }}-{{ filterItems(v.imageResolution, imageResolution) }}
</div> </div>
</div> </div>
</div> </div>
...@@ -44,6 +47,7 @@ ...@@ -44,6 +47,7 @@
import { getSkinList } from "@/services/surface"; import { getSkinList } from "@/services/surface";
import { Empty } from "ant-design-vue"; import { Empty } from "ant-design-vue";
import { mapMutations, mapState } from "vuex"; import { mapMutations, mapState } from "vuex";
import { filterItems } from "@/utils";
export default { export default {
props: { props: {
classifyList: { classifyList: {
...@@ -56,6 +60,7 @@ export default { ...@@ -56,6 +60,7 @@ export default {
}, },
data() { data() {
return { return {
filterItems,
simpleImage: Empty.PRESENTED_IMAGE_SIMPLE, simpleImage: Empty.PRESENTED_IMAGE_SIMPLE,
categoryId: "", // 分类ID categoryId: "", // 分类ID
previewList: [], // 皮肤列表 previewList: [], // 皮肤列表
...@@ -63,7 +68,7 @@ export default { ...@@ -63,7 +68,7 @@ export default {
}; };
}, },
computed: { computed: {
...mapState("site", ["curSkinIndex", "curProduct"]), ...mapState("site", ["curSkinIndex", "curProduct", "imageResolution"]),
}, },
watch: { watch: {
curProduct(newVal) { curProduct(newVal) {
...@@ -190,18 +195,31 @@ export default { ...@@ -190,18 +195,31 @@ export default {
height: 100%; height: 100%;
object-fit: contain; object-fit: contain;
} }
.name { .resolution {
width: 100%; width: 100%;
background-color: rgba(0, 0, 0, 0.3); background-color: rgba(0, 0, 0, 0.3);
color: #fff; color: #fff;
position: absolute; position: absolute;
left: 0px; left: 0px;
bottom: 0px; top: 0px;
text-align: center; text-align: center;
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;
} }
.name {
width: 100%;
background-color: rgba(0, 0, 0, 0.3);
color: #fff;
position: absolute;
left: 0px;
bottom: 0px;
text-align: center;
display: -webkit-box;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
overflow: hidden;
}
} }
.active { .active {
border: 4px solid #ff8522; border: 4px solid #ff8522;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="across-skin" class="across-skin"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<div <div
class="vertical-skin" class="vertical-skin"
:id="componentsId" :id="componentsId"
v-else-if="imageResolution === '2'" v-else-if="resolution === '1080x1920'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -33,6 +33,9 @@ ...@@ -33,6 +33,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
// imgItem: { // imgItem: {
...@@ -51,7 +54,7 @@ export default { ...@@ -51,7 +54,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -63,6 +66,13 @@ export default { ...@@ -63,6 +66,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 桌面自助服务终端 横板 --> <!-- 桌面自助服务终端 横板 -->
<div <div
:id="componentsId" :id="componentsId"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
class="across-skin flex flexc aic" class="across-skin flex flexc aic"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -106,13 +109,20 @@ export default { ...@@ -106,13 +109,20 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
type: String, type: String,
}, },
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
data() { data() {
return { return {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
class="vertical-skin flex flexc aic" class="vertical-skin flex flexc aic"
:id="componentsId" :id="componentsId"
v-if="imageResolution === '2'" v-if="resolution === '1080x1920'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -51,6 +51,9 @@ ...@@ -51,6 +51,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
// imgItem: { // imgItem: {
...@@ -69,7 +72,7 @@ export default { ...@@ -69,7 +72,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -81,6 +84,13 @@ export default { ...@@ -81,6 +84,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="across-skin flex flexc" class="across-skin flex flexc"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
> >
<div <div
class="header" class="header"
...@@ -56,7 +56,7 @@ ...@@ -56,7 +56,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="vertical-skin flex flexc" class="vertical-skin flex flexc"
v-else-if="imageResolution === '2'" v-else-if="resolution === '1080x1920'"
> >
<div <div
class="header" class="header"
...@@ -69,7 +69,7 @@ ...@@ -69,7 +69,7 @@
</div> </div>
<div class="main"> <div class="main">
<div class="left"> <div class="left">
<img class="banner" src="../../../../assets/img/banner2.png" /> <img class="banner" src="../../../../assets/img/pjq.png" />
</div> </div>
<div class="right"> <div class="right">
<img class="banner" src="../../../../assets/img/banner3.png" /> <img class="banner" src="../../../../assets/img/banner3.png" />
...@@ -110,6 +110,9 @@ ...@@ -110,6 +110,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -121,7 +124,7 @@ export default { ...@@ -121,7 +124,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -133,6 +136,13 @@ export default { ...@@ -133,6 +136,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -244,7 +244,7 @@ export default { ...@@ -244,7 +244,7 @@ export default {
formData: { formData: {
categoryId: undefined, // 所属种类 categoryId: undefined, // 所属种类
name: "", // 皮肤名称 name: "", // 皮肤名称
imageResolution: "1", // 分辨率 imageResolution: undefined, // 分辨率
skinFieldList: [], // 字段属性列表 skinFieldList: [], // 字段属性列表
previewImagePath: "", // 预览图地址 previewImagePath: "", // 预览图地址
}, },
...@@ -469,6 +469,7 @@ export default { ...@@ -469,6 +469,7 @@ export default {
onAdd() { onAdd() {
Object.assign(this.formData, this.$options.data().formData); Object.assign(this.formData, this.$options.data().formData);
this.formData.id && this.$delete(this.formData, "id"); this.formData.id && this.$delete(this.formData, "id");
this.formData.imageResolution = Object.keys(this.imageResolution)[0];
}, },
// 编辑 // 编辑
onEdit(row) { onEdit(row) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="across-skin" class="across-skin"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -73,7 +73,7 @@ ...@@ -73,7 +73,7 @@
<div <div
class="vertical-skin" class="vertical-skin"
:id="componentsId" :id="componentsId"
v-else-if="imageResolution === '2'" v-else-if="resolution === '1080x1920'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</div> </div>
</div> </div>
<div class="banner"> <div class="banner">
<img src="../../../../assets/img/Banner.png" alt="" /> <img src="../../../../assets/img/pjq.png" alt="" />
</div> </div>
<div class="meuns flex flexwrap jcb"> <div class="meuns flex flexwrap jcb">
<div <div
...@@ -150,6 +150,9 @@ ...@@ -150,6 +150,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
// imgItem: { // imgItem: {
...@@ -168,7 +171,7 @@ export default { ...@@ -168,7 +171,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -180,6 +183,13 @@ export default { ...@@ -180,6 +183,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 样表机 横板 --> <!-- 样表机 横板 -->
<div <div
:id="componentsId" :id="componentsId"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
class="sample_form_skin flex flexc aic" class="sample_form_skin flex flexc aic"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
...@@ -133,6 +133,9 @@ ...@@ -133,6 +133,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -144,7 +147,7 @@ export default { ...@@ -144,7 +147,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -156,6 +159,13 @@ export default { ...@@ -156,6 +159,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 自助服务终端 横板 --> <!-- 自助服务终端 横板 -->
<div <div
:id="componentsId" :id="componentsId"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
class="across-skin flex flexc aic" class="across-skin flex flexc aic"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
...@@ -95,6 +95,9 @@ ...@@ -95,6 +95,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -106,7 +109,7 @@ export default { ...@@ -106,7 +109,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -118,6 +121,13 @@ export default { ...@@ -118,6 +121,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 导视机 横板 --> <!-- 导视机 横板 -->
<div <div
:id="componentsId" :id="componentsId"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
class="across-skin flex flexc aic" class="across-skin flex flexc aic"
> >
<!-- 头部 --> <!-- 头部 -->
...@@ -74,6 +74,9 @@ ...@@ -74,6 +74,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -85,7 +88,7 @@ export default { ...@@ -85,7 +88,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -97,6 +100,13 @@ export default { ...@@ -97,6 +100,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<div <div
:id="componentsId" :id="componentsId"
class="window-skin-across flex flexc jcb aic" class="window-skin-across flex flexc jcb aic"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
}" }"
...@@ -64,6 +64,9 @@ ...@@ -64,6 +64,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -75,7 +78,7 @@ export default { ...@@ -75,7 +78,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -87,6 +90,13 @@ export default { ...@@ -87,6 +90,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
<!-- 填单机 横板 --> <!-- 填单机 横板 -->
<div <div
:id="componentsId" :id="componentsId"
v-if="imageResolution === '1'" v-if="resolution === '1920x1080'"
class="write_form_skin flex flexc aic" class="write_form_skin flex flexc aic"
:style="{ :style="{
background: filterItem('1', 0), background: filterItem('1', 0),
...@@ -155,6 +155,9 @@ ...@@ -155,6 +155,9 @@
</template> </template>
<script> <script>
import { unifyResolution } from "@/utils";
import { filterItems } from "@/utils";
import { mapGetters } from "vuex";
export default { export default {
props: { props: {
skinFieldList: { skinFieldList: {
...@@ -166,7 +169,7 @@ export default { ...@@ -166,7 +169,7 @@ export default {
}, },
imageResolution: { imageResolution: {
required: true, required: true,
default: "1", default: "",
}, },
componentsId: { componentsId: {
required: true, required: true,
...@@ -178,6 +181,13 @@ export default { ...@@ -178,6 +181,13 @@ export default {
api: process.env.VUE_APP_API_IMG_URL, api: process.env.VUE_APP_API_IMG_URL,
}; };
}, },
computed: {
...mapGetters("site", ["imageResolutions"]),
resolution() {
let data = filterItems(this.imageResolution, this.imageResolutions);
return unifyResolution(data);
},
},
methods: { methods: {
// 过滤属性类型 // 过滤属性类型
filterItem(type, index) { filterItem(type, index) {
......
...@@ -39,6 +39,9 @@ export default { ...@@ -39,6 +39,9 @@ export default {
siteId(state) { siteId(state) {
return state.siteId; return state.siteId;
}, },
imageResolutions(state) {
return state.imageResolution;
},
}, },
mutations: { mutations: {
SET_path(state, path) { SET_path(state, path) {
......
...@@ -17,3 +17,7 @@ export const transverter = (obj) => { ...@@ -17,3 +17,7 @@ export const transverter = (obj) => {
}; };
}); });
}; };
// 统一分辨率格式
export const unifyResolution = (resolution) => {
return resolution.replace(/[xX*]/, "x");
};
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