|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { computed, defineOptions, nextTick, onBeforeMount, onMounted, reactive, ref, unref, watch } from 'vue'
|
|
|
|
|
import { debounce } from 'lodash-es'
|
|
|
|
|
import CustomFieldModalVue from '../modal/CustomFieldModal.vue'
|
|
|
|
|
import WorkSheetList from './WorkSheetList.vue'
|
|
|
|
|
import { useWindowSizeFn } from '@/hooks/event/useWindowSizeFn'
|
|
|
|
|
import { getViewportOffset } from '@/utils/domUtils'
|
|
|
|
|
import type { PackageListItem } from '/#/workorder'
|
|
|
|
|
import { useWorkOrder } from '@/store/modules/workOrder'
|
|
|
|
|
|
|
|
|
|
defineOptions({ name: 'AsideContent' })
|
|
|
|
@ -12,6 +12,7 @@ defineOptions({ name: 'AsideContent' })
|
|
|
|
|
const collapse = ref(false)
|
|
|
|
|
const workStore = useWorkOrder()
|
|
|
|
|
const filterModalRef = ref(null)
|
|
|
|
|
const packageListRef = ref<HTMLDivElement | null>(null)
|
|
|
|
|
|
|
|
|
|
function collapseHandler() {
|
|
|
|
|
collapse.value = !collapse.value
|
|
|
|
@ -54,18 +55,6 @@ onMounted(() => {
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const data = ref<PackageListItem[]>([])
|
|
|
|
|
|
|
|
|
|
const pagination = reactive({
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
onBeforeMount(async () => {
|
|
|
|
|
const orderList = await workStore.fetchOrderList(pagination)
|
|
|
|
|
data.value = orderList
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const asideEnter = ref(false)
|
|
|
|
|
|
|
|
|
|
const showCollapse = computed(() => {
|
|
|
|
@ -80,6 +69,16 @@ function showFilter() {
|
|
|
|
|
watch(() => workStore.immersion, () => {
|
|
|
|
|
collapse.value = true
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const showSearch = ref(false)
|
|
|
|
|
|
|
|
|
|
function setShowSearch(value: boolean) {
|
|
|
|
|
showSearch.value = value
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const inputHandler = debounce((word) => {
|
|
|
|
|
(packageListRef.value as any).search(word)
|
|
|
|
|
}, 500)
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
@ -90,16 +89,29 @@ watch(() => workStore.immersion, () => {
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="aside-header">
|
|
|
|
|
<div class="aside-header-left">
|
|
|
|
|
<svg-icon name="all-worksheet" size="32" />
|
|
|
|
|
<span style="margin-left: 8px;">所有工单</span>
|
|
|
|
|
<div v-show="!showSearch" class="warpper">
|
|
|
|
|
<div class="left">
|
|
|
|
|
<svg-icon name="all-worksheet" size="32" />
|
|
|
|
|
<span style="margin-left: 8px;">所有工单</span>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="right">
|
|
|
|
|
<SvgIcon
|
|
|
|
|
style="cursor: pointer;margin-left: 10px;" size="18" name="magnifying-1"
|
|
|
|
|
@click="setShowSearch(true)"
|
|
|
|
|
/>
|
|
|
|
|
<SvgIcon style="cursor: pointer;margin-left: 10px;" size="18" name="filter" @click="showFilter" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="aside-header-right">
|
|
|
|
|
<SvgIcon style="cursor: pointer;margin-left: 10px;" size="18" name="magnifying-1" />
|
|
|
|
|
<SvgIcon style="cursor: pointer;margin-left: 10px;" size="18" name="filter" @click="showFilter" />
|
|
|
|
|
<div v-show="showSearch" class="warpper">
|
|
|
|
|
<n-input style="flex: 1;height: 32px;" placeholder="请输入你需要搜索的内容" @input="inputHandler">
|
|
|
|
|
<template #suffix>
|
|
|
|
|
<SvgIcon size="14px" name="magnifying-1" />
|
|
|
|
|
</template>
|
|
|
|
|
</n-input>
|
|
|
|
|
<SvgIcon size="16px" style="margin-left: 6px;cursor: pointer;" name="clear" @click="setShowSearch(false)" />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<WorkSheetList :style="listStyle" class="work-sheet-list" :data="data" :active-id="workStore.getActiveId" />
|
|
|
|
|
<WorkSheetList ref="packageListRef" :style="listStyle" class="work-sheet-list" />
|
|
|
|
|
<CustomFieldModalVue ref="filterModalRef" />
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
@ -115,20 +127,23 @@ watch(() => workStore.immersion, () => {
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
&-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
padding: 12px 16px;
|
|
|
|
|
width: 100%;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
|
|
|
|
|
&-left {
|
|
|
|
|
.warpper {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.left {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-right {
|
|
|
|
|
.right {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
overflow: hidden;
|
|
|
|
@ -147,7 +162,7 @@ watch(() => workStore.immersion, () => {
|
|
|
|
|
height: 100%;
|
|
|
|
|
background: #507afd;
|
|
|
|
|
position: absolute;
|
|
|
|
|
right: 0;
|
|
|
|
|
right: -2px;
|
|
|
|
|
top: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|