mirror of
https://gitee.com/beijing_hongye_huicheng/lilishop-ui.git
synced 2026-08-06 10:57:26 +08:00
Merge branch 'vue3'
This commit is contained in:
@@ -190,7 +190,7 @@
|
||||
<el-upload
|
||||
v-if="canUploadImages"
|
||||
ref="up"
|
||||
:action="commonUrl + '/common/common/upload/file'"
|
||||
:action="managerApiUrl + '/manager/common/upload/file'"
|
||||
:data="uploadData"
|
||||
:headers="accessToken"
|
||||
:before-upload="beforeUpload"
|
||||
@@ -385,7 +385,7 @@ import {
|
||||
updateFileDirectory,
|
||||
} from "@/api/index";
|
||||
import DPlayer from "dplayer";
|
||||
import {commonUrl} from "@/libs/axios";
|
||||
import {managerApiUrl} from "@/libs/axios";
|
||||
import config from "@/config/index";
|
||||
import playIcon from "@/assets/play.png";
|
||||
|
||||
@@ -417,7 +417,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
commonUrl, // 上传文件路径
|
||||
managerApiUrl, // 上传文件路径
|
||||
config, // api地址
|
||||
fileDirectoryId: "",
|
||||
groupFormValidate: {
|
||||
|
||||
@@ -51,15 +51,6 @@
|
||||
</el-form-item>
|
||||
</div>
|
||||
<div class="label-btns goods-setting-btns">
|
||||
<div class="goods-setting-action-row">
|
||||
<el-button type="success" @click="createIndex()">重新生成所有商品索引</el-button>
|
||||
<el-button type="info" @click="deleteDownGoods()">删除ES中下架的商品</el-button>
|
||||
<el-button type="warning" @click="generateCache()">生成所有商品的缓存</el-button>
|
||||
<el-button type="danger" @click="deleteNotExistIndex()">删除不存在的索引</el-button>
|
||||
<div class="progress-item" v-if="showProgress">
|
||||
<el-progress :percentage="progressVal" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="goods-setting-save-row">
|
||||
<el-button type="primary" @click="submit('formValidate')">保存</el-button>
|
||||
</div>
|
||||
@@ -69,7 +60,7 @@
|
||||
</template>
|
||||
<script>
|
||||
import { ElMessage } from "element-plus";
|
||||
import { setSetting, createIndex, getProgress, deleteGoodsDown, generateGoodsCache, delSkuIndex } from "@/api/index";
|
||||
import { setSetting } from "@/api/index";
|
||||
export default {
|
||||
props: ["res", "type"],
|
||||
data() {
|
||||
@@ -83,9 +74,6 @@ export default {
|
||||
originalPictureWidth: "0",
|
||||
originalPictureHeight: "0",
|
||||
},
|
||||
progressVal: 0,
|
||||
showProgress: false,
|
||||
intervalProgress: null,
|
||||
ruleValidate: {},
|
||||
result: "",
|
||||
};
|
||||
@@ -103,69 +91,6 @@ export default {
|
||||
}
|
||||
});
|
||||
},
|
||||
createIndex() {
|
||||
createIndex().then((res) => {
|
||||
if (res.success) {
|
||||
ElMessage.success("开始生成!");
|
||||
this.showProgress = true;
|
||||
setTimeout(() => {
|
||||
this.intervalProgress = setInterval(() => {
|
||||
getProgress().then((resp) => {
|
||||
const progressResult = resp.result;
|
||||
if (progressResult != null && progressResult.flag === 0) {
|
||||
clearInterval(this.intervalProgress);
|
||||
this.showProgress = false;
|
||||
ElMessage.success("生成成功!");
|
||||
} else {
|
||||
this.progressVal = Math.floor((progressResult.processed / progressResult.total) * 100);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}, 10000);
|
||||
} else if (res.code === 100000) {
|
||||
this.showProgress = true;
|
||||
this.intervalProgress = setInterval(() => {
|
||||
getProgress().then((resp) => {
|
||||
const progressResult = resp.result;
|
||||
if (progressResult != null && progressResult.flag === 0) {
|
||||
clearInterval(this.intervalProgress);
|
||||
this.showProgress = false;
|
||||
ElMessage.success("生成成功!");
|
||||
} else {
|
||||
this.progressVal = Math.floor((progressResult.processed / progressResult.total) * 100);
|
||||
}
|
||||
});
|
||||
}, 1000);
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteDownGoods() {
|
||||
deleteGoodsDown().then((res) => {
|
||||
if (res.success) {
|
||||
ElMessage.success("删除成功!");
|
||||
} else {
|
||||
ElMessage.error("删除失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
generateCache() {
|
||||
generateGoodsCache().then((res) => {
|
||||
if (res.success) {
|
||||
ElMessage.success("生成成功!");
|
||||
} else {
|
||||
ElMessage.error("生成失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
deleteNotExistIndex() {
|
||||
delSkuIndex().then((res) => {
|
||||
if (res.success) {
|
||||
ElMessage.success("删除成功!");
|
||||
} else {
|
||||
ElMessage.error("删除失败!");
|
||||
}
|
||||
});
|
||||
},
|
||||
setupSetting() {
|
||||
setSetting(this.type, this.formValidate).then((res) => {
|
||||
if (res.success) {
|
||||
@@ -217,19 +142,6 @@ export default {
|
||||
gap: 10px;
|
||||
margin-left: 150px;
|
||||
}
|
||||
.goods-setting-action-row {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
}
|
||||
.goods-setting-action-row .progress-item {
|
||||
flex: 0 0 240px;
|
||||
min-width: 200px;
|
||||
}
|
||||
.goods-setting-action-row .progress-item :deep(.el-progress) {
|
||||
width: 100%;
|
||||
}
|
||||
:deep(.el-input){
|
||||
width: 180px !important;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user