fix: BUG修改
This commit is contained in:
parent
54b454b6b8
commit
92c560ed8b
@ -0,0 +1,181 @@
|
||||
<template>
|
||||
<el-dialog title="查看文件列表" width="70%" v-model="visible1" show-close>
|
||||
<div>
|
||||
<div style="width: 90%; margin: 0 auto">
|
||||
<el-table
|
||||
:data="annexFiles"
|
||||
class="el-table"
|
||||
:header-cell-style="{ textAlign: 'center' }"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column type="index" label="序号" width="200" />
|
||||
<el-table-column prop="dictValue" label="附件名称" />
|
||||
<el-table-column label="操作" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link size="small" @click="onAppendix(row)">查看</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="visible1 = false">关闭</el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog v-model="dialogVisible" title="查看附件" width="30%" show-close>
|
||||
<el-upload
|
||||
ref="upload"
|
||||
:headers="headers"
|
||||
:show-file-list="false"
|
||||
class="upload-demo"
|
||||
:action="`${baseUrl}` + '/xmgl/file/upload'"
|
||||
multiple
|
||||
:on-success="uploadSuccess"
|
||||
style="width: 100%; margin-left: 20px; margin-bottom: 20px"
|
||||
>
|
||||
<el-button class="uploadBtn" type="primary">添加文件</el-button>
|
||||
</el-upload>
|
||||
<el-table
|
||||
:data="current"
|
||||
height="180"
|
||||
class="el-table"
|
||||
:header-cell-style="{ textAlign: 'center' }"
|
||||
:cell-style="{ textAlign: 'center' }"
|
||||
>
|
||||
<el-table-column prop="fileName" label="文件名称" />
|
||||
<el-table-column label="操作" width="200">
|
||||
<template #default="{ row }">
|
||||
<el-button type="primary" link size="small" @click="onDowmload(row)">下载</el-button>
|
||||
<el-button type="primary" link size="small" @click="onDowmload(row)">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<template #footer>
|
||||
<span class="dialog-footer">
|
||||
<el-button type="primary" @click="dialogVisible = false"> 关闭 </el-button>
|
||||
</span>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</template>
|
||||
<script setup lang="tsx" name="readonlyDialog">
|
||||
import { onMounted, watch, ref } from "vue";
|
||||
import { getIdEngApproveList } from "@/api/modules/goverment";
|
||||
import { getDicList, exportApp } from "@/api/modules/jxjview";
|
||||
import { ElMessage, ElMessageBox } from "element-plus";
|
||||
import { useDownload } from "@/hooks/useDownload";
|
||||
import { GlobalStore } from "@/stores";
|
||||
const emits = defineEmits(["update:fileListVisible"]);
|
||||
const props = defineProps(["relativeId", "fileListVisible"]);
|
||||
const store = GlobalStore();
|
||||
const baseUrl = import.meta.env.VITE_API_URL;
|
||||
const headers = ref({ Authorization: "Bearer " + store.token });
|
||||
const current = ref([]);
|
||||
const dialogVisible = ref(false);
|
||||
const annexFiles = ref([]);
|
||||
const visible1 = ref(false);
|
||||
const form = ref({});
|
||||
const addressList = ref({});
|
||||
const uploadSuccess = (response: any) => {
|
||||
ElMessage.success("上传成功");
|
||||
// formData.value.videoUrl = response.result.url;
|
||||
// fileList.value = [{ name: response.result.originalFilename, url: response.result.downloadPath }];
|
||||
};
|
||||
const onDowmload = row => {
|
||||
ElMessageBox.confirm("确认下载数据?", "温馨提示", { type: "warning" }).then(() =>
|
||||
useDownload(exportApp, `${row.fileName}`, { fileUrl: row.fileUrl })
|
||||
);
|
||||
};
|
||||
// 附件信息的查看点击
|
||||
const onAppendix = row => {
|
||||
dialogVisible.value = true;
|
||||
|
||||
current.value = form.value.annexFiles.filter(item => item.label == row.dictLabel);
|
||||
};
|
||||
const getDataDetail = async () => {
|
||||
// console.log(row);
|
||||
const res = await getIdEngApproveList({ id: props.relativeId });
|
||||
form.value = res.result;
|
||||
addressList.value = {
|
||||
province: res.result.province,
|
||||
city: res.result.city,
|
||||
district: res.result.district
|
||||
};
|
||||
form.value.position = `${"经度:" + res.result.longitude + ",纬度:" + res.result.latitude}`;
|
||||
console.log(props.relativeId);
|
||||
};
|
||||
watch(
|
||||
() => props.fileListVisible,
|
||||
(n, o) => {
|
||||
if (n) {
|
||||
getDataDetail();
|
||||
}
|
||||
visible1.value = n;
|
||||
}
|
||||
);
|
||||
watch(
|
||||
() => visible1.value,
|
||||
(n, o) => {
|
||||
emits("update:fileListVisible", n);
|
||||
}
|
||||
);
|
||||
onMounted(async () => {
|
||||
const res2 = await getDicList({ dictType: "attachment_name" });
|
||||
annexFiles.value = res2.result.map(item => ({ ...item, files: [] }));
|
||||
});
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
.el-table {
|
||||
width: calc(100% - 20px);
|
||||
margin-left: 20px;
|
||||
}
|
||||
|
||||
.el-table_main {
|
||||
padding: 2% 4% 0 4%;
|
||||
}
|
||||
:deep(.el-tabs--card > .el-tabs__header) {
|
||||
border-bottom: none;
|
||||
}
|
||||
:deep(.el-tabs--card > .el-tabs__header .el-tabs__nav) {
|
||||
width: 600px;
|
||||
border: none;
|
||||
}
|
||||
:deep(.el-tabs__nav-scroll) {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
.el-tabs__item {
|
||||
width: 33.33%;
|
||||
text-align: center;
|
||||
// background: #fff;
|
||||
color: var(--el-menu-text-color);
|
||||
font-size: 16px;
|
||||
|
||||
border: 1px solid #aeaeae;
|
||||
// border-radius: 8px;
|
||||
}
|
||||
.el-tabs__item.is-active {
|
||||
background-color: #008bff;
|
||||
color: var(--el-menu-text-color);
|
||||
font-size: 16px;
|
||||
}
|
||||
}
|
||||
:deep(#tab-first) {
|
||||
border-radius: 4px 0 0 4px;
|
||||
border-left: 1px solid #aeaeae;
|
||||
}
|
||||
:deep(#tab-third) {
|
||||
border-radius: 0 4px 4px 0;
|
||||
}
|
||||
:deep(.el-input--suffix) {
|
||||
width: 100%;
|
||||
}
|
||||
.test :deep(.el-input__wrapper) {
|
||||
box-shadow: 0 0 0 0;
|
||||
}
|
||||
.test :deep(.el-input__inner) {
|
||||
text-align: center;
|
||||
}
|
||||
</style>
|
||||
@ -18,6 +18,9 @@
|
||||
<el-button v-auth="'project_add'" class="btnStyle" @click="handleAddItem">新增</el-button>
|
||||
</template>
|
||||
<template #operation="{ row }">
|
||||
<el-button type="primary" link @click="onFileList(row)"
|
||||
><img src="@/assets/images/tableIcon/look.png" alt="" class="configureIcon" /><span>文件列表</span></el-button
|
||||
>
|
||||
<el-button type="primary" link @click="onSee(row)"
|
||||
><img src="@/assets/images/tableIcon/look.png" alt="" class="configureIcon" /><span>查看</span></el-button
|
||||
>
|
||||
@ -49,6 +52,12 @@
|
||||
:relativeId="relativeId"
|
||||
@confirm="childrenDataUpdate"
|
||||
></editDialog>
|
||||
<!-- 项目列表 -->
|
||||
<fileListDialog
|
||||
v-model:fileListVisible="fileListVisible"
|
||||
:relativeId="relativeId"
|
||||
@confirm="childrenDataUpdate"
|
||||
></fileListDialog>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -63,12 +72,14 @@ import ProTable from "@/components/ProTable/index.vue";
|
||||
import ProjectSupervision from "./components/ProjectSupervision/index.vue";
|
||||
import readonlyDialog from "./components/readonlyDialog/index.vue";
|
||||
import editDialog from "./components/editDialog/index.vue";
|
||||
import fileListDialog from "./components/fileListDialog/index.vue";
|
||||
import { getEngineeringApproveList, getEngineeringApproveArea, getIdEngApproveList } from "@/api/modules/goverment";
|
||||
import { getDicList } from "@/api/modules/jxjview";
|
||||
import { GlobalStore } from "@/stores";
|
||||
import largeScreen from "../../../hz-enterprise/largeScreen/largeScreenOne/index.vue";
|
||||
const showScreen = ref(false);
|
||||
const router = useRouter();
|
||||
const fileListVisible = ref(false);
|
||||
const editennMEssageVisible = ref(false);
|
||||
const ennMEssageVisible = ref(false);
|
||||
const DicStatusList = ref([]);
|
||||
@ -123,7 +134,7 @@ const columns: ColumnProps[] = [
|
||||
}
|
||||
}
|
||||
},
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 300 }
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 380 }
|
||||
];
|
||||
const relativeId = ref("");
|
||||
const detailsDialog = ref(false);
|
||||
@ -134,6 +145,11 @@ const childrenDataUpdate = () => {
|
||||
};
|
||||
// 获取 ProTable 元素,调用其获取刷新数据方法(还能获取到当前查询参数,方便导出携带参数)
|
||||
const proTable = ref();
|
||||
// 查看文件列表
|
||||
const onFileList = (row: any) => {
|
||||
relativeId.value = row.id;
|
||||
fileListVisible.value = true;
|
||||
};
|
||||
const onSee = row => {
|
||||
relativeId.value = row.id;
|
||||
ennMEssageVisible.value = true;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user