u
This commit is contained in:
1 parent
422d206bd6
commit
a4bd92264d
108 files changed
+16862
-35
No files matched your search
@@ -26,8 +26,8 @@ import {
|
||||
formatFileSize,
|
||||
getAliyunFileBlob,
|
||||
getFileExtension,
|
||||
uploadFile,
|
||||
buildPublicUrl,
|
||||
extractFilePath,
|
||||
} from "@/utils/file";
|
||||
import {
|
||||
insertFileApi,
|
||||
@@ -150,7 +150,7 @@ async function handleConfirmUpdate() {
|
||||
return;
|
||||
}
|
||||
|
||||
updateLoading.value = true;
|
||||
// updateLoading.value = true;
|
||||
|
||||
const requestData = [
|
||||
{
|
||||
@@ -162,20 +162,60 @@ async function handleConfirmUpdate() {
|
||||
subid: updateFile.value.subid,
|
||||
mx_filename: updateFile.value.mx_filename,
|
||||
mx_bz: updateFile.value.mx_bz,
|
||||
mx_cate_id: updateFile.value.mx_cate_id,
|
||||
},
|
||||
],
|
||||
deletes: [],
|
||||
},
|
||||
];
|
||||
|
||||
// 检查是否设置了箱门照
|
||||
if (updateFile.value.mx_cate_id === "0") {
|
||||
requestData[0].updates[0].mx_xh = "0";
|
||||
|
||||
// 检查数据库表其它是否有文件已经设置了箱门照
|
||||
const searchCondition = `father = '${props.father}' AND mx_cate_id = '0' AND subid != '${updateFile.value.subid}'`;
|
||||
const res = await loadDataApi("bf_file", searchCondition, "mx_xh", ["subid", "mx_xh"]);
|
||||
|
||||
if (res.success && res.data.length > 0) {
|
||||
requestData.push({
|
||||
tableName: "bf_file",
|
||||
keyField: "subid",
|
||||
inserts: [],
|
||||
updates: [
|
||||
{
|
||||
subid: res.data[0].subid,
|
||||
mx_cate_id: "1",
|
||||
mx_xh: updateFile.value.mx_xh,
|
||||
},
|
||||
],
|
||||
deletes: [],
|
||||
});
|
||||
|
||||
requestData.push({
|
||||
tableName: "b_container",
|
||||
keyField: "b_id",
|
||||
inserts: [],
|
||||
updates: [
|
||||
{
|
||||
b_id: props.father,
|
||||
b_container_img: extractFilePath(updateFile.value.mx_mapfilename),
|
||||
},
|
||||
],
|
||||
deletes: [],
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await saveObjectApi(requestData);
|
||||
|
||||
if (response.success) {
|
||||
ElMessage.success("文件名更新成功");
|
||||
updateFileName(updateFile.value);
|
||||
ElMessage.success("更新成功");
|
||||
|
||||
showUpdateDialog.value = false;
|
||||
|
||||
loadFiles()
|
||||
}
|
||||
} catch (error) {
|
||||
ElMessage.error("更新文件时发生错误");
|
||||
@@ -247,7 +287,7 @@ async function loadFiles() {
|
||||
}
|
||||
|
||||
try {
|
||||
const res = await loadDataApi("bf_file", searchCondition, "mx_xh");
|
||||
const res = await loadDataApi("bf_file", searchCondition, "mx_cate_id,mx_xh");
|
||||
|
||||
if (res.success) {
|
||||
let datas = res.data.map((item) => {
|
||||
@@ -1065,6 +1105,10 @@ function handleTreeNodeClick(data) {
|
||||
<el-input v-model="updateFile.mx_filename" />
|
||||
<div style="margin: 4px 0px">备注:</div>
|
||||
<el-input v-model="updateFile.mx_bz" />
|
||||
<template v-if="updateFile._status !== 'pending'">
|
||||
<div style="margin: 4px 0px">是否为箱门照:</div>
|
||||
<el-switch v-model="updateFile.mx_cate_id" active-value="0" inactive-value="1" />
|
||||
</template>
|
||||
</div>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
|
||||
Reference in new issue
Block a user