text: const Init = compoenntName => {
    return `
  export default {
    name: '${ compoenntName }Page',
    title: '${ compoenntName }',
    components: {},
    data(){
      return {
        
      }
    },
    computed: {},
    methods:{
      
    },
    created(){
  
    }
  }
  `
  };
  const Table = compoenntName => {
    return `
  import moment from 'moment'
  import TableFilter from '@/components/TableFilter/index.vue'
  import { STable, Ellipsis } from '@/components'
  import { getServiceList } from '@/api/user'
  import {columns,filterList,result} from './codeList.js'
  
  const statusMap = {
    0: {
      status: 'default',
      text: '关闭'
    },
    1: {
      status: 'processing',
      text: '运行中'
    },
    2: {
      status: 'success',
      text: '已上线'
    },
    3: {
      status: 'error',
      text: '异常'
    }
  }
  
  export default {
    name: '${ compoenntName }List',
    title: '${ compoenntName }',
    components: {
      STable,
      Ellipsis,
      TableFilter
    },
    data () {
      this.columns = columns
      this.filterList = filterList
      return {
        // create model
        visible: false,
        confirmLoading: false,
        mdl: null,
        // 高级搜索 展开/关闭
        advanced: false,
        // 查询参数
        queryParam: {},
        // 加载数据方法 必须为 Promise 对象
        loadData: parameter => {
          const requestParameters = Object.assign({}, parameter, this.queryParam)
          console.log('loadData request parameters:', requestParameters)
          return getServiceList(requestParameters)
            .then(res => {
              // return res.result
              return result
            })
        },
        selectedRowKeys: [],
        selectedRows: []
      }
    },
    filters: {
      statusFilter (type) {
        return statusMap[type].text
      },
      statusTypeFilter (type) {
        return statusMap[type].status
      }
    },
    computed: {
      rowSelection () {
        return {
          selectedRowKeys: this.selectedRowKeys,
          onChange: this.onSelectChange
        }
      }
    },
    methods: {
      handleAdd () {
        this.$router.push({name:'baseForm',query:{title:'${ compoenntName }'}})
      },
      handleEdit (record) {
        this.visible = true
        this.mdl = { ...record }
      },
      handleSub (record) {
        
      },   
      onSelectChange (selectedRowKeys, selectedRows) {
        this.selectedRowKeys = selectedRowKeys
        this.selectedRows = selectedRows
      }
    }
  }
  
  
  
  
  
  `
  };
  
  module.exports = {
    Init,
    Table
  };
  