|
@@ -12,53 +12,48 @@
|
|
|
<div class="dialog-container">
|
|
|
<div class="ppt-form">
|
|
|
<div class="input-item" style="position:relative;">
|
|
|
- <h3>{{$t('Slides.please_select_ppt_title')}}</h3>
|
|
|
+ <h3>
|
|
|
+ <span>{{$t('Slides.please_select_ppt_title')}}</span>
|
|
|
+ <el-cascader
|
|
|
+ @change="getPPtList"
|
|
|
+ :options="classifyOptions"
|
|
|
+ v-model="searchClassifyId"
|
|
|
+ :props="{
|
|
|
+ value: 'Id',
|
|
|
+ label: 'ClassifyName',
|
|
|
+ children: 'Child',
|
|
|
+ emitPath:false
|
|
|
+ }"
|
|
|
+ clearable
|
|
|
+ :placeholder="$t('ReportManage.smart_type_filtering')"
|
|
|
+ style="width:200px;"
|
|
|
+ ></el-cascader>
|
|
|
+ </h3>
|
|
|
<div class="select-ppt-wrap select-wrap">
|
|
|
- <el-tabs value="public">
|
|
|
- <el-tab-pane :label="$t('Slides.public_ppt_tabs')" name="public">
|
|
|
- <div class="tree-container">
|
|
|
- <div class="tree-list" :key="treeKey">
|
|
|
- <div class="list-item" v-for="(item,index) in publicList" :key="item.nodeKeyId" @click.stop="expandList(index,'public')">
|
|
|
- <p class="item-label"><span @click.stop="expandList(index,'public')"><i :class="item.expand?'el-icon-caret-bottom':'el-icon-caret-right'"></i></span> {{item.label}}</p>
|
|
|
- <template v-if="item.expand">
|
|
|
- <div class="list-child" v-for="i in item.children" :key="i.nodeKeyId">
|
|
|
- <el-checkbox
|
|
|
- :disabled="disabled&&!choosedIdArr.includes(i.PptId)||i.disabled"
|
|
|
- v-model="i.checked"
|
|
|
- @change="(checked)=>{changeCheck(checked,i,'public')}"
|
|
|
- >{{i.label}}</el-checkbox>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <el-tabs value="public" v-model="panelSource" @tab-click="()=>{getCatalogsList();getPPtList()}">
|
|
|
+ <el-tab-pane :label="$t('Slides.public_ppt_tabs')" :name="3">
|
|
|
</el-tab-pane>
|
|
|
- <el-tab-pane :label="$t('Slides.my_ppt_tabs')" name="private">
|
|
|
- <div class="tree-container">
|
|
|
- <div class="tree-list" :key="treeKey">
|
|
|
- <div class="list-item" v-for="(item,index) in privateList" :key="item.nodeKeyId" @click.stop="expandList(index,'private')">
|
|
|
- <p class="item-label"><span @click.stop="expandList(index,'private')"><i :class="item.expand?'el-icon-caret-bottom':'el-icon-caret-right'"></i></span> {{item.label}}</p>
|
|
|
- <template v-if="item.expand">
|
|
|
- <div class="list-child" v-for="i in item.children" :key="i.nodeKeyId">
|
|
|
- <el-checkbox
|
|
|
- :disabled="disabled&&!choosedIdArr.includes(i.PptId)||i.disabled"
|
|
|
- v-model="i.checked"
|
|
|
- @change="(checked)=>{changeCheck(checked,i,'private')}"
|
|
|
- >{{i.label}}</el-checkbox>
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
+ <el-tab-pane :label="$t('Slides.my_ppt_tabs')" :name="1">
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
+
|
|
|
+ <ul class="tree-container" v-if="catalogPPTList.length">
|
|
|
+ <li v-for="item in catalogPPTList" :key="item.PptId" class="list-item">
|
|
|
+ <el-checkbox
|
|
|
+ v-model="item.checked"
|
|
|
+ @change="(checked)=>{changeCheck(checked,item)}"
|
|
|
+ >{{item.Title}}</el-checkbox>
|
|
|
+ </li>
|
|
|
+ </ul>
|
|
|
+
|
|
|
+ <tableNoData text="暂无ppt" size="mini" v-else/>
|
|
|
</div>
|
|
|
<div class="selected-ppt-wrap ">
|
|
|
<span>{{$t('Slides.selected_pages')}}:</span>
|
|
|
<div class="selected-ppt">
|
|
|
<div class="select-node" v-for="item in choosedItemArr" :key="item.PptId">
|
|
|
- <span>{{ item.Title }} {{translatePageNumber(item.PptPage)}}</span>
|
|
|
- <i class="el-icon-error" @click.stop="changeCheck(false,item,'unknow')"></i>
|
|
|
+ <span>{{ item.Title }} ({{item.PptPage}}页)</span>
|
|
|
+ <i class="el-icon-error" @click.stop="changeCheck(false,item,'list')"></i>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -74,7 +69,7 @@
|
|
|
<el-form-item prop="classify" :label="$t('ReportManage.ReportList.label_report_classify')">
|
|
|
<el-cascader
|
|
|
ref="cascader"
|
|
|
- :options="classifyOptions"
|
|
|
+ :options="privateClassifyList"
|
|
|
v-model="pptInfo.classify"
|
|
|
:props="{
|
|
|
value: 'Id',
|
|
@@ -87,10 +82,10 @@
|
|
|
/>
|
|
|
</el-form-item>
|
|
|
|
|
|
- <el-form-item prop="title" :label="$t('ReportManage.ReportList.label_report_tit')">
|
|
|
+ <el-form-item prop="Title" :label="$t('ReportManage.ReportList.label_report_tit')">
|
|
|
<el-input
|
|
|
:placeholder="$t('ReportManage.ReportList.input_title_please')"
|
|
|
- v-model="pptInfo.title"
|
|
|
+ v-model="pptInfo.Title"
|
|
|
style="width:400px"
|
|
|
>
|
|
|
</el-input>
|
|
@@ -149,9 +144,7 @@
|
|
|
|
|
|
<script>
|
|
|
import {pptInterface} from '@/api/api.js';
|
|
|
-import {pptEnInterface} from '@/api/modules/pptEnApi.js';
|
|
|
import {etaBaseConfigInterence} from '@/api/modules/etaBaseConfigApi.js';
|
|
|
-import { classifylist } from '@/api/modules/reportV2.js';
|
|
|
import {changeCatalogArr,createRandomCode} from '../../utils/untils';
|
|
|
import chooseCooperaUserDia from '@/views/report_manage/reportV2/components/chooseCooperaUserDia.vue';
|
|
|
export default {
|
|
@@ -169,26 +162,23 @@ export default {
|
|
|
ImgUrl:'',//读取etaBaseConfig中封面页的第一个
|
|
|
BackIndex:0,
|
|
|
TemplateType:1,
|
|
|
- classify: [],
|
|
|
- title: "",
|
|
|
+ classify: 0,
|
|
|
cooperationType: 1,//协作方式
|
|
|
cooperationUsers:[],
|
|
|
|
|
|
},//PPT的标题信息
|
|
|
publicList:[],
|
|
|
- privateList:[],
|
|
|
- treeKey:0,
|
|
|
+ catalogPPTList:[],
|
|
|
+
|
|
|
disabled:false,//判断所有的checkbox是否应该是启用/禁用状态
|
|
|
choosedIdArr:[],//选中的PPTIds
|
|
|
choosedItemArr:[],//选中的PPT item
|
|
|
- choosedTreesName:{},//选中的ppt分别来自哪个目录
|
|
|
+
|
|
|
PptId:0,//合并后的pptId
|
|
|
- showCatalog:false,
|
|
|
- selectedCatalogId:0,//选择的目录Id
|
|
|
saveLoading:null,//加载loading
|
|
|
- MyPrivateList:[],
|
|
|
|
|
|
classifyOptions: [],
|
|
|
+ privateClassifyList: [],
|
|
|
rules: {
|
|
|
classify: [
|
|
|
{
|
|
@@ -197,7 +187,7 @@ export default {
|
|
|
trigger: "change",
|
|
|
},
|
|
|
],
|
|
|
- title: [
|
|
|
+ Title: [
|
|
|
{
|
|
|
required: true,
|
|
|
message: '报告标题不能为空',
|
|
@@ -205,6 +195,9 @@ export default {
|
|
|
},
|
|
|
],
|
|
|
},
|
|
|
+
|
|
|
+ panelSource: 1,
|
|
|
+ searchClassifyId:0,
|
|
|
//协作人弹窗
|
|
|
isChooseCooperaUser: false,
|
|
|
};
|
|
@@ -213,10 +206,9 @@ export default {
|
|
|
mergePptShow(newValue){
|
|
|
if(newValue){
|
|
|
this.init()
|
|
|
- this.getCatalogsList()
|
|
|
- this.getPrivateList()
|
|
|
+ this.getCatalogsList('init')
|
|
|
+ this.getPPtList()
|
|
|
this.getBaseConfig()
|
|
|
- this.getclassifylist();
|
|
|
}
|
|
|
if(!newValue){
|
|
|
if(this.saveLoading){
|
|
@@ -226,16 +218,23 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
- // 获取分类
|
|
|
- getclassifylist() {
|
|
|
- //获取分类列表
|
|
|
- let params = { CurrentIndex: 0, PageSize: 1000, KeyWord: "",Enabled:1 };
|
|
|
|
|
|
- classifylist(params).then((res) => {
|
|
|
- if (res.Ret == 200 && Array.isArray(res.Data.List)) {
|
|
|
- this.classifyOptions = res.Data.List||[];
|
|
|
- }
|
|
|
- });
|
|
|
+ //ppt列表
|
|
|
+ async getPPtList() {
|
|
|
+ const res = await pptInterface.getPptListV2({
|
|
|
+ PageSize: 1000,
|
|
|
+ CurrentIndex: 1,
|
|
|
+ Source: this.panelSource,
|
|
|
+ ClassifyId: this.searchClassifyId,
|
|
|
+ Keyword: ''
|
|
|
+ })
|
|
|
+
|
|
|
+ if(res.Ret!==200) return
|
|
|
+ let data = res.Data.List||[];
|
|
|
+ this.catalogPPTList = data.map(_ => ({
|
|
|
+ ..._,
|
|
|
+ checked: this.choosedIdArr.includes(_.PptId)?true:false
|
|
|
+ }))
|
|
|
},
|
|
|
|
|
|
getChooseCooperaUser(val) {
|
|
@@ -249,10 +248,7 @@ export default {
|
|
|
cancelHandle(){
|
|
|
this.$emit('cancel')
|
|
|
},
|
|
|
- translatePageNumber(num){
|
|
|
- let str = this.$i18n.locale == 'zh' ?`({${num}}页)`:`(Slide{${num}})`
|
|
|
- return str
|
|
|
- },
|
|
|
+
|
|
|
async saveChange(){
|
|
|
const {result,msg} = this.checkForm()
|
|
|
if(!result){
|
|
@@ -269,14 +265,12 @@ export default {
|
|
|
background: 'rgba(255, 255, 255, 0.8)'
|
|
|
})
|
|
|
await this.getPptsDetail()
|
|
|
- if(this.$parent.currentLang==='en'){
|
|
|
- this.pptInfo.PptDate = (new Date().getFullYear())+'.'+(new Date().getMonth()+1)
|
|
|
- }
|
|
|
+
|
|
|
await this.addNewPpt()
|
|
|
if(this.PptId!==0){
|
|
|
this.saveLoading.close()
|
|
|
//跳转至ppt编辑页
|
|
|
- const path = this.$parent.currentLang!=='en'?'/ppteditor':'/ppteneditor'
|
|
|
+ const path = '/ppteditor'
|
|
|
this.$router.push({
|
|
|
path,
|
|
|
query:{
|
|
@@ -291,7 +285,7 @@ export default {
|
|
|
if(this.choosedIdArr.length!==2){
|
|
|
return {result:false,msg: this.$t('Slides.please_select_two_msg')}
|
|
|
}
|
|
|
- if(this.selectedCatalogId===0){
|
|
|
+ if(this.pptInfo.classify===0){
|
|
|
return {result:false,msg:this.$t('Slides.please_select_directory_msg') }
|
|
|
}
|
|
|
return {result:true,msg:''}
|
|
@@ -300,26 +294,21 @@ export default {
|
|
|
async getPptsDetail(){
|
|
|
//只需要content
|
|
|
let content_font = [],content_back=[]
|
|
|
- const res_font = this.$parent.currentLang!=='en'
|
|
|
- ? await pptInterface.getpptDetail({
|
|
|
- PptId:this.choosedIdArr[0]
|
|
|
- })
|
|
|
- : await pptEnInterface.getpptDetail({
|
|
|
- PptId:this.choosedIdArr[0]
|
|
|
- })
|
|
|
+ const res_font = await pptInterface.getpptDetail({
|
|
|
+ PptId:this.choosedIdArr[0]
|
|
|
+ })
|
|
|
+
|
|
|
if(res_font.Ret===200){
|
|
|
content_font = JSON.parse(res_font.Data.Content)
|
|
|
}
|
|
|
- const res_back = this.$parent.currentLang!=='en'
|
|
|
- ? await pptInterface.getpptDetail({
|
|
|
- PptId:this.choosedIdArr[1]
|
|
|
- })
|
|
|
- : await pptEnInterface.getpptDetail({
|
|
|
- PptId:this.choosedIdArr[1]
|
|
|
- })
|
|
|
+ const res_back = await pptInterface.getpptDetail({
|
|
|
+ PptId:this.choosedIdArr[1]
|
|
|
+ })
|
|
|
+
|
|
|
if(res_back.Ret===200){
|
|
|
content_back = JSON.parse(res_back.Data.Content)
|
|
|
}
|
|
|
+
|
|
|
//合并两个content,并给每个重新赋id,保证id唯一
|
|
|
let content = content_font.concat(content_back)
|
|
|
this.content = content.map(item=>{
|
|
@@ -329,17 +318,29 @@ export default {
|
|
|
},
|
|
|
//添加PPT
|
|
|
async addNewPpt(){
|
|
|
- const res = this.$parent.currentLang!=='en'
|
|
|
- ? await pptInterface.addppt({
|
|
|
- FirstPage:this.pptInfo,
|
|
|
- Content:JSON.stringify(this.content),
|
|
|
- GroupId:this.selectedCatalogId
|
|
|
- })
|
|
|
- : await pptEnInterface.addppt({
|
|
|
- FirstPage:this.pptInfo,
|
|
|
+ const {
|
|
|
+ Title,
|
|
|
+ ImgUrl,
|
|
|
+ BackIndex,
|
|
|
+ TemplateType,
|
|
|
+ } = this.pptInfo
|
|
|
+
|
|
|
+ const res = await pptInterface.addppt({
|
|
|
+ FirstPage:{
|
|
|
+ Title,
|
|
|
+ ImgUrl,
|
|
|
+ BackIndex,
|
|
|
+ TemplateType
|
|
|
+ },
|
|
|
Content:JSON.stringify(this.content),
|
|
|
- GroupId:this.selectedCatalogId
|
|
|
+ AddType: 1,
|
|
|
+ ClassifyId: this.pptInfo.classify,
|
|
|
+ Title: Title,
|
|
|
+ CollaborateType: this.pptInfo.cooperationType,
|
|
|
+ InheritPptId: 0,
|
|
|
+ CollaborateUserIds: this.pptInfo.cooperationUsers.map(_ => _.NodeId)
|
|
|
})
|
|
|
+
|
|
|
if(res.Ret===200){
|
|
|
this.$message.success(this.$t('Slides.merging_successful_msg'))
|
|
|
this.PptId = res.Data.PptId
|
|
@@ -351,84 +352,45 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
//PPT的选中和取消选中处理
|
|
|
- changeCheck(type,i,treeName){
|
|
|
- let ListName = treeName==='public'?'privateList':'publicList'
|
|
|
- //从已选择的PPT内点击,只能是取消选中
|
|
|
- if(treeName==='unknow'){
|
|
|
- ListName = this.choosedTreesName[i.PptId]+'List'
|
|
|
- }
|
|
|
- if(type){
|
|
|
+ changeCheck(type,i,treeName=''){
|
|
|
+ if(type) {
|
|
|
+ if(this.choosedIdArr.length===2){
|
|
|
+ i.checked=false;
|
|
|
+ return this.$message.warning('最多只能选择两个ppt')
|
|
|
+ }
|
|
|
this.choosedIdArr.push(i.PptId)
|
|
|
this.choosedItemArr.push(i)
|
|
|
- this.choosedTreesName[i.PptId] = treeName
|
|
|
- //选中时,同时要将另一个List的对应i也勾选,如果有
|
|
|
- this.setNodeChecked(ListName,i.PptId,true)
|
|
|
- }else{
|
|
|
+ }else {
|
|
|
const index = this.choosedIdArr.findIndex(item=>item===i.PptId)
|
|
|
index!==-1&&this.choosedIdArr.splice(index,1)
|
|
|
index!==-1&&this.choosedItemArr.splice(index,1)
|
|
|
- //取消选中时,同时要将另一个List的对应i也取消勾选,如果有
|
|
|
- this.setNodeChecked(ListName,i.PptId,false)
|
|
|
- if(treeName==='unknow'){
|
|
|
- ListName = this.choosedTreesName[i.PptId]==='public'?'privateList':'publicList'
|
|
|
- this.setNodeChecked(ListName,i.PptId,false)
|
|
|
- }
|
|
|
- delete this.choosedTreesName[i.PptId]
|
|
|
- }
|
|
|
- if(this.choosedIdArr.length===2){
|
|
|
- this.disabled = true
|
|
|
- }else if(this.choosedIdArr.length<2){
|
|
|
- if(this.disabled){
|
|
|
- this.disabled=false
|
|
|
- }
|
|
|
+
|
|
|
+ treeName==='list' && this.catalogPPTList.forEach(_ => {
|
|
|
+ if(_.PptId===i.PptId) {
|
|
|
+ _.checked = false
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
},
|
|
|
- //设置ppt的选中取消和禁用启用属性
|
|
|
- setNodeChecked(listName,PptId,checked){
|
|
|
- this[listName].forEach(item=>{
|
|
|
- if(item.children.length>0){
|
|
|
- item.children.forEach(i=>{
|
|
|
- if(i.PptId===PptId){
|
|
|
- i.checked = checked
|
|
|
- //顺便禁用下,不然看起来就像选了四个
|
|
|
- i.disabled = checked
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //展开收起列表
|
|
|
- expandList(index,treeName){
|
|
|
- const {expand} = this[`${treeName}List`][index]
|
|
|
- this.$set(this[`${treeName}List`][index],'expand',!expand)
|
|
|
- this.treeKey++
|
|
|
- },
|
|
|
+
|
|
|
//获取PPT目录
|
|
|
- async getCatalogsList(){
|
|
|
- const res = this.$parent.currentLang!=='en'
|
|
|
- ? await pptInterface.getCatalogsList({IsNewPpt:1})
|
|
|
- : await pptEnInterface.getCatalogsList({IsNewPpt:1})
|
|
|
+ async getCatalogsList(type=''){
|
|
|
+ const res = await pptInterface.getCatalogsListV2({Source: 3})
|
|
|
if(res.Ret===200){
|
|
|
- const {PublicList,PrivateList} = res.Data
|
|
|
- this.publicList = changeCatalogArr(PublicList)
|
|
|
- this.privateList = changeCatalogArr(PrivateList)
|
|
|
- this.publicList.forEach(item=>{
|
|
|
- item.expand = false
|
|
|
- })
|
|
|
- this.privateList.forEach(item=>{
|
|
|
- item.expand = false
|
|
|
- })
|
|
|
+ this.classifyOptions = res.Data||[]
|
|
|
+ this.filterNode(this.classifyOptions)
|
|
|
+
|
|
|
+ type==='init' && (this.privateClassifyList = this.classifyOptions)
|
|
|
}
|
|
|
},
|
|
|
- //获取私有PPT目录
|
|
|
- async getPrivateList(){
|
|
|
- const res = this.$parent.currentLang!=='en'
|
|
|
- ? await pptInterface.getPrivateCatalogList()
|
|
|
- : await pptEnInterface.getPrivateCatalogList()
|
|
|
- if(res.Ret===200){
|
|
|
- this.MyPrivateList = res.Data.List||[]
|
|
|
- this.selectedCatalogId = this.MyPrivateList[0].GroupId
|
|
|
- }
|
|
|
+ filterNode(arr) {
|
|
|
+ arr.forEach(item => {
|
|
|
+ if(item.Child&&item.Child.length) {
|
|
|
+ this.filterNode(item.Child)
|
|
|
+ }else {
|
|
|
+ delete item.Child
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
|
|
|
//重置data的值
|
|
@@ -478,7 +440,7 @@ export default {
|
|
|
font-size: 14px;
|
|
|
color:#999999FF;
|
|
|
&.is-active{
|
|
|
- color: #409EFF
|
|
|
+ color: #0052D9;
|
|
|
}
|
|
|
}
|
|
|
.el-tabs__nav-wrap.is-top{
|
|
@@ -513,33 +475,6 @@ export default {
|
|
|
width: 100%;
|
|
|
display: flex;
|
|
|
justify-content: space-between;
|
|
|
- .public-tree,.private-tree{
|
|
|
- /* flex: 1; */
|
|
|
- width:47.5%;
|
|
|
- .tree-container{
|
|
|
- margin-top: 10px;
|
|
|
- width:100%;
|
|
|
- height:300px;
|
|
|
- overflow-y: scroll;
|
|
|
- border: 1px dashed #999;
|
|
|
- .tree-list{
|
|
|
- .list-item{
|
|
|
- cursor: pointer;
|
|
|
- .item-label{
|
|
|
- &:hover{
|
|
|
- background-color: #f0f4ff;
|
|
|
- }
|
|
|
- }
|
|
|
- .list-child{
|
|
|
- margin-left: 10px;
|
|
|
- &:hover{
|
|
|
- background-color: #f0f4ff;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
|
|
|
}
|
|
|
.ppt-form{
|
|
@@ -618,25 +553,23 @@ export default {
|
|
|
.tree-container{
|
|
|
height:200px;
|
|
|
overflow-y: scroll;
|
|
|
- .tree-list{
|
|
|
- .list-item{
|
|
|
- margin-left: 20px;
|
|
|
- margin-top: 6px;
|
|
|
- cursor: pointer;
|
|
|
- &:first-child{
|
|
|
- margin-top:0;
|
|
|
- }
|
|
|
- .item-label{
|
|
|
- &:hover{
|
|
|
- background-color: #f0f4ff;
|
|
|
- }
|
|
|
+ .list-item{
|
|
|
+ margin-left: 20px;
|
|
|
+ margin-top: 6px;
|
|
|
+ cursor: pointer;
|
|
|
+ &:first-child{
|
|
|
+ margin-top:0;
|
|
|
+ }
|
|
|
+ .item-label{
|
|
|
+ &:hover{
|
|
|
+ background-color: #f0f4ff;
|
|
|
}
|
|
|
- .list-child{
|
|
|
- margin-left: 10px;
|
|
|
- margin-top: 6px;
|
|
|
- &:hover{
|
|
|
- background-color: #f0f4ff;
|
|
|
- }
|
|
|
+ }
|
|
|
+ .list-child{
|
|
|
+ margin-left: 10px;
|
|
|
+ margin-top: 6px;
|
|
|
+ &:hover{
|
|
|
+ background-color: #f0f4ff;
|
|
|
}
|
|
|
}
|
|
|
}
|