main
姜玉琦 2024-07-24 16:40:04 +08:00
parent 746ddfaf56
commit 171c93fc0e
7 changed files with 35 additions and 23 deletions

View File

@ -45,7 +45,7 @@ const devicesInfo = (id) => {
});
}
//更新设备信息
const updateDevices = (id) => {
const updateDevices = (id,data) => {
return request({
url: `/devices/${id}`,
method: "put",

View File

@ -24,7 +24,7 @@ const deleteUser = (id) => {
});
}
//更新用户信息
const updateAuth = (id, data) => {
const updatePassword = (id, data) => {
return request({
url: `/users/${id}/auth`,
method: "put",
@ -32,7 +32,7 @@ const updateAuth = (id, data) => {
});
}
//更新用户密码
const updatePassword = (id, data) => {
const updateAuth = (id, data) => {
return request({
url: `/users/${id}/auth`,
method: "put",

View File

@ -196,8 +196,9 @@
:on-change="handleChangeFiles"
list-type="picture"
multiple
accept="application/json,image/png,image/jpg,image/jpeg"
accept="application/json,image/jpeg"
>
<!--accept="application/json,image/png,image/jpg,image/jpeg"-->
<el-button type="primary"
><el-icon class="el-icon--upload"> <i-ep-upload-filled /> </el-icon
>选择文件</el-button
@ -205,7 +206,7 @@
<template #tip>
<div class="el-upload__tip">
请上传大小不超过 <strong style="color: red">10M</strong>格式为
<strong style="color: red">png/jpg/jpeg/json</strong> 的文件
<strong style="color: red">json/jpg</strong> 的文件
</div>
</template>
</el-upload>
@ -524,8 +525,8 @@ const initData = () => {
DataSetApi.dataSetInfo(id).then((res) => {
if (res.data.code == 0) {
let resolution = res.data.data.image_resolution.split("x");
res.data.data.image_width=resolution[0];
res.data.data.image_height=resolution[1];
res.data.data.image_width = resolution[0];
res.data.data.image_height = resolution[1];
form.value = res.data.data;
codeHtml.value = JSON.stringify(res.data.data.dataset_parameters);
if (codeHtml.value == "{}") {
@ -557,12 +558,14 @@ const initData = () => {
const handleQuery = () => {
DataSetApi.rawFiles(ID.value).then((res) => {
if (res.data.code == 0) {
let list = [];
res.data.data.file_name_list.forEach((item) => {
list.push({ name: item, url: item });
});
imageList.value = list;
imgCount.value = imageList.value.length;
if (res.data.data.file_name_list) {
let list = [];
res.data.data.file_name_list.forEach((item) => {
list.push({ name: item, url: item });
});
imageList.value = list;
imgCount.value = imageList.value.length;
}
}
});
};

View File

@ -133,7 +133,11 @@ const handleSubmit = useThrottleFn(() => {
function initUnregistedList() {
DeviceApi.unregisted(queryParams).then((res) => {
if (res.data.code == 0) {
unregistedList.value = res.data.data.UnregistedList;
let list = [];
res.data.data.device_info.forEach(item => {
list.push(item.device_info);
})
unregistedList.value = list;
}
});
}

View File

@ -135,7 +135,12 @@ const handleSubmit = useThrottleFn(() => {
function initUnregistedList() {
DeviceApi.unregisted(queryParams).then((res) => {
if (res.data.code == 0) {
unregistedList.value = res.data.data.UnregistedList;
let list = [];
res.data.data.device_info.forEach(item => {
item.device_info.pcie_index = item.pcie_index;
list.push(item.device_info);
})
unregistedList.value = list;
}
});
}

View File

@ -62,7 +62,7 @@ import DeviceApi from "@/api/device";
const route = useRoute();
const router = useRouter();
const form = reactive({});
const form = ref({});
const formRef = ref(ElForm); //
const loading = ref(false); //
const list = ref([]); //
@ -79,7 +79,7 @@ const handleSubmit = useThrottleFn(() => {
formRef.value.validate((valid: any) => {
if (valid) {
loading.value = true;
DeviceApi.updateDevices(form)
DeviceApi.updateDevices(form.value.device_id,form.value)
.then((res) => {
if (res.data.code == 0) {
ElMessage.success("保存成功");
@ -112,10 +112,10 @@ function initPage() {
data.cmpt_interface_type = device_info.cmpt_interface_type;
list.value.push(data);
}
form.device_id = res.data.data.device_id || device_info.device_id;
form.device_name = device_info.device_name;
form.device_desc = device_info.device_desc;
form.infomation = device_info.infomation;
form.value.device_id = res.data.data.device_id || device_info.device_id;
form.value.device_name = device_info.device_name;
form.value.device_desc = device_info.device_desc;
form.value.infomation = device_info.infomation;
})
.finally(() => {
loading.value = false;

View File

@ -107,7 +107,7 @@
show-password
/>
</el-form-item>
<el-form-item label="确认密码" prop="password" v-if="!form.user_id == null">
<el-form-item label="确认密码" prop="password" v-if="form.user_id == null">
<el-input
v-model="form.password"
type="password"
@ -221,7 +221,7 @@ function resetPassword(row: { [key: string]: any }) {
ElMessage.warning("密码至少需要6位字符请重新输入");
return false;
}
UserAPI.updatePassword(row.id, { password: value }).then((res) => {
UserAPI.updatePassword(row.user_id, { password: value }).then((res) => {
if (res.data.code == 0) {
ElMessage.success("密码重置成功,新密码是:" + value);
} else {