fix: 🧩 修复测试bug
This commit is contained in:
@@ -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