MarketingSystemDataTool/web/index.html

97 lines
4.3 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>MarketingSystemDataTool</title>
<link rel="stylesheet" href="https://unpkg.com/element-plus/dist/index.css">
<link rel="stylesheet" href="/styles.css">
</head>
<body>
<div id="app">
<el-container>
<el-header height="56px">
<el-row align="middle" justify="space-between">
<el-col :span="8">
<div class="title">导出工具</div>
</el-col>
</el-row>
</el-header>
<el-main>
<el-row :gutter="16">
<el-col :span="14">
<el-card header="模板列表">
<el-table :data="templates" size="small" stripe>
<el-table-column prop="id" label="ID" width="80" />
<el-table-column prop="name" label="名称" />
<el-table-column prop="datasource" label="数据源" width="120" />
<el-table-column prop="file_format" label="格式" width="100" />
<el-table-column prop="explain_score" label="评分" width="100" />
<el-table-column label="操作" width="140">
<template #default="scope">
<el-button size="small" type="primary" @click="runExport(scope.row.id)">执行导出</el-button>
</template>
</el-table-column>
</el-table>
</el-card>
</el-col>
<el-col :span="10">
<el-card header="新增模板">
<el-form :model="form" label-width="110px">
<el-form-item label="模板名称"><el-input v-model="form.name" placeholder="模板名称" /></el-form-item>
<el-form-item label="数据源">
<el-select v-model="form.datasource" placeholder="选择">
<el-option label="营销系统" value="marketing" />
<el-option label="易码通" value="ymt" />
</el-select>
</el-form-item>
<el-form-item label="主表"><el-input v-model="form.main_table" /></el-form-item>
<el-form-item label="字段(逗号分隔)"><el-input v-model="form.fieldsRaw" /></el-form-item>
<el-form-item label="creator 列表"><el-input v-model="form.creatorRaw" placeholder="如1,2,3" /></el-form-item>
<el-form-item label="时间范围">
<el-date-picker v-model="form.timeRange" type="datetimerange" range-separator="至" start-placeholder="开始" end-placeholder="结束" />
</el-form-item>
<el-row :gutter="8">
<el-col :span="12">
<el-form-item label="输出格式">
<el-select v-model="form.file_format">
<el-option label="CSV" value="csv" />
<el-option label="XLSX" value="xlsx" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="可见性">
<el-select v-model="form.visibility">
<el-option label="个人" value="private" />
<el-option label="公共" value="public" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="所有者ID"><el-input v-model="form.owner_id" /></el-form-item>
<el-form-item>
<el-button type="primary" @click="createTemplate">创建并校验</el-button>
</el-form-item>
</el-form>
</el-card>
</el-col>
<el-col :span="24">
<el-card header="导出任务">
<div v-if="job.id" class="job">
任务 {{ job.id }} 状态:<b>{{ job.status }}</b> 行数:{{ job.total_rows || '' }}
<el-button v-if="job.files && job.files.length" type="success" size="small" @click="download(job.id)">下载</el-button>
</div>
<div v-else>暂无任务</div>
</el-card>
</el-col>
</el-row>
</el-main>
</el-container>
</div>
<script src="https://unpkg.com/vue@3/dist/vue.global.prod.js"></script>
<script src="https://unpkg.com/element-plus/dist/index.full.min.js"></script>
<script src="/main.js"></script>
</body>
</html>