Commit 4fbb5e26 by linjinhong

feat:修改card样式

parent 587836ed
......@@ -16,8 +16,9 @@
</div>
</div>
</template>
<script setup lang="ts">
<script>
export default {
name: "LogList",
props: {
logList: {
default: () => [],
......@@ -26,7 +27,7 @@ export default {
}
};
</script>
<style lang="scss" scoped>
<style lang="less" scoped>
.log-list {
height: 500px;
overflow: auto;
......
......@@ -3,12 +3,13 @@ import BaseCard from "@/components/BaseCard.vue";
import DTFhead from "./components/detailHead.vue";
import DetailDialog from "@/components/detailDialog.vue";
const { remote } = require("electron");
import LogList from "@//components/LogList.vue";
const { Menu } = remote;
import dayjs from "dayjs";
export default {
name: "dtf-batch-detail",
components: { BaseCard, DTFhead, DetailDialog },
components: { BaseCard, DTFhead, DetailDialog, LogList },
props: {
user: {
default: () => ({
......@@ -119,7 +120,11 @@ export default {
setProductMark(tagsId) {},
parseImageAry(tagsId) {},
openLogDialog(tagsId) {},
openLogDialog(tagsId) {
console.log(999);
this.logVisible = true;
},
changeActive(item) {
item.active = !item.active;
},
......@@ -253,17 +258,6 @@ export default {
<template #operations>
<div class="flex-row flex-row-gap6">
<div
v-if="
item?.productMark === 'custom_normal' ||
item?.productMark === 'normal'
"
class="product-mark-badge"
:title="`类型:${setProductMark(item?.productMark)}类`"
>
{{ setProductMark(item?.productMark) }}
</div>
<div
v-if="item.customizedQuantity"
class="quantity-badge"
:class="
item.customizedQuantity === 1
......@@ -276,23 +270,20 @@ export default {
>
{{ item.customizedQuantity === 1 ? "单" : "多" }}
</div>
<el-icon
name="caozuorizhi"
style="width: 28px; height: 28px"
<i
class="el-icon-tickets quantity-badge"
style="background-color: #41c792;"
@click.stop="openLogDialog(item)"
title="操作日志"
>
<template #title>
<title>操作日志</title>
</template>
</el-icon>
<el-icon
name="chakanxiangqing"
</i>
<i
style="background-color: #2183fe;"
class="el-icon-search quantity-badge"
@click.stop="handleViewDetail(item)"
title="查看详情"
>
<template #title>
<title>查看详情</title>
</template>
</el-icon>
</i>
</div>
</template>
<template #info>
......@@ -397,18 +388,18 @@ export default {
</div>
</div>
<el-dialog
v-model="logVisible"
:visible.sync="logVisible"
title="操作日志"
width="1000px"
:close-on-click-modal="false"
>
<LogList :log-list="logList" />
<div v-if="!logList.length" class="empty-content">暂无数据</div>
<LogList v-if="logList.length" :log-list="logList" />
<div v-else class="empty-content">暂无数据</div>
</el-dialog>
<DetailDialog
:show.sync="detailVisible"
:img-url="''"
:info="''"
:info="{}"
></DetailDialog>
</div>
</template>
......@@ -483,11 +474,14 @@ export default {
white-space: nowrap;
}
.quantity-badge {
background-color: #f56c6c;
width: 28px;
height: 28px;
color: #fff;
padding: 5px 8px;
border-radius: 4px;
font-size: 12px;
font-size: 16px;
line-height: 28px;
text-align: center;
margin-left: 5px;
}
.multiple-quantity-badge-color {
......
......@@ -98,10 +98,51 @@ export default {
]
};
},
mounted() {},
mounted() {
this.fetchBatchList();
// 开启5分钟轮询
this.pollTimer = setInterval(() => {
this.fetchBatchList();
}, 5 * 60 * 1000);
// 监听下载结果
ipcRenderer.on("download:success", (_, batchNum) => {
this.$message.success(`批次 ${batchNum} 素材下载完成`);
});
ipcRenderer.on("download:error", (_, { batchArrangeNum, msg }) => {
this.$message.error(`批次 ${batchArrangeNum} 下载失败:${msg}`);
});
},
beforeDestroy() {
clearInterval(this.pollTimer);
ipcRenderer.removeAllListeners("download:success");
ipcRenderer.removeAllListeners("download:error");
},
methods: {
loadData() {
// 请求列表接口
async fetchBatchList() {
// 先判断:有下载任务在跑,本轮直接跳过
const status = ipcRenderer.sendSync("download:getStatus");
if (status.isRunning) return;
try {
// const res = await getBatchListApi();
let res;
if (res.code === 200) {
this.tableData = res.data || [];
this.autoHandleDownload();
}
} catch (err) {
console.error("批次列表拉取失败", err);
}
},
autoHandleDownload() {
// 1. 过滤出 status 为“是”的批次
const finishList = this.tableData.filter(item => item.status === "是");
if (finishList.length === 0) return;
// 2. 直接发给主进程,主进程会自动校验本地文件、过滤已存在的批次
ipcRenderer.sendSync("download:addTasks", finishList);
},
handleSelect(rows) {
console.log("选中行", rows);
......
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