Merge branch 'master' of http://highdatas.com:9000/r/~kimi/srs
# Conflicts:
# .eslintrc.js
# public/index.html
# src/router/index.ts
# src/views/Home.vue
| | |
| | | <template> |
| | | <div id="app"> |
| | | |
| | | <home /> |
| | | <router-view name="app"></router-view> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import Home from "./views/Home.vue"; |
| | | // import Home from "./views/Home.vue"; |
| | | export default { |
| | | name :"app", |
| | | components:{ |
| | | /* components:{ |
| | | Home |
| | | } |
| | | } */ |
| | | }; |
| | | </script> |
| | | <style lang="stylus"> |
| | |
| | | import store from "./store"; |
| | | import ElementUI from "element-ui"; |
| | | import "element-ui/lib/theme-chalk/index.css"; |
| | | import Axios from 'axios'; |
| | | |
| | | |
| | | Vue.use(ElementUI); |
| | | |
| | | Vue.config.productionTip = false; |
| | | Vue.prototype.$axios = Axios; |
| | | Axios.defaults.baseURL = '/api'; |
| | | Axios.defaults.headers.post['Content-Type'] = 'application/json'; |
| | | |
| | | Vue.prototype.axios = axios; |
| | | |
| | |
| | | store, |
| | | render: h => h(App) |
| | | }).$mount("#app"); |
| | | |
| | | //日期格式化 |
| | | Date.prototype.Format = function(fmt){ |
| | | var o = { |
| | | "M+": this.getMonth() + 1, |
| | | "d+": this.getDate(), |
| | | "H+": this.getHours(), |
| | | "m+": this.getMinutes(), |
| | | "s+": this.getSeconds(), |
| | | "S+": this.getMilliseconds() |
| | | }; |
| | | if(/(y+)/.test(fmt)){ |
| | | fmt=fmt.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length)); |
| | | } |
| | | for(var k in o){ |
| | | if (new RegExp("(" + k +")").test(fmt)){ |
| | | fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(String(o[k]).length))); |
| | | } |
| | | } |
| | | return fmt; |
| | | }; |
| | |
| | | import Vue from "vue"; |
| | | import VueRouter from "vue-router"; |
| | | import login from "../views/login.vue"; |
| | | import Home from "../views/Home.vue"; |
| | | import Mine from "../views/Mine.vue"; |
| | | import Project from "../views/Project.vue"; |
| | | import square from "../components/square.vue"; |
| | | import Overview from "../views/Overview.vue"; |
| | | import calendarTask from "../views/calendarTask.vue"; |
| | | |
| | | Vue.use(VueRouter); |
| | | |
| | | const routes = [ |
| | | |
| | | { |
| | | path: "/mine", |
| | | name: "mine", |
| | | component:Mine |
| | | },{ |
| | | path: "/square", |
| | | name: "square", |
| | | component:square |
| | | },{ |
| | | path: "/project", |
| | | name: "project", |
| | | component:Project |
| | | path: "/login", |
| | | name: "login", |
| | | components:{ |
| | | app: login |
| | | } |
| | | }, |
| | | { |
| | | path: "/about", |
| | | name: "about", |
| | | // route level code-splitting |
| | | // this generates a separate chunk (about.[hash].js) for this route |
| | | // which is lazy-loaded when the route is visited. |
| | | component: () => |
| | | import(/* webpackChunkName: "about" */ "../views/About.vue") |
| | | path: "/", |
| | | name: "Home", |
| | | components:{ |
| | | app: Home |
| | | }, |
| | | children: [ |
| | | { |
| | | path: "mine", |
| | | name: "mine", |
| | | components:{ |
| | | home: Mine |
| | | } |
| | | },{ |
| | | path: "project", |
| | | name: "project", |
| | | components:{ |
| | | home: Project |
| | | } |
| | | }, |
| | | { |
| | | path: "Overview", |
| | | name: "Overview", |
| | | components:{ |
| | | home: Overview |
| | | } |
| | | }, |
| | | { |
| | | path: "calendarTask", |
| | | name: "calendarTask", |
| | | components:{ |
| | | home: calendarTask |
| | | } |
| | | }, |
| | | { |
| | | path: "project2", |
| | | name: "project2", |
| | | components:{ |
| | | home: Project |
| | | } |
| | | }, |
| | | { |
| | | path: "project3", |
| | | name: "project3", |
| | | components:{ |
| | | home: Project |
| | | } |
| | | }, |
| | | { |
| | | path: "project4", |
| | | name: "project4", |
| | | components:{ |
| | | home: Project |
| | | } |
| | | }, |
| | | { |
| | | path: "project5", |
| | | name: "project5", |
| | | components:{ |
| | | home: Project |
| | | } |
| | | }, |
| | | { |
| | | path: "project6", |
| | | name: "project6", |
| | | components:{ |
| | | home: Project |
| | | } |
| | | } |
| | | ] |
| | | }, |
| | | |
| | | ]; |
| | | |
| | | const router = new VueRouter({ |
| | |
| | | <template> |
| | | <div style="margin: 0;"> |
| | | <div style="100%;height: 100%;margin: 0;"> |
| | | <el-container style="height: 100vh; box-sizing: border-box;"> |
| | | |
| | | <el-aside width="200px" style="background-color: rgb(238, 241, 246); "> |
| | | <div style="width: 100%;height: 60px;"></div> |
| | | <el-menu default-active="1" @select="handleSelect"> |
| | | <el-menu |
| | | :default-openeds="defaultActive" |
| | | class="el-menu-vertical-demo" |
| | | :unique-opened="false" |
| | | @select ="menuSelect" |
| | | @open ="menuSelect" |
| | | @close ="menuSelect" |
| | | active-text-color="#409EFF" |
| | | > |
| | | <navigationItem v-for="menu in navList" :key="menu.path" :item="menu" /> |
| | | </el-menu> |
| | | |
| | | <!-- <el-menu default-active="1" @select="handleSelect"> |
| | | <el-menu-item index="0"> |
| | | <i class="el-icon-menu"></i> |
| | | <span slot="title">首页</span> |
| | | </el-menu-item> |
| | | |
| | | |
| | | <el-submenu index="1"> |
| | | <template slot="title"> |
| | | <i class="el-icon-menu"></i> |
| | |
| | | <el-menu-item index="1-3">项目分析</el-menu-item> |
| | | <el-menu-item index="1-4">归档报告</el-menu-item> |
| | | </el-menu-item-group> |
| | | |
| | | </el-submenu> |
| | | <el-menu-item index="2"> |
| | | <i class="el-icon-menu"></i> |
| | | <span slot="title">任务管理</span> |
| | | </el-menu-item> |
| | | |
| | | |
| | | </el-menu> |
| | | </el-menu> --> |
| | | </el-aside> |
| | | |
| | | <el-container> |
| | | |
| | | |
| | | <el-header style="text-align: right; font-size: 15px;padding-right: 40px;"> |
| | | <i class="el-icon-user-solid"></i> |
| | | <span>admin</span> |
| | | </el-header> |
| | | |
| | | <el-main> |
| | | <router-view></router-view> |
| | | <el-main style="background-color: #f7f8f9;"> |
| | | <router-view name="home"></router-view> |
| | | </el-main> |
| | | </el-container> |
| | | </el-container> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | |
| | | |
| | | <script> |
| | | |
| | | import navigationItem from '../components/menu/navigationItem.vue' |
| | | export default { |
| | | components: { |
| | | navigationItem |
| | | }, |
| | | data() { |
| | | |
| | | return { |
| | | breadcrumbItems:[], |
| | | defaultActive: [], |
| | | navList:[ |
| | | { |
| | | title:"首页", path:"mine",children:[] |
| | | }, |
| | | { |
| | | title:"项目管理", path:"0_1",children:[ |
| | | {title:"信息广场", path:"project2",children:[]}, |
| | | {title:"项目总览", path:"Overview",children:[]}, |
| | | {title:"项目分析", path:"project3",children:[]}, |
| | | {title:"归档报告", path:"project4",children:[]}, |
| | | ] |
| | | }, |
| | | { |
| | | title:"任务管理", path:"0_2",children:[ |
| | | {title:"任务列表", path:"calendarTask",children:[]}, |
| | | ] |
| | | } |
| | | ], |
| | | } |
| | | }, |
| | | created() { |
| | | let userId_ = localStorage.getItem('userId'); |
| | | if (!userId_) { |
| | | this.$router.push('/login'); |
| | | } |
| | | }, |
| | | |
| | | methods: { |
| | | handleSelect(key, keyPath){ |
| | | menuSelect(index, a){ |
| | | let isPage = index.substring(0,2); |
| | | if (isPage != "0_") { |
| | | this.$router.push('/'+ index); |
| | | } |
| | | }, |
| | | |
| | | /* handleSelect(key, keyPath){ |
| | | switch(key){ |
| | | case '0': |
| | | this.$router.push('/mine'); |
| | | this.breadcrumbItems = ["首页"]; |
| | | break; |
| | | case '1-1': |
| | | this.$router.push('/square'); |
| | | this.breadcrumbItems = ["广场"]; |
| | | break; |
| | | case '2': |
| | | this.$router.push('/project') |
| | |
| | | break; |
| | | case '3': |
| | | this.$router.push('/Page3') |
| | | |
| | | break; |
| | | } |
| | | }, |
| | | }, */ |
| | | |
| | | } |
| | | }; |