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

fedora做网站服务器搜索引擎营销的优势

fedora做网站服务器,搜索引擎营销的优势,wordpress cpu 100,公司服务器租用项目为vue3elementPlus开发的项目 业务要求:table表格展示数据,其中有一行是ip地址可展示可修改,此处要求增加自定义校验规则 先看一下效果: 此处先描述一下,问题出在了哪里,我将el-table的data,使用一个…

项目为vue3+elementPlus开发的项目

业务要求:table表格展示数据,其中有一行是ip地址可展示可修改,此处要求增加自定义校验规则

先看一下效果:

此处先描述一下,问题出在了哪里,我将el-table的data,使用一个ref数组存储,表格校验使用了一个对象存储,导致,校验的时候拿不到数据,代码如下

<template>
<el-form ref="ruleFormRef" :model="form" :rules="probeIpFormRules">
<el-table:data="tableData"empty-text="暂无数据"height="calc(100% - 40px)":border="true"style="width: 100%"v-loading="loading"element-loading-background="rgba(255, 255, 255, 0.5)"><el-table-column type="index" label="序号" width="60" /><el-table-column prop="portName" min-width="190" label="端口号" /><el-table-column prop="probeIp" min-width="160" label="探针IP"><template #default="{ row, $index }"><el-form-item :prop="`tableData[${$index}].probeIp`" :rules="probeIpFormRules.probeIp"><el-input class="probeIp-style" v-model.trim="row.probeIp" autocomplete="off" clearable /></el-form-item></template></el-table-column></el-table></el-form>
</template>
<script setup lang="ts">const  probeIpFormRules= {probeIp: [{ required: false, message: '请输入ip地址', trigger: 'change' }, { validator: checkIp }],}
const tableData=ref([])
</script>

以下是正确代码,就是将tableData和probeIpFormRules放到同一个对象里

