|
|
@@ -1,6 +1,14 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
- <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
|
|
+ <!-- 搜索表单 -->
|
|
|
+ <el-form
|
|
|
+ :model="queryParams"
|
|
|
+ ref="queryForm"
|
|
|
+ size="small"
|
|
|
+ :inline="true"
|
|
|
+ v-show="showSearch"
|
|
|
+ label-width="68px"
|
|
|
+ >
|
|
|
<el-form-item label="采集页面URL" prop="pageUrl">
|
|
|
<el-input
|
|
|
v-model="queryParams.pageUrl"
|
|
|
@@ -35,6 +43,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
|
|
|
+ <!-- 操作按钮区 -->
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -43,8 +52,9 @@
|
|
|
icon="el-icon-plus"
|
|
|
size="mini"
|
|
|
@click="handleAdd"
|
|
|
- v-hasPermi="['spiderData:spiderData:add']"
|
|
|
- >新增</el-button>
|
|
|
+ v-hasPermi="['spiderData:sourceData:add']"
|
|
|
+ >新增
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -52,10 +62,11 @@
|
|
|
plain
|
|
|
icon="el-icon-edit"
|
|
|
size="mini"
|
|
|
- :disabled="single"
|
|
|
+ :disabled="!hasSingleSelection"
|
|
|
@click="handleUpdate"
|
|
|
- v-hasPermi="['spiderData:spiderData:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ v-hasPermi="['spiderData:sourceData:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -63,10 +74,11 @@
|
|
|
plain
|
|
|
icon="el-icon-delete"
|
|
|
size="mini"
|
|
|
- :disabled="multiple"
|
|
|
+ :disabled="!hasMultipleSelection"
|
|
|
@click="handleDelete"
|
|
|
- v-hasPermi="['spiderData:spiderData:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ v-hasPermi="['spiderData:sourceData:remove']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
@@ -75,60 +87,108 @@
|
|
|
icon="el-icon-download"
|
|
|
size="mini"
|
|
|
@click="handleExport"
|
|
|
- v-hasPermi="['spiderData:spiderData:export']"
|
|
|
- >导出</el-button>
|
|
|
+ v-hasPermi="['spiderData:sourceData:export']"
|
|
|
+ >导出
|
|
|
+ </el-button>
|
|
|
</el-col>
|
|
|
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
|
|
</el-row>
|
|
|
|
|
|
- <el-table v-loading="loading" :data="spiderDataList" @selection-change="handleSelectionChange">
|
|
|
- <el-table-column type="selection" width="55" align="center" />
|
|
|
- <!-- <el-table-column label="原始数据ID" align="center" prop="id" /> -->
|
|
|
- <el-table-column label="采集页面URL" align="center" prop="pageUrl" />
|
|
|
-<!-- <el-table-column label="原始文本内容" align="center" prop="rawContent" width="500" show-overflow-tooltip/>-->
|
|
|
- <el-table-column label="原始文本内容" align="center" prop="rawContent" width="300">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <!-- 数据表格 -->
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="spiderDataList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ row-key="id"
|
|
|
+ >
|
|
|
+ <el-table-column type="selection" width="55" align="center"/>
|
|
|
+
|
|
|
+ <el-table-column label="采集页面URL" align="center" prop="pageUrl" width="300">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ :href="scope.row.pageUrl"
|
|
|
+ target="_blank"
|
|
|
+ :underline="true"
|
|
|
+ class="text-ellipsis"
|
|
|
+ >
|
|
|
+ {{ formatLongText(scope.row.pageUrl, 30) }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="原始文本内容" align="center" prop="rawContent" width="200">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openRichTextNewPage(scope.row.rawContent, '原始文本内容')"
|
|
|
+ :underline="false"
|
|
|
+ class="text-ellipsis"
|
|
|
+ >
|
|
|
+ {{ formatLongText(scope.row.rawContent, 50) }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="优化文本内容" align="center" prop="rawContentFilter" width="200">
|
|
|
+ <template #default="scope">
|
|
|
<el-link
|
|
|
type="primary"
|
|
|
- @click="openRichTextPage(scope.row.rawContent)"
|
|
|
+ @click="openRichTextNewPage(scope.row.rawContentFilter, '优化文本内容')"
|
|
|
:underline="false"
|
|
|
class="text-ellipsis"
|
|
|
>
|
|
|
- {{ scope.row.rawContent.length > 50 ? scope.row.rawContent.substring(0, 50) + '...' : (scope.row.rawContent || '无') }}
|
|
|
+ {{ formatLongText(scope.row.rawContentFilter, 50) }}
|
|
|
</el-link>
|
|
|
</template>
|
|
|
- </el-table-column>
|
|
|
-
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column label="原始附件信息" align="center" prop="rawAttachments" width="200">
|
|
|
+ <template #default="scope">
|
|
|
+ <el-link
|
|
|
+ type="primary"
|
|
|
+ @click="openRichTextNewPage(scope.row.rawAttachments, '原始附件信息')"
|
|
|
+ :underline="false"
|
|
|
+ class="text-ellipsis"
|
|
|
+ >
|
|
|
+ {{ formatLongText(scope.row.rawAttachments, 50) }}
|
|
|
+ </el-link>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
- <el-table-column label="原始附件信息" align="center" prop="rawAttachments" width="300" show-overflow-tooltip/>
|
|
|
<el-table-column label="采集时间" align="center" prop="collectionTime" width="180">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <template #default="scope">
|
|
|
<span>{{ parseTime(scope.row.collectionTime, '{y}-{m}-{d}') }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
- <el-table-column label="关联采集任务ID" align="center" prop="taskId" />
|
|
|
+
|
|
|
+ <el-table-column label="关联采集任务ID" align="center" prop="taskId"/>
|
|
|
+
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
- <template slot-scope="scope">
|
|
|
+ <template #default="scope">
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-edit"
|
|
|
@click="handleUpdate(scope.row)"
|
|
|
- v-hasPermi="['spiderData:spiderData:edit']"
|
|
|
- >修改</el-button>
|
|
|
+ v-hasPermi="['spiderData:sourceData:edit']"
|
|
|
+ >修改
|
|
|
+ </el-button>
|
|
|
<el-button
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
|
@click="handleDelete(scope.row)"
|
|
|
- v-hasPermi="['spiderData:spiderData:remove']"
|
|
|
- >删除</el-button>
|
|
|
+ v-hasPermi="['spiderData:sourceData:remove']"
|
|
|
+ >删除
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
|
|
|
+ <!-- 分页组件 -->
|
|
|
<pagination
|
|
|
- v-show="total>0"
|
|
|
+ v-show="total > 0"
|
|
|
:total="total"
|
|
|
:page.sync="queryParams.pageNum"
|
|
|
:limit.sync="queryParams.pageSize"
|
|
|
@@ -139,13 +199,16 @@
|
|
|
<el-dialog :title="title" :visible.sync="open" width="1000px" append-to-body>
|
|
|
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
<el-form-item label="采集页面URL" prop="pageUrl">
|
|
|
- <el-input v-model="form.pageUrl" placeholder="请输入采集页面URL" />
|
|
|
+ <el-input v-model="form.pageUrl" placeholder="请输入采集页面URL"/>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="原始文本内容">
|
|
|
<editor v-model="form.rawContent" :min-height="192"/>
|
|
|
</el-form-item>
|
|
|
+ <el-form-item label="优化文本内容">
|
|
|
+ <editor v-model="form.rawContentFilter" :min-height="192"/>
|
|
|
+ </el-form-item>
|
|
|
<el-form-item label="原始附件信息" prop="rawAttachments">
|
|
|
- <el-input v-model="form.rawAttachments" type="textarea" placeholder="请输入内容" />
|
|
|
+ <el-input v-model="form.rawAttachments" type="textarea" placeholder="请输入内容"/>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer" class="dialog-footer">
|
|
|
@@ -156,8 +219,20 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
+
|
|
|
<script>
|
|
|
-import { listSpiderData, getSpiderData, delSpiderData, addSpiderData, updateSpiderData,spiderCollect } from "@/api/spiderData/spiderData";
|
|
|
+import {
|
|
|
+ listSpiderData,
|
|
|
+ getSpiderData,
|
|
|
+ delSpiderData,
|
|
|
+ addSpiderData,
|
|
|
+ updateSpiderData,
|
|
|
+ spiderCollect
|
|
|
+} from "@/api/spiderData/spiderData";
|
|
|
+
|
|
|
+// 常量定义
|
|
|
+const DEFAULT_PAGE_SIZE = 10;
|
|
|
+const DEFAULT_PAGE_NUM = 1;
|
|
|
|
|
|
export default {
|
|
|
name: "SpiderData",
|
|
|
@@ -167,10 +242,6 @@ export default {
|
|
|
loading: true,
|
|
|
// 选中数组
|
|
|
ids: [],
|
|
|
- // 非单个禁用
|
|
|
- single: true,
|
|
|
- // 非多个禁用
|
|
|
- multiple: true,
|
|
|
// 显示搜索条件
|
|
|
showSearch: true,
|
|
|
// 总条数
|
|
|
@@ -181,14 +252,15 @@ export default {
|
|
|
title: "",
|
|
|
// 是否显示弹出层
|
|
|
open: false,
|
|
|
- // 原始附件信息时间范围
|
|
|
+ // 采集时间范围
|
|
|
daterangeCollectionTime: [],
|
|
|
// 查询参数
|
|
|
queryParams: {
|
|
|
- pageNum: 1,
|
|
|
- pageSize: 10,
|
|
|
+ pageNum: DEFAULT_PAGE_NUM,
|
|
|
+ pageSize: DEFAULT_PAGE_SIZE,
|
|
|
pageUrl: null,
|
|
|
rawContent: null,
|
|
|
+ rawContentFilter: null,
|
|
|
rawAttachments: null,
|
|
|
collectionTime: null,
|
|
|
taskId: null
|
|
|
@@ -196,36 +268,112 @@ export default {
|
|
|
// 表单参数
|
|
|
form: {},
|
|
|
// 表单校验
|
|
|
- rules: {
|
|
|
- }
|
|
|
+ rules: {},
|
|
|
+ // 新增附件弹窗相关数据
|
|
|
+ attachmentsDialogVisible: false,
|
|
|
+ attachments: []
|
|
|
};
|
|
|
},
|
|
|
+ computed: {
|
|
|
+ // 计算属性:是否有单个选中项
|
|
|
+ hasSingleSelection() {
|
|
|
+ return this.ids.length === 1;
|
|
|
+ },
|
|
|
+ // 计算属性:是否有选中项(用于删除)
|
|
|
+ hasMultipleSelection() {
|
|
|
+ return this.ids.length > 0;
|
|
|
+ }
|
|
|
+ },
|
|
|
created() {
|
|
|
this.getList();
|
|
|
},
|
|
|
methods: {
|
|
|
- /** 打开富文本新页面 */
|
|
|
- openRichTextPage(rawContent) {
|
|
|
- // 路由跳转,携带原始文本参数(通过query传递)
|
|
|
- this.$router.push({
|
|
|
- path: '/spiderData/richTextView', // 新页面路由路径
|
|
|
- query: { content: rawContent || '' } // 传递原始文本
|
|
|
- });
|
|
|
+ /** 格式化长文本,超过指定长度显示省略号 */
|
|
|
+ formatLongText(text = '', maxLength) {
|
|
|
+ if (!text) return '无';
|
|
|
+ return text.length > maxLength
|
|
|
+ ? `${text.substring(0, maxLength)}...`
|
|
|
+ : text;
|
|
|
},
|
|
|
+
|
|
|
+ /** 打开富文本新页面(新窗口) */
|
|
|
+ openRichTextNewPage(content, title = '文本内容') {
|
|
|
+ // 创建一个临时HTML内容
|
|
|
+ const htmlContent = `
|
|
|
+ <!DOCTYPE html>
|
|
|
+ <html lang="zh-CN">
|
|
|
+ <head>
|
|
|
+ <meta charset="UTF-8">
|
|
|
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
|
+ <title>${title}</title>
|
|
|
+ <style>
|
|
|
+ body {
|
|
|
+ font-family: Arial, sans-serif;
|
|
|
+ padding: 20px;
|
|
|
+ line-height: 1.6;
|
|
|
+ }
|
|
|
+ .container {
|
|
|
+ max-width: 1200px;
|
|
|
+ margin: 0 auto;
|
|
|
+ }
|
|
|
+ .title {
|
|
|
+ color: #333;
|
|
|
+ border-bottom: 1px solid #eee;
|
|
|
+ padding-bottom: 10px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ }
|
|
|
+ </style>
|
|
|
+ </head>
|
|
|
+ <body>
|
|
|
+ <div class="container">
|
|
|
+ <h2 class="title">${title}</h2>
|
|
|
+ <div class="content">${content || '无内容'}</div>
|
|
|
+ </div>
|
|
|
+ </body>
|
|
|
+ </html>
|
|
|
+ `;
|
|
|
+
|
|
|
+ // 创建Blob对象
|
|
|
+ const blob = new Blob([htmlContent], { type: 'text/html' });
|
|
|
+ // 创建临时URL
|
|
|
+ const url = URL.createObjectURL(blob);
|
|
|
+ // 打开新窗口
|
|
|
+ window.open(url, '_blank');
|
|
|
+
|
|
|
+ // 释放URL对象
|
|
|
+ setTimeout(() => {
|
|
|
+ URL.revokeObjectURL(url);
|
|
|
+ }, 1000);
|
|
|
+ },
|
|
|
+
|
|
|
/** 查询原始采集数据列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|
|
|
- this.queryParams.params = {};
|
|
|
- if (null != this.daterangeCollectionTime && '' != this.daterangeCollectionTime) {
|
|
|
- this.queryParams.params["beginCollectionTime"] = this.daterangeCollectionTime[0];
|
|
|
- this.queryParams.params["endCollectionTime"] = this.daterangeCollectionTime[1];
|
|
|
+ // 处理查询参数
|
|
|
+ const params = { ...this.queryParams };
|
|
|
+
|
|
|
+ // 添加时间范围查询参数
|
|
|
+ if (this.daterangeCollectionTime && this.daterangeCollectionTime.length === 2) {
|
|
|
+ params.params = {
|
|
|
+ beginCollectionTime: this.daterangeCollectionTime[0],
|
|
|
+ endCollectionTime: this.daterangeCollectionTime[1]
|
|
|
+ };
|
|
|
}
|
|
|
- listSpiderData(this.queryParams).then(response => {
|
|
|
- this.spiderDataList = response.rows;
|
|
|
- this.total = response.total;
|
|
|
- this.loading = false;
|
|
|
- });
|
|
|
+
|
|
|
+ listSpiderData(params)
|
|
|
+ .then(response => {
|
|
|
+ this.spiderDataList = response.rows || [];
|
|
|
+ this.total = response.total || 0;
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('获取数据列表失败:', error);
|
|
|
+ this.$modal.msgError('获取数据失败,请重试');
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
+
|
|
|
/** 采集按钮操作 */
|
|
|
spiderQuery() {
|
|
|
// 校验:若pageUrl为空,给出提示
|
|
|
@@ -234,103 +382,153 @@ export default {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- // 调用封装好的采集接口
|
|
|
- spiderCollect({
|
|
|
- pageUrl: this.queryParams.pageUrl // 传递采集页面URL
|
|
|
- }).then(response => {
|
|
|
- this.$modal.msgSuccess("采集请求已发送,处理中...");
|
|
|
- // 若需要刷新列表,可调用getList()
|
|
|
- this.getList();
|
|
|
- }).catch(error => {
|
|
|
- this.$modal.msgError("采集失败:" + (error.response?.data?.msg || "服务器异常"));
|
|
|
- });
|
|
|
+ // 显示加载状态
|
|
|
+ this.loading = true;
|
|
|
+
|
|
|
+ // 调用采集接口
|
|
|
+ spiderCollect({ pageUrl: this.queryParams.pageUrl })
|
|
|
+ .then(() => {
|
|
|
+ this.$modal.msgSuccess("采集请求已发送,处理中...");
|
|
|
+ this.getList(); // 刷新列表
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ this.$modal.msgError(`采集失败:${error.response?.data?.msg || "服务器异常"}`);
|
|
|
+ })
|
|
|
+ .finally(() => {
|
|
|
+ this.loading = false;
|
|
|
+ });
|
|
|
},
|
|
|
+
|
|
|
// 取消按钮
|
|
|
cancel() {
|
|
|
this.open = false;
|
|
|
this.reset();
|
|
|
},
|
|
|
+
|
|
|
// 表单重置
|
|
|
reset() {
|
|
|
this.form = {
|
|
|
id: null,
|
|
|
pageUrl: null,
|
|
|
rawContent: null,
|
|
|
+ rawContentFilter: null,
|
|
|
rawAttachments: null,
|
|
|
collectionTime: null,
|
|
|
taskId: null
|
|
|
};
|
|
|
this.resetForm("form");
|
|
|
},
|
|
|
+
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.pageNum = 1;
|
|
|
+ this.queryParams.pageNum = DEFAULT_PAGE_NUM;
|
|
|
this.getList();
|
|
|
},
|
|
|
+
|
|
|
/** 重置按钮操作 */
|
|
|
resetQuery() {
|
|
|
this.daterangeCollectionTime = [];
|
|
|
this.resetForm("queryForm");
|
|
|
this.handleQuery();
|
|
|
},
|
|
|
+
|
|
|
// 多选框选中数据
|
|
|
handleSelectionChange(selection) {
|
|
|
- this.ids = selection.map(item => item.id)
|
|
|
- this.single = selection.length!==1
|
|
|
- this.multiple = !selection.length
|
|
|
+ this.ids = selection.map(item => item.id);
|
|
|
},
|
|
|
+
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
this.open = true;
|
|
|
this.title = "添加原始采集数据";
|
|
|
},
|
|
|
+
|
|
|
/** 修改按钮操作 */
|
|
|
handleUpdate(row) {
|
|
|
this.reset();
|
|
|
- const id = row.id || this.ids
|
|
|
- getSpiderData(id).then(response => {
|
|
|
- this.form = response.data;
|
|
|
- this.open = true;
|
|
|
- this.title = "修改原始采集数据";
|
|
|
- });
|
|
|
+ const id = row?.id || this.ids[0];
|
|
|
+ if (!id) return;
|
|
|
+
|
|
|
+ getSpiderData(id)
|
|
|
+ .then(response => {
|
|
|
+ this.form = response.data;
|
|
|
+ this.open = true;
|
|
|
+ this.title = "修改原始采集数据";
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error('获取数据详情失败:', error);
|
|
|
+ this.$modal.msgError('获取数据详情失败,请重试');
|
|
|
+ });
|
|
|
},
|
|
|
+
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|
|
|
if (valid) {
|
|
|
- if (this.form.id != null) {
|
|
|
- updateSpiderData(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("修改成功");
|
|
|
- this.open = false;
|
|
|
- this.getList();
|
|
|
- });
|
|
|
- } else {
|
|
|
- addSpiderData(this.form).then(response => {
|
|
|
- this.$modal.msgSuccess("新增成功");
|
|
|
+ const isEdit = this.form.id != null;
|
|
|
+ const apiMethod = isEdit ? updateSpiderData : addSpiderData;
|
|
|
+
|
|
|
+ apiMethod(this.form)
|
|
|
+ .then(() => {
|
|
|
+ this.$modal.msgSuccess(isEdit ? "修改成功" : "新增成功");
|
|
|
this.open = false;
|
|
|
this.getList();
|
|
|
+ })
|
|
|
+ .catch(error => {
|
|
|
+ console.error(`${isEdit ? '修改' : '新增'}失败:`, error);
|
|
|
+ this.$modal.msgError(`${isEdit ? '修改' : '新增'}失败,请重试`);
|
|
|
});
|
|
|
- }
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
+
|
|
|
/** 删除按钮操作 */
|
|
|
handleDelete(row) {
|
|
|
- const ids = row.id || this.ids;
|
|
|
- this.$modal.confirm('是否确认删除原始采集数据编号为"' + ids + '"的数据项?').then(function() {
|
|
|
- return delSpiderData(ids);
|
|
|
- }).then(() => {
|
|
|
- this.getList();
|
|
|
- this.$modal.msgSuccess("删除成功");
|
|
|
- }).catch(() => {});
|
|
|
+ const ids = row?.id || this.ids;
|
|
|
+ if (!ids || (Array.isArray(ids) && ids.length === 0)) return;
|
|
|
+
|
|
|
+ this.$modal.confirm(`是否确认删除原始采集数据编号为"${ids}"的数据项?`)
|
|
|
+ .then(() => delSpiderData(ids))
|
|
|
+ .then(() => {
|
|
|
+ this.getList();
|
|
|
+ this.$modal.msgSuccess("删除成功");
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ // 取消删除时的处理
|
|
|
+ });
|
|
|
},
|
|
|
+
|
|
|
/** 导出按钮操作 */
|
|
|
handleExport() {
|
|
|
- this.download('spiderData/sourceData/export', {
|
|
|
- ...this.queryParams
|
|
|
- }, `spiderData_${new Date().getTime()}.xlsx`)
|
|
|
+ this.download(
|
|
|
+ 'spiderData/sourceData/export',
|
|
|
+ { ...this.queryParams },
|
|
|
+ `spiderData_${new Date().getTime()}.xlsx`
|
|
|
+ );
|
|
|
}
|
|
|
}
|
|
|
};
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+/* 附件列表样式,避免布局错乱 */
|
|
|
+.attachment-item {
|
|
|
+ padding: 12px 0;
|
|
|
+ border-bottom: 1px solid #f5f5f5;
|
|
|
+}
|
|
|
+.attachment-item:last-child {
|
|
|
+ border-bottom: none;
|
|
|
+}
|
|
|
+.text-ellipsis {
|
|
|
+ display: block;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow: hidden;
|
|
|
+ text-overflow: ellipsis;
|
|
|
+}
|
|
|
+/* 容器样式 */
|
|
|
+.app-container {
|
|
|
+ padding: 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+}
|
|
|
+</style>
|