|
@@ -42,7 +42,7 @@
|
|
|
:default-expand-all="isexpand"
|
|
|
row-key="Id"
|
|
|
style="border: 1px solid #dcdfe6"
|
|
|
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
+ :tree-props="{ children: 'Child', hasChildren: 'hasChildren' }"
|
|
|
>
|
|
|
<el-table-column
|
|
|
v-for="item in tableColums"
|
|
@@ -54,24 +54,24 @@
|
|
|
:align="item.align || 'left'"
|
|
|
:default-expand-all="isexpand"
|
|
|
row-key="Id"
|
|
|
- :tree-props="{ children: 'children', hasChildren: 'hasChildren' }"
|
|
|
+ :tree-props="{ children: 'Child', hasChildren: 'hasChildren' }"
|
|
|
>
|
|
|
<template slot-scope="{ row }">
|
|
|
<span v-if="item.prop === 'ClassifyOne'">{{
|
|
|
- row.ischild ? "" : row.ClassifyName
|
|
|
+ row.level==1 ? row.ClassifyName : ""
|
|
|
}}</span>
|
|
|
<span v-else-if="item.prop === 'ClassifyTwo'">{{
|
|
|
- row.ischild ? row.ClassifyName : ""
|
|
|
+ row.level==2 ? row.ClassifyName : ""
|
|
|
}}</span>
|
|
|
<span v-else-if="item.prop === 'ClassifyThree'">{{
|
|
|
- row.ischild ? row.ClassifyName : ""
|
|
|
+ row.level==3 ? row.ClassifyName : ""
|
|
|
}}</span>
|
|
|
|
|
|
<div v-else-if="item.prop === 'handle'">
|
|
|
<span
|
|
|
|
|
|
class="editsty"
|
|
|
- v-if="row.ischild&&isAuthSetBtnShow"
|
|
|
+ v-if="row.level==3&&isAuthSetBtnShow"
|
|
|
@click="handleShowSetVariety(row)"
|
|
|
>权限配置</span>
|
|
|
<span class="editsty" v-if="isEditBtnShow"
|
|
@@ -143,7 +143,7 @@
|
|
|
<el-option v-for="item in classifyparentArr" :key="item.ClassifyName" :label="item.ClassifyName" :value="item.Id"/>
|
|
|
</el-select> -->
|
|
|
<el-cascader :options="classifyparentArr" v-model="classifyForm.parent_id" placeholder="请选择"
|
|
|
- :props="{value:'Id',label:'ClassifyName',children:'Child'}" style="min-width:400px;"></el-cascader>
|
|
|
+ :props="{value:'Id',label:'ClassifyName',children:'Child',checkStrictly:true,emitPath:false}" style="min-width:400px;"></el-cascader>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="后台排序" prop="sort">
|
|
|
<el-input
|
|
@@ -205,76 +205,71 @@ export default {
|
|
|
computed:{
|
|
|
//添加分类是否展示
|
|
|
isAddClassifyBtnShow(){
|
|
|
- return true
|
|
|
- // if(this.aTab===0&&this.authTabsOpt.length){
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpAddClassify
|
|
|
- // )
|
|
|
- // }
|
|
|
- // if(this.aTab===1&&this.authTabsOpt.length){
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsAddClassify
|
|
|
- // )
|
|
|
- // }
|
|
|
- // return false
|
|
|
+ if(this.aTab===0&&this.authTabsOpt.length){
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpAddClassify
|
|
|
+ )
|
|
|
+ }
|
|
|
+ if(this.aTab===1&&this.authTabsOpt.length){
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsAddClassify
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//编辑是否展示
|
|
|
isEditBtnShow(){
|
|
|
- return true
|
|
|
- // if(this.aTab===0){
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpEdit
|
|
|
- // )
|
|
|
- // }else{
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsEdit
|
|
|
- // )
|
|
|
- // }
|
|
|
+ if(this.aTab===0){
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpEdit
|
|
|
+ )
|
|
|
+ }else{
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsEdit
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//删除是否展示
|
|
|
isDeleteBtnShow(){
|
|
|
- return true
|
|
|
- // if(this.aTab===0){
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpDel
|
|
|
- // )
|
|
|
- // }else{
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsDel
|
|
|
- // )
|
|
|
- // }
|
|
|
+ if(this.aTab===0){
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpDel
|
|
|
+ )
|
|
|
+ }else{
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsDel
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//权限设置是否展示
|
|
|
isAuthSetBtnShow(){
|
|
|
- return true
|
|
|
- // if(this.aTab===0){
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpAuthSetting
|
|
|
- // )
|
|
|
- // }else{
|
|
|
- // return this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsAuthSetting
|
|
|
- // )
|
|
|
- // }
|
|
|
+ if(this.aTab===0){
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rpAuthSetting
|
|
|
+ )
|
|
|
+ }else{
|
|
|
+ return this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsAuthSetting
|
|
|
+ )
|
|
|
+ }
|
|
|
},
|
|
|
//英文研报、线上路演选项卡
|
|
|
- // authTabsOpt(){
|
|
|
- // const isShowTabRoadshow = this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_roadshow
|
|
|
- // )
|
|
|
- // const isShowTabReport = this.permissionBtn.checkPermissionBtn(
|
|
|
- // this.permissionBtn.enClassifyBtn.classifyList_enClassify_report
|
|
|
- // )
|
|
|
- // //没时间写更好的写法了,有空再优化
|
|
|
- // let authTabs = []
|
|
|
- // if(isShowTabReport){
|
|
|
- // authTabs.push(this.tabsOpt[0])
|
|
|
- // }
|
|
|
- // if(isShowTabRoadshow){
|
|
|
- // authTabs.push(this.tabsOpt[1])
|
|
|
- // }
|
|
|
- // return authTabs
|
|
|
- // },
|
|
|
+ authTabsOpt(){
|
|
|
+ const isShowTabRoadshow = this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_roadshow
|
|
|
+ )
|
|
|
+ const isShowTabReport = this.permissionBtn.checkPermissionBtn(
|
|
|
+ this.permissionBtn.enClassifyBtn.classifyList_enClassify_report
|
|
|
+ )
|
|
|
+ //没时间写更好的写法了,有空再优化
|
|
|
+ let authTabs = []
|
|
|
+ if(isShowTabReport){
|
|
|
+ authTabs.push(this.tabsOpt[0])
|
|
|
+ }
|
|
|
+ if(isShowTabRoadshow){
|
|
|
+ authTabs.push(this.tabsOpt[1])
|
|
|
+ }
|
|
|
+ return authTabs
|
|
|
+ },
|
|
|
//添加分类时的选项框
|
|
|
},
|
|
|
data() {
|
|
@@ -322,20 +317,20 @@ export default {
|
|
|
classify_name: [{ required:true,message:'请输入分类名称',trigger:'blur'}],
|
|
|
parent_id: [{ required:true,message:'请输入',trigger:'blur'}],
|
|
|
sort: [{ required:true,message:'请输入数字',trigger:'blur'}],
|
|
|
- type: [{ required:true,message:'请选择',trigger:'change'}]
|
|
|
+ // type: [{ required:true,message:'请选择',trigger:'change'}]
|
|
|
},
|
|
|
|
|
|
- // tabsOpt:[
|
|
|
- // {
|
|
|
- // name:'英文研报',
|
|
|
- // val:0
|
|
|
- // },
|
|
|
- // {
|
|
|
- // name:'线上路演',
|
|
|
- // val:1
|
|
|
- // }
|
|
|
- // ],
|
|
|
- // aTab:0,
|
|
|
+ tabsOpt:[
|
|
|
+ {
|
|
|
+ name:'英文研报',
|
|
|
+ val:0
|
|
|
+ },
|
|
|
+ {
|
|
|
+ name:'线上路演',
|
|
|
+ val:1
|
|
|
+ }
|
|
|
+ ],
|
|
|
+ aTab:0,
|
|
|
|
|
|
isexpand:false,
|
|
|
|
|
@@ -383,15 +378,20 @@ export default {
|
|
|
this.tableData = res.Data.List || [];
|
|
|
this.total = parseInt(res.Data.Paging.Totals);
|
|
|
this.tableData.forEach((item, index) => {
|
|
|
+ item.level = 1
|
|
|
if (item.Child) {
|
|
|
// item.hasChildren=true;
|
|
|
- let childnode = JSON.parse(JSON.stringify(item.Child));
|
|
|
- childnode.forEach((itemchild, i) => {
|
|
|
- itemchild.ischild = true;
|
|
|
+ // let childnode = JSON.parse(JSON.stringify(item.Child));
|
|
|
+ item.Child.forEach((itemchild, i) => {
|
|
|
+ itemchild.level = 2;
|
|
|
+ itemchild.Child && itemchild.Child.forEach((itemChildTwo,i)=>{
|
|
|
+ itemChildTwo.level=3
|
|
|
+ })
|
|
|
});
|
|
|
- item.children = childnode;
|
|
|
+ // item.children = childnode;
|
|
|
}
|
|
|
});
|
|
|
+ console.log(this.tableData,'this.tableData');
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -414,11 +414,13 @@ export default {
|
|
|
if(res.Ret !== 200) return
|
|
|
|
|
|
this.classifyparentArr=[];
|
|
|
+ this.classifyparentArr.push({Id:0,ClassifyName:'无',Child:null})
|
|
|
res.Data.List && res.Data.List.forEach((item,i)=>{
|
|
|
item.Id=parseInt(item.Id);
|
|
|
-
|
|
|
- if(!item.Child) this.classifyparentArr.push(item);
|
|
|
+ // 拿取前两级
|
|
|
+ if(item.Child && (!item.Child.some(it => it.Child && it.Child.length>0))) this.classifyparentArr.push(item);
|
|
|
});
|
|
|
+ console.log(this.classifyparentArr);
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -466,7 +468,8 @@ export default {
|
|
|
/* 保存分类 */
|
|
|
async setClassifyHandle() {
|
|
|
await this.$refs.formRef.validate();
|
|
|
-
|
|
|
+ console.log(this.classifyForm);
|
|
|
+ // return
|
|
|
const { classify_name,parent_id,sort,classify_id } = this.classifyForm;
|
|
|
let params = {
|
|
|
ClassifyName: classify_name,
|