forked from dyf/dyf-vue-ui
联调中心完成
This commit is contained in:
77
src/api/debugCenter/debugCenter.ts
Normal file
77
src/api/debugCenter/debugCenter.ts
Normal file
@ -0,0 +1,77 @@
|
||||
import request from '@/utils/request';
|
||||
|
||||
//获取列表数据
|
||||
function getDevice(queryParams){
|
||||
return request({
|
||||
url: '/api/device/debug/list',
|
||||
method: 'get',
|
||||
params: queryParams
|
||||
})
|
||||
}
|
||||
|
||||
//上传文件
|
||||
function uploadFile(formData){
|
||||
return request({
|
||||
url: '/api/device/debug/addFile',
|
||||
method: 'post',
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
|
||||
//修改操作视频
|
||||
function addVideo(formData){
|
||||
return request({
|
||||
url: '/api/device/debug/addVideo',
|
||||
method: 'post',
|
||||
data: formData
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
//修改单个数据的多个文件
|
||||
function updateItem(formData){
|
||||
|
||||
return request({
|
||||
url: '/api/device/debug/editDebug',
|
||||
method: 'post',
|
||||
data: formData
|
||||
})
|
||||
//开发时假装成功
|
||||
// return new Promise((resolve,reject)=>{
|
||||
// resolve({
|
||||
// code:200,
|
||||
// msg:"操作成功"
|
||||
// });
|
||||
// });
|
||||
}
|
||||
//批量上传开机画面
|
||||
function uploadBoot(formData){
|
||||
return request({
|
||||
url: '/api/device/debug/addLogo',
|
||||
method: 'post',
|
||||
data: formData
|
||||
})
|
||||
//开发时假装成功
|
||||
// return new Promise((resolve, reject) => {
|
||||
// //开机画面
|
||||
// resolve({ code: 200, msg: '操作成功' });
|
||||
// });
|
||||
}
|
||||
|
||||
function getDeviceInfoById(id){
|
||||
|
||||
return request({
|
||||
url: '/api/device/debug/detail/'+id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export default{
|
||||
getDevice:getDevice,
|
||||
uploadFile:uploadFile,
|
||||
addVideo:addVideo,
|
||||
updateItem:updateItem,
|
||||
uploadBoot:uploadBoot,
|
||||
getDeviceInfoById:getDeviceInfoById
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
//日期格式化
|
||||
function DateFormat(date, format) {
|
||||
if (!date) {
|
||||
return '';
|
||||
@ -39,7 +40,7 @@ function DateFormat(date, format) {
|
||||
return formatMap[match];
|
||||
});
|
||||
}
|
||||
|
||||
//日期加减
|
||||
function DateAdd(datePart, number, date) {
|
||||
// 创建日期的副本,避免修改原日期对象
|
||||
const newDate = new Date(date.getTime());
|
||||
@ -71,7 +72,47 @@ function DateAdd(datePart, number, date) {
|
||||
return newDate;
|
||||
}
|
||||
|
||||
//将字节转换成0.53kb 10.13MB 1GB这样的友好单位
|
||||
function formatBytes(bytes, decimals = 2) {
|
||||
// 处理0字节的情况
|
||||
if (bytes === 0) return '0 B';
|
||||
|
||||
// 定义单位和换算比例
|
||||
const k = 1024;
|
||||
const dm = decimals < 0 ? 0 : decimals;
|
||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
|
||||
// 计算最合适的单位
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
||||
// 格式化并返回结果
|
||||
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
||||
}
|
||||
|
||||
//数组某个字段取唯一值
|
||||
function getUniqueValues(dataSource, field) {
|
||||
if(!field){
|
||||
return [];
|
||||
}
|
||||
// 使用Set来存储唯一值,因为Set会自动去重
|
||||
const uniqueValues = new Set();
|
||||
|
||||
// 遍历数据源
|
||||
for (const item of dataSource) {
|
||||
// 检查对象是否包含指定字段
|
||||
if (item.hasOwnProperty(field)) {
|
||||
uniqueValues.add(item[field]);
|
||||
}
|
||||
}
|
||||
|
||||
// 将Set转换为数组并返回
|
||||
return Array.from(uniqueValues);
|
||||
}
|
||||
|
||||
|
||||
export default{
|
||||
DateFormat:DateFormat,
|
||||
DateAdd:DateAdd
|
||||
DateAdd:DateAdd,
|
||||
formatBytes:formatBytes,
|
||||
getUniqueValues:getUniqueValues
|
||||
}
|
||||
1010
src/views/debugCenter/debugPanel/index.vue
Normal file
1010
src/views/debugCenter/debugPanel/index.vue
Normal file
File diff suppressed because it is too large
Load Diff
@ -125,7 +125,7 @@ watch(
|
||||
|
||||
if (newVal === 3) {
|
||||
// 确保参数有效
|
||||
debugger;
|
||||
|
||||
console.log('newVal=', newVal);
|
||||
getRecordList(); // 调用回调
|
||||
}
|
||||
|
||||
@ -126,7 +126,7 @@ watch(
|
||||
|
||||
if (newVal === 3) {
|
||||
// 确保参数有效
|
||||
debugger;
|
||||
|
||||
console.log('newVal=', newVal);
|
||||
getRecordList(); // 调用回调
|
||||
}
|
||||
|
||||
@ -125,7 +125,7 @@ function initData(item, Refresh) {
|
||||
params: params
|
||||
})
|
||||
.then((res) => {
|
||||
debugger;
|
||||
|
||||
if (res.code == 200) {
|
||||
if (res.rows) {
|
||||
if (res.rows.length) {
|
||||
|
||||
@ -10,11 +10,15 @@
|
||||
|
||||
<el-form :inline="true" :model="filter" class="demo-form-inline">
|
||||
<el-form-item label="">
|
||||
<el-input v-model="filter.phonenumber" placeholder="查找分享用户" @input="Search">
|
||||
<template #append>
|
||||
<el-button :icon="'Search'" />
|
||||
</template>
|
||||
</el-input>
|
||||
|
||||
|
||||
<el-input
|
||||
v-model="filter.phonenumber"
|
||||
placeholder="查找分享用户"
|
||||
:suffix-icon="'Search'"
|
||||
@input="Search"
|
||||
/>
|
||||
|
||||
</el-form-item>
|
||||
<el-form-item label="分享时间">
|
||||
<el-date-picker
|
||||
@ -72,13 +76,13 @@
|
||||
<el-checkbox :label="item.label" v-for="item in power" :value="item.value" />
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="验证码" label-position="right">
|
||||
<!-- <el-form-item label="验证码" label-position="right">
|
||||
<el-input v-model="cEdit.smsCode" placeholder="验证码">
|
||||
<template #append
|
||||
><div class="btnSendSms" @click.stop="sendSms">{{ time > 0 ? time + '秒后重发' : '发送验证码' }}</div></template
|
||||
>
|
||||
</el-input>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
</el-form>
|
||||
</div>
|
||||
<div class="center" style="margin-top: 10px">
|
||||
@ -288,7 +292,7 @@ function DelShare(item, isBatch) {
|
||||
alert('请选择需要删除的数据');
|
||||
return;
|
||||
}
|
||||
debugger;
|
||||
|
||||
let OkDel = () => {
|
||||
hideConfirm();
|
||||
Status.fullLoading = true;
|
||||
@ -353,12 +357,12 @@ function sendSms() {
|
||||
}
|
||||
//权限设置
|
||||
function powerSet(item) {
|
||||
debugger;
|
||||
|
||||
Status.ShowPowerSet = true;
|
||||
cEdit.permission = item.permission.split(',');
|
||||
cEdit.phonenumber = item.phonenumber;
|
||||
cEdit.remark = item.remark;
|
||||
cEdit.smsCode = '123456';
|
||||
cEdit.smsCode = '';
|
||||
}
|
||||
|
||||
function getUsrs() {
|
||||
@ -403,7 +407,7 @@ function initData(item, Refresh) {
|
||||
Status.loading = false;
|
||||
return;
|
||||
}
|
||||
debugger;
|
||||
|
||||
List.value = [];
|
||||
|
||||
deviceid = item.data.deviceId;
|
||||
|
||||
@ -469,7 +469,7 @@ function getRecordList() {
|
||||
|
||||
|
||||
|
||||
}, 2000);
|
||||
}, 0);
|
||||
}
|
||||
|
||||
|
||||
@ -502,7 +502,7 @@ function ToggleAdvance() {
|
||||
|
||||
//显示编辑
|
||||
function ShowEdit(item = undefined, isEdit = true) {
|
||||
debugger;
|
||||
|
||||
Status.ShowEditPop = true;
|
||||
let def = {
|
||||
recordId: null,//维修记录id
|
||||
|
||||
Reference in New Issue
Block a user