el-crud-page 1.0.4 → 1.0.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.esm.js CHANGED
@@ -1377,21 +1377,21 @@ __vue_render__$4._withStripped = true;
1377
1377
  /* style */
1378
1378
  var __vue_inject_styles__$4 = function __vue_inject_styles__(inject) {
1379
1379
  if (!inject) return;
1380
- inject("data-v-8bcd2094_0", {
1381
- source: ".crud-table[data-v-8bcd2094] .el-table__body-wrapper .el-table__cell .cell:empty::after {\n content: \"/\";\n color: #c0c4cc;\n}\n\n/*# sourceMappingURL=table.vue.map */",
1380
+ inject("data-v-00cd4ad2_0", {
1381
+ source: ".crud-table[data-v-00cd4ad2] .el-table__fixed .el-table__cell .cell:empty::after,\n.crud-table[data-v-00cd4ad2] .el-table__body-wrapper .el-table__cell .cell:empty::after {\n content: \"/\";\n color: #c0c4cc;\n}\n\n/*# sourceMappingURL=table.vue.map */",
1382
1382
  map: {
1383
1383
  "version": 3,
1384
1384
  "sources": ["/Users/tonwe/git/el-crud-page/src/table.vue", "table.vue"],
1385
1385
  "names": [],
1386
- "mappings": "AAsJA;EACA,YAAA;EACA,cAAA;ACrJA;;AAEA,oCAAoC",
1386
+ "mappings": "AAuJA;;EACA,YAAA;EACA,cAAA;ACrJA;;AAEA,oCAAoC",
1387
1387
  "file": "table.vue",
1388
- "sourcesContent": ["<!-- crud table 组件 -->\n<template>\n <el-table :data=\"data\" class=\"crud-table\" ref=\"table\" v-bind=\"combinedProps\" v-on=\"combinedEvents\">\n <crud-table-column v-for=\"(column,index) in columns\" :key=\"`${ column.key || ('column_'+index) }`\" :indexMethod=\"(index)=>( baseIndex + 1 + index )\"\n v-if=\"!column[`v-hasPermi`] || !column[`v-hasPermi`].length || $auth.hasPermiOr(column[`v-hasPermi`] || [])\"\n :column=\"column\" @action=\"onRowAction\">\n </crud-table-column>\n </el-table>\n</template>\n<script>\n\n\n/**\n * CRUD table组件\n */\n\nimport CrudTableColumn from \"./tableColumn.js\";\n\nexport default {\n name: \"CrudTable\",\n components: {\n CrudTableColumn\n },\n inject: [\"crud\"],\n props: {\n columns: {\n type: Array,\n default: () => []\n },\n on: {\n type: Object,\n default: () => {\n return {};\n }\n },\n data: {\n type: Array,\n default: () => {\n return [];\n }\n }\n },\n data() {\n return {\n emit: {},\n defaultProps: {\n stripe: true,\n size: \"mini\",\n }\n };\n },\n computed: {\n // 将外部传入的 props 与 crud 内部样式合并\n combinedProps() {\n return Object.assign({}, this.defaultProps, this.$attrs);\n },\n // 将各事件处理函数合并,包括 emit 与 on 上的回调\n combinedEvents() {\n return Object.assign(\n {},\n {\n \"selection-change\": this.onSelectionChange,\n \"sort-change\": this.onSortChange,\n \"row-contextmenu\": this.onRowContextMenu\n },\n this.emit,\n this.on\n );\n },\n baseIndex(){\n if( this.crud?.pagination ){\n return (this.crud?.pagination?.pageNum-1) * this.crud?.pagination?.pageSize;\n }else{\n return 0;\n }\n }\n },\n mounted() {\n this.bindEmits();\n this.bindMethods();\n },\n methods: {\n // 绑定 el-table 回调\n bindEmits() {\n const emits = [\n \"select\",\n \"select-all\",\n \"cell-mouse-enter\",\n \"cell-mouse-leave\",\n \"cell-click\",\n \"cell-dblclick\",\n \"row-click\",\n \"row-contextmenu\",\n \"row-dblclick\",\n \"header-click\",\n \"header-contextmenu\",\n \"filter-change\",\n \"current-change\",\n \"header-dragend\",\n \"expand-change\"\n ];\n\n emits.forEach((name) => {\n this.emit[name] = (...args) => {\n this.$emit(name, ...args);\n };\n });\n },\n\n // 绑定 el-table 事件\n bindMethods() {\n const methods = [\n \"clearSelection\",\n \"toggleRowSelection\",\n \"toggleAllSelection\",\n \"toggleRowExpansion\",\n \"setCurrentRow\",\n \"clearSort\",\n \"clearFilter\",\n \"doLayout\",\n \"sort\"\n ];\n\n methods.forEach((n) => {\n this[n] = this.$refs[\"table\"][n];\n });\n },\n onSelectionChange(selection) {\n this.$emit(\"selection-change\", selection);\n },\n onSortChange({ prop, order }) {\n this.$emit(\"sort-change\", { prop, order });\n },\n onRowContextMenu(row, column, event) {\n this.$emit(\"row-contextmenu\", row, column, event);\n },\n onRowAction(action, scope) {\n this.$emit(\"row-action\", action, scope);\n this.$emit(`row-${action}`, scope);\n }\n }\n\n}\n</script>\n\n<style scoped lang=\"scss\">\n.crud-table {\n &::v-deep {\n .el-table__body-wrapper {\n .el-table__cell {\n .cell:empty::after {\n content: '/';\n color: #c0c4cc;\n }\n }\n }\n }\n}\n</style>\n", ".crud-table::v-deep .el-table__body-wrapper .el-table__cell .cell:empty::after {\n content: \"/\";\n color: #c0c4cc;\n}\n\n/*# sourceMappingURL=table.vue.map */"]
1388
+ "sourcesContent": ["<!-- crud table 组件 -->\n<template>\n <el-table :data=\"data\" class=\"crud-table\" ref=\"table\" v-bind=\"combinedProps\" v-on=\"combinedEvents\">\n <crud-table-column v-for=\"(column,index) in columns\" :key=\"`${ column.key || ('column_'+index) }`\" :indexMethod=\"(index)=>( baseIndex + 1 + index )\"\n v-if=\"!column[`v-hasPermi`] || !column[`v-hasPermi`].length || $auth.hasPermiOr(column[`v-hasPermi`] || [])\"\n :column=\"column\" @action=\"onRowAction\">\n </crud-table-column>\n </el-table>\n</template>\n<script>\n\n\n/**\n * CRUD table组件\n */\n\nimport CrudTableColumn from \"./tableColumn.js\";\n\nexport default {\n name: \"CrudTable\",\n components: {\n CrudTableColumn\n },\n inject: [\"crud\"],\n props: {\n columns: {\n type: Array,\n default: () => []\n },\n on: {\n type: Object,\n default: () => {\n return {};\n }\n },\n data: {\n type: Array,\n default: () => {\n return [];\n }\n }\n },\n data() {\n return {\n emit: {},\n defaultProps: {\n stripe: true,\n size: \"mini\",\n }\n };\n },\n computed: {\n // 将外部传入的 props 与 crud 内部样式合并\n combinedProps() {\n return Object.assign({}, this.defaultProps, this.$attrs);\n },\n // 将各事件处理函数合并,包括 emit 与 on 上的回调\n combinedEvents() {\n return Object.assign(\n {},\n {\n \"selection-change\": this.onSelectionChange,\n \"sort-change\": this.onSortChange,\n \"row-contextmenu\": this.onRowContextMenu\n },\n this.emit,\n this.on\n );\n },\n baseIndex(){\n if( this.crud?.pagination ){\n return (this.crud?.pagination?.pageNum-1) * this.crud?.pagination?.pageSize;\n }else{\n return 0;\n }\n }\n },\n mounted() {\n this.bindEmits();\n this.bindMethods();\n },\n methods: {\n // 绑定 el-table 回调\n bindEmits() {\n const emits = [\n \"select\",\n \"select-all\",\n \"cell-mouse-enter\",\n \"cell-mouse-leave\",\n \"cell-click\",\n \"cell-dblclick\",\n \"row-click\",\n \"row-contextmenu\",\n \"row-dblclick\",\n \"header-click\",\n \"header-contextmenu\",\n \"filter-change\",\n \"current-change\",\n \"header-dragend\",\n \"expand-change\"\n ];\n\n emits.forEach((name) => {\n this.emit[name] = (...args) => {\n this.$emit(name, ...args);\n };\n });\n },\n\n // 绑定 el-table 事件\n bindMethods() {\n const methods = [\n \"clearSelection\",\n \"toggleRowSelection\",\n \"toggleAllSelection\",\n \"toggleRowExpansion\",\n \"setCurrentRow\",\n \"clearSort\",\n \"clearFilter\",\n \"doLayout\",\n \"sort\"\n ];\n\n methods.forEach((n) => {\n this[n] = this.$refs[\"table\"][n];\n });\n },\n onSelectionChange(selection) {\n this.$emit(\"selection-change\", selection);\n },\n onSortChange({ prop, order }) {\n this.$emit(\"sort-change\", { prop, order });\n },\n onRowContextMenu(row, column, event) {\n this.$emit(\"row-contextmenu\", row, column, event);\n },\n onRowAction(action, scope) {\n this.$emit(\"row-action\", action, scope);\n this.$emit(`row-${action}`, scope);\n }\n }\n\n}\n</script>\n\n<style scoped lang=\"scss\">\n.crud-table {\n &::v-deep {\n .el-table__fixed,\n .el-table__body-wrapper {\n .el-table__cell {\n .cell:empty::after {\n content: '/';\n color: #c0c4cc;\n }\n }\n }\n }\n}\n</style>\n", ".crud-table::v-deep .el-table__fixed .el-table__cell .cell:empty::after,\n.crud-table::v-deep .el-table__body-wrapper .el-table__cell .cell:empty::after {\n content: \"/\";\n color: #c0c4cc;\n}\n\n/*# sourceMappingURL=table.vue.map */"]
1389
1389
  },
1390
1390
  media: undefined
1391
1391
  });
1392
1392
  };
1393
1393
  /* scoped */
1394
- var __vue_scope_id__$4 = "data-v-8bcd2094";
1394
+ var __vue_scope_id__$4 = "data-v-00cd4ad2";
1395
1395
  /* module identifier */
1396
1396
  var __vue_module_identifier__$4 = undefined;
1397
1397
  /* functional template */