|
|
@@ -30,12 +30,13 @@
|
|
|
name="1"
|
|
|
/>
|
|
|
<el-tab-pane
|
|
|
- label="驳回"
|
|
|
+ label="已驳回"
|
|
|
name="3"
|
|
|
/>
|
|
|
</el-tabs>
|
|
|
<schema-table
|
|
|
ref="table"
|
|
|
+ :key="active"
|
|
|
:schema="schema"
|
|
|
/>
|
|
|
<confirm-dialog
|
|
|
@@ -79,12 +80,13 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { getRatiosWithUser } from '@/api/device'
|
|
|
+import { State } from '@/constant'
|
|
|
+import { getRatios } from '@/api/device'
|
|
|
import {
|
|
|
+ getSchedulesWidthDel,
|
|
|
addSchedule,
|
|
|
copySchedule
|
|
|
} from '@/api/calendar'
|
|
|
-import { State } from '@/constant'
|
|
|
import mixin from './mixin'
|
|
|
|
|
|
export default {
|
|
|
@@ -98,13 +100,8 @@ export default {
|
|
|
},
|
|
|
data () {
|
|
|
return {
|
|
|
- invokes: [
|
|
|
- { label: '编辑', render ({ status }) { return status !== State.SUBMITTED && status !== State.RESOLVED }, on: this.onDesign },
|
|
|
- { label: '查看', render ({ status }) { return status === State.SUBMITTED || status === State.RESOLVED }, on: this.onView },
|
|
|
- { label: '复制', render ({ status }) { return status === State.SUBMITTED || status === State.RESOLVED }, on: this.onCopy },
|
|
|
- { label: '删除', allow: ({ del }) => del, on: this.onDel }
|
|
|
- ],
|
|
|
- resolutionRatioSelectSchema: { remote: getRatiosWithUser },
|
|
|
+ active: `${State.READY}`,
|
|
|
+ resolutionRatioSelectSchema: { remote: getRatios },
|
|
|
schedule: {},
|
|
|
copySchedule: {
|
|
|
id: null,
|
|
|
@@ -115,6 +112,30 @@ export default {
|
|
|
computed: {
|
|
|
dialogTitle () {
|
|
|
return `新增${[null, '日程', '轮播', '排期'][this.type]}`
|
|
|
+ },
|
|
|
+ schema () {
|
|
|
+ const active = Number(this.active)
|
|
|
+
|
|
|
+ return {
|
|
|
+ condition: { type: this.type, status: active, ...this.$condition },
|
|
|
+ list: getSchedulesWidthDel,
|
|
|
+ filters: [
|
|
|
+ { key: 'resolutionRatio', type: 'select', placeholder: '全部分辨率', simple: true, remote: getRatios },
|
|
|
+ { key: 'name', type: 'search', placeholder: '名称' }
|
|
|
+ ],
|
|
|
+ cols: [
|
|
|
+ { prop: 'name', label: '名称', 'min-width': 120 },
|
|
|
+ active === State.REJECTED ? null : { prop: 'resolutionRatio', label: '分辨率' },
|
|
|
+ active === State.REJECTED ? null : { prop: 'createTime', label: '创建时间' },
|
|
|
+ active === State.REJECTED ? { prop: 'remark', label: '驳回原因', 'min-width': 160 } : null,
|
|
|
+ { type: 'invoke', width: 160, render: [
|
|
|
+ active !== State.SUBMITTED && active !== State.RESOLVED ? { label: '编辑', on: this.onDesign } : null,
|
|
|
+ active === State.SUBMITTED || active === State.RESOLVED ? { label: '查看', on: this.onView } : null,
|
|
|
+ active === State.SUBMITTED || active === State.RESOLVED ? { label: '复制', on: this.onCopy } : null,
|
|
|
+ active === State.SUBMITTED ? null : { label: '删除', allow: ({ del }) => del, on: this.onDel }
|
|
|
+ ].filter(Boolean) }
|
|
|
+ ]
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
activated () {
|
|
|
@@ -130,31 +151,35 @@ export default {
|
|
|
},
|
|
|
onAdd () {
|
|
|
this.schedule = {
|
|
|
- type: this.type,
|
|
|
name: '',
|
|
|
resolutionRatio: ''
|
|
|
}
|
|
|
this.$refs.addDialog.show()
|
|
|
},
|
|
|
onConfirmAdd (done) {
|
|
|
- if (!this.schedule.name) {
|
|
|
+ const { name, resolutionRatio } = this.schedule
|
|
|
+ if (!name) {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
message: '名称不能为空'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- if (!this.schedule.resolutionRatio) {
|
|
|
+ if (!resolutionRatio) {
|
|
|
this.$message({
|
|
|
type: 'warning',
|
|
|
message: '请选择分辨率'
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
- addSchedule(this.schedule).then(({ data: id }) => {
|
|
|
+ addSchedule({
|
|
|
+ type: this.type,
|
|
|
+ name,
|
|
|
+ resolutionRatio
|
|
|
+ }).then(({ data: id }) => {
|
|
|
done()
|
|
|
this.active = `${State.READY}`
|
|
|
- this.$refs.table.resetCondition({ status: State.READY, name: this.schedule.name })
|
|
|
+ this.$refs.table.resetCondition({ status: State.READY, resolutionRatio, name })
|
|
|
this.onDesign({ id })
|
|
|
})
|
|
|
},
|