Browse Source

平台后台用户重构

lyn7568 6 years ago
parent
commit
74d8d11d73

+ 4 - 2
config/prod.env.js

@ -4,6 +4,8 @@ module.exports = {
4 4
  ENV_CONFIG:'"prod"',
5 5
  PLAT_ID: '"F5DEA8EDB12E421A9FC4B701BB6176A6"',
6 6
  BASE_API: '""',
7
  XT_API: '"http://www.xttjpt.cn"',
8
  KX_API: '"https://www.ekexiu.com"'
7
  // XT_API: '"http://www.xttjpt.cn"',
8
  // KX_API: '"https://www.ekexiu.com"'
9
  XT_API: '"http://192.168.3.233:84"',
10
  KX_API: '"http://192.168.3.233:81"'
9 11
}

+ 10 - 42
src/components/CityPicker/index.vue

@ -27,19 +27,6 @@
27 27
          </el-option>
28 28
        </el-select>
29 29
      </el-col>
30
      <!-- <el-col :span="8">
31
        <el-select
32
          v-model="qu"
33
          @change="choseBlock"
34
          placeholder="区(县)">
35
          <el-option
36
            v-for="item in areaArr"
37
            :key="item.id"
38
            :label="item.value"
39
            :value="item.id">
40
          </el-option>
41
        </el-select>
42
      </el-col> -->
43 30
    </el-row>
44 31
  </div>
45 32
</template>
@ -49,15 +36,10 @@ export default {
49 36
  props: ['addrCode'],
50 37
  data() {
51 38
    return {
52
      firstFlag: false,
53 39
      provinceArr: [],
54 40
      cityArr: [],
55 41
      sheng: '',
56
      shi: '',
57
      // qu: '',
58
      // areaArr: [],
59
      city: '',
60
      block: ''
42
      shi: ''
61 43
    }
62 44
  },
63 45
  watch: {
@ -89,13 +71,14 @@ export default {
89 71
              if (!p.defaultChild) {
90 72
                p.defaultChild = p.children[item.code]
91 73
              }
92
            } else {
93
              var pp = that.provinceArr[item.code.slice(0, 2) + '0000'].children[item.code.slice(0, 4) + '00']
94
              pp.children[item.code] = { id: item.code, value: item.caption }
95
              if (!pp.defaultChild) {
96
                pp.defaultChild = pp.children[item.code]
97
              }
98 74
            }
75
            //  else {
76
            //   var pp = that.provinceArr[item.code.slice(0, 2) + '0000'].children[item.code.slice(0, 4) + '00']
77
            //   pp.children[item.code] = { id: item.code, value: item.caption }
78
            //   if (!pp.defaultChild) {
79
            //     pp.defaultChild = pp.children[item.code]
80
            //   }
81
            // }
99 82
          })
100 83
        } else {
101 84
          console.log(dictData.status)
@ -105,46 +88,31 @@ export default {
105 88
    choseProvince: function(e) {
106 89
      var p = this.provinceArr[e]
107 90
      this.cityArr = p.children
91
      this.sheng = p.value
108 92
      this.shi = p.defaultChild.value
109
      // this.areaArr = p.defaultChild.children
110
      // this.qu = p.defaultChild.defaultChild.value
111 93
      this.E = p.defaultChild.id
112
      this.sheng = p.value
113 94
      this.$emit('paren', this.E)
114 95
      this.$emit('parenStr', this.shi)
115 96
    },
116 97
    choseCity: function(e) {
117 98
      var p = this.provinceArr[e.slice(0, 2) + '0000'].children[e]
118
      this.shi = p.value
119
      // this.areaArr = p.children
120
      // this.qu = p.defaultChild.value
121 99
      this.E = p.id
100
      this.shi = p.value
122 101
      this.$emit('paren', this.E)
123 102
      this.$emit('parenStr', this.shi)
124 103
    },
125
    // choseBlock: function(e) {
126
    //   this.qu = this.provinceArr[e.slice(0, 2) + '0000'].children[e.slice(0, 4) + '00'].children[e].value
127
    //   this.E = e
128
    //   this.$emit('paren', this.E)
129
    // },
130 104
    initpsq: function() {
131 105
      if (!this.addrCode) {
132 106
        this.sheng = ''
133 107
        this.shi = ''
134
        // this.qu = ''
135 108
        return
136 109
      }
137 110
      const s = this.addrCode.substring(0, 2) + '0000'
138 111
      const si = this.addrCode.substring(0, 4) + '00'
139
      // const x = this.addrCode
140 112
      var p = this.provinceArr[s]
141 113
      this.sheng = p.value
142 114
      this.shi = p.children[si].value
143
      // this.qu = p.children[si].children[x].value
144 115
    }
145 116
  }
146 117
}
147 118
</script>
148
<style rel="stylesheet/scss" lang="scss" scoped>
149
150
</style>

