mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 19:07:25 +08:00
refactor: 统一组件导入方式与样式调整
- 将多个组件中的 require 替换为 import,提升代码一致性。 - 更新上传组件中的回调函数,简化图片选择逻辑。 - 调整样式以适配 Element Plus 组件,确保界面一致性。 - 删除不再使用的样式,优化项目结构。
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import hotzone from './index.vue'
|
||||
|
||||
hotzone.install = (Vue) => {
|
||||
Vue.component(hotzone.name, hotzone)
|
||||
hotzone.install = (app) => {
|
||||
app.component(hotzone.name, hotzone)
|
||||
}
|
||||
|
||||
export default hotzone
|
||||
|
||||
@@ -42,17 +42,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
:deep(.ivu-scroll-container){
|
||||
width: 100% !important;
|
||||
height: 400px !important;
|
||||
}
|
||||
|
||||
:deep(.ivu-scroll-content){
|
||||
/* */
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.wap-content-list {
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
@@ -33,13 +33,10 @@ export default {
|
||||
};
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
:deep(.ivu-card-body){
|
||||
:deep(.el-card__body) {
|
||||
height: 414px;
|
||||
overflow: auto;
|
||||
}
|
||||
.ivu-table-wrapper ivu-table-wrapper-with-border {
|
||||
height: 300px !important;
|
||||
}
|
||||
.list {
|
||||
margin: 0 1.5%;
|
||||
height: 400px;
|
||||
@@ -69,11 +66,11 @@ export default {
|
||||
height: 416px;
|
||||
overflow: hidden;
|
||||
}
|
||||
:deep(.ivu-table){
|
||||
:deep(.el-table) {
|
||||
height: 300px !important;
|
||||
overflow: auto;
|
||||
}
|
||||
:deep(.ivu-card-body){
|
||||
:deep(.el-card__body) {
|
||||
padding: 0;
|
||||
height: auto;
|
||||
}
|
||||
|
||||
@@ -63,12 +63,8 @@
|
||||
ref="ossManage"
|
||||
:is-component="true"
|
||||
:initialize="picModalFlag"
|
||||
@selected="handleOssSelected"
|
||||
@callback="handleOssCallback"
|
||||
/>
|
||||
<template #footer>
|
||||
<el-button @click="cancelPicModal">取消</el-button>
|
||||
<el-button type="primary" @click="confirmPicModal">确认</el-button>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
@@ -117,14 +113,12 @@ export default {
|
||||
viewImage: false,
|
||||
uploadFileUrl: uploadFile,
|
||||
picModalFlag: false,
|
||||
pendingSelection: [],
|
||||
selectedFormBtnName: "",
|
||||
picIndex: "",
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
handleCLickImg(val, index) {
|
||||
this.pendingSelection = [];
|
||||
this.picModalFlag = true;
|
||||
this.selectedFormBtnName = val;
|
||||
this.picIndex = index;
|
||||
@@ -134,41 +128,16 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
handleOssSelected(list) {
|
||||
this.pendingSelection = Array.isArray(list) ? list : [];
|
||||
},
|
||||
parseOssSelectionUrl(item) {
|
||||
if (!item) {
|
||||
return "";
|
||||
}
|
||||
if (typeof item === "string") {
|
||||
const index = item.indexOf(",");
|
||||
return index >= 0 ? item.slice(index + 1) : item;
|
||||
}
|
||||
return item.url || "";
|
||||
},
|
||||
confirmPicModal() {
|
||||
const list = this.pendingSelection || [];
|
||||
if (!list.length) {
|
||||
this.$Message.warning("请先选择图片");
|
||||
return;
|
||||
}
|
||||
const url = this.parseOssSelectionUrl(list[list.length - 1]);
|
||||
if (!url) {
|
||||
this.$Message.warning("请选择有效图片");
|
||||
return;
|
||||
}
|
||||
handleOssCallback(item) {
|
||||
this.picModalFlag = false;
|
||||
this.currentValue = url;
|
||||
if (!item?.url) return;
|
||||
this.currentValue = item.url;
|
||||
this.picIndex = "";
|
||||
this.emitValue(this.currentValue);
|
||||
this.pendingSelection = [];
|
||||
},
|
||||
cancelPicModal() {
|
||||
this.picModalFlag = false;
|
||||
},
|
||||
resetPicModal() {
|
||||
this.pendingSelection = [];
|
||||
this.selectedFormBtnName = "";
|
||||
this.picIndex = "";
|
||||
},
|
||||
init() {
|
||||
this.accessToken = {
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
<script>
|
||||
import AMapLoader from "@amap/amap-jsapi-loader";
|
||||
import { getRegion } from "@/api/common.js";
|
||||
import config from "@/config/index";
|
||||
|
||||
const config = require('@/config/index')
|
||||
export default {
|
||||
name: "map",
|
||||
data() {
|
||||
|
||||
Reference in New Issue
Block a user