Commit 1571da76 by 胡悦

合并

2 parents aebe6df0 90204831
...@@ -11,8 +11,8 @@ ...@@ -11,8 +11,8 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.18.0", "axios": "^0.18.0",
"glsx-vue-common": "^1.2.1",
"element-ui": "^2.15.1", "element-ui": "^2.15.1",
"glsx-vue-common": "^1.2.1",
"lodash": "^4.17.10", "lodash": "^4.17.10",
"node-sass": "^4.9.3", "node-sass": "^4.9.3",
"sass-loader": "^7.1.0", "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 @@ ...@@ -3,7 +3,11 @@
import Vue from 'vue' import Vue from 'vue'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import 'element-ui/lib/theme-chalk/index.css' 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 { Request as request } from 'glsx-vue-common'
import '@/styles/index.scss'
// 组件
import '@/components' import '@/components'
// import _ from 'lodash' // import _ from 'lodash'
// import axios from 'axios' // import axios from 'axios'
......
...@@ -133,12 +133,7 @@ export default { ...@@ -133,12 +133,7 @@ export default {
// 表格数据-外部传入 // 表格数据-外部传入
tableData: { tableData: {
type: Array, type: Array,
default: () => [ default: () => []
{
name: 1212,
status: 1
}
]
}, },
tableTotal: { tableTotal: {
type: Number, type: Number,
...@@ -264,9 +259,9 @@ export default { ...@@ -264,9 +259,9 @@ export default {
params.sortColum = this.sortColum params.sortColum = this.sortColum
params.sort = this.sort === 'descending' ? 1 : 0 params.sort = this.sort === 'descending' ? 1 : 0
} }
console.log(this.getListApi)
this.getListApi(params).then(res => { this.getListApi(params).then(res => {
// this.data = res[this.tableParams.listName] this.data = res[this.tableParams.listName]
this.data = res
this.total = res.pagination.totalCount this.total = res.pagination.totalCount
this.loading = false this.loading = false
}).catch(() => { }).catch(() => {
......
...@@ -2,4 +2,3 @@ import Vue from 'vue' ...@@ -2,4 +2,3 @@ import Vue from 'vue'
// 注意 有些组件使用异步加载会有影响 // 注意 有些组件使用异步加载会有影响
Vue.component('d2-table', () => import('./d2-table/index.vue')) Vue.component('d2-table', () => import('./d2-table/index.vue'))
...@@ -73,3 +73,12 @@ a:hover { ...@@ -73,3 +73,12 @@ a:hover {
.app-container { .app-container {
padding: 20px; padding: 20px;
} }
// element
.el-table--medium td {
padding: 4px 0 !important;
}
.el-table .cell {
padding: 0 0;
}
\ No newline at end of file \ No newline at end of file
<!-- --> <!-- -->
<template> <template>
<div> <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> </div>
</template> </template>
<script> <script>
import { getListApi } from '@/api/test'
export default { export default {
data() { data() {
return { 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!