| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141 |
- <template>
- <div class="container">
- <div id="header">
- <div class="logo">
- <img
- src="/static/images/logo.png"
- style="width: 24px; height: 24px; vertical-align: middle"
- alt=""
- />
- 青浦区“一张图”区级节点
- </div>
- </div>
- <div style="z-index: 999;right: 20px; position: absolute;line-height: 44px;">
- <span v-for="item in funcList" :key="item.label" :class="{'tab-item_active': item.type == activeName , 'tab-item': item.type != activeName}" @click="handleClick(item)">{{item.label}}</span>
- <!-- <el-tabs
- v-model="activeName"
- type="border-card"
- class="demo-tabs"
- @tab-click="handleClick"
- >
- <el-tab-pane v-for="item in funcList" :key="item.label" :label="item.label" :name="item.label">
- </el-tab-pane>
- </el-tabs> -->
- </div>
- <div style="height: 44px;"></div>
- <!-- 复用的iframe:根据激活标签动态改src -->
- <div class="win-iframe-container">
- <iframe
- :src="iframeSrc"
- width="100%"
- height="100%"
- frameborder="0"
- allowfullscreen
- ></iframe>
- </div>
- </div>
- </template>
- <script>
- export default {
- data() {
- return {
- activeName: "",
- funcList: systemConfig.sksjgl.list,
- nowFuncContent: [],
- iframeSrc: "",
- };
- },
- mounted() {
- this.dmsDataProxy = systemConfig.dmsDataProxy;
- this.activeName = this.$route.query.activePanel ? this.$route.query.activePanel : "";
- this.changePanel(this.activeName);
- },
- methods: {
- changePanel(active) {
- console.log("========"+active);
- this.activeName = parseInt(active);
- this.nowFuncContent = this.funcList[this.activeName - 1];
- this.iframeSrc = this.nowFuncContent.url;
- },
- handleClick(tab) {
- console.log("========"+tab);
- this.iframeSrc = this.funcList.find(item => item.label == tab.label).url;
- this.activeName = tab.type;
- },
- handleClick2(tab, event) {
- let label = tab.props.label;
- this.iframeSrc = this.funcList.find(item => item.label == label).url;
- }
- },
- };
- </script>
- <style>
- .el-tabs--border-card>.el-tabs__content {
- padding: 0;
- display: none;
- }
- </style>
- <style lang="less" scoped>
- .container {
- width: 100%;
- height: 100%;
- margin: 0 auto;
- padding: 0;
- }
- .win-iframe {
- width: 100%;
- height: 100%;
- }
- .win-iframe-container {
- width: 100%;
- height: 100%;
- }
- .tab-item {
- display: inline-block;
- padding: 0 10px;
- cursor: pointer;
- color: #ffffff;
- &:hover {
- color: #409eff;
- }
- }
- .tab-item_active {
- display: inline-block;
- padding: 0 10px;
- cursor: pointer;
- color: #409eff;
- }
- #header::after {
- content: "";
- position: absolute;
- bottom: 0;
- left: 0;
- width: 100%;
- height: 1px; /* 边框厚度 */
- background-image: linear-gradient(to right, #071b3c, #71a5d4, #071b3c);
- }
- #header {
- width: 100vw;
- height: 44px;
- background: linear-gradient(180deg, #2c2f74, #494d98);
- color: #ffffff;
- margin: 0 auto;
- position: absolute;
- background: #002153;
- z-index: 999;
- .logo {
- display: inline-block;
- height: 44px;
- // width: 200px;
- // padding: 0 20px;
- padding: 0 20px 0px 20px;
- text-align: center;
- line-height: 44px;
- font-size: 18px;
- font-weight: bold;
- }
- }
- </style>
|