|
@@ -2,9 +2,9 @@
|
|
|
<div class="edit-smart-report-page">
|
|
|
<!-- 顶部操作栏 -->
|
|
|
<div class="top-action-wrap">
|
|
|
- <div class="title">标题</div>
|
|
|
+ <div class="title">{{reportInfo&&reportInfo.Title}}</div>
|
|
|
<ul class="action-list">
|
|
|
- <li class="action-item">
|
|
|
+ <li class="action-item" @click="showReportBaseInfo=true">
|
|
|
<img src="~@/assets/img/smartReport/icon01.png" alt="">
|
|
|
<span>基础信息</span>
|
|
|
</li>
|
|
@@ -127,11 +127,18 @@
|
|
|
:content="activeContent"
|
|
|
@imgChange="handleTextChange"
|
|
|
/>
|
|
|
+ <!-- 图库插入 -->
|
|
|
<ETAChart
|
|
|
v-if="rightType==='etaChart'"
|
|
|
+ @handleImportMyChart="handleImportMyChart"
|
|
|
/>
|
|
|
+ <!-- ETA表格 -->
|
|
|
+ <ETASheet v-if="rightType==='etaSheet'"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <!-- 报告基础信息 -->
|
|
|
+ <BaseInfo v-model="showReportBaseInfo" :id="$route.query.id" @save="handleReportEdit" />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
@@ -144,20 +151,29 @@ import _ from 'lodash'
|
|
|
import TextEdit from './components/TextEdit.vue'
|
|
|
import ImgEdit from './components/ImgEdit.vue'
|
|
|
import ETAChart from './components/ETAChart.vue'
|
|
|
+import ETASheet from './components/ETASheet.vue'
|
|
|
import { getPublicSettingsApi } from '@/api/modules/oldApi';
|
|
|
+import {apiSmartReport} from '@/api/modules/smartReport'
|
|
|
+import BaseInfo from './components/BaseInfo.vue'
|
|
|
+
|
|
|
export default {
|
|
|
name:"smartReportEdit",
|
|
|
components: {
|
|
|
draggable,
|
|
|
+ BaseInfo,
|
|
|
TextComp,
|
|
|
ChartComp,
|
|
|
ImgComp,
|
|
|
TextEdit,
|
|
|
ImgEdit,
|
|
|
- ETAChart
|
|
|
+ ETAChart,
|
|
|
+ ETASheet
|
|
|
},
|
|
|
data() {
|
|
|
return {
|
|
|
+ reportInfo:null,
|
|
|
+ showReportBaseInfo:false,
|
|
|
+
|
|
|
topTypeList:[
|
|
|
{
|
|
|
name:'图库',
|
|
@@ -222,6 +238,41 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 批量插入myETA数据
|
|
|
+ handleImportMyChart(list){
|
|
|
+ const LINK_CHART_URL = this.$setting.dynamicOutLinks.ChartViewUrl+'/chartshow';
|
|
|
+ // console.log(list);
|
|
|
+ let arr=[]
|
|
|
+ // 分成三个一组
|
|
|
+ for (let index = 0; index < list.length; index+=3) {
|
|
|
+ const temarr=list.slice(index,index+3)
|
|
|
+ let resArr={child:[]}
|
|
|
+ if(temarr.length===1){//落单了
|
|
|
+ resArr={
|
|
|
+ compId:3,
|
|
|
+ compType:'chart',
|
|
|
+ content:`${LINK_CHART_URL}?code=${temarr[0].UniqueCode}`,
|
|
|
+ id:this.getCompId(`chart${temarr[0].UniqueCode}_`),
|
|
|
+ child:[]
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ temarr.forEach(e => {
|
|
|
+ resArr.child.push({
|
|
|
+ compId:3,
|
|
|
+ compType:'chart',
|
|
|
+ content:`${LINK_CHART_URL}?code=${e.UniqueCode}`,
|
|
|
+ id:this.getCompId(`chart${e.UniqueCode}_`),
|
|
|
+ child:[]
|
|
|
+ })
|
|
|
+ });
|
|
|
+ }
|
|
|
+ arr.push(resArr)
|
|
|
+ }
|
|
|
+ // console.log(arr);
|
|
|
+ this.conList=[...this.conList,...arr]
|
|
|
+
|
|
|
+ },
|
|
|
+
|
|
|
handleParentAdd(e){
|
|
|
console.log('container-onAdd操作------------------->');
|
|
|
|
|
@@ -280,7 +331,7 @@ export default {
|
|
|
{
|
|
|
compId:compData.compId,
|
|
|
compType:compData.compType,
|
|
|
- content:'',
|
|
|
+ content:compData.content||'',
|
|
|
id:this.getCompId(compData.compType),
|
|
|
child:[]
|
|
|
}
|
|
@@ -410,31 +461,53 @@ export default {
|
|
|
return type+new Date().getTime()
|
|
|
},
|
|
|
|
|
|
+ // 编辑报告
|
|
|
+ handleReportEdit(e){
|
|
|
+ const params={
|
|
|
+ SmartReportId:Number(this.$route.query.id)||0,
|
|
|
+ ...e,
|
|
|
+ Content:$('.report-html-wrap').html(),
|
|
|
+ ContentStruct:JSON.stringify(this.conList)
|
|
|
+ }
|
|
|
+ console.log(params);
|
|
|
+ apiSmartReport.reportEdit({...params}).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.$message.success('保存成功')
|
|
|
+ this.reportInfo.Title=params.Title
|
|
|
+ this.showReportBaseInfo=false
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+
|
|
|
/* 获取动态配置 外部动态链接 */
|
|
|
async getPublicSettings() {
|
|
|
const res = await getPublicSettingsApi();
|
|
|
if(res.Ret !== 200) return
|
|
|
|
|
|
this.$store.commit('SET_DYNAMIC_LINK',res.Data)
|
|
|
+ },
|
|
|
+
|
|
|
+ // 获取报告详情
|
|
|
+ getReportDetail(){
|
|
|
+ const id=this.$route.query.id||0
|
|
|
+ if(!id) return
|
|
|
+ apiSmartReport.reportDetail({
|
|
|
+ SmartReportId:Number(id)
|
|
|
+ }).then(res=>{
|
|
|
+ if(res.Ret===200){
|
|
|
+ this.reportInfo=res.Data
|
|
|
+ this.conList=res.Data.ContentStruct?JSON.parse(res.Data.ContentStruct):[]
|
|
|
+ }
|
|
|
+ })
|
|
|
}
|
|
|
|
|
|
},
|
|
|
created() {
|
|
|
this.getPublicSettings()
|
|
|
+ this.getReportDetail()
|
|
|
},
|
|
|
}
|
|
|
</script>
|
|
|
-<style lang="scss">
|
|
|
- .sortable-ghost{
|
|
|
- width: 200px !important;
|
|
|
- height: 180px !important;
|
|
|
- background-color: #fff !important;
|
|
|
- img{
|
|
|
- width: 100% !important;
|
|
|
- height: 100% !important;
|
|
|
- }
|
|
|
- }
|
|
|
-</style>
|
|
|
<style lang='scss' scoped>
|
|
|
div{
|
|
|
box-sizing: border-box;
|