|
|
@@ -5,7 +5,7 @@
|
|
|
<el-radio-button label="topic">文章管理</el-radio-button>
|
|
|
<el-radio-button label="video">视频管理</el-radio-button>
|
|
|
</el-radio-group>
|
|
|
- <br/>
|
|
|
+ <br />
|
|
|
<template v-if="tab==='ad'">
|
|
|
<div>
|
|
|
<el-button type="success" style="margin-top: 20px;" @click="showAdEdit(null)">添加活动</el-button>
|
|
|
@@ -23,23 +23,40 @@
|
|
|
<el-table-column prop="created_at" label="创建时间"></el-table-column>
|
|
|
<el-table-column label="操作" width="300px;">
|
|
|
<template slot-scope="ad" v-if="tab==='ad'">
|
|
|
- <el-button type="primary" @click="showAdEdit(ad.row)">编辑<i class="el-icon-edit el-icon--right"></i>
|
|
|
+ <el-button type="primary" @click="showAdEdit(ad.row)">
|
|
|
+ 编辑
|
|
|
+ <i class="el-icon-edit el-icon--right"></i>
|
|
|
</el-button>
|
|
|
- <el-button type="danger" @click="deleteAd(ad.row.id)">删除<i class="el-icon-delete el-icon--right"></i>
|
|
|
+ <el-button type="danger" @click="deleteAd(ad.row.id)">
|
|
|
+ 删除
|
|
|
+ <i class="el-icon-delete el-icon--right"></i>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <el-pagination class="order-footer" background layout="prev, pager, next" :page-size="20"
|
|
|
- :total="total" @current-change="handleCurrentChange"/>
|
|
|
-
|
|
|
+ <el-pagination
|
|
|
+ class="order-footer"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="20"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
</template>
|
|
|
<template v-if="tab==='topic'">
|
|
|
<div class="content" v-if="topics">
|
|
|
<el-table :data="topics" height="100%" border style="width: 100%">
|
|
|
- <el-table-column prop="title" label="文章标题"></el-table-column>
|
|
|
- <el-table-column prop="nickname" label="作者"></el-table-column>
|
|
|
+ <el-table-column :className="`clickable`" prop="title" label="文章标题">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span @click="goTopic(scope.row)">{{scope.row.title}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column :className="`clickable`" prop="nickname" label="作者">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span @click="goRooterUser(scope.row)">{{scope.row.nickname}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="created_at" label="发布时间"></el-table-column>
|
|
|
<el-table-column label="基本数据" width="290px">
|
|
|
<template slot-scope="topic" v-if="tab==='topic'">
|
|
|
@@ -52,38 +69,59 @@
|
|
|
<el-table-column label="操作" width="380px" v-if="tab==='topic'">
|
|
|
<template slot-scope="topic" v-if="tab==='topic'">
|
|
|
<template v-if="Number(topic.row.order) > 0">
|
|
|
- <el-button type="primary" @click="topTopic(topic.row.id,topic.row.order)">取消置顶<i
|
|
|
- class="el-icon-top el-icon--right"></i>
|
|
|
+ <el-button type="primary" @click="topTopic(topic.row.id,topic.row.order)">
|
|
|
+ 取消置顶
|
|
|
+ <i class="el-icon-top el-icon--right"></i>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template v-if="Number(topic.row.order) === 0">
|
|
|
- <el-button type="primary" @click="topTopic(topic.row.id,topic.row.order)">置顶<i
|
|
|
- class="el-icon-top el-icon--right"></i>
|
|
|
+ <el-button type="primary" @click="topTopic(topic.row.id,topic.row.order)">
|
|
|
+ 置顶
|
|
|
+ <i class="el-icon-top el-icon--right"></i>
|
|
|
</el-button>
|
|
|
</template>
|
|
|
<template v-if="topic.row.is_excellent==='yes'">
|
|
|
- <el-button type="success" @click="recTopic(topic.row.id,topic.row.is_excellent)">取消推荐<i
|
|
|
- class="el-icon-collection-tag el-icon--right"></i></el-button>
|
|
|
+ <el-button type="success" @click="recTopic(topic.row.id,topic.row.is_excellent)">
|
|
|
+ 取消推荐
|
|
|
+ <i class="el-icon-collection-tag el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
<template v-if="topic.row.is_excellent==='no'">
|
|
|
- <el-button type="success" @click="recTopic(topic.row.id,topic.row.is_excellent)">推荐<i
|
|
|
- class="el-icon-collection-tag el-icon--right"></i></el-button>
|
|
|
+ <el-button type="success" @click="recTopic(topic.row.id,topic.row.is_excellent)">
|
|
|
+ 推荐
|
|
|
+ <i class="el-icon-collection-tag el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
- <el-button type="danger" @click="delTopic(topic.row.id)">删除<i
|
|
|
- class="el-icon-delete el-icon--right"></i></el-button>
|
|
|
+ <el-button type="danger" @click="delTopic(topic.row.id)">
|
|
|
+ 删除
|
|
|
+ <i class="el-icon-delete el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <el-pagination class="order-footer" background layout="prev, pager, next" :page-size="20"
|
|
|
- :total="total" @current-change="handleCurrentChange"/>
|
|
|
-
|
|
|
+ <el-pagination
|
|
|
+ class="order-footer"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="20"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
</template>
|
|
|
<template v-if="tab==='video'">
|
|
|
<div class="content" v-if="videos">
|
|
|
<el-table :data="videos" height="100%" border style="width: 100%">
|
|
|
- <el-table-column prop="title" label="视频简介"></el-table-column>
|
|
|
- <el-table-column prop="nickname" label="作者"></el-table-column>
|
|
|
+ <el-table-column prop="title" :className="`clickable`" label="视频简介">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span @click="goVideo(scope.row)">{{scope.row.title}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="nickname" :className="`clickable`" label="作者">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <span @click="goRooterUser(scope.row)">{{scope.row.nickname}}</span>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="created_at" label="发布时间"></el-table-column>
|
|
|
<el-table-column label="基本数据" width="340px">
|
|
|
<template slot-scope="video" v-if="tab==='video'">
|
|
|
@@ -96,19 +134,38 @@
|
|
|
<el-table-column prop="status_name" label="状态"></el-table-column>
|
|
|
<el-table-column label="操作" width="340px">
|
|
|
<template slot-scope="video" v-if="tab==='video'">
|
|
|
- <el-button type="primary" v-if="video.row.status==1" @click="approveVideo(video.row.id)">下架<i
|
|
|
- class="el-icon-bottom el-icon--right"></i></el-button>
|
|
|
- <el-button type="primary" v-if="video.row.status==0" @click="approveVideo(video.row.id)">上架<i
|
|
|
- class="el-icon-top el-icon--right"></i></el-button>
|
|
|
- <el-button type="danger" @click="deleteVideo(video.row.id)">删除<i
|
|
|
- class="el-icon-delete el-icon--right"></i></el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="video.row.status==1"
|
|
|
+ @click="approveVideo(video.row.id)"
|
|
|
+ >
|
|
|
+ 下架
|
|
|
+ <i class="el-icon-bottom el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ type="primary"
|
|
|
+ v-if="video.row.status==0"
|
|
|
+ @click="approveVideo(video.row.id)"
|
|
|
+ >
|
|
|
+ 上架
|
|
|
+ <i class="el-icon-top el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
+ <el-button type="danger" @click="deleteVideo(video.row.id)">
|
|
|
+ 删除
|
|
|
+ <i class="el-icon-delete el-icon--right"></i>
|
|
|
+ </el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
</div>
|
|
|
- <el-pagination class="order-footer" background layout="prev, pager, next" :page-size="20"
|
|
|
- :total="total" @current-change="handleCurrentChange"/>
|
|
|
-
|
|
|
+ <el-pagination
|
|
|
+ class="order-footer"
|
|
|
+ background
|
|
|
+ layout="prev, pager, next"
|
|
|
+ :page-size="20"
|
|
|
+ :total="total"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
</template>
|
|
|
|
|
|
<el-dialog title="活动管理" :visible.sync="dialogFormVisible">
|
|
|
@@ -153,289 +210,325 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
- export default {
|
|
|
- data() {
|
|
|
- return {
|
|
|
- page: 1,
|
|
|
- size: 20,
|
|
|
- tab: 'ad',
|
|
|
- total: 1,
|
|
|
- ads: [],
|
|
|
- topics: [],
|
|
|
- videos: [],
|
|
|
- form: {
|
|
|
- title: '',
|
|
|
- url: '',
|
|
|
- type: '1',
|
|
|
- tags: '',
|
|
|
- status: '1',
|
|
|
- position: '1'
|
|
|
- },
|
|
|
- dialogFormVisible: false,
|
|
|
- formLabelWidth: '120px',
|
|
|
- };
|
|
|
+export default {
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ page: 1,
|
|
|
+ size: 20,
|
|
|
+ tab: "ad",
|
|
|
+ total: 1,
|
|
|
+ ads: [],
|
|
|
+ topics: [],
|
|
|
+ videos: [],
|
|
|
+ form: {
|
|
|
+ title: "",
|
|
|
+ url: "",
|
|
|
+ type: "1",
|
|
|
+ tags: "",
|
|
|
+ status: "1",
|
|
|
+ position: "1"
|
|
|
+ },
|
|
|
+ dialogFormVisible: false,
|
|
|
+ formLabelWidth: "120px"
|
|
|
+ };
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ goTopic(topic) {
|
|
|
+ console.log(topic);
|
|
|
+ window.open(
|
|
|
+ this.$store.state.domainConfig.jishuinUrl + "/p/" + topic.id + ".html"
|
|
|
+ );
|
|
|
},
|
|
|
- mounted() {
|
|
|
- this.getList();
|
|
|
+ goVideo(topic) {
|
|
|
+ console.log(topic);
|
|
|
+ window.open(
|
|
|
+ this.$store.state.domainConfig.jishuinUrl + "/video/" + topic.video_id
|
|
|
+ );
|
|
|
},
|
|
|
- methods: {
|
|
|
- topTopic(id, order) {
|
|
|
- let hint = '是否置顶文章?';
|
|
|
- if (order > 0) {
|
|
|
- hint = '是否取消推荐文章?';
|
|
|
- }
|
|
|
- this.$confirm(hint, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let res = this.$post('/api/admin/jishuquan/top_topic', {id: id}).then(res => {
|
|
|
+ goRooterUser(topic) {
|
|
|
+ window.open(
|
|
|
+ this.$store.state.domainConfig.siteUrl + "/rooter/user/" + topic.user_id
|
|
|
+ );
|
|
|
+ },
|
|
|
+ topTopic(id, order) {
|
|
|
+ let hint = "是否置顶文章?";
|
|
|
+ if (order > 0) {
|
|
|
+ hint = "是否取消推荐文章?";
|
|
|
+ }
|
|
|
+ this.$confirm(hint, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/top_topic", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
if (res.status === 1) {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功!'
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消'
|
|
|
+ type: "info",
|
|
|
+ message: "已取消"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- recTopic(id, status) {
|
|
|
- let hint = '是否推荐文章?';
|
|
|
- if (status === 'yes') {
|
|
|
- hint = '是否取消推荐文章?';
|
|
|
- }
|
|
|
- this.$confirm(hint, '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let res = this.$post('/api/admin/jishuquan/rec_topic', {id: id}).then(res => {
|
|
|
+ },
|
|
|
+ recTopic(id, status) {
|
|
|
+ let hint = "是否推荐文章?";
|
|
|
+ if (status === "yes") {
|
|
|
+ hint = "是否取消推荐文章?";
|
|
|
+ }
|
|
|
+ this.$confirm(hint, "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/rec_topic", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
if (res.status === 1) {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功!'
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消'
|
|
|
+ type: "info",
|
|
|
+ message: "已取消"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- delTopic(id) {
|
|
|
- this.$confirm('此操作将永久删除该文章, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let res = this.$post('/api/admin/jishuquan/delete_topic', {id: id}).then(res => {
|
|
|
+ },
|
|
|
+ delTopic(id) {
|
|
|
+ this.$confirm("此操作将永久删除该文章, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/delete_topic", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
if (res.status == 1) {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
});
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- approveVideo(id) {
|
|
|
- this.$confirm('更改视频状态', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let res = this.$post('/api/admin/jishuquan/audit_video', {id: id}).then(res => {
|
|
|
+ },
|
|
|
+ approveVideo(id) {
|
|
|
+ this.$confirm("更改视频状态", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/audit_video", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
if (res.status == 1) {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '操作成功!'
|
|
|
+ type: "success",
|
|
|
+ message: "操作成功!"
|
|
|
});
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消'
|
|
|
+ type: "info",
|
|
|
+ message: "已取消"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- deleteVideo(id) {
|
|
|
- this.$confirm('此操作将永久删除该视频, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let res = this.$post('/api/admin/jishuquan/delete_video', {id: id}).then(res => {
|
|
|
+ },
|
|
|
+ deleteVideo(id) {
|
|
|
+ this.$confirm("此操作将永久删除该视频, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/delete_video", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
if (res.status == 1) {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
});
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- showAdEdit(item) {
|
|
|
- console.log(item);
|
|
|
- if (item != null) {
|
|
|
- this.form.id = item.id;
|
|
|
- this.form.title = item.title;
|
|
|
- this.form.url = item.url;
|
|
|
- this.form.type = item.type;
|
|
|
- this.form.tags = item.tags;
|
|
|
- this.form.status = item.status;
|
|
|
- this.form.position = item.position;
|
|
|
- this.form.uid = item.uid;
|
|
|
- }
|
|
|
- this.dialogFormVisible = true;
|
|
|
- },
|
|
|
+ },
|
|
|
+ showAdEdit(item) {
|
|
|
+ console.log(item);
|
|
|
+ if (item != null) {
|
|
|
+ this.form.id = item.id;
|
|
|
+ this.form.title = item.title;
|
|
|
+ this.form.url = item.url;
|
|
|
+ this.form.type = item.type;
|
|
|
+ this.form.tags = item.tags;
|
|
|
+ this.form.status = item.status;
|
|
|
+ this.form.position = item.position;
|
|
|
+ this.form.uid = item.uid;
|
|
|
+ }
|
|
|
+ this.dialogFormVisible = true;
|
|
|
+ },
|
|
|
|
|
|
- deleteAd(id) {
|
|
|
- this.$confirm('此操作将永久删除该活动, 是否继续?', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- type: 'warning'
|
|
|
- }).then(() => {
|
|
|
- let res = this.$post('/api/admin/jishuquan/delete_ad', {id: id}).then(res => {
|
|
|
+ deleteAd(id) {
|
|
|
+ this.$confirm("此操作将永久删除该活动, 是否继续?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/delete_ad", {
|
|
|
+ id: id
|
|
|
+ }).then(res => {
|
|
|
if (res.status == 1) {
|
|
|
this.$message({
|
|
|
- type: 'success',
|
|
|
- message: '删除成功!'
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功!"
|
|
|
});
|
|
|
this.getList();
|
|
|
}
|
|
|
});
|
|
|
- }).catch(() => {
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
this.$message({
|
|
|
- type: 'info',
|
|
|
- message: '已取消删除'
|
|
|
+ type: "info",
|
|
|
+ message: "已取消删除"
|
|
|
});
|
|
|
});
|
|
|
- },
|
|
|
- async editAd() {
|
|
|
- let form = this.form;
|
|
|
- if (form.id) {
|
|
|
- let res = await this.$post("/api/admin/jishuquan/update_ad", form);
|
|
|
- console.log(res);
|
|
|
- if (res.status == 1) {
|
|
|
- this.$message({
|
|
|
- type: "success",
|
|
|
- message: "修改成功"
|
|
|
- });
|
|
|
- }
|
|
|
- } else {
|
|
|
- let res = this.$post("/api/admin/jishuquan/create_ad", form);
|
|
|
- if (res.status == 1) {
|
|
|
- this.$message.success("创建成功");
|
|
|
- this.form = {
|
|
|
- title: '',
|
|
|
- url: '',
|
|
|
- type: '1',
|
|
|
- tags: '',
|
|
|
- status: '1',
|
|
|
- position: '1'
|
|
|
- };
|
|
|
- }
|
|
|
+ },
|
|
|
+ async editAd() {
|
|
|
+ let form = this.form;
|
|
|
+ if (form.id) {
|
|
|
+ let res = await this.$post("/api/admin/jishuquan/update_ad", form);
|
|
|
+ console.log(res);
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message({
|
|
|
+ type: "success",
|
|
|
+ message: "修改成功"
|
|
|
+ });
|
|
|
}
|
|
|
-
|
|
|
- this.getList();
|
|
|
- this.dialogFormVisible = false;
|
|
|
-
|
|
|
- },
|
|
|
- handleCurrentChange(val) {
|
|
|
- this.page = val;
|
|
|
- this.getList();
|
|
|
- },
|
|
|
- async getList() {
|
|
|
- const page = this.page;
|
|
|
- const size = this.size;
|
|
|
- const data = {
|
|
|
- page,
|
|
|
- size
|
|
|
- };
|
|
|
- let res;
|
|
|
- switch (this.tab) {
|
|
|
- case "ad":
|
|
|
- res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
- this.ads = res.data.ads;
|
|
|
- this.total = res.data.total;
|
|
|
- break;
|
|
|
- case 'video':
|
|
|
- res = await this.$post("/api/admin/jishuquan/get_videos", data);
|
|
|
- this.videos = res.data.videos;
|
|
|
- this.total = res.data.total;
|
|
|
- break;
|
|
|
- case 'topic':
|
|
|
- res = await this.$post("/api/admin/jishuquan/get_topics", data);
|
|
|
- this.topics = res.data.topics;
|
|
|
- this.total = res.data.total;
|
|
|
- break;
|
|
|
-
|
|
|
+ } else {
|
|
|
+ let res = this.$post("/api/admin/jishuquan/create_ad", form);
|
|
|
+ if (res.status == 1) {
|
|
|
+ this.$message.success("创建成功");
|
|
|
+ this.form = {
|
|
|
+ title: "",
|
|
|
+ url: "",
|
|
|
+ type: "1",
|
|
|
+ tags: "",
|
|
|
+ status: "1",
|
|
|
+ position: "1"
|
|
|
+ };
|
|
|
}
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- },
|
|
|
- async contact(id) {
|
|
|
-
|
|
|
- const data = {
|
|
|
- id
|
|
|
- };
|
|
|
- let res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
- this.$message({
|
|
|
- message: res.info,
|
|
|
- type: 'success'
|
|
|
- });
|
|
|
- },
|
|
|
+ this.getList();
|
|
|
+ this.dialogFormVisible = false;
|
|
|
+ },
|
|
|
+ handleCurrentChange(val) {
|
|
|
+ this.page = val;
|
|
|
+ this.getList();
|
|
|
+ },
|
|
|
+ async getList() {
|
|
|
+ const page = this.page;
|
|
|
+ const size = this.size;
|
|
|
+ const data = {
|
|
|
+ page,
|
|
|
+ size
|
|
|
+ };
|
|
|
+ let res;
|
|
|
+ switch (this.tab) {
|
|
|
+ case "ad":
|
|
|
+ res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
+ this.ads = res.data.ads;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ case "video":
|
|
|
+ res = await this.$post("/api/admin/jishuquan/get_videos", data);
|
|
|
+ this.videos = res.data.videos;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ case "topic":
|
|
|
+ res = await this.$post("/api/admin/jishuquan/get_topics", data);
|
|
|
+ this.topics = res.data.topics;
|
|
|
+ this.total = res.data.total;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ },
|
|
|
+ async contact(id) {
|
|
|
+ const data = {
|
|
|
+ id
|
|
|
+ };
|
|
|
+ let res = await this.$post("/api/admin/jishuquan/get_ads", data);
|
|
|
+ this.$message({
|
|
|
+ message: res.info,
|
|
|
+ type: "success"
|
|
|
+ });
|
|
|
}
|
|
|
- };
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
- .count-list {
|
|
|
- padding-bottom: 10px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- }
|
|
|
+.count-list {
|
|
|
+ padding-bottom: 10px;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+}
|
|
|
|
|
|
- .count-item {
|
|
|
- margin-right: 20px;
|
|
|
- font-size: 16px;
|
|
|
- }
|
|
|
+.count-item {
|
|
|
+ margin-right: 20px;
|
|
|
+ font-size: 16px;
|
|
|
+}
|
|
|
|
|
|
- .content {
|
|
|
- margin-top: 30px;
|
|
|
- white-space: nowrap;
|
|
|
- overflow-x: scroll;
|
|
|
- height: calc(100vh - 150px);
|
|
|
- }
|
|
|
+.content {
|
|
|
+ margin-top: 30px;
|
|
|
+ white-space: nowrap;
|
|
|
+ overflow-x: scroll;
|
|
|
+ height: calc(100vh - 150px);
|
|
|
+}
|
|
|
|
|
|
- .btn {
|
|
|
- width: 80px;
|
|
|
- }
|
|
|
+.btn {
|
|
|
+ width: 80px;
|
|
|
+}
|
|
|
|
|
|
- .order-footer {
|
|
|
- margin-top: 10px;
|
|
|
- }
|
|
|
+.order-footer {
|
|
|
+ margin-top: 10px;
|
|
|
+}
|
|
|
</style>
|