Commit 5343e18b authored by 黄奎's avatar 黄奎

页面修改

parent dd1ea82b
......@@ -9,7 +9,6 @@ LoadingBar.setDefaults({
});
let loadAsyncRouter = false;
const whiteList = ["/login", "/"]; // 不重定向白名单
console.log(router)
router.beforeEach((to, from, next) => {
localStorage.setItem("routerBefore", from.path);
LoadingBar.start();
......@@ -25,7 +24,6 @@ router.beforeEach((to, from, next) => {
if (!loadAsyncRouter) {
// 判断当前用户是否获取权限
loadAsyncRouter = true;
console.log(store.getters.allAuth)
if (store.getters.allAuth) {
store.dispatch("GenerateRoutes", store.getters.allAuth).then(() => {
// 根据auths权限生成可访问的路由表
......@@ -86,7 +84,6 @@ router.beforeEach((to, from, next) => {
}
}
} else {
console.log(to.path)
if (whiteList.indexOf(to.path) !== -1) {
next();
} else {
......
<template>
<q-card style="width: 360px;">
<q-select ref="select" v-model="chooseArray" size="small" :clearable="true" :multiple="multiple" :label="tipText"
@click.native="isShowSelect = !isShowSelect" option-value="value" option-label="label" :options="options"
:dense="false">
</q-select>
<q-tree v-if="isShowSelect"
style="width:100%;height:250px;overflow-y: scroll;position:absolute;z-index:99999;background:#fff;border:1px solid rgba(0, 0, 0, 0.12);"
:nodes="treeData" :node-key="nodeKey" :label-key="labelKey" :children-key="childrenKey" tick-strategy="strict"
:default-expand-all="defaultExpandAll" no-connectors :ticked.sync="chooseArray">
</q-tree>
</q-card>
</template>
<script>
export default {
props: {
//树形结构列表
treeData: {
type: Array,
required: true
},
//是否默认展开
defaultExpandAll: {
type: Boolean,
default: false
},
//是否多选
multiple: {
type: Boolean,
default: false
},
//返回类型
id: [String, Array],
//节点Key
nodeKey: {
type: String,
default: 'id'
},
//节点名称
labelKey: {
type: String,
default: 'name'
},
//子节点名称
childrenKey: {
type: String,
default: 'children'
},
//下拉框提示信息
tipText: {
type: String,
default: '请选择'
}
},
data() {
return {
//是否显示树状选择器
isShowSelect: false,
options: [],
showValueTmp: '',
defaultProps: {
children: 'children',
label: 'label'
},
chooseArray: []
}
},
watch: {
isShowSelect(val) {
// 隐藏select自带的下拉框
this.$refs.select.blur();
if (val) {
// 下拉面板展开-选中节点-展开节点
this.setTreeCheckNode(this.chooseArray);
}
},
chooseArray(val) {
if (this.multiple) {
this.$emit('update:id', this.chooseArray)
} else {
this.$emit('update:id', this.chooseArray[0])
}
this.setTreeCheckNode()
}
},
mounted() {
// 把传进来的参数转成数组处理
if (this.multiple && Array.isArray(this.id)) {
this.chooseArray = this.id
} else {
this.chooseArray.push(this.id)
}
this.setTreeCheckNode();
},
methods: {
//设置节点下拉框选择
setTreeCheckNode() {
this.options = []
this.chooseArray.forEach(id => {
if (id != '') {
var tempStr = this.findTreeNode(this.treeData, id)
this.options.push({
value: id,
label: tempStr
});
console.log("this.options",this.options)
}
})
},
//递归查询树形节点
findTreeNode(tree, id) {
if (tree && tree.length > 0) {
console.log("111")
for (var i = 0; i < tree.length; i++) {
console.log("222")
if (tree[i][this.nodeKey] === id) {
console.log("tree",tree[i][this.nodeKey]);
console.log("id",id);
return tree[i][this.labelKey]
} else if (tree[i][this.childrenKey] != null && tree[i][this.childrenKey].length > 0) {
return this.findTreeNode(tree[i][this.childrenKey], id)
}
}
}
return "";
},
}
}
</script>
......@@ -155,13 +155,11 @@ export default {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data
if (this.objOption.School_Id != '') {
console.log(this.objOption)
this.objOption.School_Id = this.schoolList.filter(x => {
if (this.objOption.School_Id == x.SId) {
return x
}
})[0]
console.log(this.objOption)
}
})
},
......
......@@ -193,13 +193,11 @@ export default {
getSchoolDropdown({}).then(res => {
this.schoolList = res.Data
if (this.objOption.School_Id != '') {
console.log(this.objOption)
this.objOption.School_Id = this.schoolList.filter(x => {
if (this.objOption.School_Id == x.SId) {
return x
}
})[0]
console.log(this.objOption)
}
})
},
......
......@@ -224,7 +224,6 @@ export default {
if (newVal && newVal.MenuList) {
this.secondNavs = newVal.MenuList.length > 0 ? newVal.MenuList[i].SubList : []
}
console.log(this.secondNavs)
},
immediate: true
}
......
......@@ -7,12 +7,8 @@
label="课程名称" />
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" v-model="msg.MenuType" :options="MenuTypeOpts"
emit-value map-options label="菜单类型" />
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" v-model="msg.MenuLevel"
:options="MenuLevelOpts" emit-value map-options label="菜单等级" />
<select-tree v-if="TreeCategoryList&&TreeCategoryList.length>0" :treeData='TreeCategoryList'
:id.sync="returnString" nodeKey="CateId" labelKey="CateName" childrenKey="ChildList"></select-tree>
</div>
<div class="col-3">
<q-select @input="resetSearch" standout="bg-primary text-white" v-model="msg.Status" :options="ShowOpts"
......@@ -26,6 +22,13 @@
<div class="page-content">
<q-table :pagination="msg" :loading="loading" no-data-label="暂无相关数据" flat class="sticky-tow-column-table"
separator="none" title="课程信息" :data="data" :columns="columns" row-key="name">
<template v-slot:body-cell-CoverImg="props">
<q-td :props="props">
<q-avatar square size="100px">
<img :src="props.value" />
</q-avatar>
</q-td>
</template>
<template v-slot:body-cell-Status="props">
<q-td :props="props">
<q-badge :color="props.value==1?'negative':'primary'" :label="props.value==0?'正常':'禁用'" />
......@@ -50,60 +53,57 @@
<script>
import {
queryCoursePage
queryCoursePage,
queryCourseCategoryTree,
} from '../../api/course/index'
import courseForm from '../../components/course/course-form'
import selectTree from '../../components/common/tree'
export default {
meta: {
title: "菜单管理"
title: "课程管理"
},
components: {
courseForm,
selectTree
},
data() {
return {
currentUrl: "",
columns: [{
name: 'MenuId',
label: '菜单编号',
field: 'MenuId',
name: 'CourseId',
label: '课程编号',
field: 'CourseId',
align: 'left'
},
{
name: 'MenuName',
name: 'CourseName',
required: true,
label: '菜单名称',
label: '课程名称',
align: 'left',
field: row => row.MenuName
},
{
name: 'MenuUrl',
label: '菜单地址',
field: 'MenuUrl',
align: 'left'
field: row => row.CourseName
},
{
name: 'MenuTypeStr',
label: '菜单类型',
field: 'MenuTypeStr',
name: 'CateName',
label: '所属分类',
field: 'CateName',
align: 'left'
},
{
name: 'MenuLevel',
label: '菜单等级',
field: 'MenuLevel',
name: 'CoverImg',
label: '课程封面',
field: 'CoverImg',
align: 'left'
},
{
name: 'MenuIcon',
label: '图标',
field: 'MenuIcon',
name: 'CourseIntro',
label: '课程介绍',
field: 'CourseIntro',
align: 'left'
},
{
name: 'SortNum',
label: '排序',
field: 'SortNum',
name: 'CreateByName',
label: '创建人',
field: 'CreateByName',
align: 'left'
},
{
......@@ -121,7 +121,7 @@
{
name: 'optioned',
label: '操作',
field: 'MenuId'
field: 'CourseId'
}
],
data: [],
......@@ -153,16 +153,29 @@
MenuType: -1,
Status: "-1",
},
//课程分类树形列表
TreeCategoryList: [],
returnString: "", //返回字符串
pageCount: 0,
isShowMenuForm: false,
menuObjOption: null,
}
},
mounted() {
this.getCategorytree();
this.currentUrl = this.$route.path
this.getcourselist()
this.getcourselist();
},
methods: {
getCategorytree() {
this.TreeCategoryList = [];
var qMsg = {}
queryCourseCategoryTree(qMsg).then(res => {
this.TreeCategoryList = res.Data;
})
},
//重新查询
resetSearch() {
this.msg.pageIndex = 1;
......@@ -179,7 +192,6 @@
queryCoursePage(this.msg).then(res => {
this.loading = false
this.data = res.Data.PageData
console.log("this.data",this.data);
this.pageCount = res.Data.PageCount
}).catch(() => {
this.loading = false
......
......@@ -318,7 +318,6 @@ export default {
this.loading = false
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
console.log(this.data)
}).catch(() => {
this.loading = false
})
......
......@@ -203,7 +203,6 @@ export default {
}
return false
})
console.log(obj)
this.objOption = obj[0]
} else {
this.objOption = {
......@@ -218,12 +217,10 @@ export default {
Status: '0'
}
}
console.log(this.objOption)
this.persistent = true
},
resetSearch() {
this.pageIndex = 1
//this.pageCount = 0
this.loading = true
this.msg.Status = this.StatusTemp ? this.StatusTemp.value : '-1'
this.getSchool()
......
......@@ -367,7 +367,6 @@ export default {
this.loading = false
this.data = res.Data.PageData
this.pageCount = res.Data.PageCount
console.log(this.data)
}).catch(() => {
this.loading = false
})
......
......@@ -72,7 +72,6 @@ const permission = {
}, data) {
return new Promise(resolve => {
// TODO 实现权限验证
console.log('测试进入')
resolve()
})
}
......
......@@ -42,7 +42,6 @@ const user = {
resolve(data);
})
.catch(error => {
console.log(error)
reject(error);
});
});
......
......@@ -14,7 +14,6 @@ const service = axios.create({
// request拦截器
service.interceptors.request.use(
config => {
console.log(config.headers)
const flag =
config.headers["Content-Type"] &&
config.headers["Content-Type"].indexOf("application/json") !== -1;
......
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