Большой поиск
This commit is contained in:
1 parent
52b78f5fcb
commit
efe9b9eb43
3 files changed
+171
-6
No files matched your search
Binary file not shown.
@@ -0,0 +1,159 @@
|
|||||||
|
<template>
|
||||||
|
<v-card class="bg-white pa-3 px-0" width="550"
|
||||||
|
height="600">
|
||||||
|
|
||||||
|
<v-card
|
||||||
|
class="mx-auto overflow-auto mx-0 px-3"
|
||||||
|
width="550"
|
||||||
|
height="600"
|
||||||
|
flat
|
||||||
|
>
|
||||||
|
|
||||||
|
<v-card-title class="fixed-bar bg-white">
|
||||||
|
|
||||||
|
<v-row class="bggrad">
|
||||||
|
<v-col class="text-center text-black_and_white">
|
||||||
|
{{heading}}
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
<v-row>
|
||||||
|
<v-col class="pa-0 mb-3">
|
||||||
|
|
||||||
|
<v-textarea
|
||||||
|
v-model="searchname"
|
||||||
|
clearable
|
||||||
|
prepend-inner-icon="mdi-magnify"
|
||||||
|
hide-details
|
||||||
|
class="mx-0"
|
||||||
|
label="Поиск"
|
||||||
|
rows="1"
|
||||||
|
no-resize
|
||||||
|
/>
|
||||||
|
</v-col>
|
||||||
|
</v-row>
|
||||||
|
|
||||||
|
|
||||||
|
</v-card-title>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
<div
|
||||||
|
v-for="(x, key) in variable"
|
||||||
|
:key="key"
|
||||||
|
class="px-3" >
|
||||||
|
|
||||||
|
<v-list class="py-0">
|
||||||
|
<v-list-subheader>{{key}} </v-list-subheader>
|
||||||
|
</v-list>
|
||||||
|
|
||||||
|
<v-card
|
||||||
|
v-for="item in x"
|
||||||
|
:key="item"
|
||||||
|
|
||||||
|
class="bg-transparent"
|
||||||
|
density="compact"
|
||||||
|
:prepend-avatar="checkremote(`${spravURL}${item.login}.jpg`)"
|
||||||
|
:title="item.fio"
|
||||||
|
:subtitle="item.post"
|
||||||
|
variant="text"
|
||||||
|
@click="getcard(item.login)"
|
||||||
|
>
|
||||||
|
|
||||||
|
</v-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</v-card>
|
||||||
|
<v-divider/>
|
||||||
|
<v-card-actions class="align-self-end pb-0">
|
||||||
|
<v-btn
|
||||||
|
color="more_details_btn"
|
||||||
|
variant="text"
|
||||||
|
@click="onSubmit"
|
||||||
|
|
||||||
|
|
||||||
|
>
|
||||||
|
Закрыть
|
||||||
|
</v-btn>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { ref,watch } from 'vue'
|
||||||
|
import {checkremote} from '@/utils/universal_functions'
|
||||||
|
import { spravURL } from '@/utils/axios-api'
|
||||||
|
export default {
|
||||||
|
|
||||||
|
props: {
|
||||||
|
|
||||||
|
byDefault: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
variable: {
|
||||||
|
type: Object,
|
||||||
|
default: {}
|
||||||
|
},
|
||||||
|
heading: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
setup(props, context){
|
||||||
|
|
||||||
|
|
||||||
|
const searchname = ref('')
|
||||||
|
|
||||||
|
const onSubmit = () => {
|
||||||
|
context.emit('searchClose')
|
||||||
|
}
|
||||||
|
|
||||||
|
const filterItems = (query) => {
|
||||||
|
console.log(props.variable, '----------t_dailyRound.value');
|
||||||
|
|
||||||
|
|
||||||
|
props.variable={}
|
||||||
|
Object.keys(props.byDefault).map(el1 => {
|
||||||
|
let myarr = props.byDefault[el1].filter((el) =>el.fio.toLowerCase().includes(query.toLowerCase()))
|
||||||
|
|
||||||
|
if(myarr.length>0)
|
||||||
|
{
|
||||||
|
props.variable[el1] = myarr
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
watch(()=> searchname.value,(newValue,oldValue)=>{
|
||||||
|
|
||||||
|
if(newValue){
|
||||||
|
filterItems(newValue)
|
||||||
|
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
props.variable = JSON.parse(JSON.stringify(props.byDefault))
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}, {deep:true})
|
||||||
|
return {
|
||||||
|
onSubmit,
|
||||||
|
checkremote,
|
||||||
|
searchname,
|
||||||
|
spravURL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
|
||||||
|
</style>
|
||||||
@@ -76,7 +76,13 @@
|
|||||||
v-model="dialogDetailRound"
|
v-model="dialogDetailRound"
|
||||||
width="500"
|
width="500"
|
||||||
>
|
>
|
||||||
<v-card class="bg-white pa-3 px-0" width="550"
|
<dialog-search
|
||||||
|
:heading="t_dailyRound.position"
|
||||||
|
:byDefault="t_dailyRound.daily"
|
||||||
|
:variable="result"
|
||||||
|
@searchClose="dialogDetailRound=!dialogDetailRound"
|
||||||
|
/>
|
||||||
|
<!-- <v-card class="bg-white pa-3 px-0" width="550"
|
||||||
height="600">
|
height="600">
|
||||||
|
|
||||||
<v-card
|
<v-card
|
||||||
@@ -95,7 +101,7 @@ flat
|
|||||||
</v-row>
|
</v-row>
|
||||||
<v-row>
|
<v-row>
|
||||||
<v-col class="pa-0 mb-3">
|
<v-col class="pa-0 mb-3">
|
||||||
<!-- <my-helper :pretext="t_dailyRound.position"/> -->
|
|
||||||
<v-textarea
|
<v-textarea
|
||||||
v-model="searchname"
|
v-model="searchname"
|
||||||
clearable
|
clearable
|
||||||
@@ -152,7 +158,7 @@ class="px-3" >
|
|||||||
Закрыть
|
Закрыть
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-card-actions>
|
</v-card-actions>
|
||||||
</v-card>
|
</v-card> -->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -179,11 +185,13 @@ class="px-3" >
|
|||||||
import {checkremote} from '@/utils/universal_functions'
|
import {checkremote} from '@/utils/universal_functions'
|
||||||
import { spravURL } from '@/utils/axios-api'
|
import { spravURL } from '@/utils/axios-api'
|
||||||
import CardUsers from '@/components/cardUsers.vue'
|
import CardUsers from '@/components/cardUsers.vue'
|
||||||
|
import DialogSearch from './dialog-search.vue'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
|
||||||
components: {
|
components: {
|
||||||
CardUsers
|
CardUsers,
|
||||||
|
DialogSearch
|
||||||
},
|
},
|
||||||
|
|
||||||
setup(){
|
setup(){
|
||||||
@@ -209,8 +217,6 @@ export default {
|
|||||||
idpos.value=pos
|
idpos.value=pos
|
||||||
dialogDetailRound.value=!dialogDetailRound.value
|
dialogDetailRound.value=!dialogDetailRound.value
|
||||||
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then(data => {
|
axiosApiInstance.get(`api/general_vacation/dailyload/?id=${pos}`).then(data => {
|
||||||
console.log(data, '-------------------data');
|
|
||||||
|
|
||||||
t_dailyRound.value = data.data
|
t_dailyRound.value = data.data
|
||||||
|
|
||||||
result.value=JSON.parse(JSON.stringify(data.data.daily))
|
result.value=JSON.parse(JSON.stringify(data.data.daily))
|
||||||
|
|||||||
Reference in new issue
Block a user