YY 2 jaren geleden
bovenliggende
commit
cd713120df
3 gewijzigde bestanden met toevoegingen van 17 en 12 verwijderingen
  1. 6 2
      src/views/system/dict/detail.vue
  2. 10 9
      src/views/system/dict/index.vue
  3. 1 1
      vite.config.ts

+ 6 - 2
src/views/system/dict/detail.vue

@@ -41,7 +41,9 @@ import { ref, onMounted, getCurrentInstance, reactive } from 'vue'
 import { ElMessage } from 'element-plus'
 import { useRoute } from 'vue-router'
 import { DictDataStore } from '@common/src/stores/system/dictData' // 字典表
+import { DictTypeStore } from '@common/src/stores/system/dictType' // 字典表
 import type { IQueryResult } from '@/util/types.util'
+const dictType = DictTypeStore()
 const dictData = DictDataStore()
 const route = useRoute()
 const { proxy } = getCurrentInstance() as any
@@ -84,6 +86,7 @@ const rules = reactive<FormRules>({
 // 查询数据
 let searchForm: Ref<any> = ref({})
 let dict_type: Ref<any> = ref('')
+let dict_typeList: Ref<any> = ref([])
 
 onMounted(async () => {
   await searchOther()
@@ -103,11 +106,12 @@ const search = async (e: { skip: number; limit: number }) => {
 const toSearch = () => {
   search({ skip, limit })
 }
-const searchOther = () => {
+const searchOther = async () => {
   if (route.query.dict_type) dict_type.value = route.query.dict_type
   form.value.dict_type = dict_type.value
   searchForm.value.dict_type = dict_type.value
-  console.log(searchForm.value)
+  let res: IQueryResult = await dictType.query()
+  if (res.errcode == 0) dict_typeList.value = res.data as any[]
 }
 const toReset = () => {
   searchForm.value = { dict_type: route.query.dict_type }

+ 10 - 9
src/views/system/dict/index.vue

@@ -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 })
 }
 // 新增

+ 1 - 1
vite.config.ts

@@ -19,7 +19,7 @@ export default defineConfig(({ mode }) => {
         '/files': {
           target: 'http://broadcast.kqyjy.com'
         },
-        '/zkzx/v2/v1/api': {
+        '/zkzx/v2/api': {
           target: 'http://192.168.1.113:12001',
           changeOrigin: true,
           ws: false