|
@@ -23,7 +23,7 @@
|
|
|
</el-input>
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="tabs-box" :style="authTabsOpt.length>1?'':'border:none'"
|
|
|
+ <!-- <div class="tabs-box" :style="authTabsOpt.length>1?'':'border:none'"
|
|
|
v-if="authTabsOpt.length">
|
|
|
<span
|
|
|
v-for="item in authTabsOpt"
|
|
@@ -31,10 +31,10 @@
|
|
|
:class="item.val==aTab?'active':''"
|
|
|
@click="handleTabChange(item)"
|
|
|
>{{item.name}}</span>
|
|
|
- </div>
|
|
|
+ </div> -->
|
|
|
|
|
|
+ <!-- v-if="authTabsOpt.length" -->
|
|
|
<el-table
|
|
|
- v-if="authTabsOpt.length"
|
|
|
:data="tableData"
|
|
|
v-loading="dataLoading"
|
|
|
row-class-name="tableRowClassName"
|
|
@@ -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,21 +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.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"
|
|
@@ -107,7 +110,7 @@
|
|
|
label-position="left"
|
|
|
hide-required-asterisk
|
|
|
label-width="80px">
|
|
|
- <el-form-item prop="type" label="所属模块">
|
|
|
+ <!-- <el-form-item prop="type" label="所属模块">
|
|
|
<el-select
|
|
|
v-model="classifyForm.type"
|
|
|
placeholder="请选择所属模块"
|
|
@@ -119,7 +122,7 @@
|
|
|
<el-option v-for="item in authTabsOpt" :key="item.val" :label="item.name" :value="item.val"/>
|
|
|
</el-select>
|
|
|
|
|
|
- </el-form-item>
|
|
|
+ </el-form-item> -->
|
|
|
<el-form-item prop="classify_name" label="分类名称">
|
|
|
<el-input
|
|
|
type="text"
|
|
@@ -130,7 +133,7 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
<el-form-item prop="parent_id" label="上级分类">
|
|
|
- <el-select
|
|
|
+ <!-- <el-select
|
|
|
v-model="classifyForm.parent_id"
|
|
|
placeholder="请选择"
|
|
|
size="small"
|
|
@@ -138,7 +141,9 @@
|
|
|
>
|
|
|
<el-option label="无" :value="0"/>
|
|
|
<el-option v-for="item in classifyparentArr" :key="item.ClassifyName" :label="item.ClassifyName" :value="item.Id"/>
|
|
|
- </el-select>
|
|
|
+ </el-select> -->
|
|
|
+ <el-cascader :options="classifyparentArr" v-model="classifyForm.parent_id" placeholder="请选择"
|
|
|
+ :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
|
|
@@ -200,72 +205,71 @@ export default {
|
|
|
computed:{
|
|
|
//添加分类是否展示
|
|
|
isAddClassifyBtnShow(){
|
|
|
- if(this.aTab===0&&this.authTabsOpt.length){
|
|
|
+ // 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===1&&this.authTabsOpt.length){
|
|
|
+ // return this.permissionBtn.checkPermissionBtn(
|
|
|
+ // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsAddClassify
|
|
|
+ // )
|
|
|
+ // }
|
|
|
},
|
|
|
//编辑是否展示
|
|
|
isEditBtnShow(){
|
|
|
- if(this.aTab===0){
|
|
|
+ // 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
|
|
|
- )
|
|
|
- }
|
|
|
+ // }else{
|
|
|
+ // return this.permissionBtn.checkPermissionBtn(
|
|
|
+ // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsEdit
|
|
|
+ // )
|
|
|
+ // }
|
|
|
},
|
|
|
//删除是否展示
|
|
|
isDeleteBtnShow(){
|
|
|
- if(this.aTab===0){
|
|
|
+ // 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
|
|
|
- )
|
|
|
- }
|
|
|
+ // }else{
|
|
|
+ // return this.permissionBtn.checkPermissionBtn(
|
|
|
+ // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsDel
|
|
|
+ // )
|
|
|
+ // }
|
|
|
},
|
|
|
//权限设置是否展示
|
|
|
isAuthSetBtnShow(){
|
|
|
- if(this.aTab===0){
|
|
|
+ // 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
|
|
|
+ // }else{
|
|
|
+ // return this.permissionBtn.checkPermissionBtn(
|
|
|
+ // this.permissionBtn.enClassifyBtn.classifyList_enClassify_rsAuthSetting
|
|
|
+ // )
|
|
|
+ // }
|
|
|
},
|
|
|
+ //英文研报、线上路演选项卡 - ETA1.1.7 不区分英文研报和线上路演,统一用英文研报的 按钮标识
|
|
|
+ // 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() {
|
|
@@ -287,6 +291,10 @@ export default {
|
|
|
label: "二级分类",
|
|
|
prop: "ClassifyTwo",
|
|
|
},
|
|
|
+ {
|
|
|
+ label: "三级分类",
|
|
|
+ prop: "ClassifyThree",
|
|
|
+ },
|
|
|
{
|
|
|
label: "操作",
|
|
|
prop: "handle",
|
|
@@ -299,7 +307,7 @@ export default {
|
|
|
title: '',
|
|
|
show: false,
|
|
|
classify_name: '',
|
|
|
- parent_id: 0,
|
|
|
+ parent_id: "0", // 数字的0,级联选择器不回显
|
|
|
sort: 1,
|
|
|
classify_id: '',
|
|
|
|
|
@@ -309,7 +317,7 @@ 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:[
|
|
@@ -362,7 +370,7 @@ export default {
|
|
|
CurrentIndex: this.page_no,
|
|
|
PageSize: 15,
|
|
|
KeyWord: this.searchform.key_word,
|
|
|
- ClassifyType:this.aTab
|
|
|
+ // ClassifyType:this.aTab
|
|
|
};
|
|
|
classifyEnInterface.classifyList(params).then(res => {
|
|
|
this.dataLoading = false;
|
|
@@ -370,25 +378,30 @@ 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');
|
|
|
}
|
|
|
});
|
|
|
},
|
|
|
|
|
|
- addClassify() {
|
|
|
+ addClassify() {
|
|
|
this.classifyForm = {
|
|
|
title: '新增英文分类',
|
|
|
show: true,
|
|
|
classify_name: '',
|
|
|
- parent_id: 0,
|
|
|
+ parent_id: "0",
|
|
|
sort: 1,
|
|
|
type:0
|
|
|
}
|
|
@@ -396,16 +409,13 @@ export default {
|
|
|
|
|
|
/* 获取一级分类 */
|
|
|
getClassifyOne() {
|
|
|
- classifyEnInterface.classifyOne({ CurrentIndex: 1, PageSize: 9999,ClassifyType:this.classifyForm.type })
|
|
|
+ classifyEnInterface.classifyOne({ CurrentIndex: 1, PageSize: 9999 /**,ClassifyType:this.classifyForm.type */ })
|
|
|
.then(res => {
|
|
|
if(res.Ret !== 200) return
|
|
|
|
|
|
- this.classifyparentArr=[];
|
|
|
- res.Data.List && res.Data.List.forEach((item,i)=>{
|
|
|
- item.Id=parseInt(item.Id);
|
|
|
+ this.classifyparentArr=res.Data.List || [];
|
|
|
|
|
|
- if(!item.Child) this.classifyparentArr.push(item);
|
|
|
- });
|
|
|
+ this.classifyparentArr.unshift({Id:"0",ClassifyName:'无',Child:null})
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -424,7 +434,7 @@ export default {
|
|
|
title: '编辑分类',
|
|
|
show: true,
|
|
|
classify_name: ClassifyName,
|
|
|
- parent_id: ParentId,
|
|
|
+ parent_id: ParentId==0?0+'':ParentId,//数字的0,'无'不回显
|
|
|
sort: Sort,
|
|
|
classify_id: Id,
|
|
|
type:ClassifyType
|
|
@@ -453,17 +463,19 @@ 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,
|
|
|
- ParentId: parent_id,
|
|
|
+ ParentId: parseInt(parent_id),
|
|
|
Sort: sort
|
|
|
}
|
|
|
|
|
|
const { Ret,Msg } = classify_id
|
|
|
? await classifyEnInterface.classifyEdit({...params,ClassifyId: classify_id})
|
|
|
- : await classifyEnInterface.classifyAdd({...params,ClassifyType:this.classifyForm.type})
|
|
|
+ : await classifyEnInterface.classifyAdd(params)
|
|
|
+ // : await classifyEnInterface.classifyAdd({...params,ClassifyType:this.classifyForm.type})
|
|
|
|
|
|
if(Ret !== 200) return
|
|
|
this.$message.success(Msg)
|
|
@@ -478,25 +490,25 @@ export default {
|
|
|
},
|
|
|
|
|
|
//切换分类
|
|
|
- handleTabChange(item){
|
|
|
- this.aTab=item.val
|
|
|
- this.page_no=1
|
|
|
- this.searchform.key_word=''
|
|
|
- this.getList()
|
|
|
- },
|
|
|
+ // handleTabChange(item){
|
|
|
+ // this.aTab=item.val
|
|
|
+ // this.page_no=1
|
|
|
+ // this.searchform.key_word=''
|
|
|
+ // this.getList()
|
|
|
+ // },
|
|
|
|
|
|
//新增分类时切换分类
|
|
|
- FormClassifyChange(){
|
|
|
- this.classifyForm.parent_id=0
|
|
|
- this.getClassifyOne()
|
|
|
- }
|
|
|
+ // FormClassifyChange(){
|
|
|
+ // this.classifyForm.parent_id=0
|
|
|
+ // this.getClassifyOne()
|
|
|
+ // }
|
|
|
},
|
|
|
|
|
|
mounted() {
|
|
|
- if(this.authTabsOpt.length){
|
|
|
- this.aTab = this.authTabsOpt[0].val
|
|
|
+ // if(this.authTabsOpt.length){
|
|
|
+ // this.aTab = this.authTabsOpt[0].val
|
|
|
this.getList();
|
|
|
- }
|
|
|
+ // }
|
|
|
},
|
|
|
};
|
|
|
</script>
|
|
@@ -542,3 +554,9 @@ export default {
|
|
|
}
|
|
|
}
|
|
|
</style>
|
|
|
+<style lang="scss">
|
|
|
+.el-cascader .el-input{
|
|
|
+ width: 100%;
|
|
|
+}
|
|
|
+
|
|
|
+</style>
|