|
|
@@ -1,20 +1,21 @@
|
|
|
<template>
|
|
|
<view class="query-form-header" @click="toggleFilter">
|
|
|
- <text class="query-title">查询条件</text>
|
|
|
- <text class="query-arrow">{{ isOpen ? '▲' : '▼' }}</text>
|
|
|
+ <text class="query-title">查询</text>
|
|
|
+ <image class="arrow-icon" :src="iconMap.ArrowDown" :class="{ 'arrow-rotate': isOpen }" />
|
|
|
</view>
|
|
|
<view class="query-form" :style="contentStyle">
|
|
|
- <view class="form-item">
|
|
|
- <text class="form-label">设备类别</text>
|
|
|
- <wd-picker
|
|
|
- v-model="selectedTypeValue"
|
|
|
- :columns="equipmentTypesColumn"
|
|
|
- @change="onTypeChange"
|
|
|
- />
|
|
|
- </view>
|
|
|
+ <EquipTypeCom
|
|
|
+ ref="equipTypeRef"
|
|
|
+ title="设备类别:"
|
|
|
+ type="type"
|
|
|
+ :columns="equipmentTypes"
|
|
|
+ :text-style="{ width: '100px' }"
|
|
|
+ :style="{ marginLeft: 0 }"
|
|
|
+ @change="handleEquipTypeChange"
|
|
|
+ />
|
|
|
<InputCom
|
|
|
ref="equipNameRef"
|
|
|
- title="设备名称"
|
|
|
+ title="设备名称:"
|
|
|
type="equipName"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
@@ -23,7 +24,7 @@
|
|
|
/>
|
|
|
<InputCom
|
|
|
ref="equipCodeRef"
|
|
|
- title="设备注册代码"
|
|
|
+ title="设备注册代码:"
|
|
|
type="equipCode"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
@@ -32,7 +33,7 @@
|
|
|
/>
|
|
|
<InputCom
|
|
|
ref="productNoRef"
|
|
|
- title="出厂编号"
|
|
|
+ title="出厂编号:"
|
|
|
type="productNo"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
@@ -41,7 +42,7 @@
|
|
|
/>
|
|
|
<InputCom
|
|
|
ref="unitNameRef"
|
|
|
- title="使用单位"
|
|
|
+ title="使用单位:"
|
|
|
type="unitName"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
@@ -50,7 +51,7 @@
|
|
|
/>
|
|
|
<InputCom
|
|
|
ref="unitInnerNoRef"
|
|
|
- title="单位内编号"
|
|
|
+ title="单位内编号:"
|
|
|
type="unitInnerNo"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
@@ -59,7 +60,7 @@
|
|
|
/>
|
|
|
<InputCom
|
|
|
ref="useRegisterNoRef"
|
|
|
- title="使用证编号"
|
|
|
+ title="使用证编号:"
|
|
|
type="useRegisterNo"
|
|
|
:text-style="{ width: '100px', textAlign: 'right' }"
|
|
|
:style="{ marginLeft: 0 }"
|
|
|
@@ -76,6 +77,8 @@
|
|
|
<script lang="ts" setup>
|
|
|
import { ref, reactive, computed } from 'vue'
|
|
|
import { InputCom } from '@/components/QueryViewItem'
|
|
|
+import { EquipTypeCom } from '@/components/QueryViewItem'
|
|
|
+import iconMap from '@/utils/imagesMap'
|
|
|
|
|
|
const emit = defineEmits<{
|
|
|
queryAction: [params: Record<string, any>]
|
|
|
@@ -93,25 +96,22 @@ const params = reactive({
|
|
|
useRegisterNo: '',
|
|
|
})
|
|
|
|
|
|
-const selectedType = ref<any>(null)
|
|
|
-const selectedTypeValue = ref('')
|
|
|
-const equipmentTypes = ref([
|
|
|
+const equipmentTypes = [
|
|
|
{ label: '全部', value: '' },
|
|
|
{ label: '压力容器', value: '1' },
|
|
|
{ label: '锅炉', value: '2' },
|
|
|
{ label: '管道', value: '3' },
|
|
|
-])
|
|
|
-const equipmentTypesColumn = computed(() => [
|
|
|
- equipmentTypes.value.map((item) => ({ label: item.label, value: item.value })),
|
|
|
-])
|
|
|
+]
|
|
|
|
|
|
const contentStyle = computed(() => ({
|
|
|
height: isOpen.value ? 'auto' : '0',
|
|
|
opacity: isOpen.value ? 1 : 0,
|
|
|
+ padding: isOpen.value ? '15px' : '0',
|
|
|
overflow: 'hidden',
|
|
|
- transition: 'all 0.3s',
|
|
|
+ transition: 'all 0.5s',
|
|
|
}))
|
|
|
|
|
|
+const equipTypeRef = ref<any>(null)
|
|
|
const equipNameRef = ref<any>(null)
|
|
|
const equipCodeRef = ref<any>(null)
|
|
|
const productNoRef = ref<any>(null)
|
|
|
@@ -123,11 +123,8 @@ const toggleFilter = () => {
|
|
|
isOpen.value = !isOpen.value
|
|
|
}
|
|
|
|
|
|
-const onTypeChange = ({ selected }: { selected: number[] }) => {
|
|
|
- const index = selected[0]
|
|
|
- selectedType.value = equipmentTypes.value[index]
|
|
|
- params.type = selectedType.value?.value || ''
|
|
|
- selectedTypeValue.value = selectedType.value?.value || ''
|
|
|
+const handleEquipTypeChange = (value: string | number) => {
|
|
|
+ params.type = value as string
|
|
|
}
|
|
|
|
|
|
const handleChange = (propName: string, value: string) => {
|
|
|
@@ -142,9 +139,8 @@ const handleReset = () => {
|
|
|
params.unitName = ''
|
|
|
params.unitInnerNo = ''
|
|
|
params.useRegisterNo = ''
|
|
|
- selectedType.value = null
|
|
|
- selectedTypeValue.value = ''
|
|
|
|
|
|
+ equipTypeRef.value?.reset()
|
|
|
equipNameRef.value?.reset()
|
|
|
equipCodeRef.value?.reset()
|
|
|
productNoRef.value?.reset()
|
|
|
@@ -176,8 +172,8 @@ defineExpose({
|
|
|
}
|
|
|
|
|
|
.query-title {
|
|
|
- font-size: 14px;
|
|
|
- color: #333;
|
|
|
+ font-size: 16px;
|
|
|
+ color: rgb(51, 51, 51);
|
|
|
}
|
|
|
|
|
|
.query-arrow {
|
|
|
@@ -186,26 +182,10 @@ defineExpose({
|
|
|
}
|
|
|
|
|
|
.query-form {
|
|
|
- padding: 15px;
|
|
|
background-color: #fff;
|
|
|
border-bottom: 1px solid #eee;
|
|
|
}
|
|
|
|
|
|
-.form-item {
|
|
|
- display: flex;
|
|
|
- flex-direction: row;
|
|
|
- align-items: center;
|
|
|
- margin-bottom: 12px;
|
|
|
-}
|
|
|
-
|
|
|
-.form-label {
|
|
|
- width: 100px;
|
|
|
- font-size: 14px;
|
|
|
- color: #666;
|
|
|
- text-align: right;
|
|
|
- margin-right: 5px;
|
|
|
-}
|
|
|
-
|
|
|
.form-actions {
|
|
|
display: flex;
|
|
|
flex-direction: row;
|
|
|
@@ -233,4 +213,14 @@ defineExpose({
|
|
|
color: #fff;
|
|
|
background-color: #2f8eff;
|
|
|
}
|
|
|
+
|
|
|
+.arrow-icon {
|
|
|
+ width: 21px;
|
|
|
+ height: 21px;
|
|
|
+ transition: transform 0.3s;
|
|
|
+}
|
|
|
+
|
|
|
+.arrow-rotate {
|
|
|
+ transform: rotate(180deg);
|
|
|
+}
|
|
|
</style>
|