800ba85e by 任超

style:用户中心

1 parent cac15baf
......@@ -3,35 +3,20 @@
<div class="from-clues-header">
<el-form ref="ruleForm" :model="form" label-width="100px">
<el-row class="mb-5">
<el-col :span="3">
<el-select v-model="selectType" placeholder="请选择" class="select">
<el-option
v-for="item in typeOptions"
:key="item.value"
:label="item.label"
:value="item.value"
/>
<el-option v-for="item in typeOptions" :key="item.value" :label="item.label" :value="item.value" />
</el-select>
</el-col>
<el-col :span="3">
<el-input
v-model="queryName"
class="selectName"
clearable
placeholder="请输入"
>
<el-button
slot="append"
icon="el-icon-search"
@click="searchQuery()"
/>
<el-input v-model="queryName" class="selectName" clearable placeholder="请输入">
<el-button slot="append" icon="el-icon-search" @click="searchQuery()" />
</el-input>
</el-col>
<!-- 按钮操作 -->
<el-col :span="6" class="btnColRight">
<el-form-item>
<btn nativeType="cz" @click="handleAdd" >添加人员</btn>
<!-- 按钮操作 -->
<el-col :span="6" class="btnColRight">
<el-form-item>
<btn nativeType="cz" @click="handleAdd">添加人员</btn>
<btn nativeType="cx" @click="resetPassword(selectionRows)">重置密码</btn>
<btn nativeType="sb" @click="resetSearch()">重置</btn>
</el-form-item>
......@@ -41,191 +26,72 @@
</el-form>
</div>
<div class="from-clues-content">
<vxe-table
ref="xTree"
v-loading="loading"
class="header-bg-type1"
:data="tableData"
show-overflow
border
:checkbox-config="{ highlight: true }"
:empty-render="{ name: 'NotData' }"
highlight-hover-row
max-height="90%"
@checkbox-all="selectAllEvent"
@checkbox-change="selectChangeEvent"
>
<vxe-table ref="xTree" v-loading="loading" class="header-bg-type1" :data="tableData" show-overflow border
:checkbox-config="{ highlight: true }" :empty-render="{ name: 'NotData' }" highlight-hover-row max-height="90%"
@checkbox-all="selectAllEvent" @checkbox-change="selectChangeEvent">
<template #empty>
<table-empty />
</template>
<vxe-table-column
type="checkbox"
width="36"
align="center"
fixed="left"
/>
<vxe-table-column
field="code"
title="工号"
width="80"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
fixed="left"
/>
<vxe-table-column
title="姓名"
width="140"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
fixed="left"
>
<vxe-table-column type="checkbox" width="36" align="center" fixed="left" />
<vxe-table-column field="code" title="工号" width="80" align="left" show-header-overflow="tooltip"
show-overflow="tooltip" fixed="left" />
<vxe-table-column title="姓名" width="140" align="left" show-header-overflow="tooltip" show-overflow="tooltip"
fixed="left">
<template slot-scope="scope">
<svg-icon
:icon-class="
scope.row.sex === '0'
? 'male'
: scope.row.sex === '1'
<svg-icon :icon-class="
scope.row.sex === '0'
? 'male'
: scope.row.sex === '1'
? 'female'
: 'secrecy'
"
/>
" />
{{ scope.row.name }}
</template>
</vxe-table-column>
<vxe-table-column
field="loginName"
title="用户名"
width="110"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
fixed="left"
/>
<vxe-table-column
title="负责人"
align="left"
show-header-overflow="tooltip"
show-overflow="tooltip"
>
<vxe-table-column field="loginName" title="用户名" width="110" align="left" show-header-overflow="tooltip"
show-overflow="tooltip" fixed="left" />
<vxe-table-column title="负责人" align="left" show-header-overflow="tooltip" show-overflow="tooltip">
<template slot-scope="scope">
<i v-if="scope.row.isDuty" class="el-icon-check" />
</template>
</vxe-table-column>
<vxe-table-column
field="departmentName"
title="所属部门"
align="left"
width="140"
min-width="140"
show-header-overflow="tooltip"
show-overflow="tooltip"
/>
<vxe-table-column
field="jobLevel"
:formatter="formatterjobLevel"
title="职位"
align="left"
width="140"
min-width="140"
show-header-overflow="tooltip"
show-overflow="tooltip"
/>
<vxe-table-column
field="mobilePhone"
title="电话"
width="140"
show-header-overflow="tooltip"
show-overflow="tooltip"
align="left"
/>
<vxe-table-column field="departmentName" title="所属部门" align="left" width="140" min-width="140"
show-header-overflow="tooltip" show-overflow="tooltip" />
<vxe-table-column field="jobLevel" :formatter="formatterjobLevel" title="职位" align="left" width="140"
min-width="140" show-header-overflow="tooltip" show-overflow="tooltip" />
<vxe-table-column field="mobilePhone" title="电话" width="140" show-header-overflow="tooltip"
show-overflow="tooltip" align="left" />
<vxe-table-column title="状态" width="50">
<template scope="scope">
<el-switch
v-model="scope.row.switch"
class="switch"
active-color="#32BAD4"
inactive-color="#B1B9C5"
active-text="启"
inactive-text="禁"
@change="changeStatus(scope.row)"
/>
<el-switch v-model="scope.row.switch" class="switch" active-color="#32BAD4" inactive-color="#B1B9C5"
active-text="启" inactive-text="禁" @change="changeStatus(scope.row)" />
</template>
</vxe-table-column>
<vxe-table-column
title="排序"
width="148"
min-width="148"
align="left"
fixed="right"
>
<vxe-table-column title="排序" width="148" min-width="148" align="left" fixed="right">
<template #header>
<p class="ml8">排序</p>
</template>
<template slot-scope="scope">
<sort-table
:scope-data="scope"
:sort-url="tableUrl"
@sortOk="getTableList"
/>
<sort-table :scope-data="scope" :sort-url="tableUrl" @sortOk="getTableList" />
</template>
</vxe-table-column>
<vxe-table-column
title="操作"
width="148"
min-width="148"
align="left"
fixed="right"
>
<vxe-table-column title="操作" width="148" min-width="148" align="left" fixed="right">
<template #header>
<p class="ml8">操作</p>
</template>
<template slot-scope="scope">
<el-button type="text" size="small">
<el-tooltip
class="item"
effect="dark"
content="解锁"
placement="top"
>
<i
class="icon-platform-unlock iconfont"
@click="updateLock(scope.row.id, scope.row.name)"
/>
<el-tooltip class="item" effect="dark" content="解锁" placement="top">
<i class="icon-platform-unlock iconfont" @click="updateLock(scope.row.id, scope.row.name)" />
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="重置"
placement="top"
>
<i
class="icon-platform-reset iconfont"
@click="resetPassword(scope.row.id)"
/>
<el-tooltip class="item" effect="dark" content="重置" placement="top">
<i class="icon-platform-reset iconfont" @click="resetPassword(scope.row.id)" />
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="修改"
placement="top"
>
<i
class="icon-platform-edit iconfont"
@click="handleEdit(scope.row)"
/>
<el-tooltip class="item" effect="dark" content="修改" placement="top">
<i class="icon-platform-edit iconfont" @click="handleEdit(scope.row)" />
</el-tooltip>
<el-tooltip
class="item"
effect="dark"
content="删除"
placement="top"
>
<i
class="icon-platform-delete iconfont"
@click="handleDelete(scope.row.id, scope.row.name)"
/>
<el-tooltip class="item" effect="dark" content="删除" placement="top">
<i class="icon-platform-delete iconfont" @click="handleDelete(scope.row.id, scope.row.name)" />
</el-tooltip>
</el-button>
</template>
......@@ -236,11 +102,10 @@
</template>
<script>
// 定时任务
export default {
name: "users",
components: {},
data() {
data () {
return {
title: '',
queryParam: {},
......@@ -279,7 +144,7 @@ export default {
},
};
},
created() {
created () {
// 获取区域和组织机构id
eventBus.$on('getSelectedId', (res) => {
if (!res.organizationId) {
......@@ -295,13 +160,13 @@ export default {
this.initDictConfig()
})
},
updated() {
updated () {
this.tableData.forEach((element) => {
element.switch = element.status === 'ACTIVE'
})
},
methods: {
initDictConfig() {
initDictConfig () {
getDictItems('XB').then((res) => {
if (res.status === 1) {
this.sexList = res.content
......@@ -317,7 +182,7 @@ export default {
}
})
},
getDepartData() {
getDepartData () {
getDeptsByIdAction(this.organizationId).then((res) => {
if (res.status === 1) {
this.departmentList = res.content
......@@ -326,7 +191,7 @@ export default {
}
})
},
getTableList() {
getTableList () {
this.loading = true
this.queryParam = {
organizationId: this.organizationId,
......@@ -342,7 +207,7 @@ export default {
})
},
// 查询
searchQuery() {
searchQuery () {
switch (this.selectType) {
case '0':
this.queryParam.type = 'NAME'
......@@ -369,7 +234,7 @@ export default {
})
},
// 重置搜索
resetSearch() {
resetSearch () {
this.selectType = '0'
this.queryName = ''
this.queryParam = {
......@@ -379,7 +244,7 @@ export default {
this.getTableList()
},
// 性别
formatterSex({ cellValue }) {
formatterSex ({ cellValue }) {
if (this.sexList.length !== 0) {
if (cellValue !== null) {
const sex = this.sexList.find((item) => item.value === cellValue).name
......@@ -390,7 +255,7 @@ export default {
}
},
// 职务级别
formatterjobLevel({ cellValue }) {
formatterjobLevel ({ cellValue }) {
if (this.levelList.length !== 0) {
if (cellValue) {
const jobLevel = this.levelList.find(
......@@ -403,7 +268,7 @@ export default {
}
},
// 删除
handleDelete(id, content) {
handleDelete (id, content) {
this.$confirm(deleteDomStr(content), '执行确认', {
dangerouslyUseHTMLString: true,
customClass: 'customer-delete',
......@@ -421,10 +286,10 @@ export default {
this.getTableList()
})
})
.catch(() => {})
.catch(() => { })
},
// 修改状态
changeStatus(row) {
changeStatus (row) {
this.$confirm('确定要修改状态吗?', '提示', {
customClass: 'customer-update',
confirmButtonText: '确定',
......@@ -448,7 +313,7 @@ export default {
})
},
// 更新用户解锁状态
updateLock(id, name) {
updateLock (id, name) {
this.$confirm(
`<div class="customer-message-wrapper">
<h5 class="title">确定要更新用户解锁状态吗</h5>
......@@ -475,10 +340,10 @@ export default {
}
})
})
.catch(() => {})
.catch(() => { })
},
// 重置用户密码
resetPassword(data) {
resetPassword (data) {
const ids = []
if (data instanceof Array) {
data.forEach((item) => {
......@@ -521,20 +386,20 @@ export default {
}
})
})
.catch(() => {})
.catch(() => { })
},
// 新增回显
reloadTableData() {
reloadTableData () {
this.getTableList()
},
showimport() {
showimport () {
this.$refs.leadingIn.import(this.tableUrl, '人员')
}
}
}
</script>
<style scoped lang="less">
<style scoped lang="scss">
.content {
.top-wrapper {
.el-button + .el-button {
......