Commit fecccc2b authored by 赵啸非's avatar 赵啸非

Merge remote-tracking branch 'origin/master'

parents fd6e0147 6448da90
......@@ -10,9 +10,10 @@ export default {
return {};
},
created() {
// this.readVueXData();
this.readVueXData();
},
methods: {
// 解决刷新store初始化问题
readVueXData() {
window.addEventListener("beforeunload", () => {
sessionStorage.setItem("store", JSON.stringify(this.$store.state));
......
......@@ -113,15 +113,18 @@
<template slot-scope="scope">
<el-switch
disabled
class="tableScopeSwitch"
:active-value="1"
:inactive-value="0"
inactive-text="停用"
active-text="启用"
v-model="scope.row.enabled"
@change="handleChange(scope.row)"
>
</el-switch>
</template>
</el-table-column>
<el-table-column align="center" label="操作" width="150">
<!-- <el-table-column align="center" label="操作" width="150">
<template slot-scope="scope">
<div class="flex jca">
<span
......@@ -144,7 +147,7 @@
>
</div>
</template>
</el-table-column>
</el-table-column> -->
</el-table>
</div>
<div class="pagination" v-if="total">
......@@ -292,4 +295,27 @@ export default {
.table-content {
height: 550px;
}
/deep/.tableScopeSwitch .el-switch__label {
position: absolute;
display: none;
color: #fff;
}
/*打开时文字位置设置*/
/deep/.tableScopeSwitch .el-switch__label--right {
z-index: 1;
left: 0px; /*不同场景下可能不同,自行调整*/
}
/*关闭时文字位置设置*/
/deep/.tableScopeSwitch .el-switch__label--left {
z-index: 1;
right: 0px; /*不同场景下可能不同,自行调整*/
}
/*显示文字*/
/deep/.tableScopeSwitch .el-switch__label.is-active {
display: block;
}
/deep/.tableScopeSwitch.el-switch .el-switch__core,
.el-switch .el-switch__label {
width: 60px !important; /*开关按钮的宽度大小*/
}
</style>
\ No newline at end of file
......@@ -57,7 +57,7 @@ export default {
...mapMutations(["SET_deptList"]),
// 计算面包屑
calcBreads() {
let temp = [{ to: "/", title: "数字样表系统" }];
let temp = [{ to: "/basicsset", title: "数字样表系统" }];
// 过滤出路由数据
let r = this.$route.matched
.filter((v) => v.meta.title)
......
......@@ -59,7 +59,7 @@ export default {
created() {},
methods: {
handleGoHome() {
this.$router.push("/");
this.$router.push("/basicsset");
},
},
};
......
......@@ -37,6 +37,7 @@
<script>
import { login } from "@/api/login";
import local from "@/utils/local";
import { calcMenu } from "@/router";
export default {
name: "login",
data() {
......@@ -63,6 +64,8 @@ export default {
if (token) {
local.setLocal("sampleToken", token);
local.setLocal("sampleSiteId", siteid);
// 渲染菜单
calcMenu();
this.$router.push("/basicsset");
}
}
......
......@@ -3,17 +3,26 @@
<el-dialog title="从公共库中选择" :visible.sync="Visible" width="50%">
<TableHeader>
<div slot="right" class="flex">
<el-select v-model="department" size="small" placeholder="选择部门">
<el-select
v-model="department"
class="autoWidth"
size="small"
placeholder="选择部门"
>
<template slot="prefix">
{{ (deptList.find((s) => s.id === department) || {}).name }}
</template>
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
v-for="item in deptList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<el-input
size="small"
style="width: 200px"
v-model="searchVal"
class="ml10 mr10"
placeholder="请输入事项名称搜索"
......@@ -93,6 +102,7 @@
<script>
import TableHeader from "@/components/TableHeader.vue";
import { mapGetters } from "vuex";
export default {
components: {
TableHeader,
......@@ -113,28 +123,6 @@ export default {
},
data() {
return {
options: [
{
value: "选项1",
label: "黄金糕",
},
{
value: "选项2",
label: "双皮奶",
},
{
value: "选项3",
label: "蚵仔煎",
},
{
value: "选项4",
label: "龙须面",
},
{
value: "选项5",
label: "北京烤鸭",
},
],
department: "",
searchVal: "",
tableData: [
......@@ -172,6 +160,7 @@ export default {
this.$emit("update:libVisible", val);
},
},
...mapGetters(["deptList"]),
},
methods: {
handleOk() {
......
......@@ -97,7 +97,7 @@
</el-table-column>
<el-table-column
prop="total"
label="样表次数"
label="填单次数"
align="center"
width="80"
>
......@@ -182,6 +182,7 @@
</el-select>
<el-input
size="small"
style="width: 200px"
v-model="rightSearch"
class="ml10 mr10"
placeholder="请输入事项名称搜索"
......@@ -457,7 +458,7 @@ export default {
},
// 右边加入
async handleJoin(id) {
let res = await createMatter({ ids: id,siteId:this.siteId });
let res = await createMatter({ ids: id, siteId: this.siteId });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
......
import Vue from 'vue'
import VueRouter from 'vue-router'
import Layouts from "@/pages/layouts/Layouts.vue"
import store from '@/store'
import Vue from "vue";
import VueRouter from "vue-router";
import Layouts from "@/pages/layouts/Layouts.vue";
import store from "@/store";
// 解决重复点击同一个路由报错
const originalPush = VueRouter.prototype.push;
VueRouter.prototype.push = function (location) {
return originalPush.call(this, location).catch(err => err)
}
Vue.use(VueRouter)
return originalPush.call(this, location).catch((err) => err);
};
Vue.use(VueRouter);
const routes = [
{
path: '/jump',
name: '跳转页',
component: () => import('@/pages/jump/jump')
path: "/jump",
name: "跳转页",
component: () => import("@/pages/jump/jump"),
},
{
path: '/',
redirect: '/login',
path: "/",
redirect: "/jump",
},
{
path: '/login',
name: '登录页',
component: () => import('@/pages/login/login')
path: "/login",
name: "登录页",
component: () => import("@/pages/login/login"),
},
]
];
const router = new VueRouter({
routes
})
routes,
});
// 动态菜单
const dynamicRouter = [
{
path: '/basicsset',
path: "/basicsset",
component: Layouts,
meta: {
icon: 'el-icon-setting',
title: '样表基础设置'
icon: "el-icon-setting",
title: "样表基础设置",
},
children: [
{
path: '',
path: "",
// name: '样表基础设置',
component: () => import('@/pages/software/basics/BasicsSet'),
}
]
component: () => import("@/pages/software/basics/BasicsSet"),
},
],
},
{
path: '/mattermanage',
path: "/mattermanage",
component: Layouts,
meta: {
icon: 'el-icon-document',
title: '样表事项管理'
icon: "el-icon-document",
title: "样表事项管理",
},
children: [
{
path: '',
name: '样表事项管理',
component: () => import('@/pages/software/matter/MatterManage'),
}
]
path: "",
name: "样表事项管理",
component: () => import("@/pages/software/matter/MatterManage"),
},
],
},
{
path: '/materialsmanage',
path: "/materialsmanage",
component: Layouts,
meta: {
icon: 'el-icon-files',
title: '样表管理'
icon: "el-icon-files",
title: "样表管理",
},
children: [
{
path: '',
path: "",
// name: '材料管理',
component: () => import('@/pages/software/materials/MaterialsManage'),
}
]
component: () => import("@/pages/software/materials/MaterialsManage"),
},
],
},
{
path: '/librarymanage',
path: "/librarymanage",
component: Layouts,
meta: {
icon: 'el-icon-refrigerator',
title: '公共库管理'
icon: "el-icon-refrigerator",
title: "公共库管理",
},
children: [
{
path: '',
path: "",
// name: '公共库管理',
component: () => import('@/pages/software/librarymanage/LibraryManage'),
}
]
component: () => import("@/pages/software/librarymanage/LibraryManage"),
},
],
},
{
path: '/numberwritedevice',
path: "/numberwritedevice",
component: Layouts,
meta: {
icon: 'el-icon-monitor',
title: '数字样表设备'
icon: "el-icon-monitor",
title: "数字样表设备",
},
children: [
{
path: '',
path: "",
// name: '数字样表设备',
component: () => import('@/pages/hardware/NumberWriteDevice'),
}
]
component: () => import("@/pages/hardware/NumberWriteDevice"),
},
],
},
]
];
// 过滤菜单
function menusFilter(arr) {
let router = arr.filter(v => {
let router = arr.filter((v) => {
if (v.meta && v.meta.title) {
if (v.children) {
v.children = menusFilter(v.children)
v.children = menusFilter(v.children);
}
return v
return v;
}
})
return router
});
return router;
}
// 动态菜单
export function calcMenu() {
dynamicRouter.forEach(v => {
router.addRoute(v)
})
let menus = menusFilter(dynamicRouter)
store.commit('SET_MENUS',menus)
dynamicRouter.forEach((v) => {
router.addRoute(v);
});
let menus = menusFilter(dynamicRouter);
store.commit("SET_MENUS", menus);
}
calcMenu()
calcMenu();
export default router
export default router;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment