| | |
| | | <template> |
| | | <basic-container> |
| | | <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel" |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :before-open="beforeOpen" |
| | | @search-change="searchChange" @search-reset="searchReset" @selection-change="selectionChange" |
| | | @current-change="currentChange" @size-change="sizeChange" @refresh-change="refreshChange" @on-load="onLoad"> |
| | | v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" |
| | | :before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset" |
| | | @selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
| | | @refresh-change="refreshChange" @on-load="onLoad"> |
| | | <template slot="menuLeft"> |
| | | <el-button size="small" icon="el-icon-delete" plain v-if="permission.article_delete" @click="handleDelete">删 |
| | | 除 |
| | |
| | | <el-button icon="el-icon-circle-plus-outline" :size="size" :type="type" @click.stop="openDilog(row, 1)"> |
| | | 创建议题 |
| | | </el-button> --> |
| | | <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" @click.stop="updateFb(row)"> |
| | | <el-button v-if="row.publish == '1'" icon="el-icon-close" :size="size" :type="type" |
| | | @click.stop="updateFb(row)"> |
| | | 撤销 |
| | | </el-button> |
| | | <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" @click.stop="updateFb(row)"> |
| | | <el-button v-if="row.publish == '0'" icon="el-icon-check" :size="size" :type="type" |
| | | @click.stop="updateFb(row)"> |
| | | 发布 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="publish"> |
| | | <el-tag>{{ |
| | | row.publish == "1" ? "已发布" : row.publish == "0" ? "未发布" : "未发布" |
| | | }} |
| | | <template slot-scope="{ row, size }" slot="publish"> |
| | | <el-tag :size="size" :type="showPublish(row.publish).type" v-text="showPublish(row.publish).text"> |
| | | </el-tag> |
| | | </template> |
| | | |
| | |
| | | datetime: "", |
| | | selectionList: [], |
| | | option: { |
| | | labelWidth: 96, |
| | | searchLabelWidth: 96, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 280, |
| | | |
| | | height: "auto", |
| | | calcHeight: 54, |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 240, |
| | | border: false, |
| | | //stripe:true, |
| | | index: true, |
| | |
| | | selection: true, |
| | | excelBtn: true, |
| | | dialogClickModal: false, |
| | | column: [{ |
| | | column: [ |
| | | { |
| | | overHidden: true, |
| | | label: "文章标题", |
| | | prop: "title", |
| | | span: 24, |
| | |
| | | }, ], |
| | | }, |
| | | { |
| | | width: 110, |
| | | label: "文章封面", |
| | | prop: "url", |
| | | // align:'center', |
| | | width: 80, |
| | | type: "upload", |
| | | listType: "picture-img", |
| | | action: "/api/blade-resource/oss/endpoint/put-file", |
| | |
| | | span: 24, |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "文章来源", |
| | | prop: "sourceName", |
| | | search: true, |
| | |
| | | message: "请输入文章类型", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, { |
| | | }, |
| | | { |
| | | label: "文章范围", |
| | | prop: "articleList", |
| | | span: 12, |
| | |
| | | hide: true, |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "文章类型", |
| | | prop: "articleType", |
| | | addDisplay: true, |
| | | editDisplay: true, |
| | | viewDisplay: true, |
| | | searchSpan: 3, |
| | | searchSpan: 4, |
| | | checkStrictly: true, |
| | | dicUrl: "/api/blade-system/dict-biz/dictionary?code=articleType", |
| | | props: { |
| | |
| | | }, ], |
| | | }, |
| | | { |
| | | label: "发布时间", |
| | | prop: "dateTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchSpan: 5, |
| | | searchRange: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | | editDisplay: false, |
| | | viewDisplay: false, |
| | | search: true, |
| | | rules: [{ |
| | | required: true, |
| | | message: "请选择发布时间", |
| | | trigger: "blur", |
| | | }, ], |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "发布时间", |
| | | prop: "createTime", |
| | | type: "date", |
| | |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "发布状态", |
| | | prop: "publish", |
| | | searchSpan: 3, |
| | | width: 80, |
| | | searchSpan: 4, |
| | | value: "0", |
| | | slot: true, |
| | | search: true, |
| | |
| | | ], |
| | | }, |
| | | { |
| | | width: 100, |
| | | label: "评论区", |
| | | prop: "iscomment", |
| | | width: 80, |
| | | slot: true, |
| | | type: "switch", |
| | | activeColor: "#13ce66", |
| | |
| | | ids.push(ele.id) |
| | | }) |
| | | return ids.join(",") |
| | | }, |
| | | |
| | | showPublish () { |
| | | return (data) => { |
| | | if (data == 0) { |
| | | return { |
| | | text: '未发布', |
| | | type: 'info' |
| | | } |
| | | } else if (data == 1) { |
| | | return { |
| | | text: '已发布', |
| | | type: 'success' |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | methods: { |