Commit b11275ca authored by 李鹏 's avatar 李鹏

bugfix

parent c50aacc8
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
<script setup> <script setup>
import { Search } from "@element-plus/icons-vue"; import { Search } from "@element-plus/icons-vue";
import { watch, nextTick, reactive, toRefs, ref, computed, onBeforeMount } from "vue"; import { watch, nextTick, reactive, toRefs, ref, computed, onBeforeMount } from "vue";
import { useRoute, useRouter } from "vue-router"; import { useRouter } from "vue-router";
import axios from "@/request/http.js"; import axios from "@/request/http.js";
import { topId } from "../helper.js"; import { topId } from "../helper.js";
import { ElMessage } from "element-plus"; import { ElMessage } from "element-plus";
...@@ -292,7 +292,6 @@ const filterClear = () => { ...@@ -292,7 +292,6 @@ const filterClear = () => {
changePage(1); changePage(1);
}; };
const router = useRouter();
const getTableRows = () => { const getTableRows = () => {
let params = { let params = {
...state.filter, ...state.filter,
...@@ -304,7 +303,10 @@ const getTableRows = () => { ...@@ -304,7 +303,10 @@ const getTableRows = () => {
}) })
.then((res) => { .then((res) => {
if (res.data.code == 200) { if (res.data.code == 200) {
state.tableRows = res.data.data || []; state.tableRows = (res.data.data || []).map((item) => ({
...item,
parent_classify_name: item.parent_id === topId ? "平台公开" : item.parent_classify_name,
}));
state.tableTotal = res.data.total; state.tableTotal = res.data.total;
} else { } else {
ElMessage.error(res.data.data); ElMessage.error(res.data.data);
...@@ -417,7 +419,7 @@ const editCurType = async (row) => { ...@@ -417,7 +419,7 @@ const editCurType = async (row) => {
state.formData = { state.formData = {
parent_id: data.parent_id === topId ? "topLevel" : data.parent_id, parent_id: data.parent_id === topId ? "topLevel" : data.parent_id,
classify_name: data.classify_name, classify_name: data.classify_name,
sort: data.sort, sort: data.sort === 0 ? "" : data.sort,
describe: data.describe, describe: data.describe,
is_active: data.is_active, is_active: data.is_active,
}; };
...@@ -436,6 +438,7 @@ const confirmForm = () => { ...@@ -436,6 +438,7 @@ const confirmForm = () => {
let params = { let params = {
...state.formData, ...state.formData,
parent_id: state.formData.parent_id !== "topLevel" ? state.formData.parent_id : "", parent_id: state.formData.parent_id !== "topLevel" ? state.formData.parent_id : "",
sort: state.formData.sort === "" ? undefined : state.formData.sort,
}; };
if (state.formDialogConfig.type === "update") { if (state.formDialogConfig.type === "update") {
params = { ...params, id: state.selectedRow.id }; params = { ...params, id: state.selectedRow.id };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment