9a9176e0d/js/model/sys/resourceinfo">resourceinfo
/
index.js

index.js 9.8KB

    /** * Created by TT on 2017/8/9. */ ; spa_define(function () { return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) { return { main: function () { var root = spa.findInMain(".sys_resourceinfo_index"); var pdg = pdgf.build(root); pdg.code.shell("showDay", function (env) { if (env.cd && env.cd[this.k]) { var day = env.cd[this.k]; return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日 " + day.substring(8, 10) + ":" + day.substring(10, 12); } return ""; }); pdg.code.listen($.dict.doTransfer); pdg.code.listen(function(){ root.find(".hand-contacts").each(function () { var $e = $(this); var resourceId = $e.attr("resourceId"); util.get("../ajax/resource/pro", {id: resourceId}, function (data) { var proName = []; data.forEach(function (item) { util.get("../ajax/sys/professor/getName/" + item.professorId, null, function (data) { // proName = proName + data; proName.push(data); $e.text(proName); }) }); }); $e.removeClass("hand-contacts"); }); root.find(".hand-collectionid").each(function() { var $e = $(this); var collectionid = $e.attr("collectionid"); util.get("/ajax/content/countProfessor",{id:collectionid,type:2},function(data){ $e.text(data); },{}); $e.removeClass("hand-collectionid"); }); root.find(".table-opt a.name").on("click",function () { var resourceId = $(this).parent().attr("resourceId"); window.open('http://www.ekexiu.com/resourceShow.html?resourceId=' + resourceId); }) }); root.find(".opt-query").on("click", function () { pdg.load(); }); pdg.load(); root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function () { var $this = $(this); $this.toggleClass("checked"); if ($this.hasClass("checked")) { root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked"); } else { root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked"); } }); root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function () { var $this = $(this); $this.toggleClass("checked"); }); root.find(".opt-del").on("click", function() { var $resource = root.find("td.opt-check>i.checked"); if ($resource.length) { var ret = []; $resource.each(function() { ret.push($(this).attr("resourceId")); }); util.boxMsg({ title: "确认删除", content: "您是否要删除选中的资源?", btns: [{ caption: "删除", hand: function () { util.post("../ajax/resource/deleteResource", {resourceIds:ret}, function () { pdg.reload() }, {}); } }, {caption: "取消"} ] }); } else { util.alert("请选择一个资源"); } }); root.find(".opt-sort-num").on("click", function() { var $resource = root.find("td.opt-check>i.checked"); if($resource.length) { if($resource.length > 1) { util.alert("只能选择一个资源"); } else { $.util.get("../ajax/resource/id/"+$resource.attr("resourceId"),null,function(rd){ if(rd){ spa.showModal("sys_resourceinfo_sort", { data:rd, hand: function() { pdg.reload() } }) }else{ util.alertMsg("资源不存在", function(){pdg.reload();}); } },{}); } } else { util.alert("请选择一个资源"); } }); root.find(".opt-subject").on("click", function() { var $resource = root.find("td.opt-check>i.checked"); if($resource.length) { if($resource.length > 1) { util.alert("只能选择一个资源"); } else { $.util.get("../ajax/resource/id/"+$resource.attr("resourceId"),null,function(rd){ if(rd){ spa.showModal("sys_resourceinfo_subject", { data:rd, hand: function() { pdg.reload() } }) }else{ util.alertMsg("资源不存在", function(){pdg.reload();}); } },{}); } } else { util.alert("请选择一个资源"); } }); root.find(".opt-view").on("click", function () { var $resource = root.find("td.opt-check>i.checked"); if ($resource.length) { if ($resource.length > 1) { util.alert("只能选择一个资源"); } else { window.open('http://www.ekexiu.com/resourceShow.html?resourceId=' + $resource.attr("resourceId")); } } else { util.alert("请选择一个资源"); } }); root.find(".opt-edit").on("click", function() { var $resource = root.find("td.opt-check>i.checked"); if($resource.length) { if($resource.length > 1) { util.alert("只能选择一个资源"); } else { // $.util.get("../ajax/article/id/"+$resource.attr("articleId"),null,function(rd){ // if(rd){ // window.open('http://www.ekexiu.com:81/html/model/resourceinfo/resourceIssue.html?resourceId=' + $resource.attr("resourceId")); window.open('http://'+window.location.host+'/html/model/sys/resourceinfo/resourceIssue.html?resourceId=' + $resource.attr("resourceId")); // }else{ // util.alertMsg("文章不存在", function(){pdg.reload();}); // } // },{}); } } else { util.alert("请选择一个资源"); } }); root.find(".opt-contacts").on("click", function() { var $resource = root.find("td.opt-check>i.checked"); if ($resource.length) { var ret = {ids:[],orgIds:[],category:[]}; $resource.each(function() { ret.ids.push($(this).attr("resourceId")); ret.orgIds.push($(this).attr("owner")); ret.category.push($(this).attr("category")); }); var nary=ret.orgIds.sort(); var narc=ret.category; for(var j=0;j<ret.category.length;j++){ if (narc[j]!="2"){ util.alert("列表中有非企业发布的资源"); return; } } if(ret.orgIds.length>1) { for (var i = 0; i < ret.orgIds.length-1; i++) { if (nary[i] != nary[i + 1]) { util.alert("列表中的企业不一致"); return; } } } spa.showModal("sys_resourceinfo_contacts", { data: {orgId:ret.orgIds[0],ids:ret.ids}, hand: function () { pdg.reload() } }); } else { util.alert("请选择一个资源"); } }); }, mainDestory: function () { } }; }); });
suryee - Gogs: Go Git Service

赛亿官网

Confirmation.php 1.7KB

    <?php // +---------------------------------------------------------------------- // | ThinkPHP [ WE CAN DO IT JUST THINK ] // +---------------------------------------------------------------------- // | Copyright (c) 2006~2015 http://thinkphp.cn All rights reserved. // +---------------------------------------------------------------------- // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 ) // +---------------------------------------------------------------------- // | Author: yunwuxin <448901948@qq.com> // +---------------------------------------------------------------------- namespace think\console\output\question; use think\console\output\Question; class Confirmation extends Question { private $trueAnswerRegex; /** * 构造方法 * @param string $question 问题 * @param bool $default 默认答案 * @param string $trueAnswerRegex 验证正则 */ public function __construct($question, $default = true, $trueAnswerRegex = '/^y/i') { parent::__construct($question, (bool) $default); $this->trueAnswerRegex = $trueAnswerRegex; $this->setNormalizer($this->getDefaultNormalizer()); } /** * 获取默认的答案回调 * @return callable */ private function getDefaultNormalizer() { $default = $this->getDefault(); $regex = $this->trueAnswerRegex; return function ($answer) use ($default, $regex) { if (is_bool($answer)) { return $answer; } $answerIsTrue = (bool) preg_match($regex, $answer); if (false === $default) { return $answer && $answerIsTrue; } return !$answer || $answerIsTrue; }; } }
console-front - Gogs: Go Git Service

暂无描述

index.js 7.5KB

    /** * Created by TT on 2017/8/9. */ ; spa_define(function () { return $.use(["spa", "pagedatagrid", "util"], function (spa, pdgf, util) { return { main: function () { var root = spa.findInMain(".sys_paper_index"); var pdg = pdgf.build(root); pdg.code.shell("showDay", function (env) { if (env.cd && env.cd[this.k]) { var day = env.cd[this.k]; return day.substring(0, 4) + "年" + day.substring(4, 6) + "月" + day.substring(6, 8) + "日 " + day.substring(8, 10) + ":" + day.substring(10, 12); } return ""; }); pdg.code.listen($.dict.doTransfer); pdg.code.listen(function(){ root.find(".hand-paperid").each(function() { var $e = $(this); var paperid = $e.attr("paperid"); if (paperid) { util.get("http://www.ekexiu.com/ajax/leavemsg/count", {sid: paperid,stype:2}, function (data) { $e.text(data); }, {}); $e.removeClass("hand-paperid"); } }); root.find(".hand-collectionid").each(function() { var $e = $(this); var collectionid = $e.attr("collectionid"); util.get("/ajax/content/countProfessor",{id:collectionid,type:4},function(data){ $e.text(data); },{}); $e.removeClass("hand-collectionid"); }); root.find(".hand-agreeid").each(function() { var $e = $(this); var agreeid = $e.attr("agreeid"); util.get("/ajax/paper/agreeCount",{id:agreeid},function(data){ $e.text(data); },{}); $e.removeClass("hand-agreeid"); }); root.find(".table-opt a.name").on("click",function () { // var paperId = $(this).parent().attr("paperId"); var time = $(this).parent().attr("createTime").substring(0,8); var shareId = $(this).parent().attr("shareId"); // window.open('http://www.ekexiu.com/paperShow.html?paperId=' + paperId); window.open('http://www.ekexiu.com/shtml/pp/'+time+'/' + shareId+'.html'); }) }); root.find(".opt-query").on("click", function () { pdg.load(); }); pdg.load(); root.find(".dt-tpl").on("click", "th.opt-check>i.icon-st-check", function () { var $this = $(this); $this.toggleClass("checked"); if ($this.hasClass("checked")) { root.find(".dt-tpl td.opt-check>i.icon-st-check").addClass("checked"); } else { root.find(".dt-tpl td.opt-check>i.icon-st-check").removeClass("checked"); } }); root.find(".dt-tpl").on("click", "td.opt-check>i.icon-st-check", function () { var $this = $(this); $this.toggleClass("checked"); }); // root.find(".opt-del").on("click", function() { // var $org = root.find("td.opt-check>i.checked"); // if($org.length) { // var ret = []; // $org.each(function() { // ret.push($(this).attr("articleId")); // }); // util.boxMsg({ // title: "确认删除", // content: "您是否要删除选中的文章?", // btns: [{ // caption: "删除", // hand: function () { // util.post("../ajax/paper/deleteArticle", {articleIds: ret}, function () { // pdg.reload() // }, {}); // } // }, // {caption: "取消"} // ] // }); // } else { // util.alert("请选择一个用户"); // } // }); root.find(".opt-sort-num").on("click", function() { var $paper = root.find("td.opt-check>i.checked"); if($paper.length) { if($paper.length > 1) { util.alert("只能选择一篇资源"); } else { $.util.get("../ajax/paper/id/"+$paper.attr("paperId"),null,function(rd){ if(rd){ spa.showModal("sys_paper_sort", { data:rd, hand: function() { pdg.reload() } }) }else{ util.alertMsg("资源不存在", function(){pdg.reload();}); } },{}); } } else { util.alert("请选择一篇资源"); } }); root.find(".opt-keyword").on("click", function() { var $paper = root.find("td.opt-check>i.checked"); if($paper.length) { if($paper.length > 1) { util.alert("只能选择一篇资源"); } else { $.util.get("../ajax/paper/id/"+$paper.attr("paperId"),null,function(rd){ if(rd){ spa.showModal("sys_paper_keyword", { data:rd, hand: function() { pdg.reload() } }) }else{ util.alertMsg("资源不存在", function(){pdg.reload();}); } },{}); } } else { util.alert("请选择一篇资源"); } }); root.find(".opt-view").on("click", function () { var $paper = root.find("td.opt-check>i.checked"); if ($paper.length) { if ($paper.length > 1) { util.alert("只能选择一篇资源"); } else { var time = $paper.attr("createTime").substring(0,8); var shareId = $paper.attr("shareId"); // window.open('http://www.ekexiu.com/paperShow.html?paperId=' + $paper.attr("paperId")); window.open('http://www.ekexiu.com/shtml/pp/'+time+'/' + shareId+'.html'); } } else { util.alert("请选择一篇资源"); } }); }, mainDestory: function () { } }; }); });