fix: 🧩 修复bug
This commit is contained in:
@@ -27,7 +27,7 @@ export const EDIT_FORM_DATA: FormItem[] = [
|
||||
},
|
||||
|
||||
{
|
||||
prop: "category_id",
|
||||
prop: "category_id1",
|
||||
placeholder: "请选择",
|
||||
type: "select",
|
||||
label: "下载分类: ",
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
export const RULES = {
|
||||
name: [{ required: true, message: "下载名称不能为空 ! ", trigger: "blur" }],
|
||||
category_id: [{ required: true, message: "下载分类不能为空 ! ", trigger: "blur" }],
|
||||
category_id1: [{ required: true, message: "下载分类不能为空 ! ", trigger: "blur" }],
|
||||
sort: [{ required: true, message: "下载排序不能为空 ! ", trigger: "blur" }]
|
||||
};
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
:formData="dataStore.editFormData"
|
||||
:rules="dataStore.rules"
|
||||
ref="formRef"
|
||||
@handleSelectChangeEmits="handleSelectChangeEmits"
|
||||
>
|
||||
<el-button type="primary" size="small" style="margin-bottom: 10px" @click="handleEditAdd">添加行</el-button>
|
||||
<FormTable :columns="dataStore.editColumns" :tableData="dataStore.editTableData" :height="200">
|
||||
@@ -228,10 +229,20 @@ const getAttachmentRead = async () => {
|
||||
if (result?.code === 0) {
|
||||
dataStore.editRuleForm = result?.data;
|
||||
dataStore.editTableData = result?.data.attach;
|
||||
|
||||
let is = dataStore.editFormData[1].options.some((item: any) => {
|
||||
console.log(item.id);
|
||||
console.log(dataStore.editRuleForm.category_id);
|
||||
return item.value == dataStore.editRuleForm.category_id;
|
||||
});
|
||||
dataStore.editRuleForm.category_id1 = is ? dataStore.editRuleForm.category_id : dataStore.editRuleForm.category_name;
|
||||
}
|
||||
};
|
||||
getAttachmentRead();
|
||||
|
||||
const handleSelectChangeEmits = (value: any) => {
|
||||
console.log(value, "========value=========");
|
||||
dataStore.editRuleForm.category_id = value.id;
|
||||
};
|
||||
//分类
|
||||
const getCategorys = async () => {
|
||||
const result = await getCategorysApi({ is_show: 1 });
|
||||
|
||||
@@ -151,7 +151,7 @@ const handleInput = (row: any) => {
|
||||
row.sort = integerRexg(row.sort);
|
||||
};
|
||||
const getCategorys = async () => {
|
||||
const result = await getCategorysApi({ is_show: 0 });
|
||||
const result = await getCategorysApi();
|
||||
|
||||
if (result?.code === 0) {
|
||||
let arr: any[] = [];
|
||||
|
||||
@@ -47,7 +47,7 @@ const dataStore = reactive<any>({
|
||||
});
|
||||
//分类列表
|
||||
const getCategorys = async () => {
|
||||
const result = await getCategorysApi();
|
||||
const result = await getCategorysApi({ is_show: 0 });
|
||||
|
||||
if (result?.code === 0) {
|
||||
let arr: any[] = [];
|
||||
|
||||
Reference in New Issue
Block a user