SysTranslateList.vue 4.71 KB
<template>
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item :label="$t('translate.chinese')">
              <j-input :placeholder="$t('translate.inputChinese')" v-model="queryParam.chinese"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item :label="$t('translate.english')">
              <j-input :placeholder="$t('translate.inputEnglish')" v-model="queryParam.english"></j-input>
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">{{ $t('button.search') }}</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">{{ $t('button.reset') }}</a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->

    <!-- 操作按钮区域 -->
    <div class="table-operator">
      <a-button @click="handleAdd" v-has="'sysTranslate:add'" type="primary" icon="plus">{{ $t('button.new') }}</a-button>
    </div>

    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        :scroll="{ x: true }"
        bordered
        rowKey="id"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        :rowSelection="{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }"
        class="j-table-force-nowrap"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
          <a @click="handleEdit(record)">{{ $t('button.edit') }}</a>
        </span>
      </a-table>
    </div>

    <sys-translate-modal ref="modalForm" @ok="modalFormOk"></sys-translate-modal>
  </a-card>
</template>

<script>
import '@/assets/less/TableExpand.less'
import { mixinDevice } from '@/utils/mixin'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import SysTranslateModal from './modules/SysTranslateModal'

export default {
  name: 'SysTranslateList',
  mixins: [JeecgListMixin, mixinDevice],
  components: {
    SysTranslateModal
  },
  data() {
    return {
      description: 'sys_translate管理页面',
      // 表头
      columns: [
        {
          title: 'ID',
          align: 'center',
          dataIndex: 'id'
        },
        {
          title: this.$t('translate.relateTable'),
          align: 'center',
          dataIndex: 'relateTable'
        },
        {
          title: this.$t('translate.relateId'),
          align: 'center',
          dataIndex: 'relateId'
        },
        {
          title: this.$t('translate.chinese'),
          align: 'center',
          dataIndex: 'chinese'
        },
        {
          title: this.$t('translate.english'),
          align: 'center',
          dataIndex: 'english'
        },
        {
          title: this.$t('system.createTime'),
          align: 'center',
          dataIndex: 'createTime'
        },
        {
          title: this.$t('system.updateTime'),
          align: 'center',
          dataIndex: 'updateTime'
        },
        {
          title: this.$t('system.options'),
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' }
        }
      ],
      url: {
        list: '/translate/sysTranslate/list',
        delete: '/translate/sysTranslate/delete',
        deleteBatch: '/translate/sysTranslate/deleteBatch',
        exportXlsUrl: '/translate/sysTranslate/exportXls',
        importExcelUrl: 'translate/sysTranslate/importExcel'
      },
      dictOptions: {},
      superFieldList: []
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {
    importExcelUrl: function() {
      return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`
    }
  },
  methods: {
    initDictConfig() {},
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'relateTable', text: 'relateTable', dictCode: '' })
      fieldList.push({ type: 'int', value: 'relateId', text: 'relateId', dictCode: '' })
      fieldList.push({ type: 'string', value: 'chinese', text: 'chinese', dictCode: '' })
      fieldList.push({ type: 'string', value: 'english', text: 'english', dictCode: '' })
      this.superFieldList = fieldList
    }
  }
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>