| | |
| | | >删 除 |
| | | </el-button> |
| | | </template> |
| | | |
| | | <template slot-scope="{type,size,row }" slot="menu"> |
| | | <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> |
| | | </template> |
| | | |
| | | <template slot-scope="{ row }" slot="publish"> |
| | | <el-tag |
| | | >{{ |
| | | row.publish == "1" ? "已发布" : row.publish == "0" ? "未发布" : "未发布" |
| | | }} |
| | | </el-tag> |
| | | </template> |
| | | |
| | | </avue-crud> |
| | | </basic-container> |
| | | </template> |
| | |
| | | dialogWidth: 950, |
| | | tip: false, |
| | | searchShow: true, |
| | | searchMenuSpan: 6, |
| | | searchMenuSpan: 3, |
| | | menuWidth: 350, |
| | | border: false, |
| | | //stripe:true, |
| | | index: true, |
| | |
| | | prop: "title", |
| | | span: 24, |
| | | row: true, |
| | | searchSpan: 5, |
| | | searchSpan: 4, |
| | | search: true, |
| | | rules: [ |
| | | { |
| | |
| | | label: "发布时间", |
| | | prop: "dateTime", |
| | | type: "datetime", |
| | | format: "yyyy-MM-dd HH:mm:ss", |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | format: "yyyy-MM-dd", |
| | | valueFormat: "yyyy-MM-dd", |
| | | searchSpan: 5, |
| | | searchRange: true, |
| | | hide: true, |
| | | addDisplay: false, |
| | |
| | | valueFormat: "yyyy-MM-dd HH:mm:ss", |
| | | }, |
| | | { |
| | | label: "发布状态", |
| | | prop: "publish", |
| | | searchSpan: 3, |
| | | width: 80, |
| | | value: "0", |
| | | slot: true, |
| | | search: true, |
| | | type: "select", |
| | | dicData: [ |
| | | { |
| | | label: "未发布", |
| | | value: "0", |
| | | }, |
| | | { |
| | | label: "已发布", |
| | | value: "1", |
| | | } |
| | | ], |
| | | }, |
| | | { |
| | | label: "视频", |
| | | prop: "videoUrl", |
| | | type: "upload", |
| | | accept: "video/mp4", |
| | | display: true, |
| | | hide: true, |
| | | span: 24, |
| | | listType: "picture-img", |
| | | action: "/api/depl/put-depl", |
| | | propsHttp: { |
| | |
| | | watch: { |
| | | "form.articleType": { |
| | | handler(val) { |
| | | if (val) { |
| | | var videoUrl = this.findObject(this.option.column, "videoUrl"); |
| | | var content = this.findObject(this.option.column, "content"); |
| | | if (val === "2" || val === "2001"|| val === "2002"|| val === "2003") { |
| | | if (val.indexOf('ksp') != -1) { |
| | | videoUrl.display = true; |
| | | content.display = false; |
| | | videoUrl.rules = [ |
| | |
| | | videoUrl.display = false; |
| | | content.display = true; |
| | | videoUrl.rules = []; |
| | | } |
| | | } |
| | | }, |
| | | immediate: true, |
| | |
| | | this.selectionClear(); |
| | | }); |
| | | }, |
| | | updateFb(row) { |
| | | if (row.publish == "0") { |
| | | row.publish = "1"; |
| | | } else { |
| | | row.publish = "0"; |
| | | } |
| | | update(row).then( |
| | | () => { |
| | | this.onLoad(this.page); |
| | | this.$message({ |
| | | type: "success", |
| | | message: "操作成功!", |
| | | }); |
| | | done(); |
| | | }, |
| | | (error) => { |
| | | window.console.log(error); |
| | | loading(); |
| | | } |
| | | ); |
| | | } |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style> |
| | | .avue-upload__icon { |
| | | line-height: 6; |
| | | } |
| | | </style> |