1、api配置文件位置规则修改至src/api/http-api.js,规则配置详见axios.js文件。

2、巷道管理列表页构建+接口联调
merge-requests/1/head
张鑫 5 years ago
parent 42e5873ccf
commit 6c361681f9

@ -0,0 +1,13 @@
export default {
getStreetList: {
method: "POST",
url: "/street/page",
name: "获取巷道列表"
},
queryList: {
url: '/order/list',
name: '查询',
method: 'POST'
}
}

@ -6,7 +6,7 @@
<slot name="title">{{ title }}</slot> <slot name="title">{{ title }}</slot>
</span> </span>
</div> </div>
<router-view class="sss"></router-view> <router-view class="table"></router-view>
<!-- footer --> <!-- footer -->
<div class="wrap-footer bg-white"> <div class="wrap-footer bg-white">
<slot name="footer"></slot> <slot name="footer"></slot>
@ -95,5 +95,11 @@ export default {
text-align: center; text-align: center;
z-index: 2; z-index: 2;
} }
.table{
background: #ffffff;
margin: 8px 20px;
height: 900px;
padding:20px;
}
} }
</style> </style>

@ -15,7 +15,7 @@ const trans = (apiObj) => {
return obj; return obj;
}; };
const apiAll = require.context('@/views', true, /-api\.js$/); const apiAll = require.context('@/api', true, /-api\.js$/);
const moduleApis = {}; const moduleApis = {};
// -转驼峰 // -转驼峰
function toCamelCase(str) { function toCamelCase(str) {

@ -1,7 +1,3 @@
export default { export default {
queryList: {
url: '/order/list',
name: '查询',
method: 'POST'
}
} }

@ -108,10 +108,11 @@ export default {
}, },
methods: { methods: {
handleSearch() { handleSearch() {
console.log(this.$api)
this.query(); this.query();
}, },
query() { query() {
this.$api.historyApi this.$api.httpApi
.queryList({ .queryList({
data: { data: {
orderNum: this.search orderNum: this.search

@ -1,3 +1,103 @@
<template> <template>
<div>巷道管理页面</div> <a-table
:columns="columns"
:row-key="record => record.id"
:data-source="data"
:pagination="pagination"
@change="handleGetStreetList"
>
<span slot="leftType" slot-scope="text">
{{ text === 0 ? '单伸' : '双伸' }}
</span>
<span slot="rightType" slot-scope="text">
{{ text === 0 ? '单伸' : '双伸' }}
</span>
<span slot="actions" slot-scope="text">
<template>
<span v-if="text.camera1Name">{{text.camera1Name}}</span>
<span v-if="text.camera2Name">{{text.camera2Name}}</span>
<span v-if="text.camera1Name && text.camera2Name">{{text.camera1Name}}/{{text.camera2Name}}</span>
</template>
</span>
<span slot="action" slot-scope="text, record">
<a @click="editModal(1,record)" v-action="'dosage_edit'">
编辑
</a>
<a-divider type="vertical" v-action="'dosage_edit'"/>
<a-popconfirm
title="是否删除?"
@confirm="() => delDosage(record)"
v-action="'dosage_delete'"
>
<a>删除</a>
</a-popconfirm>
</span>
</a-table>
</template> </template>
<script>
// import reqwest from 'reqwest';
const columns = [
{
title: '巷道名称',
dataIndex: 'name',
},
{
title: 'PLC-ID',
dataIndex: 'plcId',
},
{
title: '左货架类型',
dataIndex: 'leftType',
scopedSlots: { customRender: 'leftType' }
},
{
title: '右货架类型',
dataIndex: 'rightType',
scopedSlots: { customRender: 'rightType' }
},
{
title: '对应球机',
scopedSlots: { customRender: 'actions' },
},
{
title: '修改时间',
dataIndex: 'updateTime',
},
{
title: '操作',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
},
];
export default {
data() {
return {
pageNum:1,
pageSize:10,
data: [],
pagination: {},
loading: false,
columns,
};
},
mounted() {
this.handleGetStreetList()
},
methods: {
handleGetStreetList(){
this.$api.httpApi
.getStreetList({
data: {
pageNum:this.pageNum,
pageSize:this.pageSize,
}
})
.then(res => {
// res.data[1].mediaPath =
// "http://gitlab.zhehekeji.com/security_check/security_front/raw/1.0.0/src/assets/video/video2.mp4";
this.data = res.data.list;
});
}
},
};
</script>

Loading…
Cancel
Save