1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<template>
<CellWrapper title="快速查询" :cellContentHeight="cellContentHeight">
<template v-slot:header>
<span class="el-icon-setting" title="设置" @click="openSetting"></span>
</template>
<quick
ref="quick"
quickType="search"
:cellContentHeight="cellContentHeight"
></quick>
</CellWrapper>
</template>
<script>
import CellWrapper from "../common/CellWrapper.vue";
import quick from "../common/quick.vue";
import defaultQuickSearchItems from "../common/defaultQuickSearchItems.js";
export default {
name: "QuickSearch",
components: { CellWrapper, quick },
props: {
cellContentHeight: {
type: Number,
required: true,
},
},
created() {
const admin = localStorage.getItem("quick-search-admin");
if (!admin) {
localStorage.setItem(
"quick-search-admin",
JSON.stringify(defaultQuickSearchItems.admin)
);
}
const normal = localStorage.getItem("quick-search-normal");
if (!normal) {
localStorage.setItem(
"quick-search-normal",
JSON.stringify(defaultQuickSearchItems.normal)
);
}
},
methods: {
openSetting() {
this.$refs.quick.openSetting();
},
},
};
</script>
<style scoped></style>