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

有名的网站开发工具泰安招聘信息最新招聘2023

有名的网站开发工具,泰安招聘信息最新招聘2023,网站的标签怎么修改,西安app开发文章目录 前言一、新增table组件二、使用步骤 前言 在 基于element-plus定义表单配置化 基础上#xff0c;封装个Element-plus的table表格 由于表格不同于form组件#xff0c;需自定义校验器#xff0c;以下组件配置了单个校验#xff0c;及提交统一校验方法#xff0c;且… 文章目录 前言一、新增table组件二、使用步骤 前言 在 基于element-plus定义表单配置化 基础上封装个Element-plus的table表格 由于表格不同于form组件需自定义校验器以下组件配置了单个校验及提交统一校验方法且自定义必填校验*显示和校验错误部分边框标红等实际可根据业务及不同场景优化改造相关定义 后期抽空新增表格行及删除行等功能, 一、新增table组件 table-configuration/index.vue templateel-tableborderreftableRef:show-headershowHeader:datatableDatastylewidth: 100%tooltip-effect:max-heighttablemaxHeightel-table-column typeselection :fixedselectionFixed width55 v-ifhasSelection/template v-for(item, index) in tableProperty :keyitemel-table-column:alignalign:sortableitem.sortable:min-widthitem.width:show-overflow-tooltipshowOverflowTooltip:labelitem.labeltemplate #headerdiv :class[getTableHeader(item.property.rules)] v-htmlitem.label/div/templatetemplate #defaultscopecomponent :class[scope.$index 0 getIsErrorClass(scope.$index, index)]v-model:contentscope.row[item.field]v-modelscope.row[item.field]:property{...item.property, name: item.field}:isitem.typefieldBlur(val) blur(val, item, scope.$index, index)fieldChange(val) change(val, item, scope.$index, index) //template/el-table-column/template/el-table /template script langts src./index.ts/ style langless .is-error .el-select-v2__wrapper,.is-error .el-select-v2__wrapper:focus,.is-error .el-textarea__inner,.is-error .el-textarea__inner:focus {box-shadow: 0 0 0 1px var(--el-color-danger) inset }.is-error .el-input__wrapper {box-shadow: 0 0 0 1px var(--el-color-danger) inset } .table {_header:before {content: *;color: var(--el-color-danger);margin-right: 4px;} } /styletable-configuration/index.ts import { tableHooks } from /composables/table-hooks; import { computed, defineComponent, reactive, ref } from vue; import Input from /components/form-configuration/input.vue; import Select from /components/form-configuration/select.vue; import Vhtml from /components/form-configuration/v-html.vue; import Upload from /components/form-configuration/upload.vue; import Switch from /components/form-configuration/switch.vue; import Radio from /components/form-configuration/radio.vue; import Checkbox from /components/form-configuration/checkbox.vue; import Date from /components/form-configuration/date.vue; import Cascader from /components/form-configuration/cascader.vue; import { isArray } from lodash-es; import { ElMessage } from element-plus; import type { rulesType } from /interface;const ruleType {required: false,message: ,trigger: ,validator: (val: any) {return val} } const fieldProperty {label: demo,type: Input,field: demo,width: 120px,err: ,property: {maxlength: 200,rules: [ruleType]} } export default defineComponent({components: {Input,Select,Vhtml,Upload,Switch,Radio,Checkbox,Date,Cascader,},props: {align: {type: String,default: left, // left / center / right},showHeader: {type: Boolean,default: true,},selectionFixed: {type: Boolean,default: false,},showOverflowTooltip: {type: Boolean,default: true,},hasSelection: {type: Boolean,default: false,},property: {type: Object,default() {return [ fieldProperty ];},},data: {type: Object,default() {return {};},},},setup(props, { emit }) {const { tablemaxHeight } tableHooks();const tableRef ref()const tableData computed({get() {return props.data;},set(val) {emit(update:data, val);},});const noType noTypeconst tableProperty computed(() props.property);const blur (val: any, item: typeof fieldProperty, rowIndex: number, colIndex: number) {let arr: Arrayboolean []if (item.property.rules isArray(item.property.rules)) {arr validateForField(item, val, blur, rowIndex, colIndex)}if (!arr.length) {emit(blur, {val, field: item.field, rowIndex, colIndex}) // 触发clearIsError(rowIndex, colIndex)}}const change (val: any, item: typeof fieldProperty, rowIndex: number, colIndex: number) {let arr: Arrayboolean []if (item.property.rules isArray(item.property.rules)) {arr validateForField(item, val, change, rowIndex, colIndex)}if (!arr.length) {emit(change, {val, field: item.field, rowIndex, colIndex}) // 触发clearIsError(rowIndex, colIndex)}}const isError ref{rowIndex: number, colIndex: number}[]([])const validateForField (item: typeof fieldProperty, val: any, type: string, rowIndex: number, colIndex: number) {let arr: Arrayboolean []item.property.rules.forEach((valid) {const types [valid.trigger, noType]if (valid.required !val) {ElMessage.error(valid.message)arr.push(false)isError.value.push({rowIndex, colIndex,})return}if (!valid.required !val || !types.includes(type)) returnif (!valid.validator) returnconst bool valid.validator(val)if (!bool) {ElMessage.error(valid.message)arr.push(bool)isError.value.push({rowIndex, colIndex,})}})return arr}const clearIsError (rowIndex: number, colIndex: number) {if (rowIndex -1) {isError.value []} else {isError.value isError.value.filter((item) {return !((item.rowIndex rowIndex) (item.colIndex colIndex))})}}const validate () {let arr: Arrayboolean []clearIsError(-1, -1)tableData.value.forEach((data: object, rowIndex: number) {tableProperty.value.forEach((tabPro: any, colIndex: number) {if (!tabPro.property.rules) returnconst field tabPro.field as keyof typeof dataarr.push(...validateForField(tabPro, data[field], noType, rowIndex, colIndex))});});return !arr.length}const getIsErrorClass computed(() {return (rowIndex: number, colIndex: number) {let bool falseisError.value.forEach((error) {(error.rowIndex rowIndex) (error.colIndex colIndex) (bool true)})return bool ? is-error : }})const getTableHeader (rules: rulesType[]) {if (!rules) return return !!rules.filter((item) item.required).length ? table_header : }return {tableRef,tablemaxHeight,tableProperty,tableData,isError,getIsErrorClass,getTableHeader,change,blur,validate};}, }); 二、使用步骤 TableConfigurationrefsupplierListRefv-model:datasupplierListEntity.product:hasSelectiontrue:selectionFixedtrue:propertytablePropertyaligncenter/import { defineComponent, reactive, ref } from vue import TableConfiguration from /components/table-configuration/index.vue export default defineComponent({components: {TableConfiguration},setup() {const tableRef ref()const tableProperty reactive([{ label: Input01, type: Input, field: Input01, property: {maxlength: 500,rules: [{ required: false, message: error, trigger: blur, validator: (value: string) {return /^\?[1-9][0-9]*$/.test(value)}}]}},{ label: Input02, type: Input, field: Input02, width: 200px, property: {maxlength: 500,rules: [{ required: true, message: error, trigger: blur }]}}])const tableEntity reactive({table: [{Input01: ,Input02: ,}]})const validate () {tableRef.value.validate()}return {tableRef,tableProperty,tableEntity,validate}}, })
http://www.hkea.cn/news/14328968/

