Compare commits

...

6 Commits

  1. 5
      .env.development
  2. 3
      .env.production
  3. 3
      .env.test
  4. 12
      src/api/role.js
  5. 16
      src/views/bggl/banjie_list.vue
  6. 15
      src/views/user/components/data-permission.vue
  7. 144
      src/views/user/user.vue

5
.env.development

@ -25,4 +25,7 @@ VUE_APP_SJ_API = 'http://${VUE_APP_SJ_BASE_IP_ADDRESS}:9092/SJSE/'
VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/'
# websocket连接地址
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/'
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/'
# 图片链接地址
VUE_APP_IMG_URL = '${VUE_APP_PREVIEW_API}${VUE_APP_PROJECT_NAME}/upload/image/'

3
.env.production

@ -23,3 +23,6 @@ VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/'
# websocket连接地址
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/'
# 图片链接地址
VUE_APP_IMG_URL = '${VUE_APP_PREVIEW_API}${VUE_APP_PROJECT_NAME}/upload/image/'

3
.env.test

@ -23,3 +23,6 @@ VUE_APP_PREVIEW_API = '${VUE_APP_SERVER_API}/sdma-preview/'
# websocket连接地址
VUE_APP_WEBSOCKET = 'ws://${VUE_APP_SERVER_ADDRESS}/sdma-websocket/websocket/'
# 图片链接地址
VUE_APP_IMG_URL = '${VUE_APP_PREVIEW_API}${VUE_APP_PROJECT_NAME}/upload/image/'

12
src/api/role.js

