Prechádzať zdrojové kódy

Merge branch 'xinyan' into dev

xinyan 6 mesiacov pred
rodič
commit
5508194ecd

+ 1 - 1
src/views/score-statistics/Columns.ts

@@ -18,5 +18,5 @@ export const scoreStatisticsColumns = [
 	},
 	{ field: 'review_date', title: '评论日期', minWidth: 'auto' },
 	{ field: 'launch_date', title: '发布日期', minWidth: 'auto' },
-	{ field: 'avg_score', title: '平均评分', align: 'center', minWidth: 'auto' },
+	{ field: 'avg_score', title: '平均评分',  minWidth: 150 ,slots: { default: 'avg_score' }},
 ];

+ 22 - 16
src/views/score-statistics/components/MonthlyRating.vue

@@ -26,11 +26,21 @@
 					</div>
 				</div>
 				<div>
-					<el-button circle :icon="Download" plain @click="handleDownload"></el-button>
+					<el-button :icon="Download" circle plain @click="handleDownload"></el-button>
 				</div>
 			</div>
 			<el-card body-style="padding: 0" shadow="never">
-				<vxe-grid :cell-style="cellStyle" :header-cell-style="headerStyle" v-bind="gridOptions" v-on="gridEvents" show-overflow="tooltip"></vxe-grid>
+				<vxe-grid :cell-style="cellStyle" :header-cell-style="headerStyle" show-overflow="tooltip" v-bind="gridOptions" v-on="gridEvents">
+					<template #avg_score="{ row }">
+						<template v-if="row.avg_score !== null && row.avg_score !== undefined && row.avg_score !== ''">
+							<el-rate v-if="row.avg_score > 0" v-model="row.avg_score" show-score :colors="['#FF0000', '#FF9900', '#67C23A']" disabled text-color="#1e293b" />
+							<span v-else>{{ row.avg_score }}</span>
+						</template>
+						<template v-else>
+							<span>-</span>
+						</template>
+					</template>
+				</vxe-grid>
 			</el-card>
 		</el-card>
 	</div>
@@ -59,7 +69,7 @@ const gridOptions = reactive({
 	data: [],
 });
 
-const asinMonthDate = ref(dayjs().subtract(1, 'month').startOf('month').format('YYYY-MM-DD'))
+const asinMonthDate = ref(dayjs().subtract(1, 'month').startOf('month').format('YYYY-MM-DD'));
 
 const disabledDate = (time: Date) => {
 	// 禁用当前月和当前月之后的日期
@@ -74,7 +84,6 @@ const searchAsin = ref('');
 const searchSku = ref('');
 const averageData = ref([]);
 
-
 const gridEvents = {
 	pageChange({ pageSize, currentPage }) {
 		gridOptions.pagerConfig.currentPage = currentPage;
@@ -90,8 +99,8 @@ async function fetchData() {
 			limit: gridOptions.pagerConfig.pageSize,
 			page: gridOptions.pagerConfig.currentPage,
 			review_date: asinMonthDate.value,
-			asin : searchAsin.value,
-			sku : searchSku.value,
+			asin: searchAsin.value,
+			sku: searchSku.value,
 		};
 
 		const resp = await getTableData(params);
@@ -109,10 +118,9 @@ async function handleDownload() {
 	try {
 		const params = {
 			review_date: asinMonthDate.value,
-			asin : searchAsin.value,
-			sku : searchSku.value,
+			asin: searchAsin.value,
+			sku: searchSku.value,
 		};
-console.log(asinMonthDate.value);
 		const resp = await getTableDownloadData(params);
 		const url = window.URL.createObjectURL(resp.data);
 		const link = document.createElement('a');
@@ -149,18 +157,16 @@ function headerStyle() {
 }
 
 watch(asinMonthDate, (newVal) => {
-		const date = dayjs(newVal).startOf('month').format('YYYY-MM-DD');
-		if (date !== asinMonthDate.value) {
-			asinMonthDate.value = date;
-			fetchData();
-		}
+	const date = dayjs(newVal).startOf('month').format('YYYY-MM-DD');
+	if (date !== asinMonthDate.value) {
+		asinMonthDate.value = date;
+		fetchData();
 	}
-);
+});
 
 onMounted(() => {
 	fetchData();
 });
-
 </script>
 
 <style scoped>

+ 1 - 1
src/views/sku-manage/company-sku/component/DataTableSlot.vue

@@ -67,7 +67,7 @@ function showDetail() {
 					</template>
 					<template #actions="{ confirm, cancel }">
 						<el-button size="small" @click="cancel">No!</el-button>
-						<el-button size="small" type="danger" @click="confirm"> Yes?</el-button>
+						<el-button size="small" :color="'#6466F1'" @click="confirm"> Yes?</el-button>
 					</template>
 				</el-popconfirm>
 				<el-popconfirm :icon="InfoFilled" icon-color="#626AEF" title="你确定要删除此项吗?" width="220" @confirm="onConfirm">