|
@@ -1,5 +1,5 @@
|
|
<script setup name="DataEDBIndex">
|
|
<script setup name="DataEDBIndex">
|
|
-import {reactive,ref, watch} from 'vue'
|
|
|
|
|
|
+import {computed, reactive,ref, watch} from 'vue'
|
|
import apiDataEDB from '@/api/dataEDB'
|
|
import apiDataEDB from '@/api/dataEDB'
|
|
import {apiCommonSetSysConfig,apiGetLanguageConfig} from '@/api/common'
|
|
import {apiCommonSetSysConfig,apiGetLanguageConfig} from '@/api/common'
|
|
import EDBClassify from './components/EDBClassify.vue'
|
|
import EDBClassify from './components/EDBClassify.vue'
|
|
@@ -8,6 +8,8 @@ import {useRouter} from 'vue-router'
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
import {useCachedViewsStore} from '@/store/modules/cachedViews'
|
|
import langIconZH from '@/assets/imgs/chartETA/lang-icon.png'
|
|
import langIconZH from '@/assets/imgs/chartETA/lang-icon.png'
|
|
import langIconEN from '@/assets/imgs/chartETA/langEn-icon.png'
|
|
import langIconEN from '@/assets/imgs/chartETA/langEn-icon.png'
|
|
|
|
+import {edbDataBtn,useAuthBtn} from '@/hooks/useAuthBtn'
|
|
|
|
+const {checkAuthBtn} = useAuthBtn()
|
|
|
|
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
const cachedViewsStore=useCachedViewsStore()
|
|
const router=useRouter()
|
|
const router=useRouter()
|
|
@@ -36,6 +38,29 @@ async function langTypeChange(){
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+//根据权限决定actions
|
|
|
|
+const actions = computed(()=>{
|
|
|
|
+ let actionArr = []
|
|
|
|
+ if(checkAuthBtn(edbDataBtn.edbData_addEdb)){
|
|
|
|
+ actionArr.push({
|
|
|
|
+ name:'添加指标',
|
|
|
|
+ path:'/dataEDB/addbaseEDB'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if(checkAuthBtn(edbDataBtn.edbData_calcuEdb)){
|
|
|
|
+ actionArr.push({
|
|
|
|
+ name:'计算指标',
|
|
|
|
+ path:'/dataEDB/calculate/index'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ if(checkAuthBtn(edbDataBtn.edbData_replaceEdb)){
|
|
|
|
+ actionArr.push({
|
|
|
|
+ name:'替换指标',
|
|
|
|
+ path:'/dataEDB/replaceEDB'
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ return actionArr
|
|
|
|
+})
|
|
|
|
|
|
const listState = reactive({
|
|
const listState = reactive({
|
|
list:[],
|
|
list:[],
|
|
@@ -129,6 +154,23 @@ watch(
|
|
}
|
|
}
|
|
}
|
|
}
|
|
)
|
|
)
|
|
|
|
+//图表option check
|
|
|
|
+function checkOption(item){
|
|
|
|
+ let optionArr = []
|
|
|
|
+ if(seeComputeEDBInfo(item)&&checkAuthBtn(edbDataBtn.edbData_checkCalcChart)){
|
|
|
|
+ optionArr.push('查看')
|
|
|
|
+ }
|
|
|
|
+ if(item.Button.ShowEdbRelation&&checkAuthBtn(edbDataBtn.edbData_checkRelatedEdb)){
|
|
|
|
+ optionArr.push('关联指标')
|
|
|
|
+ }
|
|
|
|
+ if(item.Button.ShowChartRelation&&checkAuthBtn(edbDataBtn.edbData_checkRelatedChart)){
|
|
|
|
+ optionArr.push('关联图表')
|
|
|
|
+ }
|
|
|
|
+ if(item.Button.MoveButton){
|
|
|
|
+ optionArr.push('移动至')
|
|
|
|
+ }
|
|
|
|
+ return optionArr.length
|
|
|
|
+}
|
|
function handleShowEdbOpt(item){
|
|
function handleShowEdbOpt(item){
|
|
edbOptState.data=item
|
|
edbOptState.data=item
|
|
|
|
|
|
@@ -251,7 +293,7 @@ async function goSearch(){
|
|
style="flex:1;padding-left:0"
|
|
style="flex:1;padding-left:0"
|
|
@click-input="goSearch"
|
|
@click-input="goSearch"
|
|
/>
|
|
/>
|
|
- <div class="lang-icon icon">
|
|
|
|
|
|
+ <div class="lang-icon icon" v-permission="edbDataBtn.edbData_switchEn">
|
|
<img :src="langType==='zh'?langIconZH:langIconEN" alt="" @click="langTypeChange">
|
|
<img :src="langType==='zh'?langIconZH:langIconEN" alt="" @click="langTypeChange">
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -288,6 +330,7 @@ async function goSearch(){
|
|
height="28"
|
|
height="28"
|
|
viewBox="0 0 28 28"
|
|
viewBox="0 0 28 28"
|
|
fill="none"
|
|
fill="none"
|
|
|
|
+ v-if="checkOption(item)"
|
|
@click.stop="handleShowEdbOpt(item)"
|
|
@click.stop="handleShowEdbOpt(item)"
|
|
>
|
|
>
|
|
<rect width="28" height="28" rx="4" :fill="item.EdbInfoId===edbOptState.data?.EdbInfoId?'#0052D9':'none'"/>
|
|
<rect width="28" height="28" rx="4" :fill="item.EdbInfoId===edbOptState.data?.EdbInfoId?'#0052D9':'none'"/>
|
|
@@ -302,7 +345,7 @@ async function goSearch(){
|
|
</div>
|
|
</div>
|
|
|
|
|
|
<!-- 悬浮操作按钮 -->
|
|
<!-- 悬浮操作按钮 -->
|
|
- <div class="fixed-opt-btn" @click="showActionPop=true">
|
|
|
|
|
|
+ <div class="fixed-opt-btn" @click="showActionPop=true" v-if="actions.length">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none">
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="48" height="48" viewBox="0 0 48 48" fill="none">
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.4855 12.7505L25.4062 2.31235C24.536 1.80995 23.4639 1.80995 22.5937 2.31235L4.5144 12.7505V33.6267C4.5144 34.6315 5.05046 35.5599 5.92065 36.0623L24 46.5005L42.0793 36.0623C42.9495 35.5599 43.4855 34.6315 43.4855 33.6267V12.7505ZM23.997 22.2665L9.01233 13.6153L24 4.96245L38.9859 13.6158L23.997 22.2665ZM25.5 24.8665L40.485 16.2149V33.5165L25.5 42.1666V24.8665ZM22.5 24.8665V42.1667L7.51198 33.5165V16.2132L22.5 24.8665Z" fill="white"/>
|
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M43.4855 12.7505L25.4062 2.31235C24.536 1.80995 23.4639 1.80995 22.5937 2.31235L4.5144 12.7505V33.6267C4.5144 34.6315 5.05046 35.5599 5.92065 36.0623L24 46.5005L42.0793 36.0623C42.9495 35.5599 43.4855 34.6315 43.4855 33.6267V12.7505ZM23.997 22.2665L9.01233 13.6153L24 4.96245L38.9859 13.6158L23.997 22.2665ZM25.5 24.8665L40.485 16.2149V33.5165L25.5 42.1666V24.8665ZM22.5 24.8665V42.1667L7.51198 33.5165V16.2132L22.5 24.8665Z" fill="white"/>
|
|
</svg>
|
|
</svg>
|
|
@@ -314,20 +357,7 @@ async function goSearch(){
|
|
v-model:show="showActionPop"
|
|
v-model:show="showActionPop"
|
|
cancel-text="取消"
|
|
cancel-text="取消"
|
|
close-on-click-action
|
|
close-on-click-action
|
|
- :actions="[
|
|
|
|
- {
|
|
|
|
- name:'添加指标',
|
|
|
|
- path:'/dataEDB/addbaseEDB'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name:'计算指标',
|
|
|
|
- path:'/dataEDB/calculate/index'
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- name:'替换指标',
|
|
|
|
- path:'/dataEDB/replaceEDB'
|
|
|
|
- }
|
|
|
|
- ]"
|
|
|
|
|
|
+ :actions="actions"
|
|
@select="handleSelectActionOpt"
|
|
@select="handleSelectActionOpt"
|
|
>
|
|
>
|
|
</van-action-sheet>
|
|
</van-action-sheet>
|
|
@@ -345,9 +375,9 @@ async function goSearch(){
|
|
<template #default>
|
|
<template #default>
|
|
<ul class="edb-opt-list">
|
|
<ul class="edb-opt-list">
|
|
<!-- 计算指标查看 -->
|
|
<!-- 计算指标查看 -->
|
|
- <li class="item" v-if="seeComputeEDBInfo(edbOptState.data)" @click="handleEDBOpt('see',edbOptState.data)">查看</li>
|
|
|
|
- <li class="item" v-if="edbOptState.data?.Button.ShowEdbRelation" @click="handleEDBOpt('relationEDB',edbOptState.data)">关联指标</li>
|
|
|
|
- <li class="item" v-if="edbOptState.data?.Button.ShowChartRelation" @click="handleEDBOpt('relationChart',edbOptState.data)">关联图表</li>
|
|
|
|
|
|
+ <li class="item" v-if="seeComputeEDBInfo(edbOptState.data)&&checkAuthBtn(edbDataBtn.edbData_checkCalcChart)" @click="handleEDBOpt('see',edbOptState.data)">查看</li>
|
|
|
|
+ <li class="item" v-if="edbOptState.data?.Button.ShowEdbRelation&&checkAuthBtn(edbDataBtn.edbData_checkRelatedEdb)" @click="handleEDBOpt('relationEDB',edbOptState.data)">关联指标</li>
|
|
|
|
+ <li class="item" v-if="edbOptState.data?.Button.ShowChartRelation&&checkAuthBtn(edbDataBtn.edbData_checkRelatedChart)" @click="handleEDBOpt('relationChart',edbOptState.data)">关联图表</li>
|
|
<li class="item" v-if="edbOptState.data?.Button.MoveButton" @click="handleEDBOpt('move',edbOptState.data)">移动至</li>
|
|
<li class="item" v-if="edbOptState.data?.Button.MoveButton" @click="handleEDBOpt('move',edbOptState.data)">移动至</li>
|
|
</ul>
|
|
</ul>
|
|
</template>
|
|
</template>
|