This commit is contained in:
邱贞招 2024-07-24 18:17:13 +08:00
parent 74be13b534
commit 99a2950e53
4 changed files with 529 additions and 59 deletions

44
src/api/system/msgLog.js Normal file
View File

@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询短信日志列表
export function listMsgLog(query) {
return request({
url: '/system/msgLog/list',
method: 'get',
params: query
})
}
// 查询短信日志详细
export function getMsgLog(id) {
return request({
url: '/system/msgLog/' + id,
method: 'get'
})
}
// 新增短信日志
export function addMsgLog(data) {
return request({
url: '/system/msgLog',
method: 'post',
data: data
})
}
// 修改短信日志
export function updateMsgLog(data) {
return request({
url: '/system/msgLog',
method: 'put',
data: data
})
}
// 删除短信日志
export function delMsgLog(id) {
return request({
url: '/system/msgLog/' + id,
method: 'delete'
})
}

View File

@ -2,7 +2,7 @@
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="运营商" prop="deptId" v-if="userName == 'admin'">
<el-select v-model="queryParams.deptId" placeholder="选择运营商" clearable>
<el-select v-model="queryParams.deptId" placeholder="选择运营商" style="width: 120px;" clearable>
<el-option
v-for="item in deptOptions"
:key="item.deptId"
@ -11,8 +11,18 @@
></el-option>
</el-select>
</el-form-item>
<el-form-item label="运营区" prop="areaId" v-if="userName == 'admin'">
<el-select v-model="queryParams.areaId" placeholder="选择运营区" style="width: 120px;" clearable>
<el-option
v-for="item in areaOptions"
:key="item.areaId"
:label="item.areaName"
:value="item.areaId"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="MAC" prop="mac">
<el-input style="width: 150px"
<el-input style="width: 120px"
v-model="queryParams.mac"
placeholder="请输入mac"
clearable
@ -20,15 +30,15 @@
/>
</el-form-item>
<el-form-item label="SN号" prop="sn">
<el-input style="width: 150px"
<el-input style="width: 120px"
v-model="queryParams.sn"
placeholder="请输入设备SN号"
placeholder="请输入SN号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="车牌号" prop="vehicleNum">
<el-input style="width: 150px"
<el-input style="width: 120px"
v-model="queryParams.vehicleNum"
placeholder="请输入车牌号"
clearable
@ -36,7 +46,7 @@
/>
</el-form-item>
<el-form-item label="在线状态" prop="onlineStatus">
<el-select v-model="queryParams.onlineStatus" placeholder="请选择在线状态" clearable>
<el-select v-model="queryParams.onlineStatus" placeholder="请选择在线状态" style="width: 100px;" clearable>
<el-option
v-for="dict in dict.type.as_online_status"
:key="dict.value"
@ -46,7 +56,7 @@
</el-select>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-select v-model="queryParams.status" placeholder="请选择状态" style="width: 100px;" clearable>
<el-option
v-for="dict in statusOptions"
:key="dict.dictValue"
@ -56,7 +66,7 @@
</el-select>
</el-form-item>
<el-form-item label="锁状态" prop="status">
<el-select v-model="queryParams.lockStatus" placeholder="请选择锁状态" clearable>
<el-select v-model="queryParams.lockStatus" placeholder="请选择锁状态" style="width: 100px;" clearable>
<el-option
v-for="dict in dict.type.et_device_lock_status"
:key="dict.value"
@ -169,45 +179,50 @@
v-hasPermi="['system:device:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table ref="tableSort" v-loading="loading" :data="deviceList" @selection-change="handleSelectionChange" :default-sort="defaultSort"
@sort-change="handleSortChange"
class="el-table">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="运营商" align="center" prop="deptName" v-if="userName == 'admin'"/>
<el-table-column label="运营区" align="center" prop="areaName" width="60"/>
<el-table-column label="mac" align="center" prop="mac" width="70"/>
<el-table-column label="SN" align="center" prop="sn" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="车辆型号" align="center" prop="model" />
<el-table-column label="车牌号" align="center" prop="vehicleNum" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="定位" align="center" prop="location" :show-overflow-tooltip="true"/>
<el-table-column label="版本" align="center" prop="version" width="70" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="信号" align="center" prop="signalStrength" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="卫星" align="center" prop="satellites" width="70" sortable="custom" :sort-orders="['descending', 'ascending']"/>
<el-table-column label="钥匙" align="center" prop="quality" width="60"/>
<el-table-column label="定位时间" align="center" prop="lastLocationTime" width="90">
<el-table-column label="运营商" align="center" prop="deptName" v-if="userName == 'admin' && columns[0].visible" />
<el-table-column label="运营区" align="center" prop="areaName" v-if="columns[1].visible"/>
<el-table-column label="MAC" align="center" prop="mac" v-if="columns[2].visible"/>
<el-table-column label="SN" align="center" prop="sn" sortable="custom" :sort-orders="['descending', 'ascending']" v-if="columns[3].visible"/>
<el-table-column label="车辆型号" align="center" prop="model" v-if="columns[4].visible"/>
<el-table-column label="车牌号" align="center" prop="vehicleNum" sortable="custom" :sort-orders="['descending', 'ascending']" v-if="columns[5].visible"/>
<el-table-column label="版本" align="center" prop="version" sortable="custom" :sort-orders="['descending', 'ascending']" v-if="columns[6].visible">
<template slot-scope="scope">
<span>{{ formatVersion(scope.row.hardwareVersionId)+' | '+scope.row.version }}</span>
</template>
</el-table-column>
<el-table-column label="信号" align="center" prop="signalStrength" sortable="custom" :sort-orders="['descending', 'ascending']" v-if="columns[7].visible"/>
<el-table-column label="卫星" align="center" prop="satellites" sortable="custom" :sort-orders="['descending', 'ascending']" v-if="columns[8].visible"/>
<el-table-column label="钥匙" align="center" prop="quality" width="60" v-if="columns[9].visible"/>
<el-table-column label="定位时间" align="center" prop="lastLocationTime" v-if="columns[10].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.lastLocationTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="电压" align="center" prop="voltage" width="60" :formatter="formatVoltage"/>
<el-table-column label="电量" align="center" prop="remainingPower" width="70" sortable="custom" :sort-orders="['descending', 'ascending']" :formatter="formatPower"/>
<el-table-column label="车辆状态" align="center" prop="status">
<el-table-column label="电压" align="center" prop="voltage" :formatter="formatVoltage" v-if="columns[11].visible"/>
<el-table-column label="电量" align="center" prop="remainingPower" sortable="custom" :sort-orders="['descending', 'ascending']" :formatter="formatPower" v-if="columns[12].visible"/>
<el-table-column label="车辆状态" align="center" prop="status" v-if="columns[13].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.as_device_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="锁状态" align="center" prop="status">
<el-table-column label="锁" align="center" prop="status" width="60" v-if="columns[14].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_device_lock_status" :value="scope.row.lockStatus"/>
</template>
</el-table-column>
<el-table-column label="网络状态" align="center" prop="onlineStatus">
<el-table-column label="网络" align="center" prop="onlineStatus" width="60" v-if="columns[15].visible">
<template slot-scope="scope">
<dict-tag :options="dict.type.as_online_status" :value="scope.row.onlineStatus"/>
</template>
</el-table-column>
<el-table-column label="二维码" align="center" width="100">
<el-table-column label="二维码" align="center" v-if="columns[16].visible">
<template slot-scope="d">
<el-popover
placement="top"
@ -220,12 +235,12 @@
</el-popover>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createTime" width="90">
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[17].visible">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" width="160" align="center" class-name="small-padding fixed-width">
<el-table-column label="操作" width="320" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
@ -297,6 +312,13 @@
@click="reboot(scope.row)"
v-hasPermi="['system:device:reboot']"
>重启</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-refresh"
@click="refresh(scope.row)"
v-hasPermi="['system:device:refresh']"
>更新</el-button>
<el-button
size="mini"
type="text"
@ -326,7 +348,7 @@
</el-col>
<el-col :span="8">
<el-form-item label="SN" prop="sn">
<el-input v-model="form.sn" placeholder="请输入设备SN" :disabled="title=='修改设备' && userName != 'admin'"/>
<el-input v-model="form.sn" placeholder="请输入SN" :disabled="title=='修改设备' && userName != 'admin'"/>
</el-form-item>
</el-col>
<el-col :span="8">
@ -409,6 +431,13 @@
</el-form-item>
</el-col>
</div>
<el-col :span="24">
<el-form-item label="硬件版本说明:" label-width="200">
<span style="color: red;font-weight: 600">
{{versionDescription}}
</span>
</el-form-item>
</el-col>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
@ -417,12 +446,12 @@
</el-dialog>
<!-- 设备详情对话框 -->
<el-dialog style="font-weight: bold;" title="设备详情" :close-on-click-modal="true" :visible.sync="open2" width="1000px" append-to-body>
<el-dialog style="font-weight: bold;" title="设备详情" :close-on-click-modal="true" :visible.sync="open2" width="1300px" append-to-body>
<el-form ref="form" :model="form" label-width="100px" size="mini">
<el-row>
<el-col :span="8">
<el-form-item label="设备mac">{{ form.mac }}</el-form-item>
<el-form-item label="设备sn">{{ form.sn }}</el-form-item>
<el-form-item label="设备SN">{{ form.sn }}</el-form-item>
<el-form-item label="车辆状态:" style="color: #12d2ac;font-weight: 700">{{ form.statusStr }}</el-form-item>
</el-col>
<el-col :span="8">
@ -447,7 +476,7 @@
</el-col>
</el-row>
<el-row>
<h2 style="font-weight: bold;font-size: 18px">自动更新</h2>
<h2 style="font-weight: bold;font-size: 18px;padding: 0;margin: 0">定位更新</h2>
<el-col :span="6">
<el-form-item label="经度:">{{ form.longitude }}</el-form-item>
</el-col>
@ -455,7 +484,7 @@
<el-form-item label="纬度:">{{ form.latitude }}</el-form-item>
</el-col>
<el-col :span="8" >
<el-form-item label="最后更新时间:" label-width="120">{{ form.lastTime }}</el-form-item>
<el-form-item label="最后更新时间:" label-width="120">{{ form.lastLocationTime }}</el-form-item>
</el-col>
<el-col :span="4" v-if="form.gps === '0'">
<span style="color: red;font-weight: 700">
@ -532,7 +561,7 @@ import { getModel, listModel } from '@/api/system/model'
import QrCode from "@/components/QrCode/index.vue";
import { listArea, selectAreaListByDeptId, selectDeptByAreaId } from '@/api/system/area'
import { listDept } from '@/api/system/dept'
import { listHardwareVersion } from '@/api/system/hardwareVersion'
import { getHardwareVersion, listHardwareVersion } from '@/api/system/hardwareVersion'
import Treeselect from '@riophae/vue-treeselect'
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
@ -562,6 +591,7 @@ export default {
key: 0,
//
single: true,
versionDescription: '',
//
multiple: true,
statusOptions: [],
@ -597,6 +627,27 @@ export default {
onlineStatus: null,
status: null,
},
//
columns: [
{ key: 0, label: `运营商`, visible: true },
{ key: 1, label: `运营区`, visible: true },
{ key: 2, label: `MAC`, visible: true },
{ key: 3, label: `SN`, visible: true },
{ key: 4, label: `车辆型号`, visible: true },
{ key: 5, label: `车牌号`, visible: true },
{ key: 6, label: `版本`, visible: true },
{ key: 7, label: `信号`, visible: true },
{ key: 8, label: `卫星`, visible: true },
{ key: 9, label: `钥匙`, visible: true },
{ key: 10, label: `定位时间`, visible: true },
{ key: 11, label: `电压`, visible: true },
{ key: 12, label: `电量`, visible: true },
{ key: 13, label: `车辆状态`, visible: true },
{ key: 14, label: ``, visible: true },
{ key: 15, label: `网络`, visible: true },
{ key: 16, label: `二维码`, visible: true },
{ key: 17, label: `创建时间`, visible: true },
],
showPlaceSearchMap: false,
selected: null,
//
@ -615,6 +666,12 @@ export default {
}
};
},
mounted() { //
window.addEventListener('scroll', this.handleScroll, true)
},
destroyed() { //
window.removeEventListener('scroll', this.handleScroll, true)
},
created() {
console.log("当前用户信息:",this.$store.state.user.name)
const sn = this.$route.params && this.$route.params.sn;
@ -648,6 +705,9 @@ export default {
listDept({status: '0' }).then(response => {
this.deptOptions = response.data;
});
listArea(this.queryParams).then(response => {
this.areaOptions = response.rows;
});
}
},
watch: {
@ -660,6 +720,11 @@ export default {
'form.areaId': function(newVal) {
this.fetchData3(newVal);
},
'form.hardwareVersionId': function(hardwareVersionId) {
if(hardwareVersionId){
this.selectHardwareVersion(hardwareVersionId);
}
},
open2(val) {
if (!val) {
console.log("========关闭地图=============")
@ -674,6 +739,35 @@ export default {
this.$eventBus.$off('close-all-dialogs', this.closeDialog);
},
methods: {
handleScroll() {
let scrollTop = window.scrollY;
let heightTop = this.$refs['tableSort'].$parent.$parent.$el.offsetTop; //
const headerWrapper = document.querySelector('.el-table__header-wrapper');
if (scrollTop >= heightTop) { //
let top = scrollTop - (heightTop + 160);
headerWrapper.style.position = 'relative';
headerWrapper.style.zIndex = '500';
headerWrapper.style.top = `${top}px`;
} else if (scrollTop === 0) { //
headerWrapper.style.position = 'relative';
headerWrapper.style.zIndex = '500';
} else {
headerWrapper.style.position = '';
headerWrapper.style.top = '';
headerWrapper.style.zIndex = '';
}
},
formatVersion(versionId){
if(versionId){
return this.hardwareVersionOptions.find(item => item.id === versionId).version;
}
return "";
},
selectHardwareVersion(hardwareVersionId){
getHardwareVersion(hardwareVersionId).then(response => {
this.versionDescription =response.data.instructions;
});
},
closeDialog() {
this.open2 = false;
},
@ -692,7 +786,7 @@ export default {
areaOptions.length > 0 ? this.form.areaId = areaOptions[0].areaId : this.form.areaId = null;
});
}else{
this.reset();
this.reset2();
}
},
/** 当选择运营商时 根据运营商id获取运营区和型号 */
@ -708,7 +802,7 @@ export default {
modelOptions.length > 0 ? this.form.modelId = modelOptions[0].modelId : this.form.modelId = null;
});
}else{
this.reset();
this.reset2();
// this.form.areaId = null;
// this.form.modelId = null;
}
@ -727,7 +821,7 @@ export default {
modelOptions.length > 0 ? this.form.modelId = modelOptions[0].modelId : this.form.modelId = null;
});
}else{
this.reset();
this.reset2();
}
},
/** 排序触发事件 */
@ -889,6 +983,23 @@ export default {
this.areaOptions = response.rows;
});
},
reset2() {
console.log(11111)
this.form.areaId = null;
this.form.deptId = null;
this.form.modelId = null;
if(this.userName === 'admin'){
listDept({status: '0' }).then(response => {
this.deptOptions = response.data;
});
}
listModel(this.queryParams).then(response => {
this.modelOptions = response.rows;
});
listArea(this.queryParams).then(response => {
this.areaOptions = response.rows;
});
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
@ -1085,6 +1196,9 @@ export default {
padding: 10px 20px;
}
.el-dialog:not(.is-fullscreen) {
margin-top: 3vh !important;
margin-top: 1vh !important;
}
.el-dialog__header {
padding: 10px 20px !important;
}
</style>

View File

@ -52,6 +52,7 @@
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id" align="center" prop="ruleId" />
<el-table-column label="运营商" align="center" prop="deptName" v-if="userName == 'admin'"/>
<el-table-column label="应用运营区" align="center" prop="areaName"/>
<el-table-column label="套餐名称" align="center" prop="name" />
<el-table-column label="说明" :show-overflow-tooltip="true" align="center" prop="instructions" />
<!-- <el-table-column label="时间(小时)" align="center" prop="time" />
@ -87,16 +88,32 @@
<el-form-item label="套餐名称" prop="name">
<el-input v-model="form.name" placeholder="请输入套餐名称" />
</el-form-item>
<el-form-item label="运营区" prop="areaId" v-if="userName == 'admin'">
<el-select v-model="form.areaId" placeholder="请选择运营区">
<el-option
v-for="item in areaOptions"
:key="item.areaId"
:label="item.areaName"
:value="item.areaId"
></el-option>
</el-select>
</el-form-item>
<el-row>
<el-col :span="12" v-if="userName == 'admin'">
<el-form-item label="运营商" prop="deptId" >
<el-select v-model="form.deptId" placeholder="请选择运营区">
<el-option
v-for="item in deptOptions"
:key="item.deptId"
:label="item.deptName"
:value="item.deptId"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="应用运营区" prop="areaId">
<el-select v-model="form.areaId" clearable placeholder="请选择运营区">
<el-option
v-for="item in areaOptions"
:key="item.areaId"
:label="item.areaName"
:value="item.areaId"
></el-option>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="说明" prop="instructions" :show-overflow-tooltip="true">
<editor v-model="form.instructions" :min-height="192"/>
<!-- <el-input v-model="form.explain" type="textarea" placeholder="请输入内容" /> -->
@ -325,12 +342,17 @@
<script>
import { listFee, getFee, delFee, addFee, updateFee } from "@/api/system/fee";
import { listArea } from '@/api/system/area'
import { listArea, selectAreaListByDeptId } from '@/api/system/area'
import { listDept, listDeptExcludeChild } from '@/api/system/dept'
export default {
name: "Fee",
dicts: ['sys_normal_disable'],
watch: {
'form.deptId': function(deptId) {
this.getAreaListByDeptId(deptId);
},
},
data() {
return {
userName: undefined,
@ -425,8 +447,8 @@ export default {
sectionCharges: [
{ required: true, message: '请输入区间收费', trigger: 'blur' },
],
areaId: [
{ required: true, message: '请选择运营', trigger: 'change' },
deptId: [
{ required: true, message: '请选择运营', trigger: 'change' },
]
// startingTime: [
// { required: true, message: '', trigger: 'blur' },
@ -448,8 +470,28 @@ export default {
this.deptOptions = response.data;
});
}
listArea(this.queryParams).then(response => {
this.areaOptions = response.rows;
});
},
methods: {
getAreaListByDeptId(deptId){
console.log('---------------deptId:', deptId)
if(deptId){
selectAreaListByDeptId(deptId).then(response => {
console.log("根据运营商id获取运营区和型号=========",response.data)
this.areaOptions = response.data.areaList;
let areaOptions = response.data.areaList;
if(this.form.areaId != null){
areaOptions.length > 0 ? this.form.areaId = areaOptions[0].areaId : this.form.areaId = null;
}
});
}else{
listArea(this.queryParams).then(response => {
this.areaOptions = response.rows;
});
}
},
handleUnitChange() {
if (this.form.rentalUnit == 'minutes') {
this.timeUnit = '分钟';
@ -497,7 +539,8 @@ export default {
ridingRule: '1',
chargingCycle: '',
chargingCycleValue: '',
cappedAmount: ''
cappedAmount: '',
areaId: null
}
this.enablelnterval = false,
this.more = { start: '', end: '9999', eachUnit: '', fee: '' }
@ -523,11 +566,8 @@ export default {
},
handleAdd() {
this.reset();
listArea(this.queryParams).then(response => {
this.areaOptions = response.rows;
this.open = true;
this.title = "添加收费方式";
});
this.open = true;
this.title = "添加收费方式";
},
handleUpdate(row) {
this.reset();

View File

@ -0,0 +1,272 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="短信类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择短信类型" clearable>
<el-option
v-for="dict in dict.type.et_msg_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="手机号" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入手机号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="primary"-->
<!-- plain-->
<!-- icon="el-icon-plus"-->
<!-- size="mini"-->
<!-- @click="handleAdd"-->
<!-- v-hasPermi="['system:msgLog:add']"-->
<!-- >新增</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="success"-->
<!-- plain-->
<!-- icon="el-icon-edit"-->
<!-- size="mini"-->
<!-- :disabled="single"-->
<!-- @click="handleUpdate"-->
<!-- v-hasPermi="['system:msgLog:edit']"-->
<!-- >修改</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="danger"-->
<!-- plain-->
<!-- icon="el-icon-delete"-->
<!-- size="mini"-->
<!-- :disabled="multiple"-->
<!-- @click="handleDelete"-->
<!-- v-hasPermi="['system:msgLog:remove']"-->
<!-- >删除</el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- type="warning"-->
<!-- plain-->
<!-- icon="el-icon-download"-->
<!-- size="mini"-->
<!-- @click="handleExport"-->
<!-- v-hasPermi="['system:msgLog:export']"-->
<!-- >导出</el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="msgLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="短信类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.et_msg_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="短信签名" align="center" prop="signName" />
<el-table-column label="内容" align="center" prop="content" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phone" />
<!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width">-->
<!-- <template slot-scope="scope">-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-edit"-->
<!-- @click="handleUpdate(scope.row)"-->
<!-- v-hasPermi="['system:msgLog:edit']"-->
<!-- >修改</el-button>-->
<!-- <el-button-->
<!-- size="mini"-->
<!-- type="text"-->
<!-- icon="el-icon-delete"-->
<!-- @click="handleDelete(scope.row)"-->
<!-- v-hasPermi="['system:msgLog:remove']"-->
<!-- >删除</el-button>-->
<!-- </template>-->
<!-- </el-table-column>-->
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改短信日志对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listMsgLog, getMsgLog, delMsgLog, addMsgLog, updateMsgLog } from "@/api/system/msgLog";
export default {
name: "MsgLog",
dicts: ['et_msg_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
msgLogList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
type: null,
content: null,
phone: null
},
//
form: {},
//
rules: {
}
};
},
created() {
this.getList();
},
methods: {
/** 查询短信日志列表 */
getList() {
this.loading = true;
listMsgLog(this.queryParams).then(response => {
this.msgLogList = response.rows;
this.total = response.total;
this.loading = false;
});
},
//
cancel() {
this.open = false;
this.reset();
},
//
reset() {
this.form = {
id: null,
type: null,
templateCode: null,
signName: null,
content: null,
createTime: null,
phone: null
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加短信日志";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
const id = row.id || this.ids
getMsgLog(id).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改短信日志";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateMsgLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addMsgLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除短信日志编号为"' + ids + '"的数据项?').then(function() {
return delMsgLog(ids);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
},
/** 导出按钮操作 */
handleExport() {
this.download('system/msgLog/export', {
...this.queryParams
}, `msgLog_${new Date().getTime()}.xlsx`)
}
}
};
</script>