lihang
2023-06-02 59d3dce7cf32975e59935920968b2266af3c60a6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
<template>
    <el-container>
        <!-- 顶端按钮 -->
        <el-header class="businessHeader" style="height: 40px;">
            <el-button-group>
                <el-button type="primary" @click="linkTypeAdd" size="small">
                    <i class="el-icon-plus"></i>&nbsp;
                    新增
                </el-button>
                <el-button type="primary" @click="linkTypeEdit" size="small">
                    <i class="el-icon-edit"></i>&nbsp;
                    修改
                </el-button>
                <el-button type="primary" @click="selectFromTable" size="small">
                    <i class="el-icon-thumb"></i>&nbsp;
                    从已有中获取
                </el-button>
            </el-button-group>
        </el-header>
        <!-- 侧边栏树 -->
        <el-container>
            <el-aside width="240px">
                <basic-container class="businessTreeContainer">
                    <p style="margin-top: 10px;font-weight: 570;font-size: 19px">{{ treeOption.title }}</p>
                    <avue-tree id="basic" :data="treeData" :option="treeOption" @node-click="nodeClick"
                        class="businessTree">
                        <span class="el-tree-node__label" slot-scope="{ node, data }">
                            <span>
                                <i class="el-icon-star-on"></i>
                                {{ (node || {}).label }}
                            </span>
                        </span>
                    </avue-tree>
                </basic-container>
            </el-aside>
            <el-container>
                <el-main>
                    <basic-container>
                        <p style="margin-top: 10px;font-weight: 570;font-size: 19px">基本信息</p>
                        <el-descriptions class="margin-top" :column="2" size="medium" border>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-finished"></i>
                                    英文名称
                                </template>
                                {{ obj.id }}
                            </el-descriptions-item>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-info"></i>
                                    中文名称
                                </template>
                                {{ obj.name }}
                            </el-descriptions-item>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-date"></i>
                                    数据库表名
                                </template>
                                {{ obj.tableName }}
                            </el-descriptions-item>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-folder-opened"></i>
                                    所属领域
                                </template>
                                <el-tag size="small">
                                    {{ obj.domainText }}
                                </el-tag>
                            </el-descriptions-item>
                        </el-descriptions>
                        <el-descriptions class="margin-top" direction="vertical" :column="2" border>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-sort-down"></i>
                                    From端类型
                                </template>
                                <span v-for="item in obj.fromBtmTypes" style="margin-left:2px;">
                                    <el-tag size="small" effect="plain" style="width:130px;margin-top: 2px;">
                                        {{ item.id + '(' + item.name + ')' }}
                                    </el-tag>
                                </span>
                            </el-descriptions-item>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-sort-up"></i>
                                    To段类型
                                </template>
                                <span v-for="item in obj.toBtmTypes" style="height:26px;width:140px;margin-left:2px">
                                    <el-tag size="small" effect="plain" style="width:130px;margin-top: 2px;">
                                        {{ item.id + '(' + item.name + ')' }}
                                    </el-tag>
                                </span>
                            </el-descriptions-item>
                        </el-descriptions>
 
                        <el-descriptions class="margin-top" :column="2" size="medium" border>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-info"></i>
                                    主类型
                                </template>
                                {{ obj.fromBtmTypeName }}
                            </el-descriptions-item>
                            <el-descriptions-item labelStyle="text-align:center;width:120px"
                                contentStyle="width:240px;text-align:center;word-break;break-all;">
                                <template slot="label">
                                    <i class="el-icon-info"></i>
                                    主类型
                                </template>
                                {{ obj.toBtmTypeName }}
                            </el-descriptions-item>
                            <el-descriptions-item span='2' labelStyle="text-align:center;width:120px">
                                <template slot="label">
                                    <i class="el-icon-chat-line-square"></i>
                                    描述
                                </template>
                                {{ obj.description }}
                            </el-descriptions-item>
                        </el-descriptions>
                    </basic-container>
                    <!-- 属性列表-->
                    <basic-container>
                        <p style="margin-top: 10px;font-weight: 570;font-size: 19px">属性列表</p>
                        <avue-crud class="attributeCrud" v-model="obj" :data="obj.attributes" :option="loadOption">
                            <template slot="attrDataType" slot-scope="{row}">
                                <el-tag>{{ row.attrDataType }}</el-tag>
                            </template>
                        </avue-crud>
                    </basic-container>
                </el-main>
            </el-container>
        </el-container>
 
 
    </el-container>
</template>
  
<script>
import {
    initTree,
    refOnLoad,
    getDomain,
    saveFromTable,
    getDetail
} from "@/api/omd/linkType"
export default {
    name: "LinkType",
    data() {
        return {
            treeData: [
                { id: "1", name: "2", label: "label" },
                { id: "a", name: "b", label: "c" }
            ],
            loadOption: {
                border: true,
                height: 360,
                editBtn: false,
                addBtn: false,
                menu: false,
                highlightCurrentRow: true,
                refreshBtn: false,
                columnBtn: false,
                column: [
                    {
                        label: '英文名称',
                        prop: 'id',
                        align: 'center'
                    }, {
                        label: '中文名称',
                        prop: 'name',
                        align: 'center'
                    },
                    {
                        label: '类型',
                        prop: 'attrDataType',
                        align: 'center',
                        slot: true
                    },
                    {
                        label: '默认值',
                        prop: 'defaultValue',
                        align: 'center'
                    },
                    {
                        label: '说明',
                        prop: 'description',
                        align: 'center'
                    }
                ]
            },
            obj: {
                id: 'linkType',
                name: '链接类型',
                tableName: 'PLLT_OMD_LINKTYPE',
                domain: 'ubcs-omd',
                domainText: '对象建模',
                fromBtmTypes: [
                    { id: 'btm', name: '业务类型' },
                    { id: 'btm2', name: '业务类型2' }
                ],
                toBtmTypes: [{ id: 'btm', name: '业务类型' }, { id: 'btm2', name: '业务类型2' }],
                fromBtmTypeName: '',
                toBtmTypeName: '',
            },
            treeOption: {
                defaultExpandAll: true,
                title: '链接类型树',
                addBtn: false,
                props: {
                    labelText: '',
                    label: 'name',
                    value: 'oid',
                    children: 'childList',
                }
            },
        }
    },
    created() {
        this.initTreeOnLoad();
        // this.initDomainOption();
    },
 
    methods: {
        // 树点击
        nodeClick(data) {
            console.log(data);
        },
        // 添加按钮点击事件
        linkTypeAdd() {
 
        },
        // 编辑按钮点击事件
        linkTypeEdit() {
 
        },
        // 从已有中获取按钮点击事件
        selectFromTable() {
 
        },
        initTreeOnLoad() {
            initTree().then(res => {
                this.treeData = res.data.data;
            });
        }
 
    }
}
</script>
  
<style lang="scss">
.attributeCrud>.el-card:nth-of-type(2)>.el-card__body>.avue-crud__menu {
    display: none !important;
}
</style>