1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <template>
- <div id="spaceSelect">
- <span class="buildFloor" style="padding-right:12px">业务空间</span>
- <el-select v-model="value" placeholder="请选择" :props="props" filterable :style="isWidth ? '' : 'width:160px;'" size="small" @change="changeVal">
- <el-option v-for="(item, key) in options" :key="key" :label="item.Name" :value="item.Code"></el-option>
- </el-select>
- </div>
- </template>
- <script>
- import { queryDictionaryHead } from '@/api/scan/request';
- export default {
- props: {
- isWidth: {
- type: Boolean,
- default: true
- }
- },
- data() {
- return {
- value:null,
- spaceVal: null,//值
- options: [],
- props: {
- isWidth:false
- }
- }
- },
- methods: {
- //获取下拉框数据
- getOptionData() {
- let pa = {
- Filters: `parentId = 'Space'`
- }
- queryDictionaryHead(pa, res => {
- this.options = res.Content.map(t => {
- if (t.Name == "元空间") {
- return undefined;
- }
- return t;
- }).filter(item => item);
- this.options.unshift({Code:null, CreateTime:null, LastUpdate:null, Name:'全部', ObjectType: null, ParentId: null, Statistics: {}});
- })
- },
- //改变空间
- changeVal(value) {
- this.$emit('change', value)
- }
- },
- created() {
- this.getOptionData();
- }
- }
- </script>
- <style lang="less" scoped>
- #spaceSelect {
- float: left;
- margin-left: 10px;
- .buildFloor {
- color: #999999;
- font-size: 14px;
- }
- }
- </style>
|