|
@@ -7,7 +7,7 @@
|
|
|
:key="item.text"
|
|
|
@click="
|
|
|
() => {
|
|
|
- menuClick(item.url);
|
|
|
+ menuClick(item);
|
|
|
}
|
|
|
"
|
|
|
:style="{ backgroundColor: colors[index % colors.length] }"
|
|
@@ -16,59 +16,54 @@
|
|
|
<span class="text">{{ item.text }}</span>
|
|
|
</div>
|
|
|
</template>
|
|
|
+ <el-dialog title="提示" :visible.sync="childMenuVisible" width="70%">
|
|
|
+ <div class="dialogContainer">
|
|
|
+ <template v-for="(item, index) in childMenuList">
|
|
|
+ <div
|
|
|
+ v-if="item.show"
|
|
|
+ class="menu"
|
|
|
+ :key="item.text"
|
|
|
+ @click="
|
|
|
+ () => {
|
|
|
+ menuClick(item);
|
|
|
+ }
|
|
|
+ "
|
|
|
+ :style="{ backgroundColor: colors[index % colors.length] }"
|
|
|
+ >
|
|
|
+ <span :class="'iconfont ' + item.icon"></span>
|
|
|
+ <span class="text">{{ item.text }}</span>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </div>
|
|
|
+ <span slot="footer" class="dialog-footer">
|
|
|
+ <el-button size="mini" @click="childMenuVisible = false">取 消</el-button>
|
|
|
+ <el-button size="mini" type="primary" @click="childMenuVisible = false">确 定</el-button>
|
|
|
+ </span>
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
+import menuList from '../assets/js/menus';
|
|
|
export default {
|
|
|
name: 'Menu',
|
|
|
props: {},
|
|
|
data() {
|
|
|
return {
|
|
|
colors: ['#a6c2ce', '#9c8f96', '#ebc57c', '#6b799e'],
|
|
|
- menuList: [
|
|
|
- {
|
|
|
- icon: 'icon-dianziqianmingguanli_huaban1',
|
|
|
- text: '邮件签名制作',
|
|
|
- url: '/mailSignature',
|
|
|
- show: true,
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'icon-dayintaodabiaoqian',
|
|
|
- text: '标签套打',
|
|
|
- url: '/repeatPrint',
|
|
|
- show: true,
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'icon-fuwenbenkuang',
|
|
|
- text: '富文本框',
|
|
|
- url: '/richTextBox',
|
|
|
- show: false,
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'icon-haibao',
|
|
|
- text: '海报制作',
|
|
|
- url: '/posterMake',
|
|
|
- show: false,
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'icon-chuankou',
|
|
|
- text: '串口通讯',
|
|
|
- url: '/serial',
|
|
|
- show: true,
|
|
|
- },
|
|
|
- {
|
|
|
- icon: 'icon-shebeikaifa',
|
|
|
- text: '开发模版',
|
|
|
- url: '/template',
|
|
|
- show: false,
|
|
|
- },
|
|
|
- ],
|
|
|
+ menuList: menuList,
|
|
|
+ childMenuVisible: false,
|
|
|
+ childMenuList: [],
|
|
|
};
|
|
|
},
|
|
|
methods: {
|
|
|
- menuClick(url) {
|
|
|
- this.$router.push(url);
|
|
|
+ menuClick(item) {
|
|
|
+ if (item.children && item.children.length) {
|
|
|
+ this.childMenuList = item.children;
|
|
|
+ this.childMenuVisible = true;
|
|
|
+ } else {
|
|
|
+ this.$router.push(item.url);
|
|
|
+ }
|
|
|
},
|
|
|
},
|
|
|
};
|
|
@@ -79,7 +74,7 @@ export default {
|
|
|
height: 100%;
|
|
|
padding: 50px;
|
|
|
box-sizing: border-box;
|
|
|
- > .menu {
|
|
|
+ .menu {
|
|
|
background-color: #a6c2ce;
|
|
|
width: 100px;
|
|
|
height: 100px;
|
|
@@ -105,5 +100,11 @@ export default {
|
|
|
margin-top: 5px;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ .dialogContainer {
|
|
|
+ padding: 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ overflow: hidden;
|
|
|
+ }
|
|
|
}
|
|
|
</style>
|