2021-12-14 18:36:19 +08:00
|
|
|
<template>
|
|
|
|
|
<div id="app">
|
2022-06-13 10:46:55 +08:00
|
|
|
<header-nav v-if="showTools" title="web端产品库">
|
2022-05-10 19:16:02 +08:00
|
|
|
<template #right>
|
2022-11-04 18:12:28 +08:00
|
|
|
<mock/>
|
2024-09-03 15:49:06 +08:00
|
|
|
<div @click="showTools=false,dvDev=true">大屏开发</div>
|
2022-05-10 19:16:02 +08:00
|
|
|
<div @click="showTools=false">隐藏工具栏</div>
|
|
|
|
|
<div @click="handleLogin">点此登录</div>
|
|
|
|
|
</template>
|
|
|
|
|
</header-nav>
|
2024-09-29 11:07:35 +08:00
|
|
|
<ai-dv-wrapper class="fill" v-if="dvDev">
|
2024-10-10 17:35:04 +08:00
|
|
|
<router-view v-bind="commonAttrs"/>
|
2024-09-03 15:49:06 +08:00
|
|
|
</ai-dv-wrapper>
|
|
|
|
|
<el-row v-else-if="showTools" class="fill mar-t48" type="flex">
|
2022-08-25 09:54:56 +08:00
|
|
|
<slider-nav/>
|
2024-10-10 17:35:04 +08:00
|
|
|
<main-content class="fill" :commonAttrs="commonAttrs"/>
|
2021-12-14 18:36:19 +08:00
|
|
|
</el-row>
|
2024-10-10 17:35:04 +08:00
|
|
|
<router-view class="fill" v-else v-bind="commonAttrs"/>
|
2021-12-14 18:36:19 +08:00
|
|
|
<div v-if="dialog" class="sign-box">
|
2022-07-27 10:24:38 +08:00
|
|
|
<ai-sign style="margin: auto" :instance="$request" :action="{login}"
|
2021-12-14 18:36:19 +08:00
|
|
|
visible @login="getToken" :showScanLogin="false"/>
|
|
|
|
|
</div>
|
|
|
|
|
<el-button type="info" v-if="!showTools" class="fixedBtn" @click="showTools=true">显示工具栏</el-button>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2022-05-10 18:46:57 +08:00
|
|
|
import SliderNav from "./components/sliderNav";
|
2022-05-10 19:16:02 +08:00
|
|
|
import MainContent from "./components/mainContent";
|
|
|
|
|
import HeaderNav from "./components/headerNav";
|
2022-07-19 15:20:10 +08:00
|
|
|
import {mapActions, mapMutations, mapState} from "vuex";
|
2022-11-04 18:12:28 +08:00
|
|
|
import Mock from "./components/mock";
|
2024-10-10 17:35:04 +08:00
|
|
|
import AiDvWrapper from "dui/dv/layout/AiDvWrapper/AiDvWrapper.vue";
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
name: 'app',
|
2024-09-03 15:49:06 +08:00
|
|
|
components: {AiDvWrapper, Mock, HeaderNav, MainContent, SliderNav},
|
2021-12-14 18:36:19 +08:00
|
|
|
computed: {
|
2022-05-16 11:10:11 +08:00
|
|
|
...mapState(['user']),
|
2022-03-23 11:23:32 +08:00
|
|
|
login() {
|
|
|
|
|
let url = '/auth/oauth/token';
|
|
|
|
|
/project\/sass/g.test(location.pathname) && (url += "?corpId=ww596787bb70f08288")
|
|
|
|
|
return url
|
2022-05-10 18:46:57 +08:00
|
|
|
},
|
2024-10-10 17:35:04 +08:00
|
|
|
commonAttrs() {
|
|
|
|
|
return {
|
|
|
|
|
instance: this.$request,
|
|
|
|
|
dict: this.$dict,
|
|
|
|
|
permissions: this.$permissions
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-05-10 18:46:57 +08:00
|
|
|
},
|
2021-12-14 18:36:19 +08:00
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
dialog: false,
|
2022-05-10 18:46:57 +08:00
|
|
|
showTools: true,
|
2024-09-03 15:49:06 +08:00
|
|
|
dvDev: false
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
showTools(v) {
|
|
|
|
|
v && (this.dvDev = false)
|
2021-12-14 18:36:19 +08:00
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2022-08-29 11:16:25 +08:00
|
|
|
...mapMutations(['setToken']),
|
|
|
|
|
...mapActions(['getUserInfo', 'getFinanceUser']),
|
2021-12-14 18:36:19 +08:00
|
|
|
getToken(params) {
|
2022-06-28 09:15:10 +08:00
|
|
|
if (params.access_token) {
|
|
|
|
|
this.setToken([params.token_type, params.access_token].join(' '))
|
|
|
|
|
this.dialog = false
|
|
|
|
|
this.$message.success("登录成功,正在刷新页面...")
|
|
|
|
|
location.reload()
|
|
|
|
|
} else this.$message.error(params.msg || "登录失败!")
|
|
|
|
|
|
2021-12-14 18:36:19 +08:00
|
|
|
},
|
|
|
|
|
handleLogin() {
|
2022-07-27 10:24:38 +08:00
|
|
|
this.$request.delete("/auth/token/logout").finally(() => {
|
2021-12-14 18:36:19 +08:00
|
|
|
this.dialog = true
|
|
|
|
|
})
|
|
|
|
|
},
|
2022-11-04 18:12:28 +08:00
|
|
|
handleMock() {
|
|
|
|
|
}
|
2021-12-14 18:36:19 +08:00
|
|
|
},
|
|
|
|
|
created() {
|
2024-10-10 17:35:04 +08:00
|
|
|
const {jWeixin} = window
|
|
|
|
|
window.wx = jWeixin
|
2022-08-26 17:20:08 +08:00
|
|
|
if (this.user.token) this.getUserInfo().finally(() => {
|
2022-07-19 15:20:10 +08:00
|
|
|
if (/^\/project\/xiushan/.test(location.pathname)) {
|
2022-08-26 17:20:08 +08:00
|
|
|
this.getFinanceUser()
|
2022-07-19 15:20:10 +08:00
|
|
|
}
|
|
|
|
|
})
|
2021-12-14 18:36:19 +08:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss">
|
|
|
|
|
html, body {
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
margin: 0;
|
|
|
|
|
}
|
|
|
|
|
|
2022-05-10 19:16:02 +08:00
|
|
|
.mar-t48 {
|
|
|
|
|
margin-top: 48px;
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-14 18:36:19 +08:00
|
|
|
#app {
|
|
|
|
|
font-family: 'Avenir', Helvetica, Arial, sans-serif;
|
|
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
|
|
color: #2c3e50;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
|
|
|
|
|
.fixedBtn {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
right: 60px;
|
|
|
|
|
opacity: 0;
|
2024-09-29 11:07:35 +08:00
|
|
|
z-index: 999;
|
2021-12-14 18:36:19 +08:00
|
|
|
|
|
|
|
|
&:hover {
|
|
|
|
|
opacity: 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
li {
|
|
|
|
|
list-style-type: none;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.sign-box {
|
|
|
|
|
z-index: 99;
|
|
|
|
|
margin: -10px;
|
|
|
|
|
display: flex;
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
width: 100%;
|
|
|
|
|
height: 100%;
|
|
|
|
|
background: rgba(0, 0, 0, 0.2);
|
|
|
|
|
}
|
2022-05-10 18:46:57 +08:00
|
|
|
}
|
|
|
|
|
|
2021-12-14 18:36:19 +08:00
|
|
|
</style>
|