笔记
input 被 jQuery Mobile 渲染成“伪元素”
有些主题会用 box-shadow 或 background-image 伪造输入框背景。你可以把这些也清掉:
3. 样式优先级问题
确保你的 <style> 标签在所有 CSS 文件后面,这样优先级才最高。
---
4. 浏览器缓存
有时候浏览器缓存了旧的 CSS,强制刷新(Ctrl+F5)或清理缓存再试。
请将以下样式放在页面 <style> 最后,或直接放在 <head> 最后:
input[type="text"], input[type="search"], input, select, textarea,
.ui-input-text, .ui-input-search {
background: #fff !important;
color: #333 !important;
box-shadow: none !important;
background-image: none !important;
border: 1px solid #ccc !important;
}
项目后端:
domain->mapper->mpper.mange->service->impl->controller
项目前端
<template #default="scope">
{{ scope.row.profitRatio }}%
</template>
-
工作原理: #default="scope"
el-table-column组件通过v-slot:default向父组件暴露当前行的数据- 开发者可以通过自定义
scope变量名(如 props、item等)访问这些数据 - 例如:
#default="props"后可通过props.row.profitRatio访问数据
<el-table v-loading="loading" :data="partnerList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" type="index" width="50" align="center" prop="id" />
<el-table-column label="合作商名称" align="center" prop="partnerName" />
<el-table-column label="账号" align="center" prop="account" />
<el-table-column label="分成比例" align="center" prop="profitRatio" >
<template #default="scope">
{{ scope.row.profitRatio }}%
</template>
</el-table-column>
<el-table-column label="联系人" align="center" prop="contactPerson" />
<el-table-column label="联系电话" align="center" prop="contactPhone" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" @click="getPartnerInfo(scope.row)" v-hasPermi="['manage:partner:query']">查看详情</el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['manage:partner:edit']">修改</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['manage:partner:remove']">删除</el-button>
</template>
</el-table-column>
</el-table>
-
表格数据绑定
- 使用
:data="partnerList"将el-table组件的数据源绑定到 partnerList 响应式变量 - partnerList 通过 getList 函数从 API 获取数据并赋值
- 使用
-
列数据绑定
- 每个
el-table-column使用prop属性指定对应的数据字段名:prop="partnerName"绑定合作商名称prop="account"绑定账号prop="profitRatio"绑定分成比例prop="contactPerson"绑定联系人prop="contactPhone"绑定联系电话
- 每个
function SILcheckWeight(scanSN, weightType, isElectronicScale) {
if (isWeight) {
var failCount = 0;
for (var i = 0; i < 3; i++) {
var weight = GetWeight();
if (weight === false) {
failCount++;
if (failCount === 3) {
showAreaMessge("网络延迟获取重量失败,请稍等再按回车或者检查电子秤连接!", "messageRed");
$("#txtSN").select();
return false;
}
continue;
}
// 验证重量范围
var ajax = SKT.LeanMES.Web.AjaxServices.AjaxContainerWeight.CheckSNWeight(scanSN, parseFloat(weight), stationId, resourceId, weightType, isElectronicScale);
if (ajax.error != null) {
updateCollectionList(scanSN, 'NG');
if (isByPass == 1) {
var errorMsg = ajax.error.Message;
showAreaMessge(scanSN + ':' + errorMsg, "messageRed");
ByPassWeight(scanSN, weight, errorMsg);
return false;
} else {
showAreaMessge(scanSN + ':' + ajax.error.Message, "messageRed");
}
$("#txtSN").select();
return false;
}
return true;
}
return false;
}
return true;
}
对比其他情况:
当weight === false时:执行continue → 继续下一次循环
当AJAX出错时:执行return false → 跳出循环和函数
当3次都失败时:执行return false → 跳出函数
关键结论:
只要执行到return true,函数立即结束,循环自然终止
这个设计确保了:一旦成功获取重量并通过验证,就不再尝试后续的重量获取
这是高效的"快速成功"处理方式,避免了不必要的重试
因此,在您描述的"执行一次就成功获取到重量"的场景中:
不会执行i=1和i=2的循环
函数立即返回true
后续的重量获取尝试都会被跳过
本文来自博客园,作者:舒然,转载请注明原文链接:https://www.cnblogs.com/Jeffrey1172417122/p/18924501

浙公网安备 33010602011771号