|
@@ -2,54 +2,85 @@
|
|
|
<div class="main">
|
|
|
<div class="footer">
|
|
|
<van-tabbar v-model="tabType">
|
|
|
- <van-tabbar-item icon="home-o" to="/main/message">消息</van-tabbar-item>
|
|
|
- <van-tabbar-item icon="search" to="/main/working">工作台</van-tabbar-item>
|
|
|
+ <van-tabbar-item icon="home-o" to="/main/message"
|
|
|
+ >消息</van-tabbar-item
|
|
|
+ >
|
|
|
+ <van-tabbar-item icon="search" to="/main/working"
|
|
|
+ >工作台</van-tabbar-item
|
|
|
+ >
|
|
|
<van-tabbar-item
|
|
|
icon="friends-o"
|
|
|
- :to="tenantId == 'xmhjc' ? '/main/xiamenList' : '/main/equipment'"
|
|
|
- >物联网</van-tabbar-item>
|
|
|
- <van-tabbar-item
|
|
|
- icon="setting-o"
|
|
|
- to="/main/home"
|
|
|
- >我的</van-tabbar-item>
|
|
|
+ :to="
|
|
|
+ tenantId == 'xmhjc'
|
|
|
+ ? '/main/xiamenList'
|
|
|
+ : '/main/equipment'
|
|
|
+ "
|
|
|
+ >物联网</van-tabbar-item
|
|
|
+ >
|
|
|
+ <van-tabbar-item icon="setting-o" to="/main/home"
|
|
|
+ >我的</van-tabbar-item
|
|
|
+ >
|
|
|
</van-tabbar>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <router-view/>
|
|
|
+ <router-view />
|
|
|
</template>
|
|
|
<script setup>
|
|
|
-import { ref, getCurrentInstance } from 'vue'
|
|
|
-import { getUserInfo } from '@/utils/auth';
|
|
|
-import {lang} from '@/lang/cn'
|
|
|
+import { ref, getCurrentInstance, watch } from 'vue'
|
|
|
+import { getUserInfo } from '@/utils/auth'
|
|
|
+import { useRouter } from 'vue-router'
|
|
|
+import { lang } from '@/lang/cn'
|
|
|
+import * as dd from 'dingtalk-jsapi'
|
|
|
import '@/assets/icon/iconfont.css'
|
|
|
-import 'vant/lib/index.css';
|
|
|
+import 'vant/lib/index.css'
|
|
|
import axios from 'axios'
|
|
|
+import { uploadDdRightBtn } from '@/utils/ddAdapter'
|
|
|
const tenantId = getUserInfo().tenantId
|
|
|
const proxy = getCurrentInstance().proxy
|
|
|
const tabType = ref('home')
|
|
|
+
|
|
|
//判断是否为开发环境.如果是开发环境,则同步前后台中文配置表
|
|
|
const isDev = process.env.NODE_ENV === 'development'
|
|
|
-if(isDev) {
|
|
|
-
|
|
|
+if (isDev) {
|
|
|
let networkLang = window.localStorage.getItem('lang')
|
|
|
- if(networkLang || networkLang != JSON.stringify(lang)){
|
|
|
+ if (networkLang || networkLang != JSON.stringify(lang)) {
|
|
|
try {
|
|
|
networkLang = JSON.parse(networkLang)
|
|
|
networkLang.app.cn = lang
|
|
|
- proxy.post('/open/multilingual/setJson',{configValue:JSON.stringify(networkLang)}).then(res=>{
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- } catch (error) {
|
|
|
-
|
|
|
- }
|
|
|
+ proxy
|
|
|
+ .post('/open/multilingual/setJson', {
|
|
|
+ configValue: JSON.stringify(networkLang),
|
|
|
+ })
|
|
|
+ .then((res) => {})
|
|
|
+ } catch (error) {}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
+const corpId = window.localStorage.getItem('corpId')
|
|
|
+//监听路由变化
|
|
|
+const router = useRouter()
|
|
|
+watch(router.currentRoute, (to, from) => {
|
|
|
+ console.log(dd.biz,123123138713827)
|
|
|
+ dd.biz.navigation.setTitle({
|
|
|
+ title : router.currentRoute.value.name,
|
|
|
+ onSuccess : function(result) {
|
|
|
+ },
|
|
|
+ onFail : function(err) {}
|
|
|
+ });
|
|
|
+
|
|
|
+ //获取元素的绑定事件
|
|
|
+ setTimeout(() => {
|
|
|
+ if(!corpId) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let el = document.getElementsByClassName('van-nav-bar__content')[0]
|
|
|
+ if(el) {
|
|
|
+ //删除el元素
|
|
|
+ el.parentNode.removeChild(el)
|
|
|
+ }
|
|
|
+ }, 100)
|
|
|
+})
|
|
|
</script>
|
|
|
<style lang="scss">
|
|
|
- .footer{
|
|
|
-
|
|
|
- }
|
|
|
+.footer {
|
|
|
+}
|
|
|
</style>
|