<template>
  <toolbar-container :fields="fields" v-on="$listeners" />
</template>

<script>
import { setStatus } from '@/utils';

export default {
  name: 'UpdateListToolbar',

  data() {
    return {
      fields: [
        {
          type: 'text',
          name: 'productName',
          label: '产品名称'
        },
        {
          type: 'text',
          name: 'platform',
          label: '平台'
        },
        {
          type: 'text',
          name: 'versionCode',
          label: '版本编码'
        },
        {
          type: 'text',
          name: 'versionNumber',
          label: '版本号'
        },
        {
          type: 'select',
          name: 'isForceUpgrade',
          label: '强制更新',
          options: setStatus(['开启', '关闭'], [true, false]),
          format: val => (val !== null && val !== '' ? !!val : null)
        },
        {
          type: 'select',
          name: 'isShow',
          label: '显示/隐藏',
          options: setStatus(['显示', '隐藏'], [true, false]),
          format: val => (val !== null && val !== '' ? !!val : null)
        }
      ]
    };
  }
};
</script>

<style type="scss" scoped></style>
