Commit edccefc6 authored by 王晓旭's avatar 王晓旭

一些优化项

parent 918125bb
...@@ -144,7 +144,7 @@ export default { ...@@ -144,7 +144,7 @@ export default {
methods: { methods: {
formatterDate, formatterDate,
contentRender(h, params) { contentRender(h, params) {
return <img src={require("../assets/images/d.png")} />; return <img style="width: 36px;height: 50px;" src={require("../assets/images/red.png")} />;
}, },
getDeviceDetial() { getDeviceDetial() {
this.$emit("choose", this.info, (val) => { this.$emit("choose", this.info, (val) => {
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
@change="item.change" @change="item.change"
@clear="item.clear" @clear="item.clear"
v-if="item.type === 'select'" v-if="item.type === 'select'"
:placeholder="'请选择'+item.label"
> >
<el-option <el-option
label="全部" label="全部"
......
...@@ -290,6 +290,9 @@ export default { ...@@ -290,6 +290,9 @@ export default {
</script> </script>
<style lang="less"> <style lang="less">
.table-body{
margin-left: 30px;
}
@media screen and (max-width: 800px) { @media screen and (max-width: 800px) {
.layout-table { .layout-table {
.table-head { .table-head {
...@@ -313,6 +316,7 @@ export default { ...@@ -313,6 +316,7 @@ export default {
} }
.layout-table { .layout-table {
.table-head { .table-head {
margin-left: 10px;
margin-bottom: 10px; margin-bottom: 10px;
//padding-bottom: 12px; //padding-bottom: 12px;
// padding-top: 7px; // padding-top: 7px;
......
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig"> <LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
<el-button slot="table-head-left2" style="margin-left: 10px" type="primary" size="mini" @click="doExport" <el-button slot="table-head-left2" type="primary" size="mini" @click="doExport"
:disabled="isExport">导出</el-button> :disabled="isExport">导出</el-button>
</LayoutTable> </LayoutTable>
......
...@@ -49,6 +49,18 @@ ...@@ -49,6 +49,18 @@
return { return {
config: { config: {
search: [ search: [
{
name: "appCode",
type: "text",
label: "应用编码",
fuzzy: true,
},
{
name: "appName",
type: "text",
label: "应用名称",
fuzzy: true,
},
], ],
columns: [ columns: [
{type: "selection", width: 60}, {type: "selection", width: 60},
......
<template>
<!-- 弹出框表单 -->
<el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-row>
<!-- <Field
:span="22"
label="所属平台"
prop="platformId"
v-model="form.platformId"
:enumData="dict.platformId"
type="select"
placeholder="请输入产品名称,名称唯一"
/> -->
<Field
:span="22"
label="产品名称"
prop="productName"
v-model="form.productName"
placeholder="请输入产品名称,名称唯一"
/>
<Field
:span="22"
label="告警设备"
prop="deviceName"
v-model="form.deviceName"
/>
<Field
:span="22"
label="告警时间"
prop="alarmTime"
v-model="time"
/>
<Field
:span="22"
label="告警内容"
prop="alarmType"
v-model="alarmType"
/>
<Field
:span="22"
label="告警程度"
prop="alarmLevel"
v-model="alarmLevel"
/>
<Field
:span="22"
label="告警状态"
prop="alarmStatus"
v-model="alarmStatus"
/>
<Field
:span="22"
label="接收人员"
prop="alarmReceivePersonnel"
v-model="form.alarmReceivePersonnel"
/>
<Field
:span="22"
label="告警详情"
prop="alarmContent"
v-model="form.alarmContent"
type="textarea"
/>
<!-- <Field
:span="22"
label="产品编码"
prop="productCode"
v-model="form.productCode"
placeholder="请输入产品编码"
/> -->
<!-- <Field
:span="22"
label="默认首页"
prop="skinId"
v-model="form.skinId"
@change="skinSelect"
:enumData="dict.skinProductCodeMap[form.productCode]"
type="select"
placeholder="请输入产品名称,名称唯一"
/> -->
<!-- <Field
:span="22"
v-if="form.productCode == 'pjq'"
label="事件地址"
prop="eventUrl"
v-model="form.eventUrl"
placeholder="请输入事件地址"
/> -->
</el-row>
<!-- <form-buttons @submit="submitForm" noCancelBtn /> -->
</el-form>
</el-drawer>
</template>
<script>
import form from "@/assets/mixins/formdialog";
import { formatterDate } from "@/assets/utils/index";
export default {
name: "DeviceAlarmDetail",
mixins: [form],
components: {},
created() {
this.changePath("product");
},
data() {
return {
alarmLevel:'',
alarmStatus:'',
time:'',
// 遮罩层
loading: true,
// 弹出层标题
title: "产品",
// 是否显示弹出层
open: false,
direction: "rtl",
toString: ["platformId", "skinId"],
toDate: [],
// 表单校验
rules: {
productName: [
{
required: true,
message: "请输入产品名称,名称唯一",
trigger: "blur",
},
{ max: 20, message: "最多只能录入20个字符", trigger: "blur" },
],
productCode: [
{ required: true, message: "请输入产品编码", trigger: "blur" },
{ max: 256, message: "最多只能录入256个字符", trigger: "blur" },
],
homeUrl: [
{ required: true, message: "请输入首页地址", trigger: "blur" },
{ max: 512, message: "最多只能录入512个字符", trigger: "blur" },
],
},
};
},
watch:{
'form.alarmTime'(newval){
this.time = this.formatterDate(parseInt(newval))
},
"form.alarmLevel"(newval){
this.alarmLevel = this.dict.alarmLevel[newval]
},
"form.alarmStatus"(newval){
this.alarmStatus = this.dict.alarmStatus[newval]
},
"form.alarmType"(newval){
this.alarmType = this.dict.alarmType[newval]
},
},
methods: {
formatterDate,
skinSelect(val) {
this.form.skinName =
this.dict.skinProductCodeMap[this.form.productCode][val];
},
/** 编辑 */
edit(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "product/edit";
this.getData();
this.pageInfo.type = "edit";
this.title = "修改产品";
},
/** 新增 */
add(row) {
this.reset();
this.urls.currUrl = "product/add";
this.getData();
this.pageInfo.type = "add";
this.title = "新增产品";
},
/** 查看*/
view(row) {
this.reset();
this.query = { id: row.id };
this.urls.currUrl = "device/alarm/info/view";
this.getData();
this.pageInfo.type = "view";
this.title = "详情";
},
/**取消按钮 */
cancel() {
this.open = false;
},
/**获取数据后弹框 */
afterRender(data) {
this.open = true;
},
afterSubmit(data) {
this.open = false;
this.$emit("ok");
},
// 表单重置
reset() {
this.form = {
platformId: null,
productName: "",
productCode: "",
productRemark: "",
};
this.resetForm("form");
},
resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
},
},
};
</script>
<template> <template>
<div class="page"> <div class="page">
<LayoutTable :data="tableData" notAdd notDel :config="tableConfig"> <LayoutTable :data="tableData" notAdd notDel :config="tableConfig">
<el-button slot="table-head-left2" style="margin-left: 10px" type="primary" class="addclass" size="mini" @click="doExport" <el-button slot="table-head-left2" type="primary" class="addclass" size="mini" @click="doExport"
:disabled="isExport">导出</el-button> :disabled="isExport">导出</el-button>
<el-tag slot="table-head-row2-left" size="mini" style="margin: 10px">告警次数:{{ tableData.totalCount }}</el-tag> <el-tag slot="table-head-row2-left" size="mini" style="margin: 10px">告警次数:{{ tableData.totalCount }}</el-tag>
...@@ -16,13 +16,15 @@ ...@@ -16,13 +16,15 @@
}}</el-tag> }}</el-tag>
</LayoutTable> </LayoutTable>
<dialog-show ref="dialogform" @ok="getData" /> <!-- <dialog-show ref="dialogform" @ok="getData" /> -->
<drawer-show ref="drawerform" @ok="getData" />
</div> </div>
</template> </template>
<script> <script>
/** 表单弹出框模式需引入 */ /** 表单弹出框模式需引入 */
import dialogShow from "./dialogshow"; import drawerShow from "./drawershow";
// import dialogShow from "./dialogshow";
import table from "@/assets/mixins/table"; import table from "@/assets/mixins/table";
export default { export default {
name: "DeviceAlarmInfo", name: "DeviceAlarmInfo",
...@@ -32,7 +34,7 @@ export default { ...@@ -32,7 +34,7 @@ export default {
default: null, default: null,
}, },
}, },
components: { dialogShow }, components: { drawerShow },
mixins: [table], mixins: [table],
created() { created() {
if (this.queryIn && this.queryIn.alarmDevice) { if (this.queryIn && this.queryIn.alarmDevice) {
...@@ -53,9 +55,10 @@ export default { ...@@ -53,9 +55,10 @@ export default {
this.$refs.dialogform.edit(row); this.$refs.dialogform.edit(row);
}, },
/** 重写查看方法 */ /** 重写查看方法 */
// toView(row) { toView(row) {
// this.$refs.dialogform.view(row); // this.$refs.dialogform.view(row);
// }, this.$refs.drawerform.view(row);
},
/** 导出Excel */ /** 导出Excel */
doExport() { doExport() {
this.isExport = true; this.isExport = true;
...@@ -127,6 +130,12 @@ export default { ...@@ -127,6 +130,12 @@ export default {
prop: "alarmDevice", prop: "alarmDevice",
formatter: this.formatter, formatter: this.formatter,
}, },
{
label: "设备类型",
align: "center",
prop: "productName",
formatter: this.formatter,
},
{ {
label: "告警内容", label: "告警内容",
align: "center", align: "center",
...@@ -152,6 +161,21 @@ export default { ...@@ -152,6 +161,21 @@ export default {
prop: "alarmStatus", prop: "alarmStatus",
formatter: this.formatter, formatter: this.formatter,
}, },
{
label: "操作",
align: "center",
width: 240,
formatter: (row) => {
return (
<table-buttons
row={row}
noEdit={true}
noDel={true}
onView={this.toView}
/>
);
},
},
], ],
}, },
}; };
......
...@@ -44,13 +44,13 @@ export default { ...@@ -44,13 +44,13 @@ export default {
name: "deviceCode", name: "deviceCode",
type: "text", type: "text",
label: "设备编号", label: "设备编号",
fuzzy: true, // fuzzy: true,
}, },
{ {
name: "messageHead", name: "messageHead",
type: "text", type: "text",
label: "业务标识", label: "业务标识",
fuzzy: true, // fuzzy: true,
}, },
{ {
name: "logType", name: "logType",
......
<template> <template>
<!-- 弹出框表单 --> <!-- 抽屉表单 -->
<el-dialog :title="title" :visible.sync="open" width="90%" append-to-body> <el-drawer
:title="title"
:visible.sync="open"
:direction="direction"
size="50%"
>
<el-form ref="form" :model="form" :rules="rules" label-width="160px"> <el-form ref="form" :model="form" :rules="rules" label-width="160px">
<el-row> <el-row>
<Field :span="20" label="模块名称" prop="moduleName" v-model="form.moduleName" type="textarea" placeholder="请输入模块名称"/> <Field :span="20" label="模块名称" prop="moduleName" v-model="form.moduleName" type="textarea" placeholder="请输入模块名称"/>
<Field :span="20" label="模块消息编码" prop="moduleMsgCode" v-model="form.moduleMsgCode" type="textarea" placeholder="请输入模块消息编码,与上报消息头编码一致,唯一"/> <Field :span="20" label="模块消息编码" prop="moduleMsgCode" v-model="form.moduleMsgCode" type="textarea" placeholder="请输入模块消息编码,与上报消息头编码一致,唯一"/>
</el-row> </el-row>
<form-buttons @submit="submitForm" noCancelBtn />
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> </el-drawer>
<el-button type="primary" class="addclass" v-if="pageInfo.type !== 'view'" @click="submitForm">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template> </template>
<script> <script>
...@@ -26,6 +28,7 @@ ...@@ -26,6 +28,7 @@
}, },
data() { data() {
return { return {
direction: "rtl",
// 遮罩层 // 遮罩层
loading: true, loading: true,
// 弹出层标题 // 弹出层标题
......
...@@ -56,7 +56,13 @@ export default { ...@@ -56,7 +56,13 @@ export default {
data() { data() {
return { return {
config: { config: {
search: [], search: [
{
name: "productName",
type: "text",
label: "产品",
fuzzy: true,
},],
columns: [ columns: [
{ type: "selection", align: "center", width: 60 }, { type: "selection", align: "center", width: 60 },
{ type: "index", align: "center", label: "序号", width: 50 }, { type: "index", align: "center", label: "序号", width: 50 },
......
...@@ -32,7 +32,11 @@ export default { ...@@ -32,7 +32,11 @@ export default {
data() { data() {
return { return {
config: { config: {
search: [], search: [{
name: "moduleName",
type: "text",
label: "模块名称",
}],
columns: [ columns: [
{ type: "selection", align: "center", width: 60 }, { type: "selection", align: "center", width: 60 },
{ type: "index", align: "center", label: "序号", width: 50 }, { type: "index", align: "center", label: "序号", width: 50 },
......
...@@ -43,7 +43,7 @@ export default { ...@@ -43,7 +43,7 @@ export default {
name: "firmName", name: "firmName",
type: "text", type: "text",
label: "设备生产厂商名称", label: "设备生产厂商名称",
fuzzy: true, // fuzzy: true,
}, },
], ],
columns: [ columns: [
......
...@@ -32,7 +32,15 @@ export default { ...@@ -32,7 +32,15 @@ export default {
data() { data() {
return { return {
config: { config: {
search: [], search: [{
name: "platformName",
type: "text",
label: "平台名称",
},{
name: "platformSn",
type: "text",
label: "平台编码",
}],
columns: [ columns: [
{ {
type: "selection", type: "selection",
......
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
/> />
</el-row> </el-row>
<form-buttons @submit="submitForm" noCancelBtn /> <form-buttons @submit="submitForm" noCancelBtn v-if="pageInfo.type != 'view'"/>
</el-form> </el-form>
</el-drawer> </el-drawer>
</template> </template>
......
...@@ -50,6 +50,12 @@ ...@@ -50,6 +50,12 @@
return { return {
config: { config: {
search: [ search: [
{
name: "productName",
type: "text",
label: "产品类型",
fuzzy: true,
},
], ],
columns: [ columns: [
{type: "selection", width: 60}, {type: "selection", width: 60},
......
...@@ -18,11 +18,13 @@ export default { ...@@ -18,11 +18,13 @@ export default {
name: "loginName", name: "loginName",
type: "text", type: "text",
label: "登录名", label: "登录名",
fuzzy: true,
}, },
{ {
name: "requestUrl", name: "requestUrl",
type: "text", type: "text",
label: "请求地址", label: "请求地址",
fuzzy: true,
}, },
], ],
columns: [ columns: [
......
...@@ -150,9 +150,9 @@ export default { ...@@ -150,9 +150,9 @@ export default {
reserveSelection: true, reserveSelection: true,
width: 60, width: 60,
}, },
{ type: "index", label: "序号", align: "center", width: 50 },
{ {
width: 60, width: 60,
label: "树形展开",
align: "center", align: "center",
formatter: (row) => { formatter: (row) => {
const icon = const icon =
...@@ -170,6 +170,7 @@ export default { ...@@ -170,6 +170,7 @@ export default {
); );
}, },
}, },
{ type: "index", label: "序号", align: "center", width: 50 },
{ {
prop: "id", prop: "id",
align: "center", align: "center",
......
...@@ -33,6 +33,7 @@ export default { ...@@ -33,6 +33,7 @@ export default {
name: "name", name: "name",
type: "text", type: "text",
label: "参数名称", label: "参数名称",
fuzzy: true,
}, },
], ],
columns: [ columns: [
......
...@@ -35,6 +35,7 @@ export default { ...@@ -35,6 +35,7 @@ export default {
name: "name", name: "name",
type: "text", type: "text",
label: "资源名称", label: "资源名称",
fuzzy: true,
}, },
{ {
name: "authType", name: "authType",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment