123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230 |
- window.onload = function () {
- Backs_Name();
- U.UF.DL.asynLoadJs({ type: "text/javascript", src: "/js/Controls/PC/U.MD.UI.Calendar.js" });
- U.UF.DL.asynLoadCss({ "href": "/css/Controls/PC/U.MD.UI.Calendar.css", type: "text/css", rel: "stylesheet" });
- U.selectEl(".backs_scoretwo")[0].click()
- }
- //查找项目名称
- Backs_Name = function () {
- // var div = $$("div", { "className": "backs_right"} , U.selectEl(".backs")[0]);
- var r = U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeName"]));
- for (var i = 0; i < r.value.length; i++) {
- var two = $$("div", { "className": "backs_scoretwo", "innerHTML": r.value[i].ProjectName, "id": r.value[i].ProjectID }, U.selectEl(".backs_left")[0]);
- var update = $$("img", { "onerror": U.MD.C.imgError, "className": "update", "src": "../img/reply/update.png" }, U.selectEl(".backs_scoretwo")[i]);
- var dustbin = $$("img", { "onerror": U.MD.C.imgError, "className": "dustbin", "src": "../img/reply/dustbin.png" }, U.selectEl(".backs_scoretwo")[i]);
- U.selectEl(".update")[i].onclick = function () {
- Backs_UpdateType();
- }
- U.selectEl(".dustbin")[i].onclick = function () {
- Backs_DeleteType();
- }
- U.selectEl(".backs_left>div")[i].onclick = function () {
- Backs(this.id, 0);
- for (var i = 0; i < r.value.length; i++) {
- U.selectEl(".backs_left>div")[i].className = 'backs_scoretwo';
- U.selectEl(".backs_left>div")[i].style.backgroundColor = '';
- }
- this.className = 'backs_score';
- this.style.backgroundColor = '#013F67';
- }
- }
- var two = $$("div", { "className": "backs_scoretwo", "innerHTML": "+ 添加项目", "onclick": "Backs_InsertType()", "style": { "margin-top": "120px"} }, U.selectEl(".backs_left")[0]);
- U.selectEl(".backs_scoretwo")[0].className = 'backs_scoretwo backs_score';
-
- }
- //创建导航栏组件
- Creat_Navigation = function () {
- var ul = $$("ul", { "className": "backs_ul dhl" }, U.selectEl(".backs_right")[0]);
- var li = $$("li", { "className": "backs_li xh", "innerHTML": "序号" }, ul);
- var li = $$("li", { "className": "backs_li yh", "innerHTML": "用户" }, ul);
- var li = $$("li", { "className": "backs_content con", "innerHTML": "评论内容" }, ul);
- var li = $$("li", { "className": "backs_li ly", "innerHTML": "来源" }, ul);
- var li = $$("li", { "className": "backs_li sj", "innerHTML": "时间" }, ul);
- var li = $$("li", { "className": "backs_content", "innerHTML": "操作" }, ul);
- }
- //创建数据列表组件
- Todo = function (i, data) {
-
- var ul = $$("ul", { "className": "backs_ul" }, U.selectEl(".backs_right")[0]);
- var li = $$("li", { "className": "backs_li xh", "innerHTML": i + 1 }, ul);
- var li = $$("li", { "className": "backs_li yh", "innerHTML": data[i].UserName }, ul);
- var li = $$("li", { "className": "backs_content con", "innerHTML": data[i].ReplyContent }, ul);
- var li = $$("li", { "className": "backs_li ly", "innerHTML": "云盘" }, ul);
- var li = $$("li", { "className": "backs_li sj", "innerHTML": data[i].ReplyAddTime }, ul);
- var a = $$("li", { "className": "backs_content" }, ul);
- var b = $$("div", { "className": "backs_pass", "innerHTML": "查看" }, a);
- // var c = $$("div", { "className": "backs_span", "innerHTML": "|" }, a);
- var ReplyExamine = $$("div", { "className": "backs_pass", "id": data[i].ReplyID, "innerHTML": "通过", "onclick": "ReplyExamine(this)" }, a);
- if (data[i].ReplyExamine == 0) {
- ReplyExamine.style.backgroundColor = "#217EC4!important";
- ReplyExamine.style.color = "#fff";
- ReplyExamine.innerHTML = "通过";
- } else {
- ReplyExamine.style.backgroundColor = "#cccccc";
- ReplyExamine.style.color = "rgba(0, 93, 152, 1)";
- ReplyExamine.innerHTML = "未通过";
- }
- // var c = $$("div", { "className": "backs_span", "innerHTML": "|" }, a);
- var b = $$("div", { "className": "backs_pass", "innerHTML": "删除" }, a);
- }
- //动态创建数据
- Backs = function (Tid, isfetch) {
- U.selectEl(".backs_right")[0].innerHTML = '';
- if (isfetch == 0) {
- Creat_Navigation();
- }
- var STRE = U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeReplyEnable", Tid])).value[0];
- /*var TypeID = U.selectEl(".backs_score")[0].id;*/
- if (STRE.ProjectReplyEnable == "0") {
- U.selectEl(".ellipse")[0].style.backgroundColor = "#D7D7D7";
- U.selectEl(".circle")[0].style.left = "5px";
- } else {
- U.selectEl(".ellipse")[0].style.backgroundColor = "rgba(0, 93, 152, 1)";
- U.selectEl(".circle")[0].style.left = "27px";
- }
- // var div = $$("div", { "className": "backs_right"} , U.selectEl(".backs")[0]); U.selectEl(".backs_score")[0].id
- var b = U.selectEl(".backs_selet")[0].value
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectAllType", Tid, "aa29cab0-691d-4235-8d30-7afada8a3672", "1", ""]), function (r) {
- var data = r.value;
- if (data.length == 0) {
- var ul = $$("div", { "innerHTML": "暂无数据!" }, U.selectEl(".backs_right")[0]);
- ul.style.cssText = 'text-align: center;font-size: 31px;'
- retrun;
- }
- for (var i = 0; i < r.value.length; i++) {
- Todo(i,data);
- }
- });
- }
- //添加弹窗
- Backs_InsertType = function () {
- new U.UF.UI.form("添加项目", $$("div", { "id": "DetailInfo_box", "style": { "padding": "20px"} }), { "class": "box", "style": { "width": "300px", "height": "200px", "position": "aboulute", "top": "10%", "left": "45%"} });
- $$("div", { "id": "Reply2", "innerHTML": "项目名:", "style": { "float": "left", "line-height": "38px"} }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "id": "backs_p", "contenteditable": "true" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "class": "backs_ok", "innerHTML": "确定", "onclick": "Backs_InsertTypeID()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "class": "backs_ok", "innerHTML": "取消", "onclick":"Backs_none()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- }
- //修改弹窗
- Backs_UpdateType = function () {
- new U.UF.UI.form("修改项目", $$("div", { "id": "DetailInfo_box", "style": { "padding": "20px"} }), { "class": "box", "style": { "width": "300px", "height": "200px", "position": "aboulute", "top": "10%", "left": "45%"} });
- $$("div", { "id": "Reply2", "innerHTML": "项目名:", "style": { "float": "left", "line-height": "38px"} }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "id": "backs_p", "contenteditable": "true" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "class": "backs_ok", "innerHTML": "确定" ,"onclick":"Backs_UpdateTypeID()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "class": "backs_ok", "innerHTML": "取消", "onclick":"Backs_none()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- }
- //删除项目
- Backs_DeleteType = function () {
- new U.UF.UI.form("修改项目", $$("div", { "id": "DetailInfo_box", "style": { "padding": "20px"} }), { "class": "box", "style": { "width": "300px", "height": "200px", "position": "aboulute", "top": "10%", "left": "45%"} });
- $$("div", { "id": "Reply2", "innerHTML": "确定要删除该项目吗", "style": { "margin-left":"38px", "line-height": "38px"} }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "class": "backs_ok", "innerHTML": "确定" ,"onclick":"Backs_DeleteTypeID()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- $$("div", { "class": "backs_ok", "innerHTML": "取消", "onclick":"Backs_none()" }, U.selectEl("#DetailInfo_box")[0]); //创建内容盒子
- }
- //删除项目数据
- Backs_DeleteTypeID = function () {
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Delete_Type", U.selectEl(".backs_score")[0].id]), function (r) {
- });
- U.selectEl(".box")[0].remove();
- }
- //修改项目数据
- Backs_UpdateTypeID = function () {
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Update_TName", U.selectEl("#backs_p")[0].innerText, U.selectEl(".backs_score")[0].id]), function (r) {
- r.value == '1' ? U.Alert('修改项目成功') : U.Alert('修改项目失败')
- });
- U.selectEl(".backs_score")[0].innerHTML = U.selectEl("#backs_p")[0].innerHTML;
- U.selectEl(".box")[0].remove();
- }
- //插入项目数据
- Backs_InsertTypeID = function () {
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Insert_Type", Guid.newGuid(), U.selectEl("#backs_p")[0].innerText, 0]), function (r) {
- r.value == '1' ? U.Alert('添加项目成功') : U.Alert('添加项目失败')
- });
- U.selectEl(".box")[0].remove();
- }
- Backs_none = function (){
- // U.selectEl(".box")[0].style.display = 'none';
- U.selectEl(".box")[0].remove();
- }
- //搜索框查询
- Backs_Select = function () {
- var b = U.selectEl(".backs_selet")[0].value
- U.selectEl(".backs_right")[0].innerHTML = '';
- Creat_Navigation();
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectLike", '%' + b + '%']), function (r) {
- var data = r.value
- if (data.length == 0) {
- var ul = $$("div", { "innerHTML": "暂无数据!" }, U.selectEl(".backs_right")[0]);
- ul.style.cssText = 'text-align: center;font-size: 31px;'
- retrun;
- }
- for (var i = 0; i < r.value.length; i++) {
- Todo(i, data);
- }
- });
- }
- //查询两周时间段
- Backs_SelectSeven = function (num) {
- var b = U.selectEl(".backs_selet")[0].value
- U.selectEl(".backs_right")[0].innerHTML = '';
- Creat_Navigation();
- // var b = $$("div", { "className": "backs_pass","innerHTML":"查看" }, a);
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Select_Seven", num]), function (r) {
- var data = r.value
- if (data.length == 0) {
- var ul = $$("div", { "innerHTML": "暂无数据!" }, U.selectEl(".backs_right")[0]);
- ul.style.cssText='text-align: center;font-size: 31px;'
- retrun;
- }
- for (var i = 0; i < r.value.length; i++) {
- Todo(i, data);
- }
- });
- }
- $(".backs_input")[0].onclick = function () {
- U.MD.UI.Calendar(this);
- }
- $(".backs_input")[1].onclick = function () {
- U.MD.UI.Calendar(this);
- }
- $("#backs_input")[0].onclick = function () {
- var b = U.selectEl(".backs_selet")[0].value
- U.selectEl(".backs_right")[0].innerHTML = '';
- Creat_Navigation();
- // var b = $$("div", { "className": "backs_pass","innerHTML":"查看" }, a);
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Select_Rpdata", U.selectEl(".backs_input")[0].value, U.selectEl(".backs_input")[1].value]), function (r) {
- var data = r.value
- for (var i = 0; i < r.value.length; i++) {
- Todo(i, data);
- }
- });
- }
- ReplyExamine = function (el) {
- if(el.innerHTML == "通过"){
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_ReplyExamine", 1 , el.id]), function (r) {
- el.style.backgroundColor = "#cccccc";
- el.style.color = "rgba(0, 93, 152, 1)";
- el.innerHTML = "未通过";
- });
- }else{
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_ReplyExamine", 0 , el.id]), function (r) {
- el.style.backgroundColor = "#217EC4";
- el.style.color = "#fff";
- el.innerHTML = "通过";
- });
- }
- }
- TypeReplyEnable = function (r) {
- var TypeID = U.selectEl(".backs_score")[0].id;
- var STRE = U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_SelectTypeReplyEnable", TypeID])).value[0];
- if (STRE.TypeReplyEnable == 0) {
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_TypeReplyEnable", 1, TypeID]), function (r) {
- U.selectEl(".ellipse")[0].style.backgroundColor = "rgba(0, 93, 152, 1)";
- U.selectEl(".circle")[0].style.left = "27px";
- });
- } else {
- U.A.Request("http://cd.1473.cn/php", (["db.1473.cn", "UseStudio_Reply", "Reply_TypeReplyEnable", 0, TypeID]), function (r) {
- U.selectEl(".ellipse")[0].style.backgroundColor = "#D7D7D7";
- U.selectEl(".circle")[0].style.left = "5px";
- });
- }
- }
|