7/13 水电表解绑房屋
This commit is contained in:
@@ -85,3 +85,14 @@ export const getElectricityDeviceTimeRangeUsedWater = (data: { deviceCode: strin
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 电表解绑房屋
|
||||
* @param { string } deviceCode
|
||||
*/
|
||||
export const ElectricityDeviceUnbind = (deviceCode: string) => {
|
||||
return request({
|
||||
url: `/electricityDevice/unbind/${deviceCode}`,
|
||||
method: 'PUT'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -107,3 +107,14 @@ export const latestRecord = (deviceCodes: string) => {
|
||||
method: 'GET'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 解绑设备绑定的房屋
|
||||
* @param deviceCode
|
||||
*/
|
||||
export const waterDeviceUnbind = (deviceCode: string) => {
|
||||
return request({
|
||||
url: `/waterDevice/unbind/${deviceCode}`,
|
||||
method: 'PUT'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -63,9 +63,9 @@ export const delVersion = (id: string | number | Array<string | number>) => {
|
||||
};
|
||||
|
||||
/** 获取过往版本 */
|
||||
export const getPastVersion = (platform: string, channel: string) => {
|
||||
export const getPastVersion = (platform: string, appChannel: string, channel: string = 'xiaomi') => {
|
||||
return request({
|
||||
url: `/api/app/getPastVersion?platform=${platform}&channel=${channel}`,
|
||||
url: `/api/app/getPastVersion?platform=${platform}&appChannel=${appChannel}&channel=${channel}`,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -64,6 +64,12 @@ export interface VersionVO {
|
||||
}
|
||||
|
||||
export interface VersionForm extends BaseEntity {
|
||||
/**
|
||||
* 更新app端
|
||||
* butler 管家端
|
||||
* resident 业主端
|
||||
*/
|
||||
appChannel: string;
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@@ -115,12 +121,6 @@ export interface VersionForm extends BaseEntity {
|
||||
* 0-禁用 1-启用
|
||||
*/
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 更新app端
|
||||
* butler 管家端
|
||||
* resident 业主端
|
||||
*/
|
||||
channel?: string;
|
||||
}
|
||||
|
||||
@@ -140,11 +140,6 @@ export interface VersionQuery extends PageQuery {
|
||||
*/
|
||||
versionName?: string;
|
||||
|
||||
/**
|
||||
* 最低支持版本
|
||||
*/
|
||||
minVersionCode?: number;
|
||||
|
||||
/**
|
||||
* optional/force
|
||||
*/
|
||||
@@ -155,15 +150,6 @@ export interface VersionQuery extends PageQuery {
|
||||
*/
|
||||
downloadUrl?: string;
|
||||
|
||||
/**
|
||||
* 更新日志
|
||||
*/
|
||||
releaseNotes?: string;
|
||||
|
||||
/**
|
||||
* 文件大小(MB)
|
||||
*/
|
||||
fileSize?: string;
|
||||
|
||||
/**
|
||||
* 0-禁用 1-启用
|
||||
@@ -171,12 +157,14 @@ export interface VersionQuery extends PageQuery {
|
||||
status?: number;
|
||||
|
||||
/**
|
||||
* 更新app端
|
||||
* 更
|
||||
*/
|
||||
channel?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
* 更新app端
|
||||
* butler 管家端
|
||||
* resident 业主端
|
||||
*/
|
||||
params?: any;
|
||||
appChannel: string;
|
||||
}
|
||||
|
||||
@@ -133,11 +133,15 @@
|
||||
> -->
|
||||
<el-button
|
||||
link
|
||||
v-if="!scope.row.houseName"
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-has-permi="['equipment:edithouse:electricitydevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<el-button v-else link type="primary" @click="handleUnbind(scope.row)" v-has-permi="['equipment:edithouse:electricitydevice']"
|
||||
>解绑房屋</el-button
|
||||
>
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
@@ -248,6 +252,7 @@
|
||||
<script setup name="WaterDevice" lang="ts">
|
||||
import {
|
||||
ElectricityDeviceMakerQrcode,
|
||||
ElectricityDeviceUnbind,
|
||||
getElectricityDeviceTimeRangeUsedWater,
|
||||
listElectricityDevice,
|
||||
updateElectricityDevice
|
||||
@@ -259,6 +264,8 @@ import { checkPermi } from '@/utils/permission';
|
||||
import { Upload } from '@element-plus/icons-vue';
|
||||
import { CascaderValue, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { exportImagesToZip } from '@/utils/exportZip';
|
||||
import { WaterDeviceVO } from '@/api/system/SdbWaterDevice/type';
|
||||
import { waterDeviceUnbind } from '@/api/system/SdbWaterDevice';
|
||||
|
||||
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/electricityDevice/upload';
|
||||
|
||||
@@ -490,6 +497,17 @@ const handleOpenDialog = (type: 'usedWater' | 'Upload' | 'UpdateHouse', row: Ele
|
||||
}
|
||||
};
|
||||
|
||||
// 解绑房屋
|
||||
function handleUnbind(data: ElectricityDeviceVO) {
|
||||
ElectricityDeviceUnbind(data.deviceCode)
|
||||
.then(() => {
|
||||
ElMessage.success('解绑成功');
|
||||
})
|
||||
.finally(() => {
|
||||
getList();
|
||||
});
|
||||
}
|
||||
|
||||
function getTree() {
|
||||
treedata.value = [];
|
||||
houseStore.getCurrentVilageTreeHouse().then((res) => {
|
||||
|
||||
@@ -129,9 +129,18 @@
|
||||
>
|
||||
<!-- <el-button link type="primary" @click="handleUpdate(scope.row.deviceCode)">最新抄表记录</el-button> -->
|
||||
|
||||
<el-button link type="primary" @click="handleOpenDialog('UpdateHouse', scope.row)" v-has-permi="['equipment:edithouse:waterdevice']"
|
||||
<el-button
|
||||
v-if="!scope.row.houseName"
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('UpdateHouse', scope.row)"
|
||||
v-has-permi="['equipment:edithouse:waterdevice']"
|
||||
>绑定房屋</el-button
|
||||
>
|
||||
<el-button v-else link type="primary" @click="handleUnbind(scope.row)" v-has-permi="['equipment:edithouse:waterdevice']"
|
||||
>解绑房屋</el-button
|
||||
>
|
||||
|
||||
<!-- <el-dropdown style="vertical-align: text-top">
|
||||
<el-button link type="primary">
|
||||
<div>
|
||||
@@ -309,7 +318,8 @@ import {
|
||||
WaterDeviceMakerQrcode,
|
||||
updateWaterDevice,
|
||||
WaterDeviceUpdateBin,
|
||||
latestRecord
|
||||
latestRecord,
|
||||
waterDeviceUnbind
|
||||
} from '@/api/system/SdbWaterDevice';
|
||||
import { WaterDeviceVO } from '@/api/system/SdbWaterDevice/type';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
@@ -637,6 +647,17 @@ function handleUpdate(id: string) {
|
||||
});
|
||||
}
|
||||
|
||||
// 解绑房屋
|
||||
function handleUnbind(data: WaterDeviceVO) {
|
||||
waterDeviceUnbind(data.deviceCode)
|
||||
.then(() => {
|
||||
ElMessage.success('解绑成功');
|
||||
})
|
||||
.finally(() => {
|
||||
getList();
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
if (dialogType.value === 'usedWater') {
|
||||
|
||||
@@ -30,7 +30,8 @@
|
||||
</el-form-item>
|
||||
<el-form-item label="维护人员" prop="maintainUserIds">
|
||||
<repairUser
|
||||
userType="EquipmentMaintenance"
|
||||
userType="repair"
|
||||
EquipmentMaintenance
|
||||
:userid="checkoutuseid"
|
||||
ref="repairUserRef"
|
||||
returnvalue="*"
|
||||
@@ -135,7 +136,7 @@ function init() {
|
||||
};
|
||||
|
||||
checkoutuser.value = [];
|
||||
checkoutuser.value = res.data.maintainUserList;
|
||||
checkoutuser.value = res.data.maintainUserList??[];
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<div class="label">维修结果:</div>
|
||||
<DictTag :options="com_equipment_repair_status" :value="form.repairResult"></DictTag>
|
||||
</div>
|
||||
<!-- TODO 维修时间 -->
|
||||
<div class="info_item">
|
||||
<div class="label">维修时间:</div>
|
||||
<span class="value">{{ form.repairTime }}</span>
|
||||
|
||||
@@ -222,7 +222,6 @@ function updatePayMethod(dataFrom: PayMentMethod): EChartsOption {
|
||||
]
|
||||
};
|
||||
}
|
||||
|
||||
// 【新增】定义12个月份
|
||||
const monthX = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
|
||||
/** 欠费分布 散点图 */
|
||||
@@ -637,6 +636,7 @@ onMounted(() => {
|
||||
onUnmounted(() => {
|
||||
open.value = false;
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-has-permi="['system:version:add']">新增</el-button>
|
||||
</el-col>
|
||||
<!-- <right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar> -->
|
||||
<!-- <right-toolbar v-model:showSearch="showSearch"╬╬╘╬ @queryTable="getList"></right-toolbar> -->
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
@@ -50,10 +50,10 @@
|
||||
@selection-change="handleSelectionChange"
|
||||
>
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="应用名称" sortable align="center" prop="channel">
|
||||
<el-table-column label="应用名称" sortable align="center" prop="appChannel">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.channel === 'resident'">花开物业App</span>
|
||||
<span v-else-if="scope.row.channel === 'butler'">花开管家App</span>
|
||||
<span v-if="scope.row.appChannel === 'resident'">花开物业App</span>
|
||||
<span v-else-if="scope.row.appChannel === 'butler'">花开管家App</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="版本类型" align="center" prop="platform">
|
||||
@@ -62,6 +62,7 @@
|
||||
<el-tag type="primary" v-else>android</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新渠道" sortable align="center" prop="channel" />
|
||||
<el-table-column label="版本号" sortable align="center" prop="versionCode" />
|
||||
<el-table-column label="版本名称" sortable align="center" prop="versionName" />
|
||||
<el-table-column label="最低支持版本" sortable align="center" prop="minVersionName" />
|
||||
@@ -84,8 +85,8 @@
|
||||
<!-- 添加或修改对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="650px" append-to-body>
|
||||
<el-form ref="versionFormRef" :model="form" :rules="rules" label-width="130px">
|
||||
<el-form-item label="App端" prop="channel">
|
||||
<el-select @change="handleGetVersionlast" v-model="form.channel" placeholder="请选择">
|
||||
<el-form-item label="App端" prop="appChannel">
|
||||
<el-select @change="handleGetVersionlast" v-model="form.appChannel" placeholder="请选择">
|
||||
<el-option label="花开管家App" value="butler"></el-option>
|
||||
<el-option label="花开物业App" value="resident"></el-option>
|
||||
</el-select>
|
||||
@@ -107,37 +108,45 @@
|
||||
<el-option label="1.0.0" :value="1"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="渠道" prop="channel">
|
||||
<el-radio-group v-model="form.channel">
|
||||
<el-radio value="huawei">华为</el-radio>
|
||||
<el-radio value="xiaomi">小米</el-radio>
|
||||
<el-radio value="oppo">oppo</el-radio>
|
||||
<el-radio value="vivo">vivo</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="更新日志" prop="releaseNotes">
|
||||
<el-input v-model="form.releaseNotes" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="低版本强制更新">
|
||||
<div>
|
||||
<el-switch
|
||||
v-model="form.updateType"
|
||||
:active-value="updateType.force"
|
||||
active-text="开启"
|
||||
:inactive-value="updateType.optional"
|
||||
inactive-text="停止"
|
||||
></el-switch>
|
||||
<p class="tips">
|
||||
<strong style="color: #000">配合最低支持版本使用</strong> 开启后: <br />低于最低版→启用强制(无取消,不更退出 APP);<br />高于最低版→普通弹窗可选取消。
|
||||
</p>
|
||||
</div>
|
||||
<!-- <el-form-item label="低版本强制更新">-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-switch-->
|
||||
<!-- v-model="form.updateType"-->
|
||||
<!-- :active-value="updateType.force"-->
|
||||
<!-- active-text="开启"-->
|
||||
<!-- :inactive-value="updateType.optional"-->
|
||||
<!-- inactive-text="停止"-->
|
||||
<!-- ></el-switch>-->
|
||||
<!-- <p class="tips">-->
|
||||
<!-- <strong style="color: #000">配合最低支持版本使用</strong> 开启后: <br />低于最低版→启用强制(无取消,不更退出 APP);<br />高于最低版→普通弹窗可选取消。-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <el-form-item label="更新地址" prop="downloadUrl" v-if="form.platform === appType.ios">-->
|
||||
<!-- <el-input v-model="form.downloadUrl" placeholder="请输入App Store 链接" />-->
|
||||
<!-- </el-form-item>-->
|
||||
<!-- <div v-else-if="form.platform === appType.android">-->
|
||||
<!-- <el-form-item label="更新类型">-->
|
||||
<!-- <el-radio-group v-model="form.method">-->
|
||||
<!-- <el-radio-button :value="updatePackageType.apk">整包更新(apk)</el-radio-button>-->
|
||||
<!-- <el-radio-button :value="updatePackageType.wgt">热更新(wgt)</el-radio-button>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="上传安装包地址" prop="downloadUrl">
|
||||
<el-input v-model="form.downloadUrl" placeholder="请输入更新地址" />
|
||||
</el-form-item>
|
||||
<el-form-item label="更新地址" prop="downloadUrl" v-if="form.platform === appType.ios">
|
||||
<el-input v-model="form.downloadUrl" placeholder="请输入App Store 链接" />
|
||||
</el-form-item>
|
||||
<div v-else-if="form.platform === appType.android">
|
||||
<el-form-item label="更新类型">
|
||||
<el-radio-group v-model="form.method">
|
||||
<el-radio-button :value="updatePackageType.apk">整包更新(apk)</el-radio-button>
|
||||
<el-radio-button :value="updatePackageType.wgt">热更新(wgt)</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传安装包地址" prop="downloadUrl">
|
||||
<el-input v-model="form.downloadUrl" placeholder="请输入更新地址" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<!-- </div>-->
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
@@ -150,7 +159,7 @@
|
||||
</template>
|
||||
|
||||
<script setup name="Version" lang="ts">
|
||||
import { listVersion, addVersion, getPastVersion, switchVersion } from '@/api/system/version/index';
|
||||
import { listVersion, addVersion, getPastVersion, switchVersion } from '@/api/system/version';
|
||||
import { VersionVO, VersionQuery, VersionForm } from '@/api/system/version/type';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -183,6 +192,7 @@ const initFormData: VersionForm = {
|
||||
downloadUrl: undefined,
|
||||
releaseNotes: undefined,
|
||||
fileSize: undefined,
|
||||
appChannel: undefined,
|
||||
status: undefined,
|
||||
channel: undefined
|
||||
};
|
||||
@@ -194,13 +204,7 @@ const data = reactive<PageData<VersionForm, VersionQuery>>({
|
||||
platform: undefined,
|
||||
versionCode: undefined,
|
||||
versionName: undefined,
|
||||
minVersionCode: undefined,
|
||||
updateType: undefined,
|
||||
downloadUrl: undefined,
|
||||
releaseNotes: undefined,
|
||||
fileSize: undefined,
|
||||
status: undefined,
|
||||
channel: undefined
|
||||
appChannel: undefined
|
||||
},
|
||||
rules: {
|
||||
channel: [{ required: true, message: 'App应用不能为空', trigger: 'blur' }],
|
||||
@@ -241,7 +245,7 @@ const getlastVersionlist = ref([]);
|
||||
* @param {string} latest - 最新版本号字符串,格式为点分十进制(如 "1.2.4")
|
||||
* @returns {boolean} 如果当前版本小于或等于最新版本,返回 true;否则返回 false
|
||||
*/
|
||||
function needUpdate(current, latest) {
|
||||
function needUpdate(current: string, latest: string) {
|
||||
// 将版本号字符串分割并转换为数字数组
|
||||
const c = current.split('.').map(Number);
|
||||
const l = latest.split('.').map(Number);
|
||||
@@ -314,7 +318,7 @@ function handleChangePlatform() {
|
||||
}
|
||||
|
||||
function handleGetVersionlast() {
|
||||
getPastVersion(form.value.platform, form.value.channel).then((res) => {
|
||||
getPastVersion(form.value.platform, form.value.appChannel).then((res) => {
|
||||
getlastVersionlist.value = res.data;
|
||||
form.value.minVersionCode = getlastVersionlist.value[getlastVersionlist.value.length - 1]
|
||||
? getlastVersionlist.value[getlastVersionlist.value.length - 1].versionCode
|
||||
|
||||
Reference in New Issue
Block a user