遗漏掉的文件

This commit is contained in:
pengjunchao 2026-07-28 10:15:20 +08:00
parent d484c8a6a8
commit fb75b75d04
3 changed files with 347 additions and 3 deletions

1
src/assets/icon/gif.svg Normal file
View File

@ -0,0 +1 @@
<svg data-v-58697b5c="" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1024 1024"><path fill="#00E9FE" d="M704 768V256H128v512zm64-416 192-96v512l-192-96v128a32 32 0 0 1-32 32H96a32 32 0 0 1-32-32V224a32 32 0 0 1 32-32h640a32 32 0 0 1 32 32zm0 71.552v176.896l128 64V359.552zM192 320h192v64H192z"></path></svg>

After

Width:  |  Height:  |  Size: 310 B

View File

@ -0,0 +1,343 @@
<script setup lang="ts">
import { ElButton, ElOption, TableInstance, UploadInstance } from 'element-plus';
import dayjs from 'dayjs';
import { ElMessage } from 'element-plus';
import { ref, reactive } from 'vue'; // Vue set
import { useI18n } from 'vue-i18n';
import { getData, getTaskLog } from '@/utils/axios/tqyb/task';
import log from '../log/index.vue';
const emit = defineEmits(['playback']);
const { t } = useI18n();
const configVisible = ref(false);
const configType = ref('');
/* 新增、编辑表单 */
const configForm = ref<any>({});
// ref
const fileInput: Ref<HTMLInputElement | null> = ref(null);
const taskList = ref<any[]>([]);
const logData = ref<any>([]);
const currentPage = ref(1);
const pageSize = ref(20);
const total = ref(0);
//
const currentSelection = ref<any>([]);
const multipleTableRef = ref<TableInstance>();
const logVisible = ref(false);
/* drawer侧边栏表单 */
const form = ref<any>({});
/* 任务列表搜索表单 */
const searchForm = reactive({});
interface OptionItem {
label: string;
value: number;
}
const taskStatusList = ref<OptionItem[]>([
// -101234
{ label: '执行失败', value: -1 },
{ label: '未开始', value: 0 },
{ label: '等待中', value: 1 },
{ label: '运行中', value: 2 },
{ label: '已完成', value: 3 },
{ label: '检查未通过', value: 4 },
]);
function search() {
console.log('搜索条件:', searchForm);
getList();
}
function getList() {
let startDate, endDate;
if (searchForm.createTime && searchForm.createTime.length) {
startDate = searchForm.createTime[0];
endDate = searchForm.createTime[1];
}
getData({
...searchForm,
startDate,
endDate,
pageSize: pageSize.value,
pageNum: currentPage.value,
}, (res) => {
taskList.value = res.rows;
total.value = res.total;
});
}
function refresh() {
console.log('刷新任务列表');
getList();
}
function showLog(task: any) {
console.log('显示运行日志');
getTaskLog({ taskId: task.id }, (res) => {
console.log('res', res);
logData.value = res;
logVisible.value = true;
});
}
function handleSelectionChange(selection: any[]) {
// multipleTableRef.value!.clearSelection()
// multipleSelection.value = val
// 1
if (selection.length > 1) {
//
const latestSelection = selection[selection.length - 1];
multipleTableRef.value?.clearSelection(); //
multipleTableRef.value?.toggleRowSelection(latestSelection, true); //
currentSelection.value = [latestSelection];
}
else {
//
currentSelection.value = selection;
}
console.log('当前选中项:', currentSelection.value);
}
function playback() {
console.log('当前选中项:', currentSelection.value);
if (Object.keys(currentSelection.value).length === 0) {
ElMessage({
type: 'warning',
message: t(`isSelect`),
});
}
else {
const startTime = dayjs(currentSelection.value[0].startDate).add(0, 'hour').format('YYYY-MM-DD HH:mm:ss');
const params = {
dataType: currentSelection.value[0].predictionModel,
weatherType: 3,
startTime,
endTime: dayjs(startTime).add(currentSelection.value[0].leadTime, 'hour').format('YYYY-MM-DD HH:mm:ss'),
// hour: currentSelection.value[0].leadTime,
hour: 0,
};
emit('playback', params);
EventBusTool.getEventBus().publish('playData', {
key: 'setTaishiParam',
dataType: currentSelection.value[0].predictionModel,
weatherType: 3,
startTime,
// hour: currentSelection.value[0].leadTime,
hour: 0,
endTime: dayjs(startTime).add(currentSelection.value[0].leadTime, 'hour').format('YYYY-MM-DD HH:mm:ss'),
});
}
}
function handleClick(): void {
if (fileInput.value) {
fileInput.value.value = '';
fileInput.value.click();
}
}
//
function handleFileChange(event: Event): void {
const target = event.target as HTMLInputElement;
const file = target.files?.[0];
if (!file) {
console.warn('未选择文件');
return;
}
configForm.value.file = file;
configForm.value.inputFile = file.name;
// const formData = new FormData();
// // FormData
// formData.append('inputFile', file.name);
// formData.append('file', file);
// importTaskformDatacallback
// importFile(formData, (res:any) => {
// console.log(':', res);
// getList();
// });
}
function handleSizeChange(val: number) {
console.log(`${val} items per page`);
pageSize.value = val;
getList();
}
function handleCurrentChange(val: number) {
console.log(`current page: ${val}`);
currentPage.value = val;
getList();
}
getList();
</script>
<template>
<div class="ycrw">
<!-- 主表 -->
<ElForm :inline="true" :model="searchForm" class="custom-form">
<ElFormItem label="">
<ElInput v-model="searchForm.taskName" :placeholder="`${t('keyword')}...`" class="custom-input" />
</ElFormItem>
<ElFormItem :label="t('taskStatus')">
<ElSelect v-model="searchForm.taskStatus" :placeholder="t('pleaseSelect')" clearable class="custom-select">
<ElOption v-for="item in taskStatusList" :key="item.value" :label="item.label" :value="item.value" />
</ElSelect>
</ElFormItem>
<ElFormItem :label="t('predictionDate')">
<ElDatePicker v-model="searchForm.createTime" value-format="YYYY-MM-DD" type="daterange" range-separator="--"
:start-placeholder="t('startDate')" :end-placeholder="t('endDate')" class="custom-date-picker" />
</ElFormItem>
<ElFormItem>
<ElButton type="primary" class="custom-btn" icon="Search" @click="search">
{{ t('search') }}
</ElButton>
</ElFormItem>
</ElForm>
<ElTable ref="multipleTableRef" :data="taskList" width="100%" max-height="60vh" class="custom-table"
@selection-change="handleSelectionChange">
<ElTableColumn type="selection" width="55" />
<ElTableColumn type="index" :label="t('serialNumber')" width="80" />
<ElTableColumn prop="taskName" :label="t('taskName')" />
<ElTableColumn :label="t('taskStatus')">
<template #default="scope">
<div v-if="scope.row.taskStatus === -1" style="color:#f42a2a;">执行失败</div>
<div v-if="scope.row.taskStatus === 0" style="color:#f42a2a;">未开始</div>
<div v-if="scope.row.taskStatus === 1" style="color:#ffcb40;">等待中</div>
<div v-if="scope.row.taskStatus === 2" style="color:#ffcb40;">运行中</div>
<div v-if="scope.row.taskStatus === 3" style="color:#2af442;">已完成</div>
<div v-if="scope.row.taskStatus === 4" style="color:#f42a2a;">检查未通过</div>
</template>
</ElTableColumn>
<ElTableColumn prop="model" :label="t('predictionModel')">
<template #default="scope">
<div v-if="scope.row.predictionModel === 1">
{{ '盘古' }}
</div>
<div v-if="scope.row.predictionModel === 2">
{{ 'Graphcast' }}
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="time" :label="t('predictionDate')">
<!-- 预测日期 -->
<template #default="scope">
<div>
{{ scope.row.startDate }}
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="startTime" :label="t('predictionStartTime')">
<!-- 预测时间 -->
<template #default="scope">
<div>
{{ scope.row.startTime }}
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="leadTime" :label="t('predictionDuration')">
<!-- 预测时长 -->
<template #default="scope">
<div>
{{ scope.row.leadTime }}小时
</div>
</template>
</ElTableColumn>
<ElTableColumn prop="hours" :label="t('timeConsuming')">
<!-- 耗时 -->
<template #default="scope">
<div>
{{ (scope.row.timeConsuming) }}分钟
</div>
</template>
</ElTableColumn>
<!--<ElTableColumn prop="creator" :label="t('creator')">
<template #default="scope">
{{ scope.row.createBy || '暂无信息' }}
</template>
</ElTableColumn>-->
<ElTableColumn prop="createTime" :label="t('creationTime')" width="220" />
</ElTable>
<div class="pagination">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize" :page-sizes="[10, 20, 50, 100, 200]"
size="small" :background="true" layout="total, sizes, prev, pager, next, jumper" :total="total"
@size-change="handleSizeChange" @current-change="handleCurrentChange" />
</div>
<div class="dialog-footer">
<el-button type="primary" class="custom-btn" icon="Refresh" @click="refresh">
{{ t('refresh') }}
</el-button>
</div>
</div>
</template>
<style lang="less">
.ycrw {
.config-dialog {
margin-top: 35vh;
.config-custom-form {
padding: 20px;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
.config-custom-select,
.config-custom-input {
width: calc(20vw - 80px) !important;
}
.custom-select-dropdown {
max-width: 200px;
/* 根据实际需求调整 */
}
}
.config-custom-btn {
.el-button {
width: 92px;
height: 32px;
background-color: #08a7cf;
border-radius: 0;
border: 0;
color: #fff;
&:hover {
filter: brightness(1.3);
}
&:last-child {
background-color: #b98326;
}
}
}
}
.el-table__header-wrapper {
.el-checkbox {
display: none;
}
}
.config-custom-date {
.el-date-editor.el-input,
.el-date-editor.el-input__wrapper {
width: calc(20vw - 80px) !important;
}
}
.pagination {
width: 100%;
display: flex;
justify-content: left;
margin-top: 10px;
}
}
</style>

View File

@ -19,17 +19,17 @@ export default defineConfig(({ mode }) => {
port: 8888, port: 8888,
proxy: { proxy: {
'/api': { '/api': {
target: 'http://champion.natapp1.cc', target: 'http://pbl.nat100.top', // http://champion.natapp1.cc
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/api/, ''), rewrite: path => path.replace(/^\/api/, ''),
}, },
'/api1': { '/api1': {
target: 'http://champion.natapp1.cc', target: 'http://pbl.nat100.top', // http://champion.natapp1.cc
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/api1/, ''), rewrite: path => path.replace(/^\/api1/, ''),
}, },
'/gisApi': { '/gisApi': {
target: 'http://localhost:8080', target: 'http://pbl.nat100.top', // http://localhost:8080
changeOrigin: true, changeOrigin: true,
rewrite: path => path.replace(/^\/gisApi/, ''), rewrite: path => path.replace(/^\/gisApi/, ''),
}, },