|
|
@@ -27,10 +27,8 @@
|
|
|
ref="table"
|
|
|
:key="active"
|
|
|
:schema="schema"
|
|
|
- @row-click="onToggle"
|
|
|
/>
|
|
|
- <preview-dialog ref="previewDialog" />
|
|
|
- <material-dialog ref="materialDialog" />
|
|
|
+ <workflow-detail-dialog ref="workflowDetailDialog" />
|
|
|
<workflow-history-dialog ref="workflowHistoryDialog" />
|
|
|
</wrapper>
|
|
|
</template>
|
|
|
@@ -42,11 +40,13 @@ import {
|
|
|
getWorkflowsByUser,
|
|
|
deleteWorkflow
|
|
|
} from '../api'
|
|
|
+import WorkflowDetailDialog from '../components/WorkflowDetailDialog.vue'
|
|
|
import WorkflowHistoryDialog from '../components/WorkflowHistoryDialog.vue'
|
|
|
|
|
|
export default {
|
|
|
name: 'MyWorkflows',
|
|
|
components: {
|
|
|
+ WorkflowDetailDialog,
|
|
|
WorkflowHistoryDialog
|
|
|
},
|
|
|
data () {
|
|
|
@@ -66,7 +66,7 @@ export default {
|
|
|
list: this.getWorkflows,
|
|
|
transform: this.transformWorkflow,
|
|
|
cols: [
|
|
|
- { type: 'expand', refresh: true, render: this.renderRelative },
|
|
|
+ isSubmitted && { type: 'refresh' },
|
|
|
isSubmitted && { label: '当前节点', render: ({ status }) => status === State.SECOND_LEVEL
|
|
|
? '三审'
|
|
|
: status === State.FIRST_LEVEL
|
|
|
@@ -77,12 +77,13 @@ export default {
|
|
|
{ prop: 'targetInfo', label: '上播内容', width: 80, align: 'center' },
|
|
|
{ prop: 'targetName', label: '' },
|
|
|
isRejected && { prop: 'reason', label: '驳回原因', 'min-width': 120 },
|
|
|
- { prop: 'createTime', label: '提交时间' },
|
|
|
- !isSubmitted && { prop: 'updateTime', label: '审批时间' },
|
|
|
+ { prop: 'createTime', label: '提交时间', 'min-width': 60 },
|
|
|
+ !isSubmitted && { prop: 'updateTime', label: '审批时间', 'min-width': 60 },
|
|
|
{ type: 'invoke', render: [
|
|
|
- { label: '历史', on: this.onViewHistory },
|
|
|
- isRejected ? { label: '删除', on: this.onDel } : { label: '查看', on: this.onView }
|
|
|
- ] }
|
|
|
+ { label: '详情', on: this.onDetail },
|
|
|
+ { label: '流程历史', on: this.onViewHistory },
|
|
|
+ isRejected && { label: '删除', on: this.onDel }
|
|
|
+ ].filter(Boolean), width: 180 }
|
|
|
]
|
|
|
}
|
|
|
}
|
|
|
@@ -99,15 +100,6 @@ export default {
|
|
|
...params
|
|
|
})
|
|
|
},
|
|
|
- renderRelative (data, h) {
|
|
|
- return h('div', { staticClass: 'o-info' }, [
|
|
|
- h('div', null, data.desc),
|
|
|
- h('div', { staticClass: 'c-sibling-item--v' }, `设备:${data.devices}`)
|
|
|
- ])
|
|
|
- },
|
|
|
- onViewHistory ({ workflowId }) {
|
|
|
- this.$refs.workflowHistoryDialog.show(workflowId)
|
|
|
- },
|
|
|
onTabClick ({ name: active }) {
|
|
|
if (this.active !== active) {
|
|
|
this.active = active
|
|
|
@@ -120,11 +112,11 @@ export default {
|
|
|
...workflow
|
|
|
}
|
|
|
},
|
|
|
- onToggle (row) {
|
|
|
- this.$refs.table.getInst().toggleRowExpansion(row)
|
|
|
+ onDetail (workflow) {
|
|
|
+ this.$refs.workflowDetailDialog.show(workflow)
|
|
|
},
|
|
|
- onView ({ target }) {
|
|
|
- this.$refs.materialDialog.showPublishTarget(target)
|
|
|
+ onViewHistory ({ workflowId }) {
|
|
|
+ this.$refs.workflowHistoryDialog.show(workflowId)
|
|
|
},
|
|
|
onDel ({ workflowId }) {
|
|
|
deleteWorkflow(workflowId).then(() => {
|