This commit is contained in:
24kycj
2024-12-03 20:31:02 +08:00
parent 8eee91ee3a
commit 39be1d3f1a
3 changed files with 47 additions and 18 deletions
+12 -14
View File
@@ -142,27 +142,25 @@ export default {
const _this = this; const _this = this;
dialog dialog
.showOpenDialog({ .showOpenDialog({
properties: ["openFile"], properties: ["multiSelections"],
}) })
.then(async (rel) => { .then(async (rel) => {
console.log(rel); console.log(rel);
for (const item of rel.filePaths) { for (const item of rel.filePaths) {
const stats = fs.statSync(item); const stats = fs.statSync(item);
let folder = false
if (stats.isFile()) { if (stats.isFile()) {
folder = true await fs.stat(item, function (err, res) {
} if (err) {
await fs.stat(item, function (err, res) { return false;
if (err) { }
return false; _this.insertList({
} name: getFileName(item),
_this.insertList({ path: item,
name: getFileName(item), size: res.size,
path: item, folder: false,
size: res.size, });
folder: folder,
}); });
}); }
} }
}); });
}, },
+2 -2
View File
@@ -116,10 +116,10 @@
<div class="flex_box flex_row_between work_left_top"> <div class="flex_box flex_row_between work_left_top">
<div class="flex_box"> <div class="flex_box">
<div class="work_left_top_label">内容</div> <div class="work_left_top_label">内容</div>
<!-- <div @click="addFolder" class="flex_box work_left_top_btn"> <div @click="addFolder" class="flex_box work_left_top_btn">
<img src="@/assets/images/file_icon.png" /> <img src="@/assets/images/file_icon.png" />
<div>添加文件夹</div> <div>添加文件夹</div>
</div> --> </div>
<div @click="addFile" class="flex_box work_left_top_btn"> <div @click="addFile" class="flex_box work_left_top_btn">
<img src="@/assets/images/paper_icon.png" /> <img src="@/assets/images/paper_icon.png" />
<div>添加文件</div> <div>添加文件</div>
+33 -2
View File
@@ -242,7 +242,7 @@
<div class="flex_box work_top"> <div class="flex_box work_top">
<div class="work_top_text">作业列表</div> <div class="work_top_text">作业列表</div>
</div> </div>
<el-table row-key="task_uuid" default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表" :tree-props="{children: 'ass_task', hasChildren: 'hasChildren'}"> <el-table row-key="id" default-expand-all class="work_table" :data="task_list" empty-text="暂无作业列表" :tree-props="{children: 'ass_task', hasChildren: 'hasChildren'}">
<!-- <el-table-column type="index" width="80" label="序号"></el-table-column> --> <!-- <el-table-column type="index" width="80" label="序号"></el-table-column> -->
<el-table-column prop="task_uuid" label="作业ID"></el-table-column> <el-table-column prop="task_uuid" label="作业ID"></el-table-column>
<el-table-column prop="task_name" label="任务名称"></el-table-column> <el-table-column prop="task_name" label="任务名称"></el-table-column>
@@ -263,6 +263,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div class="flex_box work_status_box"> <div class="flex_box work_status_box">
<div>{{ statusList[scope.row.task_status] }}</div> <div>{{ statusList[scope.row.task_status] }}</div>
<el-button v-if="scope.row.task_status == 5" @click="workRetry(scope.$index)" size="mini" type="primary" class="work_status_retry">重试</el-button>
<!-- <i class="el-icon-caret-bottom"></i> --> <!-- <i class="el-icon-caret-bottom"></i> -->
</div> </div>
</template> </template>
@@ -396,8 +397,9 @@ export default {
if (item.ass_task&&item.ass_task.length) { if (item.ass_task&&item.ass_task.length) {
let task_size = 0 let task_size = 0
item.cdType = this.$store.state.chat.CDTypes[item.ass_task[0].cd_type] item.cdType = this.$store.state.chat.CDTypes[item.ass_task[0].cd_type]
item.id = item.task_uuid
item.ass_task.forEach((item2, idx) => { item.ass_task.forEach((item2, idx) => {
item2.task_uuid = item.task_uuid+'_'+(idx+1) item2.id = item.task_uuid+'_'+(idx+1)
item2.cdType = this.$store.state.chat.CDTypes[item2.cd_type] + '_' + (idx+1) item2.cdType = this.$store.state.chat.CDTypes[item2.cd_type] + '_' + (idx+1)
task_size = this.$accAdd(task_size, item2.task_size) task_size = this.$accAdd(task_size, item2.task_size)
}) })
@@ -702,6 +704,27 @@ export default {
} }
that.showAll = !that.showAll that.showAll = !that.showAll
}, },
// 作业重试
workRetry(e) {
that.$store.dispatch('chat/websocketsend', {
req_name: 'retry task',
req_type: 1,
req_info: {
task_uuid: that.task_list[e].task_uuid
}
}).then(() => {
that.$message({
message: '重试成功',
type: 'success'
})
that.task_list[e].task_status = 1
if (that.task_list[e].ass_task&&that.task_list[e].ass_task.length > 0) {
that.task_list[e].ass_task.forEach(item => {
item.task_status = 1
})
}
})
},
// 跳转设置 // 跳转设置
goSet(e) { goSet(e) {
that.$router.push({ path: e }) that.$router.push({ path: e })
@@ -1321,6 +1344,14 @@ $red: #ff0000;
font-size: 14px; font-size: 14px;
color: #000000; color: #000000;
height: 30px; height: 30px;
.work_status_retry {
width: 40px;
height: 22px;
line-height: 22px;
font-size: 12px;
padding: 0;
margin-left: 12px;
}
} }
} }
.child_table { .child_table {