修改样式

main
wangqiujuan0808 2024-06-26 21:37:56 +08:00
parent e2100394db
commit 45051f4836
19 changed files with 76 additions and 74 deletions

View File

@ -6,6 +6,7 @@
:before-close="closeDialog" :before-close="closeDialog"
> >
<el-form <el-form
size="large"
label-position="top" label-position="top"
:model="addForm" :model="addForm"
label-width="150px" label-width="150px"
@ -152,8 +153,8 @@
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveData"> </el-button> <el-button size="large" type="primary" @click="saveData"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>
@ -207,7 +208,7 @@ export default {
rules: { rules: {
name: [ name: [
{ required: true, message: "请输入通讯名称", trigger: "blur" }, { required: true, message: "请输入通讯名称", trigger: "blur" },
{ required: true, validator: validName, trigger: "blur" }, // { required: true, validator: validName, trigger: "blur" },
], ],
description: [{ required: true, message: "请输入驱动描述", trigger: "blur" }], description: [{ required: true, message: "请输入驱动描述", trigger: "blur" }],
type: [{ required: true, message: "请选择通讯驱动", trigger: "blur" }] type: [{ required: true, message: "请选择通讯驱动", trigger: "blur" }]

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog v-model="visible" :title="type === 'I' ? '新增模板' : '编辑模板'" width="30%" :before-close="closeDialog"> <el-dialog v-model="visible" :title="type === 'I' ? '新增模板' : '编辑模板'" width="30%" :before-close="closeDialog">
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef"> <el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large">
<el-form-item label="模板名称:" prop="name"> <el-form-item label="模板名称:" prop="name">
<el-input v-model="addForm.name" placeholder="请输入模板名称" clearable :disabled="type !== 'I'" /> <el-input v-model="addForm.name" placeholder="请输入模板名称" clearable :disabled="type !== 'I'" />
</el-form-item> </el-form-item>
@ -16,8 +16,8 @@
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveFormData"> </el-button> <el-button size="large" type="primary" @click="saveFormData"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog v-model="visible" title="点位管理" width="40%" :before-close="closeDialog"> <el-dialog v-model="visible" title="点位管理" width="40%" :before-close="closeDialog">
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef"> <el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large">
<el-form-item label="点位名称:" prop="name"> <el-form-item label="点位名称:" prop="name">
<el-input v-model="addForm.name" placeholder="请输入点位名称" clearable :disabled="type !== 'I'" /> <el-input v-model="addForm.name" placeholder="请输入点位名称" clearable :disabled="type !== 'I'" />
</el-form-item> </el-form-item>
@ -34,8 +34,8 @@
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveP"> </el-button> <el-button size="large" type="primary" @click="saveP"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -6,6 +6,7 @@
:before-close="closeDialog" :before-close="closeDialog"
> >
<el-form <el-form
size="large"
label-position="top" label-position="top"
:model="formData" :model="formData"
label-width="150px" label-width="150px"
@ -55,8 +56,8 @@
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveData"> </el-button> <el-button size="large" type="primary" @click="saveData"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -6,6 +6,7 @@
:before-close="closeDialog" :before-close="closeDialog"
> >
<el-form <el-form
size="large"
:model="addForm" :model="addForm"
label-width="100px" label-width="100px"
:rules="rules" :rules="rules"
@ -29,8 +30,8 @@
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveFormData"> </el-button> <el-button size="large" type="primary" @click="saveFormData"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog v-model="visible" title="设备管理" width="40%" :before-close="closeDialog"> <el-dialog v-model="visible" title="设备管理" width="40%" :before-close="closeDialog">
<el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef"> <el-form :model="addForm" label-width="100px" :rules="rules" ref="ruleFormRef" size="large">
<el-form-item label="设备名称:" prop="name"> <el-form-item label="设备名称:" prop="name">
<el-input v-model="addForm.name" placeholder="请输入设备名称" clearable :disabled="type!=='I'"/> <el-input v-model="addForm.name" placeholder="请输入设备名称" clearable :disabled="type!=='I'"/>
</el-form-item> </el-form-item>
@ -20,8 +20,8 @@
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveSet"> </el-button> <el-button size="large" type="primary" @click="saveSet"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -6,6 +6,7 @@
:before-close="closeDialog" :before-close="closeDialog"
> >
<el-form <el-form
size="large"
:model="formData" :model="formData"
label-width="150px" label-width="150px"
:rules="rules" :rules="rules"

View File

@ -41,7 +41,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div class="btns"> <div class="btns">
<el-button type="primary" @click="resetCount"></el-button> <el-button type="primary" size="large" @click="resetCount"></el-button>
<!-- <el-button @click="closeDialog"></el-button> --> <!-- <el-button @click="closeDialog"></el-button> -->
</div> </div>
</fieldset> </fieldset>

View File

@ -1,6 +1,6 @@
<template> <template>
<el-dialog v-model="visible" title="修改密码" width="35%" :before-close="closeDialog"> <el-dialog v-model="visible" title="修改密码" width="35%" :before-close="closeDialog">
<el-form label-position="top" :model="formData" label-width="150px" :rules="rules" ref="ruleFormRef"> <el-form size="large" label-position="top" :model="formData" label-width="150px" :rules="rules" ref="ruleFormRef">
<el-form-item label="原密码:" prop="oldPass"> <el-form-item label="原密码:" prop="oldPass">
<el-input type="password" v-model="formData.oldPass" placeholder="请输入原密码" clearable /> <el-input type="password" v-model="formData.oldPass" placeholder="请输入原密码" clearable />
</el-form-item> </el-form-item>
@ -13,8 +13,8 @@
</el-form> </el-form>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveData"> </el-button> <el-button size="large" type="primary" @click="saveData"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -8,8 +8,8 @@
</div> </div>
<template #footer> <template #footer>
<span class="dialog-footer"> <span class="dialog-footer">
<el-button @click="closeDialog"></el-button> <el-button size="large" @click="closeDialog"></el-button>
<el-button type="primary" @click="saveP"> </el-button> <el-button size="large" type="primary" @click="saveP"> </el-button>
</span> </span>
</template> </template>
</el-dialog> </el-dialog>

View File

@ -1,5 +1,5 @@
<template> <template>
<div style="background: rgb(2, 87, 2);color:#fff;"> <div style="background: #2B5451;color:#fff;">
<div class="header"> <div class="header">
<div class="left"> <div class="left">
<i v-if="hasBack" class="el-icon-back" @click="back"></i> <i v-if="hasBack" class="el-icon-back" @click="back"></i>

View File

@ -4,12 +4,12 @@
<legend class="box-ht">驱动名称</legend> <legend class="box-ht">驱动名称</legend>
<el-form label-width="130px"> <el-form label-width="130px">
<el-form-item> <el-form-item>
{{ props.formData.name }} {{ formData.name }}
</el-form-item> </el-form-item>
</el-form> </el-form>
</fieldset> </fieldset>
<!-- 1 modbus_tcp --> <!-- 1 modbus_tcp -->
<el-form :model="form" label-width="120px" :rules="rules" ref="ruleFormRef" v-if="pztypecode === 1"> <el-form size="large" :model="form" label-width="120px" :rules="rules" ref="ruleFormRef" v-if="pztypecode === 1">
<fieldset class="box2"> <fieldset class="box2">
<legend class="box-ht">通用配置</legend> <legend class="box-ht">通用配置</legend>
<el-form-item label="轮询时间" prop="polling_time"> <el-form-item label="轮询时间" prop="polling_time">
@ -30,7 +30,7 @@
</fieldset> </fieldset>
</el-form> </el-form>
<!-- 2: 'modbus_rtu' --> <!-- 2: 'modbus_rtu' -->
<el-form :model="form2" label-width="120px" :rules="rules2" ref="ruleFormRef2" v-if="pztypecode === 2"> <el-form size="large" :model="form2" label-width="120px" :rules="rules2" ref="ruleFormRef2" v-if="pztypecode === 2">
<fieldset class="box2"> <fieldset class="box2">
<legend class="box-ht">通用配置</legend> <legend class="box-ht">通用配置</legend>
<el-form-item label="轮询时间" prop="polling_time"> <el-form-item label="轮询时间" prop="polling_time">
@ -98,7 +98,7 @@
</fieldset> </fieldset>
</el-form> --> </el-form> -->
<div class="btns"> <div class="btns">
<el-button type="primary" @click="onSubmit"></el-button> <el-button type="primary" size="large" @click="onSubmit"></el-button>
</div> </div>
</el-drawer> </el-drawer>

View File

@ -17,7 +17,7 @@
</div> </div>
</div> </div>
<el-table :data="propertiesData" height="640" style="width: 100%" border stripe <el-table :data="propertiesData" height="640" style="width: 100%" border stripe
:header-cell-style="{ background: '#F6F7FC' }"> :header-cell-style="{ background: '#F6F7FC' }" size="large">
<el-table-column type="index" label="序号" width="80" align="center" /> <el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="name" label="点位名称" align="center" show-overflow-tooltip> <el-table-column prop="name" label="点位名称" align="center" show-overflow-tooltip>
</el-table-column> </el-table-column>
@ -45,12 +45,12 @@
<span>{{ scope.row.permissions == 1 ? '只读' : '可写' }}</span> <span>{{ scope.row.permissions == 1 ? '只读' : '可写' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="180" show-overflow-tooltip> <el-table-column label="操作" align="center" width="200" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="editData(scope.row)"> <el-button size="large" @click="editData(scope.row)">
编辑 编辑
</el-button> </el-button>
<el-button type="danger" @click="delData(scope.row)"> <el-button type="danger" size="large" @click="delData(scope.row)">
删除 删除
</el-button> </el-button>
</template> </template>

View File

@ -8,7 +8,7 @@
<span>设备数量{{ propertiesData.length }}</span> <span>设备数量{{ propertiesData.length }}</span>
</el-card> </el-card>
<div class="top-btn"> <div class="top-btn">
<el-button type="primary" @click="manageData"> <el-button type="primary" size="large" @click="manageData">
新增设备 新增设备
</el-button> </el-button>
<!-- <div> <!-- <div>
@ -30,10 +30,10 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="180" show-overflow-tooltip> <el-table-column label="操作" align="center" width="180" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="editData(scope.row)"> <el-button type="primary" size="large" @click="editData(scope.row)">
编辑 编辑
</el-button> </el-button>
<el-button type="danger" @click="delData(scope.row)"> <el-button type="danger" size="large" @click="delData(scope.row)">
删除 删除
</el-button> </el-button>
</template> </template>

View File

@ -46,6 +46,9 @@ s {
border: 0 !important; border: 0 !important;
background: #00AAA3 !important; background: #00AAA3 !important;
} }
.el-table--large .el-table__cell {
padding: 14px 0;
}
.mb { .mb {
margin-bottom: 10px; margin-bottom: 10px;
} }
@ -62,6 +65,7 @@ s {
margin-top: 5px; margin-top: 5px;
} }
.btns { .btns {
margin-top: 15px;
text-align: center; text-align: center;
} }
.el-drawer { .el-drawer {
@ -140,7 +144,7 @@ s {
} }
.turn { .turn {
background: rgba(15, 179, 251, 0.2); background: rgba(15, 179, 251, 0.2);
color: rgb(2, 87, 2) !important; color: #2B5451 !important;
animation: turn 1s linear infinite; animation: turn 1s linear infinite;
} }
@keyframes turn { @keyframes turn {
@ -242,7 +246,7 @@ s {
text-align: center; text-align: center;
} }
.green { .green {
background: #2b545158 !important; background: #04968a !important;
color: #000000; color: #000000;
} }
.red { .red {

View File

@ -35,8 +35,9 @@ axios.interceptors.response.use(
} }
} }
} }
console.log(123,res);
if(!res.request || res.request.responseType === 'blob') { // if(!res.request || res.request.responseType === 'blob') { //
return res; return Promise.resolve(res);
} }
// token // token
if (res.data.code === 3004) { if (res.data.code === 3004) {

View File

@ -3,8 +3,8 @@
<div class="all-content"> <div class="all-content">
<div class="time-div"> <div class="time-div">
<span>2023年08月23日 星期三 09:57:11</span> <span>2023年08月23日 星期三 09:57:11</span>
<el-button type="primary" @click="getTime"></el-button> <el-button type="primary" size="large" @click="getTime"></el-button>
<el-button type="primary" @click="getTime"></el-button> <el-button type="primary" size="large" @click="getTime"></el-button>
</div> </div>
<div class="top-div"> <div class="top-div">

View File

@ -2,10 +2,10 @@
<el-card class="content-div"> <el-card class="content-div">
<div class="all-content"> <div class="all-content">
<div class="top-div"> <div class="top-div">
<el-button type="primary" @click="addData"></el-button> <el-button type="primary" size="large" @click="addData"></el-button>
</div> </div>
<el-table :data="tableData" height="760" style="width: 100%" border stripe <el-table :data="tableData" height="760" style="width: 100%" border stripe
:header-cell-style="{ background: '#F6F7FC' }"> :header-cell-style="{ background: '#F6F7FC' }" size="large">
<el-table-column type="index" label="序号" width="80" align="center" /> <el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="name" label="模板名称" width="240" align="center" show-overflow-tooltip /> <el-table-column prop="name" label="模板名称" width="240" align="center" show-overflow-tooltip />
<el-table-column prop="type" label="模板类型" width="240" align="center" show-overflow-tooltip> <el-table-column prop="type" label="模板类型" width="240" align="center" show-overflow-tooltip>
@ -14,16 +14,16 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="point_count" label="点位数量" width="240" align="center" show-overflow-tooltip /> <el-table-column prop="point_count" label="点位数量" width="240" align="center" show-overflow-tooltip />
<el-table-column prop="description" label="模板描述" width="600" align="center" show-overflow-tooltip /> <el-table-column prop="description" label="模板描述" align="center" show-overflow-tooltip />
<el-table-column label="模板管理" align="center" show-overflow-tooltip> <el-table-column label="模板管理" align="center" show-overflow-tooltip width="300">
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="viewData(scope.row)"> <el-button type="primary" size="large" @click="viewData(scope.row)">
点位 点位
</el-button> </el-button>
<el-button type="primary" @click="editData(scope.row)"> <el-button size="large" @click="editData(scope.row)">
编辑 编辑
</el-button> </el-button>
<el-button type="danger" @click="delData(scope.row)"> <el-button type="danger" size="large" @click="delData(scope.row)">
删除 删除
</el-button> </el-button>
</template> </template>

View File

@ -2,14 +2,14 @@
<el-card class="content-div"> <el-card class="content-div">
<div class="all-content"> <div class="all-content">
<div class="top-div"> <div class="top-div">
<el-button type="primary" @click="addData"></el-button> <el-button type="primary" size="large" @click="addData"></el-button>
</div> </div>
<el-table :data="tableData" height="760" border :row-class-name="tableRowClassName" <el-table :data="tableData" height="760" border :row-class-name="tableRowClassName"
:header-cell-style="{ background: '#F6F7FC' }"> :header-cell-style="{ background: '#F6F7FC' }" size="large">
<el-table-column type="index" label="序号" width="80" align="center" /> <el-table-column type="index" label="序号" width="80" align="center" />
<el-table-column prop="name" label="通讯名称" width="200" align="center" show-overflow-tooltip /> <el-table-column prop="name" label="通讯名称" width="200" align="center" show-overflow-tooltip />
<el-table-column prop="description" label="通讯描述" width="200" align="center" show-overflow-tooltip /> <el-table-column prop="description" label="通讯描述" align="center" show-overflow-tooltip />
<el-table-column prop="drive" label="通讯驱动" width="200" align="center" show-overflow-tooltip> <el-table-column prop="drive" label="驱动类型" width="200" align="center" show-overflow-tooltip>
<template #default="scope"> <template #default="scope">
<span>{{ qudongOptions[scope.row.type] }}</span> <span>{{ qudongOptions[scope.row.type] }}</span>
</template> </template>
@ -20,36 +20,36 @@
<span> {{ txStatus[scope.row.status] }} </span> <span> {{ txStatus[scope.row.status] }} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="enable" label="启停控制" width="350" align="center"> <el-table-column prop="enable" label="启停控制" width="200" align="center">
<template #default="scope"> <template #default="scope">
<!-- 现在是 <el-tag :class="!scope.row.enable? 'stop':'start'">{{!scope.row.enable? '停用状态' : '启用状态'}} </el-tag> --> <!-- 现在是 <el-tag :class="!scope.row.enable? 'stop':'start'">{{!scope.row.enable? '停用状态' : '启用状态'}} </el-tag> -->
<el-button type="primary" size="mini" @click="changeStatus(scope.row)" v-if="!scope.row.enable"> <el-button type="primary" size="large" @click="changeStatus(scope.row)" v-if="!scope.row.enable">
启用 启用
</el-button> </el-button>
<el-button size="mini" @click="changeStatus(scope.row)" v-else> <el-button size="large" @click="changeStatus(scope.row)" v-else>
停用 停用
</el-button> </el-button>
<!-- <el-switch v-model="scope.row.enable" inline-prompt active-text="" inactive-text="" :active-value="true" <!-- <el-switch v-model="scope.row.enable" inline-prompt active-text="" inactive-text="" :active-value="true"
:inactive-value="false" active-color="#13ce66" inactive-color="#ddd" @change="changeStatus(scope.row)" /> --> :inactive-value="false" active-color="#13ce66" inactive-color="#ddd" @change="changeStatus(scope.row)" /> -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" show-overflow-tooltip> <el-table-column label="操作" align="center" show-overflow-tooltip width="450">
<template #default="scope"> <template #default="scope">
<el-button type="primary" @click="openDetails(scope.row)"> <el-button type="success" size="large" @click="openDetails(scope.row)">
详情 详情
</el-button> </el-button>
<el-button type="primary" @click="openPz(scope.row)"> <el-button type="warning" size="large" @click="openPz(scope.row)">
配置 配置
</el-button> </el-button>
<el-button type="primary" @click="editData(scope.row)"> <el-button size="large" @click="editData(scope.row)">
编辑 编辑
</el-button> </el-button>
<el-button type="danger" @click="delData(scope.row)"> <el-button type="danger" size="large" @click="delData(scope.row)">
删除 删除
</el-button> </el-button>
<el-button type="primary" @click="viewData(scope.row)"> <!-- <el-button type="primary" size="large" @click="viewData(scope.row)">
设备 设备
</el-button> </el-button> -->
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -211,6 +211,11 @@ export default {
}; };
const delData = (item) => { const delData = (item) => {
if(item.status == 2) {
ElMessage.warning("无法删除正在运行的驱动,请先手动停止后再删除");
return;
}
ElMessageBox.confirm("确定删除该数据?", "提示", { ElMessageBox.confirm("确定删除该数据?", "提示", {
confirmButtonText: "确定", confirmButtonText: "确定",
cancelButtonText: "取消", cancelButtonText: "取消",
@ -218,7 +223,7 @@ export default {
}) })
.then(async () => { .then(async () => {
let param = { let param = {
name: state.formData.name name: item.name
} }
const res = await infoApi.delTx(param); const res = await infoApi.delTx(param);
if (res.code == 0) { if (res.code == 0) {
@ -268,20 +273,9 @@ export default {
} }
const getTextColor = (type) => {
if(type == 1) {
return ''
}
if(type == 2) {
return 'green'
}
if(type == 3) {
return 'red'
}
}
const tableRowClassName = ({ row, rowIndex }) => { const tableRowClassName = ({ row, rowIndex }) => {
if(row.status == 1) { if(row.status == 1) {
return 'green' return ''
} }
if(row.status == 2) { if(row.status == 2) {
return 'green' return 'green'
@ -310,7 +304,6 @@ export default {
openPz, openPz,
openDetails, openDetails,
viewData, viewData,
getTextColor,
tableRowClassName tableRowClassName
}; };
}, },