123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229 |
- <template>
- <ul class="right-actions">
- <li>{{$t('Table.column_operations')}}</li>
- <li
- class="span-item shareLink"
- @click="copyChartConfirm('url')"
- :data-clipboard-text="linkUrl"
- v-if="!chartInfo.Disabled&&isShowBtn('share')"
- >
- <i class="el-icon-share" /> {{$t('Chart.chart_share_btn')}}
- </li>
- <li v-if="isShowBtn('addMyChart')"
- class="span-item" @click="addMychartHandle(chartInfo)">
- <img
- :src="$icons.chart_join_ico"
- alt=""
- style="width: 13px; height: 12px; vertical-align: middle"
- />{{$t('Chart.chart_addmy_btn')}}
- </li>
- <li v-if="isShowBtn('refresh')"
- class="span-item" @click="refreshHandle">
- <span
- ><i class="el-icon-refresh" style="margin-left: 0" /> {{$t('Edb.detail_refresh_btn')}}
- </span>
- </li>
- <li class="span-item" v-if="['/commordityChartBase','/crossVarietyChartList'].includes($route.path)">
- <span @click="saveChartHandle">
- <i class="el-icon-collection" /> {{$t('Chart.chart_save_btn')}}
- </span>
- </li>
- <li class="span-item" v-if="chartInfo.Button.IsCopy&&isShowBtn('otherSave')">
- <span @click="saveChartOtherHandle">
- <i class="el-icon-document-add" /> {{$t('Chart.chart_copy_btn')}}
- </span>
- </li>
- <li class="span-item" v-if="chartInfo.Button.IsEdit&&isShowBtn('edit')" @click="editChartHandle">
- <img
- src="~@/assets/img/set_m/edit.png"
- alt=""
- style="width: 13px; height: 12px"
- /> {{$t('Chart.chart_edit_btn')}}
- </li>
- <li
- class="span-item copy"
- @click="copyChartConfirm('office')"
- v-if="!chartInfo.Disabled&&isShowBtn('copyOffice')"
- >
- <i class="el-icon-document-copy" /> {{$t('Chart.chart_copyoffice')}}
- </li>
- <li
- class="span-item copy"
- @click="copyChartConfirm('微信')"
- v-if="!chartInfo.Disabled&&isShowBtn('copyWechat')"
- >
- <img
- style="width: 13px; height: 12px; vertical-align: middle"
- src="~@/assets/img/chart_m/WeChat.jpg"
- /> {{$t('Chart.chart_copywx')}}
- </li>
- <li v-if="isShowBtn('enNameSetting')"
- class="span-item copy" @click="openLangInfoDia">
- <img
- style="width: 16px; vertical-align: middle"
- :src="$icons.to_en"
- /> {{$t('Edb.detail_en_btn')}}
- </li>
- <li
- class="span-item"
- style="color: #ff4040"
- @click="delChartHandle"
- v-if="chartInfo.Button.IsEdit&&isShowBtn('del')"
- >
- <i class="el-icon-delete" style="color: #ff4040" /> {{$t('Chart.chart_del_btn')}}
- </li>
- </ul>
- </template>
- <script>
- export default {
- props: ['chartInfo','linkUrl'],
- methods: {
- copyChartConfirm(type) {
- this.$emit('copyChartConfirm',type)
- },
- addMychartHandle(item) {
- this.$emit('addMychartHandle',item)
- },
- refreshHandle() {
- this.$emit('refreshHandle')
- },
- saveChartHandle() {
- this.$emit('saveChartHandle')
- },
- saveChartOtherHandle() {
- this.$emit('saveChartOtherHandle')
- },
- editChartHandle() {
- this.$emit('editChartHandle')
- },
- openLangInfoDia() {
- this.$emit('openLangInfoDia')
- },
- delChartHandle() {
- this.$emit('delChartHandle')
- },
- //在原先按钮显示的逻辑上,加上权限控制
- //由于多个图表共用这个操作栏,通过路由判断
- isShowBtn(btn){
- const {path} = this.$route
- const {statisticPermission,productPricePermission,checkPermissionBtn} = this.permissionBtn
- const chartrelevanceMap = {
- share:checkPermissionBtn(statisticPermission.corrAnalysis_share),
- addMyChart:checkPermissionBtn(statisticPermission.corrAnalysis_addMyChart),
- refresh:checkPermissionBtn(statisticPermission.corrAnalysis_refresh),
- otherSave:checkPermissionBtn(statisticPermission.corrAnalysis_otherSave),
- edit:checkPermissionBtn(statisticPermission.corrAnalysis_edit),
- copyOffice:checkPermissionBtn(statisticPermission.corrAnalysis_copyOffice),
- copyWechat:checkPermissionBtn(statisticPermission.corrAnalysis_copyWechat),
- enNameSetting:checkPermissionBtn(statisticPermission.corrAnalysis_enNameSetting),
- del:checkPermissionBtn(statisticPermission.corrAnalysis_del),
- }
- const fittingEquationMap = {
- share:checkPermissionBtn(statisticPermission.fittingEq_share),
- addMyChart:checkPermissionBtn(statisticPermission.fittingEq_addMyChart),
- refresh:checkPermissionBtn(statisticPermission.fittingEq_refresh),
- otherSave:checkPermissionBtn(statisticPermission.fittingEq_otherSave),
- edit:checkPermissionBtn(statisticPermission.fittingEq_edit),
- copyOffice:checkPermissionBtn(statisticPermission.fittingEq_copyOffice),
- copyWechat:checkPermissionBtn(statisticPermission.fittingEq_copyWechat),
- enNameSetting:checkPermissionBtn(statisticPermission.fittingEq_enNameSetting),
- del:checkPermissionBtn(statisticPermission.fittingEq_del),
- }
- const statisticFeatureMap = {
- share:checkPermissionBtn(statisticPermission.statisticFeature_share),
- addMyChart:checkPermissionBtn(statisticPermission.statisticFeature_addMyChart),
- refresh:checkPermissionBtn(statisticPermission.statisticFeature_refresh),
- otherSave:checkPermissionBtn(statisticPermission.statisticFeature_otherSave),
- edit:checkPermissionBtn(statisticPermission.statisticFeature_edit),
- copyOffice:checkPermissionBtn(statisticPermission.statisticFeature_copyOffice),
- copyWechat:checkPermissionBtn(statisticPermission.statisticFeature_copyWechat),
- enNameSetting:checkPermissionBtn(statisticPermission.statisticFeature_enNameSetting),
- del:checkPermissionBtn(statisticPermission.statisticFeature_del),
- }
- const priceLineMap = {
- share:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_share),
- addMyChart:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_addMyChart),
- refresh:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_refresh),
- otherSave:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_otherSave),
- edit:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_edit),
- copyOffice:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_copyOffice),
- copyWechat:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_copyWechat),
- enNameSetting:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_enNameSetting),
- del:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_del),
- }
- const incomeLine = {
- share:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_share),
- addMyChart:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_addMyChart),
- refresh:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_refresh),
- otherSave:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_otherSave),
- edit:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_edit),
- copyOffice:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_copyOffice),
- copyWechat:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_copyWechat),
- enNameSetting:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_enNameSetting),
- del:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_del),
- }
- const crossVarietyBtnMap = {
- share:checkPermissionBtn(statisticPermission.crossVariety_share),
- addMyChart:checkPermissionBtn(statisticPermission.crossVariety_addMyChart),
- refresh:checkPermissionBtn(statisticPermission.crossVariety_refresh),
- otherSave:checkPermissionBtn(statisticPermission.crossVariety_otherSave),
- edit:checkPermissionBtn(statisticPermission.crossVariety_edit),
- copyOffice:checkPermissionBtn(statisticPermission.crossVariety_copyOffice),
- copyWechat:checkPermissionBtn(statisticPermission.crossVariety_copyWechat),
- enNameSetting:checkPermissionBtn(statisticPermission.crossVariety_enNameSetting),
- del:checkPermissionBtn(statisticPermission.crossVariety_del),
- }
- //相关性分析
- if(path==='/chartrelevance') return chartrelevanceMap[btn]
- //拟合方程曲线
- else if(path==='/fittingEquationList') return fittingEquationMap[btn]
-
- //统计特性
- else if(path==='/statisticFeatureList') return statisticFeatureMap[btn]
- //跨品种分析
- else if(path==='/crossVarietyChartList') return crossVarietyBtnMap[btn]
- //商品价格曲线
- else if(path==='/commordityChartBase'){
- const {Source,ChartType} = this.chartInfo
- if(Source===2&&ChartType===8){//是商品价格曲线
- return priceLineMap[btn]
- }else{//是利润曲线
- return incomeLine[btn]
- }
-
- }
- return false
- }
- },
- };
- </script>
- <style scoped lang="scss">
- .right-actions {
- /* max-width: 160px; */
- height: 100%;
- padding: 20px 10px;
- border-left: 1px solid #DCDFE6;
- li {
- margin-bottom: 15px;
- }
- @media screen and (max-width: 1710px) {
- font-size: 12px;
- }
- .span-item {
- color: #409eff;
- cursor: pointer;
- &:hover {
- text-decoration: underline;
- }
- .el-icon-collection,
- .el-icon-document-copy {
- color: #409eff;
- }
- }
- }
- </style>
|