|
|
|
|
@ -0,0 +1,608 @@
|
|
|
|
|
<template>
|
|
|
|
|
<el-row>
|
|
|
|
|
<el-col :span="24">
|
|
|
|
|
<div style="padding: 10px 0;display: flex">
|
|
|
|
|
|
|
|
|
|
<!-- <el-button type="primary" style="margin-left: 0.5%;margin-top: 0px;" @click="addOperators">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<plus />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 新增 </span>
|
|
|
|
|
</el-button> -->
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" style="margin-left: 0.5%;margin-top: 0px;" @click="updateOperators">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<Edit />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;">修改</span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-button type="warning" style="margin-left: 0.5%;margin-top: 0px;" @click="configClient">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<Edit />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 远程修改配置信息 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
<!-- <el-button type="danger" style="margin-top: 0px;" @click="del">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<delete />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 解锁屏幕 </span>
|
|
|
|
|
</el-button> -->
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" style="margin-left: 0.5%;margin-top: 0px;" @click="searchShow = true">
|
|
|
|
|
<el-icon style="vertical-align: middle;">
|
|
|
|
|
<search />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 查找 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<el-table :height=myHeight highlight-current-row="true" v-loading.fullscreen.lock="tableLoading"
|
|
|
|
|
:data="tableData" border style="width: 100%;" @current-change="tableHandleCurrentChange"
|
|
|
|
|
@selection-change="handleSelectionChange">
|
|
|
|
|
<el-table-column :resizable="false" fixed align="center" type="index" width="80" label="序号" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" prop="clientName" label="客户端别名" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" width="150" prop="clientId" label="客户端MAC地址" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" width="180" prop="connectStartTime"
|
|
|
|
|
label="客户端创建连接时间" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" prop="passwordKey" label="客户端动态口令私钥" />
|
|
|
|
|
<el-table-column :resizable="false" align="center" width="130" prop="groupName" label="客户端所属群组" />
|
|
|
|
|
<el-table-column :resizable="false" prop="right" label="操作" width="200" align="center">
|
|
|
|
|
<template v-slot="scope">
|
|
|
|
|
<el-button style="width: 48%;margin-left: 1%;margin-top: 2%" @click="unlock(scope.row)"
|
|
|
|
|
type="danger" size="default" :icon="View">
|
|
|
|
|
<span style="vertical-align: middle;"> 解锁屏幕 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</template>
|
|
|
|
|
</el-table-column>
|
|
|
|
|
</el-table>
|
|
|
|
|
|
|
|
|
|
<el-config-provider :locale="locale">
|
|
|
|
|
<el-pagination background @size-change="handleSizeChange" @current-change="handleCurrentChange"
|
|
|
|
|
:current-page="searchForm.pageNum" :page-sizes="[20, 30, 50]" :page-size="searchForm.pageSize"
|
|
|
|
|
layout="total, sizes, prev, pager, next, jumper" :total="searchForm.total">
|
|
|
|
|
</el-pagination>
|
|
|
|
|
</el-config-provider>
|
|
|
|
|
</el-col>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog title="人员信息查找" v-model="searchShow" width="35%" top="0.5%" draggable :modal="false">
|
|
|
|
|
<el-form :model="searchForm" size="medium" ref="searchFormElement">
|
|
|
|
|
<el-row>
|
|
|
|
|
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="客户端别名" :label-width="formLabelWidth">
|
|
|
|
|
<el-input clearable placeholder="请输入" v-model="searchForm.clientNameQuery"
|
|
|
|
|
autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="客户端MAC地址" :label-width="formLabelWidth">
|
|
|
|
|
<el-input clearable placeholder="请输入" v-model="searchForm.clientIdQuery"
|
|
|
|
|
autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="群组名称" :label-width="formLabelWidth">
|
|
|
|
|
<el-input clearable placeholder="请输入" v-model="searchForm.groupNameQuery"
|
|
|
|
|
autocomplete="off"></el-input>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="核销时间(起始)" :label-width="formLabelWidth">
|
|
|
|
|
<el-date-picker clearable v-model="searchForm.startTime" type="date" format="YYYY-MM-DD"
|
|
|
|
|
value-format="YYYY-MM-DD 00:00:00" style="width: 100%;" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
<el-col :span="19" :offset="1">
|
|
|
|
|
<el-form-item label="核销时间(终止)" :label-width="formLabelWidth">
|
|
|
|
|
<el-date-picker clearable v-model="searchForm.endTime" type="date" format="YYYY-MM-DD"
|
|
|
|
|
value-format="YYYY-MM-DD 23:59:59" style="width: 100%;" />
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-col>
|
|
|
|
|
</el-row>
|
|
|
|
|
</el-form>
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="searchShow = false"> 取消</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" @click="resetSearchData">
|
|
|
|
|
<el-icon>
|
|
|
|
|
<Refresh />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 重置 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
|
|
|
|
|
<el-button type="primary" @click="searchData">
|
|
|
|
|
<el-icon style="vertical-align: middle;">
|
|
|
|
|
<search />
|
|
|
|
|
</el-icon>
|
|
|
|
|
<span style="vertical-align: middle;"> 搜索 </span>
|
|
|
|
|
</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="addOperatorsShow" width="40%" top="0.5%" :destroy-on-close="true"
|
|
|
|
|
:close-on-click-modal="false">
|
|
|
|
|
<!-- :before-close="addOperatorsShow = false" -->
|
|
|
|
|
|
|
|
|
|
<template #header="{ titleAdd, titleClass, titleUpdate }">
|
|
|
|
|
<div class="my-header">
|
|
|
|
|
<span v-if="addTitle" :id="titleAdd" :class="titleClass">添加</span>
|
|
|
|
|
<span v-if="updateTitle" :id="titleUpdate" :class="titleClass">修改</span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<clientAddUpdate ref="clientAddUpdateDom" :rowData="addUpdateForm" @addReload="addReload">
|
|
|
|
|
</clientAddUpdate>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="addOperatorsShow = false"> 取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="saveData()"> 保存</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<el-dialog v-model="configShow" width="40%" top="0.5%" :destroy-on-close="true" :close-on-click-modal="false">
|
|
|
|
|
|
|
|
|
|
<template #header="{ titleAdd, titleClass, warnMessgae }">
|
|
|
|
|
<div class="my-header">
|
|
|
|
|
<span :id="titleAdd" :class="titleClass">客户端远程配置修改</span>
|
|
|
|
|
<span :id="warnMessgae" :class="titleClass" style="color: red;">
|
|
|
|
|
输入要修改的值,点击保存后发送修改指令 </span>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<clientConfigUpdate ref="clientConfigUpdateDom" :rowData="configForm" @addReload="addReload">
|
|
|
|
|
</clientConfigUpdate>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<template #footer>
|
|
|
|
|
<span class="dialog-footer">
|
|
|
|
|
<el-button @click="configShow = false"> 取消</el-button>
|
|
|
|
|
<el-button type="primary" @click="saveConfigData()"> 保存</el-button>
|
|
|
|
|
</span>
|
|
|
|
|
</template>
|
|
|
|
|
</el-dialog>
|
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { Download, View } from '@element-plus/icons-vue';
|
|
|
|
|
|
|
|
|
|
import pro from '../../../util/tool.js';
|
|
|
|
|
|
|
|
|
|
import { onMounted, reactive, ref, toRefs, warn } from 'vue';
|
|
|
|
|
|
|
|
|
|
import { getLockScreenClientList, unLockClient, deleteLockScreenGtUser } from '@/util/api/api.js';
|
|
|
|
|
|
|
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
|
|
|
|
|
|
|
import clientAddUpdate from './clientAddUpdate.vue'
|
|
|
|
|
|
|
|
|
|
import clientConfigUpdate from './clientConfigUpdate.vue'
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//定义子组件dom
|
|
|
|
|
const clientAddUpdateDom = ref(null);
|
|
|
|
|
|
|
|
|
|
//定义子组件dom
|
|
|
|
|
const clientConfigUpdateDom = ref(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//定义从父组件传进来的变量值
|
|
|
|
|
const props = defineProps(['checkForm', 'images']);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//表格加载状态
|
|
|
|
|
const tableLoading = ref(false);
|
|
|
|
|
|
|
|
|
|
//输入框 label宽度
|
|
|
|
|
const formLabelWidth = ref('130px');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//表格固定高度
|
|
|
|
|
const myHeight = ref(500);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//表格查询条件
|
|
|
|
|
const searchForm = reactive({
|
|
|
|
|
total: 0,
|
|
|
|
|
pageNum: 1,
|
|
|
|
|
pageSize: 20,
|
|
|
|
|
clientIdQuery: "", //人员姓名查询条件
|
|
|
|
|
clientNameQuery: "",
|
|
|
|
|
groupNameQuery: "",
|
|
|
|
|
startTime: "", //统计数据,默认查询当天的数据
|
|
|
|
|
endTime: "", //统计数据,默认查询当天的数据
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
//定义新增修改数据集合
|
|
|
|
|
const addUpdateForm = ref({});
|
|
|
|
|
|
|
|
|
|
//定义新增修改数据集合
|
|
|
|
|
const configForm = ref({});
|
|
|
|
|
|
|
|
|
|
//定义表格数据
|
|
|
|
|
const tableData = ref([]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//定义搜索服务区下拉
|
|
|
|
|
const searchServiceAreaList = ref([]);
|
|
|
|
|
|
|
|
|
|
//定义搜索角色下拉
|
|
|
|
|
const searchRoleList = ref([]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//添加弹窗是否展示 false不展示 true展示
|
|
|
|
|
const addOperatorsShow = ref(false);
|
|
|
|
|
|
|
|
|
|
//添加弹窗是否展示 false不展示 true展示
|
|
|
|
|
const configShow = ref(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//查询框是否展示 false不展示 true展示
|
|
|
|
|
const searchShow = ref(false);
|
|
|
|
|
|
|
|
|
|
//新增弹窗标题
|
|
|
|
|
const addTitle = ref(false);
|
|
|
|
|
|
|
|
|
|
//修改弹窗标题
|
|
|
|
|
const updateTitle = ref(false);
|
|
|
|
|
|
|
|
|
|
//单选当前行
|
|
|
|
|
const currentRow = ref(null);
|
|
|
|
|
|
|
|
|
|
//多选数据
|
|
|
|
|
const multipleSelection = ref(null);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//定义分公司,收费站,岗位三个多选框的选中状态
|
|
|
|
|
const checkList = ref([]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//统计弹窗展示
|
|
|
|
|
const collectionShow = ref(false);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
onMounted(() => {
|
|
|
|
|
tableLoading.value = true;
|
|
|
|
|
//获取运营人员数据
|
|
|
|
|
getTableData();
|
|
|
|
|
|
|
|
|
|
//获取下拉数据
|
|
|
|
|
//getOtherData();
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
function getTableData() {
|
|
|
|
|
getLockScreenClientList(searchForm).then(res => {
|
|
|
|
|
if (res.records != null) {
|
|
|
|
|
tableData.value = res.records;
|
|
|
|
|
searchForm.total = res.total;
|
|
|
|
|
searchForm.pageNum = res.current;
|
|
|
|
|
searchForm.pageSize = res.size;
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('查询失败!')
|
|
|
|
|
}
|
|
|
|
|
tableLoading.value = false;
|
|
|
|
|
//计算表格固定高度
|
|
|
|
|
myHeight.value = (document.documentElement.clientHeight) * 0.77;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function reloadTableData() {
|
|
|
|
|
tableLoading.value = true;
|
|
|
|
|
getLockScreenClientList(searchForm).then(res => {
|
|
|
|
|
if (res.records != null) {
|
|
|
|
|
tableData.value = res.records;
|
|
|
|
|
searchForm.total = res.total;
|
|
|
|
|
searchForm.pageNum = res.current;
|
|
|
|
|
searchForm.pageSize = res.size;
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error('查询失败!')
|
|
|
|
|
}
|
|
|
|
|
tableLoading.value = false;
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function getOtherData() {
|
|
|
|
|
getOperationsFiterData({ subComNo: null, isChange: "N" }).then(res => {
|
|
|
|
|
if (res.roleList != null) {
|
|
|
|
|
searchRoleList.value = res.roleList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (res.serviceAreaList != null) {
|
|
|
|
|
searchServiceAreaList.value = res.serviceAreaList;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增按钮点击事件
|
|
|
|
|
function configClient() {
|
|
|
|
|
//判断如果当前行为空,则提示让选择当前行
|
|
|
|
|
if (currentRow.value == null) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: '请选择要修改的数据!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//浅拷贝给子组件传入值,避免修改值退出后,再次进入还是修改过的值
|
|
|
|
|
let current = { ...currentRow.value };
|
|
|
|
|
|
|
|
|
|
//浅拷贝给子组件传入值,避免修改值退出后,再次进入还是修改过的值
|
|
|
|
|
configForm.value.ClientId = current.clientId;
|
|
|
|
|
configForm.value.PrivateKey = current.passwordKey;
|
|
|
|
|
configForm.value.ClientName = current.clientName;
|
|
|
|
|
configShow.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//保存运营人员数据
|
|
|
|
|
function saveData() {
|
|
|
|
|
clientAddUpdateDom.value.formDom.validate((valid) => {
|
|
|
|
|
if (valid) { // 注意:只有当所有的规则都满足后,此时的 valid 的值才为 true,才能执行下面的值;
|
|
|
|
|
//如果是保存,就调保存方法
|
|
|
|
|
if (addTitle.value) {
|
|
|
|
|
//调用子组件保存方法
|
|
|
|
|
clientAddUpdateDom.value.saveData();
|
|
|
|
|
}
|
|
|
|
|
//如果是修改,就调修改方法
|
|
|
|
|
if (updateTitle.value) {
|
|
|
|
|
//调用子组件修改方法
|
|
|
|
|
clientAddUpdateDom.value.updateData();
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//保存运营人员数据
|
|
|
|
|
function saveConfigData() {
|
|
|
|
|
clientConfigUpdateDom.value.formDom.validate((valid) => {
|
|
|
|
|
if (valid) { // 注意:只有当所有的规则都满足后,此时的 valid 的值才为 true,才能执行下面的值;
|
|
|
|
|
clientConfigUpdateDom.value.saveConfigData();
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//新增或修改重新加载数据
|
|
|
|
|
function addReload() {
|
|
|
|
|
|
|
|
|
|
//关闭新增数据弹窗
|
|
|
|
|
addOperatorsShow.value = false;
|
|
|
|
|
|
|
|
|
|
//关闭远程修改配置弹窗
|
|
|
|
|
configShow.value = false;
|
|
|
|
|
configForm.value = {};
|
|
|
|
|
|
|
|
|
|
//获取数据
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改运营人员数据
|
|
|
|
|
function updateOperators() {
|
|
|
|
|
|
|
|
|
|
//判断如果当前行为空,则提示让选择当前行
|
|
|
|
|
if (currentRow.value == null) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: '请选择要修改的数据!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
//浅拷贝给子组件传入值,避免修改值退出后,再次进入还是修改过的值
|
|
|
|
|
addUpdateForm.value = { ...currentRow.value };
|
|
|
|
|
|
|
|
|
|
addOperatorsShow.value = true;
|
|
|
|
|
//新增标题隐藏
|
|
|
|
|
addTitle.value = false;
|
|
|
|
|
//修改标题展示
|
|
|
|
|
updateTitle.value = true;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//点击搜索,查询数据
|
|
|
|
|
function searchData() {
|
|
|
|
|
//如果统计日期(起始)和统计日期(终止)都有值,需要判断开始日期不能小于结束日期
|
|
|
|
|
if (searchForm.startTime !== "" && searchForm.endTime !== null
|
|
|
|
|
&& searchForm.startTime !== "" && searchForm.endTime !== null) {
|
|
|
|
|
let result = compareDates(searchForm.startTime, searchForm.endTime);
|
|
|
|
|
if (result == -1) {
|
|
|
|
|
ElMessage.warning("核销时间(起始) 不能大于 核销时间(终止)");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
searchForm.pageSize = 20;
|
|
|
|
|
searchForm.pageNum = 1;
|
|
|
|
|
searchForm.total = 0;
|
|
|
|
|
//调用查询数据接口
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//搜索条件重置
|
|
|
|
|
function resetSearchData() {
|
|
|
|
|
//搜索条件 重置
|
|
|
|
|
searchForm.startTime = "" //统计数据,默认查询当天的数据
|
|
|
|
|
searchForm.endTime = ""; //统计数据,默认查询当天的数据4
|
|
|
|
|
searchForm.clientIdQuery = "";
|
|
|
|
|
searchForm.clientNameQuery = "";
|
|
|
|
|
searchForm.groupNameQuery = "";
|
|
|
|
|
searchForm.pageSize = 20;
|
|
|
|
|
searchForm.pageNum = 1;
|
|
|
|
|
searchForm.total = 0;
|
|
|
|
|
//调用查询数据接口
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function unlock(row) {
|
|
|
|
|
//调用接口
|
|
|
|
|
unLockClient(row).then(res => {
|
|
|
|
|
if (res.result == 1) {
|
|
|
|
|
ElMessage.success(res.msg);
|
|
|
|
|
} else if (res.result == -2) {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
//获取数据
|
|
|
|
|
reloadTableData();
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function del() {
|
|
|
|
|
if (null == currentRow.value && null == multipleSelection.value) {
|
|
|
|
|
ElMessage({
|
|
|
|
|
showClose: true,
|
|
|
|
|
message: '请选择要删除的数据!',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
})
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
let operatorList = [];
|
|
|
|
|
//如果多选有数据,则判断单选是否有数据,把单选数据添加到所选中,然后删除数据
|
|
|
|
|
if (null != multipleSelection.value && multipleSelection.value.length > 0) {
|
|
|
|
|
operatorList = [...multipleSelection.value];
|
|
|
|
|
if (null != currentRow.value) {
|
|
|
|
|
let isCanAdd = true;
|
|
|
|
|
for (let item of operatorList) {
|
|
|
|
|
if (item.id == currentRow.value.id) {
|
|
|
|
|
isCanAdd = false;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (isCanAdd) {
|
|
|
|
|
operatorList.push({ ...currentRow.value });
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
operatorList.push({ ...currentRow.value });
|
|
|
|
|
}
|
|
|
|
|
let msg = "";
|
|
|
|
|
if (operatorList.length == 1) {
|
|
|
|
|
msg = '是否确定删除该数据?';
|
|
|
|
|
} else {
|
|
|
|
|
msg = '是否批量删除' + operatorList.length + '条数据?';
|
|
|
|
|
}
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
|
msg,
|
|
|
|
|
'提示',
|
|
|
|
|
{
|
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
|
type: 'warning',
|
|
|
|
|
}
|
|
|
|
|
).then(() => {
|
|
|
|
|
deleteLockScreenGtUser(operatorList).then((res) => {
|
|
|
|
|
if (res.result == 1) {
|
|
|
|
|
ElMessage.success(res.msg);
|
|
|
|
|
currentRow.value = null;
|
|
|
|
|
multipleSelection.value = null;
|
|
|
|
|
//获取运营人员数据
|
|
|
|
|
reloadTableData();
|
|
|
|
|
} else {
|
|
|
|
|
ElMessage.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}).catch(() => {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
function tableFormat(row, column) {
|
|
|
|
|
//如果是统计日期 DT 字段,需要转换显示格式为YYYY-mm-dd HH:mm:ss
|
|
|
|
|
if (column.property == "loginPwd") {
|
|
|
|
|
return "**********";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//比较日期大小
|
|
|
|
|
function compareDates(beginDate, endDate) {
|
|
|
|
|
let beginTime = new Date(beginDate);
|
|
|
|
|
let endTime = new Date(endDate);
|
|
|
|
|
//开始日期大于结束日期 返回-1
|
|
|
|
|
if (beginTime > endTime) {
|
|
|
|
|
return -1;
|
|
|
|
|
//开始日期小于等于结束日期
|
|
|
|
|
} else if (beginTime <= endTime) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//修改分页大小函数
|
|
|
|
|
function handleSizeChange(pageSize) {
|
|
|
|
|
|
|
|
|
|
searchForm.pageSize = pageSize;
|
|
|
|
|
reloadTableData();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//当前页改变
|
|
|
|
|
function handleCurrentChange(pageNum) {
|
|
|
|
|
|
|
|
|
|
searchForm.pageNum = pageNum;
|
|
|
|
|
reloadTableData()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//表格单选事件
|
|
|
|
|
function tableHandleCurrentChange(row) {
|
|
|
|
|
currentRow.value = row;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//批量删除选择的数据
|
|
|
|
|
function handleSelectionChange(row) {
|
|
|
|
|
multipleSelection.value = row
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped></style>
|