🐛(component): 排除 uuid 依赖, 修复 table.css empty 与 tools 样式
This commit is contained in:
		
							parent
							
								
									4b30714dab
								
							
						
					
					
						commit
						0e8e392e90
					
				@ -41,12 +41,8 @@
 | 
			
		||||
    "@umijs/ssr-darkreader": "^4.9.45",
 | 
			
		||||
    "dayjs": "^1.11.0",
 | 
			
		||||
    "evtd": "^0.2.3",
 | 
			
		||||
    "uuid": "^8.3.2",
 | 
			
		||||
    "vue-i18n": "^9.1.10"
 | 
			
		||||
  },
 | 
			
		||||
  "devDependencies": {
 | 
			
		||||
    "@types/uuid": "^8.3.4"
 | 
			
		||||
  },
 | 
			
		||||
  "files": [
 | 
			
		||||
    "lib",
 | 
			
		||||
    "es",
 | 
			
		||||
 | 
			
		||||
@ -2,6 +2,7 @@
 | 
			
		||||
@import "../radio/index.less";
 | 
			
		||||
@import "../dropdown/index.less";
 | 
			
		||||
@import "../page/index.less";
 | 
			
		||||
@import "../empty/index.less";
 | 
			
		||||
 | 
			
		||||
.layui-table-col-special {
 | 
			
		||||
  width: 34px;
 | 
			
		||||
@ -14,6 +15,10 @@
 | 
			
		||||
  table-layout: fixed;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.layui-table .layui-empty {
 | 
			
		||||
  margin: 20px;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
.layui-table th {
 | 
			
		||||
  text-align: left;
 | 
			
		||||
  font-weight: 400;
 | 
			
		||||
 | 
			
		||||
@ -17,7 +17,6 @@ import {
 | 
			
		||||
  computed,
 | 
			
		||||
  onBeforeUnmount,
 | 
			
		||||
} from "vue";
 | 
			
		||||
import { v4 as uuidv4 } from "../../utils/guidUtil";
 | 
			
		||||
import { Recordable } from "../../types";
 | 
			
		||||
import { LayIcon } from "@layui/icons-vue";
 | 
			
		||||
import LayCheckbox from "../checkbox/index.vue";
 | 
			
		||||
@ -78,8 +77,6 @@ const props = withDefaults(defineProps<LayTableProps>(), {
 | 
			
		||||
  getRadioProps: () => {},
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const tableId = uuidv4();
 | 
			
		||||
 | 
			
		||||
const emit = defineEmits([
 | 
			
		||||
  "change",
 | 
			
		||||
  "update:expandKeys",
 | 
			
		||||
@ -92,6 +89,7 @@ const emit = defineEmits([
 | 
			
		||||
 | 
			
		||||
const slot = useSlots();
 | 
			
		||||
const slots = slot.default && slot.default();
 | 
			
		||||
const tableRef = ref();
 | 
			
		||||
 | 
			
		||||
const s = "";
 | 
			
		||||
const allChecked = ref(false);
 | 
			
		||||
@ -333,7 +331,7 @@ const rowContextmenu = (data: any, evt: MouseEvent) => {
 | 
			
		||||
 | 
			
		||||
// 页面打印
 | 
			
		||||
const print = () => {
 | 
			
		||||
  let subOutputRankPrint = document.getElementById(tableId) as HTMLElement;
 | 
			
		||||
  let subOutputRankPrint = tableRef.value as HTMLElement;
 | 
			
		||||
  let newContent = subOutputRankPrint.innerHTML;
 | 
			
		||||
  let oldContent = document.body.innerHTML;
 | 
			
		||||
  document.body.innerHTML = newContent;
 | 
			
		||||
@ -621,12 +619,11 @@ onBeforeUnmount(() => {
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<template>
 | 
			
		||||
  <div :id="tableId">
 | 
			
		||||
  <div ref="tableRef">
 | 
			
		||||
    <table class="layui-hide" lay-filter="test"></table>
 | 
			
		||||
    <div class="layui-form layui-border-box layui-table-view" :class="classes">
 | 
			
		||||
      <!-- 工具栏 -->
 | 
			
		||||
      <div v-if="defaultToolbar || slot.toolbar" class="layui-table-tool">
 | 
			
		||||
        <div v-if="slot.toolbar" class="layui-table-tool-temp">
 | 
			
		||||
        <div class="layui-table-tool-temp">
 | 
			
		||||
          <slot name="toolbar"></slot>
 | 
			
		||||
        </div>
 | 
			
		||||
        <div v-if="defaultToolbar" class="layui-table-tool-self">
 | 
			
		||||
 | 
			
		||||
@ -1,2 +0,0 @@
 | 
			
		||||
// @ts-ignore
 | 
			
		||||
export { v4 } from "uuid";
 | 
			
		||||
@ -1,3 +1,2 @@
 | 
			
		||||
export * from "./domUtil";
 | 
			
		||||
export * from "./guidUtil";
 | 
			
		||||
export * from "./withInstall";
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										10
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										10
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							@ -77,14 +77,12 @@ importers:
 | 
			
		||||
    specifiers:
 | 
			
		||||
      '@layui/icons-vue': ^1.0.9
 | 
			
		||||
      '@layui/layer-vue': ^1.4.2
 | 
			
		||||
      '@types/uuid': ^8.3.4
 | 
			
		||||
      '@umijs/ssr-darkreader': ^4.9.45
 | 
			
		||||
      '@vueuse/core': ^8.7.3
 | 
			
		||||
      async-validator: ^4.1.1
 | 
			
		||||
      cropperjs: ^1.5.12
 | 
			
		||||
      dayjs: ^1.11.0
 | 
			
		||||
      evtd: ^0.2.3
 | 
			
		||||
      uuid: ^8.3.2
 | 
			
		||||
      vue-i18n: ^9.1.10
 | 
			
		||||
    dependencies:
 | 
			
		||||
      '@layui/icons-vue': link:../icons
 | 
			
		||||
@ -95,10 +93,7 @@ importers:
 | 
			
		||||
      cropperjs: 1.5.12
 | 
			
		||||
      dayjs: 1.11.0
 | 
			
		||||
      evtd: 0.2.3
 | 
			
		||||
      uuid: 8.3.2
 | 
			
		||||
      vue-i18n: 9.1.10_vue@3.2.37
 | 
			
		||||
    devDependencies:
 | 
			
		||||
      '@types/uuid': 8.3.4
 | 
			
		||||
 | 
			
		||||
  package/document-component:
 | 
			
		||||
    specifiers:
 | 
			
		||||
@ -5119,11 +5114,6 @@ packages:
 | 
			
		||||
    resolution: {integrity: sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=}
 | 
			
		||||
    dev: true
 | 
			
		||||
 | 
			
		||||
  /uuid/8.3.2:
 | 
			
		||||
    resolution: {integrity: sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==}
 | 
			
		||||
    hasBin: true
 | 
			
		||||
    dev: false
 | 
			
		||||
 | 
			
		||||
  /v8-compile-cache-lib/3.0.0:
 | 
			
		||||
    resolution: {integrity: sha512-mpSYqfsFvASnSn5qMiwrr4VKfumbPyONLCOPmsR3A6pTY/r0+tSaVbgPWSAIuzbk3lCTa+FForeTiO+wBQGkjA==}
 | 
			
		||||
    dev: true
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user