fix: 🧩 flx:修改bug

This commit is contained in:
X_Rian 2024-08-01 18:03:46 +08:00
parent 508e43b52c
commit 58f7d41023
15 changed files with 91 additions and 38 deletions

View File

@ -2,14 +2,14 @@
NODE_ENV = 'development'
# 本地环境接口地址(/api/index.ts文件中使用)
VITE_API_URL = 'http://192.168.34.155:6688'
# VITE_API_URL = 'http://192.168.34.155:6688'
# VITE_API_URL = 'http://183.63.230.59:6090'
# VITE_API_URL = 'http://2xliv7gs.shenzhuo.vip:55296'
VITE_WPAPI_URL = "http://jxjzw.zhgdyun.com:8081"
# VITE_API_URL = "http://jxjzw.zhgdyun.com:9013"
# VITE_API_URL = 'https://xmglcs.hyjgxt.cn:6090'
VITE_API_URL = 'https://xmglcs.hyjgxt.cn:6090'
# 上传
VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
# VITE_ULD_API_URL = 'http://jxjzw.zhgdyun.com:8012/onlinePreview?url='
# VITE_ULD_API_URL = 'http://192.168.34.155:8012/onlinePreview?url='
VITE_ULD_API_URL = 'http://jxjzw.zhgdyun.com:8012/onlinePreview?url='

View File

@ -6,7 +6,7 @@ export enum ResultEnum {
SUCCESS = 200,
ERROR = 500,
OVERDUE = 401,
TIMEOUT = 30000,
TIMEOUT = 60000,
TYPE = "success"
}

View File

@ -321,3 +321,16 @@ export function sendIframeMessage(msg: any, type: any, iframeEle: any | undefine
window.parent.postMessage(msg, "*");
}
}
// 替换指定字符串内容
export function getSubstringAfter(str: string, searchStr: string) {
// 查找searchStr在str中的位置
const index = str.indexOf(searchStr);
console.log(index, searchStr);
// 如果找到了则截取searchStr之后的内容包括searchStr之后的所有字符
// 如果不想包括searchStr本身可以调整startIndex为index + searchStr.length
if (index !== -1) {
return str.substring(index + searchStr.length);
}
// 如果没有找到返回原字符串或null等根据需求决定
return false; // 或者返回空字符串"",表示没有找到
}

View File

