浏览代码

账户管理界面目录调整,样式调整

shihang 6 年之前
父节点
当前提交
b400b7636b

+ 0 - 510
src/dashoo.cn/frontend_web/src/pages/organize.vue

@@ -1,510 +0,0 @@
-<template>
-  <div v-loading="downloading" element-loading-text="数据拼命准备中,请稍候。。。">
-    <el-breadcrumb class="heading">
-      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
-      <el-breadcrumb-item>内部组织结构</el-breadcrumb-item>
-    </el-breadcrumb>
-    <el-card class="box-card">
-      <div slot="header">
-        <span>
-          <i class="icon icon-table2"> 内部组织结构</i>
-        </span>
-        <span style="float: right;">
-          <el-button size="small" type="primary" @click="opendatadialog(1,null,-1);resetForm('organizeform')">新增组织</el-button>
-        </span>
-      </div>
-      <el-row :gutter="20">
-        <el-col :span="6">
-          <el-tree highlight-current="true" :expand-on-click-node="true" node-key="id" :data="orgtreelist" :props="orgtreeprops" :default-expanded-keys="userdepartment"
-            @node-click="orgtreeNodeClick" ref="orgmanagetree">
-          </el-tree>
-        </el-col>
-        <el-col :span="18">
-          <!--列表-->
-          <el-collapse>
-            <el-collapse-item title="查询">
-              <el-form ref="form" label-width="120px">
-                <el-row>
-                  <el-col :span="8">
-                    <el-form-item label="组织名称">
-                      <el-input v-model="keyword" placeholder="请输入组织名称"> ></el-input>
-                    </el-form-item>
-                  </el-col>
-                </el-row>
-                <el-row>
-                  <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 1px">&nbsp;</el-col>
-                </el-row>
-                <el-row :gutter="0" style="text-align:right;margin-top:10px;">
-                  <el-button @click="seachdata" size="small" type="primary">查询</el-button>
-                  <el-button type="primary" class="el-button--small" @click="clearSearch" style="margin-left:8px">重 置</el-button>
-                </el-row>
-              </el-form>
-            </el-collapse-item>
-          </el-collapse>
-          <el-table :data="tablelist" border>
-            <el-table-column label="操作" width="70" align="center">
-              <template slot-scope="scope">
-                <template v-if="scope.row.Parentid !== 0">
-                  <el-button size="small" type="text" @click="opendatadialog(2,scope.row,scope.$index);resetForm('organizeform')" icon="el-icon-edit"
-                    title="编辑"></el-button>
-                  <el-button size="small" type="text" @click="deletedata(scope.row)" icon="el-icon-delete" title="删除" style="margin-left: 3px"></el-button>
-                  <!--暂时隐藏-->
-                  <el-button v-if="1==2" size="small" type="success" @click="permission(scope.row)">权限</el-button>
-                </template>
-              </template>
-            </el-table-column>
-            <el-table-column prop="Fullname" align="center" label="组织名称" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="Parentname" align="center" label="上级组织" show-overflow-tooltip></el-table-column>
-            <el-table-column prop="Description" align="center" label="备注" show-overflow-tooltip></el-table-column>
-            <el-table-column label="操作时间" align="center" prop="Modifiedon">
-              <template slot-scope="scope">
-                <p>{{jstimehandle(scope.row.Modifiedon)}}</p>
-              </template>
-            </el-table-column>
-          </el-table>
-        </el-col>
-      </el-row>
-      <!--分页-->
-      <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage" :page-sizes="[10, 15, 20, 25]"
-        :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
-      </el-pagination>
-    </el-card>
-    <!--新增、编辑组织信息-->
-    <el-dialog :title="dialogtitle" :visible.sync="datadialogVisible" top="5vh">
-      <el-form :model="organizeform" :rules="rulesorganize" ref="organizeform">
-        <el-form-item label="上级组织" label-width="120px" required>
-          <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false" v-model="selectedorg"
-            placeholder="请选择组织"></el-cascader>
-        </el-form-item>
-        <el-form-item label="组织名称" prop="fullname" label-width="120px">
-          <el-input v-model="organizeform.fullname" auto-complete="off"></el-input>
-        </el-form-item>
-        <el-form-item label="描述" label-width="120px">
-          <el-input type="textarea" v-model="organizeform.description" auto-complete="off"></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="datadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savedata('organizeform')">确 定</el-button>
-      </div>
-    </el-dialog>
-
-    <el-dialog :title="permissiondialogtitle" :visible.sync="permissiondatadialogVisible" top="5vh">
-      <el-form ref="alertform">
-        <el-form-item>
-          <div style="margin-left:1px;border:1px #CCCCCC solid;overflow:auto;height:300px;">
-            <el-checkbox-group v-model="binddevices" @change="handleCheckedCitiesChange">
-              <el-checkbox v-for="item in devices" :label="item.Id" :key="item.Id" style="margin-left:15px;">{{item.Code}}</el-checkbox>
-            </el-checkbox-group>
-          </div>
-          <el-checkbox :indeterminate="isIndeterminate" v-model="checkAll" @change="handleCheckAllChange" style="margin-left:15px;">全选</el-checkbox>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer" style="margin-top:-35px;">
-        <el-button @click="permissiondatadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savepermission()">确 定</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  import {
-    mapGetters
-  } from 'vuex'
-  export default {
-    name: 'organize',
-
-    data() {
-      return {
-        downloading: true,
-        selectedNode: 0,
-        currentItemCount: 0,
-        currentPage: 1,
-        size: 10,
-        tablelist: [], // 处理分页用
-        keyword: '',
-        parentid: '',
-        datadialogVisible: false,
-        dialogtitle: '',
-        organizeform: {
-          IsInnerOrganize: 1,
-          parentid: 0,
-          fullname: '',
-          description: '',
-          id: 0
-        },
-        rulesorganize: {
-          fullname: [{
-            required: true,
-            message: '请输入组织名称',
-            trigger: 'blur'
-          }]
-        },
-        operatingitem: 0,
-        permissiondialogtitle: '',
-        permissiondatadialogVisible: false,
-        binddevices: [],
-        devices: [],
-        devicesallid: [],
-        isIndeterminate: true,
-        checkAll: false,
-        update: true,
-        childArr: [],
-        parentArr: [],
-        // 级联选项
-        options: [],
-        currentOrgan: '请选择组织',
-        havechild: false,
-        // 数据传输
-        currId: 0,
-        currOrganName: '',
-        orgtreelist: [],
-        orgtreeprops: {
-          value: 'id',
-          label: 'Fullname',
-          children: 'children'
-        },
-        selectedorg: [],
-        userdepartment: []
-      }
-    },
-
-    created() {
-      // initial data
-      this.initData()
-      this.getorgtreelist()
-      this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
-      this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
-    },
-    updated() {},
-    watch: {},
-    computed: mapGetters({
-      authUser: 'authUser'
-    }),
-    methods: {
-      initData() {
-        let _this = this
-        // paginate
-        let params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          keyword: this.keyword,
-          parentid: this.parentid,
-          IsInnerOrganize: this.organizeform.IsInnerOrganize
-        }
-        // request
-        this.$axios.get('/organizes/listbandparentname', {
-            params
-          })
-          .then(res => {
-            // response
-            _this.tablelist = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-            _this.downloading = false
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-        // this.$axios.get('/equipment/list', {})
-        //   .then(res => {
-        //     // response
-        //     _this.devices = res.data.items
-        //     _this.devices.forEach((item, k) => {
-        //       _this.devicesallid.push(item.Id)
-        //     })
-        //   }).catch(() => {})
-      },
-      getorgtreelist() {
-        let _this = this
-        // request
-        let params = {
-          IsInnerOrganize: this.organizeform.IsInnerOrganize
-        }
-        _this.$axios.get('/organizes/list', {
-            params
-          })
-          .then(res => {
-            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      orgtreeNodeClick(data) {
-        this.parentid = data.id + ''
-        this.currentPage = 1
-        this.initData()
-      },
-      seachdata() {
-        this.currentPage = 1
-        this.initData()
-      },
-      permission(v) {
-        this.binddevices = []
-        this.permissiondialogtitle = '权限设置'
-        this.permissiondatadialogVisible = true
-        this.currId = v.Id
-        this.currOrganName = v.Fullname
-        this.$axios.get('/equipment/bindequipment/' + this.currId, null)
-          .then(res => {
-            // response
-            for (var i = 0; i < res.data.items.length; i++) {
-              this.binddevices.push(res.data.items[i].Id)
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      savepermission() {
-        let _this = this
-        _this.$axios.put('/equipment/permission/' + this.currId, {
-            EquipmentIds: this.binddevices + '',
-            OrganizeName: this.currOrganName
-          })
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              _this.permissiondatadialogVisible = false
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(() => {})
-      },
-      handleSizeChange(value) {
-        this.size = value
-        this.currentPage = 1
-        this.initData()
-      },
-      handleCurrentChange(value) {
-        this.currentPage = value
-        this.initData()
-      },
-      jstimehandle(val) {
-        val = val.replace('T', ' ')
-        return val.substring(0, 19)
-      },
-      opendatadialog(item, v, index) {
-        this.operatingitem = item
-        this.datadialogVisible = true
-        this.clearorganizeform()
-        let _this = this
-        if (item === 1) {
-          if (this.parentid !== '') {
-            this.$axios.get('/organizes/parentlist/' + this.parentid, {})
-              .then(res => {
-                if (res.data.code === 0) {
-                  _this.dialogtitle = `新增组织`
-                  // 选中状态
-                  _this.selectedorg = []
-                  let pidarr = res.data.message.split(',')
-                  for (var i = pidarr.length - 1; i >= 0; i--) {
-                    if (pidarr[i] !== '0') {
-                      _this.selectedorg.push(parseInt(pidarr[i]))
-                    }
-                  }
-                } else {
-                  _this.$message({
-                    type: 'warning',
-                    message: '出现错误!'
-                  })
-                  this.datadialogVisible = false
-                }
-              })
-              .catch(err => {
-                // handle error
-                console.error(err)
-              })
-          }
-        } else if (item === 2) {
-          this.$axios.get('/organizes/parentlist/' + v.Parentid, {})
-            .then(res => {
-              if (res.data.code === 0) {
-                _this.dialogtitle = `编辑组织信息(${v.Fullname})`
-                _this.organizeform.parentid = v.Parentid
-                _this.organizeform.fullname = v.Fullname
-                _this.organizeform.description = v.Description
-                _this.organizeform.id = v.Id
-                // 选中状态
-                _this.selectedorg = []
-                let pidarr = res.data.message.split(',')
-                for (var i = pidarr.length - 1; i >= 0; i--) {
-                  if (pidarr[i] !== '0') {
-                    _this.selectedorg.push(parseInt(pidarr[i]))
-                  }
-                }
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: '出现错误!'
-                })
-                this.datadialogVisible = false
-              }
-            })
-            .catch(err => {
-              // handle error
-              console.error(err)
-            })
-        }
-      },
-      savedata(formName) {
-        let _this = this
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            _this.organizeform.parentid = parseInt(_this.selectedorg[_this.selectedorg.length - 1])
-            if (_this.organizeform.parentid === 0) {
-              _this.$message({
-                type: 'warning',
-                message: '请选择上一级组织!'
-              })
-              return
-            }
-            if (_this.organizeform.parentid === _this.organizeform.id) {
-              _this.$message({
-                type: 'warning',
-                message: '上一级组织不能为自身数据!'
-              })
-              return
-            }
-            if (_this.operatingitem === 1) {
-              _this.organizeform.IsInnerOrganize = 1
-              _this.$axios.post('organizes/', _this.organizeform)
-                .then(res => {
-                  // response
-                  if (res.data.code === 0) {
-                    _this.$message({
-                      type: 'success',
-                      message: res.data.message
-                    })
-                    _this.datadialogVisible = false
-                    this.initData()
-                    // 重新加载tree数据
-                    _this.getorgtreelist()
-                  } else {
-                    _this.$message({
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                  }
-                })
-                .catch(err => {
-                  // handle error
-                  console.error(err)
-                })
-            } else if (_this.operatingitem === 2) {
-              _this.organizeform.IsInnerOrganize = 1
-              _this.$axios.put('organizes/' + _this.organizeform.id, _this.organizeform)
-                .then(res => {
-                  // response
-                  if (res.data.code === 0) {
-                    _this.$message({
-                      type: 'success',
-                      message: res.data.message
-                    })
-                    _this.datadialogVisible = false
-                    // 更新界面
-                    _this.initData()
-                    // 重新加载tree数据
-                    _this.getorgtreelist()
-                  } else {
-                    _this.$message({
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                  }
-                })
-                .catch(() => {})
-            }
-          } else {
-            return false
-          }
-        })
-      },
-      deletedata(val) {
-        let _this = this
-        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.delete('organizes/' + val.Id, null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                // 更新界面
-                _this.initData()
-                // 重新加载tree数据
-                _this.getorgtreelist()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-          // _this.$axios.put('device/deviceclear/' + val.Id, null)
-          //   .then(res => {
-          //     // response
-          //   })
-          //   .catch(() => {})
-          // _this.$axios.put('user/organclear/' + val.Id, null)
-          //   .then(res => {
-          //     // response
-          //   })
-          //   .catch(() => {})
-        }).catch(() => {})
-      },
-      resetForm(formName) {
-        //this.$refs[formName].resetFields()
-      },
-      clearorganizeform() {
-        this.organizeform = {
-          parentid: 0,
-          fullname: '',
-          description: '',
-          id: 0
-        }
-      },
-      clearSearch() {
-        this.keyword = ''
-        this.initData()
-      }
-    }
-  }
-
-</script>
-
-<style lang="scss">
-  .el-pagination {
-    margin: 1rem 0 2rem;
-    text-align: right;
-  }
-
-  .triggerone {
-    font-size: 13px;
-    margin-left: 80px;
-  }
-
-  .plab {
-    font-size: 13px;
-    color: #999;
-  }
-
-</style>

+ 49 - 21
src/dashoo.cn/frontend_web/src/pages/userchangepwd.vue → src/dashoo.cn/frontend_web/src/pages/system/userchangepwd.vue

@@ -1,5 +1,31 @@
+<style>
+  .input-with-select .el-select .el-input {
+    width: 110px;
+  }
+
+  .input-with-select .el-input-group__append {
+    background-color: #fff;
+  }
+
+</style>
+
 <template>
-  <div class="page">
+  <el-card style="min-height: calc(100vh - 92px);">
+    <div slot="header" style="height: 20px;">
+      <span style="float: left;">
+        <i class="icon icon-table2"></i>
+      </span>
+      <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
+        <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+        <el-breadcrumb-item>密码修改</el-breadcrumb-item>
+      </el-breadcrumb>
+      <span style="float: right;">
+        <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
+          @click="submitForm('pwdform')">提交</el-button>
+        <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
+          @click="resetForm('pwdform')">重置</el-button>
+      </span>
+    </div>
     <el-row>
       <el-col :span="12">
         <el-form :model="pwdform" :rules="pwdrules" ref="pwdform" label-width="200px">
@@ -12,14 +38,10 @@
           <el-form-item label="确认新的登录密码 :" prop="checknewPass" required>
             <el-input type="password" v-model="pwdform.checknewPass" auto-complete="off"></el-input>
           </el-form-item>
-          <el-form-item>
-            <el-button type="primary" @click="submitForm('pwdform')">提交</el-button>
-            <el-button @click="resetForm('pwdform')">重置</el-button>
-          </el-form-item>
         </el-form>
       </el-col>
     </el-row>
-  </div>
+  </el-card>
 </template>
 
 <script>
@@ -52,15 +74,19 @@
           checknewPass: ''
         },
         pwdrules: {
-          pass: [
-            { required: true, message: '请输入当前密码', trigger: 'blur' }
-          ],
-          newpass: [
-            { validator: validatePass, trigger: 'blur' }
-          ],
-          checknewPass: [
-            { validator: validatePass2, trigger: 'blur' }
-          ]
+          pass: [{
+            required: true,
+            message: '请输入当前密码',
+            trigger: 'blur'
+          }],
+          newpass: [{
+            validator: validatePass,
+            trigger: 'blur'
+          }],
+          checknewPass: [{
+            validator: validatePass2,
+            trigger: 'blur'
+          }]
         }
       }
     },
@@ -96,13 +122,15 @@
       }
     }
   }
