confirm

弹框

☆樱花仙子☆ 提交于 2019-12-06 16:43:00
<!DOCTYPE html> <head> <meta charset="utf-8"> <title>js confirm弹出框自定义样式</title> <style> html,body { margin: 0; padding: 0; font-family: "Microsoft YaHei"; } .wrap-dialog { position: fixed; top: 0; left: 0; width: 100%; height: 100%; font-size: 16px; text-align: center; background-color: rgba(0, 0, 0, .4); z-index: 999; } .dialog { position: relative; margin: 15% auto; width: 300px; background-color: #FFFFFF; } .dialog .dialog-header { height: 20px; padding: 10px; background-color: lightskyblue; } .dialog .dialog-body { height: 30px; padding: 20px; } .dialog .dialog-footer { padding: 8px;

在 Vue 中使用 装饰器 Decorator

孤者浪人 提交于 2019-12-06 12:43:02
Decorator 的语法还没有通过提案,所以项目中很少用。不过最近刚好有一个需求用到了。 装饰器的语法 http://es6.ruanyifeng.com/#docs/decorator 需求是,有很多操作都需要二次确认,因为用到的是 element ui 组件,所以就需要在每个函数中都加一个确认操作。 deleteFile(data) { this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', { type: 'warning' }).then(() => { // 删除文件操作 }).catch(() => {}); } 每个函数都加一遍。。感觉有点冗余。。于是想到了使用注释器将 confirm 提出去。 import { MessageBox } from 'element-ui'; function confirmation(target, name, descriptor) { let oldValue = descriptor.value; descriptor.value = function(...args) { MessageBox.confirm('此操作将永久删除该文件, 是否继续?', '提示') .then(oldValue.bind(this, ...args)) .catch(() => {}); }; return

Primefaces p:confirmDialog inside tabView

心不动则不痛 提交于 2019-12-06 12:37:21
I now have problem with using confirmDialog inside tabView. Here is my confirmDialog <p:confirmDialog global="true" showEffect="fade" hideEffect="explode"> <h:form> <p:commandButton value="Yes" type="button" styleClass="ui-confirmdialog-yes" icon="ui-icon-check" /> <p:commandButton value="No" type="button" styleClass="ui-confirmdialog-no" icon="ui-icon-close" /> </h:form> </p:confirmDialog> In the 1st tabView, I have a button with confirmation <p:commandButton value="Import" icon="ui-icon-arrowrefresh-1-w" update=":form:growl"> <p:confirm header="Confirmation" message="Are you sure?" /> </p

rabbitmq原理介绍(转载)

巧了我就是萌 提交于 2019-12-06 09:31:44
从AMQP协议可以看出,MessageQueue、Exchange和Binding构成了AMQP协议的核心,下面我们就围绕这三个主要组件 从应用使用的角度全面的介绍如何利用Rabbit MQ构建消息队列以及使用过程中的注意事项。 1. 声明MessageQueue 在Rabbit MQ中,无论是生产者发送消息还是消费者接受消息,都首先需要声明一个MessageQueue。这就存在一个问题,是生产者声明还是消费者声明呢?要解决这个问题,首先需要明确: a)消费者是无法订阅或者获取不存在的MessageQueue中信息。 b)消息被Exchange接受以后,如果没有匹配的Queue,则会被丢弃。 在明白了上述两点以后,就容易理解如果是消费者去声明Queue,就有可能会出现在声明Queue之前,生产者已发送的消息被丢弃的隐患。如果应用能够通过消息重发的机制允许消息丢失,则使用此方案没有任何问题。但是如果不能接受该方案,这就需要无论是生产者还是消费者,在发送或者接受消息前,都需要去尝试建立消息队列。这里有一点需要明确,如果客户端尝试建立一个已经存在的消息队列,Rabbit MQ不会做任何事情,并返回客户端建立成功的。 如果一个消费者在一个信道中正在监听某一个队列的消息,Rabbit MQ是不允许该消费者在同一个channel去声明其他队列的。Rabbit MQ中,可以通过queue

js学习之BOM

雨燕双飞 提交于 2019-12-06 04:50:22
1. 浏览器的原理 1.1 浏览器的多线程 (1) 解析js引擎线程 (2) UI渲染线程 (3) 事件发起线程 (4) 发起请求的线程 (5) 定时器的线程 1.2 同步异步 (1) 前面事情的干完才能干后面的事情,例如吃完饭才能喝水。 (2) 前面的事情可以不干完,就干后面的事情,然后后面的事情干一半,可以回到前面的事情接着干,例如吃一口饭,喝一口水,然后再吃饭,再喝水。 1.3 浏览器执行JS的过程    第一阶段 载入阶段 默认:同步 (1) 获取html的内容进行解析 (2) 生成DOM树,将html文件转化为html的结构树(DOM树)放到浏览器执行的内存环境中。 DOM树: html head meta title script body (3) 从html---> head---> meta---> title----> script(把js文件从服务器下载到浏览器本地来,下载完成后开始使用js解释器,进行解析,解析完成后进行执行,执行完成后)---> body (4) 解析完成 (5) 渲染:下载图片,下载图标 (6) 载入阶段结束    第二阶段 事件阶段 默认:异步 onload (1) js中访问DOM树: 通过document对象进行访问 var n = document.getElementById("div1") <!DOCTYPE html>