@ -88,7 +88,9 @@ const next = async (data: { [key: string]: OverviewForm }, isTemporary: any) =>
annexFileList.value.push(...item.files);
}
});
addRepostData.value.annexFiles = annexFileList.value;
console.log(annexFileList.value, 22222222);
const map = new Map();
addRepostData.value.annexFiles = annexFileList.value.filter(v => !map.has(v.fileUrl) && map.set(v.fileUrl, v));
console.log(annexFileList.value, 111222);
console.log(addRepostData.value, 111222);
if (isTemporary) {
@ -111,6 +113,7 @@ const submit = async () => {
if (Array.isArray(requestData.projectSecondType)) {
requestData.projectSecondType = requestData.projectSecondType.join(",");
}
if (!store.Message) {
const data = await addPreEngineering(requestData);
ElMessage.success(data.message);
@ -129,7 +132,10 @@ const temporarySave = async () => {
let requestData = {
...addRepostData.value,
isDraft: 1 // 1
};
} as any;
if (Array.isArray(requestData.projectSecondType)) {
requestData.projectSecondType = requestData.projectSecondType.join(",");
}
if (!store.Message) {
const data = await addPreEngineering(requestData);
store.Message = { id: data.result };

View File

@ -38,8 +38,8 @@
</el-form-item>
</div>
<div class="row">
<el-form-item label="项目总投资:" prop="engineeringCost">
<el-input placeholder="请输入" v-model="form.engineeringCost" />
<el-form-item label="项目总投资:" prop="allCost">
<el-input placeholder="请输入" v-model="form.allCost" />
</el-form-item>
<el-form-item label="项目总面积(㎡):" prop="engineeringArea">
<el-input placeholder="请输入" v-model="form.engineeringArea" />
@ -144,7 +144,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
</div>
@ -315,7 +315,11 @@ onMounted(async () => {
item.files = files;
});
}
form.value.projectSecondType = store.Message.projectSecondType.split(",").map((item: string) => Number(item));
// console.log(111111, store.Message.projectSecondType, store.Message.projectSecondType.split(","));
form.value.projectSecondType =
store.Message.projectSecondType && store.Message.projectSecondType.split(",").map((item: string) => Number(item));
// console.log(form.value.projectSecondType);
form.value.allCost = store.Message.allCost;
}
// if (store.Message) {
// form.value = store.Message;

View File

@ -116,7 +116,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
@ -150,7 +150,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{

View File

@ -154,7 +154,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
@ -188,7 +188,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{

View File

@ -78,7 +78,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
@ -112,7 +112,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{

View File

@ -105,7 +105,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
@ -139,7 +139,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{

View File

@ -102,7 +102,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
@ -136,7 +136,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{

View File

@ -86,7 +86,7 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="next(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft">保存</el-button>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="next(ruleFormRef)">下一步</el-button>
</footer>
@ -120,7 +120,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{

View File

@ -242,7 +242,9 @@
<FileUpload v-model="showFilesUpload" @update:files="handlechange" :files="current.files" :reset="true" />
</div>
<footer class="footer">
<el-button type="primary" @click="handleSubmit(ruleFormRef, true)" v-if="!store.Message">保存</el-button>
<el-button type="primary" @click="handleSubmit(ruleFormRef, true)" v-if="!store.Message || store.Message.isDraft"
>保存</el-button
>
<el-button type="primary" @click="prev">上一步</el-button>
<el-button type="primary" @click="handleSubmit(ruleFormRef)">提交</el-button>
</footer>
@ -276,7 +278,7 @@ const showFilesUpload = ref(false);
const current = ref<AnnexFilesOptions>({} as AnnexFilesOptions);
const dictLabel = ref<undefined | number>(undefined);
const store = GlobalStore();
const store: any = GlobalStore();
const isOpen = ref(false);
const props = defineProps(["reportPersonList"]);
const emit = defineEmits<{
@ -408,7 +410,7 @@ const addFormContentFn = (index: number) => {
form.value.isNine = true;
let arr = [
{ dictValue: "编制文件", files: [] },
{ dictValue: "批复文件", files: [] },
{ dictValue: "批复文件", files: [] }
// { dictValue: "", files: [] }
];
form.value.engineeringSingles.push(...arr);

View File

@ -32,8 +32,8 @@
</el-form-item>
</div>
<div class="row">
<el-form-item label="项目总投资:" prop="engineeringCost">
<el-input placeholder="请输入" v-model="form.engineeringCost" />
<el-form-item label="项目总投资:" prop="allCost">
<el-input placeholder="请输入" v-model="form.allCost" />
</el-form-item>
<el-form-item label="项目总面积(㎡):" prop="engineeringArea">
<el-input placeholder="请输入" v-model="form.engineeringArea" />
@ -1214,9 +1214,10 @@ const onPreview = (row: any) => {
const onAppendix = row => {
console.log(row);
dialogVisible.value = true;
if (row.files.length) {
current.value = row.files;
}
// if (row.files.length) {
// current.value = row.files;
// }
current.value = row.files;
};
const getDataDetail = async () => {
// console.log(row);

View File

@ -313,6 +313,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
import type { FormInstance, UploadProps } from "element-plus";
import { relativeInfo, timeLineData, singleOptionAudit, allOptionAudit } from "@/api/modules/goverment";
import { submitReform } from "@/api/modules/project";
import { getSubstringAfter } from "@/utils/util";
import printJS from "print-js";
const props = defineProps({
detailsDialog: Boolean,
@ -506,7 +507,13 @@ const getInfo = async () => {
basicData.value = res.result;
recordData.value = res.result.inspectQuestionList;
recordData.value.map(item => {
item.image = eval(item.image);
item.image = eval(item.image).map((ele: any) => {
const newUrl = getSubstringAfter(ele.url, "https://xmgl.hyjgxt.cn:6090");
return {
...ele,
url: newUrl == false ? ele.url : window.location.protocol + "//" + window.location.host + newUrl
};
});
});
console.log(recordData);
};
@ -515,7 +522,13 @@ const getTimeLineList = async () => {
const res = await timeLineData({ inspectQuestionId: recordRowData.value.id });
res.result.map(item => {
item.solveImage = eval(item.solveImage);
item.solveImage = eval(item.solveImage).map((ele: any) => {
const newUrl = getSubstringAfter(ele.url, "https://xmgl.hyjgxt.cn:6090");
return {
...ele,
url: newUrl == false ? ele.url : window.location.protocol + "//" + window.location.host + newUrl
};
});
});
timelineList.value = res.result;
};

View File

@ -307,6 +307,7 @@ import type { FormInstance, UploadProps } from "element-plus";
import { relativeInfo, timeLineData, singleOptionAudit, allOptionAudit } from "@/api/modules/goverment";
import { submitReform } from "@/api/modules/project";
import printJS from "print-js";
import { getSubstringAfter } from "@/utils/util";
const baseUrl = window.location.protocol + "//" + window.location.host;
// const baseUrl = import.meta.env.VITE_API_URL;
const props = defineProps({
@ -492,13 +493,20 @@ const rowClick = row => {
};
//
const getInfo = async () => {
const res = await relativeInfo({ id: props.relativeId });
const res: any = await relativeInfo({ id: props.relativeId });
basicData.value = res.result;
recordData.value = res.result.inspectQuestionList;
recordData.value.map(item => {
item.image = eval(item.image);
recordData.value.map((item: any) => {
item.image = eval(item.image).map((ele: any) => {
const newUrl = getSubstringAfter(ele.url, "https://xmgl.hyjgxt.cn:6090");
return {
...ele,
url: newUrl == false ? ele.url : window.location.protocol + "//" + window.location.host + newUrl
};
});
});
console.log(recordData);
console.log(33333, recordRowData.value);
};
const timelineList = ref([{ name: 1 }]);
//
@ -506,7 +514,13 @@ const getTimeLineList = async () => {
const res = await timeLineData({ inspectQuestionId: recordRowData.value.id });
res.result.map(item => {
item.solveImage = eval(item.solveImage);
item.solveImage = eval(item.solveImage).map((ele: any) => {
const newUrl = getSubstringAfter(ele.url, "https://xmgl.hyjgxt.cn:6090");
return {
...ele,
url: newUrl == false ? ele.url : window.location.protocol + "//" + window.location.host + newUrl
};
});
});
timelineList.value = res.result;
};