@ -16,6 +16,7 @@ export function edit(data) {
data
})
}
export function del(params) {
return api({
url: '/role',
@ -49,4 +50,15 @@ export function getAllRole() {
})
}
export function updateDataScope(data) {
return api({
url: '/role/updateDataScope',
method: 'put',
data,
paramsSerializer: function(data) {
return qs.stringify(data, { indices: false })
}
})
}
export default { add, edit, del, getList }

16
src/views/bggl/banjie_list.vue

@ -291,21 +291,21 @@
<el-input v-model="listQueryExport.searchYsjl.guigexinghao" placeholder="锅炉型号" clearable style="width: 220px;" @keyup.enter.native="handleFilterExportReport" />
</el-form-item>
<br>
<el-form-item label="出厂开始日期" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.chuchangkaishiriqi" type="date" placeholder="出厂开始日期" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
<el-form-item label="制造日期开始" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.zhizaoriqikaishi" type="date" placeholder="制造日期开始" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
</el-form-item>
<el-form-item label="出厂结束日期" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.chuchangjieshuriqi" type="date" placeholder="出厂结束日期" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
<el-form-item label="制造日期结束" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.zhizaoriqijieshu" type="date" placeholder="制造日期结束" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
</el-form-item>
<el-form-item label="容器名称" style="width: 290px;">
<el-input v-model="listQueryExport.searchYsjl.shebeimingcheng" placeholder="容器名称" clearable style="width: 220px;" @keyup.enter.native="handleFilterExportReport" />
</el-form-item>
<br>
<el-form-item label="检开始日期" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.jianjiankaishiriqi" type="date" placeholder="检开始日期" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
<el-form-item label="检开始日期" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.jianyankaishiriqi" type="date" placeholder="检开始日期" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
</el-form-item>
<el-form-item label="检结束日期" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.jianjianjieshuriqi" type="date" placeholder="检结束日期" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
<el-form-item label="检结束日期" style="width: 290px;">
<el-date-picker v-model="listQueryExport.searchYsjl.jianyanjieshuriqi" type="date" placeholder="检结束日期" value-format="yyyy-MM-dd" clearable style="width: 190px;" @keyup.enter.native="handleFilterExportReport" />
</el-form-item>
<el-form-item label="设备类别" style="width: 290px;">
<el-input v-model="listQueryExport.searchYsjl.shebeileibie" placeholder="设备类别" clearable style="width: 220px;" @keyup.enter.native="handleFilterExportReport" />

15
src/views/user/components/data-permission.vue

@ -58,7 +58,7 @@
</template>
<script>
import CrudRole from '@/api/role'
import { updateDataScope } from '@/api/role'
import { getAll } from '@/api/data_scope_department'
export default {
@ -149,11 +149,14 @@ export default {
}
},
update() {
console.log(this.checkedIds)
console.log(Array.from(this.checkedIds))
this.permission.dataScopeDepartmentIds = Array.from(this.checkedIds)
console.log(this.permission)
CrudRole.edit(this.permission).then(() => this.$notify.success('操作成功'))
updateDataScope({
roleId: this.permission.id,
dataScope: this.permission.dataScope,
departmentIds: Array.from(this.checkedIds)
}).then(() => {
this.$notify.success('操作成功')
this.close()
})
},
handleCheckAllChange(val, checked) {
if (checked) {

144
src/views/user/user.vue

@ -29,7 +29,7 @@
v-if="hasPerm('user:add')"
type="primary"
icon="el-icon-edit"
@click="showCreate"
@click="crud.toAdd"
>
添加
</el-button>
@ -61,8 +61,8 @@
<CustomTable ref="customTable" :col-configs="colConfigs" :columns="columns" :crud="crud">
<el-table-column slot="operation" align="center" width="100" label="操作">
<template slot-scope="scope">
<Edit :data="scope.row" :disabled-edit="false" />
<Delete :data="scope.row" style="margin-left: 5px" />
<Edit :permission="permission" :data="scope.row" :disabled-edit="false" />
<Delete :permission="permission" :data="scope.row" style="margin-left: 5px" />
</template>
</el-table-column>
</CustomTable>
@ -70,70 +70,70 @@
</el-col>
</el-row>
<el-dialog :title="textMap[dialogStatus]" :visible="crud.status.editor > 0">
<el-dialog :title="textMap[dialogStatus]" :visible="crud.status.editor > 0" @close="crud.cancelCU">
<el-form
ref="tempUser"
:model="tempUser"
:rules="rules"
:rules="dialogStatus === 'create' ? rules : {}"
class="small-space"
label-position="left"
label-width="120px"
style="width: 300px; margin-left: 50px"
>
<el-form-item
v-if="dialogStatus === 'create'"
label="用户名"
prop="username"
required
>
<el-input v-model="tempUser.username" type="text" />
</el-form-item>
<el-form-item
v-if="dialogStatus === 'create'"
label="身份证号"
prop="identificationNum"
required
>
<el-input v-model="tempUser.identificationNum" type="text" />
</el-form-item>
<el-form-item
v-if="dialogStatus === 'create'"
label="昵称"
prop="nickname"
required
>
<el-input v-model="tempUser.nickname" type="text" />
</el-form-item>
<el-form-item
v-if="dialogStatus === 'create'"
label="密码"
prop="password"
required
>
<el-input v-model="tempUser.password" type="password" />
</el-form-item>
<el-form-item v-else label="新密码">
<el-input
v-model="tempUser.password"
type="password"
placeholder="不填则表示不修改"
/>
</el-form-item>
<el-form-item
v-if="dialogStatus === 'update'"
label="新签名密码"
prop="signPassword"
>
<el-input
v-model="tempUser.signPassword"
type="password"
placeholder="不填则表示不修改"
/>
</el-form-item>
<template v-if="dialogStatus === 'create'">
<el-form-item
label="用户名"
prop="username"
required
>
<el-input v-model="tempUser.username" type="text" />
</el-form-item>
<el-form-item
label="身份证号"
prop="identificationNum"
required
>
<el-input v-model="tempUser.identificationNum" type="text" />
</el-form-item>
<el-form-item
label="昵称"
prop="nickname"
required
>
<el-input v-model="tempUser.nickname" type="text" />
</el-form-item>
<el-form-item
label="密码"
prop="password"
required
>
<el-input v-model="tempUser.password" type="password" />
</el-form-item>
</template>
<template v-else>
<el-form-item label="新密码">
<el-input
v-model="tempUser.password"
type="password"
placeholder="不填则表示不修改"
/>
</el-form-item>
<el-form-item
label="新签名密码"
prop="signPassword"
>
<el-input
v-model="tempUser.signPassword"
type="password"
placeholder="不填则表示不修改"
/>
</el-form-item>
</template>
<el-form-item label="角色" prop="roleIds">
<el-select
v-model="roleIds"
multiple
filterable
placeholder="请选择"
style="width: 180px"
>
@ -295,7 +295,12 @@ export default {
},
fileList: [],
depts: [],
roleIds: []
roleIds: [],
permission: {
add: ['user:add'],
edit: ['user:update'],
del: ['user:delete']
}
}
},
computed: {
@ -316,6 +321,14 @@ export default {
console.log(this.crud, this.query, '啊哈哈哈')
},
methods: {
//
[CRUD.HOOK.beforeToAdd]() {
this.showCreate()
},
//
[CRUD.HOOK.beforeToEdit](crud, form) {
this.showUpdate(form)
},
getAllRoles() {
this.api({
url: '/role/all',
@ -401,23 +414,18 @@ export default {
//
this.tempUser = {}
this.dialogStatus = 'create'
this.dialogFormVisible = true
this.roleIds.length = 0
this.dialogFormVisible = true
},
showUpdate($index) {
const user = this.list[$index]
showUpdate(user) {
this.tempUser = user
this.roleIds.length = 0
if (user.roleIds !== null && user.roleIds !== undefined) {
if (user.roleIds.indexOf(',') !== -1) {
user.roleIds
.split(',')
.forEach((roleId) => this.roleIds.push(Number(roleId)))
}
if (user.roleIds) {
user.roleIds.split(',').forEach((roleId) => this.roleIds.push(Number(roleId)))
}
if (user.signImg !== null && user.signImg !== '') {
if (user.signImg) {
this.tempUser.signImg = user.signImg
this.fileList = JSON.parse(user.signImg)
this.fileList = [{ name: this.tempUser.signImg }]
if (this.fileList.length > 0) {
this.fileList[0].url =
process.env.VUE_APP_IMG_URL + 'signImage/' + this.fileList[0].name
@ -425,6 +433,7 @@ export default {
} else {
this.fileList = []
}
console.log(this.fileList[0])
this.dialogStatus = 'update'
this.dialogFormVisible = true
},
@ -484,6 +493,7 @@ export default {
_vue.getList()
}
})
this.crud.cancelCU()
})
} else {
return false

Loading…
Cancel
Save