Commit 1571da76 by 胡悦

合并

2 parents aebe6df0 90204831
......@@ -11,8 +11,8 @@
},
"dependencies": {
"axios": "^0.18.0",
"glsx-vue-common": "^1.2.1",
"element-ui": "^2.15.1",
"glsx-vue-common": "^1.2.1",
"lodash": "^4.17.10",
"node-sass": "^4.9.3",
"sass-loader": "^7.1.0",
......
import {
GlAxios
} from 'glsx-vue-common'
const path = '/admin-ddh-weapp/carHeadlines'
const __getList = `${path}/listConditionQuery`
function getListApi(params) {
return GlAxios.get(__getList, { params })
}
export {
getListApi
}
......@@ -3,7 +3,11 @@
import Vue from 'vue'
import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css'
// import GlsxVueComponents from 'glsx-vue-components'
// import 'glsx-vue-components/dist/glsx-vue-components.css'
import { Request as request } from 'glsx-vue-common'
import '@/styles/index.scss'
// 组件
import '@/components'
// import _ from 'lodash'
// import axios from 'axios'
......
......@@ -133,12 +133,7 @@ export default {
// 表格数据-外部传入
tableData: {
type: Array,
default: () => [
{
name: 1212,
status: 1
}
]
default: () => []
},
tableTotal: {
type: Number,
......@@ -264,9 +259,9 @@ export default {
params.sortColum = this.sortColum
params.sort = this.sort === 'descending' ? 1 : 0
}
console.log(this.getListApi)
this.getListApi(params).then(res => {
// this.data = res[this.tableParams.listName]
this.data = res
this.data = res[this.tableParams.listName]
this.total = res.pagination.totalCount
this.loading = false
}).catch(() => {
......
......@@ -2,4 +2,3 @@ import Vue from 'vue'
// 注意 有些组件使用异步加载会有影响
Vue.component('d2-table', () => import('./d2-table/index.vue'))
......@@ -73,3 +73,12 @@ a:hover {
.app-container {
padding: 20px;
}
// element
.el-table--medium td {
padding: 4px 0 !important;
}
.el-table .cell {
padding: 0 0;
}
\ No newline at end of file
<!-- -->
<template>
<div>
<a href="http://www.glsx.com.cn/">广联赛讯主页</a>
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>查询</el-button>
<d2-table
ref="recordTable"
:searchForm="searchForm"
:tableParams="tableParams"
:getListApi="getListApi"
:beforeSearchFn="beforeSearchFn"
>
<span
slot="auth-button"
slot-scope="scope"
:data="scope.scope"
>
<el-button type="text">新增</el-button>
</span>
</d2-table>
</div>
</template>
<script>
import { getListApi } from '@/api/test'
export default {
data() {
return {
searchForm: {},
getListApi: getListApi,
// 表格参数
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: 'list',
tableOption: true,
tableColumns: [{
label: 'id',
prop: 'id',
width: '80px'
}, {
label: '标题',
prop: 'title'
}]
}
}
},
mounted() { },
methods: {
beforeSearchFn() {
return new Promise(resolve => {
resolve()
})
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!