1 |
- {"version":3,"sources":["webpack:///D:/Code2024/sulibao-mini/components/basic-table/basic-table.vue?204c","webpack:///D:/Code2024/sulibao-mini/components/basic-table/basic-table.vue?4075","webpack:///D:/Code2024/sulibao-mini/components/basic-table/basic-table.vue?e25e","webpack:///D:/Code2024/sulibao-mini/components/basic-table/basic-table.vue?8257","uni-app:///components/basic-table/basic-table.vue","webpack:///D:/Code2024/sulibao-mini/components/basic-table/basic-table.vue?bff5"],"names":["renderjs","component","options","__file","components","render","_vm","this","_h","$createElement","s0","_self","_c","__get_style","getTableStyle","g0","data","length","s1","showHeader","tableBodyStyle","s2","indexShow","getIndexColStyle","l0","__map","columns","item","__i0__","$orig","__get_orig","s3","getCellProps","style","m0","s4","g1","$initSSP","l2","scope","index","s5","getBodyStyle","m1","getBodyClass","s6","m2","getIndexMethod","l1","column","__i1__","s7","m3","$scope","scopedSlotsCompiler","$setSSP","s8","showFooter","s9","l3","sumList","s10","m4","$mp","Object","assign","$root","$callSSP","recyclableRender","staticRenderFns","_withStripped","props","type","default","align","height","maxHeight","width","emptyText","border","stripe","footerMethod","footerText","minItemWidth","rowClassName","rowStyle","indexMethod","headerRowClassName","headerRowStyle","fontSize","indexWidth","tableWidth","mounted","query","computed","styleObj","c","bodyMinWidth","flexColumn","showXScroll","isEmpty","getHeaderClass","headerClass","getHeaderStyle","headerStyle","textAlign","methods","init","values","notNumber","precisions","bodyClass","bodyStyle","curIndex","classList","class","minWidth","handleHeaderClick","handleRowClick","handleCellClick","watch","handler","immediate","deep"],"mappings":"mIAAA,oIACIA,EADJ,QASIC,EAAY,qBACd,aACA,YACA,sBACA,EACA,KACA,WACA,MACA,EACA,gBACAD,GAGFC,EAAUC,QAAQC,OAAS,yCACZ,aAAAF,E,0CCvBf,uQ,iCCAA,IAAIG,EAAJ,0LACA,IAAIC,EAAS,WACX,IAAIC,EAAMC,KACNC,EAAKF,EAAIG,eAETC,GADKJ,EAAIK,MAAMC,GACVN,EAAIO,YAAY,CAACP,EAAIQ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aAEAgB,gBACAhB,aAEAiB,UACAjB,YACAC,YAEAiB,YACAlB,YACAC,iBAGAzD,gBACA,OACA4C,WACA+B,eAGAC,mBAAA,WACA,yDACAC,kCACA,wBACA,QAEAC,UACAhF,yBACA,iBAAA6D,cAAAC,iBACA,KAUA,OATA,IACAmB,WAEA,IACAA,YAEA,IACAA,eAEA,GAEA3E,0BACA,6BACA,sBACA,qDAEA,oBAEA,qCAEA,OADA4E,mBACA,wBACA,GAIA,GAHA,iBACAC,gCAEA,iBACA,UACA,gBACAC,mBACA,CACA,iBACAA,uBACAvE,4BAKA,OADAsE,gBACA,CACApB,0BAGAsB,uBAAA,MACA,kBACA,qFAEAC,mBACA,6BAEAC,0BACA,SAIA,OAHA,yBACAC,gCAEA,GAEAC,0BACA,SAMA,MALA,+CACA,qBACAC,4BAGA,GAEAjF,4BACA,OACAkF,qBACA5B,yBAIA6B,SACAC,gBAAA,WAEA,GADA,gBACA,qCACA,mBAAA3F,YAAAkE,kBACA,sCACA,gCAAAxD,UAAAV,SAEAU,yBACA,uBAIA,0DACA,KACA,KACAkF,uBACA,sBACAC,KACA,iCACAC,yBAGA,6BAWA,aAVA,EAUA,GATA,wBACA,gBACA,wBAGA,EAFA,mDAIA,QAtBA,oBA+BAlE,2BACA,SAIA,GAHA,aACAmE,QAAA,sBAEA,6CACA,mEACA,GACAA,cAEA,qCACA,mBACAA,0BAGA,UAGArE,2BACA,SACA,4CACA,+DACA,GACAsE,cAEA,yCACA,eACAA,sBAGA,UAGAjE,2BACA,IACA,EADA,MACA,uCACAkE,iEAEA,UAGAjF,yBACA,SASA,OARA,4BACAkF,gBACA,iBACAA,qBAEAA,uBAGA,CACAC,QACAlF,OACA4C,8BACA4B,qBACAW,8CAKAC,6BACA,4BAGAC,6BACA,6BAGAC,gCACA,yBAAAhF,QAAAU,SAAAT,YAGAgF,OACAxG,MACAyG,mBACA,aAEAC,aACAC,WAGA,c,6DCzWA,yHAAmiD,eAAG,G","file":"components/basic-table/basic-table.js","sourcesContent":["import { render, staticRenderFns, recyclableRender, components } from \"./basic-table.vue?vue&type=template&id=201e5038&scoped=true&\"\nvar renderjs\nimport script from \"./basic-table.vue?vue&type=script&lang=js&\"\nexport * from \"./basic-table.vue?vue&type=script&lang=js&\"\nimport style0 from \"./basic-table.vue?vue&type=style&index=0&id=201e5038&lang=scss&scoped=true&\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n \"201e5038\",\n null,\n false,\n components,\n renderjs\n)\n\ncomponent.options.__file = \"components/basic-table/basic-table.vue\"\nexport default component.exports","export * from \"-!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/templateLoader.js??vue-loader-options!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--17-0!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/template.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-uni-app-loader/page-meta.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./basic-table.vue?vue&type=template&id=201e5038&scoped=true&\"","var components\nvar render = function () {\n var _vm = this\n var _h = _vm.$createElement\n var _c = _vm._self._c || _h\n var s0 = _vm.__get_style([_vm.getTableStyle])\n var g0 = _vm.data.length\n var s1 = _vm.showHeader ? _vm.__get_style([_vm.tableBodyStyle]) : null\n var s2 =\n _vm.showHeader && _vm.indexShow\n ? _vm.__get_style([_vm.getIndexColStyle])\n : null\n var l0 = _vm.showHeader\n ? _vm.__map(_vm.columns, function (item, __i0__) {\n var $orig = _vm.__get_orig(item)\n var s3 = _vm.__get_style([_vm.getCellProps(item).style])\n var m0 = _vm.getCellProps(item)\n return {\n $orig: $orig,\n s3: s3,\n m0: m0,\n }\n })\n : null\n var s4 = _vm.__get_style([_vm.tableBodyStyle])\n var g1 = _vm.data.length\n _vm.$initSSP()\n var l2 =\n g1 > 0\n ? _vm.__map(_vm.data, function (scope, index) {\n var $orig = _vm.__get_orig(scope)\n var s5 = _vm.__get_style([_vm.getBodyStyle(scope, index)])\n var m1 = _vm.getBodyClass(scope, index)\n var s6 = _vm.indexShow\n ? _vm.__get_style([_vm.getIndexColStyle])\n : null\n var m2 = _vm.indexShow ? _vm.getIndexMethod(index) : null\n var l1 = _vm.__map(_vm.columns, function (column, __i1__) {\n var $orig = _vm.__get_orig(column)\n var s7 = _vm.__get_style([_vm.getCellProps(column).style])\n var m3 = _vm.getCellProps(column)\n return {\n $orig: $orig,\n s7: s7,\n m3: m3,\n }\n })\n if (_vm.$scope.data.scopedSlotsCompiler === \"augmented\") {\n _vm.$setSSP(\"item\", {\n scope: $orig,\n column: _vm.column.$orig,\n })\n }\n return {\n $orig: $orig,\n s5: s5,\n m1: m1,\n s6: s6,\n m2: m2,\n l1: l1,\n }\n })\n : null\n var s8 = _vm.showFooter ? _vm.__get_style([_vm.tableBodyStyle]) : null\n var s9 =\n _vm.showFooter && _vm.indexShow\n ? _vm.__get_style([_vm.getIndexColStyle])\n : null\n var l3 = _vm.showFooter\n ? _vm.__map(_vm.sumList, function (item, index) {\n var $orig = _vm.__get_orig(item)\n var s10 = _vm.__get_style([_vm.getCellProps(_vm.columns[index]).style])\n var m4 = _vm.getCellProps(_vm.columns[index])\n return {\n $orig: $orig,\n s10: s10,\n m4: m4,\n }\n })\n : null\n _vm.$mp.data = Object.assign(\n {},\n {\n $root: {\n s0: s0,\n g0: g0,\n s1: s1,\n s2: s2,\n l0: l0,\n s4: s4,\n g1: g1,\n l2: l2,\n s8: s8,\n s9: s9,\n l3: l3,\n },\n }\n )\n _vm.$callSSP()\n}\nvar recyclableRender = false\nvar staticRenderFns = []\nrender._withStripped = true\n\nexport { render, staticRenderFns, recyclableRender, components }","import mod from \"-!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./basic-table.vue?vue&type=script&lang=js&\"; export default mod; export * from \"-!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/babel-loader/lib/index.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--13-1!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/script.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./basic-table.vue?vue&type=script&lang=js&\"","<template>\r\n\t<view class=\"base-table\" :style=\"[getTableStyle]\" :class=\"{ 'is-border': border, 'no-data': data.length === 0 }\">\r\n\t\t<view class=\"base-table-inner\">\r\n\t\t\t<view class=\"base-table-header\" v-if=\"showHeader\">\r\n\t\t\t\t<view class=\"b-table\" :style=\"[tableBodyStyle]\">\r\n\t\t\t\t\t<view class=\"b-thead\">\r\n\t\t\t\t\t\t<view class=\"b-tr\" :class=\"getHeaderClass\" :style=\"getHeaderStyle\" @click=\"handleHeaderClick\">\r\n\t\t\t\t\t\t\t<view class=\"b-th\" v-if=\"indexShow\" :style=\"[getIndexColStyle]\"><view class=\"b-cell\">序号</view></view>\r\n\t\t\t\t\t\t\t<view class=\"b-th\" v-for=\"item in columns\" :key=\"item.fieldName\" :class=\"[getCellProps(item).class]\" :style=\"[getCellProps(item).style]\">\r\n\t\t\t\t\t\t\t\t<view class=\"b-cell\" :style=\"{fontSize:fontSize+'px'}\">{{ item.fieldDesc }}</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"base-table-body\">\r\n\t\t\t\t<view class=\"b-table\" :style=\"[tableBodyStyle]\">\r\n\t\t\t\t\t<view class=\"b-tbody\" v-if=\"data.length > 0\">\r\n\t\t\t\t\t\t<view\r\n\t\t\t\t\t\t\tclass=\"b-tr\"\r\n\t\t\t\t\t\t\tv-for=\"(scope, index) in data\"\r\n\t\t\t\t\t\t\t:key=\"index\"\r\n\t\t\t\t\t\t\t:class=\"[getBodyClass(scope, index)]\"\r\n\t\t\t\t\t\t\t:style=\"[getBodyStyle(scope, index)]\"\r\n\t\t\t\t\t\t\t@click=\"handleRowClick(scope, index)\"\r\n\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t<view class=\"b-td\" v-if=\"indexShow\" :style=\"[getIndexColStyle]\">\r\n\t\t\t\t\t\t\t\t<view class=\"b-cell\" :style=\"{fontSize:fontSize+'px'}\">{{ getIndexMethod(index) }}</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view class=\"b-td\" v-for=\"column in columns\" :key=\"column.fieldName\" :class=\"[getCellProps(column).class]\" :style=\"[getCellProps(column).style]\">\r\n\t\t\t\t\t\t\t\t<view class=\"b-cell\" @click.stop=\"handleCellClick(scope, column, index)\">\r\n\t\t\t\t\t\t\t\t\t<slot name=\"item\" :scope=\"scope\" :column=\"column\" v-if=\"column.fieldType === 'slot'\"></slot>\r\n\t\t\t\t\t\t\t\t\t<view v-else :style=\"{fontSize:fontSize+'px'}\">{{ scope[column.fieldName] }}</view>\r\n\t\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t\t<view class=\"base-table-empty\" v-else>\r\n\t\t\t\t\t\t<view class=\"mt20\" v-if=\"!$slots.empty\">{{ emptyText }}</view>\r\n\t\t\t\t\t\t<slot name=\"empty\"></slot>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t\t<view class=\"base-table-footer\" v-if=\"showFooter\">\r\n\t\t\t\t<view class=\"b-table\" :style=\"[tableBodyStyle]\">\r\n\t\t\t\t\t<view class=\"b-tbody\">\r\n\t\t\t\t\t\t<view class=\"b-tr\">\r\n\t\t\t\t\t\t\t<view class=\"b-td\" v-if=\"indexShow\" :style=\"[getIndexColStyle]\">\r\n\t\t\t\t\t\t\t\t<view class=\"b-cell\">{{ footerText }}</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t\t<view\r\n\t\t\t\t\t\t\t\tclass=\"b-td\"\r\n\t\t\t\t\t\t\t\tv-for=\"(item, index) in sumList\"\r\n\t\t\t\t\t\t\t\t:key=\"index\"\r\n\t\t\t\t\t\t\t\t:class=\"[getCellProps(columns[index]).class]\"\r\n\t\t\t\t\t\t\t\t:style=\"[getCellProps(columns[index]).style]\"\r\n\t\t\t\t\t\t\t>\r\n\t\t\t\t\t\t\t\t<view class=\"b-cell\">{{ item }}</view>\r\n\t\t\t\t\t\t\t</view>\r\n\t\t\t\t\t\t</view>\r\n\t\t\t\t\t</view>\r\n\t\t\t\t</view>\r\n\t\t\t</view>\r\n\t\t</view>\r\n\t</view>\r\n</template>\r\n\r\n<script>\r\nexport default {\r\n\tprops: {\r\n\t\tcolumns: {\r\n\t\t\ttype: Array,\r\n\t\t\tdefault: () => []\r\n\t\t},\r\n\t\tdata: {\r\n\t\t\ttype: Array,\r\n\t\t\tdefault: () => []\r\n\t\t},\r\n\t\talign: {\r\n\t\t\ttype: String,\r\n\t\t\tdefault: 'left'\r\n\t\t},\r\n\t\theight: {\r\n\t\t\ttype: String\r\n\t\t},\r\n\t\tmaxHeight: {\r\n\t\t\ttype: String\r\n\t\t},\r\n\t\twidth: {\r\n\t\t\ttype: String,\r\n\t\t\tdefault: '100%'\r\n\t\t},\r\n\t\temptyText: {\r\n\t\t\ttype: String,\r\n\t\t\tdefault: '暂无数据'\r\n\t\t},\r\n\t\tborder: {\r\n\t\t\ttype: Boolean,\r\n\t\t\tdefault: false\r\n\t\t},\r\n\t\tstripe: {\r\n\t\t\ttype: Boolean,\r\n\t\t\tdefault: false\r\n\t\t},\r\n\t\tshowHeader: {\r\n\t\t\ttype: Boolean,\r\n\t\t\tdefault: true\r\n\t\t},\r\n\t\tshowFooter: {\r\n\t\t\ttype: Boolean,\r\n\t\t\tdefault: false\r\n\t\t},\r\n\t\tfooterMethod: {\r\n\t\t\ttype: Function\r\n\t\t},\r\n\t\tfooterText: {\r\n\t\t\ttype: String,\r\n\t\t\tdefault: '合计'\r\n\t\t},\r\n\t\tindexShow: {\r\n\t\t\ttype: Boolean,\r\n\t\t\tdefault: false\r\n\t\t},\r\n\t\tminItemWidth: {\r\n\t\t\ttype: Number,\r\n\t\t\tdefault: 80\r\n\t\t},\r\n\t\trowClassName: {\r\n\t\t\ttype: [Function, String]\r\n\t\t},\r\n\t\trowStyle: {\r\n\t\t\ttype: [Function, Object]\r\n\t\t},\r\n\t\tindexMethod: {\r\n\t\t\ttype: Function\r\n\t\t},\r\n\t\theaderRowClassName: {\r\n\t\t\ttype: String\r\n\t\t},\r\n\t\theaderRowStyle: {\r\n\t\t\ttype: Object\r\n\t\t},\r\n\t\tfontSize:{\r\n\t\t\ttype: Number,\r\n\t\t\tdefault: 15\r\n\t\t},\r\n\t\tindexWidth: {\r\n\t\t\ttype: String,\r\n\t\t\tdefault: '60px'\r\n\t\t}\r\n\t},\r\n\tdata() {\r\n\t\treturn {\r\n\t\t\tsumList: [],\r\n\t\t\ttableWidth: 0\r\n\t\t};\r\n\t},\r\n\tmounted() {\r\n\t\tconst query = uni.createSelectorQuery().in(this).select('.base-table');\r\n\t\tquery.boundingClientRect(data => {\r\n\t\t\t\tthis.tableWidth = data.width;\r\n\t\t}).exec();\r\n\t},\r\n\tcomputed: {\r\n\t\tgetTableStyle() {\r\n\t\t\tconst { width, height, maxHeight } = this;\r\n\t\t\tconst styleObj = {};\r\n\t\t\tif (width) {\r\n\t\t\t\tstyleObj.width = width;\r\n\t\t\t}\r\n\t\t\tif (height) {\r\n\t\t\t\tstyleObj.height = height;\r\n\t\t\t}\r\n\t\t\tif (maxHeight) {\r\n\t\t\t\tstyleObj.maxHeight = maxHeight;\r\n\t\t\t}\r\n\t\t\treturn styleObj;\r\n\t\t},\r\n\t\ttableBodyStyle() {\r\n\t\t\tif (!this.tableWidth) return {};\r\n\t\t\tconst clienWidth = this.tableWidth;\r\n\t\t\tconst flexColumn = this.columns.filter(item => !item.width);\r\n\t\t\t//set min width\r\n\t\t\tconst minWidth = this.minItemWidth;\r\n\r\n\t\t\tlet bodyMinWidth = this.columns.reduce((t, c) => {\r\n\t\t\t\tc.width = c.width || minWidth;\r\n\t\t\t\treturn t + parseFloat(c.width);\r\n\t\t\t}, 0);\r\n\t\t\tif(this.indexShow){\r\n\t\t\t\tbodyMinWidth+=parseFloat(this.indexWidth)\r\n\t\t\t}\r\n\t\t\tif (flexColumn.length > 0 && bodyMinWidth < clienWidth) {\r\n\t\t\t\tconst flexWidth = clienWidth - bodyMinWidth;\r\n\t\t\t\tif (flexColumn.length === 1) {\r\n\t\t\t\t\tflexColumn[0].width = minWidth + flexWidth;\r\n\t\t\t\t} else {\r\n\t\t\t\t\tconst scaleWidth = flexWidth / flexColumn.length;\r\n\t\t\t\t\tflexColumn.forEach(item => {\r\n\t\t\t\t\t\titem.width = minWidth + Math.floor(scaleWidth);\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tbodyMinWidth = Math.max(bodyMinWidth, clienWidth);\r\n\t\t\treturn {\r\n\t\t\t\twidth: `${bodyMinWidth}px`\r\n\t\t\t};\r\n\t\t},\r\n\t\tshowXScroll() {\r\n\t\t\tconst clienWidth = this.tableWidth;\r\n\t\t\treturn clienWidth < parseFloat(this.tableBodyStyle?.width || 0);\r\n\t\t},\r\n\t\tisEmpty() {\r\n\t\t\treturn this.data.length === 0;\r\n\t\t},\r\n\t\tgetHeaderClass() {\r\n\t\t\tconst headerClass = [];\r\n\t\t\tif (this.headerRowClassName) {\r\n\t\t\t\theaderClass.push(this.headerRowClassName);\r\n\t\t\t}\r\n\t\t\treturn headerClass;\r\n\t\t},\r\n\t\tgetHeaderStyle() {\r\n\t\t\tconst headerStyle = [];\r\n\t\t\tif (typeof this.headerRowStyle === 'object') {\r\n\t\t\t\tif (this.headerRowStyle) {\r\n\t\t\t\t\theaderStyle.push(this.headerRowStyle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn headerStyle;\r\n\t\t},\r\n\t\tgetIndexColStyle() {\r\n\t\t\treturn {\r\n\t\t\t\ttextAlign: this.align,\r\n\t\t\t\twidth: this.indexWidth\r\n\t\t\t};\r\n\t\t}\r\n\t},\r\n\tmethods: {\r\n\t\tinit() {\r\n\t\t\tthis.sumList = [];\r\n\t\t\tif (this.showFooter && this.data.length > 0) {\r\n\t\t\t\tconst { columns, data, footerText } = this;\r\n\t\t\t\tif (typeof this.footerMethod === 'function') {\r\n\t\t\t\t\tthis.sumList = this.footerMethod({ columns, data });\r\n\t\t\t\t} else {\r\n\t\t\t\t\tcolumns.forEach((column, index) => {\r\n\t\t\t\t\t\tif (!this.indexShow && index === 0) {\r\n\t\t\t\t\t\t\tthis.sumList[index] = footerText;\r\n\t\t\t\t\t\t\treturn;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tconst values = data.map(item => Number(item[column.fieldName]));\r\n\t\t\t\t\t\tconst precisions = [];\r\n\t\t\t\t\t\tlet notNumber = true;\r\n\t\t\t\t\t\tvalues.forEach(value => {\r\n\t\t\t\t\t\t\tif (!Number.isNaN(+value)) {\r\n\t\t\t\t\t\t\t\tnotNumber = false;\r\n\t\t\t\t\t\t\t\tconst decimal = `${value}`.split('.')[1];\r\n\t\t\t\t\t\t\t\tprecisions.push(decimal ? decimal.length : 0);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t\tconst precision = Math.max.apply(null, precisions);\r\n\t\t\t\t\t\tif (!notNumber) {\r\n\t\t\t\t\t\t\tthis.sumList[index] = values.reduce((prev, curr) => {\r\n\t\t\t\t\t\t\t\tconst value = Number(curr);\r\n\t\t\t\t\t\t\t\tif (!Number.isNaN(+value)) {\r\n\t\t\t\t\t\t\t\t\treturn Number.parseFloat((prev + curr).toFixed(Math.min(precision, 20)));\r\n\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\treturn prev;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}, 0);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tthis.sumList[index] = '';\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t});\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t},\r\n\r\n\t\tgetBodyClass(scope, index) {\r\n\t\t\tconst bodyClass = [];\r\n\t\t\tif (this.stripe) {\r\n\t\t\t\tbodyClass.push({ 'is-stripe': index % 2 === 1 });\r\n\t\t\t}\r\n\t\t\tif (typeof this.rowClassName === 'function') {\r\n\t\t\t\tconst rowClass = this.rowClassName?.(scope, index);\r\n\t\t\t\tif (rowClass) {\r\n\t\t\t\t\tbodyClass.push(rowClass);\r\n\t\t\t\t}\r\n\t\t\t} else if (typeof this.rowClassName === 'string') {\r\n\t\t\t\tif (this.rowClassName) {\r\n\t\t\t\t\tbodyClass.push(this.rowClassName);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn bodyClass;\r\n\t\t},\r\n\r\n\t\tgetBodyStyle(scope, index) {\r\n\t\t\tconst bodyStyle = [];\r\n\t\t\tif (typeof this.rowStyle === 'function') {\r\n\t\t\t\tconst rowStyle = this.rowStyle?.(scope, index);\r\n\t\t\t\tif (rowStyle) {\r\n\t\t\t\t\tbodyStyle.push(rowStyle);\r\n\t\t\t\t}\r\n\t\t\t} else if (typeof this.rowStyle === 'object') {\r\n\t\t\t\tif (this.rowStyle) {\r\n\t\t\t\t\tbodyStyle.push(this.rowStyle);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn bodyStyle;\r\n\t\t},\r\n\r\n\t\tgetIndexMethod(index) {\r\n\t\t\tlet curIndex = index + 1;\r\n\t\t\tif (typeof this.indexMethod === 'function') {\r\n\t\t\t\tcurIndex = this.indexMethod?.(index);\r\n\t\t\t}\r\n\t\t\treturn curIndex;\r\n\t\t},\r\n\r\n\t\tgetCellProps(row) {\r\n\t\t\tconst classList = [];\r\n\t\t\tif (this.showXScroll && row.fixed) {\r\n\t\t\t\tclassList.push('fixed');\r\n\t\t\t\tif (row.fixed === 'left') {\r\n\t\t\t\t\tclassList.push('fixed-left');\r\n\t\t\t\t} else {\r\n\t\t\t\t\tclassList.push('fixed-right');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\treturn {\r\n\t\t\t\tclass: classList,\r\n\t\t\t\tstyle: {\r\n\t\t\t\t\twidth: `${row.width}px`,\r\n\t\t\t\t\ttextAlign: this.align,\r\n\t\t\t\t\tminWidth: `${this.minItemWidth}px`\r\n\t\t\t\t}\r\n\t\t\t};\r\n\t\t},\r\n\r\n\t\thandleHeaderClick() {\r\n\t\t\tthis.$emit('header-click');\r\n\t\t},\r\n\r\n\t\thandleRowClick(scope, index) {\r\n\t\t\tthis.$emit('row-click', scope, index);\r\n\t\t},\r\n\r\n\t\thandleCellClick(scope, column, index) {\r\n\t\t\tthis.$emit('cell-click', { scope, column, index });\r\n\t\t},\r\n\t},\r\n\twatch: {\r\n\t\tdata: {\r\n\t\t\thandler() {\r\n\t\t\t\tthis.init();\r\n\t\t\t},\r\n\t\t\timmediate: true,\r\n\t\t\tdeep: true\r\n\t\t}\r\n\t}\r\n};\r\n</script>\r\n\r\n<style lang=\"scss\" scoped>\r\n@import './basic-table.scss';\r\n</style>\r\n","import mod from \"-!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./basic-table.vue?vue&type=style&index=0&id=201e5038&lang=scss&scoped=true&\"; export default mod; export * from \"-!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/mini-css-extract-plugin/dist/loader.js??ref--8-oneOf-1-0!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/css-loader/dist/cjs.js??ref--8-oneOf-1-1!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/loaders/stylePostLoader.js!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-2!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/postcss-loader/src/index.js??ref--8-oneOf-1-3!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/sass-loader/dist/cjs.js??ref--8-oneOf-1-4!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/webpack-preprocess-loader/index.js??ref--8-oneOf-1-5!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/vue-cli-plugin-uni/packages/vue-loader/lib/index.js??vue-loader-options!../../../../self software/HBuilderX.3.99.2023122611/HBuilderX/plugins/uniapp-cli/node_modules/@dcloudio/webpack-uni-mp-loader/lib/style.js!./basic-table.vue?vue&type=style&index=0&id=201e5038&lang=scss&scoped=true&\""],"sourceRoot":""}
|