+
 </script>
 
 <style>
-.page {
-  margin: 50px;
-  padding: 20px 40px;
-  background-color: #fff;
-  box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
-}
+  .page {
+    margin: 50px;
+    padding: 20px 40px;
+    background-color: #fff;
+    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
+  }
+
 </style>

+ 225 - 0
src/dashoo.cn/frontend_web/src/pages/system/usersetting.vue

@@ -0,0 +1,225 @@
+<style>
+  .input-with-select .el-select .el-input {
+    width: 110px;
+  }
+
+  .input-with-select .el-input-group__append {
+    background-color: #fff;
+  }
+
+</style>
+
+<template>
+  <el-card style="min-height: calc(100vh - 92px);">
+    <div slot="header" style="height: 20px;">
+      <span style="float: left;">
+        <i class="icon icon-table2"></i>
+      </span>
+      <el-breadcrumb class="heading" style="float: left; margin-left: 5px">
+        <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
+        <el-breadcrumb-item>账号设置</el-breadcrumb-item>
+      </el-breadcrumb>
+      <span style="float: right;">
+        <el-button size="mini" type="primary" class="el-button--small" style="margin-left: 8px"
+          @click="savedata('form')">保存</el-button>
+      </span>
+    </div>
+    <el-row>
+      <el-col :span="16">
+        <el-form ref="form" :model="form" :rules="rulesform" label-width="80px">
+          <el-row>
+            <el-col :span="12">
+              <el-form-item label="账号">
+                <el-input v-model="authUser.name" disabled></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="编码">
+                <el-input v-model="form.CompanyCode"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+          <el-row>
+            <el-form-item required prop="Realname" label="名称">
+              <el-input v-model="form.Realname"></el-input>
+            </el-form-item>
+
+            <el-form-item label="单位地址">
+              <el-input v-model="form.Address"></el-input>
+            </el-form-item>
+
+            <el-col :span="12">
+              <el-form-item label="联系人">
+                <el-input v-model="form.Manager"></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="手机">
+                <el-input v-model="form.Telephone"></el-input>
+              </el-form-item>
+            </el-col>
+            <el-col :span="12">
+              <el-form-item label="座机">
+                <el-input v-model="form.Mobile"></el-input>
+              </el-form-item>
+            </el-col>
+
+            <el-col :span="12">
+              <el-form-item label="Email">
+                <el-input v-model="form.Email"></el-input>
+              </el-form-item>
+            </el-col>
+          </el-row>
+
+          <el-form-item label="备注">
+            <el-input type="textarea" :rows="4" v-model="form.Description"></el-input>
+          </el-form-item>
+
+        </el-form>
+      </el-col>
+      <el-col :span="2">&nbsp;</el-col>
+      <el-col :span="5">
+        <el-upload class="avatar-uploader" :action="'http://'+host+'/api/users/uploadphoto'" :show-file-list="false"
+          :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
+          <img v-if="imageUrl" :src="imageUrl" class="usersettingavatar">
+          <img v-else class="usersettingavatar" src="../assets/img/avatar-default.jpg">
+        </el-upload>
+        <div style="font-size:14px;color:#5D6A76;margin-left:55px;margin-bottom:20px;margin-top:10px;">上传头像</div>
+      </el-col>
+    </el-row>
+  </el-card>
+</template>
+
+<script>
+  import {
+    mapGetters
+  } from 'vuex'
+  export default {
+    name: 'usersetting',
+    data() {
+      return {
+        form: {
+          CompanyCode: '',
+          Realname: '',
+          Address: '',
+          Manager: '',
+          Telephone: '',
+          Mobile: '',
+          Email: '',
+          Description: '',
+          Photo: ''
+        },
+        host: '',
+        imageUrl: '',
+        rulesform: {
+          Realname: [{
+            required: true,
+            message: '请输入单位名称',
+            trigger: 'blur'
+          }]
+        }
+      }
+    },
+    computed: mapGetters({
+      authUser: 'authUser'
+    }),
+    created() {
+      // initial data
+      this.form.CompanyCode = this.authUser.Profile.CompanyCode
+      this.form.Realname = this.authUser.Profile.Realname
+      this.form.Address = this.authUser.Profile.Address
+      this.form.Manager = this.authUser.Profile.Manager
+      this.form.Telephone = this.authUser.Profile.Telephone
+      this.form.Mobile = this.authUser.Profile.Mobile
+      this.form.Email = this.authUser.Profile.Email
+      this.form.Description = this.authUser.Profile.Description
+      this.form.Photo = this.authUser.Profile.Photo
+      this.host = this.authUser.Profile.Host
+      if (this.form.Photo !== '') {
+        this.imageUrl = `http://${this.host}${this.form.Photo}`
+      }
+    },
+    methods: {
+      handleAvatarSuccess(res, file) {
+        this.form.Photo = res
+        this.imageUrl = URL.createObjectURL(file.raw)
+      },
+      beforeAvatarUpload(file) {
+        const isJPG = (file.type.indexOf('image/') === 0)
+        const isLt2M = file.size / 1024 / 1024 < 1
+        if (!isJPG) {
+          this.$message.error('上传头像图片只能是 图片 格式!')
+          return false
+        }
+        if (!isLt2M) {
+          this.$message.error('上传头像图片大小不能超过 1MB!')
+          return false
+        }
+        return true
+      },
+      savedata(formName) {
+        let _this = this
+        this.$refs[formName].validate((valid) => {
+          if (valid) {
+            this.$axios.put('users/membersetting', _this.form)
+              .then(res => {
+                // response
+                if (res.data.code === 0) {
+                  _this.$message({
+                    type: 'success',
+                    message: res.data.message
+                  })
+                  this.$store.commit('SET_Profile', this.form)
+                } else {
+                  _this.$message({
+                    type: 'warning',
+                    message: res.data.message
+                  })
+                }
+              })
+              .catch(() => {})
+          }
+        })
+      }
+    }
+  }
+
+</script>
+
+<style>
+  .page {
+    margin: 50px;
+    padding: 20px 40px;
+    background-color: #fff;
+    box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
+  }
+
+  .avatar-uploader .el-upload {
+    border: 1px dashed #d9d9d9;
+    border-radius: 6px;
+    cursor: pointer;
+    position: relative;
+    overflow: hidden;
+  }
+
+  .avatar-uploader .el-upload:hover {
+    border-color: #20a0ff;
+  }
+
+  .avatar-uploader-icon {
+    font-size: 28px;
+    color: #8c939d;
+    width: 178px;
+    height: 178px;
+    line-height: 178px;
+    text-align: center;
+  }
+
+  .usersettingavatar {
+    width: 178px;
+    height: 178px;
+    display: block;
+  }
+
+</style>

