main
parent
746ddfaf56
commit
171c93fc0e
|
@ -45,7 +45,7 @@ const devicesInfo = (id) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//更新设备信息
|
//更新设备信息
|
||||||
const updateDevices = (id) => {
|
const updateDevices = (id,data) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/devices/${id}`,
|
url: `/devices/${id}`,
|
||||||
method: "put",
|
method: "put",
|
||||||
|
|
|
@ -24,7 +24,7 @@ const deleteUser = (id) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//更新用户信息
|
//更新用户信息
|
||||||
const updateAuth = (id, data) => {
|
const updatePassword = (id, data) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/users/${id}/auth`,
|
url: `/users/${id}/auth`,
|
||||||
method: "put",
|
method: "put",
|
||||||
|
@ -32,7 +32,7 @@ const updateAuth = (id, data) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//更新用户密码
|
//更新用户密码
|
||||||
const updatePassword = (id, data) => {
|
const updateAuth = (id, data) => {
|
||||||
return request({
|
return request({
|
||||||
url: `/users/${id}/auth`,
|
url: `/users/${id}/auth`,
|
||||||
method: "put",
|
method: "put",
|
||||||
|
|
|
@ -196,8 +196,9 @@
|
||||||
:on-change="handleChangeFiles"
|
:on-change="handleChangeFiles"
|
||||||
list-type="picture"
|
list-type="picture"
|
||||||
multiple
|
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-button type="primary"
|
||||||
><el-icon class="el-icon--upload"> <i-ep-upload-filled /> </el-icon
|
><el-icon class="el-icon--upload"> <i-ep-upload-filled /> </el-icon
|
||||||
>选择文件</el-button
|
>选择文件</el-button
|
||||||
|
@ -205,7 +206,7 @@
|
||||||
<template #tip>
|
<template #tip>
|
||||||
<div class="el-upload__tip">
|
<div class="el-upload__tip">
|
||||||
请上传大小不超过 <strong style="color: red">10M</strong>,格式为
|
请上传大小不超过 <strong style="color: red">10M</strong>,格式为
|
||||||
<strong style="color: red">png/jpg/jpeg/json</strong> 的文件
|
<strong style="color: red">json/jpg</strong> 的文件
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</el-upload>
|
</el-upload>
|
||||||
|
@ -524,8 +525,8 @@ const initData = () => {
|
||||||
DataSetApi.dataSetInfo(id).then((res) => {
|
DataSetApi.dataSetInfo(id).then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
let resolution = res.data.data.image_resolution.split("x");
|
let resolution = res.data.data.image_resolution.split("x");
|
||||||
res.data.data.image_width=resolution[0];
|
res.data.data.image_width = resolution[0];
|
||||||
res.data.data.image_height=resolution[1];
|
res.data.data.image_height = resolution[1];
|
||||||
form.value = res.data.data;
|
form.value = res.data.data;
|
||||||
codeHtml.value = JSON.stringify(res.data.data.dataset_parameters);
|
codeHtml.value = JSON.stringify(res.data.data.dataset_parameters);
|
||||||
if (codeHtml.value == "{}") {
|
if (codeHtml.value == "{}") {
|
||||||
|
@ -557,12 +558,14 @@ const initData = () => {
|
||||||
const handleQuery = () => {
|
const handleQuery = () => {
|
||||||
DataSetApi.rawFiles(ID.value).then((res) => {
|
DataSetApi.rawFiles(ID.value).then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
let list = [];
|
if (res.data.data.file_name_list) {
|
||||||
res.data.data.file_name_list.forEach((item) => {
|
let list = [];
|
||||||
list.push({ name: item, url: item });
|
res.data.data.file_name_list.forEach((item) => {
|
||||||
});
|
list.push({ name: item, url: item });
|
||||||
imageList.value = list;
|
});
|
||||||
imgCount.value = imageList.value.length;
|
imageList.value = list;
|
||||||
|
imgCount.value = imageList.value.length;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
|
@ -133,7 +133,11 @@ const handleSubmit = useThrottleFn(() => {
|
||||||
function initUnregistedList() {
|
function initUnregistedList() {
|
||||||
DeviceApi.unregisted(queryParams).then((res) => {
|
DeviceApi.unregisted(queryParams).then((res) => {
|
||||||
if (res.data.code == 0) {
|
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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,12 @@ const handleSubmit = useThrottleFn(() => {
|
||||||
function initUnregistedList() {
|
function initUnregistedList() {
|
||||||
DeviceApi.unregisted(queryParams).then((res) => {
|
DeviceApi.unregisted(queryParams).then((res) => {
|
||||||
if (res.data.code == 0) {
|
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;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
@ -62,7 +62,7 @@ import DeviceApi from "@/api/device";
|
||||||
const route = useRoute();
|
const route = useRoute();
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|
||||||
const form = reactive({});
|
const form = ref({});
|
||||||
const formRef = ref(ElForm); // 表单
|
const formRef = ref(ElForm); // 表单
|
||||||
const loading = ref(false); // 加载状态
|
const loading = ref(false); // 加载状态
|
||||||
const list = ref([]); // 注册设备
|
const list = ref([]); // 注册设备
|
||||||
|
@ -79,7 +79,7 @@ const handleSubmit = useThrottleFn(() => {
|
||||||
formRef.value.validate((valid: any) => {
|
formRef.value.validate((valid: any) => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
loading.value = true;
|
loading.value = true;
|
||||||
DeviceApi.updateDevices(form)
|
DeviceApi.updateDevices(form.value.device_id,form.value)
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage.success("保存成功");
|
ElMessage.success("保存成功");
|
||||||
|
@ -112,10 +112,10 @@ function initPage() {
|
||||||
data.cmpt_interface_type = device_info.cmpt_interface_type;
|
data.cmpt_interface_type = device_info.cmpt_interface_type;
|
||||||
list.value.push(data);
|
list.value.push(data);
|
||||||
}
|
}
|
||||||
form.device_id = res.data.data.device_id || device_info.device_id;
|
form.value.device_id = res.data.data.device_id || device_info.device_id;
|
||||||
form.device_name = device_info.device_name;
|
form.value.device_name = device_info.device_name;
|
||||||
form.device_desc = device_info.device_desc;
|
form.value.device_desc = device_info.device_desc;
|
||||||
form.infomation = device_info.infomation;
|
form.value.infomation = device_info.infomation;
|
||||||
})
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
loading.value = false;
|
loading.value = false;
|
||||||
|
|
|
@ -107,7 +107,7 @@
|
||||||
show-password
|
show-password
|
||||||
/>
|
/>
|
||||||
</el-form-item>
|
</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
|
<el-input
|
||||||
v-model="form.password"
|
v-model="form.password"
|
||||||
type="password"
|
type="password"
|
||||||
|
@ -221,7 +221,7 @@ function resetPassword(row: { [key: string]: any }) {
|
||||||
ElMessage.warning("密码至少需要6位字符,请重新输入");
|
ElMessage.warning("密码至少需要6位字符,请重新输入");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
UserAPI.updatePassword(row.id, { password: value }).then((res) => {
|
UserAPI.updatePassword(row.user_id, { password: value }).then((res) => {
|
||||||
if (res.data.code == 0) {
|
if (res.data.code == 0) {
|
||||||
ElMessage.success("密码重置成功,新密码是:" + value);
|
ElMessage.success("密码重置成功,新密码是:" + value);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue