Browse Source

平台后台用户重构

lyn7568 6 years ago
parent
commit
74d8d11d73

+ 4 - 2
config/prod.env.js

4
  ENV_CONFIG:'"prod"',
4
  ENV_CONFIG:'"prod"',
5
  PLAT_ID: '"F5DEA8EDB12E421A9FC4B701BB6176A6"',
5
  PLAT_ID: '"F5DEA8EDB12E421A9FC4B701BB6176A6"',
6
  BASE_API: '""',
6
  BASE_API: '""',
7
  XT_API: '"http://www.xttjpt.cn"',
7
  // XT_API: '"http://www.xttjpt.cn"',
8
  KX_API: '"https://www.ekexiu.com"'
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
          </el-option>
27
          </el-option>
28
        </el-select>
28
        </el-select>
29
      </el-col>
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
    </el-row>
30
    </el-row>
44
  </div>
31
  </div>
45
</template>
32
</template>
49
  props: ['addrCode'],
36
  props: ['addrCode'],
50
  data() {
37
  data() {
51
    return {
38
    return {
52
      firstFlag: false,
53
      provinceArr: [],
39
      provinceArr: [],
54
      cityArr: [],
40
      cityArr: [],
55
      sheng: '',
41
      sheng: '',
56
      shi: '',
42
      shi: ''
57
      // qu: '',
58
      // areaArr: [],
59
      city: '',
60
      block: ''
61
    }
43
    }
62
  },
44
  },
63
  watch: {
45
  watch: {
89
              if (!p.defaultChild) {
71
              if (!p.defaultChild) {
90
                p.defaultChild = p.children[item.code]
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
        } else {
83
        } else {
101
          console.log(dictData.status)
84
          console.log(dictData.status)
105
    choseProvince: function(e) {
88
    choseProvince: function(e) {
106
      var p = this.provinceArr[e]
89
      var p = this.provinceArr[e]
107
      this.cityArr = p.children
90
      this.cityArr = p.children
91
      this.sheng = p.value
108
      this.shi = p.defaultChild.value
92
      this.shi = p.defaultChild.value
109
      // this.areaArr = p.defaultChild.children
110
      // this.qu = p.defaultChild.defaultChild.value
111
      this.E = p.defaultChild.id
93
      this.E = p.defaultChild.id
112
      this.sheng = p.value
113
      this.$emit('paren', this.E)
94
      this.$emit('paren', this.E)
114
      this.$emit('parenStr', this.shi)
95
      this.$emit('parenStr', this.shi)
115
    },
96
    },
116
    choseCity: function(e) {
97
    choseCity: function(e) {
117
      var p = this.provinceArr[e.slice(0, 2) + '0000'].children[e]
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
      this.E = p.id
99
      this.E = p.id
100
      this.shi = p.value
122
      this.$emit('paren', this.E)
101
      this.$emit('paren', this.E)
123
      this.$emit('parenStr', this.shi)
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
    initpsq: function() {
104
    initpsq: function() {
131
      if (!this.addrCode) {
105
      if (!this.addrCode) {
132
        this.sheng = ''
106
        this.sheng = ''
133
        this.shi = ''
107
        this.shi = ''
134
        // this.qu = ''
135
        return
108
        return
136
      }
109
      }
137
      const s = this.addrCode.substring(0, 2) + '0000'
110
      const s = this.addrCode.substring(0, 2) + '0000'
138
      const si = this.addrCode.substring(0, 4) + '00'
111
      const si = this.addrCode.substring(0, 4) + '00'
139
      // const x = this.addrCode
140
      var p = this.provinceArr[s]
112
      var p = this.provinceArr[s]
141
      this.sheng = p.value
113
      this.sheng = p.value
142
      this.shi = p.children[si].value
114
      this.shi = p.children[si].value
143
      // this.qu = p.children[si].children[x].value
144
    }
115
    }
145
  }
116
  }
146
}
117
}
147
</script>
118
</script>
148
<style rel="stylesheet/scss" lang="scss" scoped>
149
150
</style>

+ 21 - 5
src/router/index.js

86
      meta: { title: '系统设置' },
86
      meta: { title: '系统设置' },
87
      children: [
87
      children: [
88
        {
88
        {
89
          path: 'adminUser',
89
          path: 'platUser',
90
          component: () => import('@/views/sysSetting/adminUser'),
90
          component: () => import('@/views/sysSetting/platUser/index'),
91
          name: 'adminUser',
91
          name: 'platUser',
92
          meta: { title: '平台后台用户管理列表' }
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
      children: [
178
      children: [
163
        {
179
        {
164
          path: 'expertslist',
180
          path: 'expertslist',
181
          name: 'expertslist',
165
          component: () => import('@/views/specialExperts/index'),
182
          component: () => import('@/views/specialExperts/index'),
166
          meta: { title: '特约专家列表' }
183
          meta: { title: '特约专家列表' }
167
        }
184
        }
256
      component: Layout,
273
      component: Layout,
257
      name: 'userinfo',
274
      name: 'userinfo',
258
      redirect: 'noredirect',
275
      redirect: 'noredirect',
259
      alwaysShow: true,
260
      meta: { title: '用户信息' },
276
      meta: { title: '用户信息' },
261
      children: [
277
      children: [
262
        {
278
        {

+ 2 - 2
src/styles/sidebar.scss

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

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

100
        {
100
        {
101
          prop: 'name',
101
          prop: 'name',
102
          tit: '产品名称',
102
          tit: '产品名称',
103
          link: true,
103
          link: true
104
          width: '200'
105
        },
104
        },
106
        {
105
        {
107
          prop: 'spec',
106
          prop: 'spec',

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

25
          <el-col :span="12">
25
          <el-col :span="12">
26
            <el-form-item label="需求方名称" prop="linkOrg">
26
            <el-form-item label="需求方名称" prop="linkOrg">
27
              <span v-if="readonlyShow">{{ruleFormDem.linkOrg}}</span>
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
            </el-form-item>
29
            </el-form-item>
30
          </el-col>
30
          </el-col>
31
          <el-col :span="12">
31
          <el-col :span="12">

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

15
        </template>
15
        </template>
16
16
17
        <template v-for="child in item.children" v-if="!child.hidden">
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
            <sidebar-item v-if="!child.parentPath" :is-nest="true" class="nest-menu" :item="child" :key="child.path" :base-path="resolvePath(child.path)"></sidebar-item>
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)">
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>
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>
23
            <!-- </router-link>
24
          </div>
24
          </div> -->
25
25
26
          <router-link v-else :to="resolvePath(child.path)" :key="child.name" replace>
26
          <router-link v-else :to="resolvePath(child.path)" :key="child.name" replace>
27
            <el-menu-item :index="resolvePath(child.path)">
27
            <el-menu-item :index="resolvePath(child.path)">

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

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

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

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

1
<template>
2
  <div>
3
    <router-view></router-view>
4
  </div>
5
</template>
6

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

1
<template>
1
<template>
2
  <div class="app-container">
2
  <div class="app-container">
3
    <div class="box-container">
3
    <div class="box-container">
4
      <div class="contain-title">平台后台用户管理列表</div>
4
      <div class="contain-title">正常账号列表</div>
5
      <div class="contian-operate">
5
      <div class="contian-operate">
6
        <el-button type="primary" @click="handleAdd">添加</el-button>
6
        <el-button type="primary" @click="handleAdd">添加</el-button>
7
      </div>
7
      </div>
8
    </div>
8
    </div>
9
    <div class="content-container">
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
      <el-table
10
      <el-table
20
        :data="tableData"
11
        :data="tableData"
21
        height="630"
12
        height="630"
37
              </div>
28
              </div>
38
            </div>
29
            </div>
39
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
30
            <div class="operate-row" v-if="item.operate && typeof scope.row === 'object'">
40
              <div class="normal" v-if="scope.row.actived">
31
              <el-button
41
                <el-button
32
                size="medium"
42
                  size="medium"
33
                type="primary"
43
                  type="primary"
34
                @click="handleEdit(scope.row.id)">修改</el-button>
44
                  @click="handleEdit(scope.row.id)">修改</el-button>
35
              <el-button
45
                <el-button
36
                size="medium"
46
                  size="medium"
37
                type="primary"
47
                  type="primary"
38
                @click="handleResetpw(scope.row)">重置密码</el-button>
48
                  @click="handleResetpw(scope.row)">重置密码</el-button>
39
              <el-button
49
                <el-button
40
                size="medium"
50
                  size="medium"
41
                type="danger"
51
                  type="danger"
42
                @click="handleBan(scope.row.id)">停用</el-button>
52
                  @click="handleBan(scope.row.id)">停用</el-button>
43
              <el-button
53
                <el-button
44
                size="medium"
54
                  size="medium"
45
                type="primary"
55
                  type="primary"
46
                @click="handleRight(scope.row.id)">分配权限</el-button>
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>
64
            </div>
47
            </div>
65
          </template>
48
          </template>
66
        </el-table-column>
49
        </el-table-column>
86
  import {
69
  import {
87
    pageQueryUser,
70
    pageQueryUser,
88
    resetPw,
71
    resetPw,
89
    banUser,
72
    banUser
90
    renewUser
91
  } from '@/api/sysSetting'
73
  } from '@/api/sysSetting'
92
74
93
  import editUser from './editUser'
75
  import editUser from './editUser'
95
    data() {
77
    data() {
96
      return {
78
      return {
97
        searchText: '',
79
        searchText: '',
98
        selectMode: '1',
99
        operateM: {},
80
        operateM: {},
100
        pageSize: 10,
81
        pageSize: 10,
101
        pageNo: 1,
82
        pageNo: 1,
156
      pageQueryUser() {
137
      pageQueryUser() {
157
        var that = this
138
        var that = this
158
        that.$http.get(pageQueryUser, {
139
        that.$http.get(pageQueryUser, {
159
          actived: parseInt(that.selectMode),
140
          actived: 1,
160
          pageSize: that.pageSize,
141
          pageSize: that.pageSize,
161
          pageNo: that.pageNo
142
          pageNo: that.pageNo
162
        }, function(res) {
143
        }, function(res) {
186
        this.pageNo = val
167
        this.pageNo = val
187
        this.pageQueryUser()
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
      dialogChanged() {
170
      dialogChanged() {
214
        this.searchText = ''
171
        this.searchText = ''
215
        this.selectMode = '1'
216
        this.pageNo = 1
172
        this.pageNo = 1
217
        this.total = 0
173
        this.total = 0
218
        this.tableData = []
174
        this.tableData = []
266
            that.pageQueryUser()
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
<script>
46
<script>
47
  import { blackUser, queryBlackOne } from '@/api/userInfo'
47
  import { blackUser, queryBlackOne } from '@/api/userInfo'
48
  import queryBase from '@/utils/queryBase'
48
  import queryBase from '@/utils/queryBase'
49
  import { parseTime } from '@/utils'
49
  import { parseTime } from '@/utils/index'
50
50
51
  export default {
51
  export default {
52
    data() {
52
    data() {

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

53
</template>
53
</template>
54
54
55
<script>
55
<script>
56
import {
56
import { pageNormalUser } from '@/api/userInfo'
57
  pageNormalUser
57
import { parseTime } from '@/utils/index'
58
} from '@/api/userInfo'
59
import { parseTime } from '@/utils'
60
import comTable from '@/utils/comTable'
58
import comTable from '@/utils/comTable'
61
59
62
import baseInfo from './baseInfo'
60
import baseInfo from './baseInfo'
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
  components: {
124
  components: {
120
    baseInfo,
125
    baseInfo,
121
    pullBlack
126
    pullBlack