|
@@ -16,88 +16,58 @@
|
|
|
|
|
|
</div>
|
|
|
<div class="mymain-container">
|
|
|
- <el-table
|
|
|
- v-loading="listLoading"
|
|
|
- :data="dataList"
|
|
|
- element-loading-text="Loading"
|
|
|
- border
|
|
|
- fit
|
|
|
- highlight-current-row
|
|
|
- stripe
|
|
|
- @selection-change="handleSelectionChange"
|
|
|
- >
|
|
|
- <el-table-column type="selection" width="55" align="center">
|
|
|
+ <el-table v-loading="listLoading" :data="dataList" element-loading-text="Loading" border fit highlight-current-row stripe>
|
|
|
+ <el-table-column align="center" label="轮播图名称" prop="imgCarouselName" min-width="120" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="轮播图" prop="imgCarouselUrl" min-width="120" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <a :href="scope.row.imgCarouselUrl" >
|
|
|
+ <img :src="scope.row.imgCarouselUrl" alt="轮播图" class="el-image__inner el-image__preview"/>
|
|
|
+ </a>
|
|
|
+ </template>
|
|
|
+
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column align="center" label="排序" prop="imgCarouselOrder" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="创建时间" prop="createTime" min-width="160" show-overflow-tooltip></el-table-column>
|
|
|
+ <el-table-column align="center" label="状态" prop="status" min-width="160" show-overflow-tooltip>
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div style="z-index: 99">
|
|
|
+ <el-tag type="success" v-if="scope.row.status == '1'" >显示</el-tag>
|
|
|
+ <el-tag type="danger" v-else-if="scope.row.status == '0'">隐藏 </el-tag>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
</el-table-column>
|
|
|
- <template v-for="col in columns">
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- :label="col.lable"
|
|
|
- :prop="col.prop"
|
|
|
- :min-width="col.widht"
|
|
|
- show-overflow-tooltip
|
|
|
- v-if="col.prop == 'status'"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <div style="z-index: 99">
|
|
|
- <el-tag type="success" v-if="scope.row.status == '1'" >显示</el-tag>
|
|
|
- <el-tag type="danger" v-else-if="scope.row.status == '0'">隐藏 </el-tag>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
|
|
|
<el-table-column
|
|
|
align="center"
|
|
|
- :label="col.lable"
|
|
|
- :prop="col.prop"
|
|
|
- :min-width="col.widht"
|
|
|
- show-overflow-tooltip
|
|
|
- v-if="col.prop == 'imgCarouselUrl'"
|
|
|
+ fixed="right"
|
|
|
+ label="操作"
|
|
|
+ min-width="160"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <a :href="scope.row.imgCarouselUrl" >
|
|
|
- <img :src="scope.row.imgCarouselUrl" alt="轮播图" class="el-image__inner el-image__preview"/>
|
|
|
- </a>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
+ <el-button type="text" size="small" @click="hanleEdit(scope.row)"
|
|
|
+ >编辑</el-button
|
|
|
+ >
|
|
|
|
|
|
- <el-table-column
|
|
|
- v-else
|
|
|
- align="center"
|
|
|
- :label="col.lable"
|
|
|
- :prop="col.prop"
|
|
|
- :min-width="col.widht"
|
|
|
- show-overflow-tooltip
|
|
|
- >
|
|
|
- </el-table-column>
|
|
|
- </template>
|
|
|
+ <el-button type="text" size="small" @click="hanleStatus(scope.row.id)" v-if="scope.row.status === '1'">隐藏</el-button>
|
|
|
+ <el-button type="text" size="small" @click="hanleStatus(scope.row.id)" v-if="scope.row.status === '0'">显示</el-button>
|
|
|
|
|
|
- <el-table-column
|
|
|
- align="center"
|
|
|
- fixed="right"
|
|
|
- label="操作"
|
|
|
- min-width="160"
|
|
|
- >
|
|
|
- <template slot-scope="scope">
|
|
|
- <el-button type="text" size="small" @click="hanleEdit(scope.row)"
|
|
|
- >编辑</el-button
|
|
|
- >
|
|
|
|
|
|
- <el-button type="text" size="small" @click="hanleStatus(scope.row.id)" v-if="scope.row.status === '1'">隐藏</el-button>
|
|
|
- <el-button type="text" size="small" @click="hanleStatus(scope.row.id)" v-if="scope.row.status === '0'">显示</el-button>
|
|
|
+ <el-popconfirm
|
|
|
+ title="确定要删除这张轮播图吗?"
|
|
|
+ style="margin-left: 10px"
|
|
|
+ @onConfirm="hanleDelete(scope.row.id)"
|
|
|
+ >
|
|
|
+ <el-button slot="reference" type="text" size="small"
|
|
|
+ >删除</el-button
|
|
|
+ >
|
|
|
+ </el-popconfirm>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
|
|
|
|
|
|
- <el-popconfirm
|
|
|
- title="确定要删除这张轮播图吗?"
|
|
|
- style="margin-left: 10px"
|
|
|
- @onConfirm="hanleDelete(scope.row.id)"
|
|
|
- >
|
|
|
- <el-button slot="reference" type="text" size="small"
|
|
|
- >删除</el-button
|
|
|
- >
|
|
|
- </el-popconfirm>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
</el-table>
|
|
|
+
|
|
|
+
|
|
|
<!-- 分页 -->
|
|
|
<!-- <div style="margin: 20px 0">-->
|
|
|
<!-- <el-pagination-->
|
|
@@ -287,7 +257,7 @@
|
|
|
{
|
|
|
prop: "imgCarouselUrl",
|
|
|
lable: "轮播图",
|
|
|
- widht: 160,
|
|
|
+ widht: 200,
|
|
|
},
|
|
|
|
|
|
{
|
|
@@ -303,11 +273,11 @@
|
|
|
{
|
|
|
prop: "status",
|
|
|
lable: "状态",
|
|
|
- widht: 160,
|
|
|
+ widht: 120,
|
|
|
},
|
|
|
-
|
|
|
],
|
|
|
|
|
|
+
|
|
|
rules: {
|
|
|
imgCarouselName: [
|
|
|
{ required: true, message: "请输入轮播图名称", trigger: "blur" },
|
|
@@ -483,6 +453,9 @@
|
|
|
},
|
|
|
|
|
|
},
|
|
|
+ created() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
components: {
|
|
|
Pagination,
|
|
|
ImageUpload
|