index.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <div class="rightSpot">
  3. <div class="title">
  4. <div class="tltLeft">
  5. <span class="blue">
  6. <svg class="icon svg-icon"
  7. aria-hidden="true">
  8. <use xlink:href="#icon-shuzhuangtu"></use>
  9. </svg>
  10. {{selctedMG.mg.middlegoodsname}}({{getGoodsUnitEnumItemName(selctedMG.mg.goodsunitid)}})
  11. </span>
  12. <span class="green ml10">{{selctedMG.mg.isvalid ? '正常' : '停用'}}</span>
  13. <span class="green ml10">套保比例{{(selctedMG.mg.needhedgeratio * 100).toFixed(2)}}%</span>
  14. <span class="green ml10">套利比例100%</span>
  15. </div>
  16. <div class="tltBtns">
  17. <template v-if="isNormal">
  18. <BtnList :btnList="forDataBtn" />
  19. </template>
  20. <template>
  21. <a-button class="blueBtn">恢复</a-button>
  22. </template>
  23. </div>
  24. </div>
  25. <div class="spotCont">
  26. <a-collapse class="spotCollapse"
  27. :bordered="false">
  28. <template #expandIcon="props">
  29. <svg class="icon svg-icon"
  30. aria-hidden="true"
  31. v-if="props.isActive == 0">
  32. <use xlink:href="#icon-shouqi1"></use>
  33. </svg>
  34. <svg class="icon svg-icon"
  35. aria-hidden="true"
  36. v-else>
  37. <use xlink:href="#icon-shouqi2"></use>
  38. </svg>
  39. </template>
  40. <a-collapse-panel key="1">
  41. <template #header>
  42. <a-row class="headRow">
  43. <a-col :span="8">期货品种({{selctedMG.gplist.length}})</a-col>
  44. <a-col :span="8">单位</a-col>
  45. <a-col :span="8">品种系数</a-col>
  46. </a-row>
  47. </template>
  48. <template v-for="(item, i) in selctedMG.gplist"
  49. :key="i + '1111'">
  50. <a-row class="contRow">
  51. <a-col :span="8">{{item.goodsgroupname}}</a-col>
  52. <a-col :span="8">{{item.enumdicname}}</a-col>
  53. <a-col :span="8">{{item.convertratio}}</a-col>
  54. </a-row>
  55. <a-collapse>
  56. <template #expandIcon="props">
  57. <svg class="icon svg-icon"
  58. aria-hidden="true"
  59. v-if="props.isActive == 0">
  60. <use xlink:href="#icon-shouqi1"></use>
  61. </svg>
  62. <svg class="icon svg-icon"
  63. aria-hidden="true"
  64. v-else>
  65. <use xlink:href="#icon-shouqi2"></use>
  66. </svg>
  67. </template>
  68. <a-collapse-panel>
  69. <template #header>
  70. <a-row class="headRow">
  71. <a-col :span="8">期货合约({{item.glist.length}})</a-col>
  72. <a-col :span="8">单位</a-col>
  73. <a-col :span="8">合约系数</a-col>
  74. </a-row>
  75. </template>
  76. <a-row class="contRow"
  77. v-for="sub in item.glist"
  78. :key="sub.goodsid">
  79. <a-col :span="8">{{sub.goodsname}}</a-col>
  80. <a-col :span="8">{{sub.enumdicname}}</a-col>
  81. <a-col :span="8">{{sub.agreeunit}}</a-col>
  82. </a-row>
  83. </a-collapse-panel>
  84. </a-collapse>
  85. </template>
  86. </a-collapse-panel>
  87. <a-collapse-panel key="2">
  88. <template #header>
  89. <a-row class="headRow">
  90. <a-col :span="8">现货品种({{selctedMG.dglist.length}})</a-col>
  91. <a-col :span="8">单位</a-col>
  92. <a-col :span="8">品种系数</a-col>
  93. </a-row>
  94. </template>
  95. <template v-for="(item, i) in selctedMG.dglist"
  96. :key="i + '33'">
  97. <a-row class="contRow">
  98. <a-col :span="8">{{item.data.deliverygoodsname}}</a-col>
  99. <a-col :span="8">{{item.data.agreeunit}}</a-col>
  100. <a-col :span="8">{{item.data.enumdicname}}</a-col>
  101. </a-row>
  102. <a-collapse>
  103. <template #expandIcon="props">
  104. <svg class="icon svg-icon"
  105. aria-hidden="true"
  106. v-if="props.isActive == 0">
  107. <use xlink:href="#icon-shouqi1"></use>
  108. </svg>
  109. <svg class="icon svg-icon"
  110. aria-hidden="true"
  111. v-else>
  112. <use xlink:href="#icon-shouqi2"></use>
  113. </svg>
  114. </template>
  115. <a-collapse-panel>
  116. <template #header>
  117. <a-row class="headRow">
  118. <a-col :span="8">品类({{item.gmlist.length}})</a-col>
  119. <a-col :span="8">单位</a-col>
  120. <a-col :span="8">标仓系数</a-col>
  121. </a-row>
  122. </template>
  123. <a-row class="contRow"
  124. v-for="(sub) in item.gmlist"
  125. :key="sub.goodsid">
  126. <a-col :span="8">{{sub.wrstandardname}}</a-col>
  127. <a-col :span="8">{{sub.enumdicname}}</a-col>
  128. <a-col :span="8">{{sub.convertfactor}}</a-col>
  129. </a-row>
  130. </a-collapse-panel>
  131. </a-collapse>
  132. </template>
  133. </a-collapse-panel>
  134. </a-collapse>
  135. </div>
  136. <HedgingDetail :selctedMG="selctedMG" />
  137. <HedgingModify :selctedMG="selctedMG" />
  138. </div>
  139. </template>
  140. <script lang="ts">
  141. import { defineComponent, PropType, reactive } from 'vue';
  142. import { initMG } from '@/views/information/goods/list/hedging-variety/setup';
  143. import { Ermcp3MiddleGoodsDetail2 } from '@/services/go/ermcp/goodsInfo/interface';
  144. import { initData } from '@/common/methods';
  145. import HedgingModify from '../hedgingModify/index.vue';
  146. import HedgingDetail from '../spotDetail/index.vue';
  147. import { BtnList } from '@/common/export/table';
  148. import { getThirdMenuData, handleBtnList } from '@/common/setup/table/button';
  149. import { getGoodsUnitEnumItemName } from '@/common/constants/enumsName';
  150. export default defineComponent({
  151. name: 'rightHedging',
  152. props: {
  153. selctedMG: {
  154. default: initMG,
  155. type: Object as PropType<Ermcp3MiddleGoodsDetail2>,
  156. },
  157. isNormal: {
  158. default: true,
  159. type: Boolean,
  160. },
  161. },
  162. components: {
  163. BtnList,
  164. HedgingDetail,
  165. HedgingModify,
  166. },
  167. setup(props, context) {
  168. const menuList = getThirdMenuData();
  169. const temp = menuList.find((e) => e.code === 'goods_info_hedge');
  170. let list = undefined;
  171. if (temp) {
  172. list = temp.children.find((e) => e.code === 'goods_info_hedge_normal');
  173. }
  174. const { forDataBtn } = handleBtnList(list, 'goods_info_hedge_normal', true);
  175. initData(() => {});
  176. return { getGoodsUnitEnumItemName, forDataBtn };
  177. },
  178. });
  179. </script>
  180. <style lang="less">
  181. .rightSpot {
  182. width: 100%;
  183. height: 100%;
  184. padding: 10px 12px;
  185. .flex;
  186. flex-direction: column;
  187. .title {
  188. width: 100%;
  189. height: 35px;
  190. .flex;
  191. justify-content: space-between;
  192. div {
  193. align-self: center;
  194. align-items: center;
  195. }
  196. .tltLeft {
  197. font-size: 16px;
  198. .icon {
  199. font-size: 20px;
  200. fill: @m-blue0;
  201. margin-right: 10px;
  202. }
  203. }
  204. .tltBtns {
  205. .ant-btn + .ant-btn {
  206. margin-left: 10px;
  207. }
  208. }
  209. }
  210. .spotCont {
  211. width: 100%;
  212. padding: 0 30px;
  213. }
  214. }
  215. .blue {
  216. color: @m-blue0;
  217. }
  218. .green {
  219. color: @m-green0;
  220. }
  221. .ml10 {
  222. margin-left: 10px;
  223. }
  224. .blueBtn {
  225. width: 80px;
  226. height: 26px;
  227. text-align: center;
  228. background: linear-gradient(0deg, @m-blue2, @m-blue0);
  229. box-shadow: -1px 0px 0px 0px #121618;
  230. .rounded-corners(3px);
  231. border: 0;
  232. color: @m-white0;
  233. font-size: 14px;
  234. &:hover,
  235. &:focus {
  236. background: linear-gradient(0deg, @m-blue2-hover, @m-blue0-hover);
  237. color: @m-white0-hover;
  238. }
  239. }
  240. .redBtn {
  241. width: 80px;
  242. height: 26px;
  243. background: linear-gradient(0deg, @m-red0, @m-red1);
  244. .rounded-corners(3px);
  245. border: 0;
  246. color: @m-white0;
  247. font-size: 14px;
  248. &:hover,
  249. &:focus {
  250. background: linear-gradient(0deg, @m-red0-hover, @m-red1-hover);
  251. color: @m-white0-hover;
  252. }
  253. }
  254. .ant-collapse {
  255. background-color: transparent;
  256. border: 0;
  257. .ant-collapse-item {
  258. border: 0;
  259. .ant-collapse-header {
  260. background-color: transparent;
  261. border-bottom: 0;
  262. }
  263. .ant-collapse-content {
  264. background-color: transparent;
  265. border-top: 0;
  266. }
  267. }
  268. }
  269. // .ant-collapse.spotCollapse.ant-collapse-borderless {
  270. // margin-top: 10px;
  271. // background-color: transparent;
  272. // .ant-collapse-item {
  273. // border-bottom: 0;
  274. // .ant-collapse-header {
  275. // color: @m-grey17;
  276. // font-size: 14px;
  277. // border-bottom: 1px solid @m-grey18;
  278. // padding: 10px 8px 10px 44px;
  279. // height: 43px;
  280. // .ant-collapse-arrow {
  281. // fill: @m-grey17;
  282. // width: 16px;
  283. // height: 16px;
  284. // font-size: 16px;
  285. // left: 0;
  286. // }
  287. // }
  288. // .ant-collapse-content {
  289. // .ant-collapse-content-box {
  290. // padding: 0 0 0 30px;
  291. // background-color: transparent;
  292. // .ant-row.contRow {
  293. // width: 100%;
  294. // height: 40px;
  295. // line-height: 40px;
  296. // font-size: 16px;
  297. // color: @m-white1;
  298. // margin-bottom: 10px;
  299. // background: #0f161c;
  300. // border: 1px solid #172b56;
  301. // border-radius: 3px;
  302. // padding-left: 14px;
  303. // padding-right: 12px;
  304. // .ant-col:last-child {
  305. // text-align: right;
  306. // }
  307. // .ant-col:first-child {
  308. // text-align: left;
  309. // }
  310. // }
  311. // .contRow:first-child {
  312. // margin-top: 9px;
  313. // }
  314. // .contRow:last-child {
  315. // margin-bottom: 20px;
  316. // }
  317. // }
  318. // }
  319. // }
  320. // }
  321. </style>;