初始化
This commit is contained in:
61
src/views/components/UserSelect/index.vue
Normal file
61
src/views/components/UserSelect/index.vue
Normal file
@@ -0,0 +1,61 @@
|
||||
<!-- 自定义用户输入(编号、账号) -->
|
||||
<template>
|
||||
<input-with-helper v-bind="$attrs" v-on="$listeners" v-model="childValue" dialogTitle="选择用户" dialogWidth="600px"
|
||||
:searchCriteria="[
|
||||
{ label: '工号', prop: 'userName' },
|
||||
{ label: '姓名', prop: 'nickName' },
|
||||
{ label: '部门', prop: 'deptName' },
|
||||
]" :columns="[
|
||||
{
|
||||
title: '工号',
|
||||
field: 'userName',
|
||||
align: 'center',
|
||||
sortable: true,
|
||||
},
|
||||
{ title: '姓名', field: 'nickName', sortable: true },
|
||||
{ title: '部门', field: 'deptName', sortable: true },
|
||||
]" :defaultSort="{
|
||||
field: 'userId',
|
||||
order: 'asc',
|
||||
}" :searchMethod="listUser" :valueProps="valueProps">
|
||||
</input-with-helper>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listUser } from "@/api/system/user";
|
||||
import InputWithHelper from "@/components/ValueHelper/index";
|
||||
|
||||
export default {
|
||||
name: "UserSelect",
|
||||
components: {
|
||||
InputWithHelper,
|
||||
},
|
||||
props: {
|
||||
value: null,
|
||||
valueProps: {
|
||||
type: Object,
|
||||
default: () => {
|
||||
return {
|
||||
value: "userId",
|
||||
label: "nickName",
|
||||
};
|
||||
},
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
//选择值
|
||||
childValue: this.value,
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
//父组件值变更
|
||||
value(val) {
|
||||
this.childValue = val;
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
listUser,
|
||||
},
|
||||
};
|
||||
</script>
|
||||
Reference in New Issue
Block a user