This commit is contained in:
Teo
2025-08-14 01:58:00 +08:00
parent 606722f19e
commit 3158dc84f7
99 changed files with 620 additions and 554 deletions

View File

@ -60,7 +60,7 @@ export default defineComponent({
tableData: [],
param: {
type: 2,
projectId: currentProject.value.id
projectId: currentProject.value?.id
},
total: 0,
ids: [] //所选择的文件

View File

@ -128,7 +128,7 @@ export default defineComponent({
fileList: [],
activeName: 'first',
breadcrumbList: [{ id: 0, fileName: '目录' }], //菜单列表
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
parentPid: '0', //父级的id 默认为0
fileType: 0, //文件 或压缩文件
list: [
@ -202,7 +202,7 @@ export default defineComponent({
text: '正在查询文件……',
background: 'rgba(0, 0, 0, 0.7)'
});
documentCompletionTreeStructure({ projectId: currentProject.value.id, pid: state.parentPid }).then((res: any) => {
documentCompletionTreeStructure({ projectId: currentProject.value?.id, pid: state.parentPid }).then((res: any) => {
loading.close();
if (res.code == 200) {
state.fileList = res.data || [];

View File

@ -56,7 +56,7 @@ const ids = ref<string>('');
const tableData = ref<any[]>([]);
const param = reactive({
type: 2,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
pageNum: 1,
pageSize: 10
});
@ -67,7 +67,7 @@ const getDocumentDataList = () => {
loading.value = true;
tableData.value = [];
value.value = '2';
param.projectId = currentProject.value.id;
param.projectId = currentProject.value?.id;
documentDataAllList(param).then((res: any) => {
tableData.value = res.rows ?? [];
total.value = res.total;

View File

@ -453,7 +453,7 @@ onMounted(() => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
state.projectId = nid;
state.paramsQuery.projectId = nid;

View File

@ -125,7 +125,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionUserAnswerForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
userId: undefined,
bankId: undefined,
answer: undefined,
@ -145,7 +145,7 @@ const data = reactive<PageData<QuestionUserAnswerForm, QuestionUserAnswerQuery>>
userId: undefined,
examType: undefined,
teamId: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
userName: undefined,
params: {}
},
@ -221,7 +221,7 @@ const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
// const fileWatch = watch(
// () => filePath.value,
// (nid, oid) => {
// uploadQuestionUserAnswer({ file: filePath.value, projectId: currentProject.value.id }).then((res) => {
// uploadQuestionUserAnswer({ file: filePath.value, projectId: currentProject.value?.id }).then((res) => {
// console.log(res);
// });
// }
@ -229,7 +229,7 @@ const downloadOssOne = async (row?: QuestionUserAnswerVO) => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -111,7 +111,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionsCategoryForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
categoryName: undefined
};
const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
@ -119,7 +119,7 @@ const data = reactive<PageData<QuestionsCategoryForm, QuestionsCategoryQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
categoryName: undefined,
params: {}
},
@ -194,7 +194,7 @@ const submitForm = () => {
questionsCategoryFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
form.value.projectId = currentProject.value.id;
form.value.projectId = currentProject.value?.id;
if (form.value.id) {
await updateQuestionsCategory(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -218,7 +218,7 @@ const handleDelete = async (row?: QuestionsCategoryVO) => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -165,7 +165,7 @@ const dialog = reactive<DialogOption>({
const initFormData: QuestionsConfigForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
singleChoice: undefined,
singleScore: undefined,
multipleChoice: undefined,
@ -181,7 +181,7 @@ const data = reactive<PageData<QuestionsConfigForm, QuestionsConfigQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
singleChoice: undefined,
singleScore: undefined,
multipleChoice: undefined,

View File

@ -270,7 +270,7 @@ onMounted(() => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
getList();

View File

@ -217,7 +217,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyInspectionForm = {
id: undefined,
pid: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
checkType: undefined,
violationType: undefined,
inspectionResult: undefined,
@ -247,7 +247,7 @@ const data = reactive<PageData<SafetyInspectionForm, SafetyInspectionQuery>>({
pageSize: 10,
id: undefined,
pid: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
checkType: undefined,
violationType: undefined,
inspectionResult: undefined,
@ -286,7 +286,7 @@ const getList = async () => {
safetyInspectionList.value = res.rows;
total.value = res.total;
// 获取项目班组信息
const teamRes = await listProjectTeamForeman(currentProject.value.id);
const teamRes = await listProjectTeamForeman(currentProject.value?.id);
teamList.value = teamRes.data;
teamOpt.value = teamList.value.map((team: ProjectTeamForemanResp) => ({
label: team.teamName,
@ -367,7 +367,7 @@ const submitForm = () => {
safetyInspectionFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
form.value.projectId = currentProject.value.id;
form.value.projectId = currentProject.value?.id;
if (form.value.id) {
await updateSafetyInspection(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -402,7 +402,7 @@ const handleExport = () => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -165,7 +165,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyLogForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
dateOfOccurrence: undefined,
airTemperatureMax: undefined,
airTemperatureMin: undefined,
@ -188,7 +188,7 @@ const data = reactive<PageData<SafetyLogForm, SafetyLogQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
dateOfOccurrence: undefined,
airTemperatureMax: undefined,
airTemperatureMin: undefined,
@ -284,7 +284,7 @@ const submitForm = () => {
safetyLogFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
form.value.projectId = currentProject.value.id;
form.value.projectId = currentProject.value?.id;
if (form.value.id) {
await updateSafetyLog(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -319,7 +319,7 @@ const handleExport = () => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -142,7 +142,7 @@ const dialog = reactive<DialogOption>({
const initFormData: SafetyWeeklyReportForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
week: undefined,
scope: undefined,
scopeEnd: undefined,
@ -155,7 +155,7 @@ const data = reactive<PageData<SafetyWeeklyReportForm, SafetyWeeklyReportQuery>>
pageNum: 1,
pageSize: 10,
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
week: undefined,
scopeDate: undefined,
remark: undefined,
@ -231,7 +231,7 @@ const submitForm = () => {
safetyWeeklyReportFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
form.value.projectId = currentProject.value.id;
form.value.projectId = currentProject.value?.id;
if (form.value.id) {
await updateSafetyWeeklyReport(form.value).finally(() => (buttonLoading.value = false));
} else {
@ -266,7 +266,7 @@ const handleExport = () => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -135,7 +135,7 @@ const dialog = reactive<DialogOption>({
const initFormData: TeamMeetingForm = {
id: undefined,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
teamId: undefined,
contractorId: undefined,
meetingDate: undefined,
@ -150,7 +150,7 @@ const data = reactive<PageData<TeamMeetingForm, TeamMeetingQuery>>({
queryParams: {
pageNum: 1,
pageSize: 10,
projectId: currentProject.value.id,
projectId: currentProject.value?.id,
teamId: undefined,
contractorId: undefined,
meetingDate: undefined,
@ -272,7 +272,7 @@ const handleExport = () => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
queryParams.value.projectId = nid;
form.value.projectId = nid;

View File

@ -267,7 +267,7 @@ onMounted(() => {
//监听项目id刷新数据
const listeningProject = watch(
() => currentProject.value.id,
() => currentProject.value?.id,
(nid, oid) => {
state.tableData.param.projectId = nid;
initTableData();