新更改
This commit is contained in:
parent
449ed38a29
commit
0243ef1e08
|
@ -136,8 +136,5 @@ export default {
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.aui-content__wrapper {
|
.aui-content__wrapper {
|
||||||
margin-left: 266px;
|
margin-left: 266px;
|
||||||
.aui-content > .el-tabs > .el-tabs__header {
|
|
||||||
left: 230px;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
|
@ -1,10 +1,7 @@
|
||||||
<template>
|
<template>
|
||||||
<el-card shadow="never" class="aui-card--fill">
|
<el-card shadow="never" class="aui-card--fill">
|
||||||
<div class="mod-ability__bsabilityai">
|
<div class="mod-ability__bsabilityai">
|
||||||
<el-form
|
<el-form :inline="true" :model="dataForm">
|
||||||
:inline="true"
|
|
||||||
:model="dataForm"
|
|
||||||
>
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input
|
<el-input
|
||||||
v-model="dataForm.name"
|
v-model="dataForm.name"
|
||||||
|
@ -13,7 +10,7 @@
|
||||||
></el-input>
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="getDataList2(dataForm.name)">{{
|
<el-button type="primary" @click="getDataList2(dataForm.name)">{{
|
||||||
$t("query")
|
$t("query")
|
||||||
}}</el-button>
|
}}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
@ -49,7 +46,7 @@
|
||||||
:height="qp ? '650px' : '650px'"
|
:height="qp ? '650px' : '650px'"
|
||||||
border
|
border
|
||||||
@selection-change="dataListSelectionChangeHandle"
|
@selection-change="dataListSelectionChangeHandle"
|
||||||
style="width: 100%;"
|
style="width: 100%"
|
||||||
>
|
>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
type="selection"
|
type="selection"
|
||||||
|
@ -71,9 +68,7 @@
|
||||||
align="center"
|
align="center"
|
||||||
>
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{
|
{{ findValue(scope.row.infoList, item.attrType) }}
|
||||||
findValue(scope.row.infoList, item.attrType)
|
|
||||||
}}
|
|
||||||
</template>
|
</template>
|
||||||
</af-table-column>
|
</af-table-column>
|
||||||
<el-table-column
|
<el-table-column
|
||||||
|
@ -129,187 +124,196 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import mixinViewModule from '@/mixins/view-module'
|
import mixinViewModule from "@/mixins/view-module";
|
||||||
import AddOrUpdate from './bsabilityai-add-or-update'
|
import AddOrUpdate from "./bsabilityai-add-or-update";
|
||||||
import dictionaries from '@/utils/dictionaries'
|
import dictionaries from "@/utils/dictionaries";
|
||||||
import qs from 'qs'
|
import qs from "qs";
|
||||||
export default {
|
export default {
|
||||||
mixins: [mixinViewModule],
|
mixins: [mixinViewModule],
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
mixinViewModuleOptions: {
|
mixinViewModuleOptions: {
|
||||||
getDataListURL: '/resource/page',
|
getDataListURL: "/resource/page",
|
||||||
getDataListIsPage: true,
|
getDataListIsPage: true,
|
||||||
exportURL: '/ability/bsabilityai/export',
|
exportURL: "/ability/bsabilityai/export",
|
||||||
deleteURL: '/resource/delete',
|
deleteURL: "/resource/delete",
|
||||||
deleteIsBatch: true
|
deleteIsBatch: true,
|
||||||
},
|
},
|
||||||
disabled: false,
|
disabled: false,
|
||||||
sceneArr: dictionaries.sceneArr,
|
sceneArr: dictionaries.sceneArr,
|
||||||
fieldArr: dictionaries.fieldArr,
|
fieldArr: dictionaries.fieldArr,
|
||||||
shareFormArr: dictionaries.shareFormArr,
|
shareFormArr: dictionaries.shareFormArr,
|
||||||
dataForm: {
|
dataForm: {
|
||||||
name: '',
|
name: "",
|
||||||
creator: '',
|
creator: "",
|
||||||
delFlag: 0,
|
delFlag: 0,
|
||||||
selectType: 0,
|
selectType: 0,
|
||||||
type: '组件服务'
|
type: "组件服务",
|
||||||
},
|
},
|
||||||
qp: false
|
qp: false,
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
watch: {},
|
watch: {},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate
|
AddOrUpdate,
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.dataForm.name = ''
|
this.dataForm.name = "";
|
||||||
this.dataForm.type = '组件服务'
|
this.dataForm.type = "组件服务";
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted() {
|
||||||
window.addEventListener('resize', this.a)
|
window.addEventListener("resize", this.a);
|
||||||
this.fullScreen()
|
this.fullScreen();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
reset () {
|
reset() {
|
||||||
this.$http.get(
|
this.$http
|
||||||
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
|
.get(
|
||||||
// order: this.order,
|
this.mixinViewModuleOptions.getDataListURL +
|
||||||
// orderField: this.orderField,
|
"?" +
|
||||||
// type: '组件服务',
|
qs.stringify({
|
||||||
page: 1,
|
// order: this.order,
|
||||||
limit: 10,
|
// orderField: this.orderField,
|
||||||
creator: '',
|
// type: '组件服务',
|
||||||
selectType: 0,
|
page: 1,
|
||||||
delFlag: 0,
|
limit: 10,
|
||||||
type: '组件服务',
|
creator: "",
|
||||||
name: ''
|
selectType: 0,
|
||||||
})
|
delFlag: 0,
|
||||||
)
|
type: "组件服务",
|
||||||
|
name: "",
|
||||||
|
})
|
||||||
|
)
|
||||||
.then(({ data: res }) => {
|
.then(({ data: res }) => {
|
||||||
this.dataForm.name = ''
|
this.dataForm.name = "";
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
this.dataList = []
|
this.dataList = [];
|
||||||
this.total = 0
|
this.total = 0;
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
|
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
? res.data.list
|
? res.data.list
|
||||||
: res.data
|
: res.data;
|
||||||
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
? res.data.total
|
? res.data.total
|
||||||
: 0
|
: 0;
|
||||||
if (this.mixinViewModuleOptions.requestCallback) {
|
if (this.mixinViewModuleOptions.requestCallback) {
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
this.mixinViewModuleOptions.requestCallback(res.data);
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false;
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false;
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
findValue (list, type) {
|
findValue(list, type) {
|
||||||
const found = list.find(item => item.attrType === type)
|
const found = list.find((item) => item.attrType === type);
|
||||||
if (found) {
|
if (found) {
|
||||||
return found.attrValue
|
return found.attrValue;
|
||||||
} else {
|
} else {
|
||||||
return '暂无数据'
|
return "暂无数据";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
showDetail (val) {
|
showDetail(val) {
|
||||||
// this.addOrUpdateHandle(id)
|
// this.addOrUpdateHandle(id)
|
||||||
this.addOrUpdateVisible = true
|
this.addOrUpdateVisible = true;
|
||||||
this.disabled = false
|
this.disabled = false;
|
||||||
console.log('显示数据=============》', val)
|
console.log("显示数据=============》", val);
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.addOrUpdate.UpdateState = false
|
this.$refs.addOrUpdate.UpdateState = false;
|
||||||
this.$refs.addOrUpdate.dataFormShowDetails = val
|
this.$refs.addOrUpdate.dataFormShowDetails = val;
|
||||||
this.$refs.addOrUpdate.init()
|
this.$refs.addOrUpdate.init();
|
||||||
})
|
});
|
||||||
this.disabled = true
|
this.disabled = true;
|
||||||
},
|
},
|
||||||
showDocument (val) {
|
showDocument(val) {
|
||||||
console.log(val)
|
console.log(val);
|
||||||
window.open(window.SITE_CONFIG.frontUrl + '?id=' + val.id + '&&type=' + val.type, '_blank')
|
window.open(
|
||||||
|
window.SITE_CONFIG.frontUrl + "?id=" + val.id + "&&type=" + val.type,
|
||||||
|
"_blank"
|
||||||
|
);
|
||||||
},
|
},
|
||||||
getDataList2 (names) {
|
getDataList2(names) {
|
||||||
if (names != null) {
|
if (names != null) {
|
||||||
this.$http.get(
|
this.$http
|
||||||
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
|
.get(
|
||||||
// order: this.order,
|
this.mixinViewModuleOptions.getDataListURL +
|
||||||
// orderField: this.orderField,
|
"?" +
|
||||||
// type: '组件服务',
|
qs.stringify({
|
||||||
pageNum: 1,
|
// order: this.order,
|
||||||
pageSize: this.limit,
|
// orderField: this.orderField,
|
||||||
type: '组件服务',
|
// type: '组件服务',
|
||||||
creator: '',
|
pageNum: 1,
|
||||||
selectType: 0,
|
pageSize: this.limit,
|
||||||
delFlag: 0,
|
type: "组件服务",
|
||||||
name: names
|
creator: "",
|
||||||
})
|
selectType: 0,
|
||||||
)
|
delFlag: 0,
|
||||||
|
name: names,
|
||||||
|
})
|
||||||
|
)
|
||||||
.then(({ data: res }) => {
|
.then(({ data: res }) => {
|
||||||
console.log('res', res)
|
console.log("res", res);
|
||||||
if (res.code !== 0) {
|
if (res.code !== 0) {
|
||||||
this.dataList = []
|
this.dataList = [];
|
||||||
this.total = 0
|
this.total = 0;
|
||||||
return this.$message.error(res.msg)
|
return this.$message.error(res.msg);
|
||||||
}
|
}
|
||||||
if (res.data.list.length !== 0) {
|
if (res.data.list.length !== 0) {
|
||||||
this.dataList = res.data.list
|
this.dataList = res.data.list;
|
||||||
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
? res.data.total
|
? res.data.total
|
||||||
: 0
|
: 0;
|
||||||
if (this.mixinViewModuleOptions.requestCallback) {
|
if (this.mixinViewModuleOptions.requestCallback) {
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
this.mixinViewModuleOptions.requestCallback(res.data);
|
||||||
}
|
}
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false;
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('未查询到相关信息')
|
this.$message.error("未查询到相关信息");
|
||||||
this.reset()
|
this.reset();
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
this.dataListLoading = false
|
this.dataListLoading = false;
|
||||||
})
|
});
|
||||||
} else {
|
} else {
|
||||||
this.$message.error('查询信息不能为空')
|
this.$message.error("查询信息不能为空");
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fullScreen () {
|
fullScreen() {
|
||||||
if (window.outerHeight === screen.availHeight) {
|
if (window.outerHeight === screen.availHeight) {
|
||||||
if (window.outerWidth === screen.availWidth) {
|
if (window.outerWidth === screen.availWidth) {
|
||||||
console.log(
|
console.log(
|
||||||
'全屏1',
|
"全屏1",
|
||||||
window.outerHeight,
|
window.outerHeight,
|
||||||
screen.availHeight,
|
screen.availHeight,
|
||||||
window.outerWidth,
|
window.outerWidth,
|
||||||
screen.availWidth
|
screen.availWidth
|
||||||
)
|
);
|
||||||
this.qp = false
|
this.qp = false;
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'不是全屏2',
|
"不是全屏2",
|
||||||
window.outerHeight,
|
window.outerHeight,
|
||||||
screen.availHeight,
|
screen.availHeight,
|
||||||
window.outerWidth,
|
window.outerWidth,
|
||||||
screen.availWidth
|
screen.availWidth
|
||||||
)
|
);
|
||||||
this.qp = true
|
this.qp = true;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
console.log(
|
console.log(
|
||||||
'不是全屏3',
|
"不是全屏3",
|
||||||
window.outerHeight,
|
window.outerHeight,
|
||||||
screen.availHeight,
|
screen.availHeight,
|
||||||
window.outerWidth,
|
window.outerWidth,
|
||||||
screen.availWidth
|
screen.availWidth
|
||||||
)
|
);
|
||||||
this.qp = true
|
this.qp = true;
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
.el-tooltip__popper {
|
.el-tooltip__popper {
|
||||||
|
|
|
@ -1,32 +1,75 @@
|
||||||
<template>
|
<template>
|
||||||
<el-card shadow="never" class="aui-card--fill">
|
<el-card shadow="never" class="aui-card--fill">
|
||||||
<div class="mod-sys__user">
|
<div class="mod-sys__user">
|
||||||
<el-form :inline="true" :model="dataForm" @keyup.enter.native="getDataList()">
|
<el-form
|
||||||
|
:inline="true"
|
||||||
|
:model="dataForm"
|
||||||
|
@keyup.enter.native="getDataList()"
|
||||||
|
>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-input v-model="dataForm.username" :placeholder="$t('user.username')" clearable></el-input>
|
<el-input
|
||||||
|
v-model="dataForm.username"
|
||||||
|
:placeholder="$t('user.username')"
|
||||||
|
clearable
|
||||||
|
></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<ren-select v-model="dataForm.gender" dict-type="gender" :placeholder="$t('user.gender')"></ren-select>
|
<ren-select
|
||||||
|
v-model="dataForm.gender"
|
||||||
|
dict-type="gender"
|
||||||
|
:placeholder="$t('user.gender')"
|
||||||
|
></ren-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-select v-model="dataForm.postId" :placeholder="$t('user.postIdList')" clearable>
|
<el-select
|
||||||
<el-option :label="data.postName" v-for="data in postList" :key="data.id" :value ="data.id">{{data.postName}}</el-option>
|
v-model="dataForm.postId"
|
||||||
|
:placeholder="$t('user.postIdList')"
|
||||||
|
clearable
|
||||||
|
>
|
||||||
|
<el-option
|
||||||
|
:label="data.postName"
|
||||||
|
v-for="data in postList"
|
||||||
|
:key="data.id"
|
||||||
|
:value="data.id"
|
||||||
|
>{{ data.postName }}</el-option
|
||||||
|
>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<ren-dept-tree v-model="dataForm.deptId" :placeholder="$t('dept.title')" :query="true"></ren-dept-tree>
|
<ren-dept-tree
|
||||||
|
v-model="dataForm.deptId"
|
||||||
|
:placeholder="$t('dept.title')"
|
||||||
|
:query="true"
|
||||||
|
></ren-dept-tree>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="getDataList()">{{ $t('query') }}</el-button>
|
<el-button type="primary" @click="getDataList()">{{
|
||||||
|
$t("query")
|
||||||
|
}}</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="$hasPermission('sys:user:save')" type="primary" @click="addOrUpdateHandle()">{{ $t('add') }}</el-button>
|
<el-button
|
||||||
|
v-if="$hasPermission('sys:user:save')"
|
||||||
|
type="primary"
|
||||||
|
@click="addOrUpdateHandle()"
|
||||||
|
>{{ $t("add") }}</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="$hasPermission('sys:user:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button>
|
<el-button
|
||||||
|
v-if="$hasPermission('sys:user:delete')"
|
||||||
|
type="danger"
|
||||||
|
@click="deleteHandle()"
|
||||||
|
>{{ $t("deleteBatch") }}</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button v-if="$hasPermission('sys:user:export')" type="info" @click="exportHandle()">{{ $t('export') }}</el-button>
|
<el-button
|
||||||
|
v-if="$hasPermission('sys:user:export')"
|
||||||
|
type="info"
|
||||||
|
@click="exportHandle()"
|
||||||
|
>{{ $t("export") }}</el-button
|
||||||
|
>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button @click="reset()">重置</el-button>
|
<el-button @click="reset()">重置</el-button>
|
||||||
|
@ -38,28 +81,97 @@
|
||||||
border
|
border
|
||||||
@selection-change="dataListSelectionChangeHandle"
|
@selection-change="dataListSelectionChangeHandle"
|
||||||
@sort-change="dataListSortChangeHandle"
|
@sort-change="dataListSortChangeHandle"
|
||||||
style="width: 100%;">
|
style="width: 100%"
|
||||||
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column>
|
>
|
||||||
<el-table-column prop="username" :label="$t('user.username')" sortable="custom" header-align="center" align="center"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column prop="deptName" :label="$t('user.deptName')" header-align="center" align="center"></el-table-column>
|
type="selection"
|
||||||
<el-table-column prop="email" :label="$t('user.email')" header-align="center" align="center"></el-table-column>
|
header-align="center"
|
||||||
<el-table-column prop="mobile" :label="$t('user.mobile')" sortable="custom" header-align="center" align="center"></el-table-column>
|
align="center"
|
||||||
<el-table-column prop="gender" :label="$t('user.gender')" sortable="custom" header-align="center" align="center">
|
width="50"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="username"
|
||||||
|
:label="$t('user.username')"
|
||||||
|
sortable="custom"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="deptName"
|
||||||
|
:label="$t('user.deptName')"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="email"
|
||||||
|
:label="$t('user.email')"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="mobile"
|
||||||
|
:label="$t('user.mobile')"
|
||||||
|
sortable="custom"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
prop="gender"
|
||||||
|
:label="$t('user.gender')"
|
||||||
|
sortable="custom"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ $getDictLabel("gender", scope.row.gender) }}
|
{{ $getDictLabel("gender", scope.row.gender) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="status" :label="$t('user.status')" sortable="custom" header-align="center" align="center">
|
<el-table-column
|
||||||
|
prop="status"
|
||||||
|
:label="$t('user.status')"
|
||||||
|
sortable="custom"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{ $t('user.status0') }}</el-tag>
|
<el-tag v-if="scope.row.status === 0" size="small" type="danger">{{
|
||||||
<el-tag v-else size="small" type="success">{{ $t('user.status1') }}</el-tag>
|
$t("user.status0")
|
||||||
|
}}</el-tag>
|
||||||
|
<el-tag v-else size="small" type="success">{{
|
||||||
|
$t("user.status1")
|
||||||
|
}}</el-tag>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="createDate" :label="$t('user.createDate')" sortable="custom" header-align="center" align="center" width="180"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column :label="$t('handle')" fixed="right" header-align="center" align="center" width="150">
|
prop="createDate"
|
||||||
|
:label="$t('user.createDate')"
|
||||||
|
sortable="custom"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="180"
|
||||||
|
></el-table-column>
|
||||||
|
<el-table-column
|
||||||
|
:label="$t('handle')"
|
||||||
|
fixed="right"
|
||||||
|
header-align="center"
|
||||||
|
align="center"
|
||||||
|
width="150"
|
||||||
|
>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button v-if="$hasPermission('sys:user:update')" type="text" size="small" @click="addOrUpdateHandle(scope.row.id)">{{ $t('update') }}</el-button>
|
<el-button
|
||||||
<el-button v-if="$hasPermission('sys:user:delete')" type="text" size="small" @click="deleteHandle(scope.row.id)">{{ $t('delete') }}</el-button>
|
v-if="$hasPermission('sys:user:update')"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="addOrUpdateHandle(scope.row.id)"
|
||||||
|
>{{ $t("update") }}</el-button
|
||||||
|
>
|
||||||
|
<el-button
|
||||||
|
v-if="$hasPermission('sys:user:delete')"
|
||||||
|
type="text"
|
||||||
|
size="small"
|
||||||
|
@click="deleteHandle(scope.row.id)"
|
||||||
|
>{{ $t("delete") }}</el-button
|
||||||
|
>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
|
@ -70,84 +182,100 @@
|
||||||
:total="total"
|
:total="total"
|
||||||
layout="total, sizes, prev, pager, next, jumper"
|
layout="total, sizes, prev, pager, next, jumper"
|
||||||
@size-change="pageSizeChangeHandle"
|
@size-change="pageSizeChangeHandle"
|
||||||
@current-change="pageCurrentChangeHandle">
|
@current-change="pageCurrentChangeHandle"
|
||||||
|
>
|
||||||
</el-pagination>
|
</el-pagination>
|
||||||
<!-- 弹窗, 新增 / 修改 -->
|
<!-- 弹窗, 新增 / 修改 -->
|
||||||
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update>
|
<add-or-update
|
||||||
|
v-if="addOrUpdateVisible"
|
||||||
|
ref="addOrUpdate"
|
||||||
|
@refreshDataList="getDataList"
|
||||||
|
></add-or-update>
|
||||||
</div>
|
</div>
|
||||||
</el-card>
|
</el-card>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import mixinViewModule from '@/mixins/view-module'
|
import mixinViewModule from "@/mixins/view-module";
|
||||||
import AddOrUpdate from './user-add-or-update'
|
import AddOrUpdate from "./user-add-or-update";
|
||||||
import qs from 'qs'
|
import qs from "qs";
|
||||||
export default {
|
export default {
|
||||||
mixins: [mixinViewModule],
|
mixins: [mixinViewModule],
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
mixinViewModuleOptions: {
|
mixinViewModuleOptions: {
|
||||||
getDataListURL: '/sys/user/page',
|
getDataListURL: "/sys/user/page",
|
||||||
getDataListIsPage: true,
|
getDataListIsPage: true,
|
||||||
deleteURL: '/sys/user',
|
deleteURL: "/sys/user",
|
||||||
deleteIsBatch: true,
|
deleteIsBatch: true,
|
||||||
exportURL: '/sys/user/export'
|
exportURL: "/sys/user/export",
|
||||||
},
|
},
|
||||||
postList: [],
|
postList: [],
|
||||||
dataForm: {
|
dataForm: {
|
||||||
username: '',
|
username: "",
|
||||||
deptId: '',
|
deptId: "",
|
||||||
postId: '',
|
postId: "",
|
||||||
gender: ''
|
gender: "",
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
components: {
|
components: {
|
||||||
AddOrUpdate
|
AddOrUpdate,
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.getPostList()
|
this.getPostList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
reset () {
|
reset() {
|
||||||
this.$http.get(
|
this.$http
|
||||||
this.mixinViewModuleOptions.getDataListURL + '?' + qs.stringify({
|
.get(
|
||||||
page: 1,
|
this.mixinViewModuleOptions.getDataListURL +
|
||||||
limit: 10,
|
"?" +
|
||||||
username: '',
|
qs.stringify({
|
||||||
deptId: '',
|
page: 1,
|
||||||
postId: '',
|
limit: 10,
|
||||||
gender: ''
|
username: "",
|
||||||
|
deptId: "",
|
||||||
|
postId: "",
|
||||||
|
gender: "",
|
||||||
|
})
|
||||||
|
)
|
||||||
|
.then(({ data: res }) => {
|
||||||
|
this.dataForm.username = "";
|
||||||
|
this.dataForm.deptId = "";
|
||||||
|
this.dataForm.postId = "";
|
||||||
|
this.dataForm.gender = "";
|
||||||
|
if (res.code !== 0) {
|
||||||
|
this.dataList = [];
|
||||||
|
this.total = 0;
|
||||||
|
return this.$message.error(res.msg);
|
||||||
|
}
|
||||||
|
this.dataList = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
|
? res.data.list
|
||||||
|
: res.data;
|
||||||
|
this.total = this.mixinViewModuleOptions.getDataListIsPage
|
||||||
|
? res.data.total
|
||||||
|
: 0;
|
||||||
|
if (this.mixinViewModuleOptions.requestCallback) {
|
||||||
|
this.mixinViewModuleOptions.requestCallback(res.data);
|
||||||
|
}
|
||||||
|
this.dataListLoading = false;
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
).then(({ data: res }) => {
|
this.dataListLoading = false;
|
||||||
this.dataForm.username = ''
|
});
|
||||||
this.dataForm.deptId = ''
|
|
||||||
this.dataForm.postId = ''
|
|
||||||
this.dataForm.gender = ''
|
|
||||||
if (res.code !== 0) {
|
|
||||||
this.dataList = []
|
|
||||||
this.total = 0
|
|
||||||
return this.$message.error(res.msg)
|
|
||||||
}
|
|
||||||
this.dataList = this.mixinViewModuleOptions.getDataListIsPage ? res.data.list : res.data
|
|
||||||
this.total = this.mixinViewModuleOptions.getDataListIsPage ? res.data.total : 0
|
|
||||||
if (this.mixinViewModuleOptions.requestCallback) {
|
|
||||||
this.mixinViewModuleOptions.requestCallback(res.data)
|
|
||||||
}
|
|
||||||
this.dataListLoading = false
|
|
||||||
}).catch(() => {
|
|
||||||
this.dataListLoading = false
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
getPostList () {
|
getPostList() {
|
||||||
this.$http.get('/sys/post/list').then(({ data: res }) => {
|
this.$http
|
||||||
if (res.code !== 0) {
|
.get("/sys/post/list")
|
||||||
return this.$message.error(res.msg)
|
.then(({ data: res }) => {
|
||||||
}
|
if (res.code !== 0) {
|
||||||
this.postList = res.data
|
return this.$message.error(res.msg);
|
||||||
}).catch(() => {})
|
}
|
||||||
}
|
this.postList = res.data;
|
||||||
}
|
})
|
||||||
}
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in New Issue