|
@@ -3,7 +3,11 @@
|
|
|
<el-row>
|
|
|
<el-col :span="24" class="main animate__animated animate__backInRight">
|
|
|
<el-col :span="24" class="one">
|
|
|
- <component :is="search1" :form="searchForm" @onSubmit="toSearch" @toReset="toReset"></component>
|
|
|
+ <cSearch :is_title="false" :is_search="true" :fields="fields" @search="toSearch">
|
|
|
+ <template #dict_type>
|
|
|
+ <el-input v-model="searchForm.dict_type" placeholder="请输入字典类型"></el-input>
|
|
|
+ </template>
|
|
|
+ </cSearch>
|
|
|
</el-col>
|
|
|
<el-col :span="24" class="two">
|
|
|
<cButton @toAdd="toAdd()"> </cButton>
|
|
@@ -33,7 +37,7 @@
|
|
|
</template>
|
|
|
<script lang="ts" setup>
|
|
|
import _ from 'lodash'
|
|
|
-import search1 from './parts/search-1.vue'
|
|
|
+// import search1 from './parts/search-1.vue'
|
|
|
import type { FormRules } from 'element-plus'
|
|
|
import type { Ref } from 'vue'
|
|
|
import { ref, onMounted, getCurrentInstance, reactive } from 'vue'
|
|
@@ -52,7 +56,7 @@ let skip = 0
|
|
|
let limit: number = proxy.$limit
|
|
|
// 列表
|
|
|
let fields: Ref<any[]> = ref([
|
|
|
- { label: '字典名称', model: 'dict_name' },
|
|
|
+ { label: '字典名称', model: 'dict_name', isSearch: true },
|
|
|
{ label: '字典类型', model: 'dict_type', custom: true },
|
|
|
{ label: '状态', model: 'status', format: (i) => (i == '0' ? '正常' : '停用') },
|
|
|
{ label: '备注', model: 'remark' }
|
|
@@ -81,7 +85,7 @@ const rules = reactive<FormRules>({
|
|
|
})
|
|
|
|
|
|
// 查询数据
|
|
|
-let searchForm: Ref<{}> = ref({})
|
|
|
+let searchForm: Ref<any> = ref({})
|
|
|
|
|
|
onMounted(async () => {
|
|
|
await search({ skip, limit })
|
|
@@ -97,11 +101,8 @@ const search = async (e: { skip: number; limit: number }) => {
|
|
|
total.value = res.total
|
|
|
}
|
|
|
}
|
|
|
-const toSearch = () => {
|
|
|
- search({ skip, limit })
|
|
|
-}
|
|
|
-const toReset = () => {
|
|
|
- searchForm.value = {}
|
|
|
+const toSearch = (query) => {
|
|
|
+ searchForm.value = query
|
|
|
search({ skip, limit })
|
|
|
}
|
|
|
// 新增
|