¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="item_panel_box"> |
| | | <el-input size="mini" placeholder="è¾å
¥å
³é®åè¿è¡è¿æ»¤" v-model="filterText"> |
| | | </el-input> |
| | | <div class="box_item"> |
| | | <item-panel class="item-panel" v-loading="loading"> |
| | | <template v-for="(item, index) in nodeItems"> |
| | | <item |
| | | :key="index" |
| | | :type="item.type || 'node'" |
| | | :size="item.size || '72*43'" |
| | | :shape="item.shape || 'flow-rect'" |
| | | :model="{ |
| | | // must have model property |
| | | color: item.color || '#1890FF', |
| | | label: item.id || 'èç¹' |
| | | }" |
| | | > |
| | | <template v-if="item.src"> |
| | | <div class="item item-img"> |
| | | <img :src="item.src" :alt="item.id" /> |
| | | </div> |
| | | </template> |
| | | <template v-else> |
| | | <div :class="'item item-' + (item.shape || 'flow-rect')"> |
| | | <span>{{ item.id }}</span> |
| | | </div> |
| | | </template> |
| | | </item> |
| | | </template> |
| | | </item-panel> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { Item, ItemPanel } from 'vue-flowchart-editor' |
| | | // import { getPage } from '../../../api/omd/status' |
| | | |
| | | export default { |
| | | name: 'EditorItemPanel', |
| | | components: { ItemPanel, Item }, |
| | | props: { |
| | | nodeItems:{ |
| | | type:Array, |
| | | default:() => [], |
| | | } |
| | | }, |
| | | data() { |
| | | return { |
| | | filterText: '', |
| | | loading: false, |
| | | } |
| | | }, |
| | | created() { |
| | | this.loading = false |
| | | |
| | | }, |
| | | computed: { |
| | | filterNode() { |
| | | return this.nodeItems.filter(item => item.id.includes(this.filterText)) |
| | | } |
| | | }, |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .item-panel { |
| | | width: 210px; |
| | | height: 77vh; |
| | | text-align: center; |
| | | overflow-y: scroll; |
| | | display: flex; |
| | | flex-wrap: wrap; /* å
许æ¢è¡ */ |
| | | justify-content: center; /* å±
ä¸å¯¹é½é¡¹ç® */ |
| | | align-items: flex-start; /* ç¡®ä¿é¡¹ç®å¨å®¹å¨é¡¶é¨å¯¹é½ */ |
| | | } |
| | | |
| | | .item { |
| | | display: flex; |
| | | justify-content: center; |
| | | align-items: center; |
| | | font-size: 12px; |
| | | margin: 10px; /* 设å®å¤è¾¹è·ä»¥ç¡®ä¿é¡¹ç®é´æé´é */ |
| | | user-select: none; |
| | | } |
| | | |
| | | /* 项ç®ç±»åçæ ·å¼ */ |
| | | .item-flow-rect { |
| | | width: 75px; |
| | | padding: 6px; |
| | | box-sizing: border-box; |
| | | border: 1px solid rgb(24, 144, 255); |
| | | background-color: rgba(24, 144, 255, 0.2); |
| | | } |
| | | |
| | | .item-flow-circle { |
| | | width: 70px; |
| | | height: 70px; |
| | | border-radius: 60px; |
| | | border: 1px solid rgb(250, 140, 22); |
| | | background-color: rgba(250, 140, 22, 0.2); |
| | | } |
| | | |
| | | .item-flow-rhombus { |
| | | width: 70px; |
| | | height: 70px; |
| | | border: 1px solid rgb(19, 194, 194); |
| | | background-color: rgba(19, 194, 194, 0.2); |
| | | transform: rotate(45deg); |
| | | margin: 25px auto; |
| | | |
| | | span { |
| | | transform: rotate(-45deg); |
| | | } |
| | | } |
| | | |
| | | .item-img { |
| | | max-width: 100px; |
| | | } |
| | | </style> |