chartDetailHandlesWrap.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229
  1. <template>
  2. <ul class="right-actions">
  3. <li>{{$t('Table.column_operations')}}</li>
  4. <li
  5. class="span-item shareLink"
  6. @click="copyChartConfirm('url')"
  7. :data-clipboard-text="linkUrl"
  8. v-if="!chartInfo.Disabled&&isShowBtn('share')"
  9. >
  10. <i class="el-icon-share" />&nbsp;{{$t('Chart.chart_share_btn')}}
  11. </li>
  12. <li v-if="isShowBtn('addMyChart')"
  13. class="span-item" @click="addMychartHandle(chartInfo)">
  14. <img
  15. :src="$icons.chart_join_ico"
  16. alt=""
  17. style="width: 13px; height: 12px; vertical-align: middle"
  18. />{{$t('Chart.chart_addmy_btn')}}
  19. </li>
  20. <li v-if="isShowBtn('refresh')"
  21. class="span-item" @click="refreshHandle">
  22. <span
  23. ><i class="el-icon-refresh" style="margin-left: 0" />&nbsp;{{$t('Edb.detail_refresh_btn')}}
  24. </span>
  25. </li>
  26. <li class="span-item" v-if="['/commordityChartBase','/crossVarietyChartList'].includes($route.path)">
  27. <span @click="saveChartHandle">
  28. <i class="el-icon-collection" />&nbsp;{{$t('Chart.chart_save_btn')}}
  29. </span>
  30. </li>
  31. <li class="span-item" v-if="chartInfo.Button.IsCopy&&isShowBtn('otherSave')">
  32. <span @click="saveChartOtherHandle">
  33. <i class="el-icon-document-add" />&nbsp;{{$t('Chart.chart_copy_btn')}}
  34. </span>
  35. </li>
  36. <li class="span-item" v-if="chartInfo.Button.IsEdit&&isShowBtn('edit')" @click="editChartHandle">
  37. <img
  38. src="~@/assets/img/set_m/edit.png"
  39. alt=""
  40. style="width: 13px; height: 12px"
  41. />&nbsp;{{$t('Chart.chart_edit_btn')}}
  42. </li>
  43. <li
  44. class="span-item copy"
  45. @click="copyChartConfirm('office')"
  46. v-if="!chartInfo.Disabled&&isShowBtn('copyOffice')"
  47. >
  48. <i class="el-icon-document-copy" />&nbsp;{{$t('Chart.chart_copyoffice')}}
  49. </li>
  50. <li
  51. class="span-item copy"
  52. @click="copyChartConfirm('微信')"
  53. v-if="!chartInfo.Disabled&&isShowBtn('copyWechat')"
  54. >
  55. <img
  56. style="width: 13px; height: 12px; vertical-align: middle"
  57. src="~@/assets/img/chart_m/WeChat.jpg"
  58. />&nbsp;{{$t('Chart.chart_copywx')}}
  59. </li>
  60. <li v-if="isShowBtn('enNameSetting')"
  61. class="span-item copy" @click="openLangInfoDia">
  62. <img
  63. style="width: 16px; vertical-align: middle"
  64. :src="$icons.to_en"
  65. />&nbsp;{{$t('Edb.detail_en_btn')}}
  66. </li>
  67. <li
  68. class="span-item"
  69. style="color: #ff4040"
  70. @click="delChartHandle"
  71. v-if="chartInfo.Button.IsEdit&&isShowBtn('del')"
  72. >
  73. <i class="el-icon-delete" style="color: #ff4040" />&nbsp;{{$t('Chart.chart_del_btn')}}
  74. </li>
  75. </ul>
  76. </template>
  77. <script>
  78. export default {
  79. props: ['chartInfo','linkUrl'],
  80. methods: {
  81. copyChartConfirm(type) {
  82. this.$emit('copyChartConfirm',type)
  83. },
  84. addMychartHandle(item) {
  85. this.$emit('addMychartHandle',item)
  86. },
  87. refreshHandle() {
  88. this.$emit('refreshHandle')
  89. },
  90. saveChartHandle() {
  91. this.$emit('saveChartHandle')
  92. },
  93. saveChartOtherHandle() {
  94. this.$emit('saveChartOtherHandle')
  95. },
  96. editChartHandle() {
  97. this.$emit('editChartHandle')
  98. },
  99. openLangInfoDia() {
  100. this.$emit('openLangInfoDia')
  101. },
  102. delChartHandle() {
  103. this.$emit('delChartHandle')
  104. },
  105. //在原先按钮显示的逻辑上,加上权限控制
  106. //由于多个图表共用这个操作栏,通过路由判断
  107. isShowBtn(btn){
  108. const {path} = this.$route
  109. const {statisticPermission,productPricePermission,checkPermissionBtn} = this.permissionBtn
  110. const chartrelevanceMap = {
  111. share:checkPermissionBtn(statisticPermission.corrAnalysis_share),
  112. addMyChart:checkPermissionBtn(statisticPermission.corrAnalysis_addMyChart),
  113. refresh:checkPermissionBtn(statisticPermission.corrAnalysis_refresh),
  114. otherSave:checkPermissionBtn(statisticPermission.corrAnalysis_otherSave),
  115. edit:checkPermissionBtn(statisticPermission.corrAnalysis_edit),
  116. copyOffice:checkPermissionBtn(statisticPermission.corrAnalysis_copyOffice),
  117. copyWechat:checkPermissionBtn(statisticPermission.corrAnalysis_copyWechat),
  118. enNameSetting:checkPermissionBtn(statisticPermission.corrAnalysis_enNameSetting),
  119. del:checkPermissionBtn(statisticPermission.corrAnalysis_del),
  120. }
  121. const fittingEquationMap = {
  122. share:checkPermissionBtn(statisticPermission.fittingEq_share),
  123. addMyChart:checkPermissionBtn(statisticPermission.fittingEq_addMyChart),
  124. refresh:checkPermissionBtn(statisticPermission.fittingEq_refresh),
  125. otherSave:checkPermissionBtn(statisticPermission.fittingEq_otherSave),
  126. edit:checkPermissionBtn(statisticPermission.fittingEq_edit),
  127. copyOffice:checkPermissionBtn(statisticPermission.fittingEq_copyOffice),
  128. copyWechat:checkPermissionBtn(statisticPermission.fittingEq_copyWechat),
  129. enNameSetting:checkPermissionBtn(statisticPermission.fittingEq_enNameSetting),
  130. del:checkPermissionBtn(statisticPermission.fittingEq_del),
  131. }
  132. const statisticFeatureMap = {
  133. share:checkPermissionBtn(statisticPermission.statisticFeature_share),
  134. addMyChart:checkPermissionBtn(statisticPermission.statisticFeature_addMyChart),
  135. refresh:checkPermissionBtn(statisticPermission.statisticFeature_refresh),
  136. otherSave:checkPermissionBtn(statisticPermission.statisticFeature_otherSave),
  137. edit:checkPermissionBtn(statisticPermission.statisticFeature_edit),
  138. copyOffice:checkPermissionBtn(statisticPermission.statisticFeature_copyOffice),
  139. copyWechat:checkPermissionBtn(statisticPermission.statisticFeature_copyWechat),
  140. enNameSetting:checkPermissionBtn(statisticPermission.statisticFeature_enNameSetting),
  141. del:checkPermissionBtn(statisticPermission.statisticFeature_del),
  142. }
  143. const priceLineMap = {
  144. share:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_share),
  145. addMyChart:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_addMyChart),
  146. refresh:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_refresh),
  147. otherSave:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_otherSave),
  148. edit:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_edit),
  149. copyOffice:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_copyOffice),
  150. copyWechat:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_copyWechat),
  151. enNameSetting:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_enNameSetting),
  152. del:checkPermissionBtn(productPricePermission.goodsPrice_priceLine_del),
  153. }
  154. const incomeLine = {
  155. share:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_share),
  156. addMyChart:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_addMyChart),
  157. refresh:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_refresh),
  158. otherSave:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_otherSave),
  159. edit:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_edit),
  160. copyOffice:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_copyOffice),
  161. copyWechat:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_copyWechat),
  162. enNameSetting:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_enNameSetting),
  163. del:checkPermissionBtn(productPricePermission.goodsPrice_incomeLine_del),
  164. }
  165. const crossVarietyBtnMap = {
  166. share:checkPermissionBtn(statisticPermission.crossVariety_share),
  167. addMyChart:checkPermissionBtn(statisticPermission.crossVariety_addMyChart),
  168. refresh:checkPermissionBtn(statisticPermission.crossVariety_refresh),
  169. otherSave:checkPermissionBtn(statisticPermission.crossVariety_otherSave),
  170. edit:checkPermissionBtn(statisticPermission.crossVariety_edit),
  171. copyOffice:checkPermissionBtn(statisticPermission.crossVariety_copyOffice),
  172. copyWechat:checkPermissionBtn(statisticPermission.crossVariety_copyWechat),
  173. enNameSetting:checkPermissionBtn(statisticPermission.crossVariety_enNameSetting),
  174. del:checkPermissionBtn(statisticPermission.crossVariety_del),
  175. }
  176. //相关性分析
  177. if(path==='/chartrelevance') return chartrelevanceMap[btn]
  178. //拟合方程曲线
  179. else if(path==='/fittingEquationList') return fittingEquationMap[btn]
  180. //统计特性
  181. else if(path==='/statisticFeatureList') return statisticFeatureMap[btn]
  182. //跨品种分析
  183. else if(path==='/crossVarietyChartList') return crossVarietyBtnMap[btn]
  184. //商品价格曲线
  185. else if(path==='/commordityChartBase'){
  186. const {Source,ChartType} = this.chartInfo
  187. if(Source===2&&ChartType===8){//是商品价格曲线
  188. return priceLineMap[btn]
  189. }else{//是利润曲线
  190. return incomeLine[btn]
  191. }
  192. }
  193. return false
  194. }
  195. },
  196. };
  197. </script>
  198. <style scoped lang="scss">
  199. .right-actions {
  200. /* max-width: 160px; */
  201. height: 100%;
  202. padding: 20px 10px;
  203. border-left: 1px solid #DCDFE6;
  204. li {
  205. margin-bottom: 15px;
  206. }
  207. @media screen and (max-width: 1710px) {
  208. font-size: 12px;
  209. }
  210. .span-item {
  211. color: #409eff;
  212. cursor: pointer;
  213. &:hover {
  214. text-decoration: underline;
  215. }
  216. .el-icon-collection,
  217. .el-icon-document-copy {
  218. color: #409eff;
  219. }
  220. }
  221. }
  222. </style>