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() { async syncData() {
this.syncLoading = true; 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.$refs.table.refresh();
this.syncLoading = false; this.syncLoading = false;
}, },

View File

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

View File

@ -1,18 +1,48 @@
<template> <template>
<el-container> <el-container>
<!-- <el-header> <el-header>
<div class="left-panel"> <div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="add"></el-button> <el-select
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button> v-model="query.cates"
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> placeholder="事件种类"
</div> @change="handleQuery"
<div class="right-panel"> clearable
<div class="right-panel-search"> >
<el-input v-model="search.keyword" placeholder="姓名/手机号" clearable @click="handleQuery"></el-input> <el-option
<el-button type="primary" icon="el-icon-search" @click="handleQuery"></el-button> v-for="item in cateOptions"
</div> :key="item.id"
</div> :label="item.name"
</el-header> --> :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"> <el-main class="nopadding">
<scTable <scTable
ref="table" ref="table"
@ -102,6 +132,9 @@ export default {
}, },
data() { data() {
return { return {
timeRange: [],
cateOptions: [],
areaOptions: [],
dialog: { dialog: {
save: false, save: false,
permission: false, permission: false,
@ -114,8 +147,21 @@ export default {
}, },
}; };
}, },
created() {
this.getCateOptions();
this.getAreaOptions();
},
methods: { 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) { table_show(row) {
this.$router.push({ this.$router.push({