mirror of
				https://github.com/pure-admin/vue-pure-admin.git
				synced 2025-11-03 13:44:47 +08:00 
			
		
		
		
	perf: 优化PureTableBar组件
				
					
				
			This commit is contained in:
		
							parent
							
								
									b0ca30f3f2
								
							
						
					
					
						commit
						c62731df5b
					
				@ -53,7 +53,7 @@
 | 
				
			|||||||
    "@logicflow/core": "^1.2.18",
 | 
					    "@logicflow/core": "^1.2.18",
 | 
				
			||||||
    "@logicflow/extension": "^1.2.19",
 | 
					    "@logicflow/extension": "^1.2.19",
 | 
				
			||||||
    "@pureadmin/descriptions": "^1.2.0",
 | 
					    "@pureadmin/descriptions": "^1.2.0",
 | 
				
			||||||
    "@pureadmin/table": "^3.0.1",
 | 
					    "@pureadmin/table": "^3.0.2",
 | 
				
			||||||
    "@pureadmin/utils": "^2.4.4",
 | 
					    "@pureadmin/utils": "^2.4.4",
 | 
				
			||||||
    "@vueuse/core": "^10.7.2",
 | 
					    "@vueuse/core": "^10.7.2",
 | 
				
			||||||
    "@vueuse/motion": "^2.0.0",
 | 
					    "@vueuse/motion": "^2.0.0",
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										8
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								pnpm-lock.yaml
									
									
									
										generated
									
									
									
								
							@ -21,8 +21,8 @@ dependencies:
 | 
				
			|||||||
    specifier: ^1.2.0
 | 
					    specifier: ^1.2.0
 | 
				
			||||||
    version: 1.2.0(element-plus@2.5.3)(typescript@5.3.3)
 | 
					    version: 1.2.0(element-plus@2.5.3)(typescript@5.3.3)
 | 
				
			||||||
  '@pureadmin/table':
 | 
					  '@pureadmin/table':
 | 
				
			||||||
    specifier: ^3.0.1
 | 
					    specifier: ^3.0.2
 | 
				
			||||||
    version: 3.0.1(element-plus@2.5.3)(typescript@5.3.3)
 | 
					    version: 3.0.2(element-plus@2.5.3)(typescript@5.3.3)
 | 
				
			||||||
  '@pureadmin/utils':
 | 
					  '@pureadmin/utils':
 | 
				
			||||||
    specifier: ^2.4.4
 | 
					    specifier: ^2.4.4
 | 
				
			||||||
    version: 2.4.4(echarts@5.4.3)(vue@3.4.14)
 | 
					    version: 2.4.4(echarts@5.4.3)(vue@3.4.14)
 | 
				
			||||||
@ -1744,8 +1744,8 @@ packages:
 | 
				
			|||||||
      - typescript
 | 
					      - typescript
 | 
				
			||||||
    dev: false
 | 
					    dev: false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /@pureadmin/table@3.0.1(element-plus@2.5.3)(typescript@5.3.3):
 | 
					  /@pureadmin/table@3.0.2(element-plus@2.5.3)(typescript@5.3.3):
 | 
				
			||||||
    resolution: {integrity: sha512-DBIv0YRZogSIEtsBPNjm6tYuImaE8ZJXwAu/gutEyaH9wATN09doKDmAisyBj+XEydfM5R9hlvhQ8SzJkbtarA==}
 | 
					    resolution: {integrity: sha512-VrtpuzKm4t2KS81MWBy2G1xayjvYIM5s3EUs91mZxmA+qLb8FdF2k4QdCufVA8ZZG85AeM2HA7Z0SvqMAwy0dA==}
 | 
				
			||||||
    peerDependencies:
 | 
					    peerDependencies:
 | 
				
			||||||
      element-plus: ^2.0.0
 | 
					      element-plus: ^2.0.0
 | 
				
			||||||
    dependencies:
 | 
					    dependencies:
 | 
				
			||||||
 | 
				
			|||||||
@ -37,7 +37,6 @@ export default defineComponent({
 | 
				
			|||||||
  props,
 | 
					  props,
 | 
				
			||||||
  emits: ["refresh"],
 | 
					  emits: ["refresh"],
 | 
				
			||||||
  setup(props, { emit, slots, attrs }) {
 | 
					  setup(props, { emit, slots, attrs }) {
 | 
				
			||||||
    const buttonRef = ref();
 | 
					 | 
				
			||||||
    const size = ref("default");
 | 
					    const size = ref("default");
 | 
				
			||||||
    const isExpandAll = ref(true);
 | 
					    const isExpandAll = ref(true);
 | 
				
			||||||
    const loading = ref(false);
 | 
					    const loading = ref(false);
 | 
				
			||||||
@ -200,11 +199,22 @@ export default defineComponent({
 | 
				
			|||||||
        : false;
 | 
					        : false;
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    const rendTippyProps = (content: string) => {
 | 
				
			||||||
 | 
					      // https://vue-tippy.netlify.app/props
 | 
				
			||||||
 | 
					      return {
 | 
				
			||||||
 | 
					        content,
 | 
				
			||||||
 | 
					        offset: [0, 18],
 | 
				
			||||||
 | 
					        duration: [300, 0],
 | 
				
			||||||
 | 
					        followCursor: true,
 | 
				
			||||||
 | 
					        hideOnClick: "toggle"
 | 
				
			||||||
 | 
					      };
 | 
				
			||||||
 | 
					    };
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    const reference = {
 | 
					    const reference = {
 | 
				
			||||||
      reference: () => (
 | 
					      reference: () => (
 | 
				
			||||||
        <SettingIcon
 | 
					        <SettingIcon
 | 
				
			||||||
          class={["w-[16px]", iconClass.value]}
 | 
					          class={["w-[16px]", iconClass.value]}
 | 
				
			||||||
          onMouseover={e => (buttonRef.value = e.currentTarget)}
 | 
					          v-tippy={rendTippyProps("列设置")}
 | 
				
			||||||
        />
 | 
					        />
 | 
				
			||||||
      )
 | 
					      )
 | 
				
			||||||
    };
 | 
					    };
 | 
				
			||||||
@ -224,38 +234,36 @@ export default defineComponent({
 | 
				
			|||||||
              ) : null}
 | 
					              ) : null}
 | 
				
			||||||
              {props.tableRef?.size ? (
 | 
					              {props.tableRef?.size ? (
 | 
				
			||||||
                <>
 | 
					                <>
 | 
				
			||||||
                  <el-tooltip
 | 
					                  <ExpandIcon
 | 
				
			||||||
                    effect="dark"
 | 
					                    class={["w-[16px]", iconClass.value]}
 | 
				
			||||||
                    content={isExpandAll.value ? "折叠" : "展开"}
 | 
					                    style={{
 | 
				
			||||||
                    placement="top"
 | 
					                      transform: isExpandAll.value ? "none" : "rotate(-90deg)"
 | 
				
			||||||
                  >
 | 
					                    }}
 | 
				
			||||||
                    <ExpandIcon
 | 
					                    v-tippy={rendTippyProps(
 | 
				
			||||||
                      class={["w-[16px]", iconClass.value]}
 | 
					                      isExpandAll.value ? "折叠" : "展开"
 | 
				
			||||||
                      style={{
 | 
					                    )}
 | 
				
			||||||
                        transform: isExpandAll.value ? "none" : "rotate(-90deg)"
 | 
					                    onClick={() => onExpand()}
 | 
				
			||||||
                      }}
 | 
					                  />
 | 
				
			||||||
                      onClick={() => onExpand()}
 | 
					 | 
				
			||||||
                    />
 | 
					 | 
				
			||||||
                  </el-tooltip>
 | 
					 | 
				
			||||||
                  <el-divider direction="vertical" />
 | 
					                  <el-divider direction="vertical" />
 | 
				
			||||||
                </>
 | 
					                </>
 | 
				
			||||||
              ) : null}
 | 
					              ) : null}
 | 
				
			||||||
              <el-tooltip effect="dark" content="刷新" placement="top">
 | 
					              <RefreshIcon
 | 
				
			||||||
                <RefreshIcon
 | 
					                class={[
 | 
				
			||||||
                  class={[
 | 
					                  "w-[16px]",
 | 
				
			||||||
                    "w-[16px]",
 | 
					                  iconClass.value,
 | 
				
			||||||
                    iconClass.value,
 | 
					                  loading.value ? "animate-spin" : ""
 | 
				
			||||||
                    loading.value ? "animate-spin" : ""
 | 
					                ]}
 | 
				
			||||||
                  ]}
 | 
					                v-tippy={rendTippyProps("刷新")}
 | 
				
			||||||
                  onClick={() => onReFresh()}
 | 
					                onClick={() => onReFresh()}
 | 
				
			||||||
                />
 | 
					              />
 | 
				
			||||||
              </el-tooltip>
 | 
					 | 
				
			||||||
              <el-divider direction="vertical" />
 | 
					              <el-divider direction="vertical" />
 | 
				
			||||||
              <el-tooltip effect="dark" content="密度" placement="top">
 | 
					              <el-dropdown
 | 
				
			||||||
                <el-dropdown v-slots={dropdown} trigger="click">
 | 
					                v-slots={dropdown}
 | 
				
			||||||
                  <CollapseIcon class={["w-[16px]", iconClass.value]} />
 | 
					                trigger="click"
 | 
				
			||||||
                </el-dropdown>
 | 
					                v-tippy={rendTippyProps("密度")}
 | 
				
			||||||
              </el-tooltip>
 | 
					              >
 | 
				
			||||||
 | 
					                <CollapseIcon class={["w-[16px]", iconClass.value]} />
 | 
				
			||||||
 | 
					              </el-dropdown>
 | 
				
			||||||
              <el-divider direction="vertical" />
 | 
					              <el-divider direction="vertical" />
 | 
				
			||||||
 | 
					
 | 
				
			||||||
              <el-popover
 | 
					              <el-popover
 | 
				
			||||||
@ -326,25 +334,6 @@ export default defineComponent({
 | 
				
			|||||||
                </div>
 | 
					                </div>
 | 
				
			||||||
              </el-popover>
 | 
					              </el-popover>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
 | 
					 | 
				
			||||||
            <el-tooltip
 | 
					 | 
				
			||||||
              popper-options={{
 | 
					 | 
				
			||||||
                modifiers: [
 | 
					 | 
				
			||||||
                  {
 | 
					 | 
				
			||||||
                    name: "computeStyles",
 | 
					 | 
				
			||||||
                    options: {
 | 
					 | 
				
			||||||
                      adaptive: false,
 | 
					 | 
				
			||||||
                      enabled: false
 | 
					 | 
				
			||||||
                    }
 | 
					 | 
				
			||||||
                  }
 | 
					 | 
				
			||||||
                ]
 | 
					 | 
				
			||||||
              }}
 | 
					 | 
				
			||||||
              placement="top"
 | 
					 | 
				
			||||||
              virtual-ref={buttonRef.value}
 | 
					 | 
				
			||||||
              virtual-triggering
 | 
					 | 
				
			||||||
              trigger="hover"
 | 
					 | 
				
			||||||
              content="列设置"
 | 
					 | 
				
			||||||
            />
 | 
					 | 
				
			||||||
          </div>
 | 
					          </div>
 | 
				
			||||||
          {slots.default({
 | 
					          {slots.default({
 | 
				
			||||||
            size: size.value,
 | 
					            size: size.value,
 | 
				
			||||||
 | 
				
			|||||||
@ -104,6 +104,7 @@ defineExpose({ getRef });
 | 
				
			|||||||
        <el-form-item label="排序">
 | 
					        <el-form-item label="排序">
 | 
				
			||||||
          <el-input-number
 | 
					          <el-input-number
 | 
				
			||||||
            v-model="newFormInline.sort"
 | 
					            v-model="newFormInline.sort"
 | 
				
			||||||
 | 
					            class="!w-full"
 | 
				
			||||||
            :min="0"
 | 
					            :min="0"
 | 
				
			||||||
            :max="9999"
 | 
					            :max="9999"
 | 
				
			||||||
            controls-position="right"
 | 
					            controls-position="right"
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user