|
@@ -1,206 +1,200 @@
|
|
|
Namespace.register("Couple");//注册命名空间
|
|
Namespace.register("Couple");//注册命名空间
|
|
|
Couple.Bind=function () {
|
|
Couple.Bind=function () {
|
|
|
- var userName=$(".userName")[0]//获取用户名
|
|
|
|
|
- var ul = $(".asideMenu ul")[0];//获取项目列表ul
|
|
|
|
|
- var informationtSet = $(".informationtSet")[0];
|
|
|
|
|
- var informationtInfo = $(".informationtInfo")[0];//获取反馈信息
|
|
|
|
|
- var informationtTime = $(".informationtTime")[0];//获取反馈时间
|
|
|
|
|
- var informationtPermissions = $(".informationtPermissions")[0];//获取成员管理
|
|
|
|
|
- var informationtAddUser = $(".informationtAddUser")[0];
|
|
|
|
|
- var AddUserMembers = $(".AddUserMembers")[0];
|
|
|
|
|
- var NoPowerMembers = $(".NoPowerMembers")[0];
|
|
|
|
|
- var informationtcreateItem = $(".informationtcreateItem")[0]//创建项目按钮
|
|
|
|
|
- // userName.innerText = document.URL.split('?')[1].split("=")[1];
|
|
|
|
|
- userName.innerText = U.UF.Cookie.get("usestudiosso","username")[0];
|
|
|
|
|
-
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn", "UseStudio_FeedBack", "GetProductByUserId",U.UF.Cookie.get("usestudiosso","userid")[0]],function (r){//获取项目列表
|
|
|
|
|
|
|
+ Couple.userName.innerText = U.UF.Cookie.get("usestudiosso","username")[0];//登陆者名称
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db, Couple.SqlName, "GetProductByUserId",Couple.UserId],function (r){//获取项目列表
|
|
|
if(r.value){
|
|
if(r.value){
|
|
|
for(var i=0;i<r.value.length;i++){
|
|
for(var i=0;i<r.value.length;i++){
|
|
|
var li=$$("li", {
|
|
var li=$$("li", {
|
|
|
"className": "asideItem","productId":r.value[i].ProductId
|
|
"className": "asideItem","productId":r.value[i].ProductId
|
|
|
- }, ul);
|
|
|
|
|
- var a=$$("a", {}, li);
|
|
|
|
|
-
|
|
|
|
|
|
|
+ }, Couple.ul);
|
|
|
var span=$$("span", {
|
|
var span=$$("span", {
|
|
|
"className": "asideItemText","innerText":r.value[i].ProductName
|
|
"className": "asideItemText","innerText":r.value[i].ProductName
|
|
|
- }, a);
|
|
|
|
|
- ul.onclick = function(ev) {//点击项目列表
|
|
|
|
|
|
|
+ }, li);
|
|
|
|
|
+ Couple.ul.onclick = function(ev) {//点击项目列表
|
|
|
ev = ev || event;
|
|
ev = ev || event;
|
|
|
var target = ev.target || ev.srcElement;
|
|
var target = ev.target || ev.srcElement;
|
|
|
var icon=$$("i", {"className": "active",});
|
|
var icon=$$("i", {"className": "active",});
|
|
|
- for(var i=0;i<ul.children.length;i++){
|
|
|
|
|
- if(ul.children[i].children[0].children.length>=2){
|
|
|
|
|
- ul.children[i].setAttribute("class","asideItem");
|
|
|
|
|
- ul.children[i].children[0].removeChild(ul.children[i].children[0].children[1])
|
|
|
|
|
|
|
+ for(var i=0;i<Couple.ul.children.length;i++){
|
|
|
|
|
+ if(Couple.ul.children[i].children.length>=2){
|
|
|
|
|
+ Couple.ul.children[i].setAttribute("class","asideItem");
|
|
|
|
|
+ Couple.ul.children[i].removeChild(Couple.ul.children[i].children[1])
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ Couple.logoTitle.innerHTML = "反馈后台信息管理"+":"+target.innerText;
|
|
|
if( target.tagName=="LI"){
|
|
if( target.tagName=="LI"){
|
|
|
- target.children[0].appendChild(icon);
|
|
|
|
|
|
|
+ target.appendChild(icon);
|
|
|
target.setAttribute("class","asideItembg asideItem");
|
|
target.setAttribute("class","asideItembg asideItem");
|
|
|
}else{
|
|
}else{
|
|
|
target.parentNode.appendChild(icon);
|
|
target.parentNode.appendChild(icon);
|
|
|
- target.parentNode.parentNode.setAttribute("class","asideItembg asideItem");
|
|
|
|
|
|
|
+ target.parentNode.setAttribute("class","asideItembg asideItem");
|
|
|
}
|
|
}
|
|
|
- var productId = target.parentNode.parentElement.productId;
|
|
|
|
|
- if(informationtTime.firstChild==null){
|
|
|
|
|
- Couple.createInfo(productId)
|
|
|
|
|
- }else{
|
|
|
|
|
- informationtTime.removeChild(informationtTime.firstChild)
|
|
|
|
|
- Couple.createInfo(productId)
|
|
|
|
|
|
|
+ var productId = target.parentNode.productId;
|
|
|
|
|
+
|
|
|
|
|
+ if(Couple.informationtInfo.firstChild !== null){
|
|
|
|
|
+ Couple.informationtInfo.removeChild(Couple.informationtInfo.firstChild);
|
|
|
}
|
|
}
|
|
|
- if(informationtPermissions.firstChild !== null){
|
|
|
|
|
- informationtPermissions.style.display = "none";
|
|
|
|
|
|
|
+ if(Couple.informationtTime.firstChild !==null){
|
|
|
|
|
+ Couple.informationtTime.removeChild(Couple.informationtTime.firstChild);
|
|
|
}
|
|
}
|
|
|
- if(AddUserMembers.firstChild !== null){
|
|
|
|
|
- AddUserMembers.removeChild(AddUserMembers.firstChild)
|
|
|
|
|
- informationtAddUser.style.display = "none";
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(Couple.informationtOperation.firstChild !== null){
|
|
|
|
|
+ Couple.informationtOperation.removeChild(Couple.informationtOperation.firstChild)
|
|
|
}
|
|
}
|
|
|
- if(informationtcreateItem.firstChild !== null){
|
|
|
|
|
- informationtcreateItem.removeChild(informationtcreateItem.firstChild)
|
|
|
|
|
- informationtcreateItem.style.display = "none";
|
|
|
|
|
|
|
+ if(Couple.informationtPermissions.firstChild !== null){
|
|
|
|
|
+ Couple.informationtPermissions.style.display = "none";
|
|
|
}
|
|
}
|
|
|
- var informationtTitle=$$("h4", {
|
|
|
|
|
- "className": "informationtTitle",
|
|
|
|
|
- }, informationtTime.children[0]);
|
|
|
|
|
- var delItem=$$("button", {
|
|
|
|
|
- "className": "delItem","innerText":"删除项目","onclick":"Couple.OnclickdelITem()"
|
|
|
|
|
- }, informationtTime.children[0]);
|
|
|
|
|
- var addUser=$$("button", {
|
|
|
|
|
- "className": "addUser","innerText":"添加用户","onclick":"Couple.OnclickaddUser()"
|
|
|
|
|
- }, informationtTime.children[0]);
|
|
|
|
|
- informationtTitle.innerHTML = "当前项目:"+target.innerText;
|
|
|
|
|
- Couple.OnclickaddUser=function(){
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","GetJurisdictionName",U.UF.Cookie.get("usestudiosso","userid")[0]],function (r){
|
|
|
|
|
- if(r.value[0].JurisdictionName!=="管理员"){
|
|
|
|
|
- informationtAddUser.style.display = "block";
|
|
|
|
|
- if(AddUserMembers.firstChild == null){}else{
|
|
|
|
|
- AddUserMembers.removeChild(AddUserMembers.firstChild);
|
|
|
|
|
- }
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn", "UseStudio_FeedBack", "GetUserIdByProductId",target.parentNode.parentNode.productId],function (r){//获取没有权限用户的列表
|
|
|
|
|
- if(r.value){
|
|
|
|
|
- NoPowerMembers.innerText = r.value.length;
|
|
|
|
|
- var tbody = $$("tbody", {//创建表格
|
|
|
|
|
- "className": "tbMain",
|
|
|
|
|
- }, AddUserMembers);
|
|
|
|
|
- for(var i=0;i<r.value.length;i++){
|
|
|
|
|
- var trow = Couple.getUserRow(r.value[i],i+1,target.parentNode.parentNode.productId);
|
|
|
|
|
- tbody.appendChild(trow);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }else{
|
|
|
|
|
- alert("你无权限!");
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
|
|
+ if(Couple.AddUserMembers.firstChild !== null){
|
|
|
|
|
+ Couple.AddUserMembers.removeChild(Couple.AddUserMembers.firstChild)
|
|
|
|
|
+ Couple.informationtAddUser.style.display = "none";
|
|
|
}
|
|
}
|
|
|
- Couple.OnclickdelITem=function(){
|
|
|
|
|
- if(confirm("确定啥删除该项目吗")){
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","DeleteProductList",target.parentNode.parentNode.productId],function (r){
|
|
|
|
|
- if(r.value){
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","DeleteProduct",target.parentNode.parentNode.productId],function (r){})
|
|
|
|
|
- location.reload();
|
|
|
|
|
- return false;
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ if(Couple.informationtcreateItem.firstChild !== null){
|
|
|
|
|
+ Couple.informationtcreateItem.removeChild(Couple.informationtcreateItem.firstChild)
|
|
|
|
|
+ Couple.informationtcreateItem.style.display = "none";
|
|
|
}
|
|
}
|
|
|
- Couple.OnclickTime=function(id,time){//点击时间对应获取信息
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","GetFeedback",id,time],function (r){//获取产品的反馈信息
|
|
|
|
|
- if(r.value){
|
|
|
|
|
- if(informationtInfo.firstChild==null){}else{
|
|
|
|
|
- informationtInfo.removeChild(informationtInfo.firstChild);
|
|
|
|
|
- informationtTime.removeChild(informationtTime.firstChild);
|
|
|
|
|
- Couple.createInfo(productId)
|
|
|
|
|
- }
|
|
|
|
|
- var tbody = $$("tbody", {//创建表格
|
|
|
|
|
- "className": "tbMain",
|
|
|
|
|
- }, informationtInfo);
|
|
|
|
|
- var tr = $$("tr", {}, tbody);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle","innerText":"排序"
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle trTitle","innerText":"标题"
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle trContent","innerText":"内容",
|
|
|
|
|
- }, tr);
|
|
|
|
|
- var td = $$("td", {
|
|
|
|
|
- "className":"infoTitle trCoupleTime","innerText":"反馈时间"
|
|
|
|
|
- }, tr);
|
|
|
|
|
- if(r.value.length === 0){
|
|
|
|
|
- var coupleData = $$("div", {
|
|
|
|
|
- "className":"coupleData","innerText":"暂无数据"
|
|
|
|
|
- }, tbody);
|
|
|
|
|
- }
|
|
|
|
|
- var td = $$("td", {}, tr);
|
|
|
|
|
- for(var i=0;i<r.value.length;i++){
|
|
|
|
|
-
|
|
|
|
|
- var trow = Couple.getDataRow(r.value[i],i+1);
|
|
|
|
|
- tbody.appendChild(trow);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ Couple.itemOperation(productId);
|
|
|
|
|
+ Couple.createInfo(productId);
|
|
|
|
|
+ Couple.OnclickTime(productId,'30days');
|
|
|
};
|
|
};
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- Couple.Permissions()
|
|
|
|
|
|
|
+ Couple.Permissions();
|
|
|
}
|
|
}
|
|
|
Couple.Permissions=function(){
|
|
Couple.Permissions=function(){
|
|
|
- var informationtSet = $(".informationtSet")[0]//获取管理员设置
|
|
|
|
|
- var informationtPermissions = $(".informationtPermissions")[0];//获取成员管理
|
|
|
|
|
- var permissionsMembers = $(".permissionsMembers")[0];//获取用户成员信息
|
|
|
|
|
- var AddItem = $(".AddItem")[0];//获取创建项目
|
|
|
|
|
- var informationtcreateItem = $(".informationtcreateItem")[0]//获取创建项目
|
|
|
|
|
- var createItem = $(".createItem")[0]//获取创建按钮
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","GetUser"],function (r){//查询用户
|
|
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"GetUser"],function (r){//查询用户
|
|
|
if(r.value){
|
|
if(r.value){
|
|
|
- var tbody = $$("tbody", {//创建表格
|
|
|
|
|
|
|
+ var tbody = $$("table", {//创建表格
|
|
|
"className": "tbMain",
|
|
"className": "tbMain",
|
|
|
- }, permissionsMembers);
|
|
|
|
|
|
|
+ }, Couple.permissionsMembers);
|
|
|
for(var i=0;i<r.value.length;i++){
|
|
for(var i=0;i<r.value.length;i++){
|
|
|
var trow = Couple.getMembersRow(r.value[i],i+1);
|
|
var trow = Couple.getMembersRow(r.value[i],i+1);
|
|
|
tbody.appendChild(trow);
|
|
tbody.appendChild(trow);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","GetJurisdictionName",U.UF.Cookie.get("usestudiosso","userid")[0]],function (r){//传入用户Id获取权限名称
|
|
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"GetJurisdictionName",Couple.UserId],function (r){//传入用户Id获取权限名称
|
|
|
if(r.value){
|
|
if(r.value){
|
|
|
- if(r.value[0].JurisdictionName === "超级管理员"){
|
|
|
|
|
- informationtSet.style.display = "inline-block";
|
|
|
|
|
- informationtSet.onclick=function(){
|
|
|
|
|
- informationtPermissions.style.display = "block"
|
|
|
|
|
|
|
+ if(r.value[0].JurisdictionName === "administrator"){
|
|
|
|
|
+ Couple.informationtSet.style.display = "inline-block";
|
|
|
|
|
+ Couple.informationtSet.onclick=function(){
|
|
|
|
|
+ Couple.informationtPermissions.style.display = "block"
|
|
|
}
|
|
}
|
|
|
- AddItem.onclick=function(){
|
|
|
|
|
- var form = $$("div", {}, informationtcreateItem);
|
|
|
|
|
- var input = $$("input", {
|
|
|
|
|
- "className":"createItemName","placeholder":"请输入项目名称","type":"text"
|
|
|
|
|
- }, form);
|
|
|
|
|
- var createItem = $$("button", {
|
|
|
|
|
- "className":"createItem","innerHTML":"创建","onclick":"Couple.OnclickcreateItem()"
|
|
|
|
|
- }, form);
|
|
|
|
|
- informationtcreateItem.style.display = "block";
|
|
|
|
|
- }
|
|
|
|
|
- Couple.OnclickcreateItem=function(){
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","InsertProductList",$(".createItemName")[0].value],function (r){//查询用户
|
|
|
|
|
- if(r.value){
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn","UseStudio_FeedBack","InsertUserProduct",U.UF.Cookie.get("usestudiosso","userid")[0],r.value[0].ProductId],function (r){//查询用户
|
|
|
|
|
- location.reload()
|
|
|
|
|
- })
|
|
|
|
|
- }
|
|
|
|
|
- })
|
|
|
|
|
- console.log(1)
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+Couple.OnclickcreateItem=function(){//创建新项目
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"InsertProductList",$(".createItemName")[0].value],function (r){//查询用户
|
|
|
|
|
+ if(r.value){
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"InsertUserProduct",Couple.UserId,r.value[0].ProductId],function (r){//查询用户
|
|
|
|
|
+ location.reload()
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+Couple.OnclickaddUser=function(r,productId){//给项目添加可查看的成员
|
|
|
|
|
+ if(r=="admin"){
|
|
|
|
|
+ Couple.informationtAddUser.style.display = "block";
|
|
|
|
|
+ if(Couple.AddUserMembers.firstChild == null){}else{
|
|
|
|
|
+ Couple.AddUserMembers.removeChild(Couple.AddUserMembers.firstChild);
|
|
|
|
|
+ }
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db, Couple.SqlName, "GetUserIdByProductId",productId],function (r){//获取没有权限用户的列表
|
|
|
|
|
+ if(r.value){
|
|
|
|
|
+ Couple.NoPowerMembers.innerText = r.value.length;
|
|
|
|
|
+ var tbody = $$("table", {//创建表格
|
|
|
|
|
+ "className": "tbMain",
|
|
|
|
|
+ }, Couple.AddUserMembers);
|
|
|
|
|
+ for(var i=0;i<r.value.length;i++){
|
|
|
|
|
+ var trow = Couple.getUserRow(r.value[i],productId);
|
|
|
|
|
+ tbody.appendChild(trow);
|
|
|
}
|
|
}
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }else{
|
|
|
|
|
+ alert("你无权限!");
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+Couple.itemOperation=function(productId){//管理员功能
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"GetJurisdictionName",Couple.UserId],function (r){
|
|
|
|
|
+ if(r.value[0].JurisdictionName=="admin"){
|
|
|
|
|
+ Couple.informationtOperation.style.display = "block";
|
|
|
|
|
+ var actionItem=$$("div", {
|
|
|
|
|
+ "className": "actionItem"
|
|
|
|
|
+ }, Couple.informationtOperation);
|
|
|
|
|
+ var delItem=$$("button", {
|
|
|
|
|
+ "className": "delItem","innerText":"删除项目","onclick":"Couple.OnclickdelITem('"+productId+"')"
|
|
|
|
|
+ }, actionItem);
|
|
|
|
|
+ var addUser=$$("button", {
|
|
|
|
|
+ "className": "addUser","innerText":"添加用户","onclick":"Couple.OnclickaddUser('"+r.value[0].JurisdictionName+"','"+productId+"')"
|
|
|
|
|
+ }, actionItem);
|
|
|
|
|
+ var addItem=$$("button", {
|
|
|
|
|
+ "className": "addUser","innerText":"创建项目","onclick":"Couple.AddItem()"
|
|
|
|
|
+ }, actionItem);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+}
|
|
|
|
|
+Couple.OnclickdelITem=function(productId){//删除该项目
|
|
|
|
|
+ if(confirm("确定啥删除该项目吗")){
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"DeleteProductList",productId],function (r){
|
|
|
|
|
+ if(r.value){
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"DeleteProduct",productId],function (r){})
|
|
|
|
|
+ location.reload();
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+Couple.OnclickTime=function(id,time){//点击时间对应获取信息
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db,Couple.SqlName,"GetFeedback",id,time],function (r){//获取产品的反馈信息
|
|
|
|
|
+ if(r.value){
|
|
|
|
|
+ if(Couple.informationtInfo.firstChild !== null){
|
|
|
|
|
+ Couple.informationtInfo.removeChild(Couple.informationtInfo.firstChild);
|
|
|
|
|
+ }
|
|
|
|
|
+ var tbody = $$("table", {//创建表格
|
|
|
|
|
+ "className": "tbMain",
|
|
|
|
|
+ }, Couple.informationtInfo);
|
|
|
|
|
+ var tr = $$("tr", {}, tbody);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle","innerText":"排序"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle trTitle","innerText":"标题"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle trContent","innerText":"内容",
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle trCoupleTime","innerText":"反馈时间"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ if(r.value.length === 0){
|
|
|
|
|
+ var coupleData = $$("div", {
|
|
|
|
|
+ "className":"coupleData","innerText":"暂无数据"
|
|
|
|
|
+ }, tbody);
|
|
|
|
|
+ }
|
|
|
|
|
+ var td = $$("td", {
|
|
|
|
|
+ "className":"infoTitle infoHandle","innerText":"操作"
|
|
|
|
|
+ }, tr);
|
|
|
|
|
+ for(var i=0;i<r.value.length;i++){
|
|
|
|
|
|
|
|
|
|
+ var trow = Couple.getDataRow(r.value[i],i+1);
|
|
|
|
|
+ tbody.appendChild(trow);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
}
|
|
}
|
|
|
-Couple.createInfo=function(productId){
|
|
|
|
|
- var informationtTime = $(".informationtTime")[0]//获取反馈时间
|
|
|
|
|
|
|
+Couple.AddItem=function(){//创建添加项目模块
|
|
|
|
|
+ if(Couple.informationtcreateItem.firstChild!==null){
|
|
|
|
|
+ Couple.informationtcreateItem.removeChild(Couple.informationtcreateItem.firstChild);
|
|
|
|
|
+ }
|
|
|
|
|
+ var form = $$("div", {}, Couple.informationtcreateItem);
|
|
|
|
|
+ var input = $$("input", {
|
|
|
|
|
+ "className":"createItemName","placeholder":"请输入项目名称","type":"text"
|
|
|
|
|
+ }, form);
|
|
|
|
|
+ var createItem = $$("button", {
|
|
|
|
|
+ "className":"createItem","innerHTML":"创建","onclick":"Couple.OnclickcreateItem()"
|
|
|
|
|
+ }, form);
|
|
|
|
|
+ Couple.informationtcreateItem.style.display = "block";
|
|
|
|
|
+}
|
|
|
|
|
+Couple.createInfo=function(productId){//创建项目日期分类
|
|
|
Date.prototype.Format = function (fmt) {//时间处理对Date的扩展
|
|
Date.prototype.Format = function (fmt) {//时间处理对Date的扩展
|
|
|
var o = {
|
|
var o = {
|
|
|
"M+": this.getMonth() + 1, // 月份
|
|
"M+": this.getMonth() + 1, // 月份
|
|
@@ -219,22 +213,22 @@ Couple.createInfo=function(productId){
|
|
|
}
|
|
}
|
|
|
var time = (new Date()).Format("yyyy-MM-dd hh:mm:ss");//获取时间
|
|
var time = (new Date()).Format("yyyy-MM-dd hh:mm:ss");//获取时间
|
|
|
var timeSequence=$$("div", {
|
|
var timeSequence=$$("div", {
|
|
|
- "className": "timeSequence"
|
|
|
|
|
- }, informationtTime);
|
|
|
|
|
|
|
+ "className":"timeSequence"
|
|
|
|
|
+ },Couple.informationtTime);
|
|
|
var oneDay=$$("button", {
|
|
var oneDay=$$("button", {
|
|
|
"className": "timeItem","innerText":"今天","onclick":"Couple.OnclickTime('"+productId+"','today')"
|
|
"className": "timeItem","innerText":"今天","onclick":"Couple.OnclickTime('"+productId+"','today')"
|
|
|
- }, timeSequence);
|
|
|
|
|
|
|
+ },timeSequence);
|
|
|
var threeDay=$$("button", {
|
|
var threeDay=$$("button", {
|
|
|
"className": "timeItem","innerText":"最近三天","onclick":"Couple.OnclickTime('"+productId+"','3days')"
|
|
"className": "timeItem","innerText":"最近三天","onclick":"Couple.OnclickTime('"+productId+"','3days')"
|
|
|
- }, timeSequence);
|
|
|
|
|
|
|
+ },timeSequence);
|
|
|
var oneWeek=$$("button", {
|
|
var oneWeek=$$("button", {
|
|
|
"className": "timeItem","innerText":"最近一周","onclick":"Couple.OnclickTime('"+productId+"','7days')"
|
|
"className": "timeItem","innerText":"最近一周","onclick":"Couple.OnclickTime('"+productId+"','7days')"
|
|
|
- }, timeSequence)
|
|
|
|
|
|
|
+ },timeSequence)
|
|
|
var oneMonth=$$("button", {
|
|
var oneMonth=$$("button", {
|
|
|
"className": "timeItem","innerText":"最近一月","onclick":"Couple.OnclickTime('"+productId+"','30days')"
|
|
"className": "timeItem","innerText":"最近一月","onclick":"Couple.OnclickTime('"+productId+"','30days')"
|
|
|
- }, timeSequence)
|
|
|
|
|
|
|
+ },timeSequence)
|
|
|
}
|
|
}
|
|
|
-Couple.getUserRow = function(h,i,productId){//创建表格下用户数据库循环数据
|
|
|
|
|
|
|
+Couple.getUserRow = function(h,productId){//创建表格下用户数据库循环数据
|
|
|
var row = document.createElement('tr');
|
|
var row = document.createElement('tr');
|
|
|
var trUserId = document.createElement('td');
|
|
var trUserId = document.createElement('td');
|
|
|
trUserId.setAttribute('class','trUserId');
|
|
trUserId.setAttribute('class','trUserId');
|
|
@@ -263,7 +257,8 @@ Couple.getUserRow = function(h,i,productId){//创建表格下用户数据库循
|
|
|
btnAdd.onclick=function(){ //设置操作
|
|
btnAdd.onclick=function(){ //设置操作
|
|
|
if(confirm("确定添加权限吗")){
|
|
if(confirm("确定添加权限吗")){
|
|
|
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
|
|
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn", "UseStudio_FeedBack", "InsertUserProduct",h.UserId,productId],function (r){})//插入用户权限
|
|
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db, Couple.SqlName, "InsertUserProduct",h.UserId,productId],function (r){})//插入用户权限
|
|
|
|
|
+ Couple.NoPowerMembers.innerHTML=Couple.NoPowerMembers.innerHTML-1;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
setCell.appendChild(btnAdd);
|
|
setCell.appendChild(btnAdd);
|
|
@@ -298,7 +293,7 @@ Couple.getDataRow = function(h,i){//创建表格下的反馈数据库循环数
|
|
|
if(confirm("确定删除这一行嘛?")){
|
|
if(confirm("确定删除这一行嘛?")){
|
|
|
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
|
|
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
|
|
|
}
|
|
}
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn", "UseStudio_FeedBack", "DeleteFeedback",h.ProductId],function (r){})
|
|
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db, Couple.SqlName, "DeleteFeedback",h.FeedbackId],function (r){})
|
|
|
}
|
|
}
|
|
|
delCell.appendChild(btnDel);
|
|
delCell.appendChild(btnDel);
|
|
|
return row;
|
|
return row;
|
|
@@ -325,17 +320,17 @@ Couple.getMembersRow = function(h,i){//创建表格下的用户数据库循环
|
|
|
row.appendChild(setCell);
|
|
row.appendChild(setCell);
|
|
|
var btnSet = document.createElement('input');
|
|
var btnSet = document.createElement('input');
|
|
|
btnSet.setAttribute('type','button');
|
|
btnSet.setAttribute('type','button');
|
|
|
- btnSet.setAttribute('value','修改');
|
|
|
|
|
|
|
+ btnSet.setAttribute('value','设为管理员');
|
|
|
btnSet.setAttribute('class','setInfo');
|
|
btnSet.setAttribute('class','setInfo');
|
|
|
btnSet.onclick=function(){ //设置操作
|
|
btnSet.onclick=function(){ //设置操作
|
|
|
if(confirm("确定修改管理员信息吗")){
|
|
if(confirm("确定修改管理员信息吗")){
|
|
|
- if(this.parentNode.parentNode.children[2].innerText != "超级管理员"){
|
|
|
|
|
- this.parentNode.parentNode.children[2].innerHTML = "超级管理员"
|
|
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn", "UseStudio_FeedBack", "UpdateJurisdictionName",this.parentNode.parentNode.children[0].innerText,"超级管理员"],function (r){//修改权限
|
|
|
|
|
|
|
+ if(this.parentNode.parentNode.children[2].innerText != "admin" && this.parentNode.parentNode.children[2].innerText!=="administrator"){
|
|
|
|
|
+ this.parentNode.parentNode.children[2].innerHTML = "admin"
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db, Couple.SqlName, "UpdateJurisdictionName",this.parentNode.parentNode.children[0].innerText,"admin"],function (r){//修改权限
|
|
|
console.log(r)
|
|
console.log(r)
|
|
|
})
|
|
})
|
|
|
}else{
|
|
}else{
|
|
|
- alert("你已经是超级管理员")
|
|
|
|
|
|
|
+ alert("你已经是管理员!")
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -352,7 +347,7 @@ Couple.getMembersRow = function(h,i){//创建表格下的用户数据库循环
|
|
|
btnDel.onclick=function(){ //删除操作
|
|
btnDel.onclick=function(){ //删除操作
|
|
|
if(confirm("确定删除这一行嘛?")){
|
|
if(confirm("确定删除这一行嘛?")){
|
|
|
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
|
|
this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);
|
|
|
- U.A.Request("http://cd.1473.cn/php",["db.1473.cn", "UseStudio_FeedBack", "DeleteFeedback",h.FeedbackId],function (r){})
|
|
|
|
|
|
|
+ U.A.Request(Couple.Cd,[Couple.Db, Couple.SqlName, "DeleteFeedback",h.FeedbackId],function (r){})
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
delCell.appendChild(btnDel);
|
|
delCell.appendChild(btnDel);
|
|
@@ -360,12 +355,31 @@ Couple.getMembersRow = function(h,i){//创建表格下的用户数据库循环
|
|
|
}
|
|
}
|
|
|
Couple.logout=function(){//退出
|
|
Couple.logout=function(){//退出
|
|
|
U.UF.CD.loadAjaxCrossDomain(function(){
|
|
U.UF.CD.loadAjaxCrossDomain(function(){
|
|
|
- U.A.Request(US.AUTH, ["UserOffline", U.UF.Cookie.get("usestudiosso","userid")[0]],function(r){
|
|
|
|
|
- U.UF.Cookie.del("usestudiosso")
|
|
|
|
|
|
|
+ U.A.Request(US.AUTH, ["UserOffline", Couple.UserId],function(r){
|
|
|
|
|
+ U.UF.Cookie.del("usestudiosso");
|
|
|
window.location.href="http://feedback.1473.cn/";
|
|
window.location.href="http://feedback.1473.cn/";
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
Couple.Init=function () {
|
|
Couple.Init=function () {
|
|
|
|
|
+ Couple.informationtSet = $(".informationtSet")[0]//获取管理员设置
|
|
|
|
|
+ Couple.informationtPermissions = $(".informationtPermissions")[0];//获取成员管理
|
|
|
|
|
+ Couple.permissionsMembers = $(".permissionsMembers")[0];//获取用户成员信息
|
|
|
|
|
+ // Couple.AddItem = $(".AddItem")[0];//获取创建项目
|
|
|
|
|
+ Couple.informationtcreateItem = $(".informationtcreateItem")[0]//获取创建项目
|
|
|
|
|
+ Couple.informationtOperation = $(".informationtOperation")[0]
|
|
|
|
|
+ Couple.userName=$(".userName")[0]//获取用户名
|
|
|
|
|
+ Couple.ul = $(".asideMenu ul")[0];//获取项目列表ul
|
|
|
|
|
+ Couple.timeSequence = $(".timeSequence")[0]
|
|
|
|
|
+ Couple.logoTitle = $(".logoTitle")[0]//反馈标题位置
|
|
|
|
|
+ Couple.informationtInfo = $(".informationtInfo")[0];//获取反馈信息
|
|
|
|
|
+ Couple.informationtTime = $(".informationtTime")[0];//获取反馈时间
|
|
|
|
|
+ Couple.informationtAddUser = $(".informationtAddUser")[0];
|
|
|
|
|
+ Couple.AddUserMembers = $(".AddUserMembers")[0];
|
|
|
|
|
+ Couple.NoPowerMembers = $(".NoPowerMembers")[0];//该项目没有权限的人数
|
|
|
|
|
+ Couple.Cd = "http://cd.1473.cn/net";
|
|
|
|
|
+ Couple.Db = "db.1473.cn";
|
|
|
|
|
+ Couple.SqlName = "UseStudio_FeedBack";
|
|
|
|
|
+ Couple.UserId = U.UF.Cookie.get("usestudiosso","userid")[0];
|
|
|
Couple.Bind();
|
|
Couple.Bind();
|
|
|
}();
|
|
}();
|