|
|
@@ -64,15 +64,29 @@ a {
|
|
|
top: 15px;
|
|
|
left: 20px;
|
|
|
}
|
|
|
-.result_dialog .el-dialog{
|
|
|
- width: 40%;
|
|
|
- margin-top:20vh!important;
|
|
|
+.result_dialog .el-dialog {
|
|
|
+ width: 40%;
|
|
|
+ margin-top: 20vh !important;
|
|
|
}
|
|
|
-.result-item{
|
|
|
- height: 35px;
|
|
|
- .label{
|
|
|
- font-weight: 600;
|
|
|
- }
|
|
|
+.result-item {
|
|
|
+ height: 35px;
|
|
|
+ .label {
|
|
|
+ font-weight: 600;
|
|
|
+ }
|
|
|
+}
|
|
|
+.syncitem{
|
|
|
+ height:72px;
|
|
|
+ line-height:72px;
|
|
|
+ display:flex;
|
|
|
+ justify-content:space-between;
|
|
|
+ border-bottom:1px solid #ccc;
|
|
|
+}
|
|
|
+.syncitem img{
|
|
|
+ margin:10px;
|
|
|
+}
|
|
|
+.syncbtn{
|
|
|
+ margin-top:20px;
|
|
|
+ text-align: center;
|
|
|
}
|
|
|
</style>
|
|
|
<template>
|
|
|
@@ -97,6 +111,9 @@ a {
|
|
|
<el-button type="primary" @click="search">搜索</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item style="float: right">
|
|
|
+ <el-button @click="syncToMP" type="primary"
|
|
|
+ >同步到公众号</el-button
|
|
|
+ >
|
|
|
<el-button @click="addArticle" type="primary">发布文章</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
@@ -110,8 +127,15 @@ a {
|
|
|
default-expand-all
|
|
|
row-key="id"
|
|
|
style="width: 100%"
|
|
|
+ @selection-change="handleSelectionChange"
|
|
|
>
|
|
|
- <el-table-column prop="name" label="文章名称" width="500px"> </el-table-column>
|
|
|
+ <el-table-column type="selection" width="55"> </el-table-column>
|
|
|
+ <el-table-column prop="name" label="文章名称"> </el-table-column>
|
|
|
+ <el-table-column prop="img" label="封面图">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <img :src="scope.row.img" alt="" width="120" height="80">
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="author" label="作者"></el-table-column>
|
|
|
<el-table-column prop="journal_name" label="来源"></el-table-column>
|
|
|
<el-table-column prop="publish_time" label="出版时间"></el-table-column>
|
|
|
@@ -135,16 +159,43 @@ a {
|
|
|
:total="total"
|
|
|
@pageChange="gopage"
|
|
|
/>
|
|
|
+ <!-- 同步到微信公众号 -->
|
|
|
+ <el-dialog
|
|
|
+ class="fu-dialog"
|
|
|
+ title="同步到微信公众号" width="375px"
|
|
|
+ :close-on-click-modal="false"
|
|
|
+ :visible.sync="dialogVisible"
|
|
|
+ >
|
|
|
+ <!-- <div>
|
|
|
+ <img :src="journalLogo" alt="">
|
|
|
+ </div> -->
|
|
|
+ <div>
|
|
|
+ <div v-if="multipleSelection" style="position:relative;">
|
|
|
+ <img :src="multipleSelection[0].img" alt="" width="310px" height="157px">
|
|
|
+ <p style="position:absolute;bottom:20px;left:20px;font-weight:bold;color:#ffffff;">{{multipleSelection[0].name}}</p>
|
|
|
+ </div>
|
|
|
+ <div v-if="multipleSelection">
|
|
|
+ <div class="syncitem" v-for="(item,index) in multipleSelection" :key="index">
|
|
|
+ <p>{{item.name.substring(0,20)}}</p>
|
|
|
+ <img :src="item.img" alt="" width="48px" height="48px">
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="syncbtn">
|
|
|
+ <el-button type="normal" size="small" @click="dialogVisible=false">取消</el-button>
|
|
|
+ <el-button type="primary" size="small">确定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</section>
|
|
|
</template>
|
|
|
<script>
|
|
|
import Page from "../../components/Page";
|
|
|
-import fuEditor from '../../components/fuEditor'
|
|
|
+import fuEditor from "../../components/fuEditor";
|
|
|
export default {
|
|
|
components: {
|
|
|
Page,
|
|
|
- fuEditor
|
|
|
+ fuEditor,
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
@@ -155,9 +206,22 @@ export default {
|
|
|
rules: {
|
|
|
name: [{ required: true, message: "请输入标题", trigger: "blur" }],
|
|
|
},
|
|
|
+ dialogVisible:false,
|
|
|
+ journalLogo:""
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
+ syncToMP(){
|
|
|
+ if(!this.multipleSelection){
|
|
|
+ this.$message.error("请勾选需要同步到公众号的文章!")
|
|
|
+ return
|
|
|
+ }
|
|
|
+ console.log(this.multipleSelection)
|
|
|
+ this.dialogVisible = true;
|
|
|
+ },
|
|
|
+ handleSelectionChange(val) {
|
|
|
+ this.multipleSelection = val;
|
|
|
+ },
|
|
|
search() {
|
|
|
let parm = this.form;
|
|
|
this.getData();
|
|
|
@@ -167,8 +231,8 @@ export default {
|
|
|
this.dialogVisible = true;
|
|
|
this.dialogTitle = "发送消息";
|
|
|
},
|
|
|
- addArticle(){
|
|
|
- this.$router.push({path:'/article/article/add'})
|
|
|
+ addArticle() {
|
|
|
+ this.$router.push({ path: "/article/article/add" });
|
|
|
},
|
|
|
gopage(size) {
|
|
|
if (size) {
|
|
|
@@ -181,7 +245,7 @@ export default {
|
|
|
var parm = this.form;
|
|
|
this.loading = true;
|
|
|
this.$api.getArticleList(parm).then((res) => {
|
|
|
- console.log(res)
|
|
|
+ console.log(res);
|
|
|
this.list = res.data.data.list;
|
|
|
this.loading = false;
|
|
|
});
|
|
|
@@ -200,7 +264,10 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
edit(row) {
|
|
|
- this.$router.push({path:'/article/article/add',query:{id:row.id}})
|
|
|
+ this.$router.push({
|
|
|
+ path: "/article/article/add",
|
|
|
+ query: { id: row.id },
|
|
|
+ });
|
|
|
},
|
|
|
save() {
|
|
|
this.$refs["form1"].validate((valid) => {
|