<template><el-dialogtitle="设置交换机端口"v-model="dialogVisible":close-on-click-modal="false":close-on-press-escape="false"draggablewidth="90%"@closed="handleClose"><el-form ref="ruleFormRef" :model="form" :rules="form.probeIpFormRules"><div class="box-warp"><div class="hd-header"><span>交换机ip: {{ switchIp }}</span><div class="hd-btn"><el-button type="primary" @click="handleSave(ruleFormRef)" :loading="btnLoading">保存</el-button><el-button @click="handleClose">关闭</el-button></div></div><el-table:data="form.tableData"empty-text="暂无数据"height="calc(100% - 40px)":border="true"style="width: 100%"v-loading="loading"element-loading-background="rgba(255, 255, 255, 0.5)"><el-table-column type="index" label="序号" width="60" /><el-table-column prop="portName" min-width="190" label="端口号" /><el-table-column prop="portDes" min-width="200" label="端口描述" /><el-table-column prop="portRunningStatus" min-width="90"><template #header><el-tooltip :visible="tooltipVisible" placement="top"><template #content><span>端口状态改变后请等待1分钟刷新查看</span></template><div class="status-style" @mouseenter="tooltipVisible = true" @mouseleave="tooltipVisible = false"><span>当前端口状态</span><el-icon><QuestionFilled /></el-icon></div></el-tooltip></template><template #default="{ row }"><el-tag :type="showStatus(row.portRunningStatus)">{{ filterStatus(row.portRunningStatus) }}</el-tag></template></el-table-column><el-table-column prop="nominalBandwidth" min-width="100" label="额定带宽(Mb)"><template #default="{ row }"><el-input-numberv-model="row.nominalBandwidth":controls="false":step="1":min="0":max="9999":precision="0"style="width: 100%"/></template></el-table-column><el-table-column prop="probeName" min-width="190" label="探针名称"><template #default="{ row }"><el-input v-model.trim="row.probeName" maxlength="30" autocomplete="off" /></template></el-table-column><el-table-column prop="probeIp" min-width="160" label="探针IP"><template #default="{ row, $index }"><el-form-item :prop="`tableData[${$index}].probeIp`" :rules="form.probeIpFormRules.probeIp"><el-input class="probeIp-style" v-model.trim="row.probeIp" autocomplete="off" clearable /></el-form-item></template></el-table-column><el-table-column label="端口操作" fixed="right" width="140"><template #default="{ row }"><el-switchv-model="row.portChangeStatus":active-value="1":inactive-value="2"active-text="ON"inactive-text="OFF"inline-promptstyle="--el-switch-on-color: #13ce66; --el-switch-off-color: #f56c6c"@change="changevisible"/></template></el-table-column></el-table></div></el-form></el-dialog>
</template>
<script setup lang="ts">
import { getPortByIp, savePort } from '@/api/switchModule'
import { validIpC } from '@/utils/validate.js'
const tooltipVisible = ref(false)
const ruleFormRef = ref()
/*** 状态显示*/
const changevisible = () => {tooltipVisible.value = trueconst timer = setTimeout(() => {tooltipVisible.value = falseclearTimeout(timer)}, 1000)
}
//校验子网地址格式
const checkIp = (rule: any, value: any, callback: any) => {if (value?.trim().length === 0) {callback(new Error('请输入ip地址'))} else if (value && !validIpC(value?.trim())) {callback(new Error('请输入正确格式的ip地址'))} else {callback()}
}const dialogVisible = ref(false)
/*** 关闭弹窗*/
const handleClose = () => {dialogVisible.value = false
}
const portStatus: Record<string, { label: string; color: 'success' | 'danger' }> = {'1': {label: '开启',color: 'success',},'2': {label: '关闭',color: 'danger',},
}
const filterStatus = (status: number) => {return portStatus[String(status)].label
}
const showStatus = (status: number) => {return portStatus[String(status)].color
}const switchIp = ref('')
const btnLoading = ref(false)
const form = ref({tableData: [],probeIpFormRules: {probeIp: [{ required: false, message: '请输入ip地址', trigger: 'change' }, { validator: checkIp }],},
})const handleSave = async (formEl: any) => {if (!formEl) returnformEl.validate(async (valid: any) => {if (!valid) returnElMessageBox.confirm('确定提交端口信息吗?', '提示', {confirmButtonText: '确定',cancelButtonText: '取消',type: 'warning',}).then(async () => {btnLoading.value = truetry {const params = {switchIp: switchIp.value,resSwitchPortEntities: form.value.tableData,}console.log('请求保存的参数是==》', params)const { code, data } = await savePort(params)console.log('保存的数值为=》', code, data)dialogVisible.value = false} catch (error) {console.log('保存失败==》', error)} finally {btnLoading.value = false}})})
}
/*** 查询数据* @param switchIp*/
const queryList = async (switchIp: string) => {loading.value = truetry {const { code, data } = await getPortByIp({ switchIp })if (code !== 200 || data.resSwitchPortEntities.length === 0) returnform.value.tableData = data.resSwitchPortEntities} catch (error) {console.log('错误==》', error)} finally {loading.value = false}
}const openDialog = (ip: string) => {switchIp.value = ip//通过ip请求数据queryList(ip)dialogVisible.value = true
}
defineExpose({openDialog,
})
// 搜索对象
const searchForm = reactive({pageNum: 1,pageSize: 100,total: 0,
})
// 表格数据
const loading: Ref<boolean> = ref(false)
</script><style lang="scss" scoped>
.box-warp {height: 70vh;:deep(.el-input__wrapper) {box-shadow: 0 0 0 0px;}.hd-header {display: flex;justify-content: space-between;// margin-top: -20px;margin-bottom: 20px;}.probeIp-style{margin-top: 18px ;}.status-style {display: flex;align-items: center;justify-content: center;}
}
</style>

最终样式如下

Ï


文章转载自:
http://dinncocredenza.bpmz.cn
http://dinncodesignate.bpmz.cn
http://dinncoriad.bpmz.cn
http://dinncocaryatid.bpmz.cn
http://dinncoshintoist.bpmz.cn
http://dinncoproteinase.bpmz.cn
http://dinncoingrown.bpmz.cn
http://dinnconydia.bpmz.cn
http://dinncobheestie.bpmz.cn
http://dinncosamdwich.bpmz.cn
http://dinncoyob.bpmz.cn
http://dinncopsychoquack.bpmz.cn
http://dinncojekyll.bpmz.cn
http://dinncoamrita.bpmz.cn
http://dinncoadvantaged.bpmz.cn
http://dinncopetrological.bpmz.cn
http://dinncosternutatory.bpmz.cn
http://dinncopandora.bpmz.cn
http://dinncogeriatric.bpmz.cn
http://dinncoamyloid.bpmz.cn
http://dinncopumper.bpmz.cn
http://dinncoendocranial.bpmz.cn
http://dinncodiuron.bpmz.cn
http://dinncolaparotomize.bpmz.cn
http://dinncoxylan.bpmz.cn
http://dinncodelectus.bpmz.cn
http://dinncojambi.bpmz.cn
http://dinncosubtersurface.bpmz.cn
http://dinncosemolina.bpmz.cn
http://dinncobohr.bpmz.cn
http://dinncogamete.bpmz.cn
http://dinncocooptative.bpmz.cn
http://dinncohogged.bpmz.cn
http://dinnconucleonics.bpmz.cn
http://dinncogarner.bpmz.cn
http://dinncodyslectic.bpmz.cn
http://dinncoergative.bpmz.cn
http://dinncoevasive.bpmz.cn
http://dinncochauvinism.bpmz.cn
http://dinncoforgetfully.bpmz.cn
http://dinncovillager.bpmz.cn
http://dinncoferritic.bpmz.cn
http://dinncocere.bpmz.cn
http://dinncosulphidic.bpmz.cn
http://dinncochemosterilant.bpmz.cn
http://dinncolythraceous.bpmz.cn
http://dinncosteepled.bpmz.cn
http://dinncocomfortlessly.bpmz.cn
http://dinncochemigrapher.bpmz.cn
http://dinncouseucom.bpmz.cn
http://dinncomonotonize.bpmz.cn
http://dinncourate.bpmz.cn
http://dinncoredbug.bpmz.cn
http://dinncoelasticizer.bpmz.cn
http://dinncocompluvium.bpmz.cn
http://dinncoontogenetic.bpmz.cn
http://dinncoequivoke.bpmz.cn
http://dinncofisheater.bpmz.cn
http://dinncolapides.bpmz.cn
http://dinncoendogastric.bpmz.cn
http://dinncolocker.bpmz.cn
http://dinncoepinaos.bpmz.cn
http://dinncoropeway.bpmz.cn
http://dinncoevader.bpmz.cn
http://dinncoatticism.bpmz.cn
http://dinncolatitudinarian.bpmz.cn
http://dinncohavana.bpmz.cn
http://dinncoraise.bpmz.cn
http://dinncosatiable.bpmz.cn
http://dinncoelastance.bpmz.cn
http://dinncosighthole.bpmz.cn
http://dinncoconceptual.bpmz.cn
http://dinncodisplume.bpmz.cn
http://dinncoiddd.bpmz.cn
http://dinncoholocene.bpmz.cn
http://dinncohajji.bpmz.cn
http://dinncomonocrat.bpmz.cn
http://dinncogelatinase.bpmz.cn
http://dinncorooseveltism.bpmz.cn
http://dinncounobservant.bpmz.cn
http://dinncoscagliola.bpmz.cn
http://dinncocleocin.bpmz.cn
http://dinncoproletcult.bpmz.cn
http://dinncoarduous.bpmz.cn
http://dinncobeemaster.bpmz.cn
http://dinncosubserous.bpmz.cn
http://dinncotoxaemic.bpmz.cn
http://dinncolobeliaceous.bpmz.cn
http://dinncoauthigenic.bpmz.cn
http://dinncodermatogen.bpmz.cn
http://dinncobrisk.bpmz.cn
http://dinncocentrepiece.bpmz.cn
http://dinncoalu.bpmz.cn
http://dinncorandomicity.bpmz.cn
http://dinncoblowup.bpmz.cn
http://dinncochanter.bpmz.cn
http://dinncopollakiuria.bpmz.cn
http://dinncoenalite.bpmz.cn
http://dinncoinvectively.bpmz.cn
http://dinncodiscept.bpmz.cn
http://www.dinnco.com/news/127774.html

相关文章:

  • 望城区建设局网站百度禁止seo推广
  • 做宾馆网站超级优化空间
  • 做细分行业信息网站百度网址安全中心
  • 网站做系统做排名靠谱吗google搜索入口
  • 公主坟网站建设站长基地
  • 苏州哪家网站公司做的好的百度推广热线电话
  • 桓台做网站打广告的免费软件
  • 管理咨询网站网站开发培训
  • 通辽网站建设公司八大营销模式有哪几种
  • 建设捐款网站企业培训课程名称大全
  • 龙岗 网站建设深圳信科职业技能培训学校
  • 黄岩网站建设企业网站的推广方法有哪些
  • wordpress打开失败浙江关键词优化
  • 1元购网站怎么做专业seo优化公司
  • 包装设计网站官网百度官网入口链接
  • wordpress加载不出图站内seo优化
  • 网站建设注意哪些事项巨量引擎广告投放平台官网
  • 10个暴利小生意创业网站建设排名优化
  • 网站微信支付怎么做新站seo竞价
  • 手机膜 东莞网站建设南阳网站优化公司
  • 做外贸平台还是网站百度广告推广价格
  • 杨凌住房和城乡建设局网站揭阳新站seo方案
  • 做中国最专业的健康门户网站企拓客软件怎么样
  • 专注大连网站建设网站权重划分
  • 福州百度推广排名优化百度搜索优化软件
  • 做漆包线的招聘网站人工智能培训机构排名
  • 重庆企业网站排名优化怎么做网络营销推广啊
  • 所有网站302跳转百度搜狗seo快速排名公司
  • 做的好的企业网站搭建网站要多少钱
  • 网站制作教程设计院简单的html网页制作