setup.ts 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239
  1. import { initData } from "@/common/methods";
  2. import { getToken } from "@/services/bus/token";
  3. import { OperationTabMenuAuth } from '@/services/go/commonService/interface';
  4. import { serviceURL } from "@/services/request";
  5. import { ref } from 'vue';
  6. import { useRoute } from 'vue-router';
  7. const iframeCode: { code: string, tabIndex: number }[] = [
  8. {
  9. code: 'goods_spot', // 基础设置-商品设置-现货品种
  10. tabIndex: 1,
  11. },
  12. {
  13. code: 'goods_hedge', // 基础设置-商品设置-套保品种
  14. tabIndex: 2,
  15. },
  16. {
  17. code: 'company_normal', // 基础设置-主体设置-正常
  18. tabIndex: 1,
  19. },
  20. {
  21. code: 'company_disabled', // 基础设置-主体设置-停用
  22. tabIndex: 2,
  23. },
  24. {
  25. code: 'futures_spot_finish', // 现货套保-期现关联-外部成交单关联
  26. tabIndex: 1,
  27. },
  28. {
  29. code: 'futures_spot_order', // 现货套保-期现关联-期现单据关联
  30. tabIndex: 2,
  31. },
  32. {
  33. code: 'futures_spot_record', // 现货套保-期现关联-关联记录
  34. tabIndex: 3,
  35. },
  36. {
  37. code: 'hedge_ratio_checkpending', // 风管审核-套保比例审核-待审核
  38. tabIndex: 1,
  39. },
  40. {
  41. code: 'hedge_ratio_performance', // 风管审核-套保比例审核-已审核
  42. tabIndex: 2,
  43. },
  44. {
  45. code: 'spot_params_checkpending', // 风管审核-现货参数审核-待审核
  46. tabIndex: 1,
  47. },
  48. {
  49. code: 'spot_params_performance', // 风管审核-现货参数审核-已审核
  50. tabIndex: 2,
  51. },
  52. {
  53. code: 'price_report_spot', // 统计报表-定价报表
  54. tabIndex: 1,
  55. },
  56. {
  57. code: 'platinum_capital_flow_tab', // 铂金宝-积分流水
  58. tabIndex: 1,
  59. },
  60. {
  61. code: 'platinum_promotion_report_tab', // 铂金宝-推广报表
  62. tabIndex: 1,
  63. },
  64. {
  65. code: 'platinum_broker_management_normal', // 铂金宝-经纪人管理-正常
  66. tabIndex: 1,
  67. },
  68. {
  69. code: 'platinum_broker_management_waiting', // 铂金宝-经纪人管理-待审核
  70. tabIndex: 2,
  71. },
  72. {
  73. code: 'platinum_broker_management_refuse', // 铂金宝-经纪人管理-审核拒绝
  74. tabIndex: 3,
  75. },
  76. {
  77. code: 'platinum_signing_settings_tab', // 铂金宝-签单设置
  78. tabIndex: 1,
  79. },
  80. {
  81. code: 'platinum_team_settings_tab', // 铂金宝-团队设置
  82. tabIndex: 1,
  83. },
  84. {
  85. code: 'platinum_asset_management_signing_unsubmitted', // 铂金宝-资管签订-未提交
  86. tabIndex: 1,
  87. },
  88. {
  89. code: 'platinum_asset_management_signing_pending_review', // 铂金宝-资管签订-待审核
  90. tabIndex: 2,
  91. },
  92. {
  93. code: 'platinum_asset_management_signing_normal', // 铂金宝-资管签订-正常
  94. tabIndex: 3,
  95. },
  96. {
  97. code: 'platinum_asset_management_signing_finish', // 铂金宝-资管签订-已完成
  98. tabIndex: 4,
  99. },
  100. {
  101. code: 'platinum_asset_management_signing_all', // 铂金宝-资管签订-全部
  102. tabIndex: 5,
  103. },
  104. {
  105. code: 'platinum_precious_metal_signing_unsubmitted', // 铂金宝-贵金属签订-未提交
  106. tabIndex: 1,
  107. },
  108. {
  109. code: 'platinum_precious_metal_signing_pending_review', // 铂金宝-贵金属签订-待审核
  110. tabIndex: 2,
  111. },
  112. {
  113. code: 'platinum_precious_metal_signing_repurchase_pending_review', // 铂金宝-贵金属签订-回购待审核
  114. tabIndex: 3,
  115. },
  116. {
  117. code: 'platinum_precious_metal_signing_normal', // 铂金宝-贵金属签订-正常
  118. tabIndex: 4,
  119. },
  120. {
  121. code: 'platinum_precious_metal_signing_success', // 铂金宝-贵金属签订-已完成
  122. tabIndex: 5,
  123. },
  124. {
  125. code: 'platinum_precious_metal_signing_refunded', // 铂金宝-贵金属签订-已退单
  126. tabIndex: 6,
  127. },
  128. {
  129. code: 'platinum_precious_metal_signing_all', // 铂金宝-贵金属签订-全部
  130. tabIndex: 7,
  131. },
  132. {
  133. code: 'platinum_financial_payment_waiting_payment_tab', // 铂金宝-财务付款-待转账
  134. tabIndex: 1,
  135. },
  136. {
  137. code: 'platinum_financial_payment_in_waiting_payment_tab', // 铂金宝-财务付款-内部待转账
  138. tabIndex: 2,
  139. },
  140. {
  141. code: 'platinum_financial_payment_waiting_payment_cash_tab', // 铂金宝-财务付款-待付现金
  142. tabIndex: 3,
  143. },
  144. {
  145. code: 'platinum_financial_payment_payment_tab', // 铂金宝-财务付款-已付款
  146. tabIndex: 4,
  147. },
  148. {
  149. code: 'platinum_financial_payment_all_tab', // 铂金宝-财务付款-全部
  150. tabIndex: 5,
  151. },
  152. {
  153. code: 'platinum_account_manager_tab', // 铂金宝-客户经理
  154. tabIndex: 1,
  155. },
  156. {
  157. code: 'platinum_precious_metal_sales_report_company_tab', // 铂金宝-贵金属销售报表-公司销售(日报)
  158. tabIndex: 1,
  159. },
  160. {
  161. code: 'platinum_precious_metal_sales_report_departmental_tab', // 铂金宝-贵金属销售报表-部门销售
  162. tabIndex: 2,
  163. },
  164. {
  165. code: 'platinum_asset_management_sale_report_company_day_tab', // 铂金宝-资管销售报表-公司销售(日报)
  166. tabIndex: 1,
  167. },
  168. {
  169. code: 'platinum_asset_management_sale_report_company_week_tab', // 铂金宝-资管销售报表-公司销售(周报)
  170. tabIndex: 2,
  171. },
  172. {
  173. code: 'platinum_asset_management_sale_report_company_month_tab', // 铂金宝-资管销售报表-公司销售(月报)
  174. tabIndex: 3,
  175. },
  176. {
  177. code: 'platinum_precious_metal_sales_report_departmental_week_tab', // 铂金宝-资管销售报表-部门销售(周报)
  178. tabIndex: 4,
  179. },
  180. {
  181. code: 'platinum_precious_metal_sales_report_departmental_month_tab', // 铂金宝-资管销售报表-部门销售(月报)
  182. tabIndex: 5,
  183. },
  184. {
  185. code: 'platinum_precious_metal_sales_report_product_month_tab', // 铂金宝-资管销售报表-产品销售(月报)
  186. tabIndex: 6,
  187. },
  188. {
  189. code: 'platinum_customer_service_report_reach_rate_report_tab', // 铂金宝-客服报表-达成率报表
  190. tabIndex: 1,
  191. },
  192. {
  193. code: 'platinum_customer_service_report_team_annualized_performance_ranking_report_tab', // 铂金宝-客服报表-团队年化业绩排行报表
  194. tabIndex: 2,
  195. },
  196. {
  197. code: 'platinum_customer_service_report_personal_annualized_performance_ranking_report_tab', // 铂金宝-客服报表-个人年化业绩排行报表
  198. tabIndex: 3,
  199. },
  200. {
  201. code: 'platinum_customer_service_report_team_manager_annual_performance_ranking_report_tab', // 铂金宝-客服报表-团队经理年化业绩排行报表
  202. tabIndex: 4,
  203. },
  204. {
  205. code: 'platinum_salesman_performance_report_tab', // 铂金宝-业务员业绩报表
  206. tabIndex: 1,
  207. },
  208. ]
  209. /**
  210. * 获取管理端url
  211. */
  212. export function getIframeUrl() {
  213. const route = useRoute();
  214. const url = ref('');
  215. const getUrl = () => {
  216. // 管理端地址
  217. const serviceUrl = serviceURL.pcMangerUrl + route.meta.url;
  218. // 根据当前路由 name(code) 查找出对应的 iframeCode
  219. const item = iframeCode.find((item) => item.code === route.name);
  220. if (item) {
  221. const auth = route.meta.auth as OperationTabMenuAuth[];
  222. const param = auth.reduce((res, item) => res + `:${item.code}`, '');
  223. url.value = `${serviceUrl}?token=${getToken()}&tabindex=${item.tabIndex}&resourcepcmenu=${param}`;
  224. }
  225. }
  226. initData(() => {
  227. getUrl();
  228. })
  229. return {
  230. url
  231. }
  232. }