|
|
@@ -1,93 +1,59 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
-<!-- <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">-->
|
|
|
-<!-- <el-form-item label="信息时间" prop="newsTime">-->
|
|
|
-<!-- <el-date-picker clearable-->
|
|
|
-<!-- v-model="queryParams.newsTime"-->
|
|
|
-<!-- type="date"-->
|
|
|
-<!-- value-format="YYYY-MM-DD"-->
|
|
|
-<!-- placeholder="请选择信息时间">-->
|
|
|
-<!-- </el-date-picker>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="信息标题" prop="title">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- v-model="queryParams.title"-->
|
|
|
-<!-- placeholder="请输入信息标题"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- @keyup.enter="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item label="链接地址" prop="addr">-->
|
|
|
-<!-- <el-input-->
|
|
|
-<!-- v-model="queryParams.addr"-->
|
|
|
-<!-- placeholder="请输入链接地址"-->
|
|
|
-<!-- clearable-->
|
|
|
-<!-- @keyup.enter="handleQuery"-->
|
|
|
-<!-- />-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- <el-form-item>-->
|
|
|
-<!-- <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>-->
|
|
|
-<!-- <el-button icon="Refresh" @click="resetQuery">重置</el-button>-->
|
|
|
-<!-- </el-form-item>-->
|
|
|
-<!-- </el-form>-->
|
|
|
-
|
|
|
-<!-- <el-row :gutter="10" class="mb8">-->
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- type="primary"-->
|
|
|
-<!-- plain-->
|
|
|
-<!-- icon="Plus"-->
|
|
|
-<!-- @click="handleAdd"-->
|
|
|
-<!-- >新增</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- type="success"-->
|
|
|
-<!-- plain-->
|
|
|
-<!-- icon="Edit"-->
|
|
|
-<!-- :disabled="single"-->
|
|
|
-<!-- @click="handleUpdate"-->
|
|
|
-<!-- >修改</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <el-col :span="1.5">-->
|
|
|
-<!-- <el-button-->
|
|
|
-<!-- type="danger"-->
|
|
|
-<!-- plain-->
|
|
|
-<!-- icon="Delete"-->
|
|
|
-<!-- :disabled="multiple"-->
|
|
|
-<!-- @click="handleDelete"-->
|
|
|
-<!-- >删除</el-button>-->
|
|
|
-<!-- </el-col>-->
|
|
|
-<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>-->
|
|
|
-<!-- </el-row>-->
|
|
|
-
|
|
|
- <el-table v-loading="loading" :data="newsList" @selection-change="handleSelectionChange">
|
|
|
-<!-- <el-table-column type="selection" width="55" align="center" />-->
|
|
|
- <el-table-column label="信息时间" align="center" prop="newsTime" width="180">
|
|
|
- <template #default="scope">
|
|
|
- <span>{{ parseTime(scope.row.newsTime, '{y}-{m}-{d}') }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="信息标题" align="center" prop="title">
|
|
|
- <template #default="scope">
|
|
|
- <span style="color: #409eff; cursor: pointer;" @click="openLink(scope.row.addr)">{{ scope.row.title }}</span>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
-<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
|
|
|
-<!-- <template #default="scope">-->
|
|
|
-<!-- <el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)">修改</el-button>-->
|
|
|
-<!-- <el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)">删除</el-button>-->
|
|
|
-<!-- </template>-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
- </el-table>
|
|
|
-
|
|
|
- <pagination
|
|
|
- v-show="total>0"
|
|
|
- :total="total"
|
|
|
- v-model:page="queryParams.pageNum"
|
|
|
- v-model:limit="queryParams.pageSize"
|
|
|
- @pagination="getList"
|
|
|
- />
|
|
|
+ <el-card class="news-card">
|
|
|
+ <template #header>
|
|
|
+ <div class="card-header">
|
|
|
+ <span class="card-title">原料行情资讯</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ <el-table
|
|
|
+ v-loading="loading"
|
|
|
+ :data="newsList"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
+ class="news-table"
|
|
|
+ :header-cell-style="{background:'#f5f7fa', color:'#606266'}"
|
|
|
+ stripe
|
|
|
+ @sort-change="handleSortChange"
|
|
|
+ >
|
|
|
+ <el-table-column
|
|
|
+ label="信息时间"
|
|
|
+ align="center"
|
|
|
+ prop="newsTime"
|
|
|
+ width="180"
|
|
|
+ sortable="custom"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <span class="news-date">{{ parseTime(scope.row.newsTime, '{y}-{m}-{d}') }}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+
|
|
|
+ <el-table-column
|
|
|
+ label="信息标题"
|
|
|
+ align="left"
|
|
|
+ prop="title"
|
|
|
+ min-width="400"
|
|
|
+ >
|
|
|
+ <template #default="scope">
|
|
|
+ <span
|
|
|
+ class="news-title-link"
|
|
|
+ @click="openLink(scope.row.addr)"
|
|
|
+ >
|
|
|
+ {{ scope.row.title }}
|
|
|
+ </span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+
|
|
|
+ <pagination
|
|
|
+ v-show="total>0"
|
|
|
+ :total="total"
|
|
|
+ v-model:page="queryParams.pageNum"
|
|
|
+ v-model:limit="queryParams.pageSize"
|
|
|
+ @pagination="getList"
|
|
|
+ class="pagination-container"
|
|
|
+ />
|
|
|
+ </el-card>
|
|
|
|
|
|
<!-- 添加或修改原料行情对话框 -->
|
|
|
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
|
|
@@ -159,6 +125,13 @@ function getList() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+/** 排序 */
|
|
|
+function handleSortChange(column) {
|
|
|
+ queryParams.value.orderByColumn = column.prop;
|
|
|
+ queryParams.value.isAsc = column.order === "ascending" ? "asc" : "desc";
|
|
|
+ getList();
|
|
|
+}
|
|
|
+
|
|
|
/** 打开链接 */
|
|
|
function openLink(url) {
|
|
|
if (url) {
|
|
|
@@ -261,3 +234,62 @@ function handleExport() {
|
|
|
|
|
|
getList();
|
|
|
</script>
|
|
|
+
|
|
|
+<style scoped>
|
|
|
+.news-card {
|
|
|
+ border-radius: 8px;
|
|
|
+ box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
+.card-header {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ justify-content: space-between;
|
|
|
+}
|
|
|
+
|
|
|
+.card-title {
|
|
|
+ font-weight: bold;
|
|
|
+ font-size: 18px;
|
|
|
+ color: #303133;
|
|
|
+}
|
|
|
+
|
|
|
+.news-table {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.news-table :deep(.el-table__row:hover) {
|
|
|
+ background-color: #f5f7fa;
|
|
|
+ cursor: pointer;
|
|
|
+}
|
|
|
+
|
|
|
+.news-date {
|
|
|
+ font-weight: 500;
|
|
|
+ color: #606266;
|
|
|
+}
|
|
|
+
|
|
|
+.news-title-link {
|
|
|
+ color: #409eff;
|
|
|
+ cursor: pointer;
|
|
|
+ font-weight: 500;
|
|
|
+ transition: all 0.3s ease;
|
|
|
+ padding: 5px 0;
|
|
|
+ display: inline-block;
|
|
|
+}
|
|
|
+
|
|
|
+.news-title-link:hover {
|
|
|
+ color: #1890ff;
|
|
|
+ text-decoration: underline;
|
|
|
+}
|
|
|
+
|
|
|
+.pagination-container {
|
|
|
+ margin-top: 20px;
|
|
|
+ display: flex;
|
|
|
+ justify-content: center;
|
|
|
+}
|
|
|
+
|
|
|
+.dialog-footer {
|
|
|
+ display: flex;
|
|
|
+ justify-content: flex-end;
|
|
|
+ padding: 0 20px 20px 0;
|
|
|
+}
|
|
|
+</style>
|