import request from '@/utils/request' | |||||
// 查询站点留言列表 | |||||
export function listMessages(query) { | |||||
return request({ | |||||
url: '/system/messages/list', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 查询站点留言详细 | |||||
export function getMessages(id) { | |||||
return request({ | |||||
url: '/system/messages/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增站点留言 | |||||
export function addMessages(data) { | |||||
return request({ | |||||
url: '/system/messages', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改站点留言 | |||||
export function updateMessages(data) { | |||||
return request({ | |||||
url: '/system/messages', | |||||
method: 'put', | |||||
data: data | |||||
}) | |||||
} | |||||
// 删除站点留言 | |||||
export function delMessages(id) { | |||||
return request({ | |||||
url: '/system/messages/' + id, | |||||
method: 'delete' | |||||
}) | |||||
} |
import request from '@/utils/request' | |||||
// 查询商品配置列表 | |||||
export function listOperationGoods(query) { | |||||
return request({ | |||||
url: '/system/operationGoods/list', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 查询商品配置详细 | |||||
export function getOperationGoods(id) { | |||||
return request({ | |||||
url: '/system/operationGoods/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增商品配置 | |||||
export function addOperationGoods(data) { | |||||
return request({ | |||||
url: '/system/operationGoods', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改商品配置 | |||||
export function updateOperationGoods(data) { | |||||
return request({ | |||||
url: '/system/operationGoods', | |||||
method: 'put', | |||||
data: data | |||||
}) | |||||
} | |||||
// 删除商品配置 | |||||
export function delOperationGoods(id) { | |||||
return request({ | |||||
url: '/system/operationGoods/' + id, | |||||
method: 'delete' | |||||
}) | |||||
} |
import request from '@/utils/request' | |||||
// 查询发送信息配置列表 | |||||
export function listOperationSendconfig(query) { | |||||
return request({ | |||||
url: '/system/operationSendconfig/list', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 查询发送信息配置详细 | |||||
export function getOperationSendconfig(id) { | |||||
return request({ | |||||
url: '/system/operationSendconfig/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增发送信息配置 | |||||
export function addOperationSendconfig(data) { | |||||
return request({ | |||||
url: '/system/operationSendconfig', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改发送信息配置 | |||||
export function updateOperationSendconfig(data) { | |||||
return request({ | |||||
url: '/system/operationSendconfig', | |||||
method: 'put', | |||||
data: data | |||||
}) | |||||
} | |||||
// 删除发送信息配置 | |||||
export function delOperationSendconfig(id) { | |||||
return request({ | |||||
url: '/system/operationSendconfig/' + id, | |||||
method: 'delete' | |||||
}) | |||||
} |
import request from '@/utils/request' | |||||
// 查询邮件配置列表 | |||||
export function listOperationSmtp(query) { | |||||
return request({ | |||||
url: '/system/operationSmtp/list', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 查询邮件配置详细 | |||||
export function getOperationSmtp(id) { | |||||
return request({ | |||||
url: '/system/operationSmtp/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增邮件配置 | |||||
export function addOperationSmtp(data) { | |||||
return request({ | |||||
url: '/system/operationSmtp', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改邮件配置 | |||||
export function updateOperationSmtp(data) { | |||||
return request({ | |||||
url: '/system/operationSmtp', | |||||
method: 'put', | |||||
data: data | |||||
}) | |||||
} | |||||
// 删除邮件配置 | |||||
export function delOperationSmtp(id) { | |||||
return request({ | |||||
url: '/system/operationSmtp/' + id, | |||||
method: 'delete' | |||||
}) | |||||
} |
import request from '@/utils/request' | |||||
// 查询预警配置列表 | |||||
export function listOperationWarnconfig(query) { | |||||
return request({ | |||||
url: '/system/operationWarnconfig/list', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 查询预警配置详细 | |||||
export function getOperationWarnconfig(id) { | |||||
return request({ | |||||
url: '/system/operationWarnconfig/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增预警配置 | |||||
export function addOperationWarnconfig(data) { | |||||
return request({ | |||||
url: '/system/operationWarnconfig', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改预警配置 | |||||
export function updateOperationWarnconfig(data) { | |||||
return request({ | |||||
url: '/system/operationWarnconfig', | |||||
method: 'put', | |||||
data: data | |||||
}) | |||||
} | |||||
// 删除预警配置 | |||||
export function delOperationWarnconfig(id) { | |||||
return request({ | |||||
url: '/system/operationWarnconfig/' + id, | |||||
method: 'delete' | |||||
}) | |||||
} |
import request from '@/utils/request' | |||||
// 查询预警结果列表 | |||||
export function listOperationWarnresult(query) { | |||||
return request({ | |||||
url: '/system/operationWarnresult/list', | |||||
method: 'get', | |||||
params: query | |||||
}) | |||||
} | |||||
// 查询预警结果详细 | |||||
export function getOperationWarnresult(id) { | |||||
return request({ | |||||
url: '/system/operationWarnresult/' + id, | |||||
method: 'get' | |||||
}) | |||||
} | |||||
// 新增预警结果 | |||||
export function addOperationWarnresult(data) { | |||||
return request({ | |||||
url: '/system/operationWarnresult', | |||||
method: 'post', | |||||
data: data | |||||
}) | |||||
} | |||||
// 修改预警结果 | |||||
export function updateOperationWarnresult(data) { | |||||
return request({ | |||||
url: '/system/operationWarnresult', | |||||
method: 'put', | |||||
data: data | |||||
}) | |||||
} | |||||
// 删除预警结果 | |||||
export function delOperationWarnresult(id) { | |||||
return request({ | |||||
url: '/system/operationWarnresult/' + id, | |||||
method: 'delete' | |||||
}) | |||||
} |
<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="留言时间"> | |||||
<el-date-picker | |||||
v-model="daterangeCreatedAt" | |||||
style="width: 240px" | |||||
value-format="yyyy-MM-dd HH:mm:ss" | |||||
type="daterange" | |||||
range-separator="-" | |||||
start-placeholder="开始日期" | |||||
end-placeholder="结束日期" | |||||
:default-time="['00:00:00', '23:59:59']" | |||||
></el-date-picker> | |||||
</el-form-item> | |||||
<el-form-item label="审核状态" prop="status"> | |||||
<el-select v-model="queryParams.status" placeholder="请选择审核状态" clearable> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_faq_status" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="管理员回复时间"> | |||||
<el-date-picker | |||||
v-model="daterangeAdminReplyAt" | |||||
style="width: 240px" | |||||
value-format="yyyy-MM-dd HH:mm:ss" | |||||
type="daterange" | |||||
range-separator="-" | |||||
start-placeholder="开始日期" | |||||
end-placeholder="结束日期" | |||||
:default-time="['00:00:00', '23:59:59']" | |||||
></el-date-picker> | |||||
</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:messages: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:messages: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:messages: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:messages:export']" | |||||
>导出</el-button> | |||||
</el-col> | |||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||||
</el-row> | |||||
<el-table v-loading="loading" :data="messagesList" @selection-change="handleSelectionChange"> | |||||
<el-table-column type="selection" width="55" align="center" /> | |||||
<el-table-column label="主键ID" align="center" prop="id" v-if="false"/> | |||||
<el-table-column label="留言者姓名" align="center" prop="username" /> | |||||
<el-table-column label="留言者邮箱" align="center" prop="email" /> | |||||
<el-table-column label="留言内容" align="center" prop="content" /> | |||||
<el-table-column label="用户IP" align="center" prop="ipAddress" /> | |||||
<el-table-column label="留言时间" align="center" prop="createdAt" width="180"> | |||||
<template slot-scope="scope"> | |||||
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="审核状态" align="center" prop="status"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_faq_status" :value="scope.row.status"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="管理员回复内容" align="center" prop="adminReply" /> | |||||
<el-table-column label="管理员回复时间" align="center" prop="adminReplyAt" width="180"> | |||||
<template slot-scope="scope"> | |||||
<span>{{ parseTime(scope.row.adminReplyAt, '{y}-{m}-{d}') }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<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="updateTime" width="180"> | |||||
<template slot-scope="scope"> | |||||
<span>{{ parseTime(scope.row.updateTime, '{y}-{m}-{d}') }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="创建人" align="center" prop="createBy" /> | |||||
<el-table-column label="修改人" align="center" prop="updateBy" /> | |||||
<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:messages:edit']" | |||||
>修改</el-button> | |||||
<el-button | |||||
size="mini" | |||||
type="text" | |||||
icon="el-icon-delete" | |||||
@click="handleDelete(scope.row)" | |||||
v-hasPermi="['system:messages: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="网站ID" prop="websiteId"> | |||||
<el-input v-model="form.websiteId" placeholder="请输入网站ID" /> | |||||
</el-form-item> | |||||
<el-form-item label="留言者姓名" prop="username"> | |||||
<el-input v-model="form.username" placeholder="请输入留言者姓名" /> | |||||
</el-form-item> | |||||
<el-form-item label="留言者邮箱" prop="email"> | |||||
<el-input v-model="form.email" placeholder="请输入留言者邮箱" /> | |||||
</el-form-item> | |||||
<el-form-item label="留言内容" prop="content"> | |||||
<el-input v-model="form.content" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
<el-form-item label="用户IP" prop="ipAddress"> | |||||
<el-input v-model="form.ipAddress" placeholder="请输入用户IP" /> | |||||
</el-form-item> | |||||
<el-form-item label="审核状态" prop="status"> | |||||
<el-select v-model="form.status" placeholder="请选择审核状态"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_faq_status" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="parseInt(dict.value)" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="管理员回复内容" prop="adminReply"> | |||||
<el-input v-model="form.adminReply" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
</el-form> | |||||
<div slot="footer" class="dialog-footer"> | |||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | |||||
<el-button @click="cancel">取 消</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listMessages, getMessages, delMessages, addMessages, updateMessages } from "@/api/system/messages"; | |||||
export default { | |||||
name: "Messages", | |||||
dicts: ['zs_faq_status'], | |||||
data() { | |||||
return { | |||||
// 按钮loading | |||||
buttonLoading: false, | |||||
// 遮罩层 | |||||
loading: true, | |||||
// 选中数组 | |||||
ids: [], | |||||
// 非单个禁用 | |||||
single: true, | |||||
// 非多个禁用 | |||||
multiple: true, | |||||
// 显示搜索条件 | |||||
showSearch: true, | |||||
// 总条数 | |||||
total: 0, | |||||
// 站点留言表格数据 | |||||
messagesList: [], | |||||
// 弹出层标题 | |||||
title: "", | |||||
// 是否显示弹出层 | |||||
open: false, | |||||
// 管理员回复内容时间范围 | |||||
daterangeCreatedAt: [], | |||||
// 管理员回复内容时间范围 | |||||
daterangeAdminReplyAt: [], | |||||
// 查询参数 | |||||
queryParams: { | |||||
pageNum: 1, | |||||
pageSize: 10, | |||||
createdAt: undefined, | |||||
status: undefined, | |||||
adminReplyAt: undefined, | |||||
}, | |||||
// 表单参数 | |||||
form: {}, | |||||
// 表单校验 | |||||
rules: { | |||||
id: [ | |||||
{ required: true, message: "主键ID不能为空", trigger: "blur" } | |||||
], | |||||
websiteId: [ | |||||
{ required: true, message: "网站ID不能为空", trigger: "blur" } | |||||
], | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getList(); | |||||
}, | |||||
methods: { | |||||
/** 查询站点留言列表 */ | |||||
getList() { | |||||
this.loading = true; | |||||
this.queryParams.params = {}; | |||||
if (null != this.daterangeCreatedAt && '' != this.daterangeCreatedAt) { | |||||
this.queryParams.params["beginCreatedAt"] = this.daterangeCreatedAt[0]; | |||||
this.queryParams.params["endCreatedAt"] = this.daterangeCreatedAt[1]; | |||||
} | |||||
if (null != this.daterangeAdminReplyAt && '' != this.daterangeAdminReplyAt) { | |||||
this.queryParams.params["beginAdminReplyAt"] = this.daterangeAdminReplyAt[0]; | |||||
this.queryParams.params["endAdminReplyAt"] = this.daterangeAdminReplyAt[1]; | |||||
} | |||||
listMessages(this.queryParams).then(response => { | |||||
this.messagesList = response.rows; | |||||
this.total = response.total; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
// 取消按钮 | |||||
cancel() { | |||||
this.open = false; | |||||
this.reset(); | |||||
}, | |||||
// 表单重置 | |||||
reset() { | |||||
this.form = { | |||||
id: undefined, | |||||
websiteId: undefined, | |||||
username: undefined, | |||||
email: undefined, | |||||
content: undefined, | |||||
ipAddress: undefined, | |||||
createdAt: undefined, | |||||
status: undefined, | |||||
adminReply: undefined, | |||||
adminReplyAt: undefined, | |||||
createTime: undefined, | |||||
updateTime: undefined, | |||||
createBy: undefined, | |||||
updateBy: undefined | |||||
}; | |||||
this.resetForm("form"); | |||||
}, | |||||
/** 搜索按钮操作 */ | |||||
handleQuery() { | |||||
this.queryParams.pageNum = 1; | |||||
this.getList(); | |||||
}, | |||||
/** 重置按钮操作 */ | |||||
resetQuery() { | |||||
this.daterangeCreatedAt = []; | |||||
this.daterangeAdminReplyAt = []; | |||||
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.loading = true; | |||||
this.reset(); | |||||
const id = row.id || this.ids | |||||
getMessages(id).then(response => { | |||||
this.loading = false; | |||||
this.form = response.data; | |||||
this.open = true; | |||||
this.title = "修改站点留言"; | |||||
}); | |||||
}, | |||||
/** 提交按钮 */ | |||||
submitForm() { | |||||
this.$refs["form"].validate(valid => { | |||||
if (valid) { | |||||
this.buttonLoading = true; | |||||
if (this.form.id != null) { | |||||
updateMessages(this.form).then(response => { | |||||
this.$modal.msgSuccess("修改成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} else { | |||||
addMessages(this.form).then(response => { | |||||
this.$modal.msgSuccess("新增成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
/** 删除按钮操作 */ | |||||
handleDelete(row) { | |||||
const ids = row.id || this.ids; | |||||
this.$modal.confirm('是否确认删除站点留言编号为"' + ids + '"的数据项?').then(() => { | |||||
this.loading = true; | |||||
return delMessages(ids); | |||||
}).then(() => { | |||||
this.loading = false; | |||||
this.getList(); | |||||
this.$modal.msgSuccess("删除成功"); | |||||
}).catch(() => { | |||||
}).finally(() => { | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
/** 导出按钮操作 */ | |||||
handleExport() { | |||||
this.download('system/messages/export', { | |||||
...this.queryParams | |||||
}, `messages_${new Date().getTime()}.xlsx`) | |||||
} | |||||
} | |||||
}; | |||||
</script> |
<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="goodsSkuName"> | |||||
<el-input | |||||
v-model="queryParams.goodsSkuName" | |||||
placeholder="请输入商品名字" | |||||
clearable | |||||
@keyup.enter.native="handleQuery" | |||||
/> | |||||
</el-form-item> | |||||
<el-form-item label="商品编号" prop="goodsSkuSn"> | |||||
<el-input | |||||
v-model="queryParams.goodsSkuSn" | |||||
placeholder="请输入商品编号" | |||||
clearable | |||||
@keyup.enter.native="handleQuery" | |||||
/> | |||||
</el-form-item> | |||||
<el-form-item label="平台" prop="platform"> | |||||
<el-select v-model="queryParams.platform" placeholder="请选择平台" clearable> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_platform" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
/> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="是否启用" prop="isDisabled"> | |||||
<el-select v-model="queryParams.isDisabled" placeholder="请选择是否启用" clearable> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_is_disabled" | |||||
: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-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:operationGoods: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:operationGoods: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:operationGoods: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:operationGoods:export']" | |||||
>导出</el-button> | |||||
</el-col> | |||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||||
</el-row> | |||||
<el-table v-loading="loading" :data="operationGoodsList" @selection-change="handleSelectionChange"> | |||||
<el-table-column type="selection" width="55" align="center" /> | |||||
<el-table-column label="主键ID" align="center" prop="id" v-if="false"/> | |||||
<el-table-column label="商品名字" align="center" prop="goodsSkuName" /> | |||||
<el-table-column label="商品编号" align="center" prop="goodsSkuSn" /> | |||||
<el-table-column label="商品url" align="center" prop="goodsSkuUrl" /> | |||||
<el-table-column label="平台" align="center" prop="platform"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_platform" :value="scope.row.platform"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="基准价格" align="center" prop="initPrice" /> | |||||
<el-table-column label="备注" align="center" prop="remark" /> | |||||
<el-table-column label="是否启用" align="center" prop="isDisabled"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_is_disabled" :value="scope.row.isDisabled"/> | |||||
</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="['system:operationGoods:edit']" | |||||
>修改</el-button> | |||||
<el-button | |||||
size="mini" | |||||
type="text" | |||||
icon="el-icon-delete" | |||||
@click="handleDelete(scope.row)" | |||||
v-hasPermi="['system:operationGoods: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="goodsSkuName"> | |||||
<el-input v-model="form.goodsSkuName" placeholder="请输入商品名字" /> | |||||
</el-form-item> | |||||
<el-form-item label="商品编号" prop="goodsSkuSn"> | |||||
<el-input v-model="form.goodsSkuSn" placeholder="请输入商品编号" /> | |||||
</el-form-item> | |||||
<el-form-item label="商品url" prop="goodsSkuUrl"> | |||||
<el-input v-model="form.goodsSkuUrl" placeholder="请输入商品url" /> | |||||
</el-form-item> | |||||
<el-form-item label="平台" prop="platform"> | |||||
<el-select v-model="form.platform" placeholder="请选择平台"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_platform" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="基准价格" prop="initPrice"> | |||||
<el-input v-model="form.initPrice" placeholder="请输入基准价格" /> | |||||
</el-form-item> | |||||
<el-form-item label="备注" prop="remark"> | |||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
<el-form-item label="是否启用" prop="isDisabled"> | |||||
<el-select v-model="form.isDisabled" placeholder="请选择是否启用"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_is_disabled" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
</el-form> | |||||
<div slot="footer" class="dialog-footer"> | |||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | |||||
<el-button @click="cancel">取 消</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listOperationGoods, getOperationGoods, delOperationGoods, addOperationGoods, updateOperationGoods } from "@/api/system/operationGoods"; | |||||
export default { | |||||
name: "OperationGoods", | |||||
dicts: ['zs_is_disabled', 'zs_operation_platform'], | |||||
data() { | |||||
return { | |||||
// 按钮loading | |||||
buttonLoading: false, | |||||
// 遮罩层 | |||||
loading: true, | |||||
// 选中数组 | |||||
ids: [], | |||||
// 非单个禁用 | |||||
single: true, | |||||
// 非多个禁用 | |||||
multiple: true, | |||||
// 显示搜索条件 | |||||
showSearch: true, | |||||
// 总条数 | |||||
total: 0, | |||||
// 商品配置表格数据 | |||||
operationGoodsList: [], | |||||
// 弹出层标题 | |||||
title: "", | |||||
// 是否显示弹出层 | |||||
open: false, | |||||
// 查询参数 | |||||
queryParams: { | |||||
pageNum: 1, | |||||
pageSize: 10, | |||||
goodsSkuName: undefined, | |||||
goodsSkuSn: undefined, | |||||
platform: undefined, | |||||
isDisabled: undefined | |||||
}, | |||||
// 表单参数 | |||||
form: {}, | |||||
// 表单校验 | |||||
rules: { | |||||
id: [ | |||||
{ required: true, message: "主键ID不能为空", trigger: "blur" } | |||||
], | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getList(); | |||||
}, | |||||
methods: { | |||||
/** 查询商品配置列表 */ | |||||
getList() { | |||||
this.loading = true; | |||||
listOperationGoods(this.queryParams).then(response => { | |||||
this.operationGoodsList = response.rows; | |||||
this.total = response.total; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
// 取消按钮 | |||||
cancel() { | |||||
this.open = false; | |||||
this.reset(); | |||||
}, | |||||
// 表单重置 | |||||
reset() { | |||||
this.form = { | |||||
id: undefined, | |||||
goodsSkuName: undefined, | |||||
goodsSkuSn: undefined, | |||||
goodsSkuUrl: undefined, | |||||
platform: undefined, | |||||
initPrice: undefined, | |||||
remark: undefined, | |||||
isDisabled: undefined | |||||
}; | |||||
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.loading = true; | |||||
this.reset(); | |||||
const id = row.id || this.ids | |||||
getOperationGoods(id).then(response => { | |||||
this.loading = false; | |||||
this.form = response.data; | |||||
this.open = true; | |||||
this.title = "修改商品配置"; | |||||
}); | |||||
}, | |||||
/** 提交按钮 */ | |||||
submitForm() { | |||||
this.$refs["form"].validate(valid => { | |||||
if (valid) { | |||||
this.buttonLoading = true; | |||||
if (this.form.id != null) { | |||||
updateOperationGoods(this.form).then(response => { | |||||
this.$modal.msgSuccess("修改成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} else { | |||||
addOperationGoods(this.form).then(response => { | |||||
this.$modal.msgSuccess("新增成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
/** 删除按钮操作 */ | |||||
handleDelete(row) { | |||||
const ids = row.id || this.ids; | |||||
this.$modal.confirm('是否确认删除商品配置编号为"' + ids + '"的数据项?').then(() => { | |||||
this.loading = true; | |||||
return delOperationGoods(ids); | |||||
}).then(() => { | |||||
this.loading = false; | |||||
this.getList(); | |||||
this.$modal.msgSuccess("删除成功"); | |||||
}).catch(() => { | |||||
}).finally(() => { | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
/** 导出按钮操作 */ | |||||
handleExport() { | |||||
this.download('system/operationGoods/export', { | |||||
...this.queryParams | |||||
}, `operationGoods_${new Date().getTime()}.xlsx`) | |||||
} | |||||
} | |||||
}; | |||||
</script> |
<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="module"> | |||||
<el-select v-model="queryParams.module" placeholder="请选择模块" clearable> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_module" | |||||
: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-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:operationSendconfig: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:operationSendconfig: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:operationSendconfig: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:operationSendconfig:export']" | |||||
>导出</el-button> | |||||
</el-col> | |||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||||
</el-row> | |||||
<el-table v-loading="loading" :data="operationSendconfigList" @selection-change="handleSelectionChange"> | |||||
<el-table-column type="selection" width="55" align="center" /> | |||||
<el-table-column label="主键" align="center" prop="id" v-if="true"/> | |||||
<el-table-column label="预警方式" align="center" prop="code"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_warn_types" :value="scope.row.code"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="配置" align="center" prop="configValue" /> | |||||
<el-table-column label="模块" align="center" prop="module"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_module" :value="scope.row.module"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="发送邮箱" align="center" prop="sendEmail" /> | |||||
<el-table-column label="邮箱配置id" align="center" prop="smtpId" /> | |||||
<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:operationSendconfig:edit']" | |||||
>修改</el-button> | |||||
<el-button | |||||
size="mini" | |||||
type="text" | |||||
icon="el-icon-delete" | |||||
@click="handleDelete(scope.row)" | |||||
v-hasPermi="['system:operationSendconfig: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="code"> | |||||
<el-select v-model="form.code" placeholder="请选择预警方式"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_warn_types" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="配置" prop="configValue"> | |||||
<el-input v-model="form.configValue" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
<el-form-item label="模块" prop="module"> | |||||
<el-select v-model="form.module" placeholder="请选择模块"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_module" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="发送邮箱" prop="sendEmail"> | |||||
<el-input v-model="form.sendEmail" placeholder="请输入发送邮箱" /> | |||||
</el-form-item> | |||||
<el-form-item label="邮箱配置id" prop="smtpId"> | |||||
<el-input v-model="form.smtpId" placeholder="请输入邮箱配置id" /> | |||||
</el-form-item> | |||||
</el-form> | |||||
<div slot="footer" class="dialog-footer"> | |||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | |||||
<el-button @click="cancel">取 消</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listOperationSendconfig, getOperationSendconfig, delOperationSendconfig, addOperationSendconfig, updateOperationSendconfig } from "@/api/system/operationSendconfig"; | |||||
export default { | |||||
name: "OperationSendconfig", | |||||
dicts: ['zs_operation_module', 'zs_operation_warn_types'], | |||||
data() { | |||||
return { | |||||
// 按钮loading | |||||
buttonLoading: false, | |||||
// 遮罩层 | |||||
loading: true, | |||||
// 选中数组 | |||||
ids: [], | |||||
// 非单个禁用 | |||||
single: true, | |||||
// 非多个禁用 | |||||
multiple: true, | |||||
// 显示搜索条件 | |||||
showSearch: true, | |||||
// 总条数 | |||||
total: 0, | |||||
// 发送信息配置表格数据 | |||||
operationSendconfigList: [], | |||||
// 弹出层标题 | |||||
title: "", | |||||
// 是否显示弹出层 | |||||
open: false, | |||||
// 查询参数 | |||||
queryParams: { | |||||
pageNum: 1, | |||||
pageSize: 10, | |||||
module: undefined, | |||||
}, | |||||
// 表单参数 | |||||
form: {}, | |||||
// 表单校验 | |||||
rules: { | |||||
id: [ | |||||
{ required: true, message: "主键不能为空", trigger: "blur" } | |||||
], | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getList(); | |||||
}, | |||||
methods: { | |||||
/** 查询发送信息配置列表 */ | |||||
getList() { | |||||
this.loading = true; | |||||
listOperationSendconfig(this.queryParams).then(response => { | |||||
this.operationSendconfigList = response.rows; | |||||
this.total = response.total; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
// 取消按钮 | |||||
cancel() { | |||||
this.open = false; | |||||
this.reset(); | |||||
}, | |||||
// 表单重置 | |||||
reset() { | |||||
this.form = { | |||||
id: undefined, | |||||
code: undefined, | |||||
configValue: undefined, | |||||
module: undefined, | |||||
sendEmail: undefined, | |||||
smtpId: undefined | |||||
}; | |||||
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.loading = true; | |||||
this.reset(); | |||||
const id = row.id || this.ids | |||||
getOperationSendconfig(id).then(response => { | |||||
this.loading = false; | |||||
this.form = response.data; | |||||
this.open = true; | |||||
this.title = "修改发送信息配置"; | |||||
}); | |||||
}, | |||||
/** 提交按钮 */ | |||||
submitForm() { | |||||
this.$refs["form"].validate(valid => { | |||||
if (valid) { | |||||
this.buttonLoading = true; | |||||
if (this.form.id != null) { | |||||
updateOperationSendconfig(this.form).then(response => { | |||||
this.$modal.msgSuccess("修改成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} else { | |||||
addOperationSendconfig(this.form).then(response => { | |||||
this.$modal.msgSuccess("新增成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
/** 删除按钮操作 */ | |||||
handleDelete(row) { | |||||
const ids = row.id || this.ids; | |||||
this.$modal.confirm('是否确认删除发送信息配置编号为"' + ids + '"的数据项?').then(() => { | |||||
this.loading = true; | |||||
return delOperationSendconfig(ids); | |||||
}).then(() => { | |||||
this.loading = false; | |||||
this.getList(); | |||||
this.$modal.msgSuccess("删除成功"); | |||||
}).catch(() => { | |||||
}).finally(() => { | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
/** 导出按钮操作 */ | |||||
handleExport() { | |||||
this.download('system/operationSendconfig/export', { | |||||
...this.queryParams | |||||
}, `operationSendconfig_${new Date().getTime()}.xlsx`) | |||||
} | |||||
} | |||||
}; | |||||
</script> |
<template> | |||||
<div class="app-container"> | |||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |||||
<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:operationSmtp: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:operationSmtp: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:operationSmtp: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:operationSmtp:export']" | |||||
>导出</el-button> | |||||
</el-col> | |||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||||
</el-row> | |||||
<el-table v-loading="loading" :data="operationSmtpList" @selection-change="handleSelectionChange"> | |||||
<el-table-column type="selection" width="55" align="center" /> | |||||
<el-table-column label="主键ID" align="center" prop="id" v-if="false"/> | |||||
<el-table-column label="主机" align="center" prop="host" /> | |||||
<el-table-column label="端口" align="center" prop="port" /> | |||||
<el-table-column label="用户名" align="center" prop="username" /> | |||||
<el-table-column label="密码" align="center" prop="password" /> | |||||
<el-table-column label="最大发信数" align="center" prop="maxCount" /> | |||||
<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:operationSmtp:edit']" | |||||
>修改</el-button> | |||||
<el-button | |||||
size="mini" | |||||
type="text" | |||||
icon="el-icon-delete" | |||||
@click="handleDelete(scope.row)" | |||||
v-hasPermi="['system:operationSmtp: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="host"> | |||||
<el-input v-model="form.host" placeholder="请输入主机" /> | |||||
</el-form-item> | |||||
<el-form-item label="端口" prop="port"> | |||||
<el-input v-model="form.port" placeholder="请输入端口" /> | |||||
</el-form-item> | |||||
<el-form-item label="用户名" prop="username"> | |||||
<el-input v-model="form.username" placeholder="请输入用户名" /> | |||||
</el-form-item> | |||||
<el-form-item label="密码" prop="password"> | |||||
<el-input v-model="form.password" placeholder="请输入密码" /> | |||||
</el-form-item> | |||||
<el-form-item label="最大发信数" prop="maxCount"> | |||||
<el-input v-model="form.maxCount" placeholder="请输入最大发信数" /> | |||||
</el-form-item> | |||||
</el-form> | |||||
<div slot="footer" class="dialog-footer"> | |||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | |||||
<el-button @click="cancel">取 消</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listOperationSmtp, getOperationSmtp, delOperationSmtp, addOperationSmtp, updateOperationSmtp } from "@/api/system/operationSmtp"; | |||||
export default { | |||||
name: "OperationSmtp", | |||||
data() { | |||||
return { | |||||
// 按钮loading | |||||
buttonLoading: false, | |||||
// 遮罩层 | |||||
loading: true, | |||||
// 选中数组 | |||||
ids: [], | |||||
// 非单个禁用 | |||||
single: true, | |||||
// 非多个禁用 | |||||
multiple: true, | |||||
// 显示搜索条件 | |||||
showSearch: true, | |||||
// 总条数 | |||||
total: 0, | |||||
// 邮件配置表格数据 | |||||
operationSmtpList: [], | |||||
// 弹出层标题 | |||||
title: "", | |||||
// 是否显示弹出层 | |||||
open: false, | |||||
// 查询参数 | |||||
queryParams: { | |||||
pageNum: 1, | |||||
pageSize: 10, | |||||
}, | |||||
// 表单参数 | |||||
form: {}, | |||||
// 表单校验 | |||||
rules: { | |||||
id: [ | |||||
{ required: true, message: "主键ID不能为空", trigger: "blur" } | |||||
], | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getList(); | |||||
}, | |||||
methods: { | |||||
/** 查询邮件配置列表 */ | |||||
getList() { | |||||
this.loading = true; | |||||
listOperationSmtp(this.queryParams).then(response => { | |||||
this.operationSmtpList = response.rows; | |||||
this.total = response.total; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
// 取消按钮 | |||||
cancel() { | |||||
this.open = false; | |||||
this.reset(); | |||||
}, | |||||
// 表单重置 | |||||
reset() { | |||||
this.form = { | |||||
id: undefined, | |||||
host: undefined, | |||||
port: undefined, | |||||
username: undefined, | |||||
password: undefined, | |||||
maxCount: undefined | |||||
}; | |||||
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.loading = true; | |||||
this.reset(); | |||||
const id = row.id || this.ids | |||||
getOperationSmtp(id).then(response => { | |||||
this.loading = false; | |||||
this.form = response.data; | |||||
this.open = true; | |||||
this.title = "修改邮件配置"; | |||||
}); | |||||
}, | |||||
/** 提交按钮 */ | |||||
submitForm() { | |||||
this.$refs["form"].validate(valid => { | |||||
if (valid) { | |||||
this.buttonLoading = true; | |||||
if (this.form.id != null) { | |||||
updateOperationSmtp(this.form).then(response => { | |||||
this.$modal.msgSuccess("修改成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} else { | |||||
addOperationSmtp(this.form).then(response => { | |||||
this.$modal.msgSuccess("新增成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
/** 删除按钮操作 */ | |||||
handleDelete(row) { | |||||
const ids = row.id || this.ids; | |||||
this.$modal.confirm('是否确认删除邮件配置编号为"' + ids + '"的数据项?').then(() => { | |||||
this.loading = true; | |||||
return delOperationSmtp(ids); | |||||
}).then(() => { | |||||
this.loading = false; | |||||
this.getList(); | |||||
this.$modal.msgSuccess("删除成功"); | |||||
}).catch(() => { | |||||
}).finally(() => { | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
/** 导出按钮操作 */ | |||||
handleExport() { | |||||
this.download('system/operationSmtp/export', { | |||||
...this.queryParams | |||||
}, `operationSmtp_${new Date().getTime()}.xlsx`) | |||||
} | |||||
} | |||||
}; | |||||
</script> |
<template> | |||||
<div class="app-container"> | |||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> | |||||
<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:operationWarnconfig: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:operationWarnconfig: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:operationWarnconfig: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:operationWarnconfig:export']" | |||||
>导出</el-button> | |||||
</el-col> | |||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||||
</el-row> | |||||
<el-table v-loading="loading" :data="operationWarnconfigList" @selection-change="handleSelectionChange"> | |||||
<el-table-column type="selection" width="55" align="center" /> | |||||
<el-table-column label="主键ID" align="center" prop="id" v-if="false"/> | |||||
<el-table-column label="价格变化比例阈值" align="center" prop="priceChangeThreshold" /> | |||||
<el-table-column label="监控频率" align="center" prop="monitorFrequency"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_monitor_frequency" :value="scope.row.monitorFrequency"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="预警方式" align="center" prop="warnTypes"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_warn_types" :value="scope.row.warnTypes"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="预警时间段" align="center" prop="warnTimeRange"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_warn_time_range" :value="scope.row.warnTimeRange"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="备注" align="center" prop="remark" /> | |||||
<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:operationWarnconfig:edit']" | |||||
>修改</el-button> | |||||
<el-button | |||||
size="mini" | |||||
type="text" | |||||
icon="el-icon-delete" | |||||
@click="handleDelete(scope.row)" | |||||
v-hasPermi="['system:operationWarnconfig: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="priceChangeThreshold"> | |||||
<el-input v-model="form.priceChangeThreshold" placeholder="请输入价格变化比例阈值" /> | |||||
</el-form-item> | |||||
<el-form-item label="监控频率" prop="monitorFrequency"> | |||||
<el-select v-model="form.monitorFrequency" placeholder="请选择监控频率"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_monitor_frequency" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="预警方式" prop="warnTypes"> | |||||
<el-select v-model="form.warnTypes" placeholder="请选择预警方式"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_warn_types" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="预警时间段" prop="warnTimeRange"> | |||||
<el-select v-model="form.warnTimeRange" placeholder="请选择预警时间段"> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_warn_time_range" | |||||
:key="dict.value" | |||||
:label="dict.label" | |||||
:value="dict.value" | |||||
></el-option> | |||||
</el-select> | |||||
</el-form-item> | |||||
<el-form-item label="备注" prop="remark"> | |||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
</el-form> | |||||
<div slot="footer" class="dialog-footer"> | |||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | |||||
<el-button @click="cancel">取 消</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listOperationWarnconfig, getOperationWarnconfig, delOperationWarnconfig, addOperationWarnconfig, updateOperationWarnconfig } from "@/api/system/operationWarnconfig"; | |||||
export default { | |||||
name: "OperationWarnconfig", | |||||
dicts: ['zs_operation_monitor_frequency', 'zs_operation_warn_types', 'zs_operation_warn_time_range'], | |||||
data() { | |||||
return { | |||||
// 按钮loading | |||||
buttonLoading: false, | |||||
// 遮罩层 | |||||
loading: true, | |||||
// 选中数组 | |||||
ids: [], | |||||
// 非单个禁用 | |||||
single: true, | |||||
// 非多个禁用 | |||||
multiple: true, | |||||
// 显示搜索条件 | |||||
showSearch: true, | |||||
// 总条数 | |||||
total: 0, | |||||
// 预警配置表格数据 | |||||
operationWarnconfigList: [], | |||||
// 弹出层标题 | |||||
title: "", | |||||
// 是否显示弹出层 | |||||
open: false, | |||||
// 查询参数 | |||||
queryParams: { | |||||
pageNum: 1, | |||||
pageSize: 10, | |||||
}, | |||||
// 表单参数 | |||||
form: {}, | |||||
// 表单校验 | |||||
rules: { | |||||
id: [ | |||||
{ required: true, message: "主键ID不能为空", trigger: "blur" } | |||||
], | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getList(); | |||||
}, | |||||
methods: { | |||||
/** 查询预警配置列表 */ | |||||
getList() { | |||||
this.loading = true; | |||||
listOperationWarnconfig(this.queryParams).then(response => { | |||||
this.operationWarnconfigList = response.rows; | |||||
this.total = response.total; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
// 取消按钮 | |||||
cancel() { | |||||
this.open = false; | |||||
this.reset(); | |||||
}, | |||||
// 表单重置 | |||||
reset() { | |||||
this.form = { | |||||
id: undefined, | |||||
priceChangeThreshold: undefined, | |||||
monitorFrequency: undefined, | |||||
warnTypes: undefined, | |||||
warnTimeRange: undefined, | |||||
remark: undefined | |||||
}; | |||||
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.loading = true; | |||||
this.reset(); | |||||
const id = row.id || this.ids | |||||
getOperationWarnconfig(id).then(response => { | |||||
this.loading = false; | |||||
this.form = response.data; | |||||
this.open = true; | |||||
this.title = "修改预警配置"; | |||||
}); | |||||
}, | |||||
/** 提交按钮 */ | |||||
submitForm() { | |||||
this.$refs["form"].validate(valid => { | |||||
if (valid) { | |||||
this.buttonLoading = true; | |||||
if (this.form.id != null) { | |||||
updateOperationWarnconfig(this.form).then(response => { | |||||
this.$modal.msgSuccess("修改成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} else { | |||||
addOperationWarnconfig(this.form).then(response => { | |||||
this.$modal.msgSuccess("新增成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
/** 删除按钮操作 */ | |||||
handleDelete(row) { | |||||
const ids = row.id || this.ids; | |||||
this.$modal.confirm('是否确认删除预警配置编号为"' + ids + '"的数据项?').then(() => { | |||||
this.loading = true; | |||||
return delOperationWarnconfig(ids); | |||||
}).then(() => { | |||||
this.loading = false; | |||||
this.getList(); | |||||
this.$modal.msgSuccess("删除成功"); | |||||
}).catch(() => { | |||||
}).finally(() => { | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
/** 导出按钮操作 */ | |||||
handleExport() { | |||||
this.download('system/operationWarnconfig/export', { | |||||
...this.queryParams | |||||
}, `operationWarnconfig_${new Date().getTime()}.xlsx`) | |||||
} | |||||
} | |||||
}; | |||||
</script> |
<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="预警时间"> | |||||
<el-date-picker | |||||
v-model="daterangeWarnTime" | |||||
style="width: 240px" | |||||
value-format="yyyy-MM-dd HH:mm:ss" | |||||
type="daterange" | |||||
range-separator="-" | |||||
start-placeholder="开始日期" | |||||
end-placeholder="结束日期" | |||||
:default-time="['00:00:00', '23:59:59']" | |||||
></el-date-picker> | |||||
</el-form-item> | |||||
<el-form-item label="商品名字" prop="goodsSkuName"> | |||||
<el-input | |||||
v-model="queryParams.goodsSkuName" | |||||
placeholder="请输入商品名字" | |||||
clearable | |||||
@keyup.enter.native="handleQuery" | |||||
/> | |||||
</el-form-item> | |||||
<el-form-item label="商品编号" prop="goodsSkuSn"> | |||||
<el-input | |||||
v-model="queryParams.goodsSkuSn" | |||||
placeholder="请输入商品编号" | |||||
clearable | |||||
@keyup.enter.native="handleQuery" | |||||
/> | |||||
</el-form-item> | |||||
<el-form-item label="处理状态" prop="status"> | |||||
<el-select v-model="queryParams.status" placeholder="请选择处理状态" clearable> | |||||
<el-option | |||||
v-for="dict in dict.type.zs_operation_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-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:operationWarnresult: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:operationWarnresult: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:operationWarnresult: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:operationWarnresult:export']" | |||||
>导出</el-button> | |||||
</el-col> | |||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> | |||||
</el-row> | |||||
<el-table v-loading="loading" :data="operationWarnresultList" @selection-change="handleSelectionChange"> | |||||
<el-table-column type="selection" width="55" align="center" /> | |||||
<el-table-column label="主键ID" align="center" prop="id" v-if="false"/> | |||||
<el-table-column label="预警时间" align="center" prop="warnTime" width="180"> | |||||
<template slot-scope="scope"> | |||||
<span>{{ parseTime(scope.row.warnTime, '{y}-{m}-{d}') }}</span> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="商品名字" align="center" prop="goodsSkuName" /> | |||||
<el-table-column label="商品编号" align="center" prop="goodsSkuSn" /> | |||||
<el-table-column label="基准价格" align="center" prop="initPrice" /> | |||||
<el-table-column label="当前价格" align="center" prop="curPrice" /> | |||||
<el-table-column label="价格变动幅度" align="center" prop="priceChangeRatio" /> | |||||
<el-table-column label="预警方式" align="center" prop="warnTypes"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_warn_types" :value="scope.row.warnTypes"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="通知内容/结果" align="center" prop="warnContent" /> | |||||
<el-table-column label="处理状态" align="center" prop="status"> | |||||
<template slot-scope="scope"> | |||||
<dict-tag :options="dict.type.zs_operation_status" :value="scope.row.status"/> | |||||
</template> | |||||
</el-table-column> | |||||
<el-table-column label="图片快照" align="center" prop="snapshotUrl" width="100"> | |||||
<template slot-scope="scope"> | |||||
<image-preview :src="scope.row.snapshotUrl" :width="50" :height="50"/> | |||||
</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="['system:operationWarnresult:edit']" | |||||
>修改</el-button> | |||||
<el-button | |||||
size="mini" | |||||
type="text" | |||||
icon="el-icon-delete" | |||||
@click="handleDelete(scope.row)" | |||||
v-hasPermi="['system:operationWarnresult: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 :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | |||||
<el-button @click="cancel">取 消</el-button> | |||||
</div> | |||||
</el-dialog> | |||||
</div> | |||||
</template> | |||||
<script> | |||||
import { listOperationWarnresult, getOperationWarnresult, delOperationWarnresult, addOperationWarnresult, updateOperationWarnresult } from "@/api/system/operationWarnresult"; | |||||
export default { | |||||
name: "OperationWarnresult", | |||||
dicts: ['zs_operation_warn_types', 'zs_operation_status'], | |||||
data() { | |||||
return { | |||||
// 按钮loading | |||||
buttonLoading: false, | |||||
// 遮罩层 | |||||
loading: true, | |||||
// 选中数组 | |||||
ids: [], | |||||
// 非单个禁用 | |||||
single: true, | |||||
// 非多个禁用 | |||||
multiple: true, | |||||
// 显示搜索条件 | |||||
showSearch: true, | |||||
// 总条数 | |||||
total: 0, | |||||
// 预警结果表格数据 | |||||
operationWarnresultList: [], | |||||
// 弹出层标题 | |||||
title: "", | |||||
// 是否显示弹出层 | |||||
open: false, | |||||
// 图片快照时间范围 | |||||
daterangeWarnTime: [], | |||||
// 查询参数 | |||||
queryParams: { | |||||
pageNum: 1, | |||||
pageSize: 10, | |||||
warnTime: undefined, | |||||
goodsSkuName: undefined, | |||||
goodsSkuSn: undefined, | |||||
status: undefined, | |||||
}, | |||||
// 表单参数 | |||||
form: {}, | |||||
// 表单校验 | |||||
rules: { | |||||
snapshotUrl: [ | |||||
{ required: true, message: "图片快照不能为空", trigger: "blur" } | |||||
] | |||||
} | |||||
}; | |||||
}, | |||||
created() { | |||||
this.getList(); | |||||
}, | |||||
methods: { | |||||
/** 查询预警结果列表 */ | |||||
getList() { | |||||
this.loading = true; | |||||
this.queryParams.params = {}; | |||||
if (null != this.daterangeWarnTime && '' != this.daterangeWarnTime) { | |||||
this.queryParams.params["beginWarnTime"] = this.daterangeWarnTime[0]; | |||||
this.queryParams.params["endWarnTime"] = this.daterangeWarnTime[1]; | |||||
} | |||||
listOperationWarnresult(this.queryParams).then(response => { | |||||
this.operationWarnresultList = response.rows; | |||||
this.total = response.total; | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
// 取消按钮 | |||||
cancel() { | |||||
this.open = false; | |||||
this.reset(); | |||||
}, | |||||
// 表单重置 | |||||
reset() { | |||||
this.form = { | |||||
id: undefined, | |||||
warnTime: undefined, | |||||
goodsSkuName: undefined, | |||||
goodsSkuSn: undefined, | |||||
initPrice: undefined, | |||||
curPrice: undefined, | |||||
priceChangeRatio: undefined, | |||||
warnTypes: undefined, | |||||
warnContent: undefined, | |||||
status: undefined, | |||||
snapshotUrl: undefined | |||||
}; | |||||
this.resetForm("form"); | |||||
}, | |||||
/** 搜索按钮操作 */ | |||||
handleQuery() { | |||||
this.queryParams.pageNum = 1; | |||||
this.getList(); | |||||
}, | |||||
/** 重置按钮操作 */ | |||||
resetQuery() { | |||||
this.daterangeWarnTime = []; | |||||
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.loading = true; | |||||
this.reset(); | |||||
const id = row.id || this.ids | |||||
getOperationWarnresult(id).then(response => { | |||||
this.loading = false; | |||||
this.form = response.data; | |||||
this.open = true; | |||||
this.title = "修改预警结果"; | |||||
}); | |||||
}, | |||||
/** 提交按钮 */ | |||||
submitForm() { | |||||
this.$refs["form"].validate(valid => { | |||||
if (valid) { | |||||
this.buttonLoading = true; | |||||
if (this.form.id != null) { | |||||
updateOperationWarnresult(this.form).then(response => { | |||||
this.$modal.msgSuccess("修改成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} else { | |||||
addOperationWarnresult(this.form).then(response => { | |||||
this.$modal.msgSuccess("新增成功"); | |||||
this.open = false; | |||||
this.getList(); | |||||
}).finally(() => { | |||||
this.buttonLoading = false; | |||||
}); | |||||
} | |||||
} | |||||
}); | |||||
}, | |||||
/** 删除按钮操作 */ | |||||
handleDelete(row) { | |||||
const ids = row.id || this.ids; | |||||
this.$modal.confirm('是否确认删除预警结果编号为"' + ids + '"的数据项?').then(() => { | |||||
this.loading = true; | |||||
return delOperationWarnresult(ids); | |||||
}).then(() => { | |||||
this.loading = false; | |||||
this.getList(); | |||||
this.$modal.msgSuccess("删除成功"); | |||||
}).catch(() => { | |||||
}).finally(() => { | |||||
this.loading = false; | |||||
}); | |||||
}, | |||||
/** 导出按钮操作 */ | |||||
handleExport() { | |||||
this.download('system/operationWarnresult/export', { | |||||
...this.queryParams | |||||
}, `operationWarnresult_${new Date().getTime()}.xlsx`) | |||||
} | |||||
} | |||||
}; | |||||
</script> |
/> | /> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="产品分类ID" prop="categoryId"> | |||||
<el-input | |||||
v-model="queryParams.categoryId" | |||||
placeholder="请输入产品分类ID" | |||||
clearable | |||||
@keyup.enter.native="handleQuery" | |||||
/> | |||||
</el-form-item> | |||||
<el-form-item label="产品名称" prop="name"> | <el-form-item label="产品名称" prop="name"> | ||||
<el-input | <el-input | ||||
v-model="queryParams.name" | v-model="queryParams.name" | ||||
@keyup.enter.native="handleQuery" | @keyup.enter.native="handleQuery" | ||||
/> | /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="是否启用" prop="isDisabled"> | |||||
<el-select v-model="queryParams.isDisabled" placeholder="请选择是否启用" clearable> | |||||
<el-form-item label="是否启用 " prop="isDisabled"> | |||||
<el-select v-model="queryParams.isDisabled" placeholder="请选择是否启用 " clearable> | |||||
<el-option | <el-option | ||||
v-for="dict in dict.type.zs_is_disabled" | v-for="dict in dict.type.zs_is_disabled" | ||||
:key="dict.value" | :key="dict.value" | ||||
<el-table-column label="SEO标题" align="center" prop="seoTitle" /> | <el-table-column label="SEO标题" align="center" prop="seoTitle" /> | ||||
<el-table-column label="SEO关键词" align="center" prop="seoKeyword" /> | <el-table-column label="SEO关键词" align="center" prop="seoKeyword" /> | ||||
<el-table-column label="SEO描述" align="center" prop="seoDescripetion" /> | <el-table-column label="SEO描述" align="center" prop="seoDescripetion" /> | ||||
<el-table-column label="是否启用" align="center" prop="isDisabled"> | |||||
<el-table-column label="是否启用 " align="center" prop="isDisabled"> | |||||
<template slot-scope="scope"> | <template slot-scope="scope"> | ||||
<dict-tag :options="dict.type.zs_is_disabled" :value="scope.row.isDisabled"/> | <dict-tag :options="dict.type.zs_is_disabled" :value="scope.row.isDisabled"/> | ||||
</template> | </template> | ||||
<dict-tag :options="dict.type.zs_recommend" :value="scope.row.isRecommend"/> | <dict-tag :options="dict.type.zs_recommend" :value="scope.row.isRecommend"/> | ||||
</template> | </template> | ||||
</el-table-column> | </el-table-column> | ||||
<el-table-column label="标签" align="center" prop="tag" /> | |||||
<el-table-column label="创建时间" align="center" prop="createTime" width="180"> | <el-table-column label="创建时间" align="center" prop="createTime" width="180"> | ||||
<template slot-scope="scope"> | <template slot-scope="scope"> | ||||
<span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> | <span>{{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}</span> | ||||
<el-form-item label="SEO描述" prop="seoDescripetion"> | <el-form-item label="SEO描述" prop="seoDescripetion"> | ||||
<el-input v-model="form.seoDescripetion" type="textarea" placeholder="请输入内容" /> | <el-input v-model="form.seoDescripetion" type="textarea" placeholder="请输入内容" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="是否启用" prop="isDisabled"> | |||||
<el-select v-model="form.isDisabled" placeholder="请选择是否启用"> | |||||
<el-form-item label="是否启用 " prop="isDisabled"> | |||||
<el-select v-model="form.isDisabled" placeholder="请选择是否启用 "> | |||||
<el-option | <el-option | ||||
v-for="dict in dict.type.zs_is_disabled" | v-for="dict in dict.type.zs_is_disabled" | ||||
:key="dict.value" | :key="dict.value" | ||||
></el-option> | ></el-option> | ||||
</el-select> | </el-select> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="标签" prop="tag"> | |||||
<el-input v-model="form.tag" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
</el-form> | </el-form> | ||||
<div slot="footer" class="dialog-footer"> | <div slot="footer" class="dialog-footer"> | ||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | <el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button> | ||||
pageSize: 10, | pageSize: 10, | ||||
websiteName: undefined, | websiteName: undefined, | ||||
languageCode: undefined, | languageCode: undefined, | ||||
categoryId: undefined, | |||||
name: undefined, | name: undefined, | ||||
isDisabled: undefined, | isDisabled: undefined, | ||||
}, | }, | ||||
isDisabled: undefined, | isDisabled: undefined, | ||||
platformIds: undefined, | platformIds: undefined, | ||||
isRecommend: undefined, | isRecommend: undefined, | ||||
tag: undefined, | |||||
createTime: undefined, | createTime: undefined, | ||||
updateTime: undefined, | updateTime: undefined, | ||||
createBy: undefined, | createBy: undefined, |
<el-table-column label="分类层级" align="center" prop="level" /> | <el-table-column label="分类层级" align="center" prop="level" /> | ||||
<el-table-column label="分类名称" align="center" prop="name" /> | <el-table-column label="分类名称" align="center" prop="name" /> | ||||
<el-table-column label="分类描述" align="center" prop="descripetion" /> | <el-table-column label="分类描述" align="center" prop="descripetion" /> | ||||
<el-table-column label="亮点" align="center" prop="features" /> | |||||
<el-table-column label="栏目封面" align="center" prop="cover" width="100"> | <el-table-column label="栏目封面" align="center" prop="cover" width="100"> | ||||
<template #default="scope"> | <template #default="scope"> | ||||
<image-preview :src="scope.row.cover" :width="50" :height="50"/> | <image-preview :src="scope.row.cover" :width="50" :height="50"/> | ||||
<el-form-item label="分类描述" prop="descripetion"> | <el-form-item label="分类描述" prop="descripetion"> | ||||
<el-input v-model="form.descripetion" type="textarea" placeholder="请输入内容" /> | <el-input v-model="form.descripetion" type="textarea" placeholder="请输入内容" /> | ||||
</el-form-item> | </el-form-item> | ||||
<el-form-item label="亮点" prop="features"> | |||||
<el-input v-model="form.features" type="textarea" placeholder="请输入内容" /> | |||||
</el-form-item> | |||||
<el-form-item label="栏目封面" prop="cover"> | <el-form-item label="栏目封面" prop="cover"> | ||||
<image-upload v-model="form.cover"/> | <image-upload v-model="form.cover"/> | ||||
</el-form-item> | </el-form-item> | ||||
level: null, | level: null, | ||||
name: null, | name: null, | ||||
descripetion: null, | descripetion: null, | ||||
features: null, | |||||
cover: null, | cover: null, | ||||
blankUrl: null, | blankUrl: null, | ||||
sort: null, | sort: null, |