|
@@ -175,6 +175,19 @@
|
|
|
}
|
|
|
$(".auth").attr("disabled",true);
|
|
|
$(".edit-form #comeintime").val({{session "comeintime"}});
|
|
|
+ selectModifyUsers("#myModal-edit #affiliater",{{session "ids"}});
|
|
|
+ if({{session "identity"}} == 1){
|
|
|
+ $(".edit-form #nbry").prop("checked",true);
|
|
|
+ }else{
|
|
|
+ $(".edit-form #wbry").prop("checked",true);
|
|
|
+ }
|
|
|
+ $(".identity").attr("disabled",true);
|
|
|
+ if({{session "platform"}} == "golua平台"){
|
|
|
+ $(".edit-form #platform-lua").prop("checked",true);
|
|
|
+ }else{
|
|
|
+ $(".edit-form #platform-python").prop("checked",true);
|
|
|
+ }
|
|
|
+ $(".platform").attr("disabled",true);
|
|
|
$("#myModal-edit").modal("show");
|
|
|
passwordOld = $("#password").val();
|
|
|
var userid = {{session "userid"}};
|
|
@@ -469,8 +482,8 @@
|
|
|
<div class="form-group">
|
|
|
<label for="platform" class="col-sm-2 control-label">平台:</label>
|
|
|
<div class="col-sm-10 checkbox-style">
|
|
|
- <input type="radio" name="platform-box" class="identity" id="platform-lua" value="golua平台">golua平台</input>
|
|
|
- <input type="radio" name="platform-box" class="identity" id="platform-python" value="python">python</input>
|
|
|
+ <input type="radio" name="platform-box" class="platform" id="platform-lua" value="golua平台">golua平台</input>
|
|
|
+ <input type="radio" name="platform-box" class="platform" id="platform-python" value="python">python</input>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="form-group">
|
|
@@ -681,7 +694,79 @@
|
|
|
var $infoError = "";
|
|
|
var $infoName = "";
|
|
|
var $descript = "";
|
|
|
-
|
|
|
+ var addUserAffiliater;
|
|
|
+ //多选爬虫开发
|
|
|
+ function selectModifyUsers(m,ids) {
|
|
|
+ addUserAffiliater = xmSelect.render({
|
|
|
+ el: m,
|
|
|
+ // model: {
|
|
|
+ // icon: 'hidden',
|
|
|
+ // },
|
|
|
+ toolbar:{
|
|
|
+ show: true,
|
|
|
+ showIcon: false,
|
|
|
+ },
|
|
|
+ checkbox: true,
|
|
|
+ repeat: false,
|
|
|
+ autoRow: true,
|
|
|
+ filterable: true,
|
|
|
+ tips: '请选择',
|
|
|
+ autoRow:true,
|
|
|
+ prop: {name: 's_name', value: 's_name',},
|
|
|
+ tree: {
|
|
|
+ show: true,
|
|
|
+ showFolderIcon: false,
|
|
|
+ showLine: true,
|
|
|
+ indent: 20,
|
|
|
+ expandedKeys: [-3],
|
|
|
+ strict: false,
|
|
|
+ },
|
|
|
+ data: function () {
|
|
|
+ var modifyusers = {{.T.modifyusers}}
|
|
|
+ if(ids){
|
|
|
+ for(var i in modifyusers){
|
|
|
+ var userId = modifyusers[i]["_id"]
|
|
|
+ if (ids.includes(userId)){
|
|
|
+ modifyusers[i]["selected"] = true
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return modifyusers
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ //保存修改密码
|
|
|
+ function editUser(){
|
|
|
+ var password = $("#password").val().trim().replace(/\s/g,"");
|
|
|
+ var auth = $("input:radio[name='auth-box']:checked").val();
|
|
|
+ var identity = $("input:radio[name='identity-box']:checked").val();
|
|
|
+ var platform = $("input:radio[name='platform-box']:checked").val();
|
|
|
+ $("#myModal-edit").modal("hide");
|
|
|
+ var self =sessionStorage.getItem("self");
|
|
|
+ var id =sessionStorage.getItem("userid");
|
|
|
+ var ids = [];
|
|
|
+ if (auth == "审核员" || auth == "管理员"){
|
|
|
+ var selectArr =addUserAffiliater.getValue();
|
|
|
+ for(var i in selectArr){
|
|
|
+ ids.push(selectArr[i]["_id"]);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log("password:",password,"auth:",auth,"self:",self,"id:",id,"identity:",identity,"platform:",platform,"ids:",ids)
|
|
|
+ $.post("/center/user/updateUser",{"password":password,"userAuth":auth,"self":self,"userid":id,"identity":identity,"platform":platform,"id":ids.join(",")},function(r){
|
|
|
+ if("y" == r.status){
|
|
|
+ if (self == "y"){
|
|
|
+ window.location.reload();
|
|
|
+ }
|
|
|
+ showTip("修改成功", 1000);
|
|
|
+ $('#com-alert').on('hidden.bs.modal', function () {
|
|
|
+ ttable.ajax.reload();
|
|
|
+ })
|
|
|
+ }else{
|
|
|
+ showTip("修改失败", 1000);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
function searchbyhref(){
|
|
|
$("#searchbyhref").modal("show");
|
|
|
}
|