1
lzhe
2024-04-19 dd3bb0fcffc294ac9094c17aafbc73c8b6a73eed
src/views/mdc/MYTree.vue
@@ -1,16 +1,17 @@
<!--
 * @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: {
@@ -20,6 +21,7 @@
    },
    data() {
        return {
            pmsPng,
            firstWorkKey: '',
            currentNodeKey: '',
            defalutProps: {
@@ -44,6 +46,16 @@
        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,