+ 0 - 615
src/dashoo.cn/frontend_web/src/pages/userrole.vue

@@ -1,615 +0,0 @@
-<template>
-  <div v-loading="exportloading" element-loading-text="数据准备中,请稍候。。。">
-    <el-breadcrumb class="heading">
-      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
-      <el-breadcrumb-item>角色管理</el-breadcrumb-item>
-    </el-breadcrumb>
-    <el-card class="box-card">
-      <div slot="header">
-        <span>
-          <i class="icon icon-table2"> 角色管理</i>
-        </span>
-        <span style="float: right;">
-           <el-button size="small" type="primary" @click="opendialog(null)">添加</el-button>
-        </span>
-      </div>
-      <el-collapse>
-          <el-collapse-item title="查询">
-          <el-form ref="form" label-width="120px">
-            <el-row>
-              <el-col :span="8">
-                  <el-form-item label="角色名">
-                    <el-input type=" " v-model="searchform.name" placeholder="请输入角色名"> ></el-input>
-                </el-form-item>
-              </el-col>
-            </el-row>
-            <el-row>
-              <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 1px">&nbsp;</el-col>
-            </el-row>
-            <el-row :gutter="0" style="text-align:right;margin-top:10px;">
-                <el-button @click="clicksearch" size="small" type="primary">查询</el-button>
-                <el-button type="primary" class="el-button--small" @click="clearSearch" style="margin-left:8px">重 置</el-button>
-            </el-row>
-          </el-form>
-        </el-collapse-item>
-      </el-collapse>
-        <el-table :data="list" tooltip-effect="dark" border>
-          <el-table-column label="操作" width="110px"  align="center" >
-          <template slot-scope="scope">
-              <el-button size="small" @click="opendialog(scope.row)" type="text" icon="el-icon-edit" title="编辑"></el-button>
-              <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除" @click="deletedata(scope.row)"></el-button>
-              <el-button size="small" type="text" style="margin-left:3px" title="菜单权限" @click="setpower(scope.row)"><i class="icon icon-file-text"></i></el-button>
-              <el-button size="small" type="text" style="margin-left:3px" title="操作权限" @click="getItemPower(scope.row)"><i class="icon icon-lock"></i></el-button>
-              <el-button size="small" type="text" style="margin-left:1px" title="容器权限" @click="setequipmentpower(scope.row)" v-if = "appclient != 'lims'"><i class="icon icon-cog"></i></el-button>
-          </template>
-        </el-table-column>
-        	<el-table-column prop="Realname" align="center"  label="角色名" show-overflow-tooltip></el-table-column>
-        	<el-table-column prop="Description" align="center"  label="角色描述" show-overflow-tooltip></el-table-column>
-        	<el-table-column label="创建日期" align="center"  show-overflow-tooltip>
-          <template slot-scope="scope">
-            {{ jstimehandle(scope.row.CreateOn+'') }}
-          </template>
-        </el-table-column>
-      </el-table>
-      <el-pagination
-        @size-change="handleSizeChange"
-        @current-change="handleCurrentChange"
-        :current-page="currentPage"
-        :page-sizes="[10, 15, 20, 25]"
-        :page-size="size"
-        layout="total, sizes, prev, pager, next, jumper"
-        :total="currentItemCount">
-      </el-pagination>
-    </el-card>
-    <!-- 添加角色 -->
-    <el-dialog :title="dialogtitle" :visible.sync="dialogVisible">
-      <el-form :model="roleform">
-        <el-form-item label="角色名称" :label-width="formLabelWidth">
-          <el-input v-model="roleform.realname" placeholder="请输入角色名称"></el-input>
-        </el-form-item>
-        <el-form-item label="角色描述" :label-width="formLabelWidth">
-          <el-input type="textarea" v-model="roleform.description" placeholder="请输入角色描述"></el-input>
-        </el-form-item>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="dialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savedata()">确 定</el-button>
-      </div>
-    </el-dialog>
-    <!-- 菜单权限 -->
-    <el-dialog :title="powerdialogtitle" :visible.sync="powerdialogVisible">
-      <el-tree style="border: 0" show-checkbox node-key="id"
-               :data="modulepowerdata"
-               :props="modulepowerProps"
-               ref="modulepowertree">
-      </el-tree>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="powerdialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savepower()">确 定</el-button>
-      </div>
-    </el-dialog>
-    <!-- 容器权限 -->
-    <el-dialog title="容器权限" :visible.sync="powerequipmentdialogVisible">
-      <el-checkbox :indeterminate="isequpicheckall" v-model="equipCheckAll" @change="handleCheckAllChange">全选</el-checkbox>
-      <div style="margin-top:10px;" class="rowequippower">
-        <el-checkbox-group v-model="selectedequip">
-          <el-checkbox v-for="item in equipalllist" :key="item.Id"  @change="handlecheckedequpichange" :label="item.Id" :value="item.Id"> {{item.Name}}</el-checkbox>
-        </el-checkbox-group>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="powerequipmentdialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="saveequiptmentpower()">确 定</el-button>
-      </div>
-    </el-dialog>
-    <!-- 操作权限 -->
-    <el-dialog :title="dialogtitle" :visible.sync="operationPowerDialogVisible">
-      <el-tree style="border: 0" show-checkbox node-key="id"
-               :data="operationPowerData"
-               :props="modulepowerProps"
-               ref="operationPowerTree">
-      </el-tree>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="operationPowerDialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="saveOperatinonPower()">确 定</el-button>
-      </div>
-    </el-dialog>
-
-    <!-- 给操作权限添加角色 -->
-    <el-dialog title="给操作权限选择角色" :visible.sync="addRoleOpsDialogVisible">
-      <div>
-        <el-checkbox-group v-model="rolesToOpsPerList">
-          <el-checkbox v-for="item in list" :key="item.Id" :label="item.Realname"></el-checkbox>
-        </el-checkbox-group>
-      </div>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="addRoleOpsDialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="addRoleToOperation()">确 定</el-button>
-      </div>
-    </el-dialog>
-  </div>
-</template>
-
-<script>
-  import { mapGetters } from 'vuex'
-  export default {
-    name: 'userrole',
-    computed: mapGetters({
-      session: 'session'
-    }),
-    data() {
-      return {
-        exportloading: true,
-        searchform: {
-          name: ''
-        },
-        currentItemCount: 0,
-        currentPage: 1,
-        size: 10,
-        list: [],
-        formLabelWidth: '120px',
-        dialogtitle: '', // 添加编辑对话框
-        dialogVisible: false,
-        roleform: {
-          roleid: 0,
-          realname: '',
-          description: ''
-        },
-        powerdialogtitle: '', // 权限对话框
-        powerdialogVisible: false,
-        powerequipmentdialogVisible: false, // 容器权限
-        operationPowerDialogVisible: false, // 操作权限
-        addRoleOpsDialogVisible: false, // 给操作添加角色
-        modulepowerdata: [], // 菜单树
-        operationPowerData: [], // 操作树
-        modulepowerProps: {
-          value: 'id',
-          label: 'name',
-          children: 'children'
-        },
-        operationid: 0, // 操作ID
-        equipalllist: [], // 容器列表
-        selectedequip: [],
-        isequpicheckall: false,
-        equipCheckAll: false,
-        rolesToOpsPerList: [],
-        currentPerIdForAddRoleToOps: '',
-        appclient: ''
-      }
-    },
-    created () {
-      this.appclient = process.env.appclient
-      console.log("this.appclient = ", this.appclient)
-      // initial data
-      this.initData()
-      this.getallequipmentlist()
-    },
-    methods: {
-      initData () {
-        let _this = this
-        // paginate
-        const params = { _currentPage: this.currentPage, _size: this.size, keyword: this.searchform.name }
-        // request
-        this.$axios.get('/role/list', { params })
-          .then(res => {
-            // response
-            _this.list = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-             _this.exportloading=false
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-             _this.exportloading=false
-          })
-      },
-      jstimehandle (val) {
-        val = val.replace('T', ' ')
-        return val.substring(0, 10)
-      },
-      clicksearch() {
-        this.currentPage = 1
-        this.initData()
-      },
-      opendialog(val) {
-        if (val === null) {
-          this.dialogtitle = '添加角色'
-          this.clearroleform()
-        } else {
-          this.dialogtitle = '编辑角色-' + val.Realname
-          this.roleform.roleid = val.Id
-          this.roleform.realname = val.Realname
-          this.roleform.description = val.Description
-        }
-        this.dialogVisible = true
-      },
-      setpower(val) {
-        let _this = this
-        _this.operationid = val.Id
-        _this.$axios.get('/role/getpower?id=' + _this.operationid, null)
-          .then(res => {
-            // response
-            _this.modulepowerdata = window.toolfun_gettreejson(res.data.Module, 'id', 'pId', 'id,name')
-            let selectmodels = []
-            if (res.data.Selectemodule) {
-              for (var i = 0; i < res.data.Selectemodule.length; i++) {
-                let isParent = false
-                for (let j = 0; j < res.data.Selectemodule.length; j++) {
-                  if(res.data.Selectemodule[i].id === res.data.Selectemodule[j].pId){
-                    //是父节点
-                    isParent = true
-                    break;
-                  }
-                }
-                if(isParent) {//不去勾选父节点
-                    continue
-                }
-                 //选中
-                selectmodels.push(res.data.Selectemodule[i].id)
-              }
-            }
-            _this.$refs.modulepowertree.setCheckedKeys(selectmodels, true)
-          })
-          .catch(() => {})
-        this.powerdialogtitle = '角色(' + val.Realname + ')-菜单权限设置'
-        this.powerdialogVisible = true
-      },
-
-      getItemPower(val) {
-        console.log(val)
-        let _this = this
-        _this.operationid = val.Id
-        _this.$axios.get('/role/getItemPower?id=' + _this.operationid, null)
-          .then(res => {
-            console.log(res.data)
-            // response
-            _this.operationPowerData = window.toolfun_gettreejson(res.data.Operation, 'id', 'pId', 'id,name,scope')
-            let selectmodels = []
-            if (res.data.Selecteoperation) {
-              for (var i = 0; i < res.data.Selecteoperation.length; i++) {
-                let isParent = false
-                for (let j = 0; j < res.data.Selecteoperation.length; j++) {
-                  if(res.data.Selecteoperation[i].id === res.data.Selecteoperation[j].pId){
-                    //是父节点
-                    isParent = true
-                    break;
-                  }
-                }
-                if(isParent) {//不去勾选父节点
-                    continue
-                }
-                 //选中
-                selectmodels.push(res.data.Selecteoperation[i].id)
-              }
-            }
-            _this.$refs.operationPowerTree.setCheckedKeys(selectmodels)
-          })
-          .catch(() => {})
-        this.powerdialogtitle = '用户(' + val.Realname + ')-操作权限设置'
-        this.operationPowerDialogVisible = true
-      },
-
-
-      deletedata (val) {
-        let _this = this
-        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.delete('role/'+val.Id + '', null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                // 更新界面
-                this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }).catch(() => {})
-      },
-      savedata() {
-        if (this.roleform.realname === '') {
-          this.$message({
-            type: 'warning',
-            message: '角色名称不能为空!'
-          })
-          return
-        }
-        let _this = this
-        if (this.dialogtitle === '添加角色') {
-          _this.$axios.post('role/',_this.roleform)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                _this.dialogVisible = false
-                this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(err => {
-              // handle error
-              console.error(err)
-            })
-        } else {
-          _this.$axios.put('role/'+_this.roleform.roleid + '', _this.roleform)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                _this.dialogVisible = false
-                // 更新界面
-                this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }
-      },
-      savepower() {
-        let orgids = []
-        let selectnodes = this.$refs.modulepowertree.getCheckedNodes(false, true)
-        selectnodes.forEach(row => {
-          orgids.push(row.id)
-        })
-        let _this = this
-        _this.$axios.put('/role/savepower?id=' + _this.operationid + '&moduleids=' + orgids, {})
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              _this.powerdialogVisible = false
-              // 更新界面
-              this.initData()
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(() => {})
-      },
-
-      saveOperatinonPower() {
-        let orgids = []
-        let selectnodes = this.$refs.operationPowerTree.getCheckedNodes()
-        selectnodes.forEach(row => {
-          orgids.push(row.id)
-        })
-        let _this = this
-        _this.$axios.put('/role/saveOperationPower?id=' + _this.operationid + '&operids=' + orgids, {})
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              _this.operationPowerDialogVisible = false
-              // 更新界面
-              this.initData()
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(() => {})
-      },
-      getallequipmentlist() {
-        let _this = this
-        _this.$axios.get('/equipment/equipalllist', {})
-          .then(res => {
-            _this.equipalllist = res.data.items
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      setequipmentpower(val) {
-        let _this = this
-        _this.operationid = val.Id
-        _this.selectedequip = []
-        _this.$axios.get('/role/getroleequidpower?id=' + val.Id, {})
-          .then(res => {
-            for (let i = 0; i < res.data.length; i++) {
-              if (parseInt(res.data[i]) > 0) {
-                _this.selectedequip.push(parseInt(res.data[i]))
-              }
-            }
-            _this.handlecheckedequpichange()
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-        _this.powerequipmentdialogVisible = true
-      },
-      saveequiptmentpower() {
-        let _this = this
-        // request
-        this.$axios.put('/role/saveequpipower?id=' + this.operationid + '&selectedids=' + this.selectedequip, {})
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              // 更新界面
-              this.initData()
-              this.powerequipmentdialogVisible = false
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-
-      renderContent(h, { node, data, store }) {
-          if(data.scope == '3') {
-            return (
-              <span >
-                <span>
-                  <span>{node.label}</span>
-                </span>
-                <span style="margin-left:10px;">
-                  <el-button style="font-size: 12px;" type="text" on-click={ () => this.showAddRoleToOperation(data) }>选择角色</el-button>
-                </span>
-              </span>);
-          }else {
-            return (<span >
-                <span>
-                  <span>{node.label}</span>
-                </span>
-              </span>);
-          }
-      },
-
-      showAddRoleToOperation(data) {
-        let _this = this
-        this.addRoleOpsDialogVisible = true
-        this.currentPerIdForAddRoleToOps = data.id
-
-        // request
-        this.$axios.get('/role/getRoleOpsRolePower?id=' + this.operationid + '&perId=' + this.currentPerIdForAddRoleToOps, {})
-          .then(res => {
-            // response
-            if (res.data && res.data.length > 0) {
-              _this.rolesToOpsPerList = []
-              for (let i = 0; i < res.data.length; i++) {
-                _this.rolesToOpsPerList.push(res.data[i].realname)
-              }
-            } else {
-              console.log("res.data", res.data)
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-
-      },
-
-      addRoleToOperation() {
-        let _this = this
-        let RoleIds = []
-        for (let i = 0; i < this.rolesToOpsPerList.length; i++) {
-          for(let j = 0; j < this.list.length; j++) {
-            if (this.list[j].Realname == this.rolesToOpsPerList[i]) {
-              RoleIds.push(this.list[j].Id)
-              break
-            }
-          }
-        }
-        console.log(RoleIds)
-        // request
-        this.$axios.post('/role/saveRoleOpsRolePower?id=' + this.operationid + '&perId=' + this.currentPerIdForAddRoleToOps + '&roleIds=' + RoleIds.join(','), {})
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-        this.addRoleOpsDialogVisible = true
-      },
-
-
-      // 全选框控制
-      handleCheckAllChange(val) {
-        this.selectedequip = []
-        if (val) {
-          for (let i = 0; i < this.equipalllist.length; i++) {
-            this.selectedequip.push(this.equipalllist[i].Id)
-          }
-        }
-        this.isequpicheckall = false
-      },
-      handlecheckedequpichange() {
-        let checkedCount = this.selectedequip.length
-        this.equipCheckAll = checkedCount === this.equipalllist.length
-        this.isequpicheckall = checkedCount > 0 && checkedCount < this.equipalllist.length
-      },
-      handleSizeChange (value) {
-        this.size = value
-        this.currentPage = 1
-        this.initData()
-      },
-      handleCurrentChange (value) {
-          this.currentPage = value
-          this.initData()
-      },
-      clearroleform() {
-        this.roleform.roleid = 0
-        this.roleform.realname = ''
-        this.roleform.description = ''
-      },
-      clearSearch() {
-        this.searchform.name = ''
-        this.initData()
-      }
-    }
-  }
-</script>
-
-<style lang="scss">
-   .el-pagination {
-      margin: 1rem 0 2rem;
-      text-align: right;
-    }
-   .plab {
-      font-size: 13px;
-      color: #999;
-   }
-  .rowequippower .el-checkbox{
-    margin-left: 1px;
-    padding: 5px 10px 0 0;
-  }
-</style>

+ 0 - 815
src/dashoo.cn/frontend_web/src/pages/users.vue

@@ -1,815 +0,0 @@
-<template>
-  <div v-loading="downloading" element-loading-text="数据拼命准备中,请稍候。。。">
-    <el-breadcrumb class="heading">
-      <el-breadcrumb-item :to="{ path: '/' }">平台首页</el-breadcrumb-item>
-      <el-breadcrumb-item>用户管理</el-breadcrumb-item>
-    </el-breadcrumb>
-    <el-card class="box-card">
-      <div slot="header">
-        <span>
-          <i class="icon icon-table2"> 用户管理</i>
-        </span>
-        <span style="float: right;">
-          <el-button size="small" type="primary" @click="opendatadialog(1,null,-1);resetForm('organizeform')">新增用户</el-button>
-        </span>
-      </div>
-      <el-row :gutter="20">
-        <!--列表-->
-        <el-collapse>
-          <el-collapse-item title="查询">
-            <el-form ref="form" label-width="120px">
-              <el-row>
-                <el-col :span="8">
-                  <el-form-item label="账号">
-                    <el-input v-model="keyword" placeholder="请输入账号"> ></el-input>
-                  </el-form-item>
-                </el-col>
-              </el-row>
-              <el-row>
-                <el-col class="line" :span="24" style="background-color:lightgrey; line-height: 1px">&nbsp;</el-col>
-              </el-row>
-              <el-row :gutter="0" style="text-align:right;margin-top:10px;">
-                <el-button @click="seachdata" size="small" type="primary">查询</el-button>
-                <el-button type="primary" class="el-button--small" @click="clearSearch" style="margin-left:8px">重 置</el-button>
-              </el-row>
-            </el-form>
-          </el-collapse-item>
-        </el-collapse>
-        <el-table :data="list" border>
-          <el-table-column label="操作" align="center">
-            <template slot-scope="scope">
-              <el-button size="small" @click="opendatadialog(2,scope.row,scope.$index);" type="text" icon="el-icon-edit"
-                title="编辑"></el-button>
-              <el-button size="small" type="text" style="margin-left:3px" icon="el-icon-delete" title="删除" @click="deletedata(scope.row)"></el-button>
-              <!-- <el-button size="small" type="text" style="margin-left:1px" title="权限" @click="permission(scope.row)"><i class="icon icon-lock"></i></el-button> -->
-              <el-button size="small" type="text" style="margin-left:3px" title="密码重置" @click="resetpwd(scope.row)">
-                <i class="icon icon-spinner11"></i>
-              </el-button>
-              <el-button size="small" type="text" style="margin-left:3px" title="设置角色" @click="roleset(scope.row)">
-                <i class="icon icon-users"></i>
-              </el-button>
-            </template>
-          </el-table-column>
-          <el-table-column prop="Username" align="center" label="账号" show-overflow-tooltip></el-table-column>
-          <el-table-column prop="Realname" align="center" label="用户名"></el-table-column>
-          <el-table-column prop="Departmentname" align="center" label="所属组织"></el-table-column>
-          <el-table-column prop="RealnameRole" align="center" label="角色"></el-table-column>
-          <el-table-column prop="Telephone" align="center" label="手机" show-overflow-tooltip></el-table-column>
-          <el-table-column label="座机" align="center" prop="Mobile" show-overflow-tooltip></el-table-column>
-          <el-table-column v-if="this.appclient != 'lims'" prop="Description" align="center" label="备注"
-            show-overflow-tooltip></el-table-column>
-        </el-table>
-      </el-row>
-    </el-card>
-    <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
-      :page-sizes="[10, 15, 20, 25]" :page-size="size" layout="total, sizes, prev, pager, next, jumper" :total="currentItemCount">
-    </el-pagination>
-
-    <el-dialog :title="dialogtitle" :visible.sync="datadialogVisible" width="720px">
-      <el-form :model="userform" :rules="rulesuser" ref="userform" label-width="100px">
-        <el-row>
-          <el-col :span="24">
-            <el-form-item label="账号/Email" prop="username" required>
-              <el-input v-model="userform.username" auto-complete="off" :disabled="disabledserial"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="用户名" required prop="realname">
-              <el-input v-model="userform.realname"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="所属组织" required>
-              <el-cascader :options="orgtreelist" :props="orgtreeprops" change-on-select :show-all-levels="false"
-                v-model="selectedorg" placeholder="请选择组织"></el-cascader>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="手机" prop="telephone">
-              <el-input v-model="userform.telephone" auto-complete="off"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item label="座机" prop="mobile">
-              <el-input v-model="userform.mobile" auto-complete="off"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item v-if="this.appclient != 'lims'" label="备注">
-              <el-input type="textarea" v-model="userform.description" auto-complete="off"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="24">
-            <el-form-item v-if=" this.appclient== 'lims'" label="签名">
-              <!-- <el-input type="textarea" v-model="userform.description" auto-complete="off"></el-input> -->
-              <el-upload style="margin-top: 10px;" class="usersignimg-uploader" :action="imghost + '/api/limsupload/usersignimg'"
-                :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
-                <img v-if="imageUrl" :src="imageUrl" class="uploadusersignimg">
-                <i v-else class="el-icon-plus usersignimg-uploader-icon"></i>
-              </el-upload>
-            </el-form-item>
-          </el-col>
-        </el-row>
-      </el-form>
-      <div slot="footer" class="dialog-footer">
-        <el-button @click="datadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savedata('userform')">确 定</el-button>
-      </div>
-    </el-dialog>
-
-
-    <el-dialog :title="rolesettitle" :visible.sync="rolesetVisible">
-      <el-checkbox :indeterminate="isrolecheckall" v-model="roleCheckAll" @change="handleCheckAllChange">全选</el-checkbox>
-      <div style="margin-top:20px;">
-        <el-checkbox-group v-model="selectedrole">
-          <el-checkbox v-for="role in rolelist" @change="handlecheckedrolechange" :label="role.Id" :value="role.Id" :key="role">{{role.Realname}}</el-checkbox>
-        </el-checkbox-group>
-      </div>
-      <div slot="footer">
-        <el-button @click="rolesetVisible = false">取消</el-button>
-        <el-button type="primary" @click="rolesave()">确定</el-button>
-      </div>
-    </el-dialog>
-    <el-dialog :title="permissiondialogtitle" :visible.sync="permissiondatadialogVisible" top="5vh">
-      <el-col :span="6" style="margin-right: 10px">
-        <div class="userpermisstreediv">
-          <el-tree style="border: 0" node-key="id" show-checkbox :data="orgtreelist" :props="orgtreeprops"
-            :default-expanded-keys="userdepartment" @check-change="userpermissorgcheckedchange" ref="userpermisstree">
-          </el-tree>
-        </div>
-      </el-col>
-      <el-col :span="17">
-        <el-form ref="alertform">
-          <el-form-item>
-            <div class="userpermissdiv">
-              <el-checkbox-group v-model="userpermissdevicesselects">
-                <el-checkbox v-for="item in equipdeviceslist" :label="item.Id+''" :key="item.Id">{{item.Code}}</el-checkbox>
-              </el-checkbox-group>
-            </div>
-          </el-form-item>
-        </el-form>
-      </el-col>
-      <div slot="footer" class="dialog-footer" style="margin-top:-35px;">
-        <el-button @click="permissiondatadialogVisible = false">取 消</el-button>
-        <el-button type="primary" @click="savepermission()">确 定</el-button>
-      </div>
-    </el-dialog>
-
-  </div>
-</template>
-
-<script>
-  import {
-    mapGetters
-  } from 'vuex'
-  export default {
-    name: 'users',
-
-    data() {
-      var checkusername = (rule, value, callback) => {
-        if (!value) {
-          callback(new Error('请输入账号'))
-        } else {
-          if (this.appclient == 'lims') { //大港油田lims系统不用邮箱
-            callback()
-          }
-          let re = /^([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|-|.|-]?)*[a-zA-Z0-9]+.[a-zA-Z]{2,3}$/
-          if (!re.test(value)) {
-            callback(new Error('请输入正确的邮箱地址'))
-          } else {
-            callback()
-          }
-        }
-      }
-      return {
-        downloading: '',
-        imghost: "",
-        organdialogVisible: false,
-        currentItemCount: 0,
-        currentItemCount2: 0,
-        currentItemCount3: 0,
-        currentPage: 1,
-        size: 10,
-        rolesettitle: '',
-        rolesetVisible: false,
-        roleCheckAll: false,
-        isrolecheckall: false,
-        selectedrole: [],
-        bossSelect: [],
-        list: [],
-        rolelist: [],
-        mustrolelist: [],
-        keyword: '',
-        datadialogVisible: false,
-        dialogtitle: '',
-        disabledserial: false,
-        IsInnerOrganize: 1,
-        appclient: '',
-        userform: {
-          username: '',
-          realname: '',
-          telephone: '',
-          mobile: '',
-          sign: '',
-          description: '',
-          id: 0,
-          departmentid: '',
-          departmentname: '',
-          RealnameRole: '',
-          GroupId: '',
-          GroupName: '',
-        },
-        rulesuser: {
-          username: [{
-            validator: checkusername,
-            trigger: 'blur'
-          }],
-          realname: [{
-            required: true,
-            message: '用户名',
-            trigger: 'blur'
-          }]
-        },
-        imageUrl: "",
-        operatingitem: 0,
-        permissiondialogtitle: '',
-        permissiondatadialogVisible: false,
-        isfristchecked: false, // 过滤点击树时出现的多次触发选择事件
-        userpermisstreedata: [], // 组织tree 数据
-        userpermissdevicesselects: [], // 设备批量设置所选设备
-        equipdeviceslist: [], // 批量设置设备设备所有数据
-        equipalllist: [], // 设备所有数据
-        checkedarr: [], // 树形控件多选框
-        orgtreelist: [],
-        orgtreeprops: {
-          value: 'id',
-          label: 'Fullname',
-          children: 'children'
-        },
-        rolelistcheckall: [],
-        selectedorg: [],
-        userdepartment: [],
-        ischeckbj: false, // 过滤字段勾选时触发的选中事件
-      }
-    },
-    computed: mapGetters({
-      authUser: 'authUser'
-    }),
-    created() {
-      this.appclient = process.env.appclient
-      this.imghost = process.env.limsimgserverhost;
-      this.getorgtreelist()
-      this.initData()
-      // this.loadequipsall()
-      this.userdepartment.push(parseInt(this.authUser.Profile.DepartmentId))
-      this.selectedorg = [parseInt(this.authUser.Profile.DepartmentId)]
-    },
-    methods: {
-      initData() {
-        let _this = this
-        // paginate
-        const params = {
-          _currentPage: this.currentPage,
-          _size: this.size,
-          keyword: this.keyword
-        }
-        // request
-        this.$axios.get('users/usualwithrole', {
-            params
-          })
-          .then(res => {
-            // response
-            _this.list = res.data.items
-            _this.currentItemCount = res.data.currentItemCount
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-        this.$axios.get('role/list', {})
-          .then(res => {
-            // response
-            _this.rolelist = res.data.items
-            _this.roleItemCount = res.data.currentItemCount
-            for (var i = 0; i < _this.roleItemCount; i++) {
-              _this.rolelistcheckall.push(_this.rolelist[i].Id)
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      handleAvatarSuccess(res, file) {
-        this.userform.sign = res
-        this.imageUrl = URL.createObjectURL(file.raw);
-      },
-      beforeAvatarUpload(file) {
-        console.log(file);
-        const isimg = file.type.indexOf("image/") === 0;
-        const isLt50k = file.size / 1024 / 50 < 1;
-        if (!isimg) {
-          this.$message.error("上传图片只能是 图片 格式!");
-          return false;
-        }
-        if (!isLt50k) {
-          this.$message.error("上传图片大小不能超过 50kb!");
-          return false;
-        }
-        return true;
-      },
-      roleset(val) {
-        this.rolesettitle = '用户(' + val.Realname + ')-角色管理'
-        this.rolesetVisible = true
-        this.selecteduserid = val.Id + ''
-        this.selectedrole = []
-        let _this = this
-        // request
-        this.$axios.get('users/getuserrole/' + this.selecteduserid, {})
-          .then(res => {
-            _this.mustrolelist = []
-            // response
-            for (let i = 0; i < res.data.length; i++) {
-              if (_this.roleisexist(parseInt(res.data[i]))) {
-                _this.selectedrole.push(parseInt(res.data[i]))
-              }
-
-              let flag = false
-              let rdx = 0
-              for (rdx = 0; rdx < _this.rolelist.length; rdx++) {
-                if (parseInt(_this.rolelist[rdx].Id) == parseInt(res.data[i])) {
-                  flag = true;
-                  break;
-                }
-              }
-              if (!flag) {
-                _this.mustrolelist.push(parseInt(res.data[i]))
-              }
-
-            }
-
-            let checkedCount = this.selectedrole.length
-            this.roleCheckAll = checkedCount === this.rolelist.length
-            this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      rolesave() {
-        let _this = this
-        for (let mdx in this.mustrolelist) {
-          if (this.selectedrole.indexOf(this.mustrolelist[mdx]) == -1) {
-            this.selectedrole.push(parseInt(this.mustrolelist[mdx]))
-          }
-        }
-        let rolestring = this.selectedrole.join(',')
-        // request
-        this.$axios.put('users/setuserrole/' + this.selecteduserid + '_' + rolestring, {})
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              // 更新界面
-              this.list = []
-              this.initData()
-              this.rolesetVisible = false
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      handlecheckedrolechange() {
-        let checkedCount = this.selectedrole.length
-        this.roleCheckAll = checkedCount === this.rolelist.length
-        this.isrolecheckall = checkedCount > 0 && checkedCount < this.rolelist.length
-      },
-      handleCheckAllChange(val) {
-        this.selectedrole = val ? this.rolelistcheckall : []
-        this.isrolecheckall = false
-      },
-      roleisexist(val) {
-        for (let i = 0; i < this.rolelist.length; i++) {
-          if (this.rolelist[i].Id === val) {
-            return true
-          }
-        }
-        return false
-      },
-      // loadequipsall() {
-      //   // toggle loading
-      //   let _this = this
-      //   // request
-      //   this.$axios.get('equipment/alllist', null)
-      //     .then(res => {
-      //       // response
-      //       _this.equipalllist = res.data.items
-      //       _this.equipdeviceslist = res.data.items
-      //     })
-      //     .catch(err => {
-      //       // handle error
-      //       console.error(err)
-      //       this.loading = false
-      //     })
-      // },
-      seachdata() {
-        this.list = []
-        this.currentPage = 1
-        this.initData()
-      },
-      handleSizeChange(value) {
-        this.list = []
-        this.size = value
-        this.currentPage = 1
-        this.initData()
-      },
-      handleCurrentChange(value) {
-        this.currentPage = value
-        this.list = []
-        this.initData()
-      },
-      jstimehandle(val) {
-        val = val.replace('T', ' ')
-        return val.substring(0, 19)
-      },
-      opendatadialog(item, v, index) {
-        let _this = this
-        this.operatingitem = item
-        this.datadialogVisible = true
-        this.clearuserForm()
-        if (item === 1) {
-          this.dialogtitle = '新增用户'
-          this.disabledserial = false
-        } else if (item === 2) {
-          this.$axios.get('organizes/parentlist/' + v.Departmentid, {})
-            .then(res => {
-              if (res.data.code === 0) {
-                _this.dialogtitle = `编辑用户信息(${v.Realname})`
-                _this.disabledserial = true
-                _this.userform.username = v.Username
-                _this.userform.realname = v.Realname + ''
-                _this.userform.telephone = v.Telephone
-                _this.userform.mobile = v.Mobile
-                _this.userform.description = v.Description
-                _this.userform.role = v.Roleid + ''
-                _this.userform.id = v.Id
-                // 选中状态
-                _this.selectedorg = []
-                let pidarr = res.data.message.split(',')
-                for (var i = pidarr.length - 1; i >= 0; i--) {
-                  if (pidarr[i] !== '0') {
-                    _this.selectedorg.push(parseInt(pidarr[i]))
-                  }
-                }
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: '出现错误!'
-                })
-                this.datadialogVisible = false
-              }
-            })
-            .catch(err => {
-              // handle error
-              console.error(err)
-            })
-        }
-      },
-      savedata(formName) {
-        let _this = this
-        if (this.selectedorg.length === 0) {
-          _this.$message({
-            type: 'warning',
-            message: '请选择所属组织!'
-          })
-          return
-        }
-        this.$refs[formName].validate((valid) => {
-          if (valid) {
-            this.userform.departmentid = this.selectedorg[this.selectedorg.length - 1] + ''
-            if (_this.operatingitem === 1) {
-              _this.$axios.post('users', _this.userform)
-                .then(res => {
-                  // response
-                  if (res.data.code === 0) {
-                    _this.$message({
-                      type: 'success',
-                      message: res.data.message
-                    })
-                    this.list = []
-                    _this.datadialogVisible = false
-                    this.initData()
-                  } else {
-                    _this.$message({
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                  }
-                })
-                .catch(err => {
-                  // handle error
-                  console.error(err)
-                })
-            } else if (_this.operatingitem === 2) {
-              _this.$axios.put('users/' + _this.userform.id, _this.userform)
-                .then(res => {
-                  // response
-                  if (res.data.code === 0) {
-                    _this.$message({
-                      type: 'success',
-                      message: res.data.message
-                    })
-                    this.list = []
-                    _this.datadialogVisible = false
-                    // 更新界面
-                    this.initData()
-                  } else {
-                    _this.$message({
-                      type: 'warning',
-                      message: res.data.message
-                    })
-                  }
-                })
-                .catch(() => {})
-            }
-          } else {
-            return false
-          }
-        })
-      },
-      deletedata(val) {
-        let _this = this
-        _this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.delete('users/' + val.Id, null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.list = []
-                // 更新界面
-                this.initData()
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }).catch(() => {})
-      },
-      resetForm(formName) {
-        // this.$refs[formName].resetFields()
-      },
-      clearuserForm() {
-        this.userform = {
-          username: '',
-          realname: '',
-          telephone: '',
-          mobile: '',
-          description: ''
-        }
-      },
-      permission(v) {
-        let _this = this
-        _this.ischeckbj = true // 过滤字段勾选时触发的选中事件
-        this.userpermissdevicesselects = []
-        this.permissiondialogtitle = `用户权限设置(${v.Realname})`
-        this.permissiondatadialogVisible = true
-        this.userform.id = v.Id
-        this.$axios.get('users/permission/' + v.Id, null)
-          .then(res => {
-            // response
-            res.data.forEach((item, k) => {
-              this.userpermissdevicesselects.push(item)
-            })
-            _this.getorgbyeid(res.data + '')
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      getorgbyeid(v) {
-        let _this = this
-        this.$axios.put('equipment/getorgidsbyeqids', {
-            EquipmentIds: v
-          })
-          .then(res => {
-            // response
-            setTimeout(function () {
-              setTimeout(function () {
-                _this.ischeckbj = false
-              }, 300)
-              // 清空树选择框
-              _this.$refs.userpermisstree.setCheckedKeys(res.data)
-            }, 100)
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      savepermission() {
-        let _this = this
-        _this.$axios.put('users/permission/' + this.userform.id, {
-            channelids: this.userpermissdevicesselects + ''
-          })
-          .then(res => {
-            // response
-            if (res.data.code === 0) {
-              _this.$message({
-                type: 'success',
-                message: res.data.message
-              })
-              _this.permissiondatadialogVisible = false
-            } else {
-              _this.$message({
-                type: 'warning',
-                message: res.data.message
-              })
-            }
-          })
-          .catch(() => {})
-      },
-      resetpwd(val) {
-        let _this = this
-        _this.$confirm(`此操作将重置用户(${val.Realname})的密码为123456, 是否继续?`, '提示', {
-          confirmButtonText: '确定',
-          cancelButtonText: '取消',
-          type: 'warning'
-        }).then(() => {
-          _this.$axios.put('users/resetpwd/' + val.Id, null)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }).catch(() => {})
-      },
-      // 选择组织树时触发
-      userpermissorgcheckedchange(data, checked, indeterminate) {
-        let _this = this
-        if (!_this.ischeckbj) {
-          if (!_this.isfristchecked) {
-            _this.isfristchecked = true
-            setTimeout(function () {
-              _this.isfristchecked = false
-              _this.checkorgusermanage()
-            }, 100)
-          }
-        }
-      },
-      checkorgusermanage() {
-        let orgids = []
-        let selectnodes = this.$refs.userpermisstree.getCheckedNodes()
-        selectnodes.forEach(row => {
-          orgids.push(row.id)
-        })
-        const params = {
-          orgids: orgids
-        }
-        let _this = this
-        this.$axios.get('equipment/getidsbyoid', {
-            params
-          })
-          .then(res => {
-            // response
-            _this.userpermissdevicesselects = []
-            if (res.data) {
-              _this.equipdeviceslist = res.data
-              res.data.forEach(row => {
-                _this.userpermissdevicesselects.push(row.Id)
-              })
-            } else {
-              _this.equipdeviceslist = _this.equipalllist
-            }
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-            this.loading = false
-          })
-      },
-      getorgtreelist() {
-        let _this = this
-        // request
-        let params = {
-          IsInnerOrganize: 1
-        }
-        _this.$axios.get('organizes/list', {
-            params
-          })
-          .then(res => {
-            _this.orgtreelist = window.toolfun_gettreejson(res.data.items, 'Id', 'Parentid', 'Id,Fullname')
-          })
-          .catch(err => {
-            // handle error
-            console.error(err)
-          })
-      },
-      clearSearch() {
-        this.keyword = ''
-        this.list = []
-        this.initData()
-      }
-    }
-  }
-
-</script>
-
-<style lang="scss">
-  .el-pagination {
-    margin: 1rem 0 2rem;
-    text-align: right;
-  }
-
-  .triggerone {
-    font-size: 13px;
-    margin-left: 80px;
-  }
-
-  .plab {
-    font-size: 13px;
-    color: #999;
-  }
-
-  .userpermisstreediv {
-    border: 1px #CCCCCC solid;
-    overflow: auto;
-    height: 328px;
-    margin-right: 5px;
-  }
-
-  .userpermissdiv {
-    margin-left: 1px;
-    border: 1px #CCCCCC solid;
-    overflow: auto;
-    height: 320px;
-    padding: 4px;
-  }
-
-  .userpermissdiv .el-checkbox {
-    margin-top: 5px;
-    margin-left: 15px;
-  }
-
-  .usersignimg-uploader .el-upload {
-    border: 1px dashed #63b8ff;
-    cursor: pointer;
-    position: relative;
-    overflow: hidden;
-  }
-
-  .usersignimg-uploader .el-upload:hover {
-    border-color: #228b22;
-  }
-
-  .usersignimg-uploader-icon {
-    font-size: 28px;
-    color: #63b8ff;
-    width: 66px;
-    height: 66px;
-    line-height: 66px;
-    text-align: center;
-  }
-
-  .usersignimg-uploader-icon:hover {
-    color: #228b22;
-  }
-
-  .uploadusersignimg {
-    width: 66px;
-    height: 66px;
-    display: block;
-  }
-
-</style>

+ 0 - 200
src/dashoo.cn/frontend_web/src/pages/usersetting.vue

@@ -1,200 +0,0 @@
-<template>
-<div class="page">
-  <el-row>
-    <el-col :span="16">
-      <el-form ref="form" :model="form" :rules="rulesform" label-width="80px">
-        <el-row>
-          <el-col :span="12">
-            <el-form-item label="账号">
-              <el-input v-model="authUser.name" disabled></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="编码">
-              <el-input v-model="form.CompanyCode"></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-        <el-row>
-          <el-form-item required prop="Realname" label="名称">
-            <el-input v-model="form.Realname"></el-input>
-          </el-form-item>
-
-          <el-form-item label="单位地址">
-            <el-input v-model="form.Address"></el-input>
-          </el-form-item>
-
-          <el-col :span="12">
-            <el-form-item label="联系人">
-              <el-input v-model="form.Manager"></el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12">
-            <el-form-item label="手机">
-              <el-input v-model="form.Telephone"></el-input>
-            </el-form-item>
-          </el-col>
-          <el-col :span="12">
-            <el-form-item label="座机">
-              <el-input v-model="form.Mobile"></el-input>
-            </el-form-item>
-          </el-col>
-
-          <el-col :span="12">
-            <el-form-item label="Email">
-              <el-input v-model="form.Email"></el-input>
-            </el-form-item>
-          </el-col>
-        </el-row>
-
-        <el-form-item label="备注">
-          <el-input type="textarea" :rows="4" v-model="form.Description"></el-input>
-        </el-form-item>
-
-        <el-form-item>
-          <el-button type="primary" @click="savedata('form')">保存</el-button>
-        </el-form-item>
-      </el-form>
-    </el-col>
-    <el-col :span="2">&nbsp;</el-col>
-    <el-col :span="5">
-      <el-upload class="avatar-uploader" :action="'http://'+host+'/api/users/uploadphoto'" :show-file-list="false" :on-success="handleAvatarSuccess" :before-upload="beforeAvatarUpload">
-        <img v-if="imageUrl" :src="imageUrl" class="usersettingavatar">
-        <img v-else class="usersettingavatar" src="../assets/img/avatar-default.jpg">
-      </el-upload>
-      <div style="font-size:14px;color:#5D6A76;margin-left:55px;margin-bottom:20px;margin-top:10px;">上传头像</div>
-    </el-col>
-  </el-row>
-</div>
-</template>
-
-<script>
-import {
-  mapGetters
-} from 'vuex'
-export default {
-  name: 'usersetting',
-  data() {
-    return {
-      form: {
-        CompanyCode: '',
-        Realname: '',
-        Address: '',
-        Manager: '',
-        Telephone: '',
-        Mobile: '',
-        Email: '',
-        Description: '',
-        Photo: ''
-      },
-      host: '',
-      imageUrl: '',
-      rulesform: {
-        Realname: [{
-          required: true,
-          message: '请输入单位名称',
-          trigger: 'blur'
-        }]
-      }
-    }
-  },
-  computed: mapGetters({
-    authUser: 'authUser'
-  }),
-  created() {
-    // initial data
-    this.form.CompanyCode = this.authUser.Profile.CompanyCode
-    this.form.Realname = this.authUser.Profile.Realname
-    this.form.Address = this.authUser.Profile.Address
-    this.form.Manager = this.authUser.Profile.Manager
-    this.form.Telephone = this.authUser.Profile.Telephone
-    this.form.Mobile = this.authUser.Profile.Mobile
-    this.form.Email = this.authUser.Profile.Email
-    this.form.Description = this.authUser.Profile.Description
-    this.form.Photo = this.authUser.Profile.Photo
-    this.host = this.authUser.Profile.Host
-    if (this.form.Photo !== '') {
-      this.imageUrl = `http://${this.host}${this.form.Photo}`
-    }
-  },
-  methods: {
-    handleAvatarSuccess(res, file) {
-      this.form.Photo = res
-      this.imageUrl = URL.createObjectURL(file.raw)
-    },
-    beforeAvatarUpload(file) {
-      const isJPG = (file.type.indexOf('image/') === 0)
-      const isLt2M = file.size / 1024 / 1024 < 1
-      if (!isJPG) {
-        this.$message.error('上传头像图片只能是 图片 格式!')
-        return false
-      }
-      if (!isLt2M) {
-        this.$message.error('上传头像图片大小不能超过 1MB!')
-        return false
-      }
-      return true
-    },
-    savedata(formName) {
-      let _this = this
-      this.$refs[formName].validate((valid) => {
-        if (valid) {
-          this.$axios.put('users/membersetting', _this.form)
-            .then(res => {
-              // response
-              if (res.data.code === 0) {
-                _this.$message({
-                  type: 'success',
-                  message: res.data.message
-                })
-                this.$store.commit('SET_Profile', this.form)
-              } else {
-                _this.$message({
-                  type: 'warning',
-                  message: res.data.message
-                })
-              }
-            })
-            .catch(() => {})
-        }
-      })
-    }
-  }
-}
-</script>
-
-<style>
-.page {
-  margin: 50px;
-  padding: 20px 40px;
-  background-color: #fff;
-  box-shadow: 0 2px 6px rgba(100, 100, 100, 0.3);
-}
-.avatar-uploader .el-upload {
-  border: 1px dashed #d9d9d9;
-  border-radius: 6px;
-  cursor: pointer;
-  position: relative;
-  overflow: hidden;
-}
-
-.avatar-uploader .el-upload:hover {
-  border-color: #20a0ff;
-}
-
-.avatar-uploader-icon {
-  font-size: 28px;
-  color: #8c939d;
-  width: 178px;
-  height: 178px;
-  line-height: 178px;
-  text-align: center;
-}
-
-.usersettingavatar {
-  width: 178px;
-  height: 178px;
-  display: block;
-}
-</style>