feax:()故障初始化
parent
6d1ac12410
commit
cef91d37fc
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询车辆故障列表
|
||||
export function listFaultInfo(query) {
|
||||
return request({
|
||||
url: '/fault/faultInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询车辆故障详细
|
||||
export function getFaultInfo(id) {
|
||||
return request({
|
||||
url: '/fault/faultInfo/getInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增车辆故障
|
||||
export function addFaultInfo(data) {
|
||||
return request({
|
||||
url: '/fault/faultInfo/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改车辆故障
|
||||
export function updateFaultInfo(data) {
|
||||
return request({
|
||||
url: '/fault/faultInfo/edit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除车辆故障
|
||||
export function delFaultInfo(id) {
|
||||
return request({
|
||||
url: '/fault/faultInfo/remove/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,63 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询车辆故障列表
|
||||
export function listFaultInfo(query) {
|
||||
return request({
|
||||
url: '/enterprise/faultInfo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询车辆故障详细
|
||||
export function getFaultInfo(id) {
|
||||
return request({
|
||||
url: '/enterprise/faultInfo/getInfo/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增车辆故障
|
||||
export function addFaultInfo(data) {
|
||||
return request({
|
||||
url: '/enterprise/faultInfo/add',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改车辆故障
|
||||
export function updateFaultInfo(data) {
|
||||
return request({
|
||||
url: '/enterprise/faultInfo/edit',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除车辆故障
|
||||
export function delFaultInfo(id) {
|
||||
return request({
|
||||
url: '/enterprise/faultInfo/remove/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询车辆故障列表
|
||||
export function faultMessageList(query) {
|
||||
return request({
|
||||
url: '/enterprise/message/faultMessageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询车辆故障类型
|
||||
export function faultTypeDown(query) {
|
||||
return request({
|
||||
url: '/enterprise/type/faultTypeList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
|
@ -0,0 +1,36 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询车辆故障列表
|
||||
export function faultLogList(query) {
|
||||
return request({
|
||||
url: '/enterprise/log/faultLogList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 新增车辆故障
|
||||
export function insertFaultLog(data) {
|
||||
return request({
|
||||
url: '/enterprise/log/insertLog',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改车辆故障
|
||||
export function updateFaultLog(data) {
|
||||
return request({
|
||||
url: '/enterprise/log/updateLog',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除车辆故障
|
||||
export function delFaultInfo(id) {
|
||||
return request({
|
||||
url: '/enterprise/log/remove/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
|
@ -0,0 +1,43 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询消息
|
||||
export function faultMessageList(query) {
|
||||
return request({
|
||||
url: '/enterprise/fault-message/faultMessageList',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询未读消息
|
||||
export function faultMessageOne() {
|
||||
return request({
|
||||
url: '/enterprise/fault-message/selectOne',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询已读消息
|
||||
export function faultMessageTwo() {
|
||||
return request({
|
||||
url: '/enterprise/fault-message/selectTwo',
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 修改阅读状态
|
||||
export function updateTwo(faultMessageId) {
|
||||
return request({
|
||||
url: '/enterprise/fault-message/updateTwo/' + faultMessageId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
||||
// 删除消息
|
||||
export function deleteMessageId(faultMessageId) {
|
||||
return request({
|
||||
url: '/enterprise/fault-message/deleteMessageId/' + faultMessageId,
|
||||
method: 'post'
|
||||
})
|
||||
}
|
||||
|
|
@ -18,6 +18,14 @@ export function listDbTable(query) {
|
|||
})
|
||||
}
|
||||
|
||||
// 查询db所有数据库列表
|
||||
export function listDbTableAll() {
|
||||
return request({
|
||||
url: '/code/gen/db/listAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询表详细信息
|
||||
export function getGenTable(tableId) {
|
||||
return request({
|
||||
|
@ -36,11 +44,14 @@ export function updateGenTable(data) {
|
|||
}
|
||||
|
||||
// 导入表
|
||||
export function importTable(data) {
|
||||
export function importTable(tables, dbName) {
|
||||
return request({
|
||||
url: '/code/gen/importTable',
|
||||
method: 'post',
|
||||
params: data
|
||||
params: {
|
||||
tables: tables,
|
||||
dbName: dbName
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -69,9 +80,29 @@ export function genCode(tableName) {
|
|||
}
|
||||
|
||||
// 同步数据库
|
||||
export function synchDb(tableName) {
|
||||
export function synchDb(tableName,dbName) {
|
||||
return request({
|
||||
url: '/code/gen/synchDb/' + tableName,
|
||||
url: '/code/gen/synchDb/' + tableName+'/'+dbName,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有数据库名称
|
||||
export function selDbNameAll() {
|
||||
return request({
|
||||
url: '/code/gen/selDbNameAll',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 根据数据库名称与表名称查询表字段
|
||||
export function selectDbTableColumnsByName(dbName,table) {
|
||||
return request({
|
||||
url: '/code/gen/selectDbTableColumnsByName',
|
||||
method: 'get',
|
||||
params: {
|
||||
dbName: dbName,
|
||||
table: table
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
|
@ -0,0 +1,460 @@
|
|||
<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="faultType">
|
||||
<el-input
|
||||
v-model="queryParams.faultType"
|
||||
placeholder="请输入车辆故障类型"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障VIN编码" prop="carVin">
|
||||
<el-input
|
||||
v-model="queryParams.carVin"
|
||||
placeholder="请输入故障VIN编码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障级别" prop="faultWarn">
|
||||
<el-input
|
||||
v-model="queryParams.faultWarn"
|
||||
placeholder="请输入故障级别"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障处理状态" prop="state">
|
||||
<el-select v-model="queryParams.state" placeholder="请选择故障处理状态" clearable>
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_fault_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</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-button @click="drawer = true" class="share-button" style="margin-top: 10px" icon="el-icon-s-comment" type="primary"></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="['fault:faultInfo: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="['fault:faultInfo: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="['fault:faultInfo: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="['fault:faultInfo:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="faultInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="车辆故障编码;" align="center" prop="faultCode" />
|
||||
<el-table-column label="车辆故障类型" align="center" prop="faultTypeId"/>
|
||||
<el-table-column label="车辆故障规则" align="center" prop="faultRuleId"/>
|
||||
<el-table-column label="车辆故障位" align="center" prop="faultBit" />
|
||||
<el-table-column label="车辆故障值" align="center" prop="faultValue" />
|
||||
<el-table-column label="故障描述信息" align="center" prop="faultDesc" />
|
||||
<el-table-column label="是否报警" align="center" prop="faultWarn" >
|
||||
<template slot-scope="scope">
|
||||
<el-col style="font-size: 1px" v-if="(scope.row.faultWarn==1)">
|
||||
<el-result icon="error" />
|
||||
</el-col>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['fault:faultInfo:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['fault:faultInfo: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-item label="车辆故障编码;" prop="faultCode">
|
||||
<el-input v-model="form.faultCode" placeholder="请输入车辆故障编码;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆故障类型" prop="faultType">
|
||||
<el-input v-model="form.faultCode" placeholder="请输入车辆类型;" />
|
||||
</el-form-item>
|
||||
<el-form-item label="故障VIN编码" prop="carVin">
|
||||
<el-input v-model="form.carVin" placeholder="请输入故障VIN编码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆故障标签" prop="faultLabel">
|
||||
<el-input v-model="form.faultLabel" placeholder="请输入车辆故障标签" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆故障位" prop="faultBit">
|
||||
<el-input v-model="form.faultBit" placeholder="请输入车辆故障位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆故障值" prop="faultValue">
|
||||
<el-input v-model="form.faultValue" placeholder="请输入车辆故障值" />
|
||||
</el-form-item>
|
||||
<el-form-item label="故障级别" prop="faultWarn">
|
||||
<el-input v-model="form.faultWarn" placeholder="请输入故障级别" />
|
||||
</el-form-item>
|
||||
<el-form-item label="报警状态" prop="warnStatus">
|
||||
<el-select v-model="form.warnStatus" placeholder="请选择报警状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_common_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="故障描述信息" prop="faultDesc">
|
||||
<el-input v-model="form.faultDesc" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="故障处理状态" prop="state">
|
||||
<el-select v-model="form.state" placeholder="请选择故障处理状态">
|
||||
<el-option
|
||||
v-for="dict in dict.type.sys_fault_status"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="parseInt(dict.value)"
|
||||
></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</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>
|
||||
|
||||
<!-- 消息-->
|
||||
<el-drawer
|
||||
title="最近消息"
|
||||
:visible.sync="drawer"
|
||||
:with-header="false">
|
||||
<el-button :plain="true" @click="open1" v-if="buttonVisible" style="background-color: skyblue;color: white;border: none">全部</el-button>
|
||||
<el-button :plain="true" @click="open2" style="background-color: skyblue;color: white;border: none">未读</el-button>
|
||||
<el-button :plain="true" @click="open3" style="background-color: skyblue;color: white;border: none">已读</el-button>
|
||||
<el-table
|
||||
:data="tableData"
|
||||
style="width: 100%;">
|
||||
<el-table-column label="ID" width="180" v-if="showField"><template slot-scope="scope" ><span style="margin-left: 10px" v-if="showField">{{ scope.row.faultMessageId }}</span></template></el-table-column>
|
||||
<el-table-column label="发送人" width="180"><template slot-scope="scope"><span style="margin-left: 10px">{{ scope.row.faultMessageSendName }}</span></template></el-table-column>
|
||||
<el-table-column label="内容" width="180"><template slot-scope="scope"><span style="margin-left: 10px">{{ scope.row.faultMessageContent }}</span></template></el-table-column>
|
||||
<el-table-column label="日期" width="180"><template slot-scope="scope"><span style="margin-left: 10px">{{ scope.row.faultMessageSendTime }}</span></template></el-table-column>
|
||||
<el-table-column label="状态" width="180" v-if="showField"><template slot-scope="scope"><span style="margin-left: 10px" v-if="showField">{{ scope.row.faultMessageState }}</span></template></el-table-column>
|
||||
<el-table-column label="操作">
|
||||
<template slot-scope="scope">
|
||||
<el-button
|
||||
size="mini"
|
||||
style="background-color: yellowgreen;color: white;border: none"
|
||||
@click="handleEdit(scope.row)" v-if="scope.row.faultMessageState==1">已读</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="danger"
|
||||
@click="handleDel(scope.row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</el-drawer>
|
||||
<!-- 消息-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {
|
||||
listFaultInfo,
|
||||
getFaultInfo,
|
||||
delFaultInfo,
|
||||
addFaultInfo,
|
||||
updateFaultInfo,
|
||||
faultTypeDown
|
||||
} from '../../../api/fault/fault'
|
||||
import {
|
||||
deleteMessageId,
|
||||
faultMessageList,
|
||||
faultMessageOne,
|
||||
faultMessageTwo,
|
||||
MessageList,
|
||||
updateTwo
|
||||
} from '../../../api/fault/message'
|
||||
|
||||
export default {
|
||||
name: "FaultInfo",
|
||||
dicts: ['sys_fault_status', 'sys_common_status'],
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 车辆故障表格数据
|
||||
faultInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
//站内信
|
||||
faultMessage:{},
|
||||
//故障类型
|
||||
faultType:{},
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
faultName: null,
|
||||
faultType: null,
|
||||
carVin: null,
|
||||
faultWarn: null,
|
||||
state: null,
|
||||
},
|
||||
tableData:[],
|
||||
drawer: false,
|
||||
// 表单参数
|
||||
form: {
|
||||
},
|
||||
// 表单校验
|
||||
rules: {
|
||||
faultCode: [
|
||||
{ required: true, message: "车辆故障编码;不能为空", trigger: "blur" }
|
||||
],
|
||||
},
|
||||
buttonVisible: true // 控制按钮的显示
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
this.open1();
|
||||
},
|
||||
methods: {
|
||||
// typeDown(){
|
||||
// faultTypeDown().then(response=>{
|
||||
// this.faultType=response.data
|
||||
// })
|
||||
// },
|
||||
open1() {
|
||||
faultMessageList(this.faultMessage).then(response=>{
|
||||
this.tableData=response.data
|
||||
})
|
||||
},
|
||||
open2() {
|
||||
faultMessageOne().then(response => {
|
||||
console.log(response);
|
||||
this.tableData = response.data;
|
||||
this.$message({
|
||||
message: '未读消息',
|
||||
type: 'success'
|
||||
})
|
||||
});
|
||||
},
|
||||
open3() {
|
||||
faultMessageTwo().then(response=>{
|
||||
console.log(response);
|
||||
this.tableData = response.data;
|
||||
this.$message({
|
||||
message: '已读消息',
|
||||
type: 'warning'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleDel(row){
|
||||
deleteMessageId(row.faultMessageId).then(response=>{
|
||||
this.$message({
|
||||
message: '删除成功',
|
||||
type: 'warning'
|
||||
})
|
||||
})
|
||||
},
|
||||
handleEdit(row){
|
||||
updateTwo(row.faultMessageId).then(response=>{
|
||||
if(res.data.code==200){
|
||||
this.$message.success("已读")
|
||||
}
|
||||
})
|
||||
},
|
||||
handleClose(done) {
|
||||
this.$confirm('确认关闭?')
|
||||
.then(_ => {
|
||||
done();
|
||||
})
|
||||
.catch(_ => {});
|
||||
},
|
||||
/** 查询车辆故障列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listFaultInfo(this.queryParams).then(response => {
|
||||
alert(1)
|
||||
debugger
|
||||
console.log(response)
|
||||
debugger
|
||||
this.faultInfoList = response.data;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
id: null,
|
||||
faultCode: null,
|
||||
faultName: null,
|
||||
faultType: null,
|
||||
carVin: null,
|
||||
faultLabel: null,
|
||||
faultBit: null,
|
||||
faultValue: null,
|
||||
faultWarn: null,
|
||||
warnStatus: null,
|
||||
faultDesc: null,
|
||||
state: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: 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
|
||||
getFaultInfo(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) {
|
||||
updateFaultInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
addFaultInfo(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 delFaultInfo(ids);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('fault/faultInfo/export', {
|
||||
...this.queryParams
|
||||
}, `faultInfo_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,286 @@
|
|||
<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="faultLogCodes">
|
||||
<el-input
|
||||
v-model="queryParams.faultLogCodes"
|
||||
placeholder="请输入故障码"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆VIN" prop="faultLogVin">
|
||||
<el-input
|
||||
v-model="queryParams.faultLogVin"
|
||||
placeholder="请输入车辆VIN"
|
||||
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="['fault:log: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="['fault:log: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="['fault:log: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="['fault:log:export']"
|
||||
>导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="logList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="日志ID" align="center" prop="faultLogId" />
|
||||
<el-table-column label="故障码" align="center" prop="faultLogCodes" />
|
||||
<el-table-column label="车辆VIN" align="center" prop="faultLogVin" />
|
||||
<el-table-column label="开始报警时间" align="center" prop="faultLogStartTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.faultLogStartTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="结束报警时间" align="center" prop="faultLogEndTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.faultLogEndTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<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="['fault:log:edit']"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-delete"
|
||||
@click="handleDelete(scope.row)"
|
||||
v-hasPermi="['fault:log: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-item label="故障码" prop="faultLogCodes">
|
||||
<el-input v-model="form.faultLogCodes" placeholder="请输入故障码" />
|
||||
</el-form-item>
|
||||
<el-form-item label="车辆VIN" prop="faultLogVin">
|
||||
<el-input v-model="form.faultLogVin" placeholder="请输入车辆VIN" />
|
||||
</el-form-item>
|
||||
<el-form-item label="开始报警时间" prop="faultLogStartTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.faultLogStartTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择开始报警时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="结束报警时间" prop="faultLogEndTime">
|
||||
<el-date-picker clearable
|
||||
v-model="form.faultLogEndTime"
|
||||
type="date"
|
||||
value-format="yyyy-MM-dd"
|
||||
placeholder="请选择结束报警时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</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 { delFaultInfo, faultLogList, insertFaultLog, updateFaultLog } from '../../../api/fault/loginfo'
|
||||
|
||||
export default {
|
||||
name: "Log",
|
||||
data() {
|
||||
return {
|
||||
// 遮罩层
|
||||
loading: true,
|
||||
// 选中数组
|
||||
ids: [],
|
||||
// 非单个禁用
|
||||
single: true,
|
||||
// 非多个禁用
|
||||
multiple: true,
|
||||
// 显示搜索条件
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 故障日志表格数据
|
||||
logList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
open: false,
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
faultLogCodes: null,
|
||||
faultLogVin: null,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
}
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询故障日志列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
faultLogList(this.queryParams).then(response => {
|
||||
this.logList = response.data;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
});
|
||||
},
|
||||
// 取消按钮
|
||||
cancel() {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
faultLogId: null,
|
||||
faultLogCodes: null,
|
||||
faultLogVin: null,
|
||||
faultLogStartTime: null,
|
||||
faultLogEndTime: null,
|
||||
createBy: null,
|
||||
createTime: Date.now(),
|
||||
updateBy: null,
|
||||
updateTime: null,
|
||||
remark: 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.faultLogId)
|
||||
this.single = selection.length!==1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.open = true;
|
||||
this.title = "添加故障日志";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.reset();
|
||||
const faultLogId = row.faultLogId || this.ids
|
||||
updateFaultLog(faultLogId).then(response => {
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改故障日志";
|
||||
});
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.faultLogId != null) {
|
||||
updateFaultLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
insertFaultLog(this.form).then(response => {
|
||||
this.$modal.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const faultLogIds = row.faultLogId || this.ids;
|
||||
this.$modal.confirm('是否确认删除故障日志编号为"' + faultLogIds + '"的数据项?').then(function() {
|
||||
return delFaultInfo(faultLogIds);
|
||||
}).then(() => {
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
|
@ -0,0 +1,280 @@
|
|||
<!--<template>-->
|
||||
<!-- <div class="navbar">-->
|
||||
<!-- <hamburger id="hamburger-container" :is-active="sidebar.opened" class="hamburger-container"-->
|
||||
<!-- @toggleClick="toggleSideBar"/>-->
|
||||
|
||||
<!-- <breadcrumb v-if="!topNav" id="breadcrumb-container" class="breadcrumb-container"/>-->
|
||||
<!-- <top-nav v-if="topNav" id="topmenu-container" class="topmenu-container"/>-->
|
||||
|
||||
<!-- <div class="right-menu">-->
|
||||
<!-- <template v-if="device!=='mobile'">-->
|
||||
<!-- <el-badge :value="number" class="item">-->
|
||||
<!-- <el-button @click="drawer = true" class="share-button" style="margin-top: 10px" icon="el-icon-s-comment" type="primary"></el-button>-->
|
||||
<!-- </el-badge>-->
|
||||
|
||||
<!-- <el-drawer-->
|
||||
<!-- title="最近消息"-->
|
||||
<!-- :visible.sync="drawer"-->
|
||||
<!-- :before-close="handleClose">-->
|
||||
<!-- <el-radio-group v-model="form.status" @change="getMessageList">-->
|
||||
<!-- <el-radio-button label="">全部</el-radio-button>-->
|
||||
<!-- <el-radio-button label="0">未读</el-radio-button>-->
|
||||
<!-- <el-radio-button label="1">已读</el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- <br><br><br>-->
|
||||
<!-- <el-card class="box-card" v-for="notice in messages">-->
|
||||
<!-- <el-descriptions class="margin-top" :column="2" :size="size" border>-->
|
||||
<!-- <template slot="extra">-->
|
||||
<!-- <el-button size="small" v-if="notice.status==0" @click="handleUnreadClick(notice)">阅读消息</el-button>-->
|
||||
<!-- </template>-->
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- <i class="el-icon-user"></i>-->
|
||||
<!-- 消息内容-->
|
||||
<!-- </template>-->
|
||||
<!-- {{ notice.content }}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- <i class="el-icon-user"></i>-->
|
||||
<!-- 消息发布时间-->
|
||||
<!-- </template>-->
|
||||
<!-- {{ notice.createTime }}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
|
||||
<!-- <el-descriptions-item>-->
|
||||
<!-- <template slot="label">-->
|
||||
<!-- <i class="el-icon-office-building"></i>-->
|
||||
<!-- 消息当前状态-->
|
||||
<!-- </template>-->
|
||||
<!-- <dict-tag :options="dict.type.sys_is_read" :value="notice.status"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
|
||||
<!-- </el-descriptions>-->
|
||||
<!-- </el-card>-->
|
||||
<!-- </el-drawer>-->
|
||||
|
||||
<!-- <search id="header-search" class="right-menu-item"/>-->
|
||||
<!-- <screenfull id="screenfull" class="right-menu-item hover-effect"/>-->
|
||||
|
||||
<!-- <el-tooltip content="布局大小" effect="dark" placement="bottom">-->
|
||||
<!-- <size-select id="size-select" class="right-menu-item hover-effect"/>-->
|
||||
<!-- </el-tooltip>-->
|
||||
|
||||
<!-- </template>-->
|
||||
|
||||
<!-- <el-dropdown class="avatar-container right-menu-item hover-effect" trigger="click">-->
|
||||
<!-- <div class="avatar-wrapper">-->
|
||||
<!-- <img :src="avatar" class="user-avatar">-->
|
||||
<!-- <i class="el-icon-caret-bottom"/>-->
|
||||
<!-- </div>-->
|
||||
<!-- <el-dropdown-menu slot="dropdown">-->
|
||||
<!-- <router-link to="/user/profile">-->
|
||||
<!-- <el-dropdown-item>个人中心</el-dropdown-item>-->
|
||||
<!-- </router-link>-->
|
||||
<!-- <el-dropdown-item @click.native="setting = true">-->
|
||||
<!-- <span>布局设置</span>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- <el-dropdown-item divided @click.native="logout">-->
|
||||
<!-- <span>退出登录</span>-->
|
||||
<!-- </el-dropdown-item>-->
|
||||
<!-- </el-dropdown-menu>-->
|
||||
<!-- </el-dropdown>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</template>-->
|
||||
|
||||
<!--<script>-->
|
||||
<!--import {mapGetters} from 'vuex'-->
|
||||
<!--import Breadcrumb from '@/components/Breadcrumb'-->
|
||||
<!--import TopNav from '@/components/TopNav'-->
|
||||
<!--import Hamburger from '@/components/Hamburger'-->
|
||||
<!--import Screenfull from '@/components/Screenfull'-->
|
||||
<!--import SizeSelect from '@/components/SizeSelect'-->
|
||||
<!--import Search from '@/components/HeaderSearch'-->
|
||||
<!--import {getMessageList,getNum, updateAsUserDept} from "@/api/car/breakdown";-->
|
||||
|
||||
<!--export default {-->
|
||||
<!-- dicts: ['sys_car_fault', 'sys_yes_no','sys_is_read'],-->
|
||||
<!-- data(){-->
|
||||
<!-- return{-->
|
||||
<!-- messages:{},-->
|
||||
<!-- drawer: false,-->
|
||||
<!-- // 表单参数-->
|
||||
<!-- form: {-->
|
||||
<!-- status: "",-->
|
||||
<!-- },-->
|
||||
<!-- updateNotice:{-->
|
||||
<!-- },-->
|
||||
<!-- number: 0,-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- components: {-->
|
||||
<!-- Breadcrumb,-->
|
||||
<!-- TopNav,-->
|
||||
<!-- Hamburger,-->
|
||||
<!-- Screenfull,-->
|
||||
<!-- SizeSelect,-->
|
||||
<!-- Search-->
|
||||
<!-- },-->
|
||||
<!-- computed: {-->
|
||||
<!-- ...mapGetters([-->
|
||||
<!-- 'sidebar',-->
|
||||
<!-- 'avatar',-->
|
||||
<!-- 'device'-->
|
||||
<!-- ]),-->
|
||||
|
||||
<!-- setting: {-->
|
||||
<!-- get() {-->
|
||||
<!-- return this.$store.state.settings.showSettings-->
|
||||
<!-- },-->
|
||||
<!-- set(val) {-->
|
||||
<!-- this.$store.dispatch('settings/changeSetting', {-->
|
||||
<!-- key: 'showSettings',-->
|
||||
<!-- value: val-->
|
||||
<!-- })-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- topNav: {-->
|
||||
<!-- get() {-->
|
||||
<!-- return this.$store.state.settings.topNav-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- },-->
|
||||
<!-- created() {-->
|
||||
<!-- this.getMessageList();-->
|
||||
<!-- this.getMessageNum();-->
|
||||
<!-- },-->
|
||||
<!-- methods: {-->
|
||||
<!-- getMessageNum(){-->
|
||||
<!-- getNum().then(response => {-->
|
||||
<!-- this.number=response.data-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- handleUnreadClick(row){-->
|
||||
<!-- this.updateNotice=row-->
|
||||
<!-- updateAsUserDept(row.id).then(response => {-->
|
||||
<!-- this.getMessageList();-->
|
||||
<!-- })-->
|
||||
<!-- },-->
|
||||
<!-- getMessageList(){-->
|
||||
<!-- getMessageList(this.form).then(response => {-->
|
||||
<!-- console.log(response);-->
|
||||
<!-- this.messages = response.data;-->
|
||||
<!-- });-->
|
||||
<!-- },-->
|
||||
<!-- handleClose(done) {-->
|
||||
<!-- this.$confirm('确认关闭?')-->
|
||||
<!-- .then(_ => {-->
|
||||
<!-- done();-->
|
||||
<!-- })-->
|
||||
<!-- .catch(_ => {});-->
|
||||
<!-- },-->
|
||||
<!-- toggleSideBar() {-->
|
||||
<!-- this.$store.dispatch('app/toggleSideBar')-->
|
||||
<!-- },-->
|
||||
<!-- async logout() {-->
|
||||
<!-- this.$confirm('确定注销并退出系统吗?', '提示', {-->
|
||||
<!-- confirmButtonText: '确定',-->
|
||||
<!-- cancelButtonText: '取消',-->
|
||||
<!-- type: 'warning'-->
|
||||
<!-- }).then(() => {-->
|
||||
<!-- this.$store.dispatch('LogOut').then(() => {-->
|
||||
<!-- location.href = '/index';-->
|
||||
<!-- })-->
|
||||
<!-- }).catch(() => {-->
|
||||
<!-- });-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--}-->
|
||||
<!--</script>-->
|
||||
|
||||
<!--<style lang="scss" scoped>-->
|
||||
<!--.navbar {-->
|
||||
<!-- height: 50px;-->
|
||||
<!-- overflow: hidden;-->
|
||||
<!-- position: relative;-->
|
||||
<!-- background: #fff;-->
|
||||
<!-- box-shadow: 0 1px 4px rgba(0, 21, 41, .08);-->
|
||||
|
||||
<!-- .hamburger-container {-->
|
||||
<!-- line-height: 46px;-->
|
||||
<!-- height: 100%;-->
|
||||
<!-- float: left;-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- transition: background .3s;-->
|
||||
<!-- -webkit-tap-highlight-color: transparent;-->
|
||||
|
||||
<!-- &:hover {-->
|
||||
<!-- background: rgba(0, 0, 0, .025)-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .breadcrumb-container {-->
|
||||
<!-- float: left;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .topmenu-container {-->
|
||||
<!-- position: absolute;-->
|
||||
<!-- left: 50px;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .errLog-container {-->
|
||||
<!-- display: inline-block;-->
|
||||
<!-- vertical-align: top;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .right-menu {-->
|
||||
<!-- float: right;-->
|
||||
<!-- height: 100%;-->
|
||||
<!-- line-height: 50px;-->
|
||||
|
||||
<!-- &:focus {-->
|
||||
<!-- outline: none;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .right-menu-item {-->
|
||||
<!-- display: inline-block;-->
|
||||
<!-- padding: 0 8px;-->
|
||||
<!-- height: 100%;-->
|
||||
<!-- font-size: 18px;-->
|
||||
<!-- color: #5a5e66;-->
|
||||
<!-- vertical-align: text-bottom;-->
|
||||
|
||||
<!-- &.hover-effect {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- transition: background .3s;-->
|
||||
|
||||
<!-- &:hover {-->
|
||||
<!-- background: rgba(0, 0, 0, .025)-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .avatar-container {-->
|
||||
<!-- margin-right: 30px;-->
|
||||
|
||||
<!-- .avatar-wrapper {-->
|
||||
<!-- margin-top: 5px;-->
|
||||
<!-- position: relative;-->
|
||||
|
||||
<!-- .user-avatar {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- width: 40px;-->
|
||||
<!-- height: 40px;-->
|
||||
<!-- border-radius: 10px;-->
|
||||
<!-- }-->
|
||||
|
||||
<!-- .el-icon-caret-bottom {-->
|
||||
<!-- cursor: pointer;-->
|
||||
<!-- position: absolute;-->
|
||||
<!-- right: -20px;-->
|
||||
<!-- top: 25px;-->
|
||||
<!-- font-size: 12px;-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!-- }-->
|
||||
<!--}-->
|
||||
<!--</style>-->
|
|
@ -127,9 +127,9 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {getGenTable, updateGenTable} from "@/api/tool/gen";
|
||||
import {optionselect as getDictOptionselect} from "@/api/system/dict/type";
|
||||
import {listMenu as getMenuTreeselect} from "@/api/system/menu";
|
||||
import {getGenTable, updateGenTable} from "/src/api/tool/gen";
|
||||
import {optionselect as getDictOptionselect} from "/src/api/system/dict/type";
|
||||
import {listMenu as getMenuTreeselect} from "/src/api/system/menu";
|
||||
import basicInfoForm from "./basicInfoForm";
|
||||
import genInfoForm from "./genInfoForm";
|
||||
import Sortable from 'sortablejs'
|
||||
|
@ -183,7 +183,8 @@ export default {
|
|||
const basicForm = this.$refs.basicInfo.$refs.basicInfoForm;
|
||||
const genForm = this.$refs.genInfo.$refs.genInfoForm;
|
||||
Promise.all([basicForm, genForm].map(this.getFormPromise)).then(res => {
|
||||
const validateResult = res.data.every(item => !!item);
|
||||
console.log(res)
|
||||
const validateResult = res.every(item => !!item);
|
||||
if (validateResult) {
|
||||
const genTable = Object.assign({}, basicForm.model, genForm.model);
|
||||
genTable.columns = this.columns;
|
||||
|
@ -194,10 +195,8 @@ export default {
|
|||
parentMenuId: genTable.parentMenuId
|
||||
};
|
||||
updateGenTable(genTable).then(res => {
|
||||
this.$modal.msgSuccess(res.data.msg);
|
||||
if (res.code === 200) {
|
||||
this.$modal.msgSuccess(res.msg);
|
||||
this.close();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
this.$modal.msgError("表单校验未通过,请重新检查提交内容");
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
<el-form-item prop="moduleName">
|
||||
<span slot="label">
|
||||
生成模块名
|
||||
<el-tooltip content="可理解为子系统名,例如 system" placement="top">
|
||||
<el-tooltip content="指的是项目在网关注册的路径名称(不推荐首字母大写),例: 一个项目在网关注册路径为'- Path=/system/**',其下有两个服务模块,它们的控制层路径是s1,s2,那么这里添system" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
|
@ -39,7 +39,7 @@
|
|||
<el-form-item prop="businessName">
|
||||
<span slot="label">
|
||||
生成业务名
|
||||
<el-tooltip content="可理解为功能英文名,例如 user" placement="top">
|
||||
<el-tooltip content="指的是模块的控制层名称(不推荐首字母大写),例: 一个项目在网关注册路径为'- Path=/system/**',其下有两个服务模块,它们的控制层路径是auth和app,这次生成auth的模块,那么这里填控制层路径auth" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
|
@ -51,7 +51,7 @@
|
|||
<el-form-item prop="functionName">
|
||||
<span slot="label">
|
||||
生成功能名
|
||||
<el-tooltip content="用作类描述,例如 用户" placement="top">
|
||||
<el-tooltip content="用作类描述,例如 用户管理" placement="top">
|
||||
<i class="el-icon-question"></i>
|
||||
</el-tooltip>
|
||||
</span>
|
||||
|
|
|
@ -2,6 +2,11 @@
|
|||
<!-- 导入表 -->
|
||||
<el-dialog :visible.sync="visible" append-to-body title="导入表" top="5vh" width="800px">
|
||||
<el-form ref="queryForm" :inline="true" :model="queryParams" size="small">
|
||||
<el-form-item label="数据库名称" prop="dbName">
|
||||
<el-select v-model="queryParams.dbName" placeholder="请选择数据库" clearable>
|
||||
<el-option v-for="item in dbs" :key="item" :label="item" :value="item"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="表名称" prop="tableName">
|
||||
<el-input
|
||||
v-model="queryParams.tableName"
|
||||
|
@ -48,7 +53,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {importTable, listDbTable} from "@/api/tool/gen";
|
||||
import {importTable, listDbTable, selDbNameAll} from "@/api/tool/gen";
|
||||
|
||||
export default {
|
||||
data() {
|
||||
|
@ -61,6 +66,7 @@ export default {
|
|||
total: 0,
|
||||
// 表数据
|
||||
dbTableList: [],
|
||||
dbs: [],
|
||||
// 查询参数
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
|
@ -74,6 +80,7 @@ export default {
|
|||
// 显示弹框
|
||||
show() {
|
||||
this.getList();
|
||||
this.selDbNameList();
|
||||
this.visible = true;
|
||||
},
|
||||
clickRow(row) {
|
||||
|
@ -107,11 +114,23 @@ export default {
|
|||
this.$modal.msgError("请选择要导入的表");
|
||||
return;
|
||||
}
|
||||
importTable({tables: tableNames}).then(res => {
|
||||
this.$modal.msgSuccess(res.data.msg);
|
||||
const dbName = this.queryParams.dbName;
|
||||
importTable(tableNames, dbName).then(res => {
|
||||
console.log(res)
|
||||
if (res.code === 200){
|
||||
this.$modal.msgSuccess("成功");
|
||||
this.visible = false;
|
||||
this.$emit("ok");
|
||||
}else{
|
||||
this.$modal.msgSuccess(res.data.msg);
|
||||
}
|
||||
});
|
||||
},
|
||||
// 查询所有数据库名称
|
||||
selDbNameList() {
|
||||
selDbNameAll().then(res => {
|
||||
this.dbs = res.data
|
||||
})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -91,6 +91,13 @@
|
|||
<span>{{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="数据库名称"
|
||||
align="center"
|
||||
prop="dbName"
|
||||
:show-overflow-tooltip="true"
|
||||
width="120"
|
||||
/>
|
||||
<el-table-column
|
||||
:show-overflow-tooltip="true"
|
||||
align="center"
|
||||
|
@ -188,7 +195,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import {delTable, genCode, listTable, previewTable, synchDb} from "@/api/tool/gen";
|
||||
import {delTable, genCode, listTable, previewTable, synchDb} from "/src/api/tool/gen";
|
||||
import importTable from "./importTable";
|
||||
import hljs from "highlight.js/lib/highlight";
|
||||
import "highlight.js/styles/github-gist.css";
|
||||
|
@ -256,7 +263,9 @@ export default {
|
|||
/** 查询表集合 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
console.log(this.loading)
|
||||
listTable(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
|
||||
console.log(response)
|
||||
this.tableList = response.data.rows;
|
||||
this.total = response.data.total;
|
||||
this.loading = false;
|
||||
|
@ -286,8 +295,9 @@ export default {
|
|||
/** 同步数据库操作 */
|
||||
handleSynchDb(row) {
|
||||
const tableName = row.tableName;
|
||||
const dbName = row.dbName;
|
||||
this.$modal.confirm('确认要强制同步"' + tableName + '"表结构吗?').then(function () {
|
||||
return synchDb(tableName);
|
||||
return synchDb(tableName, dbName);
|
||||
}).then(() => {
|
||||
this.$modal.msgSuccess("同步成功");
|
||||
}).catch(() => {
|
||||
|
|
Loading…
Reference in New Issue