|
|
@@ -0,0 +1,197 @@
|
|
|
+<template>
|
|
|
+ <div class="tab1Main">
|
|
|
+ <div class="insideTop">资料管理</div>
|
|
|
+ <div class="obstruct"></div>
|
|
|
+ <div class="conten">
|
|
|
+ <div class="top">编辑资料</div>
|
|
|
+ <div class="left">
|
|
|
+ <div class="name">卢边村</div>
|
|
|
+ <div class="row" v-for="(item, index) in data" :key="index">
|
|
|
+ <div class="rowOne el-icon-menu" @click="cutTab(item.id)">
|
|
|
+ <span class="txt">{{ item.name }}</span>
|
|
|
+ <i
|
|
|
+ :class="`${
|
|
|
+ tabInd === item.id ? 'el-icon-arrow-up' : 'el-icon-arrow-down'
|
|
|
+ }`"
|
|
|
+ ></i>
|
|
|
+ </div>
|
|
|
+ <div
|
|
|
+ class="rowList"
|
|
|
+ :class="{
|
|
|
+ open: tabInd === item.id,
|
|
|
+ active: $route.params.k == val.id,
|
|
|
+ }"
|
|
|
+ @click="
|
|
|
+ $router.push(`/layout/tab1Main/${$route.params.id}/${val.id}`)
|
|
|
+ "
|
|
|
+ v-for="(val, ind) in item.son"
|
|
|
+ :key="ind"
|
|
|
+ >
|
|
|
+ {{ val.tit }}
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ <div class="right">
|
|
|
+ <One v-if="$route.params.k == 1.1" />
|
|
|
+ <Tow v-else-if="$route.params.k == 1.2" />
|
|
|
+ <Three v-else-if="$route.params.k == 1.3" />
|
|
|
+ <Four v-else />
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+
|
|
|
+<script>
|
|
|
+import One from './one.vue'
|
|
|
+import Tow from './tow.vue'
|
|
|
+import Three from './three.vue'
|
|
|
+import Four from './four.vue'
|
|
|
+export default {
|
|
|
+ name: 'tab1Main',
|
|
|
+ components: { One, Tow, Three, Four },
|
|
|
+ data () {
|
|
|
+ // 这里存放数据
|
|
|
+ return {
|
|
|
+ tabInd: 1,
|
|
|
+ data: [
|
|
|
+ {
|
|
|
+ name: '历史文化',
|
|
|
+ id: 1,
|
|
|
+ son: [
|
|
|
+ { tit: '建村历史', id: 1.1 },
|
|
|
+ { tit: '历史人物', id: 1.2 },
|
|
|
+ { tit: '历史事件', id: 1.3 },
|
|
|
+ { tit: '族谱家训', id: 1.4 },
|
|
|
+ { tit: '口述史', id: 1.5 },
|
|
|
+ { tit: '视频集', id: 1.6 }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '环境格局',
|
|
|
+ id: 2,
|
|
|
+ son: [
|
|
|
+ { tit: '村落选址', id: 2.1 },
|
|
|
+ { tit: '村落格局', id: 2.2 },
|
|
|
+ { tit: '建村智慧', id: 2.3 },
|
|
|
+ { tit: '自然环境', id: 2.4 },
|
|
|
+ { tit: '风景名胜', id: 2.5 },
|
|
|
+ { tit: '文物古迹', id: 2.6 },
|
|
|
+ { tit: '历史环境要素', id: 2.7 }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name: '传统建筑',
|
|
|
+ id: 3,
|
|
|
+ son: [
|
|
|
+ { tit: '建筑信息', id: 3.1 },
|
|
|
+ { tit: '村落风貌', id: 3.2 },
|
|
|
+ { tit: '视频集', id: 3.3 }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 监听属性 类似于data概念
|
|
|
+ computed: {},
|
|
|
+ // 监控data中的数据变化
|
|
|
+ watch: {},
|
|
|
+ // 方法集合
|
|
|
+ methods: {
|
|
|
+ cutTab (id) {
|
|
|
+ if (this.tabInd === id) {
|
|
|
+ this.tabInd = null
|
|
|
+ return
|
|
|
+ }
|
|
|
+ this.tabInd = id
|
|
|
+ let k = Number(this.$route.params.k)
|
|
|
+ k = Math.floor(k)
|
|
|
+ if (this.tabInd !== k) {
|
|
|
+ this.$router.push(`/layout/tab1Main/${this.$route.params.id}/${id}.1`)
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ // 生命周期 - 创建完成(可以访问当前this实例)
|
|
|
+ created () {},
|
|
|
+ // 生命周期 - 挂载完成(可以访问DOM元素)
|
|
|
+ mounted () {
|
|
|
+ const k = Number(this.$route.params.k)
|
|
|
+ this.tabInd = Math.floor(k)
|
|
|
+ },
|
|
|
+ beforeCreate () {}, // 生命周期 - 创建之前
|
|
|
+ beforeMount () {}, // 生命周期 - 挂载之前
|
|
|
+ beforeUpdate () {}, // 生命周期 - 更新之前
|
|
|
+ updated () {}, // 生命周期 - 更新之后
|
|
|
+ beforeDestroy () {}, // 生命周期 - 销毁之前
|
|
|
+ destroyed () {}, // 生命周期 - 销毁完成
|
|
|
+ activated () {} // 如果页面有keep-alive缓存功能,这个函数会触发
|
|
|
+}
|
|
|
+</script>
|
|
|
+<style lang='less' scoped>
|
|
|
+.tab1Main {
|
|
|
+ width: 100%;
|
|
|
+ height: 100%;
|
|
|
+ .conten {
|
|
|
+ display: flex;
|
|
|
+ position: relative;
|
|
|
+ padding: 34px 20px 0;
|
|
|
+ height: calc(100% - 50px);
|
|
|
+ .top {
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ height: 34px;
|
|
|
+ line-height: 34px;
|
|
|
+ width: 100%;
|
|
|
+ background-color: #f2f1f0;
|
|
|
+ font-weight: 700;
|
|
|
+ padding-left: 30px;
|
|
|
+ }
|
|
|
+ .left {
|
|
|
+ padding-top: 10px;
|
|
|
+ width: 140px;
|
|
|
+ height: 100%;
|
|
|
+ border-right: 1px solid #d7d7d7;
|
|
|
+ .row {
|
|
|
+ margin-top: 20px;
|
|
|
+ .rowOne {
|
|
|
+ cursor: pointer;
|
|
|
+ width: 100%;
|
|
|
+ position: relative;
|
|
|
+ i {
|
|
|
+ position: absolute;
|
|
|
+ top: 50%;
|
|
|
+ right: 5px;
|
|
|
+ transform: translateY(-50%);
|
|
|
+ }
|
|
|
+ .txt {
|
|
|
+ margin-left: 10px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .rowList {
|
|
|
+ cursor: pointer;
|
|
|
+ padding-left: 18px;
|
|
|
+ height: 0;
|
|
|
+ overflow: hidden;
|
|
|
+ transition: margin 0.3s;
|
|
|
+ &:hover {
|
|
|
+ color: #a30014;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .open {
|
|
|
+ margin-top: 10px;
|
|
|
+ height: auto;
|
|
|
+ }
|
|
|
+ .active {
|
|
|
+ pointer-events: none;
|
|
|
+ color: #a30014;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ .right {
|
|
|
+ width: calc(100% - 140px);
|
|
|
+ height: 100%;
|
|
|
+ overflow-y: auto;
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|