1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798 |
- <template>
- <div>
- <div class="search-term">
- <el-form :inline="true" :model="searchInfo" class="demo-form-inline">
- <el-form-item label="表名">
- <el-input v-model="searchInfo.tableName" placeholder="表名" />
- </el-form-item>
- <el-form-item label="结构体名称">
- <el-input v-model="searchInfo.tableName" placeholder="结构体名称" />
- </el-form-item>
- <el-form-item>
- <el-button size="mini" type="primary" icon="el-icon-plus" @click="goAutoCode">新增</el-button>
- </el-form-item>
- </el-form>
- </div>
- <el-table :data="tableData" border stripe>
- <el-table-column
- type="selection"
- width="55"
- />
- <el-table-column label="id" width="60" prop="ID" />
- <el-table-column label="日期" width="180">
- <template slot-scope="scope">{{ scope.row.CreatedAt|formatDate }}</template>
- </el-table-column>
- <el-table-column label="结构体名" min-width="150" prop="tableName" />
- <el-table-column label="表名称" min-width="150" prop="tableName" />
- </el-table>
- <el-pagination
- :current-page="page"
- :page-size="pageSize"
- :page-sizes="[10, 30, 50, 100]"
- :style="{float:'right',padding:'20px'}"
- :total="total"
- layout="total, sizes, prev, pager, next, jumper"
- @current-change="handleCurrentChange"
- @size-change="handleSizeChange"
- />
- </div>
- </template>
- <script>
- import { getSysHistory } from '@/api/autoCode.js'
- import { formatTimeToStr } from '@/utils/date'
- import infoList from '@/mixins/infoList'
- export default {
- name: 'Api',
- filters: {
- formatDate: function(time) {
- if (time !== null && time !== '') {
- var date = new Date(time)
- return formatTimeToStr(date, 'yyyy-MM-dd hh:mm:ss')
- } else {
- return ''
- }
- },
- formatBoolean: function(bool) {
- if (bool !== null) {
- return bool ? '是' : '否'
- } else {
- return ''
- }
- }
- },
- mixins: [infoList],
- data() {
- return {
- listApi: getSysHistory
- }
- },
- created() {
- this.getTableData()
- },
- methods: {
- goAutoCode() {
- this.$router.push({ name: 'autoCode' })
- }
- }
- }
- </script>
- <style scoped lang="scss">
- .button-box {
- padding: 10px 20px;
- .el-button {
- float: right;
- }
- }
- .el-tag--mini {
- margin-left: 5px;
- }
- .warning {
- color: #dc143c;
- }
- </style>
|