+
导入成员
添加已有成员
创建新成员
diff --git a/web/pages/userinfo.html b/web/pages/userinfo.html
new file mode 100644
index 0000000..bb1e4f1
--- /dev/null
+++ b/web/pages/userinfo.html
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+ 用户属性
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/pages/userinfolist.html b/web/pages/userinfolist.html
new file mode 100644
index 0000000..0b15f20
--- /dev/null
+++ b/web/pages/userinfolist.html
@@ -0,0 +1,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 
数据下载
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 111223 |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/web/src/jquery.editable-select.js b/web/src/jquery.editable-select.js
new file mode 100644
index 0000000..04783eb
--- /dev/null
+++ b/web/src/jquery.editable-select.js
@@ -0,0 +1,550 @@
+/**
+ * Copyright (c) 2009 Anders Ekdahl (http://coffeescripter.com/)
+ * var select = $('.editable-select:first');
+ * var instances = select.editableSelectInstances();
+ * instances[0].addOption('Germany', 'value added programmatically');
+ *
+ * Version: 1.3.2
+ * yingxian modify
+ * Demo and documentation: http://coffeescripter.com/code/editable-select/
+ */
+(function($) {
+ var instances = [];
+ $.fn.editableSelect = function(options) {
+ var defaults = { bg_iframe: false,
+ onSelect: false,
+ items_then_scroll: 10,
+ case_sensitive: false
+ };
+ var settings = $.extend(defaults, options);
+ // Only do bg_iframe for browsers that need it
+ /*if(settings.bg_iframe && !$.browser.msie) {
+ settings.bg_iframe = false;
+ };*/
+ var instance = false;
+ $(this).each(function() {
+ var i = instances.length;
+ if($(this).data('editable-selecter') !== null) {
+ instances[i] = new EditableSelect(this, settings);
+ $(this).data('editable-selecter', i);
+ };
+ });
+ return $(this);
+ };
+ $.fn.editableSelectInstances = function() {
+ var ret = [];
+ $(this).each(function() {
+ if($(this).data('editable-selecter') !== null) {
+ ret[ret.length] = instances[$(this).data('editable-selecter')];
+ };
+ });
+ return ret;
+ };
+
+ var EditableSelect = function(select, settings) {
+ this.init(select, settings);
+ };
+ EditableSelect.prototype = {
+ settings: false,
+ text: false,
+ select: false,
+ select_width: 0,
+ wrapper: false,
+ list_item_height: 20,
+ list_height: 0,
+ list_is_visible: false,
+ hide_on_blur_timeout: false,
+ bg_iframe: false,
+ current_value: '',
+ init: function(select, settings) {
+ this.settings = settings;
+ this.wrapper = $(document.createElement('div'));
+ this.wrapper.addClass('editable-select-options');
+ this.select = $(select);
+ var name = this.select.attr('name');
+ if(!name) {
+ name = 'editable-select'+ instances.length;
+ };
+ var id = this.select.attr('id');
+ if(!id) {
+ id = 'editable-select'+ instances.length;
+ };
+ this.text = $('
');
+ this.text_submit = $('
');
+ this.text.attr('name', name + "_sele");
+ this.text_submit.attr('name', name);
+ this.text.data('editable-selecter', this.select.data('editable-selecter'));
+ this.text_submit.data('editable-selecter', this.select.data('editable-selecter'));
+ // Because we don't want the value of the select when the form
+ // is submitted
+ this.select.attr('disabled', 'disabled');
+ this.text[0].className = this.select[0].className;
+ this.text_submit[0].className = this.select[0].className;
+
+ this.text.attr('id', id + "_sele");
+ this.text_submit.attr('id', id);
+ this.wrapper.attr('id',id+'_editable-select-options');
+ this.text.attr('autocomplete', 'off');
+ this.text.attr('autocomplete', 'off');
+ this.text.addClass('editable-select');
+ this.text_submit.addClass('editable-select');
+ this.select.attr('id', id +'_hidden_select');
+ this.select.attr('name', name +'_hidden_select');
+ this.select.after(this.text);
+ this.select.after(this.text_submit);
+ if(this.select.css('display') == 'none') {
+ //this.text.css('display', 'none');
+ this.text_submit.css('display', 'none');
+ }
+ if(this.select.css('visibility') == 'hidden') {
+ //this.text.css('visibility', 'visibility');
+ this.text_submit.css('visibility', 'visibility');
+ }
+ // Set to hidden, because we want to call .show()
+ // on it to get it's width but not having it display
+ // on the screen
+ this.select.css('visibility', 'hidden');
+ this.select.hide();
+ this.initInputEvents(this.text);
+ this.duplicateOptions();
+ this.setWidths();
+ $(document.body).append(this.wrapper);
+
+ if(this.settings.bg_iframe) {
+ this.createBackgroundIframe();
+ };
+ if(typeof this.settings.success == "function") {
+ this.settings.success.call(this,this.text_submit[0]);
+ };
+ },
+ /**
+ * Take the select lists options and
+ * populate an unordered list with them
+ */
+ duplicateOptions: function() {
+ var context = this,text,val;
+ var option_list = $(document.createElement('ul'));
+ this.wrapper.empty();
+ this.wrapper.append(option_list);
+ var options = this.select.find('option');
+ this.dataList = [];
+ options.each(function(i) {
+ text = $(this).text();
+ val = $(this).val();
+ if($(this).attr('selected') /*|| i == 0*/) {
+ context.text.val(text);
+ context.text_submit.val(val);
+ context.current_value = text;
+ };
+ if(context.trim(text) != "") context.dataList.push(text);
+ var li = $('
'+ text +'');
+ li.hide();
+ context.initListItemEvents(li);
+ option_list.append(li);
+ });
+ this.setWidths();
+ this.checkScroll();
+ },in_array:function(e,arr)
+ {
+ for(i=0,len = arr.length;i < len;i++)
+ {
+ if(arr[i] == e)
+ {
+ return true;
+ }
+ }
+ return false;
+ },trim:function(str){
+ return typeof str == "string" ? str.replace(/^\s*|\s*$/g,"") : str;
+ },
+ /**
+ * Check if the list has enough items to display a scroll
+ */
+ checkScroll: function() {
+ var options = this.wrapper.find('li');
+ if(options.length > this.settings.items_then_scroll) {
+ this.list_height = this.list_item_height * this.settings.items_then_scroll;
+ this.wrapper.css('height', this.list_height +'px');
+ this.wrapper.css('overflow', 'auto');
+ } else {
+ this.wrapper.css('height', 'auto');
+ this.wrapper.css('overflow', 'visible');
+ };
+ },
+ addOption: function(value,text) {
+ var li = $('
'+ text +'');
+ var option = $('
');
+ this.select.append(option);
+ this.initListItemEvents(li);
+ this.wrapper.find('ul').append(li);
+ this.setWidths();
+ this.checkScroll();
+ },
+ /**
+ * Init the different events on the input element
+ */
+ initInputEvents: function(text) {
+ var context = this;
+ var timer = false;
+ $(document.body).click(
+ function() {
+ context.clearSelectedListItem();
+ context.hideList();
+ }
+ );
+ text.blur(
+ function(e) {
+ var val = context.trim(this.value);
+ var isInArr = context.in_array(val,context.dataList);
+ if( val == "")
+ {
+ context.text_submit.val("");
+ }else if(val != "" && !isInArr)
+ {
+ context.text_submit.val("-1");
+ }
+
+ var list_item = typeof context.settings.onSelect == 'function' && isInArr ? context.findItem(val) : null;
+
+ if(typeof context.settings.onSelect == 'function' && list_item != null) {
+
+ context.text.val(list_item.text());
+ context.text_submit.val(list_item.attr("value"));
+ context.current_value = context.text.val();
+ context.settings.onSelect.call(context, list_item,context.text_submit[0]);
+ };
+
+ context.hideList();
+
+ e.preventDefault();
+ e.stopPropagation();
+ }
+ );
+ text.focus(
+ function(e) {
+ // Can't use the blur event to hide the list, because the blur event
+ // is fired in some browsers when you scroll the list
+ context.showList();
+ context.highlightSelected();
+ e.stopPropagation();
+ }
+ ).click(
+ function(e) {
+ e.stopPropagation();
+ context.showList();
+ context.highlightSelected();
+ }
+ ).keydown(
+ // Capture key events so the user can navigate through the list
+ function(e) {
+ switch(e.keyCode) {
+ // Down
+ case 40:
+ if(!context.listIsVisible()) {
+ context.showList();
+ context.highlightSelected();
+ } else {
+ e.preventDefault();
+ context.selectNewListItem('down');
+ };
+ break;
+ // Up
+ case 38:
+ e.preventDefault();
+ context.selectNewListItem('up');
+ break;
+ // Tab
+ case 9:
+ context.pickListItem(context.selectedListItem());
+ break;
+ // Esc
+ case 27:
+ e.preventDefault();
+ context.hideList();
+ return false;
+ break;
+ // Enter, prevent form submission
+ case 13:
+ e.preventDefault();
+ context.pickListItem(context.selectedListItem());
+ return false;
+ };
+ }
+ ).keyup(
+ function(e) {
+ // Prevent lots of calls if it's a fast typer
+ if(timer !== false) {
+ clearTimeout(timer);
+ timer = false;
+ };
+ timer = setTimeout(
+ function() {
+ // If the user types in a value, select it if it's in the list
+ if(context.text.val() != context.current_value) {
+ context.current_value = context.text.val();
+ context.highlightSelected();
+ //context.showList();
+ };
+ },
+ 200
+ );
+
+ // if input text change,list show.yingxian add hack by 2013-09-08
+ (e.keyCode == 13) ? context.hideList() : context.showList();
+ e.stopPropagation();
+ }
+ ).keypress(
+ function(e) {
+ if(e.keyCode == 13) {
+ // Enter, prevent form submission
+ e.preventDefault();
+ return false;
+ };
+ }
+ );
+ },
+ initListItemEvents: function(list_item) {
+ var context = this;
+ list_item.mouseover(
+ function() {
+ context.clearSelectedListItem();
+ context.selectListItem(list_item);
+ }
+ ).mousedown(
+ // Needs to be mousedown and not click, since the inputs blur events
+ // fires before the list items click event
+ function(e) {
+ e.stopPropagation();
+ context.pickListItem(context.selectedListItem());
+ }
+ );
+ },
+ selectNewListItem: function(direction) {
+ var li = this.selectedListItem();
+ if(!li.length) {
+ li = this.selectFirstListItem();
+ };
+ if(direction == 'down') {
+ var sib = this.selectNextItem(li);
+ } else {
+ var sib = this.selectPrevItem(li);
+ };
+ if(sib.length) {
+ this.selectListItem(sib);
+ this.scrollToListItem(sib);
+ this.unselectListItem(li);
+ };
+ },selectNextItem:function(el){
+ var e = el.next();
+ if(e && e[0].display == "none")
+ {
+ return el;
+ }
+ return e;
+ },selectPrevItem:function(el){
+
+ var e = el.prev();
+ if(e && e[0].display == "none")
+ {
+ return el;
+ }
+ return e;
+
+ },
+ selectListItem: function(list_item) {
+ this.clearSelectedListItem();
+ list_item.addClass('selected');
+ },
+ selectFirstListItem: function() {
+ this.clearSelectedListItem();
+ var first = this.wrapper.find('li:first');
+ //this.wrapper.find('li').hide();
+ first.addClass('selected');
+ //first.show();
+ return first;
+ },
+ unselectListItem: function(list_item) {
+ list_item.removeClass('selected');
+ },
+ selectedListItem: function() {
+ return this.wrapper.find('li.selected');
+ },
+ clearSelectedListItem: function() {
+ this.wrapper.find('li.selected').removeClass('selected');
+ },
+ /**
+ * The difference between this method and selectListItem
+ * is that this method also changes the text field and
+ * then hides the list
+ */
+ pickListItem: function(list_item) {
+ if(list_item.length) {
+ this.text.val(list_item.text());
+ this.text_submit.val(list_item.attr("value"));
+ this.current_value = this.text.val();
+ };
+ if(typeof this.settings.onSelect == 'function') {
+ this.settings.onSelect.call(this, list_item,this.text_submit[0]);
+ };
+ this.hideList();
+ },
+ listIsVisible: function() {
+ return this.list_is_visible;
+ },
+ showList: function() {
+ this.positionElements();
+ this.setWidths();
+ this.wrapper.show();
+ this.hideOtherLists();
+ this.list_is_visible = true;
+ if(this.settings.bg_iframe) {
+ this.bg_iframe.show();
+ };
+ },
+ findItem: function(text1) {
+ var context = this;
+ var current_value = context.trim(text1);
+ var list_items = context.wrapper.find('li');
+ var best_candiate = false;
+ var value_found = false;
+ list_items.each(
+ function() {
+ var text = context.trim($(this).text());
+ if(!value_found) {
+ if(!context.settings.case_sensitive) {
+ text = text.toLowerCase();
+ };
+ if(text == current_value) {
+ value_found = true;
+ best_candiate = $(this);
+ return false;
+ }
+ };
+
+ }
+
+ );
+
+ if(value_found) {
+ return best_candiate;
+ }else if(!best_candiate && !value_found) {
+ return null;
+ };
+
+ },
+ highlightSelected: function() {
+ var context = this;
+ var current_value = context.trim(this.text.val());
+ if(current_value.length < 0) {
+ if(highlight_first) {
+ this.selectFirstListItem();
+ };
+ return;
+ };
+
+ var list_items = this.wrapper.find('li');
+ if(current_value.length == 0) {
+ list_items.show();
+ this.selectFirstListItem();
+ return;
+ };
+
+ if(!context.settings.case_sensitive) {
+ current_value = current_value.toLowerCase();
+ };
+ var best_candiate = false;
+ var value_found = false;
+ list_items.each(
+ function() {
+ var text = $(this).text();
+ if(!value_found) {
+ if(!context.settings.case_sensitive) {
+ text = text.toLowerCase();
+ };
+ if(text == current_value) {
+ value_found = true;
+ context.clearSelectedListItem();
+ context.selectListItem($(this));
+ context.scrollToListItem($(this));
+ //return false;
+ } else if(text.search(current_value) > -1 && !best_candiate) {
+ // Can't do return false here, since we still need to iterate over
+ // all list items to see if there is an exact match
+ best_candiate = $(this);
+ };
+
+ };
+ if(context.settings.isFilter && text.search(current_value) > -1 && current_value != "")
+ {
+ $(this).show();
+
+ }else if(context.settings.isFilter)
+ {
+ $(this).hide();
+ }
+ }
+
+ );
+
+ if(best_candiate && !value_found) {
+ context.clearSelectedListItem();
+ context.selectListItem(best_candiate);
+ context.scrollToListItem(best_candiate);
+ }else if(!best_candiate && !value_found) {
+ this.selectFirstListItem();
+ };
+ },
+ scrollToListItem: function(list_item) {
+ if(this.list_height) {
+ this.wrapper.scrollTop(list_item[0].offsetTop - (this.list_height / 2));
+ };
+ },
+ hideList: function() {
+ this.wrapper.hide();
+ this.list_is_visible = false;
+ if(this.settings.bg_iframe) {
+ this.bg_iframe.hide();
+ };
+ },
+ hideOtherLists: function() {
+ for(var i = 0; i < instances.length; i++) {
+ if(i != this.select.data('editable-selecter')) {
+ instances[i].hideList();
+ };
+ };
+ },
+ positionElements: function() {
+ var offset = this.text.offset();
+ offset = { top: offset.top, left: offset.left };
+ offset.top += this.text[0].offsetHeight;
+ this.wrapper.css({top: offset.top +'px', left: offset.left +'px'});
+ // Need to do this in order to get the list item height
+ this.wrapper.css('visibility', 'hidden');
+ this.wrapper.show();
+ this.list_item_height = this.wrapper.find('li')[0] ? this.wrapper.find('li')[0].offsetHeight : 0;
+ this.wrapper.css('visibility', 'visible');
+ this.wrapper.hide();
+ },
+ setWidths: function() {
+ // The text input has a right margin because of the background arrow image
+ // so we need to remove that from the width
+ this.select.show();
+ var width = this.select.width() + 2 + 20;
+ this.select.hide();
+ var padding_right = parseInt(this.text.css('padding-right').replace(/px/, ''), 10);
+ this.text.width(width - padding_right + 18);
+ this.wrapper.width(width + 2 + 20);
+ if(this.bg_iframe) {
+ this.bg_iframe.width(width + 4 + 20);
+ };
+ },
+ createBackgroundIframe: function() {
+ var bg_iframe = $('
');
+ $(document.body).append(bg_iframe);
+ bg_iframe.width(this.select.width() + 2);
+ bg_iframe.height(this.wrapper.height());
+ bg_iframe.css({top: this.wrapper.css('top'), left: this.wrapper.css('left')});
+ this.bg_iframe = bg_iframe;
+ }
+ };
+})(jQuery);
\ No newline at end of file
diff --git a/web/src/x.min.js b/web/src/x.min.js
index 0cd8c1a..8e2b174 100644
--- a/web/src/x.min.js
+++ b/web/src/x.min.js
@@ -188,9 +188,9 @@ var X = window.X || {
},
success:function(d){
layer.close(index);
-
+ console.log(d);
if(d.code == 0){
- if( JSON.stringify(d.data) != "{}" && JSON.stringify(d.data) != "[]"){
+ if( JSON.stringify(d.data) != "{}" && JSON.stringify(d.data) != "[]" && d.data != null && d.data != ""){
callback && callback(d.data);
}else {
layer.msg('查无数据');
@@ -278,6 +278,14 @@ var X = window.X || {
});
};
+ //获取当前页面名
+ X.pagename = function(callback){
+ var search = window.location.href;
+ var searcharr = search.split('=');
+ var pagearr = searcharr[1].split("&");
+ callback && callback(pagearr[0]);
+ };
+
//提交修改记录
X.submitrecord = function(content){
var game = X.game;//项目名
@@ -1437,6 +1445,7 @@ var X = window.X || {
X.DATA['eventid'] = "";
X.DATA['ltvid'] = "";
X.DATA['retentionid'] = "";
+ layer.closeAll();
};
@@ -2784,16 +2793,16 @@ var X = window.X || {
X.laytpldata("#addexistuser-con-user-box-dot",d,".addexistuser-con-user-box");
});
- X.api("project/members","get",{},function(d){
+ // X.api("project/members","get",{},function(d){
// console.log(d)
// X.laytpldata("#addexistuser-con-user-box-dot",d,".addexistuser-con-user-box");
- });
+ // });
X.api("authz/roles","get",{},function(d){
var projectrolearrlist = [];
for(let i in d){
var arr={
- id:d[i]['_id'],
+ id:d[i]['auth_id'],
title:d[i]['name'],
game:d[i]['game']
}
@@ -2936,13 +2945,14 @@ var X = window.X || {
});
//确定按钮
$(".addexistuser-btn-qd").click(function(){
-
+
var ylist = [];
for(let i in Addeddate){
var arr = {
username:Addeddate[i]['name'],
- role_id:Addeddate[i]['role_id'],
- game:X.DATA.game
+ auth_id:Addeddate[i]['role_id'],
+ game:X.DATA.game,
+ role_id:Addeddate[i]['_id']
}
ylist.push(arr)
}
@@ -2951,7 +2961,9 @@ var X = window.X || {
layer.msg('暂未选择用户');
return;
}
+
X.api("authz/add_role_domain","post",{data:ylist},function(d){
+ X.pageLogic['useradmin'].useradmin();
layer.closeAll();
});
});
@@ -3112,7 +3124,7 @@ var X = window.X || {
var me = this;
var data;
- X.api("authz/api_list","get",{},function(d){
+ X.api("authz/api_module","get",{},function(d){
data = d;
X.laytpldata("#addrole-info-table-con-dot",d,".addrole-info-table-con");
layui.form.render();
@@ -3122,15 +3134,15 @@ var X = window.X || {
this.parms = parms;
var passdata = parms;
- X.api("authz/get_permissions_for_user_in_domain","post",{role_id:passdata.id,game:X['DATA']['game']},function(d){
+ // X.api("authz/get_permissions_for_user_in_domain","post",{role_id:passdata.id,game:X['DATA']['game']},function(d){
- $('.addrole-tit').val(passdata.title);
- var selinput = {}
- for(let i in d){
- selinput[d[i]['_id']] = true
- }
- layui.form.val('addroleexample', selinput)
- });
+ // $('.addrole-tit').val(passdata.title);
+ // var selinput = {}
+ // for(let i in d){
+ // selinput[d[i]['_id']] = true
+ // }
+ // layui.form.val('addroleexample', selinput)
+ // });
};
// layui.form.on('checkbox(addrolelist)', function(data){
@@ -3148,34 +3160,34 @@ var X = window.X || {
$(document).off('click','.addrole-list-qx').on('click','.addrole-list-qx',function(){
var selinput = {}
for(let i in data){
- selinput[data[i]['path']] = true
+ selinput[data[i][0]] = true
}
layui.form.val('addroleexample', selinput)
});
$(document).off('click','.addrole-qd').on('click','.addrole-qd',function(){
+ var roleinfo = layui.form.val("roleinfo");
var tit = $(".addrole-tit").val();
var addroledata = layui.form.val("addroleexample");
-
var dataArr =[];
for(let i in addroledata){
dataArr.push(i);
}
if(passdata){
// X.api("authz/add_roles","post",{name:tit,game:X['DATA']['game'],desc:'111'},function(d){
-
// X.api("authz/add_policy","post",{role_id:d,game:X['DATA']['game'],act:"*",path_list:dataArr},function(d){
// layer.msg("创建成功");
// $(".addrole-qx a").click();
// })
// })
}else{
- X.api("authz/add_roles","post",{name:tit,game:X['DATA']['game'],desc:'111'},function(d){
+
+ X.api("authz/add_roles","post",{name:roleinfo.title,system: roleinfo.roletype,path_name:dataArr},function(d){
- X.api("authz/add_policy","post",{role_id:d,game:X['DATA']['game'],act:"*",path_list:dataArr},function(d){
- layer.msg("创建成功");
- $(".addrole-qx a").click();
- })
+ layer.msg("创建成功");
+ $(".addrole-qx a").click();
+ // X.api("authz/add_policy","post",{role_id:d,game:X['DATA']['game'],act:"*",},function(d){
+ // })
})
}
@@ -3198,12 +3210,12 @@ var X = window.X || {
projectrolearr = d;
for(let i in projectrolearr){
var arr={
- id:projectrolearr[i]['_id'],
- title:projectrolearr[i]['name'],
- game:projectrolearr[i]['game']
+ id:projectrolearr[i]['auth_id'],
+ title:projectrolearr[i]['name']
}
projectrolearrlist.push(arr);
}
+ console.log(projectrolearrlist);
})
// var datarightsarr;
// X.api("data_auth/list","get",{},function(d){
@@ -3219,7 +3231,7 @@ var X = window.X || {
"game": X.DATA.game,
"username": titarr[i],
"role_name": projectrolearr[0]["name"],
- "role_id": projectrolearr[0]["_id"]
+ "auth_id": projectrolearr[0]["auth_id"]
// "data_authority":datarightsarr[0]["title"],
// "data_auth_id":datarightsarr[0]["id"]
}
@@ -3253,13 +3265,10 @@ var X = window.X || {
function update(){
X.laytpldata("#adduser-table-con-box-dot",adduserData,".adduser-table-con-box");
// 项目角色修改
- // console.log(projectrolearrlist);
-
X.laydropdown(".adduser-role",projectrolearrlist,function(d){
cprojectdiv.html(d.title);
-
adduserData[cprojectindex]['role_name'] = d.title;
- adduserData[cprojectindex]['role_id'] = d.id;
+ adduserData[cprojectindex]['auth_id'] = d.id;
})
// 数据权限修改
@@ -3284,6 +3293,13 @@ var X = window.X || {
if(namearr.length > 0){
//创建账号
X.api("user/add_account","post",{account_list:namearr},function(d){
+ for(let i in adduserData){
+ for(let j in d['created_account']){
+ if(adduserData[i]['username'] == d['created_account'][j]){
+ adduserData[i]['role_id'] = d['id'][j]
+ }
+ }
+ }
//给账号添加项目角色
X.api("authz/add_role_domain","post",{data:adduserData},function(d){
X.pageLogic.useradmin.useradmin();
@@ -4798,6 +4814,8 @@ var X = window.X || {
// }
// }
// return;
+ console.log(xAxisData);
+ console.log(seriesData);
var myChart = echarts.init(document.getElementById('analysis-echarts'));
var option = {
tooltip: {
@@ -4976,16 +4994,58 @@ var X = window.X || {
})
});
}
+ });
+
+ //取消
+ $(document).off('click','.del_api_admin').on('click','.del_api_admin',function(){
+ var name = $(this).attr("data-name");
+ var path = $(this).attr("data-path");
+
+ X.api("authz/del_api_module","post",{auth_id: name,url:path},function(d){
+ layer.msg('修改成功');
+ me.updataapilist();
+ })
+ });
+
+ $(document).off("click",'.add_api_admin').on("click",".add_api_admin",function(){
+ var name = $(this).attr("data-name");
+ var path = $(this).attr("data-path");
+
+ X.api("authz/add_api_module","post",{auth_id: name,url:path},function(d){
+ layer.msg('修改成功');
+ me.updataapilist();
+ })
})
-
+
+ // 编辑
+ $(document).off('click','.update_api_admin').on('click','.update_api_admin',function(){
+ var name = $(this).attr("data-name");
+ var desc = $(this).attr("data-desc");
+ var path = $(this).attr("data-path");
+ var arr = {
+ name:name,
+ desc:desc,
+ path:path
+ }
+ X.parametersopen(arr,"apiadmin_add",'auto',function(){
+ me.updataapilist();
+ })
+ })
+
+
},
updataapilist:function(){
- X.laytabledata("#apiadmin-table","authz/api_list",[[
- {field:'name', title: '标题', width: '10%', sort: true}
- ,{field:'path', title: '路径'}
- ,{field:'desc', title: '简介',width: '60%'}
- ,{fixed: 'right', title:'操作', toolbar: '#apiadminbarDemo', width:117}
- ]],null,'685');
+
+ X.api("authz/api_list","get",{},function(d){
+ X.laytpldata("#eventattradmin-table-box-dot",d,".eventattradmin-table-box-dot");
+ })
+
+ // X.laytabledata("#apiadmin-table","authz/api_list",[[
+ // {field:'name', title: '标题', width: '10%', sort: true}
+ // ,{field:'path', title: '路径'}
+ // ,{field:'desc', title: '简介',width: '60%'}
+ // ,{fixed: 'right', title:'操作', toolbar: '#apiadminbarDemo', width:117}
+ // ]],null,'685');
}
};
})();
@@ -4997,32 +5057,55 @@ var X = window.X || {
this.parms = parms;
this.callback = parms.callback; //选择后执行的回调
var data = parms.extData;//获取到上层弹窗传的数据
- // console.log(data);
- if(data){
- $("#path").val(data.path);
- $("#name").val(data.name);
- $("#desc").val(data.desc);
- }
+ console.log(data);
+
+ X.api("authz/api_module","get",{},function(d){
+ X.laytpldata("#apiadd-apitype-box-dot",d,".apiadd-apitype-box",function(){
+ $('#editable-select').editableSelect({
+ bg_iframe: true,
+ case_sensitive: false,
+ items_then_scroll: 10 ,
+ isFilter:false
+ });
+ layui.form.render();
+ if(data != ""){
+ $("#editable-select_sele").val(data.name);
+ layui.form.val('addapifrom', {
+ "desc": data.desc
+ ,"path": data.path
+ });
+ }
+ });
+
+ });
+
$(document).off('click','.newwenjian-qd').on('click','.newwenjian-qd',function(){
- if($("#path").val() == "" && $("#name").val() == ""){
- layer.msg('标题,路径为必填项');
+ var roleinfo = layui.form.val("addapifrom");
+ for(let i in roleinfo){
+ if(roleinfo[i] == ""){
+ layer.msg('分类,名称,路径为必填项');
+ return;
+ }
+ }
+ if($("#editable-select_sele").val() == ""){
+ layer.msg('分类,名称,路径为必填项');
return;
}
var arr = {
- "path": $("#path").val(),
- "name": $("#name").val(),
- "desc": $("#desc").val()
+ "path": roleinfo.path,
+ "name": $("#editable-select_sele").val(),
+ "desc": roleinfo.desc
}
- if(!data){
+ if(data == ""){
X.api('authz/add_api','post',arr,function(d){
- layer.closeAll();
X.pageLogic.apiadmin.updataapilist();
+ layer.closeAll();
});
}else {
arr['id'] = data['_id'];
X.api('authz/edit_api','post',arr,function(d){
- layer.closeAll();
X.pageLogic.apiadmin.updataapilist();
+ layer.closeAll();
});
}
@@ -5587,11 +5670,13 @@ var X = window.X || {
this.parms = parms;
this.callback = parms.callback; //选择后执行的回调
var data = parms.extData;//获取到上层弹窗传的数据
+
+ var index = 0;
// 给条件框赋值
X.laytpldata("#zhuang-tab-dot",data,'.zhuang_tab ');
- X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
+ X.laytpldata("#zhuang-conetnt-dot",data[0],'.zhuang_conetnt ');
// 搜索框改变事件
$('.zhuanghu_ss #zhuanghu_txt').bind('input propertychange', function() {
@@ -5616,10 +5701,10 @@ var X = window.X || {
}
}
// $("#zhuang-conetnt-dot").html("");
- X.laytpldata("#zhuang-conetnt-dot",arrData,'.zhuang_conetnt ');
+ X.laytpldata("#zhuang-conetnt-dot",arrData[index],'.zhuang_conetnt ');
}else {
$('.zhuanghu_ss .qingkomg').hide();
- X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
+ X.laytpldata("#zhuang-conetnt-dot",data[index],'.zhuang_conetnt ');
}
});
@@ -5628,29 +5713,21 @@ var X = window.X || {
$('.zhuanghu_ss #zhuanghu_txt').val('');
X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
})
- var index = 0;
+
$(".zhuang_tab_box .zhuang_tab span").click(function(){
$(".zhuang_tab_box .zhuang_tab span div").removeClass('zhuanghu_xila_xian');
$(this).find('div').addClass('zhuanghu_xila_xian');
index = $(this).attr("data-index");
- if(index != 0){
- var dataArr = [];
- dataArr.push(data[index])
- X.laytpldata("#zhuang-conetnt-dot",dataArr,'.zhuang_conetnt ');
- }else {
- X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
- }
+ X.laytpldata("#zhuang-conetnt-dot",data[index],'.zhuang_conetnt ');
+
})
//单击属性
$(document).off('click','.zhuang_conetnt .ta-pso-line').on('click','.zhuang_conetnt .ta-pso-line',function(){
- var indexs = $(this).attr("data-indexs");
+ var indexs = $(this).attr("data-index");
var number = 0;
- if(index == 0){
- number = $(this).attr("data-index");
- }else {
- number = index
- }
+ number = index
+
var valdata = {
'title':$(this).attr('data-title'),
'id':$(this).attr('data-id'),
@@ -5915,15 +5992,15 @@ var X = window.X || {
updataselect_list();
- // X.uploadfile("data_mana/add_select_map","#fileupload",function(res){
- // updataselect_list();
- // });
+ X.uploadfile("data_mana/add_select_map","#fileupload",function(res){
+ updataselect_list();
+ });
function updataselect_list(){
X.api("data_mana/select_list","get",{},function(res){
X.laytpldata('#customname-content-box-dot',res,'.layui-tab-title');
X.laytpldata('#layui-tab-content-dot',res,'.layui-tab-content');
- console.log($(".customname-content-box").height())
+
$(".layui-tab-content").css('height',$(".customname-content-box").height());
})
@@ -5995,6 +6072,15 @@ var X = window.X || {
X.DATA["game"] = game;
//侧边栏数据渲染
me.freshMenu(id);
+
+ X.pagename(function(d){
+ console.log(d);
+ //当页面不在看板页面时选择项目后会自动调到看板页面
+ if(d != 'dashboard'){
+ $("#data_board a").click();
+ }
+ });
+
// X.pageLogic.dashboard.freshMenu(id);
});
@@ -6696,7 +6782,9 @@ var X = window.X || {
X.api('project/kanban',"post",{"_id":id},function (d){
X.DATA['KanBanData'] = d.kanban;
X.DATA['ProjectData'] = d.spaces;
- for(let i in d.spaces){
+ if(d.spaces.length > 0){
+ X.DATA.authority = d.spaces[0]['authority'];
+ for(let i in d.spaces){
if(d.spaces[i]['children'].length > 0){
if(d.spaces[i]['authority'] == "rw" && d.spaces[i]['children'][i]['user_id'] == X.DATA['userinfo']['userid']){
$(".baobiao").show();
@@ -6707,6 +6795,7 @@ var X = window.X || {
}
}
}
+ }
for(let i in d.spaces){
if(d.spaces[i]['children'].length > 0){
@@ -8871,7 +8960,7 @@ var X = window.X || {
this.callback = parms.callback;
var listdata = parms.extData.data;
var comparator = parms.extData.comparator;
- // console.log('aaa',listdata);
+ console.log('aaa',listdata);
X.laytpldata("#dropdownlist-con-box-dot",listdata,".dropdownlist-con-box");
@@ -10121,10 +10210,10 @@ var X = window.X || {
$(".importuser-qd").click(function(){
var xzprojectid = layui.form.val("example").interest;
-
- // X.api("","post",{_id:xzprojectid},function(){
- // layer.closeAll();
- // })
+ X.api("project/import_member","post",{games:xzprojectid,game:X['DATA']['game']},function(){
+ layer.closeAll();
+ X.pageLogic['useradmin'].useradmin();
+ })
})
}
@@ -10531,6 +10620,7 @@ var X = window.X || {
X.api('space/detail','post',{space_id:id},function(d){
$('.kongjian-mc-box-txt').val(d.name);
for(let i in d.members){
+ console.log(d.members[i]);
d.members[i]["firs"] = d.members[i]['name'].substring(0,1);
}
X.DATA['adduadaserarr'] = d.members;
@@ -11147,6 +11237,7 @@ var X = window.X || {
this.parms = parms;
this.callback = parms.callback;
var data = parms;
+ console.log('11',data);
X.laytpldata("#kanban-model-modify-table-dot",data,"model"+data.id,function(html){
@@ -11195,7 +11286,7 @@ var X = window.X || {
// }else {
$("#conent-box"+data.id).html(html);
// }
- console.log(data.reverseorder , data.name);
+ // console.log(data.reverseorder , data.name);
if(data.modeltype == "table" && data.modelsize != "small"){
var tableMul;
var id = 'dataTableMul'+data['id'];
@@ -11703,20 +11794,30 @@ var X = window.X || {
X.pageLogic['projectadmin'] = {
init : function(parms){
var role_id,datalist;
+ var system;
updataroles();
- function updataroles(){
+ function updataroles(roleid){
X.api("authz/roles","get",{},function(d){
+ // var roleid = roleid ? roleid : 0;
datalist = d;
- if(d[0]){
- role_id = d[0]['_id'];
- $(".projectadmin-list-name").html(d[0]["name"]);
- X.laytpldata("#projectadmin-con-hz-left-list-tit-xiangmu-dot",d,".projectadmin-con-hz-left-list-tit-xiangmu");
- updataapiinfo(d[0]['_id']);
+ if(roleid){
+ for(let i in d){
+ if(d[i]['auth_id'] == roleid){
+ updataapiinfo(d[i]);
+ }
+ }
}else {
- layer.msg('查无数据');
+ if(d[0]){
+ role_id = d[0]['auth_id'];
+ system = d[0]['system'];
+ $(".projectadmin-list-name").html(d[0]["name"]);
+ X.laytpldata("#projectadmin-con-hz-left-list-tit-xiangmu-dot",d,".projectadmin-con-hz-left-list-box");
+ updataapiinfo(d[0]);
+ }else {
+ layer.msg('查无数据');
+ }
}
-
- // X.laytpldata("#projectadmin-info-box-dot",d.sys_role[0]['authority'],".projectadmin-info-box");
+
});
}
@@ -11726,49 +11827,53 @@ var X = window.X || {
var url = $(this).attr("data-url");
});
+ var currentindex = 0;
+
$(document).off('click','.roleinproject-tit').on("click",".roleinproject-tit",function(){
var index = $(this).attr("data-index");
+ currentindex = index;
+ system = $(this).attr("data-system");
$(".projectadmin-con-hz-left-list-con").removeClass("selected___3ctlt");
$(this).addClass("selected___3ctlt");
$(".projectadmin-list-name").html(datalist[index]['name']);
- var id = $(this).attr("data-id");
- updataapiinfo(id);
- // X.laytpldata("#projectadmin-info-box-dot",data.dom_role[index]['authority'],".projectadmin-info-box");
+ role_id = $(this).attr("data-id");
+ updataapiinfo(datalist[index]);
});
- function updataapiinfo(id){
- role_id = id;
- X.api("authz/get_permissions_for_user_in_domain","post",{role_id:id,game:X['DATA']['game']},function(d){
- X.laytpldata("#projectadmin-info-box-dot",d,".projectadmin-info-box");
- });
+ function updataapiinfo(d){
+ console.log(d);
+ X.laytpldata("#projectadmin-info-box-dot",d,".projectadmin-info-box");
};
-
+
$(document).off('click','.projectadmin-del').on('click','.projectadmin-del',function(){
var index = $(this).attr('data-index');
var path = $(this).attr('data-path');
- layer.confirm('确认删除当前api吗?', {
- btn: ['取消','删除 '] //按钮
+ var path_name = $(this).attr("data-name");
+ layer.confirm('确认取消当前api的授权?', {
+ btn: ['取消','确认 '] //按钮
}, function(){
//取消
layer.close(layer.index);
}, function(){
//删除
- X.api("authz/del_policy",'post',{role_id:role_id,game:X['DATA']['game'],path:path,act:"*"},function(d){
- layer.msg('删除成功');
+ X.api("authz/del_policy",'post',{role_id:role_id,path:path,path_name: path_name,system:system},function(d){
+ console.log('11a23sd13as4d54a65'+ d);
layer.close(layer.index);
- updataapiinfo(role_id);
+ updataroles(role_id);
+ layer.msg('操作成功');
})
});
});
$(document).off('click','.projectadmin-edit').on('click','.projectadmin-edit',function(params){
+ var index = $(this).attr('data-index');
var path = $(this).attr('data-path');
- var arr = [];
- arr.push(path);
- X.api("authz/add_policy",'post',{role_id:role_id,game:X['DATA']['game'],path_list:arr,act:"*"},function(d){
+ var path_name = $(this).attr("data-name");
+ X.api("authz/add_policy",'post',{role_id:role_id,path:path,path_name:path_name,system:system},function(d){
layer.close(layer.index);
layer.msg('添加成功');
- updataapiinfo(role_id);
+ // updataapiinfo(datalist[currentindex]);
+ updataroles(role_id);
})
});
@@ -11797,7 +11902,7 @@ var X = window.X || {
layer.close(layer.index);
}, function(){
//删除
- X.api("authz/del_role_user_domain",'post',{role_id:id,game:X['DATA']['game'],username:name},function(d){
+ X.api("authz/del_role_user",'post',{role_id:id,game:X['DATA']['game'],username:name},function(d){
layer.close(layer.index);
layer.msg('删除成功');
updataroles();
@@ -13998,93 +14103,133 @@ var X = window.X || {
(function(){
X.pageLogic['search'] = {
init : function(){
- $(".search_pop .zhanghu_box").click(function(){
+
+ var data = {
+ 'user_arrt_title':'',//用户属性
+ 'user_arrt_id':'', //用户属性id
+ 'user_arrt_type':'', //用户属性type
+ 'comparator_title':'',//筛选条件
+ 'comparator_id':'', //筛选条件id
+ 'condition':'', //手动输入条件,区间用~符号隔开如0~10
+ 'start_time':'', //开始时间
+ 'end_time':'', //结束时间
+ 'pages': 1
+ }
+
+
+
+ var filter_props,filter_maparr;
+
+ X.api("data_mana/game_user_event_list","post",{cat:'user'},function(d){
+ filter_props = d;
+ X.api("data_auth/filter_map","get",{},function(d){
+ filter_maparr = d;
+
+ $(".search_top .zhanghu_box span").html(filter_props[0]['category'][0]['title']);
+ data['user_arrt_title'] = filter_props[0]['category'][0]['title'];
+ data['user_arrt_id'] = filter_props[0]['category'][0]['id'];
+ data['user_arrt_type'] = filter_props[0]['category'][0]['data_type'];
+
+ var comparatorarr = filter_maparr[filter_props[0]['category'][0]['data_type']]
+
+ data['comparator_title'] = comparatorarr[0]['title'];
+ data['comparator_id'] = comparatorarr[0]['id'];
+ istimeboxtype(filter_props[0]['category'][0]['data_type']);
+
+ var start = moment().subtract(6, 'days');
+ var end = moment();
+ var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
+ var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
+ data['start_time'] = startTime;
+ data['end_time'] = endTime
+
+ X.laytpldata("#judge-box-dot",filter_maparr[filter_props[0]['category'][0]['data_type']],'.judge_box');
+
+
+ });
+ });
+
+ function istimeboxtype(type){
+ if(type == "datetime"){
+ $(".search_left .judge_box").hide();
+ $(".search_left .search_txt").hide();
+ $(".search_left .time-box").show();
+ }else {
+ $(".search_left .judge_box").show();
+ $(".search_left .search_txt").show();
+ $(".search_left .time-box").hide();
+ }
+ };
+
+ $(document).off("click",'.search_pop .zhanghu_box').on('click','.search_pop .zhanghu_box',function(){
var obj = $(".search_pop .zhanghu_box");
var offset = obj.offset();
//点击按钮,数据,向左偏移,向右偏移
- X.querycriteriapop(X.DATA.search,'category',offset.left,offset.top+obj.height(),function(val){
-
+ X.querycriteriapop(filter_props,'category',offset.left,offset.top+obj.height(),function(val){
$(".search_top .zhanghu_box span").html(val.title);
- $(".search_top .zhanghu_box span").attr('data-id',val.id);
- $(".search_top .zhanghu_box span").attr('data-type',val.type);
- var judgeid = $(".search_left .judge_box").val();
- if(val.type == 'time'){
- //type为time是隐藏文本框,显示时间选择框
- $(".search_left .judge_box").hide();
- $(".search_left .search_txt").hide();
- $(".search_left .time-box").show();
- }else {
- $(".search_left .judge_box").show();
- if(judgeid == 4 || judgeid == 5 ){ //当judfeid 等于4和5时隐藏文本框,只显示下拉框
- $(".search_left .search_txt").hide();
- }else{
- $(".search_left .search_txt").show();
- }
- $(".search_left .time-box").hide();
- }
+ data['user_arrt_title'] = val.title;
+ data['user_arrt_id'] = val.id;
+ data['user_arrt_type'] = val.type;
+
+ var comparatorarr = filter_maparr[val.type];
+ data['comparator_title'] = comparatorarr[0]['title'];
+ data['comparator_id'] = comparatorarr[0]['id'];
+ // 渲染条件框数据
+ X.laytpldata("#judge-box-dot",filter_maparr[val.type],'.judge_box');
+ istimeboxtype(val.type)
});
});
- // 渲染条件框数据
- X.laytpldata("#judge-box-dot",X.DATA.search['condition'],'.judge_box');
+
+ $(document).off("click",'.user-id').on('click','.user-id',function(){
+ X['DATA']['search-user-id'] = $(this).attr("data-id");
+ X.gourl('userinfo','conetnt');
+ });
+
//渲染日期选择器
- X.daterender(".timechoice");
+ X.daterender(".timechoice",function(start,end,label){
+ var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
+ var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
+ data['start_time'] = startTime;
+ data['end_time'] = endTime;
+ });
// 下拉选项改变事件
$(".search_left .judge_box").change(function(){
var judgeid = $(this).val();
- if(judgeid == 4 || judgeid == 5){
- $('.search_left .search_txt').hide();
- }else {
- $('.search_left .search_txt').show();
- }
+ var judgetitle = $('.judge_box option:selected').text();
+ data['comparator_title'] = judgetitle;
+ data['comparator_id'] = judgeid;
+
});
// 搜索按钮单击事件
$(".search_top .searcg_but").click(function(){
- var typeid = $(".search_top .zhanghu_box span").attr('data-id');//属性id
- var type = $(".search_top .zhanghu_box span").attr('data-type');//属性id
- var condition = $(".search_left .judge_box").val(); //条件
- var details = $(".search_left .search_txt").val();//详情
- var time = $(".search_left .time-box .timechoice").val();//时间
- var timearr = time.split('-');
- var startdate = timearr[0]+ "-" + timearr[1] +"-"+ timearr[2];
- var enddate= timearr[3]+ "-" + timearr[4] +"-"+ timearr[5];
+ data['condition'] = $(".search_txt").val();
- var start = new Date(startdate);
- var starttime = Date.parse(start)/1000;
+ X.api('ck/seek_user','post', data ,function (val){
- var end = new Date(enddate);
- var endtime = Date.parse(end)/1000;
- var data;
- //当type为time时不用传condition,details,当condition为5或4时不用传details
- if( type != "time" ){
- if(condition == 4 || condition == 5){
- data = {
- typeid: typeid,
- condition:condition
+ X.api('ck/seek_user_count','post', data ,function (d){
+ $(".more_data span").html(d);
+ if(d > 10){
+ $(".search_pop .more_data-box").show();
+ X['ueser_search_data'] = data;
+ }else {
+ $(".search_pop .more_data-box").hide();
+ X['ueser_search_data'] = [];
}
- }else {
- data = {
- typeid: typeid,
- condition:condition,
- details:details
- }
- }
- }else {
- data = {
- typeid: typeid,
- starttime: starttime,
- endtime:endtime
- }
- }
- X.api('api/userquery',data,function (d){
- X.laytpldata("#search-data-dot",d.datalist,".search_pop .search_data");
- $(".more_data span").html(d.totalNum);
- $(".search_pop .more_data-box").show();
+ })
+
+ X.laytpldata("#search-data-dot",val.refer.values,".search_pop .search_data",function(){
+
+ });
+ // $(".more_data span").html(d.totalNum);
});
- })
+ });
+
+
+
},
};
})();
@@ -14655,11 +14800,11 @@ var X = window.X || {
},
useradmin : function(id){
X.tabledata('#userdata','project/members',[[
- {field:'name', width:180, title: '成员账号', sort: true}
- ,{field:'nickname', width:180, title: '成员显示名'}
- ,{field:'role', width:180, title: '项目角色', sort: true}
- ,{field:'data_auth', width:180, title: '数据权限'}
- ,{field:'sign', title: '所属成员组', width: 180}
+ {field:'name', title: '成员账号', sort: true}
+ ,{field:'nickname', title: '成员显示名'}
+ ,{field:'role', title: '项目角色', sort: true}
+ // ,{field:'data_auth', width:180, title: '数据权限'}
+ // ,{field:'sign', title: '所属成员组', width: 180}
,{field:'last_login_ts', title: '最后访问时间', sort: true}
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:80}
]]);
@@ -14861,6 +15006,222 @@ var X = window.X || {
}
};
})();
+// srczip/logic/userinfo.js
+(function(){
+ X.pageLogic['userinfo'] = {
+ init : function(parms){
+ var me = this;
+
+ var event_list,start_time,end_time,userdata;
+
+
+ // 日期渲染
+ X.daterender("#analtsis-condition-date",function(start, end, label){
+ var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
+ var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
+ start_time = startTime;
+ end_time = endTime;
+ updatasolouser();
+ })
+
+ $(document).off('click','.userinfo-event-list-title-box').on('click','.userinfo-event-list-title-box',function(){
+
+ if($(this).next().css('display') == 'block'){
+ $(this).next().hide();
+ }else {
+ $(this).next().show();
+ }
+
+ });
+
+ X.api("ck/event_list","get",{},function(d){
+ event_list = d;
+ if(X['DATA']['search-user-id']){
+ updatasolouser();
+ }
+ });
+
+
+ $(document).off('click','.analtsis-condition').on('click','.analtsis-condition',function(){
+ var type = $(".userinfo-pie-echarts").css("display");
+ if(type == 'none'){
+ $(".analysis-echarts").css("width","calc( 100% - 401px)");
+ $(".userinfo-pie-echarts").show();
+ }else {
+ $(".analysis-echarts").css("width","100%");
+ $(".userinfo-pie-echarts").hide();
+ }
+
+ userinfoechert(userdata.event_count);
+ if(userdata.proportion.length > 0){
+ userinfopieechart(userdata.proportion);
+ }
+ });
+
+ function updatasolouser(){
+ var time = $("#analtsis-condition-date").val();
+ var timearr = time.split(" ");
+ start_time = timearr[0] + " "+"00:00:00";
+ end_time = timearr[2]+" "+"23:59:59";
+
+ X.api("ck/solo_user","post",{account_id:X.DATA['search-user-id'],event_list:event_list,start_time:start_time,end_time:end_time},function(val){
+ userdata = val
+ if(val.event_count.length > 0){
+ userinfoechert(val.event_count);
+ }
+ if(val.proportion.length > 0){
+ userinfopieechart(val.proportion);
+ }
+ X.laytpldata("#user-left-content-box-dot",val['details_data'],".user-left-content-box",function(){});
+
+ X.laytpldata("#userinfo-event-box-dot",val['details_user'],".userinfo-event-box",function(){});
+
+ })
+ };
+
+ function userinfopieechart(data){
+
+ var myChart = echarts.init(document.getElementById('userinfo-pie'));
+
+ var option = {
+ color: ['#4daef5','#5dd7d1','#bae5f6','#f8e7bb','#ad91d9','#7be0b8','#f78499','#fa9c6d','#fecde2','#677a9b','#4295da'],
+ title: {
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a}
{b} : {c} ({d}%)'
+ },
+ label:{
+ formatter: '{b}\n{d}%',
+ },
+ series: [
+ {
+ name: '姓名',
+ type: 'pie',
+ radius: '50%',
+ center: ['50%', '50%'],
+ data: data,
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ myChart.setOption(option,true);
+ };
+
+ function userinfoechert(data){
+ var xAxisData = data.date;
+ var seriesData = [];
+ var arr = {
+ name:'总量',
+ type: 'bar',
+ barWidth : 30,
+ data: data.event_values,
+ }
+ seriesData.push(arr);
+
+ var myChart = echarts.init(document.getElementById('userinfo-echarts'));
+
+ var option = {
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ color: X.DATA.echartscolor,
+ grid: {
+ left: '2%',
+ right: '2%',
+ bottom: '2%',
+ top: '10%',
+ containLabel: true
+ },
+ xAxis: [
+ {
+ type: 'category',
+ axisTick: {show: false},
+ data: xAxisData
+ }
+ ],
+ yAxis: [
+ {
+ type: 'value'
+ }
+ ],
+ series: seriesData
+ };
+ myChart.resize();
+ myChart.setOption(option,true);
+ }
+
+
+ }
+ };
+})();
+
+// srczip/logic/userinfolist.js
+//cc
+(function(){
+ X.pageLogic['userinfolist'] = {
+ init : function(){
+
+ var data = X['ueser_search_data'];
+
+ updatauserlist();
+ X.api('ck/seek_user_count','post', X['ueser_search_data'] ,function (d){
+
+ $(".userinfolist_body_line_left_num span").html(d);
+ layui.laypage.render({
+ elem: 'laypages' //注意,这里的 test1 是 ID,不用加 # 号
+ ,count: d, //数据总数,从服务端得到
+ limit:10, //每页条数设置
+ jump: function(obj, first){
+
+ data['pages']=obj.curr; //改变当前页码
+
+ //首次不执行
+ if(!first){
+ updatauserlist(); //加载数据
+ }
+ }
+ });
+ });
+
+ $(document).off("click",'.userinfolist-page_table .table-fixed tbody tr td').on("click",".userinfolist-page_table .table-fixed tbody tr td",function(){
+ var id = $(this).attr("data-id");
+ X['DATA']['search-user-id'] = id;
+ X.gourl('userinfo','conetnt');
+ });
+
+ function updatauserlist(){
+ X.api('ck/seek_user','post', data ,function (val){
+ X.laytpldata("#userinfolist-title-box-dot",val.details_data.new_columns,".userinfolist-title-box");
+ X.laytpldata("#userinfolist-list-box-dot",val.details_data.new_values,".userinfolist-list-box",function(){
+ var tableMul = new FixedTable("dataTableMul-userlist", 1);
+ });
+ });
+
+ };
+
+ //下载
+ $(document).off("click",'.download-user-data').on("click",".download-user-data",function(){
+
+ X.download('ck/download_user',data,'用户报表');
+
+ });
+
+
+ },
+ };
+})();
+
// srczip/logic/userlabel.js
(function(){
X.pageLogic['userlabel'] = {
diff --git a/web/srczip/base/ajaxpage.js b/web/srczip/base/ajaxpage.js
index e9d08ee..fd8119d 100644
--- a/web/srczip/base/ajaxpage.js
+++ b/web/srczip/base/ajaxpage.js
@@ -49,6 +49,7 @@
X.DATA['eventid'] = "";
X.DATA['ltvid'] = "";
X.DATA['retentionid'] = "";
+ layer.closeAll();
};
diff --git a/web/srczip/common.js b/web/srczip/common.js
index 2d9641b..936d746 100644
--- a/web/srczip/common.js
+++ b/web/srczip/common.js
@@ -187,9 +187,9 @@ var X = window.X || {
},
success:function(d){
layer.close(index);
-
+ console.log(d);
if(d.code == 0){
- if( JSON.stringify(d.data) != "{}" && JSON.stringify(d.data) != "[]"){
+ if( JSON.stringify(d.data) != "{}" && JSON.stringify(d.data) != "[]" && d.data != null && d.data != ""){
callback && callback(d.data);
}else {
layer.msg('查无数据');
@@ -277,6 +277,14 @@ var X = window.X || {
});
};
+ //获取当前页面名
+ X.pagename = function(callback){
+ var search = window.location.href;
+ var searcharr = search.split('=');
+ var pagearr = searcharr[1].split("&");
+ callback && callback(pagearr[0]);
+ };
+
//提交修改记录
X.submitrecord = function(content){
var game = X.game;//项目名
diff --git a/web/srczip/logic/addexistuser.js b/web/srczip/logic/addexistuser.js
index 294722f..064631e 100644
--- a/web/srczip/logic/addexistuser.js
+++ b/web/srczip/logic/addexistuser.js
@@ -19,16 +19,16 @@
X.laytpldata("#addexistuser-con-user-box-dot",d,".addexistuser-con-user-box");
});
- X.api("project/members","get",{},function(d){
+ // X.api("project/members","get",{},function(d){
// console.log(d)
// X.laytpldata("#addexistuser-con-user-box-dot",d,".addexistuser-con-user-box");
- });
+ // });
X.api("authz/roles","get",{},function(d){
var projectrolearrlist = [];
for(let i in d){
var arr={
- id:d[i]['_id'],
+ id:d[i]['auth_id'],
title:d[i]['name'],
game:d[i]['game']
}
@@ -171,13 +171,14 @@
});
//确定按钮
$(".addexistuser-btn-qd").click(function(){
-
+
var ylist = [];
for(let i in Addeddate){
var arr = {
username:Addeddate[i]['name'],
- role_id:Addeddate[i]['role_id'],
- game:X.DATA.game
+ auth_id:Addeddate[i]['role_id'],
+ game:X.DATA.game,
+ role_id:Addeddate[i]['_id']
}
ylist.push(arr)
}
@@ -186,7 +187,9 @@
layer.msg('暂未选择用户');
return;
}
+
X.api("authz/add_role_domain","post",{data:ylist},function(d){
+ X.pageLogic['useradmin'].useradmin();
layer.closeAll();
});
});
diff --git a/web/srczip/logic/addrole.js b/web/srczip/logic/addrole.js
index cb887ec..c698909 100644
--- a/web/srczip/logic/addrole.js
+++ b/web/srczip/logic/addrole.js
@@ -4,7 +4,7 @@
var me = this;
var data;
- X.api("authz/api_list","get",{},function(d){
+ X.api("authz/api_module","get",{},function(d){
data = d;
X.laytpldata("#addrole-info-table-con-dot",d,".addrole-info-table-con");
layui.form.render();
@@ -14,15 +14,15 @@
this.parms = parms;
var passdata = parms;
- X.api("authz/get_permissions_for_user_in_domain","post",{role_id:passdata.id,game:X['DATA']['game']},function(d){
+ // X.api("authz/get_permissions_for_user_in_domain","post",{role_id:passdata.id,game:X['DATA']['game']},function(d){
- $('.addrole-tit').val(passdata.title);
- var selinput = {}
- for(let i in d){
- selinput[d[i]['_id']] = true
- }
- layui.form.val('addroleexample', selinput)
- });
+ // $('.addrole-tit').val(passdata.title);
+ // var selinput = {}
+ // for(let i in d){
+ // selinput[d[i]['_id']] = true
+ // }
+ // layui.form.val('addroleexample', selinput)
+ // });
};
// layui.form.on('checkbox(addrolelist)', function(data){
@@ -40,34 +40,34 @@
$(document).off('click','.addrole-list-qx').on('click','.addrole-list-qx',function(){
var selinput = {}
for(let i in data){
- selinput[data[i]['path']] = true
+ selinput[data[i][0]] = true
}
layui.form.val('addroleexample', selinput)
});
$(document).off('click','.addrole-qd').on('click','.addrole-qd',function(){
+ var roleinfo = layui.form.val("roleinfo");
var tit = $(".addrole-tit").val();
var addroledata = layui.form.val("addroleexample");
-
var dataArr =[];
for(let i in addroledata){
dataArr.push(i);
}
if(passdata){
// X.api("authz/add_roles","post",{name:tit,game:X['DATA']['game'],desc:'111'},function(d){
-
// X.api("authz/add_policy","post",{role_id:d,game:X['DATA']['game'],act:"*",path_list:dataArr},function(d){
// layer.msg("创建成功");
// $(".addrole-qx a").click();
// })
// })
}else{
- X.api("authz/add_roles","post",{name:tit,game:X['DATA']['game'],desc:'111'},function(d){
+
+ X.api("authz/add_roles","post",{name:roleinfo.title,system: roleinfo.roletype,path_name:dataArr},function(d){
- X.api("authz/add_policy","post",{role_id:d,game:X['DATA']['game'],act:"*",path_list:dataArr},function(d){
- layer.msg("创建成功");
- $(".addrole-qx a").click();
- })
+ layer.msg("创建成功");
+ $(".addrole-qx a").click();
+ // X.api("authz/add_policy","post",{role_id:d,game:X['DATA']['game'],act:"*",},function(d){
+ // })
})
}
diff --git a/web/srczip/logic/adduser.js b/web/srczip/logic/adduser.js
index 13be1cd..fc0dd6d 100644
--- a/web/srczip/logic/adduser.js
+++ b/web/srczip/logic/adduser.js
@@ -11,12 +11,12 @@
projectrolearr = d;
for(let i in projectrolearr){
var arr={
- id:projectrolearr[i]['_id'],
- title:projectrolearr[i]['name'],
- game:projectrolearr[i]['game']
+ id:projectrolearr[i]['auth_id'],
+ title:projectrolearr[i]['name']
}
projectrolearrlist.push(arr);
}
+ console.log(projectrolearrlist);
})
// var datarightsarr;
// X.api("data_auth/list","get",{},function(d){
@@ -32,7 +32,7 @@
"game": X.DATA.game,
"username": titarr[i],
"role_name": projectrolearr[0]["name"],
- "role_id": projectrolearr[0]["_id"]
+ "auth_id": projectrolearr[0]["auth_id"]
// "data_authority":datarightsarr[0]["title"],
// "data_auth_id":datarightsarr[0]["id"]
}
@@ -66,13 +66,10 @@
function update(){
X.laytpldata("#adduser-table-con-box-dot",adduserData,".adduser-table-con-box");
// 项目角色修改
- // console.log(projectrolearrlist);
-
X.laydropdown(".adduser-role",projectrolearrlist,function(d){
cprojectdiv.html(d.title);
-
adduserData[cprojectindex]['role_name'] = d.title;
- adduserData[cprojectindex]['role_id'] = d.id;
+ adduserData[cprojectindex]['auth_id'] = d.id;
})
// 数据权限修改
@@ -97,6 +94,13 @@
if(namearr.length > 0){
//创建账号
X.api("user/add_account","post",{account_list:namearr},function(d){
+ for(let i in adduserData){
+ for(let j in d['created_account']){
+ if(adduserData[i]['username'] == d['created_account'][j]){
+ adduserData[i]['role_id'] = d['id'][j]
+ }
+ }
+ }
//给账号添加项目角色
X.api("authz/add_role_domain","post",{data:adduserData},function(d){
X.pageLogic.useradmin.useradmin();
diff --git a/web/srczip/logic/analysis.js b/web/srczip/logic/analysis.js
index 454ffc6..f4848ed 100644
--- a/web/srczip/logic/analysis.js
+++ b/web/srczip/logic/analysis.js
@@ -1137,6 +1137,8 @@
// }
// }
// return;
+ console.log(xAxisData);
+ console.log(seriesData);
var myChart = echarts.init(document.getElementById('analysis-echarts'));
var option = {
tooltip: {
diff --git a/web/srczip/logic/apiadmin.js b/web/srczip/logic/apiadmin.js
index ee9134a..3878ec5 100644
--- a/web/srczip/logic/apiadmin.js
+++ b/web/srczip/logic/apiadmin.js
@@ -32,16 +32,58 @@
})
});
}
+ });
+
+ //取消
+ $(document).off('click','.del_api_admin').on('click','.del_api_admin',function(){
+ var name = $(this).attr("data-name");
+ var path = $(this).attr("data-path");
+
+ X.api("authz/del_api_module","post",{auth_id: name,url:path},function(d){
+ layer.msg('修改成功');
+ me.updataapilist();
+ })
+ });
+
+ $(document).off("click",'.add_api_admin').on("click",".add_api_admin",function(){
+ var name = $(this).attr("data-name");
+ var path = $(this).attr("data-path");
+
+ X.api("authz/add_api_module","post",{auth_id: name,url:path},function(d){
+ layer.msg('修改成功');
+ me.updataapilist();
+ })
})
-
+
+ // 编辑
+ $(document).off('click','.update_api_admin').on('click','.update_api_admin',function(){
+ var name = $(this).attr("data-name");
+ var desc = $(this).attr("data-desc");
+ var path = $(this).attr("data-path");
+ var arr = {
+ name:name,
+ desc:desc,
+ path:path
+ }
+ X.parametersopen(arr,"apiadmin_add",'auto',function(){
+ me.updataapilist();
+ })
+ })
+
+
},
updataapilist:function(){
- X.laytabledata("#apiadmin-table","authz/api_list",[[
- {field:'name', title: '标题', width: '10%', sort: true}
- ,{field:'path', title: '路径'}
- ,{field:'desc', title: '简介',width: '60%'}
- ,{fixed: 'right', title:'操作', toolbar: '#apiadminbarDemo', width:117}
- ]],null,'685');
+
+ X.api("authz/api_list","get",{},function(d){
+ X.laytpldata("#eventattradmin-table-box-dot",d,".eventattradmin-table-box-dot");
+ })
+
+ // X.laytabledata("#apiadmin-table","authz/api_list",[[
+ // {field:'name', title: '标题', width: '10%', sort: true}
+ // ,{field:'path', title: '路径'}
+ // ,{field:'desc', title: '简介',width: '60%'}
+ // ,{fixed: 'right', title:'操作', toolbar: '#apiadminbarDemo', width:117}
+ // ]],null,'685');
}
};
})();
\ No newline at end of file
diff --git a/web/srczip/logic/apiadmin_add.js b/web/srczip/logic/apiadmin_add.js
index 7236dce..9f10cca 100644
--- a/web/srczip/logic/apiadmin_add.js
+++ b/web/srczip/logic/apiadmin_add.js
@@ -5,32 +5,55 @@
this.parms = parms;
this.callback = parms.callback; //选择后执行的回调
var data = parms.extData;//获取到上层弹窗传的数据
- // console.log(data);
- if(data){
- $("#path").val(data.path);
- $("#name").val(data.name);
- $("#desc").val(data.desc);
- }
+ console.log(data);
+
+ X.api("authz/api_module","get",{},function(d){
+ X.laytpldata("#apiadd-apitype-box-dot",d,".apiadd-apitype-box",function(){
+ $('#editable-select').editableSelect({
+ bg_iframe: true,
+ case_sensitive: false,
+ items_then_scroll: 10 ,
+ isFilter:false
+ });
+ layui.form.render();
+ if(data != ""){
+ $("#editable-select_sele").val(data.name);
+ layui.form.val('addapifrom', {
+ "desc": data.desc
+ ,"path": data.path
+ });
+ }
+ });
+
+ });
+
$(document).off('click','.newwenjian-qd').on('click','.newwenjian-qd',function(){
- if($("#path").val() == "" && $("#name").val() == ""){
- layer.msg('标题,路径为必填项');
+ var roleinfo = layui.form.val("addapifrom");
+ for(let i in roleinfo){
+ if(roleinfo[i] == ""){
+ layer.msg('分类,名称,路径为必填项');
+ return;
+ }
+ }
+ if($("#editable-select_sele").val() == ""){
+ layer.msg('分类,名称,路径为必填项');
return;
}
var arr = {
- "path": $("#path").val(),
- "name": $("#name").val(),
- "desc": $("#desc").val()
+ "path": roleinfo.path,
+ "name": $("#editable-select_sele").val(),
+ "desc": roleinfo.desc
}
- if(!data){
+ if(data == ""){
X.api('authz/add_api','post',arr,function(d){
- layer.closeAll();
X.pageLogic.apiadmin.updataapilist();
+ layer.closeAll();
});
}else {
arr['id'] = data['_id'];
X.api('authz/edit_api','post',arr,function(d){
- layer.closeAll();
X.pageLogic.apiadmin.updataapilist();
+ layer.closeAll();
});
}
diff --git a/web/srczip/logic/category.js b/web/srczip/logic/category.js
index fa23825..2452384 100644
--- a/web/srczip/logic/category.js
+++ b/web/srczip/logic/category.js
@@ -6,11 +6,13 @@
this.parms = parms;
this.callback = parms.callback; //选择后执行的回调
var data = parms.extData;//获取到上层弹窗传的数据
+
+ var index = 0;
// 给条件框赋值
X.laytpldata("#zhuang-tab-dot",data,'.zhuang_tab ');
- X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
+ X.laytpldata("#zhuang-conetnt-dot",data[0],'.zhuang_conetnt ');
// 搜索框改变事件
$('.zhuanghu_ss #zhuanghu_txt').bind('input propertychange', function() {
@@ -35,10 +37,10 @@
}
}
// $("#zhuang-conetnt-dot").html("");
- X.laytpldata("#zhuang-conetnt-dot",arrData,'.zhuang_conetnt ');
+ X.laytpldata("#zhuang-conetnt-dot",arrData[index],'.zhuang_conetnt ');
}else {
$('.zhuanghu_ss .qingkomg').hide();
- X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
+ X.laytpldata("#zhuang-conetnt-dot",data[index],'.zhuang_conetnt ');
}
});
@@ -47,29 +49,21 @@
$('.zhuanghu_ss #zhuanghu_txt').val('');
X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
})
- var index = 0;
+
$(".zhuang_tab_box .zhuang_tab span").click(function(){
$(".zhuang_tab_box .zhuang_tab span div").removeClass('zhuanghu_xila_xian');
$(this).find('div').addClass('zhuanghu_xila_xian');
index = $(this).attr("data-index");
- if(index != 0){
- var dataArr = [];
- dataArr.push(data[index])
- X.laytpldata("#zhuang-conetnt-dot",dataArr,'.zhuang_conetnt ');
- }else {
- X.laytpldata("#zhuang-conetnt-dot",data,'.zhuang_conetnt ');
- }
+ X.laytpldata("#zhuang-conetnt-dot",data[index],'.zhuang_conetnt ');
+
})
//单击属性
$(document).off('click','.zhuang_conetnt .ta-pso-line').on('click','.zhuang_conetnt .ta-pso-line',function(){
- var indexs = $(this).attr("data-indexs");
+ var indexs = $(this).attr("data-index");
var number = 0;
- if(index == 0){
- number = $(this).attr("data-index");
- }else {
- number = index
- }
+ number = index
+
var valdata = {
'title':$(this).attr('data-title'),
'id':$(this).attr('data-id'),
diff --git a/web/srczip/logic/dashboard.js b/web/srczip/logic/dashboard.js
index 6fd4330..3036234 100644
--- a/web/srczip/logic/dashboard.js
+++ b/web/srczip/logic/dashboard.js
@@ -60,6 +60,15 @@
X.DATA["game"] = game;
//侧边栏数据渲染
me.freshMenu(id);
+
+ X.pagename(function(d){
+ console.log(d);
+ //当页面不在看板页面时选择项目后会自动调到看板页面
+ if(d != 'dashboard'){
+ $("#data_board a").click();
+ }
+ });
+
// X.pageLogic.dashboard.freshMenu(id);
});
@@ -774,8 +783,6 @@
}
}
}
-
-
}
for(let i in d.spaces){
diff --git a/web/srczip/logic/defaultrole.js b/web/srczip/logic/defaultrole.js
new file mode 100644
index 0000000..3bdcf57
--- /dev/null
+++ b/web/srczip/logic/defaultrole.js
@@ -0,0 +1,122 @@
+(function(){
+ X.pageLogic['defaultrole'] = {
+ init : function(parms){
+ var role_id,datalist;
+ updataroles();
+ function updataroles(){
+ X.api("authz/roles","get",{},function(d){
+ datalist = d;
+ if(d[0]){
+ role_id = d[0]['_id'];
+ $(".projectadmin-list-name").html(d[0]["name"]);
+ X.laytpldata("#projectadmin-con-hz-left-list-tit-xiangmu-dot",d,".projectadmin-con-hz-left-list-tit-xiangmu");
+ updataapiinfo(d[0]['_id']);
+ }else {
+ layer.msg('查无数据');
+ }
+
+ // X.laytpldata("#projectadmin-info-box-dot",d.sys_role[0]['authority'],".projectadmin-info-box");
+ });
+ }
+
+ $(document).off('click',".menu_dapax .item_kuvn").on('click',".menu_dapax .item_kuvn",function(){
+ $(".menu_dapax .item_kuvn").removeClass("selected___3ctlt");
+ $(this).addClass("selected___3ctlt");
+ var url = $(this).attr("data-url");
+ });
+
+ $(document).off('click','.roleinproject-tit').on("click",".roleinproject-tit",function(){
+ var index = $(this).attr("data-index");
+ $(".projectadmin-con-hz-left-list-con").removeClass("selected___3ctlt");
+ $(this).addClass("selected___3ctlt");
+ $(".projectadmin-list-name").html(datalist[index]['name']);
+ var id = $(this).attr("data-id");
+ updataapiinfo(id);
+ // X.laytpldata("#projectadmin-info-box-dot",data.dom_role[index]['authority'],".projectadmin-info-box");
+ });
+
+ function updataapiinfo(id){
+ role_id = id;
+ X.api("authz/get_permissions_for_user_in_domain","post",{role_id:id,game:X['DATA']['game']},function(d){
+ X.laytpldata("#projectadmin-info-box-dot",d,".projectadmin-info-box");
+ });
+ };
+
+ $(document).off('click','.projectadmin-del').on('click','.projectadmin-del',function(){
+ var index = $(this).attr('data-index');
+ var path = $(this).attr('data-path');
+ layer.confirm('确认删除当前api吗?', {
+ btn: ['取消','删除 '] //按钮
+ }, function(){
+ //取消
+ layer.close(layer.index);
+ }, function(){
+ //删除
+ X.api("authz/del_policy",'post',{role_id:role_id,game:X['DATA']['game'],path:path,act:"*"},function(d){
+ layer.msg('删除成功');
+ layer.close(layer.index);
+ updataapiinfo(role_id);
+ })
+ });
+ });
+
+ $(document).off('click','.projectadmin-edit').on('click','.projectadmin-edit',function(params){
+ var path = $(this).attr('data-path');
+ var arr = [];
+ arr.push(path);
+ X.api("authz/add_policy",'post',{role_id:role_id,game:X['DATA']['game'],path_list:arr,act:"*"},function(d){
+ layer.close(layer.index);
+ layer.msg('添加成功');
+ updataapiinfo(role_id);
+ })
+ });
+
+ $(document).off('click','.projectadmin-gongduo').on('click','.projectadmin-gongduo',function(e){
+ e.stopPropagation();
+ var obj = $(this);
+ var offset = obj.offset();
+ var id = obj.attr('data-id');
+ var name = obj.attr("data-name");
+ var arr = [
+ {
+ title:'重命名',
+ id:'edit'
+ },
+ {
+ title:'删除',
+ id:'del'
+ }
+ ]
+ X.querycriteriapop(arr,'dropdownlist',offset.left,offset.top+obj.height(),function(val){
+ if(val.id == 'del'){
+ layer.confirm('确认删除当前角色吗?', {
+ btn: ['取消','删除 '] //按钮
+ }, function(){
+ //取消
+ layer.close(layer.index);
+ }, function(){
+ //删除
+ X.api("authz/del_role_user_domain",'post',{role_id:id,game:X['DATA']['game'],username:name},function(d){
+ layer.close(layer.index);
+ layer.msg('删除成功');
+ updataroles();
+ })
+ });
+ }else {
+ var arr = {
+ id:id,
+ title:$(".projectadmin-list-name").html()
+ }
+ X.parametersopen(arr,"roleeditname",'auto',function(d){
+ updataroles();
+ })
+ }
+ })
+ });
+
+
+
+
+ }
+ };
+})();
\ No newline at end of file
diff --git a/web/srczip/logic/dropdownlist3.js b/web/srczip/logic/dropdownlist3.js
index 3f1d80e..f92f975 100644
--- a/web/srczip/logic/dropdownlist3.js
+++ b/web/srczip/logic/dropdownlist3.js
@@ -6,7 +6,7 @@
this.callback = parms.callback;
var listdata = parms.extData.data;
var comparator = parms.extData.comparator;
- // console.log('aaa',listdata);
+ console.log('aaa',listdata);
X.laytpldata("#dropdownlist-con-box-dot",listdata,".dropdownlist-con-box");
diff --git a/web/srczip/logic/eventmanagement.js b/web/srczip/logic/eventmanagement.js
index 647337c..2f97f99 100644
--- a/web/srczip/logic/eventmanagement.js
+++ b/web/srczip/logic/eventmanagement.js
@@ -11,8 +11,16 @@
me.eventmanagementlist();
})
}
- })
+ });
+ $(document).off('click','.eventattradmin-actions___141YT').on('click','.eventattradmin-actions___141YT',function(){
+
+ X.parametersopen(1,"personalsettingsedit",'auto',function(){
+
+ me.eventmanagementlist();
+ })
+
+ });
},
eventmanagementlist : function(){
diff --git a/web/srczip/logic/importuser.js b/web/srczip/logic/importuser.js
index 348a446..ef627b8 100644
--- a/web/srczip/logic/importuser.js
+++ b/web/srczip/logic/importuser.js
@@ -18,10 +18,10 @@
$(".importuser-qd").click(function(){
var xzprojectid = layui.form.val("example").interest;
-
- // X.api("","post",{_id:xzprojectid},function(){
- // layer.closeAll();
- // })
+ X.api("project/import_member","post",{games:xzprojectid,game:X['DATA']['game']},function(){
+ layer.closeAll();
+ X.pageLogic['useradmin'].useradmin();
+ })
})
}
diff --git a/web/srczip/logic/kongjianshezhi.js b/web/srczip/logic/kongjianshezhi.js
index 95e9c6f..716b95d 100644
--- a/web/srczip/logic/kongjianshezhi.js
+++ b/web/srczip/logic/kongjianshezhi.js
@@ -26,6 +26,7 @@
X.api('space/detail','post',{space_id:id},function(d){
$('.kongjian-mc-box-txt').val(d.name);
for(let i in d.members){
+ console.log(d.members[i]);
d.members[i]["firs"] = d.members[i]['name'].substring(0,1);
}
X.DATA['adduadaserarr'] = d.members;
diff --git a/web/srczip/logic/modeltable.js b/web/srczip/logic/modeltable.js
index 04aa42f..48ea509 100644
--- a/web/srczip/logic/modeltable.js
+++ b/web/srczip/logic/modeltable.js
@@ -5,6 +5,7 @@
this.parms = parms;
this.callback = parms.callback;
var data = parms;
+ console.log('11',data);
X.laytpldata("#kanban-model-modify-table-dot",data,"model"+data.id,function(html){
@@ -53,7 +54,7 @@
// }else {
$("#conent-box"+data.id).html(html);
// }
- console.log(data.reverseorder , data.name);
+ // console.log(data.reverseorder , data.name);
if(data.modeltype == "table" && data.modelsize != "small"){
var tableMul;
var id = 'dataTableMul'+data['id'];
diff --git a/web/srczip/logic/operation.js b/web/srczip/logic/operation.js
new file mode 100644
index 0000000..fa5f2c0
--- /dev/null
+++ b/web/srczip/logic/operation.js
@@ -0,0 +1,12 @@
+(function(){
+ X.pageLogic['operation'] = {
+ init : function(parms){
+ var me = this;
+
+ X.layuipages("operation-pages",50,function(e){
+ console.log(e);
+ });
+
+ }
+ };
+})();
\ No newline at end of file
diff --git a/web/srczip/logic/personalsettingsedit.js b/web/srczip/logic/personalsettingsedit.js
index 175ad54..755048e 100644
--- a/web/srczip/logic/personalsettingsedit.js
+++ b/web/srczip/logic/personalsettingsedit.js
@@ -6,18 +6,20 @@
this.callback = parms.callback; //选择后执行的回调
var data = parms.extData;//获取到上层弹窗传的数据
layui.form.render();
- if(data){
+ if(data != 1 && data){
layui.form.val('personalsettingseditexample', {
"show_name": data.show_name // "name": "value"
,"desc": data.desc
,"is_show":(data.is_show)? 1 : 0
});
+ }else {
+
}
$(document).off('click','.personalsettingsedit-qd').on('click','.personalsettingsedit-qd',function(){
var arr = layui.form.val('personalsettingseditexample');
arr['event_name'] = data.name;
X.api("data_mana/event_edit","post",arr,function(d){
- layer.msg("修改成功");
+ layer.msg("保存成功");
me.callback && me.callback(d);
layer.closeAll();
})
diff --git a/web/srczip/logic/projectadmin.js b/web/srczip/logic/projectadmin.js
index 172377c..ec4dd57 100644
--- a/web/srczip/logic/projectadmin.js
+++ b/web/srczip/logic/projectadmin.js
@@ -2,20 +2,30 @@
X.pageLogic['projectadmin'] = {
init : function(parms){
var role_id,datalist;
+ var system;
updataroles();
- function updataroles(){
+ function updataroles(roleid){
X.api("authz/roles","get",{},function(d){
+ // var roleid = roleid ? roleid : 0;
datalist = d;
- if(d[0]){
- role_id = d[0]['_id'];
- $(".projectadmin-list-name").html(d[0]["name"]);
- X.laytpldata("#projectadmin-con-hz-left-list-tit-xiangmu-dot",d,".projectadmin-con-hz-left-list-tit-xiangmu");
- updataapiinfo(d[0]['_id']);
+ if(roleid){
+ for(let i in d){
+ if(d[i]['auth_id'] == roleid){
+ updataapiinfo(d[i]);
+ }
+ }
}else {
- layer.msg('查无数据');
+ if(d[0]){
+ role_id = d[0]['auth_id'];
+ system = d[0]['system'];
+ $(".projectadmin-list-name").html(d[0]["name"]);
+ X.laytpldata("#projectadmin-con-hz-left-list-tit-xiangmu-dot",d,".projectadmin-con-hz-left-list-box");
+ updataapiinfo(d[0]);
+ }else {
+ layer.msg('查无数据');
+ }
}
-
- // X.laytpldata("#projectadmin-info-box-dot",d.sys_role[0]['authority'],".projectadmin-info-box");
+
});
}
@@ -25,49 +35,53 @@
var url = $(this).attr("data-url");
});
+ var currentindex = 0;
+
$(document).off('click','.roleinproject-tit').on("click",".roleinproject-tit",function(){
var index = $(this).attr("data-index");
+ currentindex = index;
+ system = $(this).attr("data-system");
$(".projectadmin-con-hz-left-list-con").removeClass("selected___3ctlt");
$(this).addClass("selected___3ctlt");
$(".projectadmin-list-name").html(datalist[index]['name']);
- var id = $(this).attr("data-id");
- updataapiinfo(id);
- // X.laytpldata("#projectadmin-info-box-dot",data.dom_role[index]['authority'],".projectadmin-info-box");
+ role_id = $(this).attr("data-id");
+ updataapiinfo(datalist[index]);
});
- function updataapiinfo(id){
- role_id = id;
- X.api("authz/get_permissions_for_user_in_domain","post",{role_id:id,game:X['DATA']['game']},function(d){
- X.laytpldata("#projectadmin-info-box-dot",d,".projectadmin-info-box");
- });
+ function updataapiinfo(d){
+ console.log(d);
+ X.laytpldata("#projectadmin-info-box-dot",d,".projectadmin-info-box");
};
-
+
$(document).off('click','.projectadmin-del').on('click','.projectadmin-del',function(){
var index = $(this).attr('data-index');
var path = $(this).attr('data-path');
- layer.confirm('确认删除当前api吗?', {
- btn: ['取消','删除 '] //按钮
+ var path_name = $(this).attr("data-name");
+ layer.confirm('确认取消当前api的授权?', {
+ btn: ['取消','确认 '] //按钮
}, function(){
//取消
layer.close(layer.index);
}, function(){
//删除
- X.api("authz/del_policy",'post',{role_id:role_id,game:X['DATA']['game'],path:path,act:"*"},function(d){
- layer.msg('删除成功');
+ X.api("authz/del_policy",'post',{role_id:role_id,path:path,path_name: path_name,system:system},function(d){
+ console.log('11a23sd13as4d54a65'+ d);
layer.close(layer.index);
- updataapiinfo(role_id);
+ updataroles(role_id);
+ layer.msg('操作成功');
})
});
});
$(document).off('click','.projectadmin-edit').on('click','.projectadmin-edit',function(params){
+ var index = $(this).attr('data-index');
var path = $(this).attr('data-path');
- var arr = [];
- arr.push(path);
- X.api("authz/add_policy",'post',{role_id:role_id,game:X['DATA']['game'],path_list:arr,act:"*"},function(d){
+ var path_name = $(this).attr("data-name");
+ X.api("authz/add_policy",'post',{role_id:role_id,path:path,path_name:path_name,system:system},function(d){
layer.close(layer.index);
layer.msg('添加成功');
- updataapiinfo(role_id);
+ // updataapiinfo(datalist[currentindex]);
+ updataroles(role_id);
})
});
@@ -96,7 +110,7 @@
layer.close(layer.index);
}, function(){
//删除
- X.api("authz/del_role_user_domain",'post',{role_id:id,game:X['DATA']['game'],username:name},function(d){
+ X.api("authz/del_role_user",'post',{role_id:id,game:X['DATA']['game'],username:name},function(d){
layer.close(layer.index);
layer.msg('删除成功');
updataroles();
diff --git a/web/srczip/logic/savereport.js b/web/srczip/logic/savereport.js
index 71bbe21..65c8e10 100644
--- a/web/srczip/logic/savereport.js
+++ b/web/srczip/logic/savereport.js
@@ -34,8 +34,12 @@
report_id:data['_id']
}
X.api('report/edit','post',arr,function(d){
+
+ // 提交看板修改记录
+ // X.submitrecord('修改'+tabval['title']+'看板')
layer.msg(d);
layer.closeAll();
+
})
}else {
data['eventView']['date_type'] = tabval.date_type;
@@ -51,13 +55,11 @@
layer.closeAll();
})
}
-
-
- })
+ });
$(document).off('click',".savereport-but-qx").on('click','.savereport-but-qx',function(){
layer.closeAll();
- })
+ });
}
};
diff --git a/web/srczip/logic/search.js b/web/srczip/logic/search.js
index af14665..9df1127 100644
--- a/web/srczip/logic/search.js
+++ b/web/srczip/logic/search.js
@@ -2,93 +2,133 @@
(function(){
X.pageLogic['search'] = {
init : function(){
- $(".search_pop .zhanghu_box").click(function(){
+
+ var data = {
+ 'user_arrt_title':'',//用户属性
+ 'user_arrt_id':'', //用户属性id
+ 'user_arrt_type':'', //用户属性type
+ 'comparator_title':'',//筛选条件
+ 'comparator_id':'', //筛选条件id
+ 'condition':'', //手动输入条件,区间用~符号隔开如0~10
+ 'start_time':'', //开始时间
+ 'end_time':'', //结束时间
+ 'pages': 1
+ }
+
+
+
+ var filter_props,filter_maparr;
+
+ X.api("data_mana/game_user_event_list","post",{cat:'user'},function(d){
+ filter_props = d;
+ X.api("data_auth/filter_map","get",{},function(d){
+ filter_maparr = d;
+
+ $(".search_top .zhanghu_box span").html(filter_props[0]['category'][0]['title']);
+ data['user_arrt_title'] = filter_props[0]['category'][0]['title'];
+ data['user_arrt_id'] = filter_props[0]['category'][0]['id'];
+ data['user_arrt_type'] = filter_props[0]['category'][0]['data_type'];
+
+ var comparatorarr = filter_maparr[filter_props[0]['category'][0]['data_type']]
+
+ data['comparator_title'] = comparatorarr[0]['title'];
+ data['comparator_id'] = comparatorarr[0]['id'];
+ istimeboxtype(filter_props[0]['category'][0]['data_type']);
+
+ var start = moment().subtract(6, 'days');
+ var end = moment();
+ var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
+ var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
+ data['start_time'] = startTime;
+ data['end_time'] = endTime
+
+ X.laytpldata("#judge-box-dot",filter_maparr[filter_props[0]['category'][0]['data_type']],'.judge_box');
+
+
+ });
+ });
+
+ function istimeboxtype(type){
+ if(type == "datetime"){
+ $(".search_left .judge_box").hide();
+ $(".search_left .search_txt").hide();
+ $(".search_left .time-box").show();
+ }else {
+ $(".search_left .judge_box").show();
+ $(".search_left .search_txt").show();
+ $(".search_left .time-box").hide();
+ }
+ };
+
+ $(document).off("click",'.search_pop .zhanghu_box').on('click','.search_pop .zhanghu_box',function(){
var obj = $(".search_pop .zhanghu_box");
var offset = obj.offset();
//点击按钮,数据,向左偏移,向右偏移
- X.querycriteriapop(X.DATA.search,'category',offset.left,offset.top+obj.height(),function(val){
-
+ X.querycriteriapop(filter_props,'category',offset.left,offset.top+obj.height(),function(val){
$(".search_top .zhanghu_box span").html(val.title);
- $(".search_top .zhanghu_box span").attr('data-id',val.id);
- $(".search_top .zhanghu_box span").attr('data-type',val.type);
- var judgeid = $(".search_left .judge_box").val();
- if(val.type == 'time'){
- //type为time是隐藏文本框,显示时间选择框
- $(".search_left .judge_box").hide();
- $(".search_left .search_txt").hide();
- $(".search_left .time-box").show();
- }else {
- $(".search_left .judge_box").show();
- if(judgeid == 4 || judgeid == 5 ){ //当judfeid 等于4和5时隐藏文本框,只显示下拉框
- $(".search_left .search_txt").hide();
- }else{
- $(".search_left .search_txt").show();
- }
- $(".search_left .time-box").hide();
- }
+ data['user_arrt_title'] = val.title;
+ data['user_arrt_id'] = val.id;
+ data['user_arrt_type'] = val.type;
+
+ var comparatorarr = filter_maparr[val.type];
+ data['comparator_title'] = comparatorarr[0]['title'];
+ data['comparator_id'] = comparatorarr[0]['id'];
+ // 渲染条件框数据
+ X.laytpldata("#judge-box-dot",filter_maparr[val.type],'.judge_box');
+ istimeboxtype(val.type)
});
});
- // 渲染条件框数据
- X.laytpldata("#judge-box-dot",X.DATA.search['condition'],'.judge_box');
+
+ $(document).off("click",'.user-id').on('click','.user-id',function(){
+ X['DATA']['search-user-id'] = $(this).attr("data-id");
+ X.gourl('userinfo','conetnt');
+ });
+
//渲染日期选择器
- X.daterender(".timechoice");
+ X.daterender(".timechoice",function(start,end,label){
+ var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
+ var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
+ data['start_time'] = startTime;
+ data['end_time'] = endTime;
+ });
// 下拉选项改变事件
$(".search_left .judge_box").change(function(){
var judgeid = $(this).val();
- if(judgeid == 4 || judgeid == 5){
- $('.search_left .search_txt').hide();
- }else {
- $('.search_left .search_txt').show();
- }
+ var judgetitle = $('.judge_box option:selected').text();
+ data['comparator_title'] = judgetitle;
+ data['comparator_id'] = judgeid;
+
});
// 搜索按钮单击事件
$(".search_top .searcg_but").click(function(){
- var typeid = $(".search_top .zhanghu_box span").attr('data-id');//属性id
- var type = $(".search_top .zhanghu_box span").attr('data-type');//属性id
- var condition = $(".search_left .judge_box").val(); //条件
- var details = $(".search_left .search_txt").val();//详情
- var time = $(".search_left .time-box .timechoice").val();//时间
- var timearr = time.split('-');
- var startdate = timearr[0]+ "-" + timearr[1] +"-"+ timearr[2];
- var enddate= timearr[3]+ "-" + timearr[4] +"-"+ timearr[5];
+ data['condition'] = $(".search_txt").val();
- var start = new Date(startdate);
- var starttime = Date.parse(start)/1000;
+ X.api('ck/seek_user','post', data ,function (val){
- var end = new Date(enddate);
- var endtime = Date.parse(end)/1000;
- var data;
- //当type为time时不用传condition,details,当condition为5或4时不用传details
- if( type != "time" ){
- if(condition == 4 || condition == 5){
- data = {
- typeid: typeid,
- condition:condition
+ X.api('ck/seek_user_count','post', data ,function (d){
+ $(".more_data span").html(d);
+ if(d > 10){
+ $(".search_pop .more_data-box").show();
+ X['ueser_search_data'] = data;
+ }else {
+ $(".search_pop .more_data-box").hide();
+ X['ueser_search_data'] = [];
}
- }else {
- data = {
- typeid: typeid,
- condition:condition,
- details:details
- }
- }
- }else {
- data = {
- typeid: typeid,
- starttime: starttime,
- endtime:endtime
- }
- }
- X.api('api/userquery',data,function (d){
- X.laytpldata("#search-data-dot",d.datalist,".search_pop .search_data");
- $(".more_data span").html(d.totalNum);
- $(".search_pop .more_data-box").show();
+ })
+
+ X.laytpldata("#search-data-dot",val.refer.values,".search_pop .search_data",function(){
+
+ });
+ // $(".more_data span").html(d.totalNum);
});
- })
+ });
+
+
+
},
};
})();
diff --git a/web/srczip/logic/setupbaobiao.js b/web/srczip/logic/setupbaobiao.js
index c1119f2..96cc65c 100644
--- a/web/srczip/logic/setupbaobiao.js
+++ b/web/srczip/logic/setupbaobiao.js
@@ -144,9 +144,60 @@
report_id:postdata[0]['_id']
}
X.api('report/edit','post',reportedit,function(d){
+
+ var ascending = data.ascending ==="false" ? false : true;
+ var avesumdata = data.avesumdata === "false" ? false : true;
+ var daydata = data.daydata === "false" ? false : true;
+ var modelswitch = data.modelswitch === "false" ? false : true;
+ var reverseorder = data.reverseorder === "false" ? false : true;
+
+ var updatatype='操作'+postdata[0]['name'];
+ if(postdata[0]['name'] != title){
+ updatatype+=",修改 报表名称"
+ }
+ if(postdata[0]['desc'] != desc){
+ // updatatype 操作 基础数据报表
+ updatatype+=",修改 备注"
+ }
+ if(ascending != arr['report']['ascending']){
+ // 倒序
+ updatatype+=",修改 倒序"
+ }
+ if(avesumdata != arr['report']['avesumdata']){
+ //平均总和
+ updatatype+=",修改 平均总和展示"
+ }
+ if(daydata != arr['report']['daydata']){0
+ // 当天数据
+ updatatype+=",修改 当天数据展示"
+ }
+ if(data.modelsize != arr['report']['graph_size']){
+ // 窗体大小
+ updatatype+=",修改 窗体大小"
+ }
+ if(modelswitch != arr['report']['modelswitch']){
+ // xy轴切换
+ updatatype+=",修改 xy轴切换"
+ }
+ if(data.modeltype != arr['report']['graph_type']){
+ // 图表类型
+ updatatype+=",修改 图表类型"
+ }
+ if(reverseorder != arr['report']['reverseorder']){
+ // 首行浮动
+ updatatype+=",修改 首行浮动"
+ }
+ if(updatatype){
+
+ }
+ // console.log(updatatype);
+ // X.submitrecord()
+ // console.log(data);
+ // console.log(arr);
me.callback && me.callback(d);
layer.closeAll();
- })
+
+ })
})
});
diff --git a/web/srczip/logic/useradmin.js b/web/srczip/logic/useradmin.js
index ad9f647..741571d 100644
--- a/web/srczip/logic/useradmin.js
+++ b/web/srczip/logic/useradmin.js
@@ -120,11 +120,11 @@
},
useradmin : function(id){
X.tabledata('#userdata','project/members',[[
- {field:'name', width:180, title: '成员账号', sort: true}
- ,{field:'nickname', width:180, title: '成员显示名'}
- ,{field:'role', width:180, title: '项目角色', sort: true}
- ,{field:'data_auth', width:180, title: '数据权限'}
- ,{field:'sign', title: '所属成员组', width: 180}
+ {field:'name', title: '成员账号', sort: true}
+ ,{field:'nickname', title: '成员显示名'}
+ ,{field:'role', title: '项目角色', sort: true}
+ // ,{field:'data_auth', width:180, title: '数据权限'}
+ // ,{field:'sign', title: '所属成员组', width: 180}
,{field:'last_login_ts', title: '最后访问时间', sort: true}
,{fixed: 'right', title:'操作', toolbar: '#barDemo', width:80}
]]);
diff --git a/web/srczip/logic/userinfo.js b/web/srczip/logic/userinfo.js
new file mode 100644
index 0000000..31e60ea
--- /dev/null
+++ b/web/srczip/logic/userinfo.js
@@ -0,0 +1,158 @@
+(function(){
+ X.pageLogic['userinfo'] = {
+ init : function(parms){
+ var me = this;
+
+ var event_list,start_time,end_time,userdata;
+
+
+ // 日期渲染
+ X.daterender("#analtsis-condition-date",function(start, end, label){
+ var startTime = start.format('YYYY-MM-DD')+ " "+ "00:00:00";
+ var endTime = end.format('YYYY-MM-DD')+ " "+ "23:59:59";
+ start_time = startTime;
+ end_time = endTime;
+ updatasolouser();
+ })
+
+ $(document).off('click','.userinfo-event-list-title-box').on('click','.userinfo-event-list-title-box',function(){
+
+ if($(this).next().css('display') == 'block'){
+ $(this).next().hide();
+ }else {
+ $(this).next().show();
+ }
+
+ });
+
+ X.api("ck/event_list","get",{},function(d){
+ event_list = d;
+ if(X['DATA']['search-user-id']){
+ updatasolouser();
+ }
+ });
+
+
+ $(document).off('click','.analtsis-condition').on('click','.analtsis-condition',function(){
+ var type = $(".userinfo-pie-echarts").css("display");
+ if(type == 'none'){
+ $(".analysis-echarts").css("width","calc( 100% - 401px)");
+ $(".userinfo-pie-echarts").show();
+ }else {
+ $(".analysis-echarts").css("width","100%");
+ $(".userinfo-pie-echarts").hide();
+ }
+
+ userinfoechert(userdata.event_count);
+ if(userdata.proportion.length > 0){
+ userinfopieechart(userdata.proportion);
+ }
+ });
+
+ function updatasolouser(){
+ var time = $("#analtsis-condition-date").val();
+ var timearr = time.split(" ");
+ start_time = timearr[0] + " "+"00:00:00";
+ end_time = timearr[2]+" "+"23:59:59";
+
+ X.api("ck/solo_user","post",{account_id:X.DATA['search-user-id'],event_list:event_list,start_time:start_time,end_time:end_time},function(val){
+ userdata = val
+ if(val.event_count.length > 0){
+ userinfoechert(val.event_count);
+ }
+ if(val.proportion.length > 0){
+ userinfopieechart(val.proportion);
+ }
+ X.laytpldata("#user-left-content-box-dot",val['details_data'],".user-left-content-box",function(){});
+
+ X.laytpldata("#userinfo-event-box-dot",val['details_user'],".userinfo-event-box",function(){});
+
+ })
+ };
+
+ function userinfopieechart(data){
+
+ var myChart = echarts.init(document.getElementById('userinfo-pie'));
+
+ var option = {
+ color: ['#4daef5','#5dd7d1','#bae5f6','#f8e7bb','#ad91d9','#7be0b8','#f78499','#fa9c6d','#fecde2','#677a9b','#4295da'],
+ title: {
+ left: 'center'
+ },
+ tooltip: {
+ trigger: 'item',
+ formatter: '{a}
{b} : {c} ({d}%)'
+ },
+ label:{
+ formatter: '{b}\n{d}%',
+ },
+ series: [
+ {
+ name: '姓名',
+ type: 'pie',
+ radius: '50%',
+ center: ['50%', '50%'],
+ data: data,
+ emphasis: {
+ itemStyle: {
+ shadowBlur: 10,
+ shadowOffsetX: 0,
+ shadowColor: 'rgba(0, 0, 0, 0.5)'
+ }
+ }
+ }
+ ]
+ };
+ myChart.setOption(option,true);
+ };
+
+ function userinfoechert(data){
+ var xAxisData = data.date;
+ var seriesData = [];
+ var arr = {
+ name:'总量',
+ type: 'bar',
+ barWidth : 30,
+ data: data.event_values,
+ }
+ seriesData.push(arr);
+
+ var myChart = echarts.init(document.getElementById('userinfo-echarts'));
+
+ var option = {
+ tooltip: {
+ trigger: 'axis',
+ axisPointer: {
+ type: 'shadow'
+ }
+ },
+ color: X.DATA.echartscolor,
+ grid: {
+ left: '2%',
+ right: '2%',
+ bottom: '2%',
+ top: '10%',
+ containLabel: true
+ },
+ xAxis: [
+ {
+ type: 'category',
+ axisTick: {show: false},
+ data: xAxisData
+ }
+ ],
+ yAxis: [
+ {
+ type: 'value'
+ }
+ ],
+ series: seriesData
+ };
+ myChart.resize();
+ myChart.setOption(option,true);
+ }
+
+
+ }
+ };
+})();
diff --git a/web/srczip/logic/userinfolist.js b/web/srczip/logic/userinfolist.js
new file mode 100644
index 0000000..879a986
--- /dev/null
+++ b/web/srczip/logic/userinfolist.js
@@ -0,0 +1,54 @@
+//cc
+(function(){
+ X.pageLogic['userinfolist'] = {
+ init : function(){
+
+ var data = X['ueser_search_data'];
+
+ updatauserlist();
+ X.api('ck/seek_user_count','post', X['ueser_search_data'] ,function (d){
+
+ $(".userinfolist_body_line_left_num span").html(d);
+ layui.laypage.render({
+ elem: 'laypages' //注意,这里的 test1 是 ID,不用加 # 号
+ ,count: d, //数据总数,从服务端得到
+ limit:10, //每页条数设置
+ jump: function(obj, first){
+
+ data['pages']=obj.curr; //改变当前页码
+
+ //首次不执行
+ if(!first){
+ updatauserlist(); //加载数据
+ }
+ }
+ });
+ });
+
+ $(document).off("click",'.userinfolist-page_table .table-fixed tbody tr td').on("click",".userinfolist-page_table .table-fixed tbody tr td",function(){
+ var id = $(this).attr("data-id");
+ X['DATA']['search-user-id'] = id;
+ X.gourl('userinfo','conetnt');
+ });
+
+ function updatauserlist(){
+ X.api('ck/seek_user','post', data ,function (val){
+ X.laytpldata("#userinfolist-title-box-dot",val.details_data.new_columns,".userinfolist-title-box");
+ X.laytpldata("#userinfolist-list-box-dot",val.details_data.new_values,".userinfolist-list-box",function(){
+ var tableMul = new FixedTable("dataTableMul-userlist", 1);
+ });
+ });
+
+ };
+
+ //下载
+ $(document).off("click",'.download-user-data').on("click",".download-user-data",function(){
+
+ X.download('ck/download_user',data,'用户报表');
+
+ });
+
+
+ },
+ };
+})();
diff --git a/web/static/css/analysis.css b/web/static/css/analysis.css
index bf05d4e..317c0a4 100644
--- a/web/static/css/analysis.css
+++ b/web/static/css/analysis.css
@@ -229,7 +229,7 @@
.groupeditemspop-qd { cursor: pointer; margin-left: 10px; height: 32px; padding: 0 16px; font-weight: 400; font-size: 14px; line-height: 30px; border-radius: 2px; color: #fff; background-color: #3d90ff; }
-.analtsis-con-right-box { padding: 24px; }
+.analtsis-con-right-box { padding: 24px; height: calc(100% - 48px); }
.analtsis-con-right-top-title { color: #202d3f; font-weight: 500; font-size: 14px; line-height: 20px; }
.analtsis-condition-box { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; margin-bottom: 14px; }
.analtsis-time-box { display: flex; align-items: center; }
diff --git a/web/static/css/projectadmin.css b/web/static/css/projectadmin.css
index c53547d..4914d16 100644
--- a/web/static/css/projectadmin.css
+++ b/web/static/css/projectadmin.css
@@ -37,13 +37,13 @@
.projectadmin-info-box { height: calc(100% - 48px); overflow-y: auto; margin-top: 16px; }
.projectadmin-info-bg { width: 100%; height: 100%; }
.projectadmin-info-table-top { width: 100%; background-color: #f0f2f5; color: #202d3f; font-weight: 400; font-size: 13px; display: flex; align-items: center; border-left: 1px solid #e6e6e6; }
-.projectadmin-info-table-top div { padding: 20px 0px; text-indent:13px; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6;}
+.projectadmin-info-table-top div { text-indent:13px; border-right: 1px solid #e6e6e6; border-bottom: 1px solid #e6e6e6;}
.projectadmin-info-table1 { width: 20%; }
.projectadmin-info-table2 { width: 70%; }
.projectadmin-info-table3 { width: 10%; }
.projectadmin-info-table-con { width: 100%; border-bottom: 1px solid #e6e6e6; background-color: #fff; color: #202d3f; font-weight: 400; font-size: 13px; display: flex; border-left: 1px solid #e6e6e6; }
.projectadmin-info-table-con div { text-indent:13px; }
-.projectadmin-info-table-left { width: 20%; }
+.projectadmin-info-table-left { width: 25%; }
.projectadmin-info-table-left div { height: 100%; min-height: 57px; display: flex; justify-content: space-between; align-items: center;}
.projectadmin-info-table-center-box { width: 70% ; }
@@ -54,7 +54,7 @@
.projectadmin-info-table-right { width: 10%; display: flex; align-items: center; border-right: 1px solid #e6e6e6; }
.projectadmin-info-table-right div { margin-left: 14px; text-indent: 0; height: 22px; line-height: 22px; padding: 0 5px; font-size: 12px; color: #fff; white-space: nowrap; text-align: center; border-radius: 2px; cursor: pointer; }
.projectadmin-edit { background-color: #009688; }
-.projectadmin-del { background-color: #FF5722; }
+.projectadmin-del { background-color: #FF5722; color: #fff; text-indent: 0 !important; font-size: 12px; margin: 0 auto; }
.projectadmin-gongduo { margin-top: 8px; float:right; display: none; }
.projectadmin-con-hz-left-list-con:hover > .projectadmin-gongduo { display: block; }
@@ -321,7 +321,7 @@
/* 创建角色 */
.addrole-box { background-color: #fff; width: 100%; height: 100%; }
.addrole-con-box { padding-right: 24px; padding-top: 24px; }
-.addrole-info-table-con { height: 600px; overflow-y: auto; display: flex; flex-wrap: wrap; }
+.addrole-info-table-con { height: 600px; overflow-y: auto; }
.addrole-but-box { padding: 24px 0px 0 0; border-top: 1px solid #f0f0f0; display: flex; justify-content:flex-end; align-items: center; }
.addrole-but-box div { cursor: pointer; margin-left: 10px; height: 32px; padding: 0 16px; font-weight: 400; font-size: 14px; line-height: 30px; border-radius: 2px; }
.addrole-qx { color: #42546d; border: 1px solid #f0f0f0; }
@@ -366,3 +366,13 @@
.operation-list-box { padding: 24px; }
.operation-list-box p { margin-top: 16px; color: #666; font-size: 14px; }
.operation-list-box p span { color: red; }
+
+.projectadmin-tab-table1 { width: 25%; padding: 20px 0;}
+.projectadmin-tab-box { width: 75%; display: flex;}
+.projectadmin-tab-box div { padding: 20px 0; }
+.projectadmin-tab-table2 { width: 45%; }
+.projectadmin-tab-table3 { width: 10%; }
+.customname-val-right2 { border-right: 1px solid #f0f2f5; display: flex; align-items: center; width: 100%; border-bottom: 1px solid #f0f2f5; }
+.customname-val-right-val { border-left: 1px solid #f0f2f5; padding: 20px 0; display: flex; align-items: center; }
+.customname-val-right-val a{ margin: 0 auto; }
+
diff --git a/web/static/css/style.css b/web/static/css/style.css
index 9ab2b9e..468c264 100644
--- a/web/static/css/style.css
+++ b/web/static/css/style.css
@@ -29,6 +29,8 @@
.layui-laypage-em { background-color: #3d90ff !important; }
.layui-table-cell { height: auto; }
.nav-list-box { overflow-y: auto; height: 100%; }
+.importuser-con-box .layui-select-title { width: auto; }
+.importuser-con-box .layui-form-selected dl { max-height: 160px; }
::-webkit-scrollbar {
width:0px;
@@ -203,7 +205,7 @@
.search_txt:hover { border: 1px solid #4fa1ff; }
.searcg_but { background-color:#3d90ff; border-color: #3d90ff; height: 32px; padding: 0 16px; font-weight: 400; font-size: 14px; line-height: 30px; text-shadow: none; text-align:center; cursor: pointer; border-radius: 4px; color: #ffffff;}
-.search_data { color: #42546d; padding: 8px 32px 0 32px; border-top: 1px solid #d9d9d9; max-height: 460px; min-height: 460px; overflow-y: auto; }
+.search_data { color: #42546d; padding: 8px 32px 0 32px; border-top: 1px solid #d9d9d9; max-height: 460px; min-height: 410px; overflow-y: auto; }
.search_data_con { cursor: pointer; border-bottom:1px solid #ebebeb; display:flex; align-items: center; justify-content: space-between; height: 40px;}
.search_data_con:hover { background-color: #f7f9fc; }
.search_data_con:hover span { color: #3d90ff; }
@@ -928,7 +930,7 @@ label:not(.form-check-label):not(.custom-file-label) { font-weight: 400; }
background-color: #fff;
z-index: 2;
overflow-y: auto;
- box-shadow: rgb(205, 205, 205) 1px 1px 5px;
+ box-shadow: rgb(205, 205, 205) 1px 1px 0px;
}
.none{display: none;}
@@ -942,3 +944,226 @@ label:not(.form-check-label):not(.custom-file-label) { font-weight: 400; }
.select-datacheck-box i{ right: -26px !important;}
+.apiadd-apitype-box .layui-form-select dl{ max-height: 180px; }
+
+input.editable-select {
+ background: #FFF url(arrow-down.gif) right center no-repeat;
+ border: 1px solid #eee;
+ padding: 2px 8px 2px 4px;
+ width: 168px !important;
+ height: 32px;
+}
+.editable-select-options {
+ /* width: 182px !important; */
+ position: absolute;
+ display: none;
+ overflow: auto;
+ margin: 0;
+ padding: 0;
+ background: #FFF;
+ border: 1px solid #eee;
+ z-index: 100000000;
+}
+.editable-select-iframe {
+ position: absolute;
+ background: #FFF;
+ z-index: 9;
+ display: none;
+}
+.editable-select-options ul {
+ margin: 0;
+ padding: 0;
+ z-index: 100000000;
+ list-style: none;
+ list-style-image: none;
+}
+.editable-select-options li {
+ cursor: default;
+ padding: 2px 4px;
+}
+.editable-select-options li.selected {
+ background: #f0f2f5;
+ color:#000;
+}
+
+.userinfolist_bg {
+ background-color: #f0f2f5;
+ width: 100%;
+ height: 100%;
+ position: fixed;
+ top: 60px;
+}
+.userinfolist-page-header-box {
+ width: 100%;
+ font-size: 16px;
+ color: #8d9eb9;
+ background-color: #fff;
+ height: 51px;
+
+}
+.userinfolist-page-header {
+ padding-right: 25px;
+ padding-left: 20px;
+ line-height: 50px;
+ border-bottom: 1px solid #edf0f2;
+}
+.userinfolist_body_box{
+ position: relative;
+ height: calc(100% - 152px);
+ margin: 20px 20px 0 20px;
+ /* padding: 20px; */
+ border-radius: 5px;
+ background-color: #fff;
+}
+.userinfolist_body_line_box {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ height: 60px;
+ border-bottom: 1px solid #eaeef1;
+ padding: 0 20px;
+}
+.userinfolist_body_line_left {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 16px;
+ font-weight: 500;
+ color: rgba(0, 0, 0, 0.65);
+}
+.userinfolist_body_line_left_num {
+ margin-right: 25px;
+}
+.ta-check-item-label {
+ padding: 0 8px;
+ height: 28px;
+ line-height: 28px;
+ color: #42546d;
+ font-size: 13px;
+ border: 1px solid #f0f0f0;
+ border-radius: 2px;
+ cursor: pointer;
+ margin-right: 8px;
+}
+.userinfolist_body_line_right {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ font-size: 16px;
+ font-weight: 500;
+ color: rgba(0, 0, 0, 0.65);
+}
+.userinfolist_body_line_right span {
+ margin-left: 16px;
+}
+.userinfolist-page_table {
+ margin: 20px;
+}
+
+.userinfolist-page_table .table-view{
+ max-height: 622px;
+ overflow: auto;
+}
+
+.userinfolist-page_table .table-fenxi-box tr td{
+ max-width: 240px;
+ padding: 16px;
+}
+.userinfolist-page_table .table-bordered tr th{
+ max-width: 240px;
+ padding: 16px;
+}
+.table-view .table th, .table-view .table td{
+ padding: 16.3px 0;
+}
+.userinfo-left-box {
+ width: 270px;
+ height: calc(100% - 152px);
+ background-color: #fff;
+ margin-top: 20px;
+ margin-left: 20px;
+ border-radius: 8px;
+}
+
+.user-left-top-box {
+ border-bottom: 1px solid #f5f5f5;
+ padding: 0 20px;
+ height: 51px;
+ display: flex;
+ align-items: center;
+ line-height: 50px;
+ width: 230px;
+}
+.user-left-top-box span {
+ color: #202d3f;
+ font-size: 14px;
+ font-weight: 500;
+}
+.user-left-content-box {
+ width: 100%;
+ height: calc(100% - 101px);
+ overflow: auto;
+}
+.user-left-content-line-box {
+ margin-top: 16px;
+ padding-left: 20px;
+ font-size: 14px;
+}
+.user-left-content-line-title {
+ color: #67729d;
+ font-size: 12px;
+}
+.user-left-content-line-value {
+ margin-top: 8px;
+ color: #42546d;
+ font-size: 14px;
+}
+.user-left-bottom-box {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ padding: 0 20px;
+ height: 50px;
+ line-height: 50px;
+ color: #4f5276;
+}
+.user-left-bottom-jt {
+ width: 80px;
+ display: flex;
+ align-items: center;
+ justify-content: space-evenly;
+}
+.user-left-bottom-jt .you {
+ transform: rotate(180deg);
+}
+.user-left-bottom-jt img {
+ cursor: pointer;
+}
+
+.userinfo-right-box {
+ width: calc(100% - 330px);
+ height: calc(100% - 152px);
+ background-color: #fff;
+ border-radius: 8px;
+ margin-left: 20px;
+ margin-top: 20px;
+}
+
+.userinfo-box {
+ display: flex;
+ height: 100%;
+}
+
+.userinfo-event-list-box { width: 100%; display: flex; }
+.userinfo-event-list-box .userinfo-event-time { font-size: 12px; color: #67729d; width: 63px; height: 36px; line-height: 36px; padding: 5px 15px 5px 0; }
+.userinfo-event-list-con-box { width: 100%; padding-top: 5px; padding-bottom: 5px; padding-left: 10px; border-left: 1px solid #f3f3f3; }
+.userinfo-event-list-title-box { cursor: pointer; width: 100%; height: 36px; line-height: 36px; padding-left: 10px; background-color:#f0f2f5;}
+.userinfo-event-list-info-box { width: calc(100% - 34px); background-color: #f6f6f6; padding: 0 22px; display: none; }
+.userinfo-event-list-info {display: flex; flex-wrap: wrap;margin-bottom: 0;padding-top: 18px;padding-bottom: 6px;overflow: hidden;}
+.property___1w1aY {width: 49%; height: 22px; line-height: 22px; margin-bottom: 12px; padding-left: 4px; color: #42546d; font-weight: 400; word-break: break-all; }
+.property___1w1aY .name___2eywe { padding-right: 10px; color: #67729d; font-weight: 400; font-size: 14px; }
+.userinfo-data-box { overflow-y: auto; overflow-x: hidden; height: calc(100% - 50px); }
+.userinfo-event-list-time-box { margin: 5px 0; color: #42546d; height: 20px; font-weight: 500; margin-right: 5px; }
+.userinfo-pie-echarts { width: 400px; height: 350px; padding: 10px; padding-top: 20px; border-left: 1px solid #f0f2f5; display: none; }
+
+