diff --git a/src/components.d.ts b/src/components.d.ts index 90278b2..207249a 100644 --- a/src/components.d.ts +++ b/src/components.d.ts @@ -7,11 +7,6 @@ export {} declare module "vue" { export interface GlobalComponents { - 403: typeof import("./components/ErrorMessage/403.vue")["default"]; - 404: typeof import("./components/ErrorMessage/404.vue")["default"]; - 500: typeof import("./components/ErrorMessage/500.vue")["default"]; - ColSetting: typeof import("./components/ProTable/components/ColSetting.vue")["default"]; - Editor: typeof import("./components/Editor/index.vue")["default"]; ElAside: typeof import("element-plus/es")["ElAside"]; ElAutocomplete: typeof import("element-plus/es")["ElAutocomplete"]; ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"]; @@ -58,10 +53,6 @@ declare module "vue" { ElTree: typeof import("element-plus/es")["ElTree"]; ElTreeSelect: typeof import("element-plus/es")["ElTreeSelect"]; ElUpload: typeof import("element-plus/es")["ElUpload"]; - Empty: typeof import("./components/ProTable/components/Empty.vue")["default"]; - FormTable: typeof import("./components/FormTable/index.vue")["default"]; - Grid: typeof import("./components/Grid/index.vue")["default"]; - GridItem: typeof import("./components/Grid/components/GridItem.vue")["default"]; IEpArrowDown: typeof import("~icons/ep/arrow-down")["default"]; IEpCircleClose: typeof import("~icons/ep/circle-close")["default"]; IEpFolderDelete: typeof import("~icons/ep/folder-delete")["default"]; @@ -69,19 +60,7 @@ declare module "vue" { IEpRemove: typeof import("~icons/ep/remove")["default"]; IEpSearch: typeof import("~icons/ep/search")["default"]; IEpSwitchButton: typeof import("~icons/ep/switch-button")["default"]; - ImportExcel: typeof import("./components/ImportExcel/index.vue")["default"]; - Loading: typeof import("./components/Loading/index.vue")["default"]; - Pagination: typeof import("./components/ProTable/components/Pagination.vue")["default"]; - ProTable: typeof import("./components/ProTable/index.vue")["default"]; RouterLink: typeof import("vue-router")["RouterLink"]; RouterView: typeof import("vue-router")["RouterView"]; - RulesForm: typeof import("./components/rulesForm/index.vue")["default"]; - SearchForm: typeof import("./components/SearchForm/index.vue")["default"]; - SearchFormItem: typeof import("./components/SearchForm/components/SearchFormItem.vue")["default"]; - TableColumn: typeof import("./components/ProTable/components/TableColumn.vue")["default"]; - UploadImg: typeof import("./components/Upload/UploadImg.vue")["default"]; - UploadImgs: typeof import("./components/Upload/UploadImgs.vue")["default"]; - UploadVideo: typeof import("./components/Upload/UploadVideo.vue")["default"]; - WangEditor: typeof import("./components/WangEditor/index.vue")["default"]; } } diff --git a/src/components/SearchForm/components/SearchFormItem.vue b/src/components/SearchForm/components/SearchFormItem.vue index e5bce98..375ae2d 100644 --- a/src/components/SearchForm/components/SearchFormItem.vue +++ b/src/components/SearchForm/components/SearchFormItem.vue @@ -72,10 +72,14 @@ v-model="_searchParam[`${item.prop}`]" :data="item.options" :placeholder="item.placeholder" + multiple :render-after-expand="false" + :check-strictly="false" show-checkbox style="width: 224px" clearable + :collapse-tags="true" + @change="handleTreeSelectChange(item)" /> @@ -178,7 +182,7 @@ const options = [ label: "数字序列号" } ]; - +// const treeSelectValue = ref(null); const props = defineProps(); const _searchParam = computed(() => props.searchParam); @@ -216,7 +220,14 @@ const remoteMethod = async (query: any, item: any) => { } loading.value = false; }; - +const handleTreeSelectChange = (item: any) => { + if (_searchParam.value[item.prop].length) { + let values = cloneDeep(_searchParam.value[item.prop]); + _searchParam.value[item.prop1] = values.join(","); + } else { + _searchParam.value[item.prop1] = ""; + } +}; const handleClear = (item: any) => { item.options = []; }; diff --git a/src/components/SearchForm/components/utils/verificationInput.ts b/src/components/SearchForm/components/utils/verificationInput.ts index 61e93a6..86d5b44 100644 --- a/src/components/SearchForm/components/utils/verificationInput.ts +++ b/src/components/SearchForm/components/utils/verificationInput.ts @@ -12,19 +12,19 @@ export const verificationInput = (item: any, _searchParam: any, selectInputValue //序列号区间值开始 限制只能输入正整数 if (startProp === "startNumber") { _searchParam.value[startProp] = integerNumber(_searchParam.value[startProp]); - if (selectInputValue === 1) { + if (selectInputValue == 1) { _searchParam.value["serialNumberBegin"] = _searchParam.value[startProp]; } - if (selectInputValue === 2) { + if (selectInputValue == 2) { _searchParam.value["numberCodeBegin"] = _searchParam.value[startProp]; } } if (endProp === "endNumber") { _searchParam.value[endProp] = integerNumber(_searchParam.value[endProp]); - if (selectInputValue === 1) { + if (selectInputValue == 1) { _searchParam.value["serialNumberEnd"] = _searchParam.value[endProp]; } - if (selectInputValue === 2) { + if (selectInputValue == 2) { _searchParam.value["numberCodeEnd"] = _searchParam.value[endProp]; } } diff --git a/src/components/SearchForm/index.scss b/src/components/SearchForm/index.scss index 8c2b554..05b5c7e 100644 --- a/src/components/SearchForm/index.scss +++ b/src/components/SearchForm/index.scss @@ -1,4 +1,5 @@ .el-form-item--default { + height: auto !important; margin-bottom: 8px; } .form-item { @@ -6,7 +7,7 @@ height: 32px; margin-right: 12px !important; .form-item-select { - width: 224px !important; + width: 254px !important; } } .form-box1 { diff --git a/src/hooks/useTable.ts b/src/hooks/useTable.ts index 243c108..15c7ac3 100644 --- a/src/hooks/useTable.ts +++ b/src/hooks/useTable.ts @@ -87,9 +87,10 @@ export const useTable = ( // 处理查询参数,可以给查询参数加自定义前缀操作 let nowSearchParam: Table.StateProps["searchParam"] = {}; // 防止手动清空输入框携带参数(这里可以自定义查询参数前缀) + console.log(state.searchParam, "=state.searchParam="); for (let key in state.searchParam) { //剔除日期参数 - if (key !== "Time" && key !== "Time1") { + if (key !== "Time" && key !== "Time1" && key !== "treeIds") { // * 某些情况下参数为 false/0 也应该携带参数 if (state.searchParam[key] || state.searchParam[key] === false || state.searchParam[key] === 0) { nowSearchParam[key] = state.searchParam[key]; diff --git a/src/styles/element.scss b/src/styles/element.scss index 02ed598..ee2d38f 100644 --- a/src/styles/element.scss +++ b/src/styles/element.scss @@ -97,6 +97,8 @@ // table-search 表格搜索样式 .table-search { + // height: auto; + // max-height: 80px; margin-bottom: 10px; .el-form { .el-form-item__content > * { diff --git a/src/views/articleManagement/class/index.vue b/src/views/articleManagement/class/index.vue index edf6702..7368f68 100644 --- a/src/views/articleManagement/class/index.vue +++ b/src/views/articleManagement/class/index.vue @@ -24,7 +24,7 @@ diff --git a/src/views/articleManagement/list/constant/search.ts b/src/views/articleManagement/list/constant/search.ts index 873d11e..c1fdbd4 100644 --- a/src/views/articleManagement/list/constant/search.ts +++ b/src/views/articleManagement/list/constant/search.ts @@ -1,5 +1,6 @@ interface FormItem { prop: string; + prop1?: string; label?: string; placeholder?: string; type: string; @@ -25,7 +26,8 @@ export const FORM_DATA: FormItem[] = [ }, { - prop: "category_id", + prop: "treeIds", + prop1: "category_id", placeholder: "请选择", type: "treeSelect", isArray: true, diff --git a/src/views/articleManagement/list/constant/table.ts b/src/views/articleManagement/list/constant/table.ts index 45d5ef9..e8f7a9f 100644 --- a/src/views/articleManagement/list/constant/table.ts +++ b/src/views/articleManagement/list/constant/table.ts @@ -49,12 +49,12 @@ export const COLUMNS = [ width: 160 }, - { - align: "center", - label: "状态", - prop: "enabled", - width: 80 - }, + // { + // align: "center", + // label: "状态", + // prop: "enabled", + // width: 80 + // }, { prop: "operation", label: "操作", fixed: "right", width: 200 } ]; diff --git a/src/views/articleManagement/list/index.vue b/src/views/articleManagement/list/index.vue index a5c8970..3c6d4c3 100644 --- a/src/views/articleManagement/list/index.vue +++ b/src/views/articleManagement/list/index.vue @@ -15,9 +15,9 @@ - +