广丰卷烟厂数采质量分析系统
zhuguifei
2026-03-02 80ff784bf60637cd348ae665fc907f7b1e527dd8
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<script setup lang="ts">
import { toRaw } from 'vue';
import { jsonClone } from '@sa/utils';
import { useNaiveForm } from '@/hooks/common/form';
import { useDict } from '@/hooks/business/dict';
import { $t } from '@/locales';
 
defineOptions({
  name: 'PostSearch'
});
 
interface Emits {
  (e: 'reset'): void;
  (e: 'search'): void;
}
 
const emit = defineEmits<Emits>();
 
const { formRef, validate, restoreValidation } = useNaiveForm();
 
const model = defineModel<Api.System.PostSearchParams>('model', { required: true });
 
const { options: sysCommonStatusOptions } = useDict('sys_normal_disable', false);
 
const defaultModel = jsonClone(toRaw(model.value));
 
function resetModel() {
  Object.assign(model.value, defaultModel);
}
 
async function reset() {
  await restoreValidation();
  resetModel();
  emit('reset');
}
 
async function search() {
  await validate();
  emit('search');
}
</script>
 
<template>
  <NCard :bordered="false" size="small" class="card-wrapper">
    <NCollapse>
      <NCollapseItem :title="$t('common.search')" name="user-search">
        <NForm ref="formRef" :model="model" label-placement="left" :label-width="80">
          <NGrid responsive="screen" item-responsive>
            <NFormItemGi span="24 s:12 m:6" label="岗位编码" path="postCode" class="pr-24px">
              <NInput v-model:value="model.postCode" placeholder="请输入岗位编码" />
            </NFormItemGi>
            <NFormItemGi span="24 s:12 m:6" label="岗位名称" path="postName" class="pr-24px">
              <NInput v-model:value="model.postName" placeholder="请输入岗位名称" />
            </NFormItemGi>
            <NFormItemGi span="24 s:12 m:6" label="状态" path="status" class="pr-24px">
              <NSelect
                v-model:value="model.status"
                placeholder="请选择状态"
                :options="sysCommonStatusOptions"
                clearable
              />
            </NFormItemGi>
            <NFormItemGi span="24 s:12 m:6" class="pr-24px">
              <NSpace class="w-full" justify="end">
                <NButton @click="reset">
                  <template #icon>
                    <icon-ic-round-refresh class="text-icon" />
                  </template>
                  {{ $t('common.reset') }}
                </NButton>
                <NButton type="primary" ghost @click="search">
                  <template #icon>
                    <icon-ic-round-search class="text-icon" />
                  </template>
                  {{ $t('common.search') }}
                </NButton>
              </NSpace>
            </NFormItemGi>
          </NGrid>
        </NForm>
      </NCollapseItem>
    </NCollapse>
  </NCard>
</template>
 
<style scoped></style>