当前位置: 首页 > 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>
http://www.lryc.cn/news/323861.html

相关文章:

  • 自动驾驶轨迹规划之时空语义走廊(一)
  • [环境配置].ssh文件夹权限修改方法
  • LeetCode刷题【树状数组、并查集、二叉树】
  • 使用POI以OLE对象的形式向excel中插入附件(pdf为例)
  • Unity构建详解(2)——SBP的初始设置和脚本编译
  • Matlab使用教程(持续更新)
  • 管理能力学习笔记一:角色转身
  • Redis面试题 概要
  • 原型,模板,策略,适配器模式
  • Ollama 在本地快速启动并执行LLM【大语言模型】
  • ubuntu : 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系。
  • 瑞芯微RK3576|触觉智能:开启科技新篇章
  • Visual Studio 2013 - 清理
  • 1、初识JVM
  • JavaScript 权威指南第七版(GPT 重译)(七)
  • 从零开始搭建游戏服务器 第四节 MongoDB引入并实现注册登录
  • 【Unity】宏定义Scripting Define Symbols
  • 算法 之 排序算法
  • Prism:打造WPF项目的MVVM之选,简化开发流程、提高可维护性
  • Springboot+vue的四川美食分享网站+数据库+报告+免费远程调试
  • 温湿度项目V1.0——原理图设计
  • H5 与 App、网页之间的通信
  • 亚马逊云科技:企业如何开启生成式AI之旅?
  • AMPQ和rabbitMQ
  • 在存在代理的主机上,为docker容器配置代理
  • 备考ICA----Istio实验4---使用 Istio 进行金丝雀部署
  • LeetCode-热题100:39.组合总和
  • 演讲嘉宾公布 | 智能家居与会议系统专题论坛将于3月28日举办
  • Unity发布webgl之后打开PDF文件,不使用js,不和浏览器交互
  • Python之装饰器-无参装饰器