// 这里设置默认初始步骤
StepContentFn('.starBox', "已申请:杨博:2020/2/3:已申请审批意见, 已立项:杨博:2020/5/5:已立项审批意见, 实施中:张三:2020/5/9:实施中意见, 等待中:杨博:2020/6/6:等待中审批意见,已完结:杨博:2020/6/6:已完结审批意见,zzz:涂磊:2023/6/6:new添加", '等待中');
如有添加,在后面 按格式 ,zzz:涂磊:2023/6/6:new添加
即可
1.添加一个UniHTMLFrame1到窗口,设置 其HTML属性为
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="initial-scale=1.0, user-scalable=no, width=device-width">
<title>jQuery动态数据流程步骤条特效</title>
</head>
<body>
<div class="starBox"></div>
<script type="text/javascript">
//步骤条控件
function StepContentFn(tag, stepContent, status) {
var descriptionValue = stepContent.indexOf(",") == -1 ? $(stepContent).val() : stepContent;
if (descriptionValue) {
var desplit = descriptionValue.split(",");
var temp = -1;
var isActiveValue = "is_finish"
var applyStatus = $(status).val() ? $(status).val() : status;
var mainStep = "<div class='control_processSteps'>";
for (let i = 0; i < desplit.length; i++) {
var desplitItem = desplit[i].split(":");
if ($.trim(desplitItem[0]) == $.trim(applyStatus)) {
temp = i;
}
mainStep += "<div class='processStep'><div class='step_head'><div class='step_line'></div><div class='step_icon_inner'>" + (i + 1) + "</div></div><div class='step_main'><div class='step_title'>" + desplitItem[0] + "</div><div class='step_description'><div>审批人:" + desplitItem[1] + "</div><div>审批时间:" + desplitItem[2] + "</div><div>审批意见:" + desplitItem[3] + "</div></div></div></div>"
}
mainStep += "</div>"
$(tag).prepend(mainStep);
for (i = 0; i < desplit.length; i++) {
if (temp >= i) {
isActiveValue = "is_finish";
$(".processStep").eq(i).find(".step_line").addClass("step_line_active");
} else if (temp == i - 1) {
isActiveValue = "is_process";
} else if (temp < i - 1) {
isActiveValue = "is_wait";
}
$(".processStep").eq(i).find(".step_head").addClass(isActiveValue);
$(".processStep").eq(i).find(".step_main>div").addClass(isActiveValue);
}
}
}
// 这里设置默认初始步骤
StepContentFn('.starBox', "已申请:杨博:2020/2/3:已申请审批意见, 已立项:杨博:2020/5/5:已立项审批意见, 实施中:张三:2020/5/9:实施中意见, 等待中:杨博:2020/6/6:等待中审批意见,已完结:杨博:2020/6/6:已完结审批意见,zzz:涂磊:2023/6/6:new添加", '等待中');
</script>
</body>
</html>
2添加CSS
在ServerModule的
@charset "utf-8";
.starBox{margin:100px auto;width:630px;}
.control_processSteps {
display: flex;
white-space: nowrap;
}
.processStep {
display: inline-block;
position: relative;
flex-shrink: 1;
flex-basis: 50%;
margin-right: 0px;
}
.step_main {
position: relative;
white-space: normal;
text-align: left;
}
/* 线条 */
.step_line {
position: absolute;
height: 4px;
top: 10px;
left: 0;
right: 0;
border-color: inherit;
background-color: #c0c4cc;
}
.processStep:last-of-type .step_line {
display: none;
}
.step_icon_inner {
position: relative;
z-index: 1;
display: inline-flex;
justify-content: center;
width: 24px;
height: 24px;
box-sizing: border-box;
border: 2px solid;
border-radius: 50%;
text-align: center;
font-weight: 700;
align-items: center;
font-size: 14px;
background: #fff;
}
.step_title {
font-size: 16px;
line-height: 38px;
cursor: pointer;
}
.step_description {
display: none;
position: absolute;
margin-top: -5px;
font-size: 12px;
line-height: 20px;
font-weight: 400;
background: #fff;
box-shadow: 0px 4px 4px #ccc;
border-radius: 5px;
padding: 10px;
z-index: 99;
}
.step_line_active {
background-color: #409eff;
}
/* 已完结状态 */
.is_finish {
color: #409eff;
border-color: #409eff;
}
.is_process {
color: #303133;
border-color: #303133;
}
.is_wait {
color: #c0c4cc;
border-color: #c0c4cc;
}
.step_main:hover .step_title+.is_finish {
display: inline-block;
}
我得到了一个包含嵌套链接的表单。编辑时链接字段为空的问题。这是我的表格:Editingkategori{:action=>'update',:id=>@konkurrancer.id})do|f|%>'Trackingurl',:style=>'width:500;'%>'Editkonkurrence'%>|我的konkurrencer模型:has_one:link我的链接模型:classLink我的konkurrancer编辑操作:defedit@konkurrancer=Konkurrancer.find(params[:id])@konkurrancer.link_attrib
我主要使用Ruby来执行此操作,但到目前为止我的攻击计划如下:使用gemsrdf、rdf-rdfa和rdf-microdata或mida来解析给定任何URI的数据。我认为最好映射到像schema.org这样的统一模式,例如使用这个yaml文件,它试图描述数据词汇表和opengraph到schema.org之间的转换:#SchemaXtoschema.orgconversion#data-vocabularyDV:name:namestreet-address:streetAddressregion:addressRegionlocality:addressLocalityphoto:i
所以我在关注Railscast,我注意到在html.erb文件中,ruby代码有一个微弱的背景高亮效果,以区别于其他代码HTML文档。我知道Ryan使用TextMate。我正在使用SublimeText3。我怎样才能达到同样的效果?谢谢! 最佳答案 为SublimeText安装ERB包。假设您安装了SublimeText包管理器*,只需点击cmd+shift+P即可获得命令菜单,然后键入installpackage并选择PackageControl:InstallPackage获取包管理器菜单。在该菜单中,键入ERB并在看到包时选择
我试图在索引页中创建一个超链接,但它没有显示,也没有给出任何错误。这是我的index.html.erb代码。ListingarticlesTitleTextssss我检查了我的路线,我认为它们也没有问题。PrefixVerbURIPatternController#Actionwelcome_indexGET/welcome/index(.:format)welcome#indexarticlesGET/articles(.:format)articles#indexPOST/articles(.:format)articles#createnew_articleGET/article
我是rails的新手,想在form字段上应用验证。myviewsnew.html.erb.....模拟.rbclassSimulation{:in=>1..25,:message=>'Therowmustbebetween1and25'}end模拟Controller.rbclassSimulationsController我想检查模型类中row字段的整数范围,如果不在范围内则返回错误信息。我可以检查上面代码的范围,但无法返回错误消息提前致谢 最佳答案 关键是您使用的是模型表单,一种显示ActiveRecord模型实例属性的表单。c
我在Rails应用程序中使用CarrierWave/Fog将视频上传到AmazonS3。有没有办法判断上传的进度,让我可以显示上传进度如何? 最佳答案 CarrierWave和Fog本身没有这种功能;你需要一个前端uploader来显示进度。当我不得不解决这个问题时,我使用了jQueryfileupload因为我的堆栈中已经有jQuery。甚至还有apostonCarrierWaveintegration因此您只需按照那里的说明操作即可获得适用于您的应用的进度条。 关于ruby-on-r
目前,Itembelongs_toCompany和has_manyItemVariants。我正在尝试使用嵌套的fields_for通过Item表单添加ItemVariant字段,但是使用:item_variants不显示该表单。只有当我使用单数时才会显示。我检查了我的关联,它们似乎是正确的,这可能与嵌套在公司下的项目有关,还是我遗漏了其他东西?提前致谢。注意:下面的代码片段中省略了不相关的代码。编辑:不知道这是否相关,但我正在使用CanCan进行身份验证。routes.rbresources:companiesdoresources:itemsenditem.rbclassItemi
如果我在模型中设置验证消息validates:name,:presence=>{:message=>'Thenamecantbeblank.'}我如何让该消息显示在闪光警报中,这是我迄今为止尝试过的方法defcreate@message=Message.new(params[:message])if@message.valid?ContactMailer.send_mail(@message).deliverredirect_to(root_path,:notice=>"Thanksforyourmessage,Iwillbeintouchsoon")elseflash[:error]
我刚刚按照thebootsygempage上的安装说明进行操作在我保存并查看帖子内容之前,一切看起来都不错。这是输出在View中的样子:HeaderSubhead:似乎没有呈现任何html格式,因为它被引号或类似的东西转义了-其他人有这个问题吗?我没有在github页面或SO上看到任何问题来指出我正确的方向。除了遵循gem安装说明之外,我还没有做任何事情,但也许我错过了什么或者只是犯了一个愚蠢的错误。如果你还有什么想知道的,请尽管问。干杯 最佳答案 你需要有这样的东西,转义html: 关
我正在写一篇关于在Ruby中几乎一切都是对象的博客文章,我试图通过以下示例来展示这一点:classCoolBeansattr_accessor:beansdefinitialize@bean=[]enddefcount_beans@beans.countendend所以从类中我们可以看出它有4个方法(当然,除非我错了):它可以在创建新实例时初始化一个默认的空bean数组它可以计算它有多少个bean它可以读取它有多少个bean(通过attr_accessor)它可以向空数组写入(或添加)更多bean(也通过attr_accessor)但是,当我询问类本身它有哪些实例方法时,我没有看到默认