blt sync bug

This commit is contained in:
曹前明 2022-09-06 17:19:15 +08:00
parent f9868d0494
commit e36c5b43e3
3 changed files with 173 additions and 58 deletions

View File

@ -164,7 +164,7 @@ export default {
//
async syncData() {
this.syncLoading = true;
var res = await this.$API.third.tdevice.vchannelSync.req({});
var res = await this.$API.third.tdevice.bltSync.req({});
this.$refs.table.refresh();
this.syncLoading = false;
},

View File

@ -1,15 +1,48 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-select v-model="query.cates" placeholder="事件种类" @change="handleQuery">
<el-option v-for="item in cateOptions" :key="item.id">{{item.name}}</el-option>
</el-select>
</div>
<div class="right-panel">
</div>
</el-header>
<div class="left-panel">
<el-select
v-model="query.cates"
placeholder="事件种类"
@change="handleQuery"
clearable
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.area"
placeholder="发生区域"
@change="handleQuery"
style="margin-left:2px"
clearable
>
<el-option
v-for="item in areaOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="timeRange"
type="datetimerange"
range-separator="至"
start-placeholder="发生时间始"
end-placeholder="发生时间止"
style="margin-left:2px"
value-format="YYYY-MM-DD HH:mm:ss"
@change="handleQuery"
clearable
/>
</div>
<div class="right-panel"></div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
@ -21,11 +54,15 @@
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="事件种类" width="200">
<template #default="scope" >
<el-tag v-for="item in scope.row.cates_"
:key="item.id" type="warning">{{item.name}}</el-tag>
<template #default="scope">
<el-tag
v-for="item in scope.row.cates_"
:key="item.id"
type="warning"
>{{ item.name }}</el-tag
>
</template>
</el-table-column>
</el-table-column>
<el-table-column label="发生区域" prop="area_.name"></el-table-column>
<el-table-column label="当事人" prop="employee_.name">
<template #default="scope">
@ -63,9 +100,13 @@
</span>
</template>
</el-table-column>
<el-table-column label="发生时间" prop="create_time" width="150"></el-table-column>
<el-table-column
<el-table-column
label="发生时间"
prop="create_time"
width="150"
></el-table-column>
<el-table-column
label="处理人"
prop="handle_user_name"
></el-table-column>
@ -83,24 +124,26 @@
<el-tag v-else type="success"></el-tag>
</template>
</el-table-column>
<el-table-column label="操作" fixed="right" align="center">
<template #default="scope">
<el-button
link
type="info"
size="small"
@click="table_show(scope.row, scope.$index)"
>查看</el-button>
<el-button
link
type="primary"
size="small"
v-if="scope.row.handle_user==null"
@click="table_handle(scope.row, scope.$index)"
>处理</el-button>
<!-- <el-button text type="warning" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> -->
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<el-button
link
type="info"
size="small"
@click="table_show(scope.row, scope.$index)"
>查看</el-button
>
<el-button
link
type="primary"
size="small"
v-if="scope.row.handle_user == null"
@click="table_handle(scope.row, scope.$index)"
>处理</el-button
>
<!-- <el-button text type="warning" size="small" @click="table_edit(scope.row, scope.$index)">编辑</el-button> -->
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button text type="danger" size="small">删除</el-button>
</template>
@ -110,7 +153,6 @@
</scTable>
</el-main>
</el-container>
</template>
<script>
import { CircleCheckFilled, CircleCloseFilled } from "@element-plus/icons-vue";
@ -119,10 +161,13 @@ export default {
components: {
CircleCheckFilled,
CircleCloseFilled,
},
data() {
return {
defaultTime: ['00:00:00', '23:59:59'],
timeRange: [],
cateOptions: [],
areaOptions: [],
dialog: {
save: false,
permission: false,
@ -135,33 +180,57 @@ export default {
},
};
},
created() {
this.getCateOptions();
this.getAreaOptions();
},
methods: {
//
table_show(row) {
this.$router.push({
this.$router.push({
name: "eventhandlefrom",
query: {
id: row.id,
},
});
},
//
table_handle(row) {
this.$router.push({
getCateOptions() {
this.$API.ecm.event_cate.list.req({ page: 0 }).then((res) => {
this.cateOptions = res;
});
},
getAreaOptions() {
this.$API.am.area.list.req({page: 0}).then(res=>{
this.areaOptions = res;
})
},
//
table_handle(row) {
this.$router.push({
name: "eventhandlefrom",
query: {
id: row.id,
},
});
},
//
handleQuery() {
this.$refs.table.queryData(this.query)
},
if(this.timeRange){
this.query.start_create = this.timeRange[0]
this.query.end_create = this.timeRange[1]
}else{
this.query.end_create = null
this.query.start_create = null
}
if(this.query.cates){
}else{
this.query.cates = null
}
this.$refs.table.queryData(this.query);
},
//
resetQuery() {
this.query = {};
},

View File

@ -1,18 +1,48 @@
<template>
<el-container>
<!-- <el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button>
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button>
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="姓名/手机号" clearable @click="handleQuery"></el-input>
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button>
</div>
</div>
</el-header> -->
<el-header>
<div class="left-panel">
<el-select
v-model="query.cates"
placeholder="事件种类"
@change="handleQuery"
clearable
>
<el-option
v-for="item in cateOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-select
v-model="query.area"
placeholder="发生区域"
@change="handleQuery"
style="margin-left:2px"
clearable
>
<el-option
v-for="item in areaOptions"
:key="item.id"
:label="item.name"
:value="item.id"
></el-option>
</el-select>
<el-date-picker
v-model="timeRange"
type="datetimerange"
range-separator="至"
start-placeholder="发生时间始"
end-placeholder="发生时间止"
style="margin-left:2px"
value-format="YYYY-MM-DD HH:mm:ss"
@change="handleQuery"
clearable
/>
</div>
<div class="right-panel"></div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
@ -102,6 +132,9 @@ export default {
},
data() {
return {
timeRange: [],
cateOptions: [],
areaOptions: [],
dialog: {
save: false,
permission: false,
@ -114,8 +147,21 @@ export default {
},
};
},
created() {
this.getCateOptions();
this.getAreaOptions();
},
methods: {
getCateOptions() {
this.$API.ecm.event_cate.list.req({ page: 0 }).then((res) => {
this.cateOptions = res;
});
},
getAreaOptions() {
this.$API.am.area.list.req({page: 0}).then(res=>{
this.areaOptions = res;
})
},
//
table_show(row) {
this.$router.push({