Merge branch 'liubiao-main、'
This commit is contained in:
@ -19,8 +19,8 @@
|
||||
<el-row :gutter="20" class="content-row" :class="deviceDetail.sta_ShakeBit == 1 || deviceDetail.staSOSGrade == 1 ? '' : 'displayNone'">
|
||||
<el-col :lg="24" :xs="24">
|
||||
<div class="staticRwo" :class="deviceDetail.sta_ShakeBit == 1 ? '' : 'displayNone'">设备静止报警中!</div>
|
||||
<div class="staticRwo" :class="deviceDetail.staSOSGrade == 1 ? '' : 'displayNone'" @click="showClose()">
|
||||
设备强制报警中<span v-show="Status.timeOut>0">{{ Status.timeOut }}S</span>!
|
||||
<div class="staticRwo" :class="(deviceDetail.staSOSGrade == 1 && Status.timeOut>0) ? '' : 'displayNone'" @click="showClose()">
|
||||
设备强制报警中<span v-show="Status.timeOut>0">,{{ Status.timeOut }}S</span>!
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -102,7 +102,7 @@
|
||||
<el-input v-if="deviceDetail" placeholder="请输入职位" v-model="deviceDetail.personnelInfo.name" />
|
||||
</div>
|
||||
<div class="form-item">
|
||||
<span class="form-label">姓名</span>
|
||||
<span class="form-label">姓名:</span>
|
||||
<el-input v-if="deviceDetail" placeholder="请输入姓名" v-model="deviceDetail.personnelInfo.position" />
|
||||
</div>
|
||||
<div class="form-item">
|
||||
@ -206,11 +206,24 @@ const router = useRouter();
|
||||
// 导入图片资源(确保路径正确)
|
||||
import strongLightDefault from '@/assets/images/strong-light.png';
|
||||
import strongLightActive from '@/assets/images/strong-light_HL.png';
|
||||
import weakLightDefault from '@/assets/images/weak-light.png';
|
||||
import weakLightActive from '@/assets/images/weak-light_HL.png';
|
||||
import floodLightDefault from '@/assets/images/flood-light.png';
|
||||
import floodLightActive from '@/assets/images/flood-light_HL.png';
|
||||
|
||||
|
||||
import di from '@/assets/images/di.png';
|
||||
import diAc from '@/assets/images/diAc.png';
|
||||
import high from '@/assets/images/high.png';
|
||||
import highAc from '@/assets/images/highAc.png';
|
||||
import rb from '@/assets/images/rb.png';
|
||||
import rbAc from '@/assets/images/rbAc.png';
|
||||
import sg from '@/assets/images/sg.png';
|
||||
import sgAc from '@/assets/images/sgAc.png';
|
||||
import zhong from '@/assets/images/zhong.png';
|
||||
import zhongAc from '@/assets/images/zhongAc.png';
|
||||
import closeDefault from '@/assets/images/close.png';
|
||||
import closeActive from '@/assets/images/close_HL.png';
|
||||
import { hi } from 'element-plus/es/locale/index.mjs';
|
||||
|
||||
const fullscreenLoading = ref(false);
|
||||
var timer = null;
|
||||
const sendTextLoading = ref(false);
|
||||
@ -248,8 +261,8 @@ const lightModes = ref<any[]>([
|
||||
{
|
||||
id: '2',
|
||||
name: '弱光',
|
||||
icon: weakLightDefault,
|
||||
activeIcon: weakLightActive,
|
||||
icon: floodLightDefault,
|
||||
activeIcon: floodLightActive,
|
||||
active: false
|
||||
},
|
||||
{
|
||||
@ -265,24 +278,24 @@ const sosModes = ref<any[]>([
|
||||
{
|
||||
id: '1',
|
||||
name: '声光报警',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: sg, // 直接使用导入的变量
|
||||
activeIcon: sgAc,
|
||||
|
||||
active: false
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '红蓝模式',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: rb, // 直接使用导入的变量
|
||||
activeIcon: rbAc,
|
||||
|
||||
active: false
|
||||
},
|
||||
{
|
||||
id: '0',
|
||||
name: '关闭',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: closeDefault, // 直接使用导入的变量
|
||||
activeIcon: closeActive,
|
||||
|
||||
active: false
|
||||
}
|
||||
@ -292,32 +305,32 @@ const staticModes = ref<any[]>([
|
||||
{
|
||||
id: '3',
|
||||
name: '高档',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: high, // 直接使用导入的变量
|
||||
activeIcon: highAc,
|
||||
|
||||
active: false
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '中档',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: zhong, // 直接使用导入的变量
|
||||
activeIcon:zhongAc,
|
||||
|
||||
active: false
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
name: '低档',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: di, // 直接使用导入的变量
|
||||
activeIcon: diAc,
|
||||
|
||||
active: false
|
||||
},
|
||||
{
|
||||
id: '0',
|
||||
name: '关闭',
|
||||
icon: strongLightDefault, // 直接使用导入的变量
|
||||
activeIcon: strongLightActive,
|
||||
icon: closeDefault, // 直接使用导入的变量
|
||||
activeIcon: closeActive,
|
||||
|
||||
active: false
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<div class="main">
|
||||
<div class="TopTool">
|
||||
<div class="button-row">
|
||||
<el-button type="primary" icon="Plus" @click.stop="ShowEdit(null, true,formRef)">新增维修</el-button>
|
||||
<el-button type="primary" icon="Plus" @click.stop="ShowEdit(null, true, formRef)">新增维修</el-button>
|
||||
<el-button type="primary" plain icon="Download" @click.stop="ExportRecord()">导出</el-button>
|
||||
<el-button type="danger" plain icon="Delete" @click.stop="DropRecord()">批量删除</el-button>
|
||||
</div>
|
||||
@ -47,7 +47,7 @@
|
||||
v-model="advanceSearch.Date"
|
||||
type="daterange"
|
||||
format="YYYY-MM-DD"
|
||||
style="width: 240px;"
|
||||
style="width: 240px"
|
||||
value-format="YYYY-MM-DD"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
@ -74,7 +74,7 @@
|
||||
<el-table-column label="操作" align="center" fixed="right" width="280" class-name="small-padding fixed-width opt">
|
||||
<template #default="scope">
|
||||
<div class="center">
|
||||
<el-text class="mx-1" type="primary" @click.stop="ShowEdit(scope.row, true,formRef)">编辑</el-text>
|
||||
<el-text class="mx-1" type="primary" @click.stop="ShowEdit(scope.row, true, formRef)">编辑</el-text>
|
||||
<el-text class="mx-1" type="primary" @click.stop="ShowEdit(scope.row, false)">详情</el-text>
|
||||
<el-text class="mx-1" type="danger" @click.stop="DropRecord([scope.row])">删除</el-text>
|
||||
</div>
|
||||
@ -101,8 +101,7 @@
|
||||
:draggable="true"
|
||||
>
|
||||
<div class="form">
|
||||
<el-form :model="cEdit" ref="formRef" style="max-width: 750px" :rules="rules" >
|
||||
|
||||
<el-form :model="cEdit" ref="formRef" style="max-width: 750px" :rules="rules">
|
||||
<el-form-item label="设备名称" label-position="right" prop="deviceId">
|
||||
<!-- <el-input v-model="selectedRow['deviceName']" :readonly="true" @click.stop="ShowDevice('Edit', true)" placeholder="请选择设备" /> -->
|
||||
<el-select v-model="cEdit.deviceId" placeholder="选择设备" clearable :disabled="!cEdit.isEdit" filterable>
|
||||
@ -143,6 +142,7 @@
|
||||
accept=".jpg,.jpeg,.png,.gif.webp"
|
||||
:limit="9"
|
||||
list-type="picture-card"
|
||||
:class="{ 'hide-add-btn': !cEdit.isEdit }"
|
||||
>
|
||||
<el-icon>
|
||||
<Plus />
|
||||
@ -154,7 +154,7 @@
|
||||
<img :src="file.url" class="el-upload-list__item-thumbnail" />
|
||||
|
||||
<!-- 操作按钮组 -->
|
||||
<div class="el-upload-list__item-actions">
|
||||
<div class="el-upload-list__item-actions" v-show="cEdit.isEdit">
|
||||
<!-- 自定义删除按钮 -->
|
||||
<span class="el-upload-list__item-delete" @click.stop="dropImg('before', file, index)">
|
||||
<el-icon>
|
||||
@ -179,6 +179,7 @@
|
||||
accept=".jpg,.jpeg,.png,.gif.webp"
|
||||
:limit="9"
|
||||
list-type="picture-card"
|
||||
:class="{ 'hide-add-btn': !cEdit.isEdit }"
|
||||
>
|
||||
<el-icon>
|
||||
<Plus />
|
||||
@ -189,7 +190,7 @@
|
||||
<!-- 图片缩略图 -->
|
||||
<img :src="file.url" class="el-upload-list__item-thumbnail" />
|
||||
<!-- 操作按钮组 -->
|
||||
<div class="el-upload-list__item-actions">
|
||||
<div class="el-upload-list__item-actions" v-show="cEdit.isEdit">
|
||||
<!-- 自定义删除按钮 -->
|
||||
<span class="el-upload-list__item-delete" @click.stop="dropImg('after', file, index)">
|
||||
<el-icon>
|
||||
@ -338,7 +339,6 @@
|
||||
import api from '@/api/equipmentManagement/repairRecords/index';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
|
||||
var grid = ref(null);
|
||||
var deviceGrid = ref(null);
|
||||
|
||||
@ -490,15 +490,12 @@ function DropRecord(arr = undefined) {
|
||||
() => {
|
||||
showloading('fullLoading');
|
||||
arr = arr.map((item) => item.recordId);
|
||||
api.dropRepir(arr).then(res=>{
|
||||
if(res && res.code==200){
|
||||
api.dropRepir(arr).then((res) => {
|
||||
if (res && res.code == 200) {
|
||||
Search();
|
||||
}
|
||||
alert(res.msg);
|
||||
});
|
||||
|
||||
|
||||
|
||||
},
|
||||
hideConfirm,
|
||||
'提示'
|
||||
@ -511,7 +508,7 @@ function ToggleAdvance() {
|
||||
}
|
||||
|
||||
//显示编辑
|
||||
function ShowEdit(item = undefined, isEdit = true,formEl=undefined) {
|
||||
function ShowEdit(item = undefined, isEdit = true, formEl = undefined) {
|
||||
Status.ShowEditPop = true;
|
||||
let def = {
|
||||
recordId: null, //维修记录id
|
||||
@ -590,9 +587,9 @@ function ShowEdit(item = undefined, isEdit = true,formEl=undefined) {
|
||||
return { name: v.imageId, url: v.imageUrl, id: v.imageId };
|
||||
});
|
||||
|
||||
if (!formEl) return
|
||||
if (!formEl) return;
|
||||
|
||||
formEl.validate();
|
||||
formEl.validate();
|
||||
}
|
||||
if (item) {
|
||||
selectedRow.value['deviceName'] = item.deviceName;
|
||||
@ -671,80 +668,79 @@ var dropImg = (type, file, index) => {
|
||||
//保存表单数据
|
||||
function SaveFormData(formEl: FormInstance | undefined) {
|
||||
if (!cEdit.isEdit) {
|
||||
CloseEdit();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!formEl) return
|
||||
if (!formEl) return;
|
||||
|
||||
let submit=()=>{
|
||||
showloading('fullLoading');
|
||||
setTimeout(() => {
|
||||
let promise = null;
|
||||
let submit = () => {
|
||||
showloading('fullLoading');
|
||||
setTimeout(() => {
|
||||
let promise = null;
|
||||
|
||||
let formData = new FormData();
|
||||
let formData = new FormData();
|
||||
|
||||
let keys = Object.keys(cEdit);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
let key = keys[i];
|
||||
if (key == 'isEdit') {
|
||||
continue;
|
||||
let keys = Object.keys(cEdit);
|
||||
for (let i = 0; i < keys.length; i++) {
|
||||
let key = keys[i];
|
||||
if (key == 'isEdit') {
|
||||
continue;
|
||||
}
|
||||
if (cEdit[key] === null || cEdit[key] === undefined) {
|
||||
continue;
|
||||
}
|
||||
formData.append(key, cEdit[key]);
|
||||
}
|
||||
if (cEdit[key] === null || cEdit[key] === undefined) {
|
||||
continue;
|
||||
}
|
||||
formData.append(key, cEdit[key]);
|
||||
}
|
||||
|
||||
// 添加第一个控件的文件
|
||||
if (beforeFile.value.length > 0) {
|
||||
for (let i = 0; i < beforeFile.value.length; i++) {
|
||||
let file = beforeFile.value[i];
|
||||
if (file && !file.id) {
|
||||
formData.append('beforeFile', file);
|
||||
// 添加第一个控件的文件
|
||||
if (beforeFile.value.length > 0) {
|
||||
for (let i = 0; i < beforeFile.value.length; i++) {
|
||||
let file = beforeFile.value[i];
|
||||
if (file && !file.id) {
|
||||
formData.append('beforeFile', file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (afterFile.value.length > 0) {
|
||||
// formData.append('afterFile', afterFile.value[0]);
|
||||
if (afterFile.value.length > 0) {
|
||||
// formData.append('afterFile', afterFile.value[0]);
|
||||
|
||||
for (let i = 0; i < afterFile.value.length; i++) {
|
||||
let file = afterFile.value[i];
|
||||
if (file && !file.id) {
|
||||
formData.append('afterFile', file);
|
||||
for (let i = 0; i < afterFile.value.length; i++) {
|
||||
let file = afterFile.value[i];
|
||||
if (file && !file.id) {
|
||||
formData.append('afterFile', file);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cEdit.recordId) {
|
||||
promise = api.updateRepair(formData);
|
||||
} else {
|
||||
promise = api.addRepir(formData);
|
||||
}
|
||||
if (cEdit.recordId) {
|
||||
promise = api.updateRepair(formData);
|
||||
} else {
|
||||
promise = api.addRepir(formData);
|
||||
}
|
||||
|
||||
promise
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
alert('操作成功');
|
||||
CloseEdit();
|
||||
Search();
|
||||
} else {
|
||||
alert(res.msg);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
ResetFormData();
|
||||
hideloading();
|
||||
});
|
||||
}, 0);
|
||||
}
|
||||
promise
|
||||
.then((res) => {
|
||||
if (res.code == 200) {
|
||||
alert('操作成功');
|
||||
CloseEdit();
|
||||
Search();
|
||||
} else {
|
||||
alert(res.msg);
|
||||
}
|
||||
})
|
||||
.finally(() => {
|
||||
ResetFormData();
|
||||
hideloading();
|
||||
});
|
||||
}, 0);
|
||||
};
|
||||
formEl.validate((valid) => {
|
||||
if (valid) {
|
||||
submit();
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
//导出
|
||||
@ -1079,12 +1075,16 @@ input:focus {
|
||||
}
|
||||
|
||||
:deep .el-upload-list--picture-card .el-upload-list__item .el-upload-list__item,
|
||||
.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item{
|
||||
margin:0px ;
|
||||
.el-upload-list--picture-card .el-upload-list__item .el-upload-list__item {
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
// :deep .el-upload-list__item,.el-upload-list__item{
|
||||
// margin-right: 8px !important;
|
||||
// }
|
||||
|
||||
:deep .hide-add-btn .el-upload.is-disabled,
|
||||
.hide-add-btn .el-upload.is-disabled {
|
||||
display: none !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
83
src/views/system/user/profile/appVer.vue
Normal file
83
src/views/system/user/profile/appVer.vue
Normal file
@ -0,0 +1,83 @@
|
||||
<template>
|
||||
<el-form :model="user" label-width="80px">
|
||||
<div v-for="item in user">
|
||||
<el-form-item :label="item.dictLabel" prop="dictLabel">
|
||||
<el-input v-model="item.dictLabel" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="版本号" prop="dictValue">
|
||||
<el-input v-model="item.dictValue" placeholder="请输入版本号" clearable />
|
||||
</el-form-item>
|
||||
<el-form-item label="下载地址" prop="remark">
|
||||
<el-input v-model="item.remark" placeholder="请输入wgt下载地址" clearable />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="submit">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import request from '@/utils/request';
|
||||
const user = ref([
|
||||
{
|
||||
'dictValue': '',
|
||||
'dictLabel': 'ios',
|
||||
'remark': ''
|
||||
},
|
||||
{
|
||||
'dictValue': '',
|
||||
'dictLabel': 'android',
|
||||
'remark': ''
|
||||
}
|
||||
]);
|
||||
|
||||
function getCfg() {
|
||||
request({
|
||||
url: '/app/auth/version',
|
||||
method: 'get'
|
||||
}).then((res) => {
|
||||
if (res && res.code === 200) {
|
||||
user.value.forEach((v) => {
|
||||
let f = res.data.find((item) => {
|
||||
return item.dictLabel === v.dictLabel;
|
||||
});
|
||||
if (f) {
|
||||
v.dictValue = f.dictValue;
|
||||
v.remark = f.remark;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function submit() {
|
||||
let flag = [];
|
||||
user.value.forEach((v) => {
|
||||
let keys = Object.keys(v);
|
||||
keys.forEach((k) => {
|
||||
if (!v[k]) {
|
||||
flag.push(false);
|
||||
}
|
||||
});
|
||||
});
|
||||
if (flag.length > 0) {
|
||||
ElMessageBox.alert('所有项都是必填');
|
||||
return;
|
||||
}
|
||||
request({
|
||||
url: '/api/xinghan/device/UpVersion',
|
||||
method: 'post',
|
||||
data: user.value
|
||||
}).then((res) => {
|
||||
if (res && res.code === 200) {
|
||||
ElMessageBox.alert('操作成功');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
getCfg();
|
||||
});
|
||||
</script>
|
||||
@ -61,6 +61,9 @@
|
||||
<el-tab-pane label="在线设备" name="onlineDevice">
|
||||
<onlineDevice :devices="state.devices" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="App版本" name="appVer">
|
||||
<appVer />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</el-card>
|
||||
</el-col>
|
||||
@ -78,7 +81,7 @@ import { getAuthList } from '@/api/system/social/auth';
|
||||
import { getUserProfile } from '@/api/system/user';
|
||||
import { getOnline } from '@/api/monitor/online';
|
||||
import { UserVO } from '@/api/system/user/types';
|
||||
|
||||
import appVer from './appVer.vue';
|
||||
const activeTab = ref('userinfo');
|
||||
interface State {
|
||||
user: Partial<UserVO>;
|
||||
@ -86,13 +89,15 @@ interface State {
|
||||
postGroup: string;
|
||||
auths: any;
|
||||
devices: any;
|
||||
vers: any;
|
||||
}
|
||||
const state = ref<State>({
|
||||
user: {},
|
||||
roleGroup: '',
|
||||
postGroup: '',
|
||||
auths: [],
|
||||
devices: []
|
||||
devices: [],
|
||||
vers: ''
|
||||
});
|
||||
|
||||
const userForm = ref({});
|
||||
|
||||
Reference in New Issue
Block a user