1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846 |
- <template>
- <div class="predictEdb-container" >
- <span
- class="slide-icon slide-right"
- @click="isSlideLeft = !isSlideLeft"
- v-show="isSlideLeft"
- >
- <i class="el-icon-d-arrow-right"></i>
- </span>
- <div class="predict-edb-main" id="box">
- <div class="main-left left" id="left" v-show="!isSlideLeft">
- <div class="datasheet_top">
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_addEdb"
- type="primary" @click="addEdbHandle">添加指标</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_calcuEdb"
- type="primary" @click="addComputedHandler" style="margin-right:10px;">计算指标</el-button>
- <change-lang v-permission="permissionBtn.predictEdbPermission.edbPreData_switchEn"
- :lang="currentLang" style="height: 32px;" @changeLang="changeLangHandle"/>
- </div>
- <div class="search-cont" v-loading="searchLoading">
- <el-select
- v-model="search_txt"
- ref="searchRef"
- :filterable="!search_txt"
- remote
- clearable
- placeholder="指标名称"
- style="width: 100%"
- :remote-method="searchHandle"
- @focus="searchHandle('')"
- >
- <i slot="prefix" class="el-input__icon el-icon-search"></i>
- <el-option
- v-for="item in searchOptions"
- :key="item.EdbInfoId"
- :label="currentLang==='en'?(item.EdbNameEn||item.EdbName):item.EdbName"
- :value="item.EdbInfoId"
- >
- <span>{{ currentLang==='en' ? (item.EdbNameEn||item.EdbName) : item.EdbName }}</span>
- </el-option>
- </el-select>
- </div>
- <div style="margin:20px 0;padding:0 20px;display:flex;justify-content:space-between">
- <span>目录</span>
- <el-checkbox v-model="isOnlyMe" v-permission="permissionBtn.predictEdbPermission.edbPreData_isOnlyMine"
- @change="onlyMeHandler">只看我的</el-checkbox>
- </div>
- <div class="tree-cont">
- <el-tree
- ref="treeRef"
- class="target_tree"
- :data="treeData"
- node-key="UniqueCode"
- :props="defaultProp"
- :allow-drag="canDragHandle"
- :allow-drop="canDropHandle"
- :current-node-key="select_node"
- :default-expanded-keys="defaultShowNodes"
- :draggable="isEdbBtnShow('edbPreData_classifyOpt_move')"
- :expand-on-click-node="false"
- check-strictly
- empty-text="暂无分类"
- lazy
- :load="getLazyTreeData"
- @node-expand="handleNodeExpand"
- @node-collapse="handleNodeCollapse"
- @current-change="nodeChange"
- @node-drop="dropOverHandle"
- @node-drag-end="dropMouseLeave"
- @node-drag-leave="dropMouseLeave"
- @node-drag-enter="dropMouseOver"
- @node-drag-over="dropMouseOver"
- >
- <span class="custom-tree-node" slot-scope="{ node, data }">
- <el-input
- ref="editVal"
- style="width: 90px"
- placeholder="请输入值"
- class="label-input"
- v-model="new_label"
- v-if="data.isEdit"
- @blur="changeValue(data)"
- />
- <span
- @dblclick.stop="editNodeLabel(data)"
- v-else
- class="text_oneLine node_label"
- :style="`width:${
- (select_node === data.UniqueCode && node.Nodewidth) || ''
- }`"
- :id="`node${data.UniqueCode}`"
- >
- <span>{{ currentLang==='en' ? (data.ClassifyNameEn||data.ClassifyName) : data.ClassifyName }}</span>
- </span>
- <span
- style="display: flex; align-items: center"
- v-if="select_node === data.UniqueCode"
- >
- <img
- src="~@/assets/img/data_m/move_ico.png"
- alt=""
- style="width: 14px; height: 14px; margin-right: 8px"
- v-if="data.Button.MoveButton"
- />
- <!-- 添加子项 -->
- <img
- src="~@/assets/img/set_m/add.png"
- alt=""
- style="width: 14px; height: 14px; margin-right: 8px"
- @click.stop="addNode(node, data)"
- v-if="data.Button.AddButton&&!data.EdbInfoId&&isEdbBtnShow('edbPreData_classifyOpt_add')&&node.level<6"
- />
- <!-- 编辑目录 -->
- <img
- src="~@/assets/img/set_m/edit.png"
- alt=""
- style="width: 15px; height: 14px; margin-right: 8px"
- @click.stop="editNode(node, data)"
- v-if="data.Button.OpButton&&!data.EdbInfoId&&isEdbBtnShow('edbPreData_classifyOpt_add')"
- />
- <!-- 删除目录 -->
- <img
- slot="reference"
- src="~@/assets/img/set_m/del.png"
- alt=""
- style="width: 14px; height: 14px"
- @click.stop="removeNode(node, data)"
- v-if="data.Button.DeleteButton&&!data.EdbInfoId&&isEdbBtnShow('edbPreData_classifyOpt_delete')"
- />
- <!-- 查看预测规则 -->
- <i class="el-icon-view" v-if="data.EdbInfoId&&isEdbBtnShow('edbPreData_checkPreRule')" @click.stop="viewNode(node,data)"></i>
- <!-- 查看关联图表 -->
- <img
- v-if="data.Button.ShowChartRelation&&isEdbBtnShow('edbPreData_checkRelatedChart')"
- @click.stop="showAssociateChart=true,showAssociateComputeData=false"
- src="~@/assets/img/icons/associate_chart.png"
- style="width: 14px; height: 14px;margin-left: 8px"
- alt=""
- />
- <!-- 查看关联指标 -->
- <img
- v-if="data.Button.ShowEdbRelation&&isEdbBtnShow('edbPreData_checkRelatedEdb')"
- @click.stop="showAssociateComputeData=true,showAssociateChart=false"
- src="~@/assets/img/icons/associate_data.png"
- style="width: 14px; height: 14px;margin-left: 8px"
- alt=""
- />
- </span>
- </span>
- </el-tree>
- <div
- class="noDepart"
- @click="addLevelOneHandle"
- v-if="opLevelOneClassify&&isEdbBtnShow('edbPreData_classifyOpt_add')"
- >
- <img
- src="~@/assets/img/set_m/add_ico.png"
- alt=""
- style="width: 16px; height: 16px; margin-right: 10px"
- />
- <span>添加一级目录</span>
- </div>
- </div>
- <span
- class="move-btn resize"
- v-drag
- id="resize"
- @mousemove="dynamicNode && resetNodeStyle(dynamicNode)"
- ></span>
- <span class="slide-icon slide-left" @click="isSlideLeft = !isSlideLeft">
- <i class="el-icon-d-arrow-left"></i>
- </span>
- </div>
- <div class="main-right" id="right" :style="isSlideLeft ? 'width:100%' : 'width:80%'"
- :class="{'detail-main':select_id&&!showAssociateChart&&!showAssociateComputeData}"
- >
- <!-- 详情 -->
- <div class="edb-detail-wrapper main-min-width" v-if="select_id&&!showAssociateChart&&!showAssociateComputeData">
- <div class="detail-header">
- <el-tabs v-model="activeTab" @tab-click="changeShowType">
- <el-tab-pane label="走势图" name="Chart">
- </el-tab-pane>
- <el-tab-pane label="数据详情" name="Data">
- </el-tab-pane>
- </el-tabs>
- <div class="edb-tool-icon edb-tool" style="align-items: center;">
- <el-popover
- placement="left"
- trigger="click"
- popper-class="edb-tool-popover"
- width="320" style="display: inline-block;">
- <div class="edb-tool-wrap">
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_enNameSetting"
- type="text" @click="clickEdbNameHandle" v-if="currentLang==='ch'||!edb_nameEn">
- 设置英文名称
- </el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_edbSource"
- type="text" @click="isLookHistory=true;lookEdbId=select_id">指标溯源</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_update"
- type="text" @click="updateEdbPartHandle">刷新</el-button>
- <el-button type="text" @click="editEdbHandle('')"
- v-if="edbButton.OpButton&&isEdbBtnShow('edbPreData_edit')">编辑</el-button>
- <el-button type="text" @click="saveEdbHandle"
- v-if="detail_show_chart&&isEdbBtnShow('edbPreData_save')">保存</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_recalcu"
- type="text" @click="updateEdbHandle">重新计算</el-button>
- <el-button class="deletesty" @click="delEdbHandle" type="text"
- v-if="edbButton.DeleteButton&&isEdbBtnShow('edbPreData_del')">删除</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_copyData"
- type="text" @click="copyData">复制数据</el-button>
- </div>
- <div class="edb-btn" slot="reference">
- <el-button type="text">操作</el-button>
- <i class="el-icon-more" style="font-size: 14px;transform: rotate(90deg);cursor: pointer;color: #3375e1;"/>
- </div>
- </el-popover>
- </div>
- <!-- <div class="edb-tool">
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_enNameSetting"
- type="text" @click="clickEdbNameHandle" v-if="currentLang==='ch'||!edb_nameEn">
- 设置英文名称
- </el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_edbSource"
- type="text" @click="isLookHistory=true;lookEdbId=select_id">指标溯源</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_update"
- type="text" @click="updateEdbPartHandle">刷新</el-button>
- <el-button type="text" @click="editEdbHandle('')"
- v-if="edbButton.OpButton&&isEdbBtnShow('edbPreData_edit')">编辑</el-button>
- <el-button type="text" @click="saveEdbHandle"
- v-if="detail_show_chart&&isEdbBtnShow('edbPreData_save')">保存</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_recalcu"
- type="text" @click="updateEdbHandle">重新计算</el-button>
- <el-button class="deletesty" @click="delEdbHandle" type="text"
- v-if="edbButton.DeleteButton&&isEdbBtnShow('edbPreData_del')">删除</el-button>
- <el-button v-permission="permissionBtn.predictEdbPermission.edbPreData_copyData"
- type="text" @click="copyData">复制数据</el-button>
- </div> -->
- </div>
- <!-- -->
- <div class="detail-wrap">
-
- <component
- :is="detail_show_chart?'edbDetail':'childData'"
- :id="select_id"
- :lang="currentLang"
- :isAllowEditLimit="isEdbBtnShow('edbPreData_editLimit')"
- ref="detailComponentRef"
-
- @updateTit="setNameBack"
- @setCurrentClassify="setCurrentClassify"
- @setOpera="(obj) => { edbButton = obj }"
- @openEnNameDia="openEnNameDia"
- />
- </div>
- </div>
- <!-- 列表 -->
- <div class="sheet-list-cont" v-else-if="!select_id">
- <div class="list-top">
- <span>共{{ edb_total }}个预测指标</span>
- </div>
- <div
- class="edbChartList-wrapper"
- ref="listRef"
- @scroll="loadMoreHandle"
- >
- <div class="chart-list-item-wrap">
- <div class="sheet-item" v-for="item in edbChartList" :key="item.EdbInfoId">
- <div class="item-top">
- <span class="text_oneLine">{{ currentLang === 'en' ? (item.EdbNameEn||item.EdbName) : item.EdbName }}</span>
- </div>
- <div class="chart-img" @click="detailShowHandle(item)"
- :style="item.ChartImage?{background: `no-repeat top/cover url('${item.ChartImage}')`}:{}"></div>
- <div class="item-bottom">
- <span>创建时间: {{ item.CreateTime.slice(0,10) }}</span>
- </div>
- </div>
- </div>
- <!-- <el-col
- :span="8"
- style="margin-bottom: 20px; padding-right: 20px"
- v-for="item in edbChartList"
- :key="item.EdbInfoId"
- >
- <el-card class="sheet-item">
- <div slot="header" class="item-top">
- <span class="text_oneLine">{{ currentLang === 'en' ? (item.EdbNameEn||item.EdbName) : item.EdbName }}</span>
- </div>
- <img
- :src="item.ChartImage"
- alt=""
- class="chart-img"
- @click="detailShowHandle(item)"
- />
- <div class="item-bottom">
- <span>创建时间: {{ item.CreateTime.slice(0,10) }}</span>
- </div>
- </el-card>
- </el-col> -->
- </div>
- <div v-if="!edb_total" class="nodata">
- <tableNoData text="暂无指标"/>
- </div>
- </div>
- <!-- 指标关联图模块 -->
- <div class="edb-detail-wrapper" style="padding: 30px 20px;" v-if="showAssociateChart&&select_id">
- <dataAssociateChart :edbInfoId="select_id"></dataAssociateChart>
- </div>
- <div class="edb-detail-wrapper" style="padding: 30px 20px;" v-if="showAssociateComputeData&&select_id">
- <dataAssociateComputeData :edbInfoId="select_id"></dataAssociateComputeData>
- </div>
- </div>
- </div>
- <!-- 计算弹窗控制 -->
- <el-dialog
- :visible.sync="isOpenComputed"
- :close-on-click-modal="false"
- :modal-append-to-body='false'
- @close="isOpenComputed=false;"
- custom-class="dialog-computed"
- top="6vh"
- center
- width="85vw"
- v-dialogDrag>
- <div class="dialog-computed-header">
- <el-radio-group v-model="computed_source" size="medium" @change="computed_type = 0">
- <el-radio-button :label="1">常规计算</el-radio-button>
- <el-radio-button :label="2">批量计算</el-radio-button>
- </el-radio-group>
- </div>
- <ul class="computed-ul">
- <li
- :class="['cpmputed-li',{'act':item.type === computed_type}]"
- v-for="item in computedTypes"
- :key="item.type"
- @click="changeComputedType(item.type)"
- >
- {{item.name}}
- <el-popover
- placement="top-start"
- width="450"
- trigger="hover"
- v-if="tips.get(item.type)"
- >
- <p style="padding:20px;line-height:25px;" v-html="tips.get(item.type)"/>
- <i slot="reference" class="el-icon-warning-outline"/>
- </el-popover>
- </li>
- </ul>
- </el-dialog>
- <!-- 指标弹窗 -->
- <edb-dialog
- :isShow.sync="isEdbDia"
- :title="edbdia_title"
- :edbForm="edbForm"
- @successHandle="handleEdbCallBack"
- />
- <!-- 分类弹窗 -->
- <edbClassifyDia
- :isOpenDialog.sync="classifyDia"
- :title="dialog_title"
- :form="classifyForm"
- @successCallback="getTreeData"
- />
- <!-- 输入英文指标弹窗 -->
- <set-en-name-dia
- :isOpenDialog="setEnName"
- @cancel="setEnName=false"
- :formData="formItemArray"
- @updateEnName="updateEnName"
- cType="predictEbd"
- />
- <!-- 运算指标弹窗 -->
- <computedDialog
- :isOpenComputed="computed_type === 31"
- :title="computedTit"
- :calulateForm="calulateForm"
- :calulateList="calulateList"
- @cancel="computed_type=0"
- @addCallBack="addComputedCallBack"
- @openPrev="isOpenComputed=true"
- @lookHistory="id => {isLookHistory=true;lookEdbId=id;}"
- />
- <!-- 同比同差计算弹窗 -->
- <!-- 转月值 同比 同差 平均值弹窗 -->
- <operationDialog
- :isOperation="[42,32,33,39,43,44,45,46,49,54,55,64,65,66,69,70].includes(computed_type) && computed_source===1"
- :type="computed_type"
- :operationForm="operationForm"
- @cancel="computed_type=0"
- @addCallBack="addComputedCallBack"
- @openPrev="isOpenComputed=true"
- @lookHistory="id => {isLookHistory=true;lookEdbId=id;}"
- @changeSource="changeComputedType"
- />
- <!-- 规则详情弹窗 -->
- <rules-detail
- :isOpenDialog.sync="isShowRuleDialog"
- :rules="showRules"
- :fromEdbInfo="showFromEdbInfo"
- />
- <!-- 批量计算弹窗 -->
- <batchComputedDialog
- :isBatchComputed="[32,33,39,43,44,45,42,64,65,66].includes(computed_type) && computed_source===2"
- :type="computed_type"
- edbSource="predict"
- @cancel="computed_type=0"
- @addCallBack="addComputedCallBack"
- @openPrev="isOpenComputed=true"
- @lookHistory="id => {isLookHistory=true;lookEdbId=id;}"
- @changeSource="changeComputedType"
- />
-
- <!-- 拼接弹窗 -->
- <joint-target-dia
- :isShow="computed_type === 'joint'"
- :params="operationForm"
- :isPredict="true"
- @cancel="computed_type=0"
- @addCallBack="addComputedCallBack"
- @openPrev="isOpenComputed=true"
- />
- <!-- 拟合残差弹窗 -->
- <fittingResidueDia
- :isShow="computed_type === 50"
- :type="50"
- :operationForm="operationForm"
- :isPredict="true"
- @cancel="computed_type=0"
- @addCallBack="addComputedCallBack"
- @openPrev="isOpenComputed=true"
- />
- <!-- 扩散指数弹窗 -->
- <diffusionIndexDialog
- :isShow="computed_type === 56 && computed_source===1"
- :type="computed_type"
- :isPredict="true"
- :operationForm="operationForm"
- @cancel="computed_type=0"
- @addCallBack="addComputedCallBack"
- @openPrev="isOpenComputed=true"
- />
- <!-- 指标历史记录 -->
- <edbHistoryDialog
- :isOpenDialog.sync="isLookHistory"
- :edbId="lookEdbId"
- />
- <!-- 指数修匀弹窗 -->
- <SmoothEdbDialog
- :is-open-smooth="computed_type==='alpha'"
- :computed-source="computed_source"
- :operationForm="operationForm"
- :isPredict="true"
- @cancel="computed_type=0"
- @openPrev="isOpenComputed=true"
- @addCallBack="addComputedCallBack"
- @lookHistory="id => {isLookHistory=true;lookEdbId=id;}"
- />
- </div>
- </template>
- <script>
- import * as preDictEdbInterface from '@/api/modules/predictEdbApi.js';
- import { dataBaseInterface } from '@/api/api.js';
- import leftMixin from './mixins/mixin';
- import edbDialog from './components/edbDia.vue'
- import childChart from './components/childChart.vue'
- import childData from './components/childData.vue'
- import edbDetail from './components/edbDetail.vue'
- import edbClassifyDia from './components/classifyDia.vue'
- import changeLang from "@/views/dataEntry_manage/components/changeLang.vue"
- import setEnNameDia from "@/views/dataEntry_manage/components/setEnNameDia.vue"
- import computedDialog from './components/computedDialog';
- import operationDialog from './components/operationDialog';
- import rulesDetail from './components/rulesDetailDia.vue'
- import batchComputedDialog from '@/views/dataEntry_manage/databaseComponents/batchComptedDialog.vue';
- import jointTargetDia from '@/views/dataEntry_manage/databaseComponents/jointTargetDia'
- import fittingResidueDia from '@/views/dataEntry_manage/databaseComponents/fittingResidueDia.vue';
- import diffusionIndexDialog from '@/views/dataEntry_manage/databaseComponents/diffusionIndexDia.vue';
- import { formulaTip } from '@/views/dataEntry_manage/databaseComponents/util';
- import dataAssociateChart from '@/views/dataEntry_manage/databaseComponents/dataAssociateChart.vue'
- import dataAssociateComputeData from '@/views/dataEntry_manage/databaseComponents/dataAssociateComputeData.vue'
- import SmoothEdbDialog from '@/views/dataEntry_manage/databaseComponents/smoothEdbDialog.vue';
- export default {
- name:'',
- components: {
- edbDialog,
- childChart,
- childData,
- edbClassifyDia,
- changeLang,
- setEnNameDia,
- computedDialog,
- operationDialog,
- edbDetail,
- rulesDetail,
- jointTargetDia,
- fittingResidueDia,
- batchComputedDialog,
- diffusionIndexDialog,
- dataAssociateChart,
- dataAssociateComputeData,
- SmoothEdbDialog
- },
- mixins:[ leftMixin ],
- beforeRouteLeave (to, from, next) {
- // 前去编辑则存一次选择的节点
- if(to.path=='/editpredictEdb'){
- const obj={
- code:this.select_node,
- id:this.select_id
- }
- sessionStorage.setItem('predictEdbTreeData',JSON.stringify(obj))
- }else{
- sessionStorage.setItem('predictEdbTreeData','')
- }
- next()
- },
- data () {
- return {
- showData: false,
- search_txt: '',
- searchOptions:[],
- isSlideLeft: false,//左侧分类收起
- select_node: '',//节点唯一标识code
- select_classify: '',
- new_label:'',//双击修改的value
- treeData: [], //分类数据
- defaultShowNodes: [], //展开节点
- defaultProp: {
- label: 'ClassifyName',
- children: 'Children',
- isLeaf:'isLeaf'
- }, //树结构配置项
- dynamicNode: null,
- edbName: '',
- edb_nameEn: '',
- edbUserId: '',
- /* 分类弹窗 */
- dialog_title:'',
- classifyDia: false, //
- classifyForm: {},
- /* 添加指标弹窗 */
- isEdbDia: false,
- edbdia_title:'',
- edbForm: {},
- select_id: '',//选中的id
- sheetDetailInfo: {},
- detail_show_chart: true,//详情展示方式 chart data
- /* 列表 */
- publicHaveMove: true,//是否还有列表数据
- edbChartList: [],
- edb_total: 0,
- public_page: 1,
- public_pages_size: 16,
- currentLang:'ch', // ch(中文) en(英文)
- setEnName:false,
- // 传入的formItem所需内容
- formItemArray:[],
- /* 计算指标弹窗 */
- isOpenComputed:false,
- computedTit:'',
- calulateForm:{},
- operationForm:{},
- calulateList:[],
- computed_type:0,//打开弹窗的类型
- tips: new Map([
- [31,formulaTip.get(4)],
- [42,formulaTip.get(5)],
- [32,formulaTip.get(6)],
- [33,formulaTip.get(7)],
- [39,formulaTip.get(8)],
- [43,formulaTip.get(12)],
- [44,formulaTip.get(13)],
- [45,formulaTip.get(14)],
- ['joint',formulaTip.get('joint')],
- [46,formulaTip.get(22)],
- [49,formulaTip.get(35)],
- [50,formulaTip.get(37)],
- [54,formulaTip.get(51)],
- [55,formulaTip.get(52)],
- [56,formulaTip.get(53)],
- ['toMonthSeason',formulaTip.get('toMonthSeason')],
- ['accumulate',formulaTip.get('accumulate')],
- [64,formulaTip.get(61)],
- [65,formulaTip.get(62)],
- [66,formulaTip.get(63)],
- ['alpha',formulaTip.get('alpha')]
- ]),//公式说明
- isShowRuleDialog: false,
- showRules: [],
- showFromEdbInfo: {},
- edbButton: {},//详情操作
- opLevelOneClassify: false,//一级分类按钮
- computed_source: 1,//计算类型 1常规 2批量
- isBatchComputed: false,//批量计算弹窗
- baseTypes: [
- { name: '指标运算',type: 31 },
- { name: '同比值',type: 32 },
- { name: '同差值',type: 33 },
- { name: 'N数值移动平均计算',type: 39 },
- { name: '累计值转月/季值',type: 'toMonthSeason' },
- { name: 'N数值环比值',type: 43 },
- { name: 'N数值环差值',type: 44 },
- { name: '升频',type: 45 },
- // { name: '指标拼接',type: 'joint' },
- { name: '时间移位',type: 46 },
- { name: '超季节性',type: 49 },
- { name: '拟合残差',type: 50 },
- { name: '年化',type: 55 },
- { name: '降频',type: 54 },
- { name: '扩散指数',type: 56 },
- { name: '累计值',type: 'accumulate' },
- { name: '指数修匀',type:'alpha'}
- ],
- batchTypes: [
- { name: '同比值',type: 32 },
- { name: '同差值',type: 33 },
- { name: 'N数值移动平均计算',type: 39 },
- { name: 'N数值环比值',type: 43 },
- { name: 'N数值环差值',type: 44 },
- { name: '升频',type: 45 },
- { name: '累计值转月/季值',type: 'toMonthSeason' },
- { name: '累计值',type: 'accumulate' },
- { name: '指数修匀',type:'alpha'}
- ],
- isOnlyMe:false,//只看我的
- /* 查看历史弹窗 */
- isLookHistory: false,
- lookEdbId: 0,
- searchLoading:false,
- showAssociateChart:false,//显示指标关联的图
- showAssociateComputeData:false,//显示指标关联的引用计算指标
- activeTab:'',
- };
- },
- computed: {
- computedTypes() {
- return this.computed_source === 1 ? this.baseTypes : this.batchTypes;
- },
- role() {
- let role = localStorage.getItem('Role') || '';
- if(['rai_admin','ficc_admin'].includes(role)) {
- return 'admin'
- }
- else {
- return role;
- }
- },
- /* 登录角色id */
- roleId() {
- let id = parseInt(localStorage.getItem('AdminId'));
- return id;
- },
- },
- watch: {
- /* 设置动态右侧区域宽度 */
- isSlideLeft(newval) {
- if (!newval) {
- this.$nextTick(() => {
- this.reloadRightWid();
- });
- }
- },
- // /* 表格id */
- select_id(newval) {
- this.detail_show_chart = true;
- this.activeTab='Chart'
- this.$nextTick(()=>{
- //切换为曲线图 重置选择状态
- if(this.$refs.detailComponentRef){
- this.$refs.detailComponentRef.$refs.chartInfo.chartInfo.ChartType=1;
- this.$refs.detailComponentRef.$refs.chartInfo.year_select=10;
- this.$refs.detailComponentRef.$refs.chartInfo.year_select_season=20;
- this.$refs.detailComponentRef.$refs.chartInfo.calendar_type='公历';
- this.$refs.detailComponentRef.$refs.chartInfo.count_year=5;
- this.$refs.detailComponentRef.$refs.chartInfo.count_year_season=5;
-
- this.$refs.detailComponentRef.$refs.chartInfo.select_date=[];
- this.$refs.detailComponentRef.$refs.chartInfo.season_year=[];
- this.$refs.detailComponentRef.$refs.chartInfo.dateTip='请选择时间段';
- }
- })
-
- },
- select_classify(newval) {
- if(this.$refs.listRef) this.$refs.listRef.scrollTop = 0;
- if(newval) {
- this.activeTab = ''
- this.public_page = 1;
- this.getPublicList()
- }
- },
- /* 搜索关键词 */
- search_txt(newval) {
- if(newval) {
- let search_obj = this.searchOptions.find(_ => _.EdbInfoId === newval);
- // let deep_arr = _.cloneDeep(this.treeData);
- // 查找图表的分类父级id
- // let arr = this.findParentNodeHandle(deep_arr, search_obj.ClassifyId).reverse(); // 父的父的父-父的父-父
- // this.defaultShowNodes = arr;
- this.select_node = search_obj.UniqueCode;
- this.$refs.treeRef.setCurrentKey(this.select_node);
- // 重置筛选状态
- this.select_id = newval;
- }
- }
- },
- methods: {
- isEdbBtnShow(type){
- const {predictEdbPermission,checkPermissionBtn}=this.permissionBtn
- return checkPermissionBtn(predictEdbPermission[type])||false
- },
- setCurrentClassify(ClassifyList){
- //获取指标详情后才能拿到准确的classifyId
- //根据准备的id查找指标的父级目录并展开
- console.log(ClassifyList);
-
- // 展开目录
- this.defaultShowNodes=ClassifyList.reverse().map(item=>item.UniqueCode)
-
- //滚动到高亮节点位置
- // this.$nextTick(()=>{
- setTimeout(() => {
- const dom = document.getElementById(`node${this.select_node}`)||{}
- const parentDom = document.getElementsByClassName('target_tree')[0];
- /* if (dom.offsetTop > parentDom.offsetHeight) {
- parentDom.scrollTo({
- top: dom.offsetTop - parentDom.offsetHeight / 2,
- left: 0,
- behavior: "smooth",
- });
- } */
- //parent可视区间:[scrollTop,scrollTop+offsetHeight]
- //node位置:node.offsetTop
- const overTop = dom.offsetTop+dom.clientHeight<parentDom.scrollTop
- const overBottom = dom.offsetTop+dom.clientHeight+30>parentDom.scrollTop+parentDom.offsetHeight
- if(overTop){
- parentDom.scrollTop = dom.offsetTop-30
- }
- if(overBottom){
- parentDom.scrollTop = dom.offsetTop - parentDom.offsetHeight/2
- }
- this.searchLoading = false;
- }, 1500);
- setTimeout(() => {
- this.$refs.treeRef.setCurrentKey(this.select_node);//设置高亮
- }, 1500);
- // })
- },
- setNameBack({edb_name,edb_nameEn,userid}) {
- this.edbName=edb_name;
- this.edb_nameEn= edb_nameEn;
- this.edbUserId=userid;
- },
- /* 添加指标 */
- addEdbHandle() {
- if(!this.treeData.length) return this.$message.warning('请先添加预测指标分类');
- this.$router.push({
- path:'/addpredictEdb'
- })
- },
- /* 获取分类 */
- getTreeData(params=null) {
- preDictEdbInterface.predictEdbCatalog({IsOnlyMe:this.isOnlyMe||false,ParentId:0}).then(res => {
- const { Ret,Data } = res;
-
- if(Ret !== 200) return
- this.treeData = Data.AllNodes || [];
- this.opLevelOneClassify = Data.CanOpClassify;
- this.currentLang = Data.Language === 'EN' ? 'en' : 'ch';
- this.showData = true;
- this.$nextTick(() => {
- /* 新增完成后 处理树展开和选中 */
- params && this.selectCurrentNode(params);
- });
- })
- },
- /* 搜索 */
- searchHandle(query) {
- if (query) {
- /* 查找列表 */
- preDictEdbInterface
- .edbSearch({
- Keyword: query,
- CurrentIndex: 1,
- PageSize: 10000,
- IsOnlyMe:this.isOnlyMe||false
- })
- .then((res) => {
- if (res.Ret !== 200) return
- this.searchOptions = res.Data.List || [];
- });
- } else {
- this.searchOptions = [];
- }
- },
- /* 选中分类变化时 */
- nodeChange({ UniqueCode,EdbInfoId,ClassifyId },node) {
- this.search_txt = '';
- this.select_node = UniqueCode;
- this.select_id = EdbInfoId || 0;
- this.select_classify = !EdbInfoId ? ClassifyId : 0;
- this.resetNodeStyle(node);
- this.dynamicNode = node;
- this.showAssociateChart=false
- this.showAssociateComputeData=false
- },
- async saveEdbHandle() {
- const {Ret} = await preDictEdbInterface.saveChartInfo({
- EdbInfoId: this.select_id,
- MaxValue: Number(this.$refs.detailComponentRef.$refs.chartInfo.tableData[0].MaxData),
- MinValue: Number(this.$refs.detailComponentRef.$refs.chartInfo.tableData[0].MinData)
- })
- if(Ret !== 200) return
- this.$message.success('保存成功')
- this.setChartImage()
- },
- /* 关联图片 */
- setChartImage() {
- let svg = this.$refs.detailComponentRef.$refs.chartInfo.$refs.chartRef.chart.getSVG({
- chart: {
- width: 340,
- height: 230,
- },
- });
- let form = new FormData();
- form.append("Img", svg);
- this.setImageHandle(form);
- },
- async setImageHandle(form) {
- let { Data } = await dataBaseInterface.uploadImgSvg(form);
- await preDictEdbInterface.setImg({
- EdbInfoId: this.select_id,
- ImageUrl: Data.ResourceUrl,
- });
- },
- /* 添加一级目录 */
- addLevelOneHandle() {
- this.dialog_title = '添加';
- this.classifyForm = {
- classify_name: '',
- Level:0,
- ParentId:0
- }
- this.classifyDia = true;
- },
- // 递归节点
- getNodeParentData(data,arr){
- if(data.level===0) return
- arr.push({classifyName:data.data.ClassifyName,classifyId:data.data.ClassifyId})
- this.getNodeParentData(data.parent,arr)
- return arr
- },
- addNode(node,{ClassifyName,ClassifyId}){
- this.dialog_title = '添加'
- let arr=[]
- arr=this.getNodeParentData(node,arr)
- /* 添加目录 */
- this.classifyForm = {
- classify_name:'',
- Level:node.level,
- ParentId:ClassifyId,
- parentArr:arr,
- }
- this.classifyDia = true;
- },
- /* 编辑节点 */
- editNode(node, { ClassifyName,ClassifyId,Level,ParentId}) {
- this.dialog_title = '编辑';
- let arr=[]
- arr=this.getNodeParentData(node.parent,arr)
- /* 编辑目录 */
- this.classifyForm = {
- classify_name: ClassifyName,
- classify_id: ClassifyId,
- Level:node.level-1,
- ParentId:ParentId,
- parentArr:arr,
- };
- this.classifyDia = true;
- },
- /* 删除节点校验 */
- async removeNode(node, { ClassifyId,EdbInfoId }) {
- const { Data } = await preDictEdbInterface.classifyDelCheck({ ClassifyId,EdbInfoId })
- const { DeleteStatus,TipsMsg } = Data;
- // DeleteStatus === 1
- // ? this.$confirm('该分类下关联指标不可删除', '删除失败', {
- // confirmButtonText: '知道了',
- // showCancelButton: false,
- // type: 'error',
- // }) : DeleteStatus === 0 && !EdbInfoId
- // ? this.$confirm('确定删除当前分类吗?', '提示', {
- // confirmButtonText: '确定',
- // cancelButtonText: '取消',
- // type: 'warning',
- // }).then(() => {
- // this.delApi(ClassifyId, EdbInfoId)
- // }): null;
- /**
- * 0 可删除
- * 1 关联指标
- * 2 有子目录无指标
- */
- const deleteLabelMap = {
- 1: '该目录关联指标不可删除',
- 2: '确认删除当前目录及包含的子目录吗?',
- 3: '当前指标已用作画图,不可删除',
- 4: TipsMsg
- }
- if([1,3,4].includes(DeleteStatus)) this.$confirm(
- deleteLabelMap[DeleteStatus],
- '删除失败',
- {
- confirmButtonText: '知道了',
- showCancelButton:false,
- type: 'error'
- })
- else if([0,2].includes(DeleteStatus)) this.$confirm(
- DeleteStatus === 2
- ? deleteLabelMap[DeleteStatus]
- : EdbInfoId?'删除后指标和指标值均不可使用,确认删除吗?':'确定删除当前目录吗?',
- '提示',
- {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning'
- }).then(() => {
- this.delApi(ClassifyId, EdbInfoId)
- }).catch(() => {
- });
- },
- /* 删除方法 */
- delApi(ClassifyId, EdbInfoId, type='') {
- preDictEdbInterface
- .classifyDel({
- ClassifyId,
- EdbInfoId,
- })
- .then((res) => {
- if (res.Ret !== 200) return
- this.$message.success(res.Msg);
- if (!res.Data.EdbInfoId || !res.Data) this.select_id = '';
- //删除表格后自动显示下一张表格
- type && res.Data.EdbInfoId
- ? this.getTreeData({
- code: res.Data.UniqueCode,
- id: res.Data.EdbInfoId,
- classifyId:res.Data.ClassifyId
- })
- : this.getTreeData();
- });
- },
- /* 删除指标 */
- delEdbHandle() {
- this.$confirm('ETA预测指标删除后不可恢复,确认删除吗?', '提示', {
- confirmButtonText: '确定',
- cancelButtonText: '取消',
- type: 'warning',
- })
- .then(() => {
- this.delApi(
- this.select_classify || 0,
- this.select_id,
- 'del-edb'
- );
- })
- .catch(() => {});
- },
- /* 分类成功回调 */
- classifyCallback(type) {
- this.getTreeData();
- if (type === 'add') {
- //新增分类完成之后,展开父节点显示刚新增的分类,若已展开节点则不做处理
- let code = this.add_parent_id;
- let flag = this.defaultShowNodes.some(item => item === code);
- !flag && this.defaultShowNodes.push(code);
- this.add_parent_id = '';
- }
- },
- /* 展开对应菜单 显示详情 */
- detailShowHandle({ UniqueCode, EdbInfoId,ClassifyId}) {
- let params = {
- code: UniqueCode,
- id: EdbInfoId,
- classifyId:ClassifyId
- };
- this.selectCurrentNode(params);
- this.select_classify = 0;
- },
- /* 操作指标后 */
- handleEdbCallBack(param) {
- this.getTreeData(param)
- //编辑后刷数据
- if(!param) {
- console.log('编辑后刷数据');
- this.detail_show_chart ? this.$refs.detailComponentRef.getDetail('updateImg') : this.$refs.detailComponentRef.getData();
- }
- },
- /* 更新指标 */
- updateEdbHandle: _.debounce(function() {
- this.loading = this.$loading({
- lock: true,
- target:'.edb-detail-wrapper',
- text: '刷新数据中...',
- spinner: 'el-icon-loading',
- background: 'rgba(255, 255, 255, 0.8)'
- });
- preDictEdbInterface.edbRefresh({
- EdbInfoId: this.select_id
- }).then(res => {
- this.loading.close();
- if(res.Ret !== 200) return
- this.$message.success(res.Msg)
- //更新完刷数据
- console.log('更新完刷数据');
-
- this.detail_show_chart ? this.$refs.detailComponentRef.getDetail('updateImg') : this.$refs.detailComponentRef.getData();
- })
- },300),
- /* 部分刷新 */
- updateEdbPartHandle: _.debounce(function() {
- this.loading = this.$loading({
- lock: true,
- target:'.edb-detail-wrapper',
- text: '刷新数据中...',
- spinner: 'el-icon-loading',
- background: 'rgba(255, 255, 255, 0.8)'
- });
- preDictEdbInterface.edbPartRefresh({
- EdbInfoId: this.select_id
- }).then(res => {
- this.loading.close();
- if(res.Ret !== 200) return
- this.$message.success(res.Msg)
- //更新完刷数据
- console.log('更新完刷数据');
-
- this.detail_show_chart ? this.$refs.detailComponentRef.getDetail('updateImg') : this.$refs.detailComponentRef.getData();
- })
- },300),
- /* 编辑指标 */
- editEdbHandle(type="") {
- preDictEdbInterface.edbDetail({
- EdbInfoId: this.select_id
- }).then(res => {
- if(res.Ret !== 200) return
- const { RuleList,EdbType,Source,CalculateList } = res.Data;
-
- // 原始指标
- if(EdbType === 1) {
- !type && this.$router.push({
- path:'/editpredictEdb',
- query:{
- id:this.select_id
- }
- })
- if(type === 'view') {
- this.showRules = RuleList;
- this.showFromEdbInfo = CalculateList[0];
- this.isShowRuleDialog=true};
- } else {
- //计算指标
- this.setComputedDialogForm(res.Data,type);
- this.computed_type =[47,48].includes(Source)?'joint': Source;
- this.computed_type = [72,73].includes(Source)? 'alpha': Source;
- }
- })
- },
- /* 查看指标 */
- viewNode() {
- this.editEdbHandle('view')
- },
- /* 计算指标回显 */
- setComputedDialogForm({Source,CalculateList,CalculateFormula,EdbInfoId,EdbName,Unit,Frequency,ClassifyId,ClassifyList,MoveType,MoveFrequency,Calendar,CorrelationStr},type='') {
- //找到指标的父级
- const parentNodes = ClassifyList.length&&ClassifyList.map(item=>item.ClassifyId)
- //指标运算 or 其他计算类型指标
- if( Source === 31 ) {
- /* 回显指标和表单 */
- this.computedTit = '编辑计算指标';
- /* 依赖的指标列表 */
- this.calulateList = CalculateList.map(item => ({
- tag: item.FromTag,
- edb_name: item.FromEdbName,
- target: item.FromEdbInfoId,
- start_date: item.StartDate,
- end_date: item.EndDate
- }))
- /* 公式和表单 */
- this.calulateForm = {
- edb_id:EdbInfoId,
- formula: CalculateFormula,
- menu: parentNodes,
- targetName: EdbName,
- unit: Unit,
- frequency: Frequency,
- view: type === 'view'
- };
- } else {
- if([47,48,50,56].includes(Source)){//拟合残差
- this.operationForm={
- edb_id:EdbInfoId,
- targetName: EdbName,
- frequency: Frequency,
- unit: Unit,
- menu: parentNodes,
- view: type === 'view',
- source: Source,
- date: CalculateFormula,
- pre_edb: Source === 47 ? CalculateList.find(item => item.FromTag === 'A').FromEdbInfoId : '', //俺也不懂为什么这么定义都是江西老表的锅
- after_edb: Source === 47 ? CalculateList.find(item => item.FromTag === 'B').FromEdbInfoId : '',
- old_stay_edb: Source === 48 ? CalculateList.find(item => item.FromTag === 'A').FromEdbInfoId : '',
- concat_edb: Source === 48 ? CalculateList.find(item => item.FromTag === 'B').FromEdbInfoId : '',
- from_arr: CalculateList,
- correlationStr: CorrelationStr
- }
- return
- }
- this.operationForm = {
- oldedb_id: CalculateList[0].FromEdbInfoId,
- oldEdb_name: CalculateList[0].FromEdbName,
- edb_id: EdbInfoId,
- targetName: EdbName,
- unit: Unit,
- menu: parentNodes.reverse(),
- frequency: Frequency,
- formula: CalculateFormula || '',
- view: type === 'view',
- moveType: MoveType,
- moveUnit: MoveFrequency,
- moveVal: Source === 46 ? CalculateFormula : '',
- calendar_type: Source === 49 ? Calendar : '',
- }
- if([72,73].includes(Source)){
- this.operationForm = {
- edb_id: EdbInfoId,
- oldedb_id: CalculateList[0].FromEdbInfoId,
- oldEdb_name: CalculateList[0].FromEdbName,
- EdbName,Frequency,Unit,ClassifyId,Formula:CalculateFormula,
- view: type === 'view'
- }
- }
- }
- },
- /* 复制数据 */
- copyData() {
- preDictEdbInterface.edbDataInfo({
- EdbInfoId: this.select_id,
- CurrentIndex: 1,
- PageSize: 100000,
- }).then(res => {
- if(res.Ret !== 200) return
- const { DataList,PredictDataList } = res.Data.Item;
- let total_data = [...PredictDataList,...DataList];
- let str = '日期\t 值\n';
- total_data.forEach((item) => (str += `${item.DataTime}\t${item.Value}\n`));
- this.$copyText(str).then(
- (res) => {
- this.$message.success('已成功复制!');
- },
- (err) => {
- this.$message.error('复制失败!');
- }
- );
- })
- },
- /* 获取表格列表 */
- getPublicList() {
- preDictEdbInterface.edbList({
- CurrentIndex: this.public_page,
- PageSize: this.public_pages_size,
- ClassifyId: this.select_classify || 0,
- IsOnlyMe:this.isOnlyMe||false,
- }).then(res => {
- if(res.Ret !== 200) return
- this.publicHaveMove = res.Data
- ? this.public_page < res.Data.Paging.Pages
- : false;
- this.edbChartList = res.Data
- ? this.public_page === 1
- ? res.Data.List
- : [...this.edbChartList, ...res.Data.List]
- : [];
- this.edb_total = res.Data ? res.Data.Paging.Totals : 0;
- })
- },
- /* 加载更多 */
- loadMoreHandle: _.throttle(function() {
- let scrollTop = this.$refs.listRef.scrollTop;
- let clientHeight = this.$refs.listRef.clientHeight;
- let scrollHeight = this.$refs.listRef.scrollHeight;
- if(scrollTop + clientHeight >= scrollHeight-10 && this.publicHaveMove){
- this.public_page++;
- this.getPublicList();
- }
- },300),
- /* 切换中英文 */
- changeLangHandle: _.debounce(async function (lang){
- this.search_txt = '';
- this.currentLang = lang;
- await dataBaseInterface.setUserLang({
- ConfigCode: 'predict_edb_language',
- ConfigValue: lang === 'en' ? 'EN' : 'CN'
- })
- },200),
- /* 编辑英文 */
- openEnNameDia(info){
- this.formItemArray=[{
- label:'指标名称',
- value:info.EdbName,
- key:'EdbName',
- notEdit:true
- }]
- // 中文单位有 才能编辑英文单位
- if(info.Unit && info.Unit!='无'){
- this.formItemArray.push({
- label:'单位',
- value:info.Unit,
- key:'Unit',
- notEdit:true
- },
- {
- label:'英文指标名称',
- value:info.EdbNameEn,
- key:'EdbNameEn',
- placeholder:'请输入英文指标名称'
- },
- {
- label:'英文单位',
- value:info.UnitEn,
- key:'UnitEn',
- placeholder:'请输入英文单位'
- })
- }else{
- this.formItemArray.push({
- label:'英文指标名称',
- value:info.EdbNameEn,
- key:'EdbNameEn',
- placeholder:'请输入英文指标名称'
- })
- }
- this.setEnName = true
- },
- clickEdbNameHandle() {
- this.$refs.detailComponentRef.changeEnOptions();
- },
- updateEnName(item){
- let params={
- EdbInfoId: Number(this.select_id),
- ...item
- }
- dataBaseInterface.edbInfoEditEn(params).then(res=>{
- if(res.Ret ==200){
- this.$message({
- message:res.Msg,
- type:"success"
- })
- this.detail_show_chart ? this.$refs.detailComponentRef.getDetail() : this.$refs.detailComponentRef.getData();
- this.setEnName = false
- this.getTreeData({
- code: this.select_node,
- id: this.select_id
- });
- }
- })
- },
- /* 打开计算弹窗 */
- addComputedHandler() {
- this.computedTit = '计算指标';
- this.calulateList = [];
- this.calulateForm = {};
- this.operationForm = {};
- this.isOpenComputed = true;
- },
- /* 选择计算类型 */
- changeComputedType(type) {
- let typeMapSource = {
- 'toMonthSeason': 42,
- 'accumulate': 65
- }
- this.computed_type = typeMapSource[type] || type;;
- this.isOpenComputed = false;
- },
- /* 新增计算指标回调 */
- addComputedCallBack(type, params) {
- this.computed_type = 0;
- this.computed_source = 1;
-
- this.showAssociateChart=false;
- this.showAssociateComputeData=false;
- type === 'add' ? this.getTreeData(params) : this.getTreeData();
- if(type === 'edit') {
- this.detail_show_chart ? this.$refs.detailComponentRef.getDetail() : this.$refs.detailComponentRef.getData();
- }
- },
- /* 重绘右侧区域宽度 */
- reloadRightWid() {
- let total_wid = $('.predict-edb-main')[0].offsetWidth;
- let left = $('#left')[0].offsetWidth;
- let rigtWid = total_wid - left - 20 + 'px';
- $('#right')[0].style.width = rigtWid;
- },
- //只看我的
- onlyMeHandler(){
- this.getTreeData()
- this.public_page = 1;
- this.$refs.listRef.scrollTop = 0;
- this.getPublicList();
- },
- //懒加载el-tree
- async getLazyTreeData(node,resolve,maxLevel=3){
- if(node.level===0){
- resolve(this.treeData)
- }else{
- let arr=[]
- const res=await preDictEdbInterface.predictEdbCatalog({IsOnlyMe:this.isOnlyMe||false,ParentId:node.data.ClassifyId})
- if (res.Ret === 200) {
- const temarr = res.Data.AllNodes || [];
- arr=temarr.map(item=>{
- return {
- ...item,
- isLeaf:item.EdbInfoId?true:false
- }
- })
- }
- resolve(arr)
- }
-
- },
- changeTreeNode(){
- this.$refs.treeRef.setCurrentKey(this.select_node);
- this.$nextTick(()=>{
- const _node = this.$refs.treeRef.getNode(this.select_node)
- this.dynamicNode = _node;
- this.dynamicNode&&this.resetNodeStyle(this.dynamicNode)
- })
- },
- changeShowType(){
- if(!this.activeTab) return
- this.detail_show_chart = this.activeTab==='Chart'?true:false
- }
- },
- mounted() {
- if (document.body.clientWidth <= 1400) {
- //小屏适配
- this.isSlideLeft = true;
- }
- const obj=sessionStorage.getItem('predictEdbTreeData')
- if(obj||this.$route.query.code){
- let code=obj?JSON.parse(obj).code:this.$route.query.code
- let id=obj?JSON.parse(obj).id:this.$route.query.id
- let classifyId=obj?JSON.parse(obj).classifyId:this.$route.query.classifyId
- this.getTreeData({code: code,id: Number(id),classifyId:Number(classifyId)})
- }else{
- this.getTreeData()
- }
- // 清除缓存数据
- setTimeout(() => {
- sessionStorage.setItem('predictEdbTreeData','')
- }, 1000);
-
- this.getPublicList();
- window.addEventListener('resize', this.reloadRightWid);
- },
- destroyed() {
- window.removeEventListener('resize', this.reloadRightWid);
- }
- }
- </script>
- <style lang="scss">
- .predictEdb-container{
- .detail-header{
- display: flex;
- position: relative;
- height: 60px;
- .el-tabs{
- width:200px;
- .el-tabs__header{
- margin-bottom: 0;
- }
- .el-tabs__nav{
- display: flex;
- width: 100%;
- .el-tabs__item{
- flex: 1;
- text-align: center;
- font-size: 16px;
- height: 60px;
- line-height: 60px;
- }
- }
- }
- }
- .edb-tool{
- flex: 1;
- text-align: right;
- display: flex;
- gap: 16px;
- justify-content: flex-end;
- padding-right: 15px;
- position: relative;
- &::after{
- position: absolute;
- content:'';
- width:100%;
- left: 0;
- bottom: 0;
- height:2px;
- background-color: #E4E7ED;
- }
- }
- }
- </style>
- <style lang='scss' scoped>
- @import "~@/styles/theme-vars.scss";
- *{ box-sizing: border-box;}
- $mini-font: 12px; $normal-font: 14px;
- .predictEdb-container {
- .slide-icon {
- padding: 20px 0;
- /* display: block; */
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.3);
- border-radius: 5px;
- cursor: pointer;
- position: absolute;
- top: 50%;
- transform: translateY(-50%);
- z-index: 99;
- &:hover {
- background-color: rgba(0, 0, 0, 0.05);
- }
- &.slide-left {
- right: 0;
- }
- &.slide-right {
- left: 0;
- }
- }
- .predict-edb-main {
- display: flex;
- .main-left {
- width: 400px;
- min-width: 380px;
- background: #fff;
- margin-right: 20px;
- border: 1px solid #ececec;
- border-radius: 4px;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
- height: calc(100vh - 120px);
- overflow: hidden;
- position: relative;
- box-sizing: border-box;
- .datasheet_top {
- padding: 20px;
- background: #fff;
- border: 1px solid #ececec;
- box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
- margin-bottom: 20px;
- display: flex;
- align-items: center;
- }
- .search-cont {
- padding: 0 20px;
- }
- .tree-cont {
- padding: 0 20px 30px 20px;
- /* max-height: calc(100vh - 280px);
- overflow: auto; */
- }
- .target_tree {
- color: #333;
- max-height: calc(100vh - 400px);
- overflow-y:auto;
- .custom-tree-node {
- display: flex !important;
- justify-content: space-between;
- align-items: center;
- display: block;
- flex: 1;
- .node_label {
- margin-right: 2px;
- }
- .el-icon-view {
- color: #409eff;
- font-size: 18px;
- margin-left: 5px;
- }
- }
- }
- .noDepart {
- margin: 30px 0;
- display: flex;
- align-items: center;
- justify-content: center;
- color: $theme-color;
- font-size: 16px;
- cursor: pointer;
- }
- .move-btn {
- height: 100%;
- width: 4px;
- /* opacity: 0; */
- position: absolute;
- right: 0px;
- top: 0;
- &:hover {
- cursor: col-resize;
- /* background-color: orange */
- }
- }
- }
- .main-right {
- width: 80%;
- height: calc(100vh - 120px);
- &.detail-main{
- overflow-x:auto;
- }
- .edb-detail-wrapper {
- height: 100%;
- border: 1px solid #ececec;
- border-radius: 4px;
- box-shadow: 0px 3px 6px rgba(0, 0, 0, 0.05);
- overflow: hidden;
- background: #fff;
- &.main-min-width{
- min-width: 780px;
- }
- .detail-top {
- padding: 20px;
- display: flex;
- justify-content: space-between;
- align-items: center;
- border-bottom: 1px solid #ececec;
- .title {
- font-size: 16px;
- &.disabled { color: #ccc; }
- }
- .action-ul {
- display: flex;
- li { margin: 0 10px; }
- }
- }
- .detail-wrap {
- position: relative;
- padding: 16px;
- height: calc(100vh - 180px);
- overflow-y: auto;
- .toggle-text {
- position: absolute;
- right: 20px;
- top: 40px;
- z-index: 2;
- display: flex;
- align-items: center;
- }
- /* min-height: 500px; */
- }
- }
- .sheet-list-cont {
- color: #333;
- .el-card .el-card__header,
- .el-card__body {
- padding: 10px;
- }
- .list-top {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .edbChartList-wrapper {
- margin-top: 10px;
- display: flex;
- flex-wrap: wrap;
- max-height: calc(100vh - 143px);
- overflow: hidden;
- overflow-y: auto;
- .drag-cont {
- width: 100%;
- display: flex;
- flex-wrap: wrap;
- }
- .dragShdow {
- box-shadow: 0 1px 8px rgba(64, 158, 255, 0.8);
- opacity: 0.5;
- }
- .sheet-item {
- width:23%;
- min-width: 255px;
- border-radius: 4px;
- box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
- border: 1px solid #EBEEF5;
- background-color: #FFFFFF;
- overflow: hidden;
- color: #303133;
- transition: 0.3s;
- .item-top,.item-bottom{
- padding:10px;
- text-align: left;
- }
- .item-top {
- display: flex;
- justify-content: space-between;
- align-items: center;
- font-size: 16px;
- font-weight: 600;
- box-shadow: 0 3px 6px rgba(37, 37, 239, 0.1);
- }
- .chart-img {
- /* width: 100%;
- height: 230px;
- object-fit: fill !important; */
- margin:10px;
- margin-bottom: 0;
- height: 0;
- padding-bottom: 67%;
- cursor: pointer;
- }
- .item-bottom {
- display: flex;
- justify-content: space-between;
- font-size: 12px;
- color: #666;
- .collected {
- color: #f00;
- cursor: pointer;
- }
- .join_txt {
- color: $theme-color;
- cursor: pointer;
- }
- }
- }
- }
- .nodata {
- text-align: center;
- }
- }
- }
- }
- .computed-ul {
- max-height: 600px;
- height: 70vh;
- overflow-y: auto;
- padding: 40px 92px;
- display: flex;
- flex-wrap: wrap;
- .cpmputed-li {
- width: 180px;
- padding: 19px 0;
- height:60px;
- color: $theme-color;
- font-size: 16px;
- background:#ECF5FF;
- border-radius: 8px;
- border: 1px solid #B3D8FF;
- text-align: center;
- cursor: pointer;
- margin-right: 65px;
- margin-bottom: 55px;
- &:nth-child(3n) {
- margin-right:0;
- }
- &:hover {
- background: $theme-color;
- color: #fff;
- }
- &.act {
- background: $theme-color;
- color: #fff;
- }
- }
- }
- }
- </style>
- <style lang="scss">
- @import "~@/styles/theme-vars.scss";
- .predictEdb-container {
- .label-input .el-input__inner {
- height: 25px;
- line-height: 25px;
- padding: 0 10px;
- }
- .el-dialog--center .el-dialog__body {
- padding: 40px 20px 30px 60px;
- }
- .el-tree__drop-indicator{
- height:3px;
- background-color: $theme-color;
- }
- .el-tree-node__content {
- margin-bottom: 14px !important;
- }
- .el-tree-node__children {
- .el-tree-node {
- /* margin-bottom: 8px !important; */
- margin-bottom: 0px !important;
- padding-left: 18px;
- }
- .el-tree-node__content {
- margin-bottom: 5px !important;
- padding-left: 0 !important;
- }
- }
- .expanded.el-icon-caret-right:before {
- content: url('../../assets/img/set_m/down.png') !important;
- }
- .el-icon-caret-right:before {
- content: url('../../assets/img/set_m/slide.png') !important;
- }
- .el-tree-node__expand-icon.is-leaf.el-icon-caret-right:before {
- content: '' !important;
- }
- .el-tree-node__expand-icon.expanded {
- -webkit-transform: rotate(0deg);
- transform: rotate(0deg);
- }
- .el-tree-node.is-current > .el-tree-node__content {
- background-color: #f0f4ff !important;
- }
- .el-tree-node__content {
- padding-right: 10px !important;
- }
- .dialog-computed {
- max-width:950px !important;
- .el-dialog__header {
- background-color: #fff;
- .el-dialog__close {
- color: #333;
- }
- }
- }
- }
- </style>
|