+ 21 - 5
src/router/index.js

@ -86,10 +86,26 @@ export const asyncRouterMap = [
86 86
      meta: { title: '系统设置' },
87 87
      children: [
88 88
        {
89
          path: 'adminUser',
90
          component: () => import('@/views/sysSetting/adminUser'),
91
          name: 'adminUser',
92
          meta: { title: '平台后台用户管理列表' }
89
          path: 'platUser',
90
          component: () => import('@/views/sysSetting/platUser/index'),
91
          name: 'platUser',
92
          redirect: { name: 'normalList' },
93
          alwaysShow: true,
94
          meta: { title: '后台用户' },
95
          children: [
96
            {
97
              path: 'normalList',
98
              component: () => import('@/views/sysSetting/platUser/normal'),
99
              name: 'normalList',
100
              meta: { title: '正常账号' }
101
            },
102
            {
103
              path: 'forbiddenList',
104
              component: () => import('@/views/sysSetting/platUser/forbidden'),
105
              name: 'forbiddenList',
106
              meta: { title: '停用账号' }
107
            }
108
          ]
93 109
        }
94 110
      ]
95 111
    },
@ -162,6 +178,7 @@ export const asyncRouterMap = [
162 178
      children: [
163 179
        {
164 180
          path: 'expertslist',
181
          name: 'expertslist',
165 182
          component: () => import('@/views/specialExperts/index'),
166 183
          meta: { title: '特约专家列表' }
167 184
        }
@ -256,7 +273,6 @@ export const asyncRouterMap = [
256 273
      component: Layout,
257 274
      name: 'userinfo',
258 275
      redirect: 'noredirect',
259
      alwaysShow: true,
260 276
      meta: { title: '用户信息' },
261 277
      children: [
262 278
        {

+ 2 - 2
src/styles/sidebar.scss

@ -47,10 +47,10 @@
47 47
    height: 100%;
48 48
    position: fixed;
49 49
    font-size: 0px;
50
    top: 50px;
50
    top: 0;
51
    padding-top:50px;
51 52
    bottom: 0;
52 53
    left: 0;
53
    padding-bottom: 50px;
54 54
    z-index: 1001;
55 55
    overflow: hidden;
56 56
    background-color: $menuBg;

+ 1 - 2
src/views/companyCen/noactive/compProduct.vue

@ -100,8 +100,7 @@ export default {
100 100
        {
101 101
          prop: 'name',
102 102
          tit: '产品名称',
103
          link: true,
104
          width: '200'
103
          link: true
105 104
        },
106 105
        {
107 106
          prop: 'spec',

+ 1 - 1
src/views/demandCen/preview.vue

@ -25,7 +25,7 @@
25 25
          <el-col :span="12">
26 26
            <el-form-item label="需求方名称" prop="linkOrg">
27 27
              <span v-if="readonlyShow">{{ruleFormDem.linkOrg}}</span>
28
              <el-input v-else v-model="ruleFormDem.linkOrg" placeholder="建议填写您的企业名称" maxlength="50"></el-input>
28
              <el-input v-else v-model="ruleFormDem.linkOrg" placeholder="请填写需求方企业名称" maxlength="50"></el-input>
29 29
            </el-form-item>
30 30
          </el-col>
31 31
          <el-col :span="12">

+ 5 - 5
src/views/layout/components/Sidebar/SidebarItem.vue

@ -15,13 +15,13 @@
15 15
        </template>
16 16
17 17
        <template v-for="child in item.children" v-if="!child.hidden">
18
          <div v-if="child.children&&child.children.length>0">
18
          <!-- <div v-if="child.children&&child.children.length>0">
19 19
            <sidebar-item v-if="!child.parentPath" :is-nest="true" class="nest-menu" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
20 20
21
            <router-link v-else :to="resolvePath(child.path)">
22
              <sidebar-item :is-nest="true" class="nest-menu" :item="child" :key="child.path" :base-path="resolvePath(child.path)" ></sidebar-item>
23
            </router-link>
24
          </div>
21
            <router-link v-else :to="resolvePath(child.path)"> -->
22
          <sidebar-item :is-nest="true" class="nest-menu" v-if="child.children&&child.children.length>0" :item="child" :key="child.path" :base-path="resolvePath(child.path)" ></sidebar-item>
23
            <!-- </router-link>
24
          </div> -->
25 25
26 26
          <router-link v-else :to="resolvePath(child.path)" :key="child.name" replace>
27 27
            <el-menu-item :index="resolvePath(child.path)">

+ 1 - 2
src/views/sysSetting/editUser.vue

@ -19,7 +19,7 @@
19 19
          <el-form-item v-if="!readonlyShow && !item.right" :label="item.tit" :prop="item.prop">
20 20
            <el-input v-model="userForm[item.prop]" :placeholder="`请填写${item.tit}`" :maxlength="item.num||''"></el-input>
21 21
          </el-form-item>
22
          <el-form-item v-if="item.right" :prop="item.prop" label-width="0">
22
          <el-form-item v-if="operateM.type==='right' && item.right" :prop="item.prop" label-width="0">
23 23
            <template>
24 24
              <el-card shadow="never">
25 25
                <div class="card-title" slot="header">
@ -36,7 +36,6 @@
36 36
            </template>
37 37
          </el-form-item>
38 38
        </el-col>
39
        <el-col :span="24"><div class="form-line"></div></el-col>
40 39
        <el-col :span="24" class="el-btn-col">
41 40
          <div class="el-btn-col-box">
42 41
            <el-button type="primary" @click="submitForm('userForm')">保存</el-button>

+ 162 - 0
src/views/sysSetting/platUser/forbidden.vue

@ -0,0 +1,162 @@
1
<template>
2
  <div class="app-container">
3
    <div class="box-container">
4
      <div class="contain-title">停用账号列表</div>
5
    </div>
6
    <div class="content-container">
7
      <el-table
8
        :data="tableData"
9
        height="630"
10
        v-loading="tableLoading"
11
        border>
12
        <el-table-column
13
          v-for="item in tableItem"
14
          :key="item.index"
15
          :prop="item.prop ? item.prop : ''"
16
          :label="item.tit ? item.tit : ''"
17
          :width="item.width ? item.width : ''"
18
          align="center">
19
          <template slot-scope="scope">
20
            <div v-if="scope.row[item.prop]">
21
              <div v-if="scope.row[item.prop]">{{scope.row[item.prop]}}</div>
22
            </div>
23
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
24
              <el-button
25
                size="medium"
26
                type="primary"
27
                @click="handleRenew(scope.row.id)">恢复</el-button>
28
            </div>
29
          </template>
30
        </el-table-column>
31
      </el-table>
32
      <div class="pagination-container">
33
        <el-pagination
34
          background
35
          @current-change="handleCurrentChange"
36
          :current-page.sync="pageNo"
37
          :page-size="pageSize"
38
          layout="prev, pager, next, jumper"
39
          :total="total">
40
        </el-pagination>
41
      </div>
42
    </div>
43
  </div>
44
</template>
45
46
<script>
47
  import { parseTime } from '@/utils'
48
  import comTable from '@/utils/comTable'
49
  import {
50
    pageQueryUser,
51
    renewUser
52
  } from '@/api/sysSetting'
53
54
  export default {
55
    data() {
56
      return {
57
        searchText: '',
58
        operateM: {},
59
        pageSize: 10,
60
        pageNo: 1,
61
        total: 0,
62
        tableData: [],
63
        tableLoading: true,
64
        tableItem: [
65
          {
66
            prop: 'account',
67
            tit: '账号',
68
            link: true
69
          },
70
          {
71
            prop: 'name',
72
            tit: '用户名'
73
          },
74
          {
75
            prop: 'job',
76
            tit: '职位'
77
          },
78
          {
79
            prop: 'comp',
80
            tit: '所在部门'
81
          },
82
          {
83
            prop: 'dep',
84
            tit: '所在机构'
85
          },
86
          {
87
            prop: 'phone',
88
            tit: '联系电话',
89
            width: '160'
90
          },
91
          {
92
            prop: 'email',
93
            tit: '联系邮箱',
94
            width: '160'
95
          },
96
          {
97
            prop: 'createTime',
98
            tit: '创建时间',
99
            width: '160'
100
          },
101
          {
102
            prop: 'invalidTime',
103
            tit: '停用时间',
104
            width: '160'
105
          },
106
          {
107
            operate: true,
108
            width: '160'
109
          }
110
        ]
111
      }
112
    },
113
    created() {
114
      this.pageQueryUser()
115
    },
116
    methods: {
117
      pageQueryUser() {
118
        var that = this
119
        that.$http.get(pageQueryUser, {
120
          actived: 0,
121
          pageSize: that.pageSize,
122
          pageNo: that.pageNo
123
        }, function(res) {
124
          that.tableLoading = false
125
          if (res.success && res.data) {
126
            const obj = res.data.data
127
            if (obj.length) {
128
              for (let i = 0; i < obj.length; ++i) {
129
                if (obj[i].createTime) {
130
                  obj[i].createTime = parseTime(obj[i].createTime)
131
                }
132
                if (obj[i].invalidTime) {
133
                  obj[i].invalidTime = parseTime(obj[i].invalidTime)
134
                }
135
              }
136
            }
137
            that.total = res.data.total
138
            that.tableData = obj
139
            comTable.gapFilling(that.tableData)
140
          } else {
141
            that.total = 0
142
            that.tableData = []
143
          }
144
        })
145
      },
146
      handleCurrentChange(val) {
147
        this.pageNo = val
148
        this.pageQueryUser()
149
      },
150
      handleRenew(id) {
151
        var that = this
152
        this.$http.get(renewUser, {
153
          id: id
154
        }, function(res) {
155
          if (res.success) {
156
            that.pageQueryUser()
157
          }
158
        })
159
      }
160
    }
161
  }
162
</script>

+ 6 - 0
src/views/sysSetting/platUser/index.vue

@ -0,0 +1,6 @@
1
<template>
2
  <div>
3
    <router-view></router-view>
4
  </div>
5
</template>
6

+ 19 - 73
src/views/sysSetting/adminUser.vue

@ -1,21 +1,12 @@
1 1
<template>
2 2
  <div class="app-container">
3 3
    <div class="box-container">
4
      <div class="contain-title">平台后台用户管理列表</div>
4
      <div class="contain-title">正常账号列表</div>
5 5
      <div class="contian-operate">
6 6
        <el-button type="primary" @click="handleAdd">添加</el-button>
7 7
      </div>
8 8
    </div>
9 9
    <div class="content-container">
10
      <div class="contain-select">
11
        <span>用户分类:</span>
12
        <el-select
13
          v-model="selectMode"
14
          @change="selectChange">
15
          <el-option label="正常账号" value="1" selected></el-option>
16
          <el-option label="停用账号" value="0"></el-option>
17
        </el-select>
18
      </div>
19 10
      <el-table
20 11
        :data="tableData"
21 12
        height="630"
@ -37,30 +28,22 @@
37 28
              </div>
38 29
            </div>
39 30
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
40
              <div class="normal" v-if="scope.row.actived">
41
                <el-button
42
                  size="medium"
43
                  type="primary"
44
                  @click="handleEdit(scope.row.id)">修改</el-button>
45
                <el-button
46
                  size="medium"
47
                  type="primary"
48
                  @click="handleResetpw(scope.row)">重置密码</el-button>
49
                <el-button
50
                  size="medium"
51
                  type="danger"
52
                  @click="handleBan(scope.row.id)">停用</el-button>
53
                <el-button
54
                  size="medium"
55
                  type="primary"
56
                  @click="handleRight(scope.row.id)">分配权限</el-button>
57
              </div>
58
              <div class="forbidden" v-else>
59
                <el-button
60
                  size="medium"
61
                  type="primary"
62
                  @click="handleRenew(scope.row.id)">恢复</el-button>
63
              </div>
31
              <el-button
32
                size="medium"
33
                type="primary"
34
                @click="handleEdit(scope.row.id)">修改</el-button>
35
              <el-button
36
                size="medium"
37
                type="primary"
38
                @click="handleResetpw(scope.row)">重置密码</el-button>
39
              <el-button
40
                size="medium"
41
                type="danger"
42
                @click="handleBan(scope.row.id)">停用</el-button>
43
              <el-button
44
                size="medium"
45
                type="primary"
46
                @click="handleRight(scope.row.id)">分配权限</el-button>
64 47
            </div>
65 48
          </template>
66 49
        </el-table-column>
@ -86,8 +69,7 @@
86 69
  import {
87 70
    pageQueryUser,
88 71
    resetPw,
89
    banUser,
90
    renewUser
72
    banUser
91 73
  } from '@/api/sysSetting'
92 74
93 75
  import editUser from './editUser'
@ -95,7 +77,6 @@
95 77
    data() {
96 78
      return {
97 79
        searchText: '',
98
        selectMode: '1',
99 80
        operateM: {},
100 81
        pageSize: 10,
101 82
        pageNo: 1,
@ -156,7 +137,7 @@
156 137
      pageQueryUser() {
157 138
        var that = this
158 139
        that.$http.get(pageQueryUser, {
159
          actived: parseInt(that.selectMode),
140
          actived: 1,
160 141
          pageSize: that.pageSize,
161 142
          pageNo: that.pageNo
162 143
        }, function(res) {
@ -186,33 +167,8 @@
186 167
        this.pageNo = val
187 168
        this.pageQueryUser()
188 169
      },
189
      selectChange(val) {
190
        this.searchText = ''
191
        this.selectMode = val
192
        this.pageNo = 1
193
        this.total = 0
194
        this.tableData = []
195
        this.addBanTimeColumn(val)
196
        this.pageQueryUser()
197
      },
198
      addBanTimeColumn(val) {
199
        var lastcol = this.tableItem.pop()
200
        if (val === '0') {
201
          var bancol = {
202
            prop: 'invalidTime',
203
            tit: '停用时间',
204
            width: '160'
205
          }
206
          this.tableItem.push(bancol)
207
          this.tableItem.push(lastcol)
208
        } else {
209
          this.tableItem.pop()
210
          this.tableItem.push(lastcol)
211
        }
212
      },
213 170
      dialogChanged() {
214 171
        this.searchText = ''
215
        this.selectMode = '1'
216 172
        this.pageNo = 1
217 173
        this.total = 0
218 174
        this.tableData = []
@ -266,16 +222,6 @@
266 222
            that.pageQueryUser()
267 223
          }
268 224
        })
269
      },
270
      handleRenew(id) {
271
        var that = this
272
        this.$http.get(renewUser, {
273
          id: id
274
        }, function(res) {
275
          if (res.success) {
276
            that.pageQueryUser()
277
          }
278
        })
279 225
      }
280 226
    }
281 227
  }

+ 1 - 1
src/views/userInfo/pullBlack.vue

@ -46,7 +46,7 @@
46 46
<script>
47 47
  import { blackUser, queryBlackOne } from '@/api/userInfo'
48 48
  import queryBase from '@/utils/queryBase'
49
  import { parseTime } from '@/utils'
49
  import { parseTime } from '@/utils/index'
50 50
51 51
  export default {
52 52
    data() {

+ 9 - 4
src/views/userInfo/usingList.vue

@ -53,10 +53,8 @@
53 53
</template>
54 54
55 55
<script>
56
import {
57
  pageNormalUser
58
} from '@/api/userInfo'
59
import { parseTime } from '@/utils'
56
import { pageNormalUser } from '@/api/userInfo'
57
import { parseTime } from '@/utils/index'
60 58
import comTable from '@/utils/comTable'
61 59
62 60
import baseInfo from './baseInfo'
@ -116,6 +114,13 @@ export default {
116 114
      ]
117 115
    }
118 116
  },
117
  watch: {
118
    '$route'(to, from) {
119
      console.log(111)
120
      console.log(to)
121
      console.log(from)
122
    }
123
  },
119 124
  components: {
120 125
    baseInfo,
121 126
    pullBlack