fix: 🧩 修复测试bug
This commit is contained in:
@@ -37,6 +37,6 @@ export const getBannerListExportApi = (params: any) => {
|
||||
});
|
||||
};
|
||||
//分类
|
||||
export const getBannerClassListApi = () => {
|
||||
return http.get<any>(`/banner/list`); //v1/banner/list
|
||||
export const getBannerClassListApi = (params: any) => {
|
||||
return http.get<any>(`/banner/list`, params); //v1/banner/list
|
||||
};
|
||||
|
||||
@@ -26,6 +26,6 @@ export const getCategorySortApi = (params: any) => {
|
||||
return http.post<any>(`${ATT_C}/sort/${params.id}`, { sort: params.sort });
|
||||
};
|
||||
//下载分类下拉列表
|
||||
export const getCategorysApi = () => {
|
||||
return http.get<any>(`/attachment/categorys`);
|
||||
export const getCategorysApi = (params: any) => {
|
||||
return http.get<any>(`/attachment/categorys`, params);
|
||||
};
|
||||
|
||||
@@ -27,6 +27,6 @@ export const getVideoListExportApi = (params: any) => {
|
||||
});
|
||||
};
|
||||
//视频分类
|
||||
export const getVideoClassListApi = () => {
|
||||
return http.get<any>(`/video/categorys`);
|
||||
export const getVideoClassListApi = (params: any) => {
|
||||
return http.get<any>(`/video/categorys`, params);
|
||||
};
|
||||
|
||||
8
src/components.d.ts
vendored
8
src/components.d.ts
vendored
@@ -16,6 +16,11 @@ declare module "vue" {
|
||||
ElBreadcrumb: typeof import("element-plus/es")["ElBreadcrumb"];
|
||||
ElBreadcrumbItem: typeof import("element-plus/es")["ElBreadcrumbItem"];
|
||||
ElButton: typeof import("element-plus/es")["ElButton"];
|
||||
ElCarousel: typeof import("element-plus/es")["ElCarousel"];
|
||||
ElCarouselItem: typeof import("element-plus/es")["ElCarouselItem"];
|
||||
ElCheckbox: typeof import("element-plus/es")["ElCheckbox"];
|
||||
ElCheckboxGroup: typeof import("element-plus/es")["ElCheckboxGroup"];
|
||||
ElColorPicker: typeof import("element-plus/es")["ElColorPicker"];
|
||||
ElContainer: typeof import("element-plus/es")["ElContainer"];
|
||||
ElDatePicker: typeof import("element-plus/es")["ElDatePicker"];
|
||||
ElDialog: typeof import("element-plus/es")["ElDialog"];
|
||||
@@ -37,6 +42,7 @@ declare module "vue" {
|
||||
ElOption: typeof import("element-plus/es")["ElOption"];
|
||||
ElPagination: typeof import("element-plus/es")["ElPagination"];
|
||||
ElRadio: typeof import("element-plus/es")["ElRadio"];
|
||||
ElRadioButton: typeof import("element-plus/es")["ElRadioButton"];
|
||||
ElRadioGroup: typeof import("element-plus/es")["ElRadioGroup"];
|
||||
ElScrollbar: typeof import("element-plus/es")["ElScrollbar"];
|
||||
ElSelect: typeof import("element-plus/es")["ElSelect"];
|
||||
@@ -47,6 +53,8 @@ declare module "vue" {
|
||||
ElTabPane: typeof import("element-plus/es")["ElTabPane"];
|
||||
ElTabs: typeof import("element-plus/es")["ElTabs"];
|
||||
ElTag: typeof import("element-plus/es")["ElTag"];
|
||||
ElTooltip: typeof import("element-plus/es")["ElTooltip"];
|
||||
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"];
|
||||
|
||||
@@ -56,7 +56,7 @@ import { ElNotification, formContextKey, formItemContextKey } from "element-plus
|
||||
import type { UploadProps, UploadRequestOptions } from "element-plus";
|
||||
|
||||
interface UploadFileProps {
|
||||
imageUrl: string; // 图片地址 ==> 必传
|
||||
imageUrl: any; // 图片地址 ==> 必传
|
||||
api?: (params: any) => Promise<any>; // 上传图片的 api 方法,一般项目上传都是同一个 api 方法,在组件里直接引入即可 ==> 非必传
|
||||
drag?: boolean; // 是否支持拖拽上传 ==> 非必传(默认为 true)
|
||||
disabled?: boolean; // 是否禁用上传组件 ==> 非必传(默认为 false)
|
||||
|
||||
@@ -55,6 +55,22 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// prop: "is_show1",
|
||||
// placeholder: "",
|
||||
// type: "radio",
|
||||
// label: "是否启动: ",
|
||||
// options: [
|
||||
// {
|
||||
// label: "是",
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// label: "否",
|
||||
// value: 0
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
prop: "link",
|
||||
placeholder: "请输入",
|
||||
|
||||
@@ -57,7 +57,7 @@ const dataStore = reactive<any>({
|
||||
|
||||
//文章分类
|
||||
const getArticleClassData = async () => {
|
||||
const result = await getArticleClassDataApi();
|
||||
const result = await getArticleClassDataApi({ is_show: 1 });
|
||||
if (result?.code === 0) {
|
||||
const { data } = result;
|
||||
dataStore.editFormData[1].options = useSearchInfoArray(data);
|
||||
|
||||
@@ -60,7 +60,7 @@ const dataStore = reactive<any>({
|
||||
|
||||
//文章分类(搜索条件)
|
||||
const getArticleClassData = async () => {
|
||||
const result = await getArticleClassDataApi();
|
||||
const result = await getArticleClassDataApi({ is_show: 0 });
|
||||
if (result?.code === 0) {
|
||||
const { data } = result;
|
||||
dataStore.formData[1].options = useSearchInfoArray(data);
|
||||
@@ -80,10 +80,6 @@ const handleAdd = (type: any) => {
|
||||
|
||||
//导出接口
|
||||
const getArticleListExport = async () => {
|
||||
// searchParam,
|
||||
// searchInitParam,
|
||||
console.log(proTableRef?.value?.pageable, "===proTableRef?.value?.pageable==");
|
||||
console.log(proTableRef?.value?.searchParam, "=dataStore.initParam=");
|
||||
const result = await getArticleListExportApi({
|
||||
...proTableRef?.value?.searchParam,
|
||||
...proTableRef?.value?.pageable
|
||||
|
||||
@@ -50,12 +50,12 @@ export const COLUMNS = [
|
||||
width: 160
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
// {
|
||||
// align: "center",
|
||||
// label: "状态",
|
||||
// prop: "status",
|
||||
// width: 80
|
||||
// },
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
|
||||
@@ -49,6 +49,22 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
placeholder: "",
|
||||
type: "radio",
|
||||
label: "是否启动: ",
|
||||
options: [
|
||||
{
|
||||
label: "是",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: "否",
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: "image",
|
||||
type: "upImg",
|
||||
@@ -121,6 +137,22 @@ export const EDIT_FORM_DATA1: FormItem[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: "status",
|
||||
placeholder: "",
|
||||
type: "radio",
|
||||
label: "是否启动: ",
|
||||
options: [
|
||||
{
|
||||
label: "是",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: "否",
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
prop: "image",
|
||||
type: "upImg",
|
||||
|
||||
@@ -33,6 +33,11 @@ export const COLUMNS = [
|
||||
label: "添加时间",
|
||||
prop: "created_at"
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
|
||||
@@ -17,6 +17,11 @@
|
||||
<template #sort="scope">
|
||||
<el-input v-model="scope.row.sort" @blur="handleBlur(scope.row)" @input="handleInput(scope.row)"></el-input>
|
||||
</template>
|
||||
<template #status="scope">
|
||||
<el-tag :type="scope.row.status === 1 ? 'success' : 'danger'" effect="dark">{{
|
||||
scope.row.status === 1 ? "启用" : "禁用"
|
||||
}}</el-tag>
|
||||
</template>
|
||||
<template #operation="scope">
|
||||
<el-button size="small" type="primary" @click="getBannerRead(scope.row.id)">编辑</el-button>
|
||||
<el-button size="small" type="danger" @click="getBannerDel(scope.row.id)">删除</el-button>
|
||||
@@ -147,7 +152,7 @@ const buildTree = (data: any, outerLinkTo: any = "") => {
|
||||
};
|
||||
// let isFirstRequest = true;
|
||||
const handleRadioGroupEmits = (value: any) => {
|
||||
getBannerClassList();
|
||||
// getBannerClassList();
|
||||
if (value === "image") {
|
||||
dataStore.isFirstRequest = true;
|
||||
dataStore.editFormData = EDIT_FORM_DATA;
|
||||
@@ -184,6 +189,13 @@ const getSystemUrls = async (node: any, resolve: any) => {
|
||||
}
|
||||
}
|
||||
};
|
||||
const setImgOrVideo = () => {
|
||||
if (dataStore.editRuleForm.type === "image") {
|
||||
dataStore.editFormData = EDIT_FORM_DATA;
|
||||
} else {
|
||||
dataStore.editFormData = EDIT_FORM_DATA1;
|
||||
}
|
||||
};
|
||||
// 详情
|
||||
const getBannerRead = async (id: any) => {
|
||||
dataStore.title = "编辑Banner";
|
||||
@@ -191,6 +203,7 @@ const getBannerRead = async (id: any) => {
|
||||
const result = await getBannerReadApi(id);
|
||||
if (result?.code === 0) {
|
||||
dataStore.editRuleForm = result?.data;
|
||||
setImgOrVideo();
|
||||
if (dataStore.editRuleForm.link && dataStore.editRuleForm.link_to) {
|
||||
let { id, name, link } = dataStore.editRuleForm.link_echo_data;
|
||||
let obj: any = {
|
||||
@@ -239,18 +252,29 @@ const getBannerUp = async () => {
|
||||
|
||||
// 分类
|
||||
const getBannerClassList = async () => {
|
||||
const result = await getBannerClassListApi();
|
||||
const result = await getBannerClassListApi({ is_show: 0 });
|
||||
if (result?.code === 0) {
|
||||
let arr: any = [];
|
||||
result?.data?.forEach((item: any) => {
|
||||
arr.push({ value: item.id, label: item.name });
|
||||
});
|
||||
console.log(arr, "========arr===============");
|
||||
dataStore.formData[1].options = arr;
|
||||
dataStore.editFormData[4].options = arr;
|
||||
// dataStore.editFormData[4].options = arr;
|
||||
}
|
||||
};
|
||||
getBannerClassList();
|
||||
//详情里的分类
|
||||
const getBannerClassEditList = async () => {
|
||||
const result = await getBannerClassListApi({ is_show: 1 });
|
||||
if (result?.code === 0) {
|
||||
let arr: any = [];
|
||||
result?.data?.forEach((item: any) => {
|
||||
arr.push({ value: item.id, label: item.name });
|
||||
});
|
||||
dataStore.editFormData[4].options = arr;
|
||||
}
|
||||
};
|
||||
getBannerClassEditList();
|
||||
// 新增 getBannerListSave
|
||||
const getBannerListSave = async () => {
|
||||
const result = await getBannerListSaveApi(dataStore.editRuleForm);
|
||||
@@ -343,6 +367,21 @@ const handleBlur = (row: any) => {
|
||||
const handleInput = (row: any) => {
|
||||
row.sort = integerRexg(row.sort);
|
||||
};
|
||||
// watch(
|
||||
// () => dataStore.editRuleForm.type,
|
||||
// newVal => {
|
||||
// console.log(dataStore.editRuleForm.type);
|
||||
// if (newVal === "video") {
|
||||
// dataStore.editFormData = EDIT_FORM_DATA1;
|
||||
// } else {
|
||||
// dataStore.editFormData = EDIT_FORM_DATA;
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
// immediate: true,
|
||||
// deep: true
|
||||
// }
|
||||
// );
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
@@ -55,6 +55,22 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// prop: "is_show1",
|
||||
// placeholder: "",
|
||||
// type: "radio",
|
||||
// label: "是否启动: ",
|
||||
// options: [
|
||||
// {
|
||||
// label: "是",
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// label: "否",
|
||||
// value: 0
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
prop: "image",
|
||||
type: "upImg",
|
||||
|
||||
@@ -48,12 +48,12 @@ export const COLUMNS = [
|
||||
prop: "created_at"
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
// {
|
||||
// align: "center",
|
||||
// label: "状态",
|
||||
// prop: "status",
|
||||
// width: 80
|
||||
// },
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
|
||||
@@ -234,7 +234,7 @@ getAttachmentRead();
|
||||
|
||||
//分类
|
||||
const getCategorys = async () => {
|
||||
const result = await getCategorysApi();
|
||||
const result = await getCategorysApi({ is_show: 1 });
|
||||
|
||||
if (result?.code === 0) {
|
||||
let arr: any[] = [];
|
||||
|
||||
@@ -151,7 +151,7 @@ const handleInput = (row: any) => {
|
||||
row.sort = integerRexg(row.sort);
|
||||
};
|
||||
const getCategorys = async () => {
|
||||
const result = await getCategorysApi();
|
||||
const result = await getCategorysApi({ is_show: 0 });
|
||||
|
||||
if (result?.code === 0) {
|
||||
let arr: any[] = [];
|
||||
|
||||
@@ -49,12 +49,12 @@ export const COLUMNS = [
|
||||
prop: "created_at"
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
// {
|
||||
// align: "center",
|
||||
// label: "状态",
|
||||
// prop: "status",
|
||||
// width: 80
|
||||
// },
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
|
||||
@@ -59,7 +59,12 @@
|
||||
<el-radio :value="0" :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="是否启用" style="width: 440px">
|
||||
<el-radio-group v-model="_ruleFormParam.status">
|
||||
<el-radio :value="1" :label="1">是</el-radio>
|
||||
<el-radio :value="0" :label="0">否</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="SEO标题">
|
||||
<el-input v-model="_ruleFormParam.seo_title" style="width: 440px" />
|
||||
</el-form-item>
|
||||
|
||||
@@ -108,6 +108,24 @@ export const BASIC_INFO_FORM_DATA: FormItem[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
prop: "is_show1",
|
||||
placeholder: "",
|
||||
type: "radio",
|
||||
label: "是否启动: ",
|
||||
options: [
|
||||
{
|
||||
label: "是",
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: "否",
|
||||
value: 0
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
prop: "seo_title",
|
||||
placeholder: "请输入",
|
||||
|
||||
@@ -54,6 +54,22 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
||||
}
|
||||
]
|
||||
},
|
||||
// {
|
||||
// prop: "is_show1",
|
||||
// placeholder: "",
|
||||
// type: "radio",
|
||||
// label: "是否启动: ",
|
||||
// options: [
|
||||
// {
|
||||
// label: "是",
|
||||
// value: 1
|
||||
// },
|
||||
// {
|
||||
// label: "否",
|
||||
// value: 0
|
||||
// }
|
||||
// ]
|
||||
// },
|
||||
{
|
||||
prop: "desc",
|
||||
placeholder: "请输入",
|
||||
|
||||
@@ -48,12 +48,12 @@ export const COLUMNS = [
|
||||
prop: "created_at"
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
// {
|
||||
// align: "center",
|
||||
// label: "状态",
|
||||
// prop: "status",
|
||||
// width: 80
|
||||
// },
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
|
||||
@@ -125,7 +125,7 @@ const handleResetClick = () => {
|
||||
|
||||
//视频分类接口
|
||||
const getVideoClassList = async () => {
|
||||
const result = await getVideoClassListApi();
|
||||
const result = await getVideoClassListApi({ is_show: 0 });
|
||||
if (result?.code === 0) {
|
||||
let arr: any[] = [];
|
||||
if (result?.data?.length) {
|
||||
@@ -141,6 +141,25 @@ const getVideoClassList = async () => {
|
||||
}
|
||||
};
|
||||
getVideoClassList();
|
||||
|
||||
const getVideoClassEditList = async () => {
|
||||
const result = await getVideoClassListApi({ is_show: 1 });
|
||||
if (result?.code === 0) {
|
||||
let arr: any[] = [];
|
||||
if (result?.data?.length) {
|
||||
result?.data?.forEach((item: any) => {
|
||||
let obj = {
|
||||
value: item.id,
|
||||
label: item.name
|
||||
};
|
||||
arr.push(obj);
|
||||
});
|
||||
dataStore.editFormData[1].options = arr;
|
||||
}
|
||||
}
|
||||
};
|
||||
getVideoClassEditList();
|
||||
|
||||
//添加
|
||||
const handleAdd = () => {
|
||||
dataStore.visible = true;
|
||||
|
||||
@@ -49,12 +49,12 @@ export const COLUMNS = [
|
||||
prop: "created_at"
|
||||
},
|
||||
|
||||
{
|
||||
align: "center",
|
||||
label: "状态",
|
||||
prop: "status",
|
||||
width: 80
|
||||
},
|
||||
// {
|
||||
// align: "center",
|
||||
// label: "状态",
|
||||
// prop: "status",
|
||||
// width: 80
|
||||
// },
|
||||
|
||||
{ prop: "operation", label: "操作", fixed: "right", width: 200 }
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user