新增字段

This commit is contained in:
haozq 2024-10-14 09:36:10 +08:00
parent 7cdb18b531
commit 9397d3dbf1
3 changed files with 92 additions and 73 deletions

View File

@ -16,7 +16,7 @@ router.beforeEach((to, from, next) => {
to.meta.title && store.dispatch('settings/setTitle', to.meta.title) to.meta.title && store.dispatch('settings/setTitle', to.meta.title)
/* has token*/ /* has token*/
if (to.path === '/login') { if (to.path === '/login') {
next({ path: '/' }) next({ path: '/zhgd-ht/' })
NProgress.done() NProgress.done()
} else if (whiteList.indexOf(to.path) !== -1) { } else if (whiteList.indexOf(to.path) !== -1) {
next() next()
@ -34,7 +34,7 @@ router.beforeEach((to, from, next) => {
}).catch(err => { }).catch(err => {
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
Message.error(err) Message.error(err)
next({ path: '/zhgd-ht' }) next({ path: '/zhgd-ht/' })
}) })
}) })
} else { } else {

View File

@ -136,7 +136,7 @@ service.interceptors.response.use(res => {
MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => { MessageBox.confirm('登录状态已过期,您可以继续留在该页面,或者重新登录', '系统提示', { confirmButtonText: '重新登录', cancelButtonText: '取消', type: 'warning' }).then(() => {
isRelogin.show = false; isRelogin.show = false;
store.dispatch('LogOut').then(() => { store.dispatch('LogOut').then(() => {
location.href = '/zhgd-ht'; location.href = '/zhgd-ht/';
}) })
}).catch(() => { }).catch(() => {
isRelogin.show = false; isRelogin.show = false;

View File

@ -48,7 +48,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -70,10 +70,10 @@
v-hasPermi="['basic:bracelet:export']" v-hasPermi="['basic:bracelet:export']"
>导出数据</el-button> >导出数据</el-button>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loading" :data="braceletList" ref="multipleTableSh" row-key="shId" @selection-change="handleSelectionChangeSh" @select="handlerSelectSh" @select-all="handlerSelectAllSh"> <el-table v-loading="loading" :data="braceletList" ref="multipleTableSh" row-key="shId" @selection-change="handleSelectionChangeSh" @select="handlerSelectSh" @select-all="handlerSelectAllSh">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" /> <el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
@ -86,7 +86,7 @@
<el-table-column label="所属手环箱" align="center" prop="shboxName" sortable> <el-table-column label="所属手环箱" align="center" prop="shboxName" sortable>
<template slot-scope="scope"> <template slot-scope="scope">
<div v-if="scope.row.shboxName!=boxName" > <div v-if="scope.row.shboxName!=boxName" >
{{ scope.row.shboxName }} {{ scope.row.shboxName }}
<el-button <el-button
size="mini" size="mini"
type="text" type="text"
@ -142,7 +142,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="total>0" v-show="total>0"
:total="total" :total="total"
@ -150,18 +150,25 @@
:limit.sync="queryParams.pageSize" :limit.sync="queryParams.pageSize"
@pagination="getList" @pagination="getList"
/> />
<!-- 手环弹窗 --> <!-- 手环弹窗 -->
<el-dialog :title="title" :visible.sync="showsh" width="600px" height="600px" append-to-body @close="cancel"> <el-dialog :title="title" :visible.sync="showsh" width="600px" height="600px" append-to-body @close="cancel">
<el-form ref="queryshCode" :model="queryshCode" :rules="rules" label-width="100px" @submit.native.prevent> <el-form ref="queryshCode" :model="queryshCode" :rules="rules" label-width="100px" @submit.native.prevent>
<el-form-item label="手环编码" prop="shCode"> <el-form-item label="手环编码" prop="shCode">
<el-input <el-input
v-model="queryshCode.shCode" v-model="queryshCode.shCode"
placeholder="请输入手环编码" placeholder="请输入手环编码"
maxlength="50" maxlength="50"
/> />
</el-form-item> </el-form-item>
</el-form> <el-form-item label="手环名称" prop="shName">
<el-input
v-model="queryshCode.shName"
placeholder="请输入手环名称"
maxlength="32"
/>
</el-form-item>
</el-form>
<el-table v-loading="loadingTwo" :data="shboxList" width="600px" height = "400px" > <el-table v-loading="loadingTwo" :data="shboxList" width="600px" height = "400px" >
<el-table-column label="手环箱id" align="center" prop="shboxId" v-if="false" /> <el-table-column label="手环箱id" align="center" prop="shboxId" v-if="false" />
<el-table-column label="手环箱名称" align="center" prop="shboxName" /> <el-table-column label="手环箱名称" align="center" prop="shboxName" />
@ -170,7 +177,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span> <span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="选择" align="center" class-name="small-padding fixed-width"> <el-table-column label="选择" align="center" class-name="small-padding fixed-width">
@ -217,7 +224,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span> <span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="选择" align="center" class-name="small-padding fixed-width"> <el-table-column label="选择" align="center" class-name="small-padding fixed-width">
@ -244,12 +251,19 @@
<el-dialog :title="title" :visible.sync="showShEdit" width="600px" height="600px" append-to-body @close="cancelEdit"> <el-dialog :title="title" :visible.sync="showShEdit" width="600px" height="600px" append-to-body @close="cancelEdit">
<el-form :model="queryshEdit" ref="queryshEdit" :rules="rules" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryshEdit" ref="queryshEdit" :rules="rules" size="small" :inline="true" v-show="showSearch" label-width="100px">
<el-form-item label="手环编码" prop="shCode"> <el-form-item label="手环编码" prop="shCode">
<el-input <el-input
v-model="queryshEdit.shCode" v-model="queryshEdit.shCode"
placeholder="请输入手环编码" placeholder="请输入手环编码"
maxlength="50" maxlength="50"
/> />
</el-form-item> </el-form-item>
<el-form-item label="手环名称" prop="shName">
<el-input
v-model="queryshEdit.shName"
placeholder="请输入手环名称"
maxlength="20"
/>
</el-form-item>
</el-form> </el-form>
<el-table v-loading="loadingFour" :data="shboxList" width="600px" height = "400px" > <el-table v-loading="loadingFour" :data="shboxList" width="600px" height = "400px" >
<el-table-column label="手环箱id" align="center" prop="shboxId" v-if="false" /> <el-table-column label="手环箱id" align="center" prop="shboxId" v-if="false" />
@ -259,7 +273,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span> <span style="color: green;">{{ scope.row.shboxBindNum }}/</span><span>{{ scope.row.shboxCapacity }}</span>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="选择" align="center" class-name="small-padding fixed-width"> <el-table-column label="选择" align="center" class-name="small-padding fixed-width">
@ -355,7 +369,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="totalTwo>0" v-show="totalTwo>0"
:total="totalTwo" :total="totalTwo"
@ -376,39 +390,39 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row :gutter="24"> <!-- <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="设备采集值" prop="dataVal"> <el-form-item label="设备采集值" prop="dataVal">
<el-input v-model="formThree.dataVal" placeholder="请输入设备采集值" maxlength="20"/> <el-input v-model="formThree.dataVal" placeholder="请输入设备采集值" maxlength="20"/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> --> </el-row> -->
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="设备值单位" prop="dataUnit"> <el-form-item label="设备值单位" prop="dataUnit">
<el-input v-model.number="formThree.dataUnit" placeholder="请输入设备值单位" maxlength="20"> <el-input v-model.number="formThree.dataUnit" placeholder="请输入设备值单位" maxlength="20">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="级联编码" prop="dataCode"> <el-form-item label="级联编码" prop="dataCode">
<el-input v-model.number="formThree.dataCode" placeholder="请输入级联编码" maxlength="20"> <el-input v-model.number="formThree.dataCode" placeholder="请输入级联编码" maxlength="20">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="数据类型" prop="dataType"> <el-form-item label="数据类型" prop="dataType">
<el-input v-model.number="formThree.dataType" placeholder="请输入数据类型" maxlength="20"> <el-input v-model.number="formThree.dataType" placeholder="请输入数据类型" maxlength="20">
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
<!-- <el-row :gutter="24"> <!-- <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="数据采集时间" prop="dataTime"> <el-form-item label="数据采集时间" prop="dataTime">
<el-date-picker <el-date-picker
@ -418,10 +432,10 @@
value-format="yyyy-MM-dd" value-format="yyyy-MM-dd"
type="date"> type="date">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> --> </el-row> -->
<el-row :gutter="24"> <el-row :gutter="24">
<el-col :span="20"> <el-col :span="20">
<el-form-item label="图标 " label-width="120px"> <el-form-item label="图标 " label-width="120px">
<el-upload <el-upload
@ -440,8 +454,8 @@
<i class="el-icon-plus avatar-uploader-icon"></i> <i class="el-icon-plus avatar-uploader-icon"></i>
</el-upload> </el-upload>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFormAttribute"> </el-button> <el-button type="primary" @click="submitFormAttribute"> </el-button>
@ -496,7 +510,7 @@
<el-button icon="el-icon-refresh" size="mini" @click="resetQueryTwo">重置</el-button> <el-button icon="el-icon-refresh" size="mini" @click="resetQueryTwo">重置</el-button>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5"> <el-col :span="1.5">
<el-button <el-button
@ -512,10 +526,10 @@
<!-- 二维码导出组件按钮在内部传选中数组 currentSelection:选中数组 clearCheck:清空选中状态--> <!-- 二维码导出组件按钮在内部传选中数组 currentSelection:选中数组 clearCheck:清空选中状态-->
<qrCodeUpload :checkboxModel.sync="currentSelection" @clearCheck="clearCheck"/> <qrCodeUpload :checkboxModel.sync="currentSelection" @clearCheck="clearCheck"/>
</el-col> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getboxList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getboxList"></right-toolbar>
</el-row> </el-row>
<el-table v-loading="loadingFive" :data="shboxallList" ref="multipleTable" row-key="shboxCode" @selection-change="handleSelectionChangeImag" @select="handlerSelect" @select-all="handlerSelectAll"> <el-table v-loading="loadingFive" :data="shboxallList" ref="multipleTable" row-key="shboxCode" @selection-change="handleSelectionChangeImag" @select="handlerSelect" @select-all="handlerSelectAll">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true" /> <el-table-column type="selection" width="55" align="center" :reserve-selection="true" />
<el-table-column label="序号" align="center" width="80" type="index"> <el-table-column label="序号" align="center" width="80" type="index">
@ -572,7 +586,7 @@
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination <pagination
v-show="totalTwo>0" v-show="totalTwo>0"
:total="totalTwo" :total="totalTwo"
@ -580,7 +594,7 @@
:limit.sync="queryShbox.pageSize" :limit.sync="queryShbox.pageSize"
@pagination="getboxList" @pagination="getboxList"
/> />
<!-- 手环箱管理页面绑定手环弹窗 --> <!-- 手环箱管理页面绑定手环弹窗 -->
<el-dialog :title="title" :visible.sync="showShall" width="1000px" height="1000px" append-to-body @close="cancelOne"> <el-dialog :title="title" :visible.sync="showShall" width="1000px" height="1000px" append-to-body @close="cancelOne">
<el-form :model="queryShBoxall" ref="queryFormThree" size="small" :inline="true" v-show="showSearch" label-width="100px"> <el-form :model="queryShBoxall" ref="queryFormThree" size="small" :inline="true" v-show="showSearch" label-width="100px">
@ -675,7 +689,7 @@
</el-table> </el-table>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="cancelBindTemp"> </el-button> <el-button @click="cancelBindTemp"> </el-button>
<el-button <el-button
type="primary" type="primary"
plain plain
icon="el-icon-plus" icon="el-icon-plus"
@ -716,9 +730,9 @@
<el-input v-model.number="formTwo.shboxCapacity" placeholder="请输入手环箱容量" maxlength="10"> <el-input v-model.number="formTwo.shboxCapacity" placeholder="请输入手环箱容量" maxlength="10">
<template slot="append"></template> <template slot="append"></template>
</el-input> </el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitFormbox"> </el-button> <el-button type="primary" @click="submitFormbox"> </el-button>
@ -752,7 +766,7 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
</template> </template>
<script> <script>
import { listBracelet, listShboxall,delShById, exportSh,listShbox,addSh,listShboxBind,addShBind,delSh,editSh,delDeviceAttribute,exportShSome, import { listBracelet, listShboxall,delShById, exportSh,listShbox,addSh,listShboxBind,addShBind,delSh,editSh,delDeviceAttribute,exportShSome,
getBoxInfo,editBox,addBox,delShboxById,listShBind,listShNoBind,bindSh,getBoxNewInfo,addAttribute,listDeviceAttribute,getAttributeInfo,editAttribute} from "@/api/base/bracelet"; getBoxInfo,editBox,addBox,delShboxById,listShBind,listShNoBind,bindSh,getBoxNewInfo,addAttribute,listDeviceAttribute,getAttributeInfo,editAttribute} from "@/api/base/bracelet";
@ -873,6 +887,7 @@
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
shCode: undefined, shCode: undefined,
shName: undefined,
shboxName: undefined, shboxName: undefined,
shboxId: undefined, shboxId: undefined,
}, },
@ -906,6 +921,7 @@
pageSize: 10, pageSize: 10,
shId: undefined, shId: undefined,
shCode: undefined, shCode: undefined,
shName:undefined,
shboxName: undefined, shboxName: undefined,
shboxId: undefined, shboxId: undefined,
}, },
@ -946,7 +962,7 @@
showShall:false, showShall:false,
openbox:false, openbox:false,
openSh:false, openSh:false,
showAttribute:false, showAttribute:false,
@ -987,6 +1003,9 @@
shCode: [ shCode: [
{ required: true, message: "手环编码不能为空", trigger: "blur" } { required: true, message: "手环编码不能为空", trigger: "blur" }
], ],
shName: [
{ required: true, message: "手环名称不能为空", trigger: "blur" }
],
}, },
rulesbox: { rulesbox: {
shboxName: [ shboxName: [
@ -1157,7 +1176,7 @@
}); });
}, },
selectAll() { selectAll() {
this.$refs.MainTable.clearSelection(); this.$refs.MainTable.clearSelection();
}, },
@ -1220,7 +1239,7 @@
resetAdd() { resetAdd() {
this.queryshCode.shCode = ''; this.queryshCode.shCode = '';
this.resetForm("queryshCode"); this.resetForm("queryshCode");
}, },
// //
resetEdit() { resetEdit() {
this.queryshEdit.shCode = {}; this.queryshEdit.shCode = {};
@ -1258,12 +1277,12 @@
this.queryShBoxall.pageNum = 1; this.queryShBoxall.pageNum = 1;
this.queryShBoxall.shboxId = this.queryShBoxall.shboxId; this.queryShBoxall.shboxId = this.queryShBoxall.shboxId;
this.getListBoxall(); this.getListBoxall();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQuery() { resetQuery() {
this.resetForm("queryFormOne"); this.resetForm("queryFormOne");
this.currentSelectionSh = [];// this.currentSelectionSh = [];//
this.handleQuery(); this.handleQuery();
}, },
@ -1273,7 +1292,7 @@
this.handleQueryShbox(); this.handleQueryShbox();
}, },
/** 重置按钮操作 */ /** 重置按钮操作 */
resetQueryThree() { resetQueryThree() {
this.resetForm("queryFormThree"); this.resetForm("queryFormThree");
@ -1443,7 +1462,7 @@
this.showAttribute = true; this.showAttribute = true;
}, },
/** 修改按钮操作 */ /** 修改按钮操作 */
handleUpdateAttribute(row) { handleUpdateAttribute(row) {
this.resetAttribute(); this.resetAttribute();
@ -1465,7 +1484,7 @@
this.showAttribute = true; this.showAttribute = true;
this.title = "修改设备属性"; this.title = "修改设备属性";
},100) },100)
}); });
}, },
@ -1482,7 +1501,7 @@
}, },
/** 手环管理页面新增设备属性提交按钮 */ /** 手环管理页面新增设备属性提交按钮 */
submitFormAttribute() { submitFormAttribute() {
this.$refs["formThree"].validate(valid => { this.$refs["formThree"].validate(valid => {
if (valid) { if (valid) {
if (this.formThree.id != undefined) { if (this.formThree.id != undefined) {
@ -1519,7 +1538,7 @@
} }
} }
}); });
}, },
// //
@ -1554,10 +1573,10 @@
this.totalTwo = response.total; this.totalTwo = response.total;
this.loadingTwo = false; this.loadingTwo = false;
}); });
}, },
/** 绑定操作 */ /** 绑定操作 */
handleBindSh(row) { handleBindSh(row) {
const shIds = row.shId || this.ids; const shIds = row.shId || this.ids;
const param = { const param = {
shboxId:this.shboxbindId, shboxId:this.shboxbindId,
@ -1630,7 +1649,7 @@
this.openbox = true; this.openbox = true;
this.title = "修改手环箱"; this.title = "修改手环箱";
},100) },100)
}); });
}, },
@ -1701,7 +1720,7 @@
/** 提交按钮 */ /** 提交按钮 */
submitForm() { submitForm() {
this.queryshCode.shCode = this.queryshCode.shCode; this.queryshCode.shCode = this.queryshCode.shCode;
this.queryshCode.shboxId = this.shboxIdOne; this.queryshCode.shboxId = this.shboxIdOne;
this.$refs["queryshCode"].validate(valid => { this.$refs["queryshCode"].validate(valid => {
@ -1715,9 +1734,9 @@
}) })
}, },
/** 手环绑定选择页面提交按钮 */ /** 手环绑定选择页面提交按钮 */
submitFormBind() { submitFormBind() {
if(this.queryshCodeBind.shboxId == undefined){ if(this.queryshCodeBind.shboxId == undefined){
this.$modal.msgError("请选择手环箱"); this.$modal.msgError("请选择手环箱");
return; return;
@ -1734,7 +1753,7 @@
}, },
/** 修改手环页面提交按钮 */ /** 修改手环页面提交按钮 */
submitFormEdit() { submitFormEdit() {
this.queryshEdit.shCode = this.queryshEdit.shCode; this.queryshEdit.shCode = this.queryshEdit.shCode;
this.queryshEdit.shboxId = this.shboxId; this.queryshEdit.shboxId = this.shboxId;
this.$refs["queryshEdit"].validate(valid => { this.$refs["queryshEdit"].validate(valid => {
@ -1750,7 +1769,7 @@
/** 手环箱管理页面提交按钮 */ /** 手环箱管理页面提交按钮 */
submitFormbox() { submitFormbox() {
this.$refs["formTwo"].validate(valid => { this.$refs["formTwo"].validate(valid => {
if (valid) { if (valid) {
if (this.formTwo.shboxId != undefined) { if (this.formTwo.shboxId != undefined) {
@ -1773,7 +1792,7 @@
} }
} }
}); });
}, },
@ -1941,7 +1960,7 @@
}, },
// //
openShboxTemp(row){ openShboxTemp(row){
this.queryshCodeBind = {}; this.queryshCodeBind = {};
this.shboxIdTwo = null; this.shboxIdTwo = null;
this.title = "选择" this.title = "选择"
@ -1987,7 +2006,7 @@
}) })
}, },
} }
}; };
</script> </script>
@ -2017,4 +2036,4 @@
::v-deep.order .el-table__header-wrapper .el-checkbox { ::v-deep.order .el-table__header-wrapper .el-checkbox {
display: none; display: none;
} }
</style> </style>