185 lines
6.2 KiB
Vue
185 lines
6.2 KiB
Vue
<template>
|
|
|
|
<header class="navbar navbar-expand-md d-print-none">
|
|
<div class="container-xl">
|
|
<h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-md-3">
|
|
<a href="/">
|
|
<img src="/static/logo.svg" width="110" height="32" alt="Tabler" class="navbar-brand-image">
|
|
</a>
|
|
</h1>
|
|
<div class="navbar-nav flex-row order-md-last">
|
|
<!-- 深色模式按钮 -->
|
|
<div class="d-none d-md-flex">
|
|
<a @click="switchTheme('dark')" class="nav-link px-0 hide-theme-dark" title="Enable dark mode"
|
|
data-bs-toggle="tooltip" data-bs-placement="bottom">
|
|
<!-- Download SVG icon from http://tabler-icons.io/i/moon -->
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
|
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
stroke-linejoin="round">
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
<path d="M12 3c.132 0 .263 0 .393 0a7.5 7.5 0 0 0 7.92 12.446a9 9 0 1 1 -8.313 -12.454z" />
|
|
</svg>
|
|
</a>
|
|
<a @click="switchTheme('light')" class="nav-link px-0 hide-theme-light" title="Enable light mode"
|
|
data-bs-toggle="tooltip" data-bs-placement="bottom">
|
|
<!-- Download SVG icon from http://tabler-icons.io/i/sun -->
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
|
|
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
|
|
stroke-linejoin="round">
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
<path d="M12 12m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0" />
|
|
<path
|
|
d="M3 12h1m8 -9v1m8 8h1m-9 8v1m-6.4 -15.4l.7 .7m12.1 -.7l-.7 .7m0 11.4l.7 .7m-12.1 -.7l-.7 .7" />
|
|
</svg>
|
|
</a>
|
|
</div>
|
|
<!-- 深色模式按钮 -->
|
|
<div v-if="type!='mini'" class="nav-item btn-list">
|
|
<a href="/#/pages/signin" class="btn" rel="noreferrer">
|
|
<!-- Download SVG icon from http://tabler-icons.io/i/heart -->
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon text-blue" width="24" height="24"
|
|
viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
<path d="M12 17v4" />
|
|
<path d="M10 20l4 -2" />
|
|
<path d="M10 18l4 2" />
|
|
<path d="M5 17v4" />
|
|
<path d="M3 20l4 -2" />
|
|
<path d="M3 18l4 2" />
|
|
<path d="M19 17v4" />
|
|
<path d="M17 20l4 -2" />
|
|
<path d="M17 18l4 2" />
|
|
<path d="M9 6a3 3 0 1 0 6 0a3 3 0 0 0 -6 0" />
|
|
<path d="M7 14a2 2 0 0 1 2 -2h6a2 2 0 0 1 2 2" />
|
|
</svg>
|
|
登录/注册
|
|
</a>
|
|
</div>
|
|
|
|
|
|
</div>
|
|
</div>
|
|
</header>
|
|
<header v-if="type!='mini'" class="navbar-expand-md">
|
|
<div class="collapse navbar-collapse" id="navbar-menu">
|
|
<div class="navbar">
|
|
<div class="container-xl">
|
|
<ul class="navbar-nav">
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/">
|
|
<span
|
|
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
|
|
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24"
|
|
viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
|
|
stroke-linecap="round" stroke-linejoin="round">
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
<path d="M5 12l-2 0l9 -9l9 9l-2 0"></path>
|
|
<path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"></path>
|
|
<path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"></path>
|
|
</svg>
|
|
</span>
|
|
<span class="nav-link-title">
|
|
主页
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/warehouses">
|
|
<span
|
|
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
class="icon icon-tabler icons-tabler-outline icon-tabler-building-warehouse">
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
|
|
<path d="M3 21v-13l9 -4l9 4v13"></path>
|
|
<path d="M13 13h4v8h-10v-6h6"></path>
|
|
<path d="M13 21v-9a1 1 0 0 0 -1 -1h-2a1 1 0 0 0 -1 1v3"></path>
|
|
</svg>
|
|
</span>
|
|
<span class="nav-link-title">
|
|
仓库
|
|
</span>
|
|
</a>
|
|
</li>
|
|
<li class="nav-item">
|
|
<a class="nav-link" href="/workorders">
|
|
<span
|
|
class="nav-link-icon d-md-none d-lg-inline-block"><!-- Download SVG icon from http://tabler-icons.io/i/home -->
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"
|
|
fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"
|
|
stroke-linejoin="round"
|
|
class="icon icon-tabler icons-tabler-outline icon-tabler-file-description">
|
|
<path stroke="none" d="M0 0h24v24H0z" fill="none" />
|
|
<path d="M14 3v4a1 1 0 0 0 1 1h4" />
|
|
<path
|
|
d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z" />
|
|
<path d="M9 17h6" />
|
|
<path d="M9 13h6" />
|
|
</svg>
|
|
</span>
|
|
<span class="nav-link-title">
|
|
工单
|
|
</span>
|
|
</a>
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
</template>
|
|
|
|
<script>
|
|
import {
|
|
myfunc
|
|
} from '../../myfunc';
|
|
|
|
|
|
|
|
myfunc.setTheme(myfunc.getThemefromStorge(),false);
|
|
|
|
|
|
export default {
|
|
name: "tabler-header",
|
|
props: {
|
|
type: {
|
|
type: String, // 指定类型
|
|
default: 'normal' // 可选的默认值
|
|
}
|
|
},
|
|
data() {
|
|
return {
|
|
|
|
};
|
|
},
|
|
methods:{
|
|
switchTheme(theme){
|
|
myfunc.setTheme(theme,true);
|
|
},
|
|
logout(){
|
|
myfunc.dele("user_info")
|
|
myfunc.dele("cookie")
|
|
},
|
|
updata_user_info_to_heard(){
|
|
//h5先判断有没有cookie
|
|
var cookie=myfunc.load_json("cookie")
|
|
if (cookie){
|
|
//判断cookie有没有过期
|
|
}else{
|
|
this.logout()
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
this.updata_user_info_to_heard()
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
|
|
</style> |