Why do JS modal message boxes pause countdown on setTimeout()?

核能气质少年 提交于 2019-12-06 02:39:21
问题 I have encountered an unexpected behavior of JS setTimeout when modal dialog windows like alert are open and I would like to know the reason behind it. I expected setTimeout(fn,10000) to mean "check current time periodically and when it is greater than Now + 10000ms fire the event handler that will invoke the passed 'fn' function". This would be logical, seeing how we pass the timeout measure as 'ms from now'. But, apparently, the countdown on setTimeout is a literal countdown and will be

ASP.NET c# Fix for the OK event of a custom ConfirmMessagebox inside a function library

浪尽此生 提交于 2019-12-06 00:27:56
问题 We made a function that shows a modalpopupmessage dynamically from c# through javascript, it works fine but we wanted to add a parameter so we can pass a function delegate (or event handler) that would be called if the user presses the OK button. Any suggestions? Postdata: We don't want the typical "confirm you want to press this button" solution but a function to ask confirmation in any part of the process if necessary. Example: User click on delete item button, in codebehind you check the

Fastreport.net绑定参数 数据打印

风流意气都作罢 提交于 2019-12-05 23:36:25
一、引入Fastreport.dll 此处忽略 二、创建report.frx文件 如果需要的可以加入公众号“办公好技巧”,找我要个文件。 三、绑定数据 1.设置变量参数,例如:subject 2.创建数据源 添加sql语句 编辑语句: SELECT D.train_info_id, D.train_edition, D.train_subject, D.train_user, D.train_data, D.train_address, D.train_class_hour, D.train_scope, D.train_content, D.train_count, D.train_inputuser, D.train_part_fuzeren, D.train_kaohe_type, D.train_result, D.train_confirm_user, D.trainner_confirm_date, D.username, D.partname, D.confirm_tag, D.train_list_id FROM dbo."View_userlist_train_info" D where D.train_subject= @subject ; 后面subject就是刚才设置的参数,保持一致哦。 绑定参数来源 完成 来源: https://my.oschina

分布式事务之解决方案(TCC)

久未见 提交于 2019-12-05 17:59:46
4. 分布式事务解决方案之TCC 4.1. 什么是TCC事务 TCC是Try、Confirm、Cancel三个词语的缩写,TCC要求每个分支事务实现三个操作 :预处理Try、确认Confirm、撤销Cancel。Try操作做业务检查及资源预留,Confirm做业务确认操作,Cancel实现一个与Try相反的操作既回滚操作。TM首先发起所有的分支事务的try操作,任何一个分支事务的try操作执行失败,TM将会发起所有分支事务的Cancel操作,若try操作全部成功,TM将会发起所有分支事务的Confirm操作,其中Confirm/Cancel操作若执行失败,TM会进行重试。 分支事务失败的情况 : TCC分为三个阶段 : Try阶段是做业务检查(一致性)及资源预留(隔离),此阶段仅是一个初步操作,它和后续的Confirm一起才能真正构成一个完整的业务逻辑。 Confirm阶段是做确认提交,Try阶段所有分支事务执行成功后开始执行Confirm。通常情况下,采用TCC则认为Confirm阶段是不会出错的。即 :只要Try成功,Confirm一定成功。若Confirm阶段真的出错了,需引入重试机制或人工处理。 Cancel阶段是在业务执行错误需要回滚的状态下执行分支事务的业务取消,预留资源释放。通常情况下,采用TCC则认为Cancel阶段也是一定成功的。若Cancel阶段真的出错了

CakePHP Javascript Confirm dialog Form Submission cancel not working

雨燕双飞 提交于 2019-12-05 17:41:00
With my CakePHP's registration form, once clicking Submit button, I simply want to display Javascript Confirm dialog box, which should work like: If pressed Ok, should submit the form If pressed Cancel, should not go for submit action But here, when i press Cancel, though it gets submitted. Don't know why? CakePHP Form Code: <?php echo $form->create('Noncompetitor', array('type' => 'file', 'url' => '/register', 'onSubmit' => 'confirmfrmSubmit();'));?> My JS Code: function confirmfrmSubmit(){ var agree=confirm("Are you sure you wish to continue?"); if (agree) return true ; else return false ; }