| | |
| | | <!-- |
| | | * @Date: 2024-04-18 19:53:35 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-18 20:56:37 |
| | | * @LastEditTime: 2024-04-18 21:30:19 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/MYTree.vue |
| | | --> |
| | | <template> |
| | | <el-tree ref="treeRef" v-bind="$attrs" :show-checkbox="showCheckbox" :current-node-key="currentNodeKey" |
| | | node-key="id" :props="defalutProps" :data="data" @check-change="checkChange" @node-click="handleNodeClick" |
| | | highlight-current default-expand-all></el-tree> |
| | | highlight-current default-expand-all :render-content="renderContent"></el-tree> |
| | | </template> |
| | | |
| | | <script> |
| | | import pmsPng from '@/assets/pms.png' |
| | | export default { |
| | | props: { |
| | | showCheckbox: { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | pmsPng, |
| | | firstWorkKey: '', |
| | | currentNodeKey: '', |
| | | defalutProps: { |
| | |
| | | this.getList() |
| | | }, |
| | | methods: { |
| | | renderContent(h, { data }) { |
| | | let img = data.groupTag == 'fms_beltline' |
| | | return h('span', { |
| | | |
| | | }, |
| | | img ? h('img', { |
| | | src: pmsPng |
| | | }, '') : '', |
| | | data.title) |
| | | }, |
| | | getList() { |
| | | this.$HTTP.post('/api/blade-cps/group/groupWorkstation/type', { |
| | | groupCategory: 1, |