mirror of
				https://github.com/pure-admin/pure-admin-thin.git
				synced 2025-11-04 09:34:49 +08:00 
			
		
		
		
	fix: 规范字典的命名
This commit is contained in:
		
							parent
							
								
									4ebdfd21c4
								
							
						
					
					
						commit
						7ff4936570
					
				@ -48,7 +48,9 @@ defineExpose({ getFormRuleRef });
 | 
			
		||||
        class="!w-[180px]"
 | 
			
		||||
      >
 | 
			
		||||
        <el-option
 | 
			
		||||
          v-for="dict in useUserStoreHook().dictionaryList['sys_notice_type']"
 | 
			
		||||
          v-for="dict in useUserStoreHook().dictionaryList[
 | 
			
		||||
            'sysNotice.noticeType'
 | 
			
		||||
          ]"
 | 
			
		||||
          :key="dict.value"
 | 
			
		||||
          :label="dict.label"
 | 
			
		||||
          :value="dict.value"
 | 
			
		||||
@ -63,7 +65,7 @@ defineExpose({ getFormRuleRef });
 | 
			
		||||
        class="!w-[180px]"
 | 
			
		||||
      >
 | 
			
		||||
        <el-option
 | 
			
		||||
          v-for="dict in useUserStoreHook().dictionaryList['sys_notice_status']"
 | 
			
		||||
          v-for="dict in useUserStoreHook().dictionaryList['sysNotice.status']"
 | 
			
		||||
          :key="dict.value"
 | 
			
		||||
          :label="dict.label"
 | 
			
		||||
          :value="dict.value"
 | 
			
		||||
 | 
			
		||||
@ -18,7 +18,8 @@ defineOptions({
 | 
			
		||||
  name: "SystemNotice"
 | 
			
		||||
});
 | 
			
		||||
 | 
			
		||||
const sys_notice_type = useUserStoreHook().dictionaryList["sys_notice_type"];
 | 
			
		||||
const noticeTypeList =
 | 
			
		||||
  useUserStoreHook().dictionaryList["sysNotice.noticeType"];
 | 
			
		||||
const tableRef = ref();
 | 
			
		||||
 | 
			
		||||
const searchFormRef = ref();
 | 
			
		||||
@ -66,7 +67,7 @@ const {
 | 
			
		||||
          class="!w-[180px]"
 | 
			
		||||
        >
 | 
			
		||||
          <el-option
 | 
			
		||||
            v-for="dict in sys_notice_type"
 | 
			
		||||
            v-for="dict in noticeTypeList"
 | 
			
		||||
            :key="dict.value"
 | 
			
		||||
            :label="dict.label"
 | 
			
		||||
            :value="dict.value"
 | 
			
		||||
@ -92,7 +93,7 @@ const {
 | 
			
		||||
        </el-button>
 | 
			
		||||
        <el-button
 | 
			
		||||
          :icon="useRenderIcon(Refresh)"
 | 
			
		||||
          @click="resetForm(searchFormRef)"
 | 
			
		||||
          @click="resetForm(searchFormRef, tableRef)"
 | 
			
		||||
        >
 | 
			
		||||
          重置
 | 
			
		||||
        </el-button>
 | 
			
		||||
@ -130,6 +131,7 @@ const {
 | 
			
		||||
          adaptive
 | 
			
		||||
          :data="dataList"
 | 
			
		||||
          :columns="dynamicColumns"
 | 
			
		||||
          :default-sort="{ prop: 'createTime', order: 'descending' }"
 | 
			
		||||
          :pagination="pagination"
 | 
			
		||||
          :paginationSmall="size === 'small' ? true : false"
 | 
			
		||||
          :header-cell-style="{
 | 
			
		||||
 | 
			
		||||
@ -15,9 +15,8 @@ import {
 | 
			
		||||
import { reactive, ref, onMounted, h, toRaw } from "vue";
 | 
			
		||||
import { useUserStoreHook } from "@/store/modules/user";
 | 
			
		||||
 | 
			
		||||
const sysNoticeTypeMap = useUserStoreHook().dictionaryMap["sys_notice_type"];
 | 
			
		||||
const sysNoticeStatusMap =
 | 
			
		||||
  useUserStoreHook().dictionaryMap["sys_notice_status"];
 | 
			
		||||
const noticeTypeMap = useUserStoreHook().dictionaryMap["sysNotice.noticeType"];
 | 
			
		||||
const noticeStatusMap = useUserStoreHook().dictionaryMap["sysNotice.status"];
 | 
			
		||||
 | 
			
		||||
export function useNoticeHook() {
 | 
			
		||||
  const pagination = reactive<PaginationProps>({
 | 
			
		||||
@ -63,10 +62,10 @@ export function useNoticeHook() {
 | 
			
		||||
      cellRenderer: ({ row, props }) => (
 | 
			
		||||
        <el-tag
 | 
			
		||||
          size={props.size}
 | 
			
		||||
          type={sysNoticeTypeMap[row.noticeType].cssTag}
 | 
			
		||||
          type={noticeTypeMap[row.noticeType].cssTag}
 | 
			
		||||
          effect="plain"
 | 
			
		||||
        >
 | 
			
		||||
          {sysNoticeTypeMap[row.noticeType].label}
 | 
			
		||||
          {noticeTypeMap[row.noticeType].label}
 | 
			
		||||
        </el-tag>
 | 
			
		||||
      )
 | 
			
		||||
    },
 | 
			
		||||
@ -77,10 +76,10 @@ export function useNoticeHook() {
 | 
			
		||||
      cellRenderer: ({ row, props }) => (
 | 
			
		||||
        <el-tag
 | 
			
		||||
          size={props.size}
 | 
			
		||||
          type={sysNoticeStatusMap[row.status].cssTag}
 | 
			
		||||
          type={noticeStatusMap[row.status].cssTag}
 | 
			
		||||
          effect="plain"
 | 
			
		||||
        >
 | 
			
		||||
          {sysNoticeStatusMap[row.status].label}
 | 
			
		||||
          {noticeStatusMap[row.status].label}
 | 
			
		||||
        </el-tag>
 | 
			
		||||
      )
 | 
			
		||||
    },
 | 
			
		||||
@ -213,9 +212,13 @@ export function useNoticeHook() {
 | 
			
		||||
    }, 500);
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  const resetForm = formEl => {
 | 
			
		||||
  const resetForm = (formEl, tableRef) => {
 | 
			
		||||
    if (!formEl) return;
 | 
			
		||||
    formEl.resetFields();
 | 
			
		||||
    searchFormParams.orderColumn = "";
 | 
			
		||||
    searchFormParams.orderDirection = "";
 | 
			
		||||
 | 
			
		||||
    tableRef.getTableRef().clearSort();
 | 
			
		||||
    onSearch();
 | 
			
		||||
  };
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user