相关文章:

  • 查一下红之易道学做的什么网站网络活动策划方案
  • 美色商城 网站建设网站优化外包公司
  • 网站推广人员怎么算业绩基于html5的旅游网站的设计
  • php网站访问很慢鲜花网络营销推广方案
  • 企业网站的基本内容有哪些如何做微信商城网站建设
  • 怎样做网站文件验证wordpress请提供一个地址才能继续
  • 临沂网站制作费用上虞市住房和城乡建设局网站
  • 徐州发布网站房产网站建设哪家好
  • 网站模板编号wordpress企业手机主题
  • 黑帽seo怎么做网站排名2022适合小学生的简短新闻
  • 网站改版建设官方黄金网站软件app大全下载
  • 为什么要给大夫做网站金融网站建设方法
  • 建筑工程信息网站wordpress 增量备份
  • 仓山区建设局招标网站广州市官方网站
  • 温州做网站的企业中国去中心化搜索引擎
  • 利用第三方做网站永久发布地址科技画
  • 网站后台更换首页图片wordpress 3.1.3
  • 网站优化时间网站建设与维护里面的个人简历
  • 网站建设业务好做吗金蝶软件官网下载
  • 简单网站制作wordpress 时光网主题
  • 手机移动网络屏蔽的网站科技网站开发
  • 做网站一般用什么字体asp网站表格代码
  • 怎样更换动易2006网站模板门户网站建设和内容保障工作
  • 网站开发费如何入账seo任务优化网站排名
  • 贵州省建设厅网站公众一体化平台网站前置审核申请报告
  • 某网站搜索引擎优化企业展示厅设计效果图
  • 中小网站公司做的推广怎么样南京斯点企业网站建设
  • 书店网站怎么做营销网络建设体系
  • 做网站工作辛苦吗怎么在自己的电脑上做网站
  • 百度给做的网站如何登陆网站后台免费发布广告的平台