Commit 76655305 by 李少勇

整理前端文件、提取gitopn相关代码到business文件夹

parent 27deec92
......@@ -105,9 +105,9 @@
import event from '../event'
import commonProcess from "~/mixin/commonProcess";
import commonFuncs from "~/mixin/commonFuncs";
import formRules from '../model'
import formRules from '../model/check'
import CodeTable from "~/config/CodeTable";
import Gitopn from "~/model/Gitopn";
import Gitopn from "../model";
import Opnp from "./Opnp";
import Ovwp from "./Ovwp";
import Ptyp from "./Ptyp";
......
<template>
<section id="business_container">
<transition name="fade-transform" mode="out-in">
<keep-alive :include="cachedViews">
<router-view :key="key" />
</keep-alive>
</transition>
<component
v-for="item in hasOpenComponentsArr"
:key="item.name"
:is="item.name"
v-show="$route.path === item.path"
></component>
</section>
</template>
<script>
import Vue from "vue";
import DzSys from "~/views/Layout/dz/DzSys.vue";
import { getDzSysMenu } from "~/views/Layout/dz/menus.js";
export default {
name: "Business",
watch: {
$route() {
if (this.$route.path.startsWith("/review")) {
this.$store.commit("setMode", "display");
} else {
this.$store.commit("setMode", "normal");
}
this.componentsArr.forEach(comp => {
if (!this.visitedViews.find(view => view.path === comp.path)) {
comp.hasOpen = false
}
})
// 判断当前路由是否iframe页
this.isOpenIframePage();
},
},
created() {
console.log("进入业务交易界面");
// 设置iframe页的数组对象
const componentsArr = []
const dzSysMenu = getDzSysMenu()
this.getComponentsArr(componentsArr, dzSysMenu ? dzSysMenu.children : []);
componentsArr.forEach((item) => {
Vue.component(item.name, DzSys);
});
this.componentsArr = componentsArr;
// 判断当前路由是否iframe页
this.isOpenIframePage();
},
computed: {
cachedViews() {
return this.$store.state.TagsView.cachedViews;
},
visitedViews() {
return this.$store.state.TagsView.visitedViews;
},
key() {
return this.$route.path;
},
// 实现懒加载,只渲染已经打开过(hasOpen:true)的iframe页
hasOpenComponentsArr() {
return this.componentsArr.filter(item => item.hasOpen);
}
},
data() {
return {
componentsArr: []
}
},
methods: {
// 根据当前路由设置hasOpen
isOpenIframePage() {
const target = this.componentsArr.find(item => {
return item.path === this.$route.path
});
if (target && !target.hasOpen) {
target.hasOpen = true;
}
},
// 遍历路由的所有页面,把含有iframeComponent标识的收集起来
getComponentsArr(arr, menus) {
for (let i = 0; i < menus.length; i++) {
const menu = menus[i];
if (menu.children.length) {
const tempArr = []
this.getComponentsArr(tempArr, menu.children)
arr.push(...tempArr)
} else {
arr.push({
name: menu.value,
path: menu.path,
hasOpen: false, // 是否打开过,默认false
})
}
}
}
}
};
</script>
<style>
#business_container {
flex: 1;
box-shadow: 0 1px 15px 0 rgb(0 0 0 / 12%), 0 0 3px 0 rgb(0 0 0 / 4%);
}
#business_container .eContainer, #business_container .eContainer-search{
box-sizing: border-box;
height: 100%;
width: 85%;
margin: 0 auto;
padding-top: 40px;
}
@media screen and (min-width: 2561px) {
#business_container .eContainer {
width: 85%;
}
}
@media screen and (min-width: 1921px) and (max-width: 2560px) {
#business_container .eContainer {
width: 90%;
}
}
@media screen and (min-width: 1441px) and (max-width: 1920px) {
#business_container .eContainer {
width: 93%;
}
}
@media screen and (min-width: 1200px) and (max-width: 1440px) {
#business_container .eContainer {
width: 95%;
}
}
@media screen and (max-width: 1199px) {
#business_container .eContainer {
width: 100%;
}
}
#business_container .eContainer {
background-color: #ffffff;
box-shadow: 0 1px 15px 0 rgb(0 0 0 / 12%), 0 0 3px 0 rgb(0 0 0 / 4%);
}
#business_container .eContainer .eContainer,
#business_container .eContainer .eContainer-search,
#business_container .eContainer-search .eContainer,
#business_container .eContainer-search .eContainer-search{
width: 100%;
margin: 0;
padding-top: 0;
background-color: unset;
box-shadow: unset;
}
/*
#business_container .eibs-tab {
padding: 40px;
}
*/
#business_container .eibs::before, #business_container .eibs-tab::before,
#business_container .eibs::after, #business_container .eibs-tab::after {
content: "";
display: block;
clear: both;
}
.eibs{
margin-top: 20px;
}
</style>
<template>
<div class="eContainer-search">
<el-form :model="model" :rules="rules" ref="modelForm" label-width="120px" label-position="right" size="small"
:validate-on-rule-change="false">
<c-content>
<m-infsea :model="model" :codes="codes" ref="infsea" />
</c-content>
</el-form>
</div>
</template>
<script>
import Api from "~/service/Api";
import CodeTable from "~/config/CodeTable";
import Infgid from "~/model/Infgid";
import commonProcess from "~/mixin/commonProcess";
import Check from "~/model/Infgid/Check";
import Default from "~/model/Infgid/Default";
import Pattern from "~/model/Infgid/Pattern";
import Infsea from "./Infsea";
export default {
name: "Infgid",
components: {
"m-infsea": Infsea,
},
provide() {
return {
root: this,
};
},
mixins: [commonProcess], // 里面包含了Default、Check等的公共处理
data() {
return {
tabVal: "",
trnName: "infgid",
model: new Infgid().data,
checkRules: Check,
defaultRules: Default,
pattern: Pattern,
rules: null,
codes: { ...CodeTable },
};
},
methods: {
myTabClick(tab) {
this.tabClick(tab);
/**
* do it yourself
**/
},
},
created: async function () {
console.log("进入infgid交易");
let rtnmsg = await this.init({});
if (rtnmsg.respCode == SUCCESS) {
this.updateModel(rtnmsg.data);
//TODO 处理数据逻辑
} else {
this.$notify.error({ title: "错误", message: "服务请求失败!" });
}
},
};
</script>
<style>
</style>
......@@ -8,6 +8,8 @@ import BusRouter from "../views/Business/BusRouter";
import ReviewRouter from "../views/Review/ReviewRouter";
import DocRouter from "../views/Docpan/DocRouter";
import ModelViewer from "../views/ModeViewer"
// 新交易模块
import Business from "./modules/business";
import StaticsRouter from "../views/Statics/StaticsRouter";
......@@ -55,6 +57,7 @@ export const routes = [
},
{ path: "/review", component: Layout, children: ReviewRouter },
{ path: "/business", component: Layout, children: BusRouter },
{ path: "/business-new", component: Layout, children: Business },
{ path: "/statics", component: Layout, children: StaticsRouter },
{ path: "/display", component: Display, children: DisplayRouter },
{ path: "/login", component: Login, name: "Login" },
......
const Business = [
{ path: 'infgid', component: () => import('~/business/infgid'), name: 'infgid', meta: { title: '保函入口交易' } },
{ path: 'gitopn', component: () => import('~/business/gitopn/views'), name: 'gitopn', meta: { title: '进口保函开立' } },
]
export default Business
......@@ -151,7 +151,7 @@ import Bftdrv from "./Bftdrv"
import ExamRule from "./ExamRule";
import Gitcom from "./Gitcom"
import Gitopn from "./Gitopn1/views"
import Gitopn from "./Gitopn"
import Gitpop from "./Gitpop"
import Gitame from "./Gitame"
import Gitsel from "./Gitsel"
......
......@@ -111,6 +111,7 @@
<tagViews></tagViews>
<div style="height: 0.5px;background-color: #1561e0;opacity: 0.2;"></div>
<business></business>
<business-new></business-new>
<toolbars @openTool="handleChooseTool"></toolbars>
</el-main>
</el-container>
......@@ -122,6 +123,7 @@ import headerCom from "./Header";
import sideMenu from "./SideMenu";
import tagViews from "./components/TagsView";
import business from "../Business";
import businessNew from "~/business";
import toolbars from "~/components/Toolbars";
import VueDraggableResizable from 'vue-draggable-resizable'
......@@ -140,7 +142,8 @@ export default {
headerCom,
sideMenu,
tagViews,
business,
business,
businessNew,
toolbars,
calculator,
cms,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment