npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pluve/lego-search-vue

v1.3.0

Published

乐高系列之 search 组件

Downloads

7

Readme

@pluve/lego-search-vue

乐高系列之 search 组件

npm (scoped)

基于 ant-design-vue 组件进行,运营平台[email protected]的交互要求封装的查询条件组件,建议配合 @pluve/use-antd-table-vue 使用。

@pluve/use-antd-table-vue 已经投入了我们的生产环境中使用,经受住了来自真实业务的考验,并伴随着我们的业务需求不断完善。

特性

  • 基于 ant-design-vue和运营平台[email protected]的交互要求进行二次封装
  • 支持响应式换行,大屏展示4列,小屏展示3列
  • 支持输入组件自动委托enter事件
  • 支持溢出部分收起展开

默认配置

| 属性 | 默认值 | 描述 | | --- | --- | --- | | searchDisable | false | 是否禁用查询按钮 | | gutter | 20 | 表格大小 | | v-model:open | false | 是否启用收起/展开功能 |

方法

| 名称 | 描述 | | --- | --- | | submit | 注入 submit方法 | | reset | 注入 reset 方法 |

表单校验

1.支持继承antdV form 的所有API 2.组件实例下的form属性绑定了form组件实例 通过searchRef.value.form来调用form的方法

安装

# 使用 npm
npm i @pluve/lego-search-vue

# 使用 yarn
yarn add @pluve/lego-search-vue

使用

<template>
    <legoSearch ref="searchRef" :model="state.formData"   v-model:open="state.open" @submit="getPlanPage" @reset="resetPlanParams">
      <a-form-item label="适用门店" name="storeCode" :rules="[
        {required:true,message:'必填'}
      ]">
          <a-input allowClear v-model:value.trim="state.formData.storeCode" placeholder="请输入门店编码"></a-input>
        </a-form-item>
        <a-form-item label="方案名称">
          <a-input allowClear v-model:value.trim="state.formData.schemeName" placeholder="请输入方案名称"></a-input>
        </a-form-item>
        <a-form-item label="方案编码">
          <a-input allowClear v-model:value.trim="state.formData.id" placeholder="请输入方案编码"></a-input>
        </a-form-item>
        <a-form-item label="企划名称">
          <a-input allowClear v-model:value.trim="state.formData.planName" placeholder="请输入企划名称"></a-input>
        </a-form-item>
        <a-form-item label="企划编码">
          <a-input allowClear v-model:value.trim="state.formData.planId" placeholder="请输入企划编码"></a-input>
        </a-form-item>
        <a-form-item label="促销时间">
          <a-select v-model:value="state.formData.saleCondition" placeholder="请选择销售条件" allowClear>
            <a-select-option :value="1">单品</a-select-option>
            <a-select-option :value="2">组合</a-select-option>
            <a-select-option :value="3">整单</a-select-option>
            <a-select-option :value="4">品类</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item label="销售条件">
          <a-select v-model:value="state.formData.saleCondition" placeholder="请选择销售条件" allowClear>
            <a-select-option :value="1">单品</a-select-option>
            <a-select-option :value="2">组合</a-select-option>
            <a-select-option :value="3">整单</a-select-option>
            <a-select-option :value="4">品类</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item v-if="state.open" label="优惠内容" allowClear>
          <a-select allowClear v-model:value="state.formData.contentType" placeholder="请选择优惠内容">
            <a-select-option :value="1">单品</a-select-option>
            <a-select-option :value="2">组合</a-select-option>
            <a-select-option :value="3">整单</a-select-option>
            <a-select-option :value="4">品类</a-select-option>
          </a-select>
        </a-form-item>
        <a-form-item v-if="state.open" label="创建人">
          <a-input allowClear v-model:value.trim="state.formData.creator" placeholder="请输入创建人姓名或工号"></a-input>
        </a-form-item>
        <a-form-item v-if="state.open" label="审核人">
          <a-input allowClear v-model:value.trim="state.formData.reviewedBy" placeholder="请输入审核人姓名或工号"></a-input>
        </a-form-item>
    </legoSearch>
</template>

<script setup lang="ts">
import { message } from "ant-design-vue";
import { reactive,ref } from "vue";

const searchRef = ref();

const state = reactive<{
    formData:any,
    open: boolean
}>({
    formData:{},
    open: false
})

const getPlanPage = ()=>{
  searchRef.value.form.validateFields().then((values:any)=>{
    message.success("操作成功!");
    console.log(values)
  })
}

const resetPlanParams = ()=>{
    state.formData = {};
}
</script>

Keywords

lego lego-search lego-search-vue