当前位置: 首页 > news >正文

工作需求ElementUi组件的使用

加油,新时代打工人!

组件源码

<template><div @mouseenter="mousein = true" @mouseleave="mousein = false"><el-input type="text" clearable autocomplete="off" v-model="searchDoc.originName"  placeholder="请选择" size="small" :style="style"@focus="handleShowDatatable(true)" @blur="handleShowDatatable(false)" @input="getList" /><div ref="tableContainer" :style="tableStyle" v-show="showDatatable" ><el-table:data="tableData"borderstyle="width: 100%"@row-click="handleRowClick"><el-table-columnprop="originCode"label="产地编码"width="180"></el-table-column><el-table-columnprop="originName"label="产地名称"width="180"></el-table-column><el-table-columnprop="zjm"label="助记码"width="70"></el-table-column></el-table><div class="paginationclass"><paginationv-show="total > 0":total="total":page.sync="pagination.pageIndex":limit.sync="pagination.pageSize"@pagination="getList"/></div></div></div></template><script>
import{  getMnufacturerList
} from "@/api/manufacturer/manufacturer.js"export default {name: 'MyFacturerName',props: {value: {type: Object},width: {type: [Number, String]},index:{type: [Number, String]},},data(){return {loading: false,searchDoc: {originName: '',id: 0},mousein: false,showDatatable: false,tableStyle: {'position':'absolute','background-color':'#FFFFFF','z-index':10,'max-height':'200px','overflow-y':'auto',},pagination: {pageIndex: 1,pageSize: 10,},queryParams: {originName: "",},total: 0,tableData: [],selectRow: null,}},methods: {getList() {getMnufacturerList({...this.pagination,...this.queryParams,originName:this.searchDoc.originName}).then((res) => {this.tableData = res.data.list;this.total = res.data.total;}).catch((err) => {this.$Message.error('请求产地信息时异常: ', err)}).finally(() => {this.loading = false});},handleRowClick(item){this.searchDoc = {originCode: item.originCode,originName:item.originName,zjm:item.zjm,providerName:item.providerName}let data={index:this.index,searchDoc:this.searchDoc}this.$emit('sendname',data.searchDoc.providerName)this.closeDatatable()},handleShowDatatable(isShow){if(!this.mousein && !isShow){this.showDatatable = false}else{this.showDatatable = trueif(this.tableData.length == 0){this.getList()}}},closeDatatable(){this.showDatatable = false}},computed: {style(){let style = {width: '180px'}if(this.width){style.width = `${this.width}px`}return style}},watch: {searchDoc: function(val){if(!val.originName){this.searchDoc.id = 0}this.$emit('input', this.searchDoc)}},mounted(){}}
</script>
<style scoped>
.paginationclass {margin-left: 40%;margin-top: 20px;margin-bottom: 20px;
}
</style>

导入

import MyFacturerName from "@/components/MyFacturerMedid/My-Facturer-medid.vue";

使用

<MyFacturerName @sendzjm="setfaceturerName" :index1="scope.$index">
</MyFacturerName>

相关文章:

  • Docker 从0安装 nacos集群
  • 国际品牌交期长 雷卯来帮忙
  • ElasticSearch首次启动忘记密码,更改密码(Windows 10)
  • flutter->Scaffold左侧/右侧侧边栏和UserAccountsDrawerHeader的使用
  • pytorch升级打怪(八)
  • 使用 Dify 和 AWS Bedrock 玩转 Anthropic Claude 3
  • 鸿蒙ArkTS实战开发-Native XComponent组件的使用
  • 机器学习 - 准备数据
  • 总结: HQL语句
  • 软考 系统架构设计师系列知识点之系统性能(1)
  • Hive自定义GenericUDF函数
  • 【AI生成文章】flutter ChangeNotifierProvider 实用场景举例
  • RIP,EIGRP,OSPF的区别
  • 医学预测变量筛选的几种方法(R语言版)
  • 2024年阿里云2核4G服务器价格30元、165元和199元1年
  • 自己简单写的 事件订阅机制
  • 【comparator, comparable】小总结
  • 【RocksDB】TransactionDB源码分析
  • 4月23日世界读书日 网络营销论坛推荐《正在爆发的营销革命》
  • Apache Pulsar 2.1 重磅发布
  • ES10 特性的完整指南
  • Hexo+码云+git快速搭建免费的静态Blog
  • leetcode378. Kth Smallest Element in a Sorted Matrix
  • LeetCode刷题——29. Divide Two Integers(Part 1靠自己)
  • mockjs让前端开发独立于后端
  • SAP云平台运行环境Cloud Foundry和Neo的区别
  • Service Worker
  • Vue.js-Day01
  • Vue--数据传输
  • 从 Android Sample ApiDemos 中学习 android.animation API 的用法
  • 技术:超级实用的电脑小技巧
  • 聚类分析——Kmeans
  • 目录与文件属性:编写ls
  • 使用iElevator.js模拟segmentfault的文章标题导航
  • 学习笔记DL002:AI、机器学习、表示学习、深度学习,第一次大衰退
  • 源码安装memcached和php memcache扩展
  • 说说我为什么看好Spring Cloud Alibaba
  • ​LeetCode解法汇总1410. HTML 实体解析器
  • #我与Java虚拟机的故事#连载15:完整阅读的第一本技术书籍
  • (10)ATF MMU转换表
  • (Arcgis)Python编程批量将HDF5文件转换为TIFF格式并应用地理转换和投影信息
  • (转) Android中ViewStub组件使用
  • (转)Android中使用ormlite实现持久化(一)--HelloOrmLite
  • (转)C语言家族扩展收藏 (转)C语言家族扩展
  • (转)德国人的记事本
  • (自适应手机端)响应式新闻博客知识类pbootcms网站模板 自媒体运营博客网站源码下载
  • .NET 使用配置文件
  • .NET/C# 避免调试器不小心提前计算本应延迟计算的值
  • .NET与 java通用的3DES加密解密方法
  • @data注解_SpringBoot 使用WebSocket打造在线聊天室(基于注解)
  • @FeignClient 调用另一个服务的test环境,实际上却调用了另一个环境testone的接口,这其中牵扯到k8s容器外容器内的问题,注册到eureka上的是容器外的旧版本...
  • @取消转义
  • [ActionScript][AS3]小小笔记
  • [c]扫雷
  • [Contiki系列论文之2]WSN的自适应通信架构