parent
5e2d602336
commit
d4c676250e
7 changed files with 102 additions and 173 deletions
@ -0,0 +1,47 @@ |
||||
<template> |
||||
<avue-tree :option="option" |
||||
:data="data" |
||||
@node-click="handleNodeClick"></avue-tree> |
||||
</template> |
||||
|
||||
<script> |
||||
import { tree } from '@/api/plugin/workflow/category'; |
||||
|
||||
export default { |
||||
name: 'wf-category', |
||||
data() { |
||||
return { |
||||
data: [], |
||||
option: { |
||||
size: 'mini', |
||||
menu: false, |
||||
addBtn: false, |
||||
props: { |
||||
label: 'name', |
||||
value: 'id' |
||||
} |
||||
} |
||||
} |
||||
}, |
||||
mounted() { |
||||
this.getCategoryList() |
||||
}, |
||||
methods: { |
||||
handleNodeClick({ id }) { |
||||
this.$emit('node-click', { id }) |
||||
}, |
||||
getCategoryList() { |
||||
tree().then(res => { |
||||
const data = res.data.data |
||||
this.$emit('list-change', this.deepClone(data)) |
||||
|
||||
this.data = data |
||||
this.data.unshift({ id: '', name: '全部' }) |
||||
}) |
||||
}, |
||||
} |
||||
} |
||||
</script> |
||||
|
||||
<style> |
||||
</style> |
||||
Loading…
Reference in new issue