Commit 3ce6740c authored by “yiyousong”'s avatar “yiyousong”

feat:修改工作人员部门选择,新增皮肤模板页面权限

parent 3cdb4090
import local from "@/utils/local";
// 皮肤模板页面权限
export const permission = {
inserted: function(el, binding) {
const { value } = binding;
const roles = local.getLocal("baseUserInfo").id;
if (value) {
const permissionRoles = value;
const hasPermission = permissionRoles.includes(roles);
if (!hasPermission) {
el.remove();
}
} else {
throw new Error(`need roles! Like v-permission="['admin','editor']"`);
}
},
};
import Vue from 'vue' import Vue from "vue";
import App from './App.vue' import App from "./App.vue";
import { initRouter } from './router' import { initRouter } from "./router";
import './theme/index.less' import "./theme/index.less";
import Antd from 'ant-design-vue' import Antd from "ant-design-vue";
// import Viser from 'viser-vue' // import Viser from 'viser-vue'
// import '@/mock' // import '@/mock'
import store from './store' import store from "./store";
import 'animate.css/source/animate.css' import "animate.css/source/animate.css";
import './assets/css/common.less' import "./assets/css/common.less";
import './assets/css/relas.less' import "./assets/css/relas.less";
import './assets/css/use.less' import "./assets/css/use.less";
import Plugins from '@/plugins' import Plugins from "@/plugins";
import { initI18n } from '@/utils/i18n' import { initI18n } from "@/utils/i18n";
import bootstrap from '@/bootstrap' import bootstrap from "@/bootstrap";
import 'moment/locale/zh-cn' import "moment/locale/zh-cn";
import VueResource from 'vue-resource' import VueResource from "vue-resource";
//富文本插件 //富文本插件
import VueQuillEditor from 'vue-quill-editor' import VueQuillEditor from "vue-quill-editor";
import 'quill/dist/quill.core.css' import "quill/dist/quill.core.css";
import 'quill/dist/quill.snow.css' import "quill/dist/quill.snow.css";
import 'quill/dist/quill.bubble.css' import "quill/dist/quill.bubble.css";
import {VueJsonp} from 'vue-jsonp' import { VueJsonp } from "vue-jsonp";
Vue.use(VueJsonp) Vue.use(VueJsonp);
// 公共样式 // 公共样式
import "@/assets/css/common.css" import "@/assets/css/common.css";
Vue.use(VueQuillEditor); Vue.use(VueQuillEditor);
// 全局过滤器 // 全局过滤器
import * as filters from "@/filters" import * as filters from "@/filters";
Object.keys(filters).forEach(key=>{ Object.keys(filters).forEach((key) => {
Vue.filter(key,filters[key]) Vue.filter(key, filters[key]);
}) });
// 引入注册全局指令
import * as directives from "@/directive";
Object.keys(directives).forEach((name) =>
Vue.directive(name, directives[name])
);
// 中央事件总线 // 中央事件总线
Vue.prototype.$bus = new Vue Vue.prototype.$bus = new Vue();
// 图片预览 // 图片预览
import Viewer from 'v-viewer' import Viewer from "v-viewer";
import 'viewerjs/dist/viewer.css' import "viewerjs/dist/viewer.css";
Vue.use(Viewer); Vue.use(Viewer);
// moment 时间处理 // moment 时间处理
import moment from 'moment'; import moment from "moment";
Vue.prototype.$moment = moment; Vue.prototype.$moment = moment;
// echats // echats
import * as echarts from 'echarts'; import * as echarts from "echarts";
Vue.prototype.$echarts = echarts Vue.prototype.$echarts = echarts;
export const router = initRouter(store.state.setting.asyncRoutes) export const router = initRouter(store.state.setting.asyncRoutes);
const i18n = initI18n('CN', 'US') const i18n = initI18n("CN", "US");
Vue.use(Antd) Vue.use(Antd);
Vue.config.productionTip = false Vue.config.productionTip = false;
// Vue.use(Viser) // Vue.use(Viser)
Vue.use(Plugins) Vue.use(Plugins);
Vue.use(VueResource) Vue.use(VueResource);
bootstrap({ router, store, i18n, message: Vue.prototype.$message }) bootstrap({ router, store, i18n, message: Vue.prototype.$message });
new Vue({ new Vue({
router, router,
store, store,
i18n, i18n,
render: h => h(App), render: (h) => h(App),
}).$mount('#app') }).$mount("#app");
...@@ -17,8 +17,10 @@ export default { ...@@ -17,8 +17,10 @@ export default {
// 获取token // 获取token
getToken() { getToken() {
let token = this.$route.query.token; let token = this.$route.query.token;
let userInfo = JSON.parse(this.$route.query.userInfo);
if (token) { if (token) {
local.setLocal("token", token); local.setLocal("token", token);
local.setLocal("baseUserInfo", userInfo);
this.$router.push("basicset/website"); this.$router.push("basicset/website");
} else { } else {
this.$message.warning("跳转失败,请重新登录"); this.$message.warning("跳转失败,请重新登录");
......
...@@ -41,7 +41,6 @@ export default { ...@@ -41,7 +41,6 @@ export default {
let { data } = res.data.data; let { data } = res.data.data;
this.productList = data; this.productList = data;
this.changeMenu(0, this.productList[0]); this.changeMenu(0, this.productList[0]);
console.log(res);
}, },
// 搜索 // 搜索
onSearch(val) { onSearch(val) {
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<a-button <a-button
slot="extra" slot="extra"
type="primary" type="primary"
v-permission="[1]"
@click="$router.push('surface/addsurfacetemplate')" @click="$router.push('surface/addsurfacetemplate')"
>新增皮肤模板</a-button >新增皮肤模板</a-button
> >
......
...@@ -48,9 +48,6 @@ ...@@ -48,9 +48,6 @@
<a-menu slot="overlay"> <a-menu slot="overlay">
<a-menu-item key="1"> <a-menu-item key="1">
<a style="color: #1890ff" @click="handleUpload"> 批量导入 </a> <a style="color: #1890ff" @click="handleUpload"> 批量导入 </a>
<!-- <a-button type="primary" @click="handleUpload" class="btn_to"
>批量导入</a-button
> -->
</a-menu-item> </a-menu-item>
<a-menu-item key="2"> <a-menu-item key="2">
<a style="color: #1890ff" @click="handleDownload"> 模板下载</a> <a style="color: #1890ff" @click="handleDownload"> 模板下载</a>
...@@ -539,8 +536,11 @@ export default { ...@@ -539,8 +536,11 @@ export default {
} }
.person_chang { .person_chang {
width: 100%; width: 100%;
margin-top: 15px; margin-top: 15px;
display: flex;
.ant-radio-button-wrapper {
margin-bottom: 6px;
}
} }
.btn_add { .btn_add {
width: 80px; width: 80px;
...@@ -582,6 +582,7 @@ export default { ...@@ -582,6 +582,7 @@ export default {
} }
div.person_gruop1 { div.person_gruop1 {
display: inline; display: inline;
flex: 1;
} }
div.person_gruop { div.person_gruop {
display: inline; display: inline;
...@@ -591,6 +592,7 @@ export default { ...@@ -591,6 +592,7 @@ export default {
} }
div.person_window1 { div.person_window1 {
display: inline; display: inline;
flex: 1;
} }
.btn_seek { .btn_seek {
width: 278px; width: 278px;
......
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