table-total-table.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. exports.ids = [39];
  2. exports.modules = {
  3. /***/ 168:
  4. /***/ (function(module, exports) {
  5. // Exports
  6. module.exports = {
  7. };
  8. /***/ }),
  9. /***/ 189:
  10. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  11. "use strict";
  12. __webpack_require__.r(__webpack_exports__);
  13. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TotalTable_vue_vue_type_style_index_0_id_8afd0988_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(168);
  14. /* harmony import */ var _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TotalTable_vue_vue_type_style_index_0_id_8afd0988_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TotalTable_vue_vue_type_style_index_0_id_8afd0988_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__);
  15. /* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TotalTable_vue_vue_type_style_index_0_id_8afd0988_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__) if(["default"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _node_modules_css_loader_dist_cjs_js_ref_7_oneOf_1_0_node_modules_vue_loader_lib_loaders_stylePostLoader_js_node_modules_postcss_loader_dist_cjs_js_ref_7_oneOf_1_1_node_modules_sass_loader_dist_cjs_js_ref_7_oneOf_1_2_node_modules_nuxt_components_dist_loader_js_ref_0_0_node_modules_vue_loader_lib_index_js_vue_loader_options_TotalTable_vue_vue_type_style_index_0_id_8afd0988_prod_lang_scss_scoped_true__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));
  16. /***/ }),
  17. /***/ 200:
  18. /***/ (function(module, __webpack_exports__, __webpack_require__) {
  19. "use strict";
  20. // ESM COMPAT FLAG
  21. __webpack_require__.r(__webpack_exports__);
  22. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/table/TotalTable.vue?vue&type=template&id=8afd0988&scoped=true
  23. var render = function render() {
  24. var _vm = this,
  25. _c = _vm._self._c;
  26. return _c('div', {
  27. staticClass: "wrap"
  28. }, [_vm._ssrNode("<p" + _vm._ssrClass("tb-title", {
  29. 'left': _vm.tableType
  30. }) + " data-v-8afd0988><span data-v-8afd0988>" + _vm._ssrEscape(_vm._s(_vm.title)) + "</span> " + (_vm.title == 'Sell Price' && _vm.comLocationNum !== 1 ? "<span" + _vm._ssrStyle(null, {
  31. width: _vm.comWidth + 'px'
  32. }, null) + " data-v-8afd0988>Total</span>" : "<!---->") + "</p> "), _c('el-table', {
  33. ref: "elTable",
  34. attrs: {
  35. "border": "",
  36. "data": _vm.tableData,
  37. "header-cell-style": {
  38. backgroundColor: '#fff',
  39. color: '#606266',
  40. fontWeight: 500,
  41. fontSize: '16px'
  42. },
  43. "stripe": ""
  44. }
  45. }, _vm._l(_vm.tableColumns, function (item, index) {
  46. return _c('el-table-column', {
  47. key: `${_vm.curOrder}-${item.prop}`,
  48. attrs: {
  49. "align": item.align ? item.align : 'center',
  50. "prop": item.prop,
  51. "label": item.label,
  52. "formatter": item.formatter,
  53. "sortable": item.sortable
  54. },
  55. scopedSlots: _vm._u([{
  56. key: "header",
  57. fn: function (scope) {
  58. return [_vm.title == 'Buy Price' && _vm.comLocationNum === 1 ? _c('div', [_c('el-input', {
  59. directives: [{
  60. name: "show",
  61. rawName: "v-show",
  62. value: !item.isFirstColumn,
  63. expression: "!item.isFirstColumn"
  64. }],
  65. attrs: {
  66. "size": "small",
  67. "type": "number",
  68. "min": _vm.min
  69. },
  70. on: {
  71. "blur": function ($event) {
  72. return _vm.getNumber($event, index);
  73. }
  74. },
  75. model: {
  76. value: item.label,
  77. callback: function ($$v) {
  78. _vm.$set(item, "label", $$v);
  79. },
  80. expression: "item.label"
  81. }
  82. }), _vm._v(" "), _c('span', {
  83. directives: [{
  84. name: "show",
  85. rawName: "v-show",
  86. value: item.isFirstColumn,
  87. expression: "item.isFirstColumn"
  88. }]
  89. }, [_vm._v(_vm._s(item.label))])], 1) : _c('div', [_c('span', [_vm._v(_vm._s(item.label))])])];
  90. }
  91. }, {
  92. key: "default",
  93. fn: function (scope) {
  94. return [_vm.tableType && !item.isFirstColumn ? [_c('span', [_vm._v(_vm._s(_vm._f("differencePrice")(scope.row[item.prop], _vm.curDecoration[item.prop], _vm.indexDecoration[item.prop], _vm.poaConfig)))])] : [(typeof scope.row[item.prop] == 'string' && scope.row[item.prop].includes('.') || typeof scope.row[item.prop] == 'number') && !item.isFirstColumn ? _c('span', [_vm._v("£")]) : _vm._e(), _vm._v(" "), _c('span', [_vm._v(_vm._s(scope.row[item.prop] ? scope.row[item.prop] : '0.00'))])]];
  95. }
  96. }], null, true)
  97. });
  98. }), 1)], 2);
  99. };
  100. var staticRenderFns = [];
  101. // CONCATENATED MODULE: ./components/table/TotalTable.vue?vue&type=template&id=8afd0988&scoped=true
  102. // EXTERNAL MODULE: external "number-precision"
  103. var external_number_precision_ = __webpack_require__(122);
  104. // CONCATENATED MODULE: ./node_modules/babel-loader/lib??ref--2-0!./node_modules/@nuxt/components/dist/loader.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./components/table/TotalTable.vue?vue&type=script&lang=js
  105. /* harmony default export */ var TotalTablevue_type_script_lang_js = ({
  106. filters: {
  107. differencePrice(a, curDecoVal, indexDecoVal, poaConfig) {
  108. const rep = /^[0-9]+(\.[0-9]*)?$/;
  109. if (!rep.test(a)) {
  110. return a || 'Waived';
  111. }
  112. if (poaConfig.includes(curDecoVal) || poaConfig.includes(indexDecoVal)) {
  113. if (curDecoVal === '111' || curDecoVal === '111.00' || indexDecoVal === '111' || indexDecoVal === '111.00') {
  114. return '-';
  115. } else if (curDecoVal === '999' || curDecoVal === '999.00' || indexDecoVal === '999' || indexDecoVal === '999.00') {
  116. return 'POA';
  117. }
  118. } else if (curDecoVal === indexDecoVal) {
  119. return 0;
  120. } else if (+curDecoVal > +indexDecoVal) {
  121. return `-£ ${Object(external_number_precision_["minus"])(curDecoVal, indexDecoVal)}`;
  122. } else if (+curDecoVal < +indexDecoVal) {
  123. return `+£ ${Object(external_number_precision_["minus"])(indexDecoVal, curDecoVal)}`;
  124. } else {
  125. return 'Waived';
  126. }
  127. }
  128. },
  129. props: {
  130. tableData: {
  131. type: Array,
  132. default: () => []
  133. },
  134. tableColumns: {
  135. type: Array,
  136. default: () => []
  137. },
  138. tableType: {
  139. type: String,
  140. default: ''
  141. },
  142. curDecoration: {
  143. type: Object,
  144. default: () => {}
  145. },
  146. indexDecoration: {
  147. type: Object,
  148. default: () => {}
  149. },
  150. comLocationNum: {
  151. type: Number,
  152. default: 1
  153. },
  154. curOrder: {
  155. type: String,
  156. default: ''
  157. },
  158. min: {
  159. type: String,
  160. default: ''
  161. },
  162. title: {
  163. type: String,
  164. default: ''
  165. }
  166. },
  167. data() {
  168. return {
  169. poaConfig: ['111', '111.00', '999', '999.00']
  170. };
  171. },
  172. methods: {
  173. getNumber(e, index) {
  174. if (parseInt(e.target.value) < this.min) {
  175. this.$emit('send-idx', index);
  176. }
  177. }
  178. },
  179. computed: {
  180. comWidth() {
  181. return 800 / this.tableColumns.length - 1;
  182. }
  183. }
  184. });
  185. // CONCATENATED MODULE: ./components/table/TotalTable.vue?vue&type=script&lang=js
  186. /* harmony default export */ var table_TotalTablevue_type_script_lang_js = (TotalTablevue_type_script_lang_js);
  187. // EXTERNAL MODULE: ./node_modules/vue-loader/lib/runtime/componentNormalizer.js
  188. var componentNormalizer = __webpack_require__(2);
  189. // CONCATENATED MODULE: ./components/table/TotalTable.vue
  190. function injectStyles (context) {
  191. var style0 = __webpack_require__(189)
  192. if (style0.__inject__) style0.__inject__(context)
  193. }
  194. /* normalize component */
  195. var component = Object(componentNormalizer["a" /* default */])(
  196. table_TotalTablevue_type_script_lang_js,
  197. render,
  198. staticRenderFns,
  199. false,
  200. injectStyles,
  201. "8afd0988",
  202. "35501f79"
  203. )
  204. /* harmony default export */ var TotalTable = __webpack_exports__["default"] = (component.exports);
  205. /***/ })
  206. };;
  207. //# sourceMappingURL=table-total-table.js.map