personmove
This commit is contained in:
parent
25e0cb4b13
commit
54ea10290c
|
|
@ -12,6 +12,26 @@ export default {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
bltBind: {
|
||||||
|
name: "绑定/解绑定位卡",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/third/tdevice/blt_bind/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
bltSync: {
|
||||||
|
name: "同步标签mac至平台",
|
||||||
|
req: async function(data){
|
||||||
|
return await http.post(
|
||||||
|
`${config.API_URL}/third/tdevice/blt_sync/`,
|
||||||
|
data
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
blt:{
|
blt:{
|
||||||
|
|
|
||||||
|
|
@ -903,6 +903,7 @@
|
||||||
mark: '1',
|
mark: '1',
|
||||||
},
|
},
|
||||||
LBType: '1',
|
LBType: '1',
|
||||||
|
userMarker:{},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
|
|
@ -1062,13 +1063,6 @@
|
||||||
} else {
|
} else {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
/*
|
|
||||||
* <div class="v_title" style="width: 327px;height: 45px;padding: 10px 0;font-size: 16px;font-weight: 700;color: #fff;position: relative;padding-left: 8px;display: flex;justify-content: space-between">
|
|
||||||
<div>`+event.markers[0].text+`</div><div style="width: 16px;height: 16px;background: url(.//public/img/close.png) no-repeat;background-size: 100% 100%;" @click="closeVideo"></div>
|
|
||||||
</div>
|
|
||||||
<div class="v_masker" style="width: 327px;height: 183px;background: url(.//public/img/v_mask.png) no-repeat;background-size: 100% 100%;" @click="playVideo()"></div>
|
|
||||||
<div id="`+event.markers[0].id+`"></div>
|
|
||||||
* */
|
|
||||||
//左侧数据统计
|
//左侧数据统计
|
||||||
this.getManCount();//人员统计$$
|
this.getManCount();//人员统计$$
|
||||||
this.getWarnings();//报警统计$$
|
this.getWarnings();//报警统计$$
|
||||||
|
|
@ -1082,9 +1076,7 @@
|
||||||
this.getAllMen();//人员
|
this.getAllMen();//人员
|
||||||
this.getAllPost();//岗位
|
this.getAllPost();//岗位
|
||||||
setInterval(function () {
|
setInterval(function () {
|
||||||
/*this.getManCount();//人员统计$$
|
|
||||||
this.getWarnings();//报警统计$$
|
|
||||||
this.getAreas();//区域*/
|
|
||||||
},3000)
|
},3000)
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
@ -1181,13 +1173,14 @@
|
||||||
},
|
},
|
||||||
//获取人员列表(全部在线标签列表信息)
|
//获取人员列表(全部在线标签列表信息)
|
||||||
getAllMen() {
|
getAllMen() {
|
||||||
this.$API.third.blt.all.req().then(res => {
|
let that = this;
|
||||||
|
that.$API.third.blt.all.req().then(res => {
|
||||||
if (res.err_msg) {
|
if (res.err_msg) {
|
||||||
} else {
|
} else {
|
||||||
this.userList = res.filter(item => {
|
that.userList = res.filter(item => {
|
||||||
return item.my_info.employee
|
return item.my_info.employee
|
||||||
});
|
});
|
||||||
// console.log(this.userList)
|
that.showUserMarkers();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
@ -1299,6 +1292,7 @@
|
||||||
show: false
|
show: false
|
||||||
});
|
});
|
||||||
window.map.addLayer(that.userMaskerLayer);
|
window.map.addLayer(that.userMaskerLayer);
|
||||||
|
that.getAllMen();
|
||||||
},
|
},
|
||||||
//喇叭layer
|
//喇叭layer
|
||||||
speakersMaskerLayers() {//消防物资
|
speakersMaskerLayers() {//消防物资
|
||||||
|
|
@ -1427,10 +1421,13 @@
|
||||||
let that = this;
|
let that = this;
|
||||||
let iconTextMarker = null;
|
let iconTextMarker = null;
|
||||||
if(that.userList.length>0){
|
if(that.userList.length>0){
|
||||||
|
let lng = [114.62923138539462,114.6315404372349];//经度
|
||||||
|
let i=0;
|
||||||
|
iconTextMarker = that.userList[0].mac+'userMarker';
|
||||||
let employee_ = that.userList[0].my_info.employee_;
|
let employee_ = that.userList[0].my_info.employee_;
|
||||||
iconTextMarker = new jsmap.JSIconTextMarker({
|
that.userMarker[iconTextMarker] = new jsmap.JSIconTextMarker({
|
||||||
id: that.userList[0].my_info.code,
|
id: that.userList[0].my_info.code,
|
||||||
position: {x: 114.6315404372349, y: 38.813557855009435, z: 0}, //坐标
|
position: {x: 114.62923138539462, y: 38.8133418942645, z: 0}, //坐标
|
||||||
floorId: 1, //楼层id,默认为1(地面)
|
floorId: 1, //楼层id,默认为1(地面)
|
||||||
image: "/img/user.png",
|
image: "/img/user.png",
|
||||||
text: employee_.name,
|
text: employee_.name,
|
||||||
|
|
@ -1450,66 +1447,16 @@
|
||||||
properties: {
|
properties: {
|
||||||
employee: employee_
|
employee: employee_
|
||||||
},
|
},
|
||||||
callback: (marker) => {
|
|
||||||
return employee_
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
that.userMaskerLayer.addMarker(that.userMarker[iconTextMarker]);
|
||||||
that.userMaskerLayer.addMarker(iconTextMarker);
|
setInterval(function () {
|
||||||
setTimeout(function () {
|
i=(i+1)%2;
|
||||||
console.log(that.userMaskerLayer);
|
that.userMaskerLayer.updateMarkerPosition(that.userMarker[iconTextMarker],{
|
||||||
that.userMaskerLayer.updateMarkerPosition(iconTextMarker,{
|
|
||||||
floorId:1,
|
floorId:1,
|
||||||
position: {x:114.62923138539462, y:38.8133418942642, z:0},
|
position: {x:lng[i], y:38.8133418942642, z:0},
|
||||||
animate: true
|
animate: {duration: 8000,}
|
||||||
});//动画效果,持续时间一秒
|
});//动画效果,持续时间一秒
|
||||||
},3000);
|
},8500)
|
||||||
setTimeout(function () {
|
|
||||||
console.log(that.userMaskerLayer);
|
|
||||||
that.userMaskerLayer.updateMarkerPosition(iconTextMarker,{
|
|
||||||
floorId:1,
|
|
||||||
position: {x:114.6315404372349, y: 38.813557855009435, z:0},
|
|
||||||
animate: true
|
|
||||||
});//动画效果,持续时间一秒
|
|
||||||
},6000);
|
|
||||||
debugger;
|
|
||||||
/*let employee_1 = that.userList[1].my_info.employee_;
|
|
||||||
iconTextMarker1 = new jsmap.JSIconTextMarker({
|
|
||||||
id: that.userList[1].my_info.code,
|
|
||||||
position: {x: 114.62923138539462, y: 38.8133418942642, z: 0}, //坐标
|
|
||||||
floorId: 1, //楼层id,默认为1(地面)
|
|
||||||
image: "/img/user.png",
|
|
||||||
text: employee_1.name,
|
|
||||||
font: '10px sans-serif',
|
|
||||||
fontColor: '#ffffff',
|
|
||||||
imageHeight: 25,
|
|
||||||
imageWidth: 25,
|
|
||||||
backgroundColor: 'rgba(0,0,0,0.3)',
|
|
||||||
backgroundRadius: 1,
|
|
||||||
backgroundStrokeColor: 'rgba(0,0,0,0.3)',
|
|
||||||
backgroundStrokeWidth: 1,
|
|
||||||
iconTextType: jsmap.JSIconTextType.TOPTEXT_BOTTOMICON,
|
|
||||||
allowPicking: true,
|
|
||||||
displayCondition: new jsmap.JSDisplayCondition(0.0, 1000),
|
|
||||||
nearFarScale: new jsmap.JSNearFarScale(0.0, 1, 500, 1),
|
|
||||||
show: true,
|
|
||||||
properties: {
|
|
||||||
employee: employee_1
|
|
||||||
},
|
|
||||||
callback: (marker) => {
|
|
||||||
return employee_1
|
|
||||||
}
|
|
||||||
});
|
|
||||||
that.userMaskerLayer.addMarker(iconTextMarker1);
|
|
||||||
setTimeout(function () {
|
|
||||||
that.userMaskerLayer.updateMarkerPosition(jsmap.JSIconTextMarker,{
|
|
||||||
floorId:1,
|
|
||||||
position: {x:114.6315404372349, y:38.813557855009435, z:0},
|
|
||||||
animate: true
|
|
||||||
});//动画效果,持续时间一秒
|
|
||||||
|
|
||||||
},3000)*/
|
|
||||||
}else{
|
|
||||||
}
|
}
|
||||||
/*that.userList.forEach(item => {
|
/*that.userList.forEach(item => {
|
||||||
if (item.my_info.code) {
|
if (item.my_info.code) {
|
||||||
|
|
@ -1737,17 +1684,7 @@
|
||||||
that.riskMarkerLayer.show = false;
|
that.riskMarkerLayer.show = false;
|
||||||
}
|
}
|
||||||
if (that.markList[6]) {
|
if (that.markList[6]) {
|
||||||
that.$API.third.blt.all.req().then(res => {
|
that.userMaskerLayer.show = true;
|
||||||
if (res.err_msg) {
|
|
||||||
} else {
|
|
||||||
that.userMaskerLayer.show = true;
|
|
||||||
that.userList = res.filter(item=>{
|
|
||||||
return item.my_info.code
|
|
||||||
});
|
|
||||||
// this.showUserMarkers();
|
|
||||||
that.showUserMarkers();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
that.userMaskerLayer.show = false;
|
that.userMaskerLayer.show = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,247 +1,326 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-plus"
|
icon="el-icon-plus"
|
||||||
@click="handleForm('add')"
|
@click="handleForm('add')"
|
||||||
></el-button>
|
></el-button>
|
||||||
<!--
|
<!--
|
||||||
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></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> -->
|
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<div class="right-panel-search">
|
<div class="right-panel-search">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="search.keyword"
|
v-model="search.keyword"
|
||||||
placeholder="姓名/手机号"
|
placeholder="姓名/手机号"
|
||||||
clearable
|
clearable
|
||||||
@click="upsearch"
|
@click="upsearch"
|
||||||
></el-input>
|
></el-input>
|
||||||
<el-button
|
<el-button
|
||||||
type="primary"
|
type="primary"
|
||||||
icon="el-icon-search"
|
icon="el-icon-search"
|
||||||
@click="upsearch"
|
@click="upsearch"
|
||||||
></el-button>
|
></el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-header>
|
</el-header>
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding">
|
||||||
<scTable
|
<scTable
|
||||||
ref="table"
|
ref="table"
|
||||||
:apiObj="apiObj"
|
:apiObj="apiObj"
|
||||||
row-key="id"
|
row-key="id"
|
||||||
@selection-change="selectionChange"
|
@selection-change="selectionChange"
|
||||||
stripe
|
stripe
|
||||||
@resetQuery="resetQuery"
|
@resetQuery="resetQuery"
|
||||||
>
|
>
|
||||||
<el-table-column type="selection" width="50"></el-table-column>
|
<el-table-column type="selection" width="50"></el-table-column>
|
||||||
<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="姓名" prop="name" width="150"></el-table-column>
|
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
|
||||||
<el-table-column label="证件照" prop="photo" width="200">
|
<el-table-column label="证件照" prop="photo" width="200">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="手机号"
|
label="手机号"
|
||||||
prop="phone"
|
prop="phone"
|
||||||
width="120"
|
width="120"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column label="部门" prop="belong_dept" width="180">
|
<el-table-column label="部门" prop="belong_dept" width="180">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<span v-if="scope.row.belong_dept_">{{
|
<span v-if="scope.row.belong_dept_">{{
|
||||||
scope.row.belong_dept_.name
|
scope.row.belong_dept_.name
|
||||||
}}</span>
|
}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
label="创建时间"
|
label="创建时间"
|
||||||
prop="create_time"
|
prop="create_time"
|
||||||
width="180"
|
width="180"
|
||||||
></el-table-column>
|
></el-table-column>
|
||||||
<el-table-column label="操作" fixed="right" align="left" width="170">
|
<el-table-column label="操作" fixed="right" align="left" width="170">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
<el-button-group>
|
<el-button
|
||||||
<el-button
|
text
|
||||||
text
|
type="primary"
|
||||||
type="primary"
|
size="small"
|
||||||
size="small"
|
@click="Addcertificate(scope.row)"
|
||||||
@click="Addcertificate(scope.row)"
|
>绑定证书
|
||||||
>绑定证书</el-button
|
</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
text
|
text
|
||||||
type="primary"
|
type="success"
|
||||||
size="small"
|
size="small"
|
||||||
@click="handleForm('show', scope.row)"
|
@click="handleForm('show', scope.row)"
|
||||||
>查看</el-button
|
>查看
|
||||||
>
|
</el-button
|
||||||
<el-button
|
>
|
||||||
text
|
<el-button
|
||||||
type="warning"
|
text
|
||||||
size="small"
|
type="warning"
|
||||||
@click="handleForm('edit', scope.row)"
|
size="small"
|
||||||
>编辑</el-button
|
@click="handleForm('edit', scope.row)"
|
||||||
>
|
>编辑
|
||||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
</el-button
|
||||||
<template #reference>
|
>
|
||||||
<el-button text type="danger" size="small">删除</el-button>
|
<el-button
|
||||||
</template>
|
v-if="scope.row.third_info.id"
|
||||||
</el-popconfirm> -->
|
text
|
||||||
</el-button-group>
|
type="primary"
|
||||||
</template>
|
size="small"
|
||||||
</el-table-column>
|
@click="handleBindBlt(20, scope.row)"
|
||||||
</scTable>
|
>解绑
|
||||||
</el-main>
|
</el-button>
|
||||||
</el-container>
|
<el-button
|
||||||
<save-dialog
|
v-else
|
||||||
v-if="dialog.save"
|
text
|
||||||
ref="saveDialog"
|
type="primary"
|
||||||
@success="handleSaveSuccess"
|
size="small"
|
||||||
@closed="dialog.save = false"
|
@click="handleBindBlt(10, scope.row)"
|
||||||
></save-dialog>
|
>绑定
|
||||||
|
</el-button>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
<save-dialog
|
||||||
|
v-if="dialog.save"
|
||||||
|
ref="saveDialog"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
></save-dialog>
|
||||||
|
<el-Dialog
|
||||||
|
title="绑定定位卡"
|
||||||
|
v-model="showBindBlt"
|
||||||
|
destroy-on-close
|
||||||
|
@closed="closeDrawer"
|
||||||
|
>
|
||||||
|
<el-form
|
||||||
|
ref="dialogForm"
|
||||||
|
:model="form"
|
||||||
|
label-width="120px"
|
||||||
|
>
|
||||||
|
<el-form-item label="姓名">
|
||||||
|
{{bindBltName}}
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="绑定卡号">
|
||||||
|
<el-select v-model="form.blt" style="width: 100%">
|
||||||
|
<el-option
|
||||||
|
v-for="item in bltList"
|
||||||
|
:key="item.id"
|
||||||
|
:label="item.id"
|
||||||
|
:value="item.id"
|
||||||
|
/>
|
||||||
|
</el-select>
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<template #footer>
|
||||||
|
<el-button v-if="form.type===10" type="primary" @click="submitBindBlt">绑定</el-button>
|
||||||
|
<el-button v-if="form.type===20" type="primary" @click="submitBindBlt">解绑</el-button>
|
||||||
|
<el-button @click="showBindBlt = false">取消</el-button>
|
||||||
|
</template>
|
||||||
|
</el-Dialog>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./ep_form.vue";
|
import saveDialog from "./ep_form.vue";
|
||||||
export default {
|
|
||||||
name: "employee",
|
|
||||||
components: {
|
|
||||||
saveDialog,
|
|
||||||
},
|
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
dialog: {
|
|
||||||
save: false,
|
|
||||||
permission: false,
|
|
||||||
},
|
|
||||||
apiObj: this.$API.hrm.employee.list,
|
|
||||||
query: {},
|
|
||||||
selection: [],
|
|
||||||
search: {
|
|
||||||
keyword: null,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
//人员证书添加
|
|
||||||
Addcertificate(row) {
|
|
||||||
this.$router.push({
|
|
||||||
name: "certificate",
|
|
||||||
query: {
|
|
||||||
id: row.id,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//添加
|
|
||||||
handleForm(type, row) {
|
|
||||||
this.dialog.save = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
if (type === "add") {
|
|
||||||
this.$refs.saveDialog.open(type);
|
|
||||||
} else {
|
|
||||||
this.$refs.saveDialog.open(type).setData(row);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
|
|
||||||
/*//添加
|
export default {
|
||||||
add(){
|
name: "employee",
|
||||||
this.dialog.save = true
|
components: {
|
||||||
|
saveDialog,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dialog: {
|
||||||
|
save: false,
|
||||||
|
permission: false,
|
||||||
|
},
|
||||||
|
apiObj: this.$API.hrm.employee.list,
|
||||||
|
query: {},
|
||||||
|
selection: [],
|
||||||
|
search: {
|
||||||
|
keyword: null,
|
||||||
|
},
|
||||||
|
showBindBlt: false,
|
||||||
|
bltList:[],
|
||||||
|
bindBltName:'',
|
||||||
|
form:{
|
||||||
|
type: 10,
|
||||||
|
blt:'',
|
||||||
|
employee:'',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted(){
|
||||||
|
this.getBltList();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
//人员证书添加
|
||||||
|
Addcertificate(row) {
|
||||||
|
this.$router.push({
|
||||||
|
name: "certificate",
|
||||||
|
query: {
|
||||||
|
id: row.id,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//添加
|
||||||
|
handleForm(type, row) {
|
||||||
|
this.dialog.save = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.saveDialog.open('add')
|
if (type === "add") {
|
||||||
|
this.$refs.saveDialog.open(type);
|
||||||
|
} else {
|
||||||
|
this.$refs.saveDialog.open(type).setData(row);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
/*//添加
|
||||||
|
add(){
|
||||||
|
this.dialog.save = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open('add')
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//编辑
|
||||||
|
table_edit(row){
|
||||||
|
this.dialog.save = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open('edit').setData(row)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
//查看
|
||||||
|
table_show(row){
|
||||||
|
this.dialog.save = true
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.saveDialog.open('show').setData(row)
|
||||||
|
})
|
||||||
|
},*/
|
||||||
|
//权限设置
|
||||||
|
permission() {
|
||||||
|
this.dialog.permission = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.permissionDialog.open();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//删除
|
||||||
|
async table_del(row) {
|
||||||
|
await this.$API.hrm.employee.create.req(row.id).then((res) => {
|
||||||
|
if (res.err_msg) {
|
||||||
|
this.$message.error(res.err_msg);
|
||||||
|
} else {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
this.$message.success("删除成功");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//批量删除
|
||||||
|
async batch_del() {
|
||||||
|
this.$confirm(
|
||||||
|
`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`,
|
||||||
|
"提示",
|
||||||
|
{
|
||||||
|
type: "warning",
|
||||||
|
}
|
||||||
|
)
|
||||||
|
.then(() => {
|
||||||
|
const loading = this.$loading();
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
loading.close();
|
||||||
|
this.$message.success("操作成功");
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
});
|
||||||
|
},
|
||||||
|
//表格选择后回调事件
|
||||||
|
selectionChange(selection) {
|
||||||
|
this.selection = selection;
|
||||||
|
},
|
||||||
|
//表格内开关
|
||||||
|
changeSwitch(val, row) {
|
||||||
|
row.status = row.status == "1" ? "0" : "1";
|
||||||
|
row.$switch_status = true;
|
||||||
|
setTimeout(() => {
|
||||||
|
delete row.$switch_status;
|
||||||
|
row.status = val;
|
||||||
|
this.$message.success("操作成功");
|
||||||
|
}, 500);
|
||||||
|
},
|
||||||
|
//搜索
|
||||||
|
upsearch() {
|
||||||
|
},
|
||||||
|
//根据ID获取树结构
|
||||||
|
filterTree(id) {
|
||||||
|
var target = null;
|
||||||
|
|
||||||
|
function filter(tree) {
|
||||||
|
tree.forEach((item) => {
|
||||||
|
if (item.id == id) {
|
||||||
|
target = item;
|
||||||
|
}
|
||||||
|
if (item.children) {
|
||||||
|
filter(item.children);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
filter(this.$refs.table.tableData);
|
||||||
|
return target;
|
||||||
|
},
|
||||||
|
//本地更新数据
|
||||||
|
handleSaveSuccess(data, mode) {
|
||||||
|
if (mode == "add") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
} else if (mode == "edit") {
|
||||||
|
this.$refs.table.refresh();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
resetQuery() {
|
||||||
|
this.query = {};
|
||||||
|
},
|
||||||
|
getBltList(){
|
||||||
|
this.$API.third.tdevice.list.req({type:30,page:0}).then(res=>{
|
||||||
|
this.bltList = res/*.filter(item=>{
|
||||||
|
return item.my_info.code === undefined
|
||||||
|
})*/
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//编辑
|
handleBindBlt(type,row) {
|
||||||
table_edit(row){
|
this.bindBltName = row.name;
|
||||||
this.dialog.save = true
|
this.form.type = type;
|
||||||
this.$nextTick(() => {
|
this.form.employee = row.id;
|
||||||
this.$refs.saveDialog.open('edit').setData(row)
|
this.showBindBlt = true;
|
||||||
|
},
|
||||||
|
submitBindBlt(){
|
||||||
|
this.$API.third.tdevice.bltBind.req(this.form).then(res=>{
|
||||||
|
this.bltList = res.filter(item=>{
|
||||||
|
|
||||||
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
//查看
|
},
|
||||||
table_show(row){
|
};
|
||||||
this.dialog.save = true
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.saveDialog.open('show').setData(row)
|
|
||||||
})
|
|
||||||
},*/
|
|
||||||
//权限设置
|
|
||||||
permission() {
|
|
||||||
this.dialog.permission = true;
|
|
||||||
this.$nextTick(() => {
|
|
||||||
this.$refs.permissionDialog.open();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//删除
|
|
||||||
async table_del(row) {
|
|
||||||
await this.$API.hrm.employee.create.req(row.id).then((res) => {
|
|
||||||
if (res.err_msg) {
|
|
||||||
this.$message.error(res.err_msg);
|
|
||||||
} else {
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
this.$message.success("删除成功");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
},
|
|
||||||
//批量删除
|
|
||||||
async batch_del() {
|
|
||||||
this.$confirm(
|
|
||||||
`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`,
|
|
||||||
"提示",
|
|
||||||
{
|
|
||||||
type: "warning",
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.then(() => {
|
|
||||||
const loading = this.$loading();
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
loading.close();
|
|
||||||
this.$message.success("操作成功");
|
|
||||||
})
|
|
||||||
.catch(() => {});
|
|
||||||
},
|
|
||||||
//表格选择后回调事件
|
|
||||||
selectionChange(selection) {
|
|
||||||
this.selection = selection;
|
|
||||||
},
|
|
||||||
//表格内开关
|
|
||||||
changeSwitch(val, row) {
|
|
||||||
row.status = row.status == "1" ? "0" : "1";
|
|
||||||
row.$switch_status = true;
|
|
||||||
setTimeout(() => {
|
|
||||||
delete row.$switch_status;
|
|
||||||
row.status = val;
|
|
||||||
this.$message.success("操作成功");
|
|
||||||
}, 500);
|
|
||||||
},
|
|
||||||
//搜索
|
|
||||||
upsearch() {},
|
|
||||||
//根据ID获取树结构
|
|
||||||
filterTree(id) {
|
|
||||||
var target = null;
|
|
||||||
function filter(tree) {
|
|
||||||
tree.forEach((item) => {
|
|
||||||
if (item.id == id) {
|
|
||||||
target = item;
|
|
||||||
}
|
|
||||||
if (item.children) {
|
|
||||||
filter(item.children);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
filter(this.$refs.table.tableData);
|
|
||||||
return target;
|
|
||||||
},
|
|
||||||
//本地更新数据
|
|
||||||
handleSaveSuccess(data, mode) {
|
|
||||||
if (mode == "add") {
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
} else if (mode == "edit") {
|
|
||||||
this.$refs.table.refresh();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
resetQuery() {
|
|
||||||
this.query = {};
|
|
||||||
},
|
|
||||||
},
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue