fix: BUG修改

This commit is contained in:
kun 2024-04-14 11:20:00 +08:00
parent 9e1c45c6c6
commit c53830b6ab
3 changed files with 82 additions and 67 deletions

View File

@ -93,6 +93,7 @@ if (process.env.NODE_ENV == 'development') {
// axios.defaults.baseURL = 'http://125.88.207.86:8088/'//中建四局线上(最新)地址 // axios.defaults.baseURL = 'http://125.88.207.86:8088/'//中建四局线上(最新)地址
// axios.defaults.baseURL = 'http://125.88.207.86:8099/'//中建四局(沙湖)线上(最新)地址 // axios.defaults.baseURL = 'http://125.88.207.86:8099/'//中建四局(沙湖)线上(最新)地址
axios.defaults.baseURL = 'http://jxj.zhgdyun.com:15551/'//测试地址 axios.defaults.baseURL = 'http://jxj.zhgdyun.com:15551/'//测试地址
// axios.defaults.baseURL = 'http://47.93.215.234:9809/'//测试地址
} else if (process.env.NODE_ENV == 'debug') { } else if (process.env.NODE_ENV == 'debug') {

View File

@ -48,22 +48,23 @@ export default new Vuex.Store({
PAGESIZRS: [10, 20, 30, 50], PAGESIZRS: [10, 20, 30, 50],
// UPLOADURL:' http://101.43.164.214:11111/upload/image/',// 百色 // UPLOADURL:' http://101.43.164.214:11111/upload/image/',// 百色
// FILEURL:' http://101.43.164.214:11111/image/',// 百色 // FILEURL:' http://101.43.164.214:11111/image/',// 百色
// UPLOADURL:'http://192.168.34.221:9111/upload/image/',// 郭圣雄 UPLOADURL:'http://192.168.34.221:9111/upload/image/',// 郭圣雄
// FILEURL:'http://192.168.34.221:9111/image/',//郭圣雄 FILEURL:'http://192.168.34.221:9111/image/',//郭圣雄
// WORKFLOWURL: 'http://192.168.34.138:88/#/workspace/forms',//测试工作流地址(本地) WORKFLOWURL: 'http://192.168.181.67:88/#/workspace/forms',//测试工作流地址(本地)
// UPLOADURL:'http://jxj.zhgdyun.com:15551/upload/image',//测试 // UPLOADURL:'http://jxj.zhgdyun.com:15551/upload/image',//测试
// FILEURL:'http://jxj.zhgdyun.com:15551/image/',//测试 // FILEURL:'http://jxj.zhgdyun.com:15551/image/',//测试
BASEURL: baseUrl // BASEURL: baseUrl
? baseUrl // ? baseUrl
: window.location.protocol + "//" + window.location.host + "/", //正式环境 // : window.location.protocol + "//" + window.location.host + "/", //正式环境
UPLOADURL: // UPLOADURL:
window.location.protocol + // window.location.protocol +
"//" + // "//" +
window.location.host + // window.location.host +
"/upload/image", //正式环境 // "/upload/image", //正式环境
FILEURL: window.location.protocol + "//" + window.location.host + "/image/", //正式环境 // FILEURL: window.location.protocol + "//" + window.location.host + "/image/", //正式环境
WORKFLOWURL: 'http://jxj.zhgdyun.com:9811/#/workspace/forms',//正式工作流地址 // WORKFLOWURL: 'http://jxj.zhgdyun.com:9811/#/workspace/forms',//正式工作流地址
// WORKFLOWURL: 'http://jxj.zhgdyun.com:9814/#/workspace/forms',//正式工作流地址
//--------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------
// BASEURL: baseUrl // BASEURL: baseUrl
// ? baseUrl // ? baseUrl

View File

@ -9,6 +9,7 @@
<div class="content-part" v-if="!selectGroupDialog && workSpaceShow"> <div class="content-part" v-if="!selectGroupDialog && workSpaceShow">
<iframe <iframe
id="myIframe" id="myIframe"
ref="myIframeRef"
:src=" :src="
`${$store.state.WORKFLOWURL}?token=${$store.state.userInfo.token}` `${$store.state.WORKFLOWURL}?token=${$store.state.userInfo.token}`
" "
@ -70,6 +71,7 @@ export default {
selectGroupDialog: true, selectGroupDialog: true,
groupListData: [], groupListData: [],
selectedDataSn: "", selectedDataSn: "",
postMessageDataList: [],
}; };
}, },
created() { created() {
@ -80,11 +82,63 @@ export default {
}, },
mounted() { mounted() {
// iframe // iframe
if (this.$store.state.selectedGroupSn) { if (this.$store.state.selectedGroupSn && !this.selectGroupDialog) {
this.getModuleList(); this.getModuleList();
} }
}, },
beforeDestroy() {
//
let iframe = this.$refs.myIframeRef;
iframe.removeEventListener("load", this.onIframeLoad);
},
methods: { methods: {
onIframeLoad() {
// iframe
//
const defaultMenuList = [
{
menuName: "审批列表",
path: "/workspace/forms",
icon: "el-icon-s-order",
},
{
menuName: "待我处理",
path: "/workspace/unfinished",
icon: "el-icon-s-check",
},
{
menuName: "已处理的",
path: "/workspace/finished",
icon: "el-icon-s-custom",
},
{
menuName: "我发起的",
path: "/workspace/submit",
icon: "el-icon-s-claim",
},
{
menuName: "关于我的",
path: "/workspace/cc",
icon: "el-icon-s-promotion",
},
];
let iframe = document.getElementById("myIframe");
iframe.contentWindow.postMessage(
{
type: "emitData",
data: JSON.stringify({
...this.$store.state.userInfo,
projectSn: this.$store.state.projectSn,
}),
authMenuList:
this.postMessageDataList.length > 0
? JSON.stringify(this.postMessageDataList)
: JSON.stringify(defaultMenuList),
},
"*"
);
},
// () // ()
getModuleList() { getModuleList() {
getNewUserAllModulePageApi({ getNewUserAllModulePageApi({
@ -121,50 +175,9 @@ export default {
} }
}); });
console.log(responseMenuList, "我的测试11112222222222"); console.log(responseMenuList, "我的测试11112222222222");
// this.postMessageDataList = responseMenuList;
const defaultMenuList = [ let iframe = this.$refs.myIframeRef;
{ iframe.addEventListener("load", this.onIframeLoad);
menuName: "审批列表",
path: "/workspace/forms",
icon: "el-icon-s-order",
},
{
menuName: "待我处理",
path: "/workspace/unfinished",
icon: "el-icon-s-check",
},
{
menuName: "已处理的",
path: "/workspace/finished",
icon: "el-icon-s-custom",
},
{
menuName: "我发起的",
path: "/workspace/submit",
icon: "el-icon-s-claim",
},
{
menuName: "关于我的",
path: "/workspace/cc",
icon: "el-icon-s-promotion",
},
];
this.$nextTick(() => {
setTimeout(() => {
let iframe = document.getElementById("myIframe");
iframe.contentWindow.postMessage(
{
type: "emitData",
data: JSON.stringify({...this.$store.state.userInfo, projectSn: this.$store.state.projectSn}),
authMenuList:
responseMenuList.length > 0
? JSON.stringify(responseMenuList)
: JSON.stringify(defaultMenuList),
},
"*"
);
}, 1000);
});
}); });
}, },
// //
@ -232,14 +245,14 @@ export default {
this.getUserNotify(); this.getUserNotify();
}, },
}, },
'$store.state.projectSn': { "$store.state.projectSn": {
deep: true, deep: true,
immediate: true, // immediate: true,
handler(to, from) { handler(to, from) {
console.log(to,'最新值') console.log(to, "最新值");
if(this.$store.state.projectSn) this.getModuleList(); if (this.$store.state.projectSn) this.getModuleList();
},
}, },
}
}, },
}; };
</script> </script>