Commit 75ad97ed by wuqian

Merge branch 'dev'

parents d13f94f2 e3b6b5af
......@@ -4,27 +4,24 @@
:inline="true"
size="mini"
@submit.native.prevent
@keyup.enter.capture="search"
>
@keyup.enter.capture="search">
<el-form-item label="用户名">
<el-input
style="width: 120px"
clearable
v-model="searchForm.employeeName"
placeholder="用户名/姓名"
></el-input>
placeholder="用户名/姓名"></el-input>
</el-form-item>
<el-form-item label="启用状态">
<el-select
clearable
:class="{
green: searchForm.enable ,
red: !searchForm.enable,
green: searchForm.enable,
red: !searchForm.enable
}"
v-model="searchForm.enable"
style="width: 120px"
placeholder="请选择"
>
placeholder="请选择">
<el-option label="启用" :value="true"></el-option>
<el-option label="禁用" :value="false"></el-option>
</el-select>
......@@ -35,15 +32,12 @@
native-type="submit"
type="primary"
@click="search()"
icon="el-icon-search"
>
icon="el-icon-search">
查询
</el-button>
</el-form-item>
<el-form-item>
<el-button type="success" @click="addDialog(1)"
>新增</el-button
>
<el-button type="success" @click="addDialog(1)">新增</el-button>
</el-form-item>
<!-- <el-form-item>
......@@ -57,8 +51,7 @@
:tableColumns="usersTableColumns"
@currentChange="currentTabFn"
:rowClassName="cellClass"
@selectionChange="selectionChange"
></table-vue>
@selectionChange="selectionChange"></table-vue>
</div>
<div class="pagination">
<el-pagination
......@@ -68,9 +61,7 @@
:page-size="pageSize"
:current-page="currentPage"
@size-change="sizeChange"
@current-change="onCurrentChange"
>
</el-pagination>
@current-change="onCurrentChange"></el-pagination>
</div>
<!-- 弹出层 -->
......@@ -78,8 +69,7 @@
:close-on-click-modal="false"
:title="is_title == 1 ? '新增' : '编辑'"
:visible.sync="dialogVisible"
width="590px"
>
width="590px">
<el-form
label-position="right"
label-width="100px"
......@@ -87,40 +77,29 @@
:inline="true"
:model="addcurrencyform"
:rules="addrules"
ref="addcurrencyform"
>
<el-form-item
label="登录账号"
prop="account"
required
>
ref="addcurrencyform">
<el-form-item label="登录账号" prop="account" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.account"
placeholder="请输入登录账号"
maxlength="30"
></el-input>
maxlength="30"></el-input>
</el-form-item>
<el-form-item label="姓名" prop="" required>
<el-input
style="width: 164px"
v-model="addcurrencyform.realName"
placeholder="请输入姓名"
maxlength="30"
></el-input>
maxlength="30"></el-input>
</el-form-item>
<el-form-item label="是否启用" prop="enable">
<div style="width: 164px" placeholder="请选择">
<el-radio
:label="true"
v-model="addcurrencyform.enable"
></el-radio
>
<el-radio
:label="false"
v-model="addcurrencyform.enable"
></el-radio
>
<el-radio :label="true" v-model="addcurrencyform.enable">
</el-radio>
<el-radio :label="false" v-model="addcurrencyform.enable">
</el-radio>
</div>
</el-form-item>
</el-form>
......@@ -128,16 +107,14 @@
<el-button
@click="dialogVisible = false"
size="mini"
style="width: 100px"
>
style="width: 100px">
取消
</el-button>
<el-button
type="primary"
@click="addUser()"
size="mini"
style="width: 100px"
>
style="width: 100px">
确认
</el-button>
</span>
......@@ -151,7 +128,7 @@ import tableVue from '@/common/components/base/tableView.vue'
export default {
name: 'system_users',
components: {
tableVue,
tableVue
},
data() {
const validatePass = (rule, value, callback) => {
......@@ -180,7 +157,7 @@ export default {
searchForm: {
employeeName: '',
enable: true,
platform: '',
platform: ''
},
dialogVisible: false,
addcurrencyform: {
......@@ -193,44 +170,40 @@ export default {
employeeId: '',
roleId: '',
funcRoleIds: [],
platform: '',
platform: ''
},
addcurrencyform2: null,
formId: null,
addrules: {
password: [
{ validator: validatePass, trigger: 'blur' },
],
confirmpwd: [
{ validator: confirmPass, trigger: 'blur' },
],
password: [{ validator: validatePass, trigger: 'blur' }],
confirmpwd: [{ validator: confirmPass, trigger: 'blur' }],
loginName: [
{
required: true,
message: '请输入登录账号',
trigger: 'blur',
},
trigger: 'blur'
}
],
employeeName: [
{
required: true,
message: '请选择员工',
trigger: 'change',
},
trigger: 'change'
}
],
roleId: [
{
required: true,
message: '请选择角色',
trigger: 'change',
},
],
trigger: 'change'
}
]
},
roleList: [],
paginationOptions: {
pageSize: 100,
currentPage: 1,
total: 0,
total: 0
},
details: [],
roleOptions: [],
......@@ -238,14 +211,12 @@ export default {
total: 0,
pageSize: 100,
currentPage: 1,
loading: false,
loading: false
}
},
created() {
this.getList(1)
this.addcurrencyform2 = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
this.addcurrencyform2 = JSON.parse(JSON.stringify(this.addcurrencyform))
// axios.get('sysRole/role_option')
// .then((res) => {
// if (res.code === 200) {
......@@ -280,19 +251,16 @@ export default {
<i
class="circle"
style={{
backgroundColor: item.enable
? 'green'
: 'red',
}}
></i>
backgroundColor: item.enable ? 'green' : 'red'
}}></i>
{item.account}
</span>
),
)
},
{
label: '姓名',
key: 'realName',
width: '',
width: ''
},
{
label: '相关操作',
......@@ -305,47 +273,38 @@ export default {
<i
class="el-icon-edit-outline"
style="color:#E6A23C"
onClick={(e) =>
this.addDialog(2, item, e)
}
></i>
onClick={(e) => this.addDialog(2, item, e)}></i>
</span>
<span title="重置密码" class="icon-view ">
<i
style="color:#67C23A"
class="el-icon-refresh-left"
onClick={(e) => this.resetPwd(e, item)}
></i>
onClick={(e) => this.resetPwd(e, item)}></i>
</span>
<span title="删除" class="icon-view ">
<i
style="color:#F56C6C"
class="el-icon-delete"
onClick={(e) => this.deleteSection(item)}
></i>
onClick={(e) => this.deleteSection(item)}></i>
</span>
</div>
),
},
)
}
]
},
funcRoleList() {
if (this.roleList.length > 0) {
return this.roleList.filter(
(item) => item.type === 'FUNCTION_ROLE',
)
return this.roleList.filter((item) => item.type === 'FUNCTION_ROLE')
}
return []
},
dataRoleList() {
if (this.roleList.length > 0) {
return this.roleList.filter(
(item) => item.type === 'DATA_ROLE',
)
return this.roleList.filter((item) => item.type === 'DATA_ROLE')
}
return []
},
}
},
methods: {
onCurrentChange() {},
......@@ -354,7 +313,7 @@ export default {
axios
.post('platform/user/update', {
...item,
cost: v,
cost: v
})
.then(() => {
this.getList()
......@@ -380,7 +339,7 @@ export default {
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {})
.catch(() => {})
......@@ -388,19 +347,14 @@ export default {
resetPwd(e, row) {
e && e.stopPropagation()
this.$confirm('确认要重置密码?', '提示', {
this.$confirm(`确认要重置用户${row.account}的密码?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
axios
.post('platform/user/resetPassword/' + row.id)
.then((res) => {
this.$alert(
'重置成功\n\r 新密码为:' +
res.data.passWord,
)
axios.post('platform/user/resetPassword/' + row.id).then((res) => {
this.$alert('重置成功\n\r 新密码为:' + res.data.passWord)
})
})
.catch(() => {})
......@@ -409,7 +363,7 @@ export default {
axios
.post('platform/user/setEnableStatus', {
enable: val,
userId: row.id,
userId: row.id
})
.then((res) => {
this.$message.success(res.message)
......@@ -420,7 +374,7 @@ export default {
axios
.post('platform/user/setBindingStatus', {
bindStatus: !row.bindStatus,
userId: row.id,
userId: row.id
})
.then((res) => {
this.$message.success(res.message)
......@@ -430,8 +384,7 @@ export default {
setempNo(id) {
for (const iterator of this.employee) {
if (iterator.id === id) {
this.addcurrencyform.empNumber =
iterator.empNumber
this.addcurrencyform.empNumber = iterator.empNumber
break
}
}
......@@ -456,19 +409,16 @@ export default {
axios
.get('platform/user/get', {
params: {
id: v.id,
},
id: v.id
}
})
.then((res) => {
const funcRoleIds = []
const dataRoleIds = []
if (res.data.roleIds) {
const roleIds =
res?.data?.roleIds.split(',') || []
const roleIds = res?.data?.roleIds.split(',') || []
for (const iterator of roleIds) {
const item = this.roleList.find(
(item) => item.id === iterator,
)
const item = this.roleList.find((item) => item.id === iterator)
if (item) {
if (item.type === 'FUNCTION_ROLE') {
funcRoleIds.push(Number(iterator))
......@@ -482,20 +432,17 @@ export default {
this.addcurrencyform = {
...res.data,
funcRoleIds,
dataRoleIds,
dataRoleIds
}
this.dialogVisible = true
})
} else {
this.addcurrencyform = JSON.parse(
JSON.stringify(this.addcurrencyform2),
)
this.addcurrencyform = JSON.parse(JSON.stringify(this.addcurrencyform2))
this.dialogVisible = true
}
this.is_title = i
this.$nextTick(() => {
this.$refs.addcurrencyform &&
this.$refs.addcurrencyform.clearValidate()
this.$refs.addcurrencyform && this.$refs.addcurrencyform.clearValidate()
})
},
addUser() {
......@@ -514,13 +461,12 @@ export default {
// 查询
getList() {
this.loading = true
const { pageSize, currentPage } =
this.paginationOptions
const { pageSize, currentPage } = this.paginationOptions
axios
.post('platform/user/list_page', {
pageSize,
currentPage,
...this.searchForm,
...this.searchForm
})
.then((res) => {
this.loading = false
......@@ -529,7 +475,7 @@ export default {
this.paginationOptions.total = res.data.total
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
......@@ -540,12 +486,9 @@ export default {
const url = 'platform/user/update'
this.$refs.addcurrencyform.validate((valid) => {
if (valid) {
const data = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
let roleIds =
this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds,
const data = JSON.parse(JSON.stringify(this.addcurrencyform))
let roleIds = this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds
)
roleIds = roleIds.join()
data.roleIds = roleIds
......@@ -554,12 +497,12 @@ export default {
this.dialogVisible = false
this.$message({
message: '修改成功',
type: 'success',
type: 'success'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
......@@ -571,12 +514,9 @@ export default {
const url = 'platform/user/add'
this.$refs.addcurrencyform.validate((valid) => {
if (valid) {
const data = JSON.parse(
JSON.stringify(this.addcurrencyform),
)
let roleIds =
this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds,
const data = JSON.parse(JSON.stringify(this.addcurrencyform))
let roleIds = this.addcurrencyform.funcRoleIds.concat(
this.addcurrencyform.dataRoleIds
)
roleIds = roleIds.join()
data.roleIds = roleIds
......@@ -584,14 +524,13 @@ export default {
if (res.code === 200) {
this.dialogVisible = false
this.$alert(
'添加成功\n\r 用户密码为:' +
res.data?.passWord || '',
'添加成功\n\r 用户密码为:' + res.data?.passWord || ''
)
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
......@@ -615,32 +554,32 @@ export default {
this.$confirm('确定删除选中的信息?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
})
.then(() => {
axios
.get('platform/user/delete', {
params: {
ids: ids,
},
ids: ids
}
})
.then((res) => {
if (res.code === 200) {
this.$message({
type: 'success',
message: '删除成功!',
message: '删除成功!'
})
this.getList(this.currentPage)
} else {
this.$alert(res.message, '错误提示', {
dangerouslyUseHTMLString: true,
dangerouslyUseHTMLString: true
})
}
})
})
.catch(() => {})
},
},
}
}
}
</script>
<style scoped>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment