历史数据页面tables字段按原型更新

merge-requests/1/head
张鑫 5 years ago
parent 003ca20639
commit 00133f33b9

@ -1,15 +1,22 @@
<template> <template>
<a-config-provider :locale="locale">
<div id="app"> <div id="app">
<router-view v-if="isRouterAlive"/> <router-view v-if="isRouterAlive"/>
</div> </div>
</a-config-provider>
</template> </template>
<script> <script>
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
import moment from 'moment'
import 'moment/locale/zh-cn'
moment.locale('zh-cn')
export default { export default {
name: 'App', name: 'App',
data () { data () {
return { return {
isRouterAlive: true isRouterAlive: true,
locale: zhCN
} }
}, },
provide(){ // provide(){ //

@ -1,7 +1,9 @@
import Vue from "vue"; import Vue from "vue";
import { import {
Layout, Layout,
ConfigProvider,
Input, Input,
InputNumber,
Tabs, Tabs,
Table, Table,
Pagination, Pagination,
@ -22,10 +24,13 @@ import {
Tooltip, Tooltip,
Tag, Tag,
Drawer, Drawer,
Divider Divider,
DatePicker
} from "ant-design-vue"; } from "ant-design-vue";
Vue.use(Layout); Vue.use(Layout);
Vue.use(ConfigProvider);
Vue.use(Input); Vue.use(Input);
Vue.use(InputNumber);
Vue.use(Tabs); Vue.use(Tabs);
Vue.use(Table); Vue.use(Table);
Vue.use(Pagination); Vue.use(Pagination);
@ -46,6 +51,7 @@ Vue.use(Tooltip)
Vue.use(Tag) Vue.use(Tag)
Vue.use(Drawer) Vue.use(Drawer)
Vue.use(Divider) Vue.use(Divider)
Vue.use(DatePicker )
Vue.prototype.$message = message; Vue.prototype.$message = message;
Vue.prototype.$info = Modal.info; Vue.prototype.$info = Modal.info;
Vue.prototype.$success = Modal.success; Vue.prototype.$success = Modal.success;

@ -1,50 +1,37 @@
<template> <template>
<div class="history bg-white"> <div class="history bg-white">
<a-input-search <div class="ant-advanced-search-form">
class="mb24" <a-form layout="inline" :label-col="labelCol" :wrapper-col="wrapperCol" :form="queryParam">
style="width: 40%;" <a-row :gutter="12">
placeholder="请输入工单号搜索" <a-col :span="8" style="text-align: left">
v-model="search" <a-form-item label="工单号">
enter-button="搜索" <a-input v-model="queryParam.con_code" placeholder="请输入" />
@search="handleSearch" </a-form-item>
></a-input-search>' </a-col>
<a-table :rowKey="record => record.id" :columns="columns" :dataSource="dataSource"> <a-col :span="8">
<div slot="mediaPath" slot-scope="text, record"> <a-form-item class="ageInput" label="时间">
<a :href="record.mediaPath" target="_blank"> <a-range-picker @change="onTimeChange" v-model="queryParam.time" />
<img </a-form-item>
v-if="imglist.some(item => record.mediaType.toLowerCase() === item)" </a-col>
:src="record.mediaPath" <a-col :span="8" style="text-align: right">
alt="内容图片" <a-button type="primary" @click="handleSearch"></a-button>
style="width: 140px; cursor:pointer;" <!-- <a-button style="margin-left: 8px" @click="reset"></a-button>-->
/> </a-col>
</a-row>
<span v-else style="color: #40a9ff; cursor:pointer;">{{ record.mediaPath }}</span> </a-form>
</a>
</div> </div>
<a-table
:columns="columns"
:row-key="record => record.id"
:data-source="data"
:pagination="pagination"
@change="handleGetHistoryList"
>
</a-table> </a-table>
<a-drawer placement="bottom" :visible="drawer" @close="onClose">
<img
v-if="showDrawer.type === 'image'"
:src="showDrawer.url"
alt="内容图片"
style="height: 500px"
/>
<!-- <video-player
v-else
class="flex"
style="height: 500px;"
ref="videoPlayer"
:options="playerOptions"
></video-player>-->
</a-drawer>
</div> </div>
</template> </template>
<script> <script>
// require styles
// import "video.js/dist/video-js.css";
// import { videoPlayer } from "vue-video-player";
export default { export default {
name: "historyMonitoring", name: "historyMonitoring",
components: { components: {
@ -52,94 +39,113 @@ export default {
}, },
data() { data() {
return { return {
playerOptions: { labelCol: { span: 6 },
autoplay: true, wrapperCol: { span: 18 },
muted: true, queryParam: {},
language: "zh-CN", pageNum:1,
height: 500, pageSize:10,
sources: [ data: [],
{ pagination:{
src: "" total:0,
} defaultPageSize:10, //
] showTotal: total => `${total} 条数据`, //
showSizeChanger:true, //
pageSizeOptions: ['10', '20', '30'],
onShowSizeChange:(current, pageSize)=>this.pageSize = pageSize //
}, },
search: "", loading: false,
columns: [ columns: [
{ {
title: "工单号", title: "工单号",
dataIndex: "orderNum", dataIndex: "orderNum",
},
{
title: "巷道",
dataIndex: "str",
width: 90 width: 90
}, },
{ {
title: "仓位号", title: "货架类型",
dataIndex: "positionNum", dataIndex: "type",
width: 170
}, },
{ {
title: "创建时间", title: "货位",
dataIndex: "createTime", dataIndex: "address",
width: 200
}, },
{ {
title: "内容", title: "时间",
dataIndex: "mediaPath", dataIndex: "time",
scopedSlots: { },
customRender: "mediaPath" {
title: "照片(入库 货位 出库)",
dataIndex: "pic",
},
{
title: "视频状态",
dataIndex: "status",
},
{
title: "视频时长",
dataIndex: "mediaTime",
},
{
title: "球机1",
dataIndex: "camera1",
},
{
title: "球机2",
dataIndex: "camera2",
}, },
width: 300
}
],
dataSource: [],
imglist: ["png", "jpg", "jpeg", "bmp", "gif"],
videolist: [
"mp4",
"m2v",
"mkv",
"rmvb",
"wmv",
"avi",
"flv",
"mov",
"m4v"
], ],
drawer: false,
showDrawer: {}
}; };
}, },
mounted() {
this.handleGetHistoryList()
},
methods: { methods: {
handleSearch(){ handleSearch(){
console.log(this.$api) delete this.queryParam.time
this.query(); console.log(this.queryParam)
if(this.queryParam.con_code || this.queryParam.start_time && this.queryParam.end_time ){
this.handleGetHistoryList()
}else{
this.$message.error('请输入搜索条件')
}
},
handleGetHistoryList(pagination) {
console.log(pagination)
if(pagination){
this.pagination.current = pagination.current;
this.pagination.pageSize = pagination.pageSize;
this.pageNum = pagination.current;
this.pageSize = pagination.pageSize;
}
this.request();
}, },
query() { request() {
this.$api.httpApi this.$api.httpApi.queryList({
.queryList({
data: { data: {
orderNum: this.search pageNum:this.pageNum,
pageSize:this.pageSize,
...this.queryParam
} }
}) }).then(res => {
.then(res => { console.log(res)
// res.data[1].mediaPath =
// "http://gitlab.zhehekeji.com/security_check/security_front/raw/1.0.0/src/assets/video/video2.mp4";
this.dataSource = res.data;
}).catch(err => { }).catch(err => {
}); });
}, },
handlePopup(type, url) { onTimeChange(date, dateString) {
this.drawer = true; console.log(date)
this.showDrawer.type = type; console.log(date[0].format('X'))
this.playerOptions.sources[0].src = url; this.queryParam.start_time = date[0].format('X')
this.queryParam.end_time = date[1].format('X')
}, },
onClose() {
this.drawer = false;
}
}, },
mounted() {}
}; };
</script> </script>
<style lang="scss"> <style lang="scss" scoped>
.history { .history {
padding: 24px; padding: 24px;
} }
@ -149,4 +155,8 @@ export default {
.ant-drawer-body { .ant-drawer-body {
text-align: center; text-align: center;
} }
.ant-advanced-search-form .ant-form-item {
display: flex;
width: 100%;
}
</style> </style>

@ -127,7 +127,6 @@ export default {
console.log(key) console.log(key)
}, },
showModel(item){ showModel(item){
console.log(11111)
console.log(item) console.log(item)
this.visible = true this.visible = true
this.modelData=item this.modelData=item

Loading…
Cancel
Save