| | |
| | | </template> |
| | | |
| | | <script> |
| | | import dayjs from 'dayjs' |
| | | import 'dayjs/locale/zh-cn' |
| | | dayjs.locale('zh-cn') |
| | | export default { |
| | | data() { |
| | | const currentDate = this.$elBusUtil.toDate(new Date()) |
| | | return { |
| | | tableConfig: { |
| | | url: 'flower/api/filmWorks/list', |
| | |
| | | { label: '封面图片描述', prop: 'coverAlt', minWidth: 120 }, |
| | | { label: '用户类型', prop: 'userTypeStr' }, |
| | | { label: '置顶权重', prop: 'stickyWeight' , minWidth: 80 }, |
| | | { label: '状态', prop: 'statusStr' , minWidth: 80 }, |
| | | { label: '发布状态', prop: 'statusStr' , minWidth: 80 }, |
| | | { label: '收藏量', prop: 'collectCount' , minWidth: 80 }, |
| | | { label: '点赞量', prop: 'likeCount', minWidth: 80 }, |
| | | { label: '评论量', prop: 'commentCount', minWidth: 80 }, |
| | |
| | | items: [ |
| | | { label: '中文名称', id: 'nameCn', type: 'input' }, |
| | | { label: '英文名称', id: 'nameEn', type: 'input' }, |
| | | { label: '作品类型', id: 'type', type: 'input' }, |
| | | { |
| | | label: '作品类型', |
| | | id: 'type', |
| | | type: 'bus-select-dict', |
| | | el: { |
| | | code: 'FILMSET_TYPE', |
| | | style: 'width:100%', |
| | | clearable: true, |
| | | }, |
| | | }, |
| | | { label: '上映年份', id: 'releaseYear', type: 'input' }, |
| | | { |
| | | label: '用户类型', |
| | | id: 'userType', |
| | | type: 'bus-select-dict', |
| | | el: { |
| | | code: 'FILMSET_CREATE_TYPE', |
| | | style: 'width:100%', |
| | | clearable: true, |
| | | }, |
| | | }, |
| | | { |
| | | label: '发布状态', |
| | | id: 'status', |
| | | type: 'bus-select-dict', |
| | | el: { |
| | | code: 'COMMON_PUBLISH_STATUS', |
| | | style: 'width:100%', |
| | | clearable: true, |
| | | }, |
| | | }, |
| | | { |
| | | label: '创建日期', |
| | | id: 'createDateBeginStr', |
| | |
| | | commonFormat: true, |
| | | commonFormatProps: ['createDateBeginStr', 'createDateEndStr'], |
| | | customClass: 'in-bus-form', |
| | | default: [currentDate, currentDate], |
| | | }, |
| | | ], |
| | | }, |
| | |
| | | trigger: 'blur', |
| | | }, |
| | | }, |
| | | { |
| | | label: '取景地图片:', |
| | | id: 'filmPictures', |
| | | component: 'el-bus-upload', |
| | | el: { |
| | | listType: 'picture-card', |
| | | }, |
| | | forceDisabled: true, |
| | | commonFormat: true, |
| | | span: 24, |
| | | // rules: { required: true, message: '请上传取景地对应的图片' }, |
| | | }, |
| | | { |
| | | label: '取景地内容:', |
| | | id: 'filmContent', |
| | | component: 'base-editor', |
| | | richText: true, |
| | | rules: { required: true, message: '请输入取景地内容', trigger: 'blur' }, |
| | | }, |
| | | { |
| | | label: '封面主题:', |
| | | id: 'coverTitle', |
| | | type: 'input', |
| | | rules: { |
| | | required: true, |
| | | message: '请输入剧情关键词', |
| | | trigger: 'blur', |
| | | }, |
| | | }, |
| | | { |
| | | label: '标签:', |
| | | id: 'tag', |
| | | type: 'input', |
| | | rules: { |
| | | required: true, |
| | | message: '请输入剧情关键词', |
| | | trigger: 'blur', |
| | | }, |
| | | }, |
| | | ], |
| | | extraButtons: [ |
| | | { |
| | | text: (row) => (row.status === 'unpublished' ? '发布' : '下架'), |
| | | text: (row) => (row.status === 'unpublished' || row.status === 'approved' ? '发布' : '下架'), |
| | | atClick: async (row) => { |
| | | const action = row.status === 'unpublished' ? '发布' : '下架' |
| | | const action = row.status === 'unpublished' || row.status === 'approved' ? '发布' : '下架' |
| | | try { |
| | | await this.$elBusUtil.confirm(`确定要${action}吗?`) |
| | | const { code } = await this.$elBusHttp.request( |
| | |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | text: '置顶', |
| | | atClick: async (row) => { |
| | | try { |
| | | await this.$elBusUtil.confirm(`确定要置顶吗?`) |
| | | const { code } = await this.$elBusHttp.request( |
| | | 'flower/api/filmWorks/setTop', |
| | | { params: { id: row.id } } |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success(`置顶成功`) |
| | | } |
| | | } catch (e) { |
| | | return false |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | text: '清除权重', |
| | | atClick: async (row) => { |
| | | try { |
| | | await this.$elBusUtil.confirm(`确定要清除权重吗?`) |
| | | const { code } = await this.$elBusHttp.request( |
| | | 'flower/api/filmWorks/setDown', |
| | | { params: { id: row.id } } |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success(`清除权重成功`) |
| | | } |
| | | } catch (e) { |
| | | return false |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | headerButtons: [ |
| | | { |
| | | text: '批量发布', |
| | | type: 'primary', |
| | | disabled: (selected) => |
| | | selected.filter((item) => item.status === 'unpublished') |
| | | selected.filter((item) => item.status === 'unpublished' || item.status === 'approved') |
| | | .length === 0, |
| | | atClick: async (selected) => { |
| | | const selectedNotice = selected.filter( |
| | | (item) => item.status === 'unpublished' |
| | | (item) => item.status === 'unpublished' || item.status === 'approved' |
| | | ) |
| | | try { |
| | | await this.$elBusUtil.confirm( |
| | |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | text: '批量通过', |
| | | type: 'primary', |
| | | disabled: (selected) => |
| | | selected.filter((item) => item.status === 'pending_review' || item.status === 'rejected') |
| | | .length === 0, |
| | | atClick: async (selected) => { |
| | | const selectedNotice = selected.filter( |
| | | (item) => item.status === 'pending_review' || item.status === 'rejected' |
| | | ) |
| | | try { |
| | | await this.$elBusUtil.confirm( |
| | | `确定要批量通过这${selectedNotice.length}个片场内容吗?` |
| | | ) |
| | | const { code } = await this.$elBusHttp.request( |
| | | 'flower/api/filmWorks/approved/batch', |
| | | { |
| | | method: 'post', |
| | | data: { |
| | | ids: selected.map((item) => item.id), |
| | | }, |
| | | } |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('操作成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | | } |
| | | }, |
| | | }, |
| | | { |
| | | text: '批量驳回', |
| | | type: 'primary', |
| | | disabled: (selected) => |
| | | selected.filter((item) => item.status === 'approved' || item.status === 'pending_review') |
| | | .length === 0, |
| | | atClick: async (selected) => { |
| | | const selectedNotice = selected.filter( |
| | | (item) => item.status === 'approved' || item.status === 'pending_review' |
| | | ) |
| | | try { |
| | | await this.$elBusUtil.confirm( |
| | | `确定要批量驳回这${selectedNotice.length}个片场内容吗?` |
| | | ) |
| | | const { code } = await this.$elBusHttp.request( |
| | | 'flower/api/filmWorks/rejected/batch', |
| | | { |
| | | method: 'post', |
| | | data: { |
| | | ids: selected.map((item) => item.id), |
| | | }, |
| | | } |
| | | ) |
| | | if (code === 0) { |
| | | this.$message.success('操作成功') |
| | | this.$refs.crud.clearSelection() |
| | | } |
| | | } catch (e) { |
| | | return false |
| | | } |
| | | }, |
| | | }, |
| | | ], |
| | | }, |
| | | } |