| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101 |
- <template>
- <div>
- <page-list
- :hideRowselect="true"
- :list="list"
- :columns="columns"
- :group-actions="groupActions"
- :single-actions="singleActions" />
- </div>
- </template>
- <script>
- import * as R from 'ramda'
- import {
- getCopyWithContentTableColumn,
- getRegionTableColumn,
- getBrandTableColumn,
- getAccountTableColumn,
- } from '@/utils/common/tableColumn'
- import {
- getRegionFilter,
- getAccountFilter,
- getCloudProviderFilter,
- } from '@/utils/common/tableFilter'
- import WindowsMixin from '@/mixins/windows'
- export default {
- name: 'vpcListForVpcPeerConnectSidePage',
- mixins: [WindowsMixin],
- props: {
- resId: String,
- data: {
- type: Object,
- required: true,
- },
- getParams: [Function, Object],
- },
- data () {
- return {
- list: this.$list.createList(this, {
- id: 'vpcListForVpcPeerConnectSidePage',
- resource: 'vpcs',
- getParams: this.getParam,
- filterOptions: {
- name: {
- label: this.$t('network.text_21'),
- filter: true,
- formatter: val => {
- return `name.contains("${val}")`
- },
- },
- cidr_block: {
- label: this.$t('network.vpc.cidr_block.ipv4.label'),
- },
- region: getRegionFilter(),
- cloudaccount: getAccountFilter(),
- manager: getCloudProviderFilter(),
- },
- }),
- columns: [
- getCopyWithContentTableColumn({
- field: 'name',
- title: this.$t('table.title.name'),
- sortable: true,
- }),
- getCopyWithContentTableColumn({
- field: 'cidr_block',
- title: this.$t('network.vpc.cidr_block.ipv4.label'),
- sortable: true,
- }),
- getRegionTableColumn(),
- getBrandTableColumn(),
- getAccountTableColumn(),
- ],
- groupActions: [],
- singleActions: [],
- }
- },
- created () {
- this.initSidePageTab('vpc-detail')
- this.list.fetchData()
- },
- methods: {
- handleOpenSidepage (row) {
- this.sidePageTriggerHandle(this, 'VpcSidePage', {
- id: row.id,
- resource: 'vpcs',
- getParams: this.getParam,
- }, {
- list: this.list,
- })
- },
- getParam () {
- const ret = {
- ...(R.is(Function, this.getParams) ? this.getParams() : this.getParams),
- }
- return ret
- },
- },
- }
- </script>
|