<template>
|
<CompInfoSearch
|
label="监管用户"
|
placeholder="输入用户名称"
|
@search="searchSVUser"
|
>
|
<template #selected="{ row }">
|
<div>
|
<el-text>编号:{{ row?.svUserId }}</el-text>
|
</div>
|
<el-space>
|
<el-text>名称:{{ row?.svUserName }}</el-text>
|
<el-button
|
v-show="row?.svUserName"
|
type="primary"
|
icon="DocumentCopy"
|
text
|
circle
|
@click="copySVUser(row?.svUserName)"
|
/>
|
</el-space>
|
</template>
|
<template #default="{ row, click }">
|
<ItemUser :item="row" @add="selectSVUser(row, click)" />
|
</template>
|
</CompInfoSearch>
|
</template>
|
<script setup>
|
import CompInfoSearch from './CompInfoSearch.vue';
|
import { useCloned } from '@vueuse/core';
|
import svUserApi from '@/api/fysp/userApi';
|
|
const props = defineProps({
|
// 检索范围(包含行政区划、场景类型)
|
area: Object
|
});
|
|
// 查询监管用户
|
function searchSVUser(param, callback) {
|
const { text, page, pageSize } = param;
|
const { cloned: area } = useCloned(props.area);
|
area.value.sceneName = text;
|
return svUserApi
|
.searchUser(area.value, text, page, pageSize)
|
.then((res) => {
|
if (res.success) {
|
const l = res.data.map((value) => {
|
return {
|
...value,
|
district: value.remark
|
};
|
});
|
callback({
|
data: l,
|
total: res.head.totalCount
|
});
|
}
|
})
|
.finally(() => {
|
callback();
|
});
|
}
|
|
function selectSVUser(row, click) {
|
const p = {
|
svUserId: row.guid,
|
svUserName: row.realname,
|
...row
|
};
|
click(p);
|
}
|
</script>
|