|
@@ -4,7 +4,7 @@
|
|
:type="data.type"
|
|
:type="data.type"
|
|
:data-list="data.dataList"
|
|
:data-list="data.dataList"
|
|
:show-more="data.showMore"
|
|
:show-more="data.showMore"
|
|
- v-if="data.type !== '0' && isShowType(data)"
|
|
|
|
|
|
+ v-if="isShowType(data) && data.type !== '0'"
|
|
:index="i"
|
|
:index="i"
|
|
@handle-see-more="handleSeeMore"
|
|
@handle-see-more="handleSeeMore"
|
|
>
|
|
>
|
|
@@ -24,7 +24,7 @@
|
|
</template>
|
|
</template>
|
|
</context-contain>
|
|
</context-contain>
|
|
</div>
|
|
</div>
|
|
- <div class="bottom-btn" v-if="reqParams.type === '5' && isAddStatus">
|
|
|
|
|
|
+ <div class="bottom-btn" v-if="reqParams!.type! === '5' && isAddStatus">
|
|
<data-button
|
|
<data-button
|
|
@handle-emit="router.push('/database/add')"
|
|
@handle-emit="router.push('/database/add')"
|
|
backgroundColor="#FF5B00"
|
|
backgroundColor="#FF5B00"
|
|
@@ -35,46 +35,60 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
<script setup lang="ts">
|
|
-import { computed, ref, watch, onMounted } from "vue";
|
|
|
|
|
|
+//import { computed, ref, watch, onMounted } from "vue";
|
|
|
|
+//import contextContain from "../components/context-contain.vue";
|
|
|
|
+//import { DDataBaseListAll, DetailParams, tabList } from "@/types/views/database.type";
|
|
|
|
+//import contextHead from "../components/context-head.vue";
|
|
|
|
+//import contextShare from "../components/context-share.vue";
|
|
|
|
+//import { useRouter, useRoute, LocationQueryValue } from "vue-router";
|
|
|
|
+//import { getArchiveList } from "@/api/context/context";
|
|
|
|
+//import { IArchiveRequest } from "@/types/api/context.type";
|
|
|
|
+import { ref, watch, onMounted } from "vue";
|
|
import contextContain from "../components/context-contain.vue";
|
|
import contextContain from "../components/context-contain.vue";
|
|
import { DDataBaseListAll, DetailParams, tabList } from "@/types/views/database.type";
|
|
import { DDataBaseListAll, DetailParams, tabList } from "@/types/views/database.type";
|
|
import contextHead from "../components/context-head.vue";
|
|
import contextHead from "../components/context-head.vue";
|
|
import contextShare from "../components/context-share.vue";
|
|
import contextShare from "../components/context-share.vue";
|
|
-import { useRouter, useRoute, LocationQueryValue } from "vue-router";
|
|
|
|
|
|
+import { useRouter } from "vue-router";
|
|
import { getArchiveList } from "@/api/context/context";
|
|
import { getArchiveList } from "@/api/context/context";
|
|
-import { IArchiveRequest } from "@/types/api/context.type";
|
|
|
|
import { useUserInfoState } from "@/store/user/user";
|
|
import { useUserInfoState } from "@/store/user/user";
|
|
import { myDecrypt } from "@/util/authStorage";
|
|
import { myDecrypt } from "@/util/authStorage";
|
|
import useWeChatShare from "@/Hooks/useWeChatShare";
|
|
import useWeChatShare from "@/Hooks/useWeChatShare";
|
|
-
|
|
|
|
|
|
+import { DTabStore } from "@/store/tab/tab.type";
|
|
const { userId } = useUserInfoState();
|
|
const { userId } = useUserInfoState();
|
|
const router = useRouter();
|
|
const router = useRouter();
|
|
-const route = useRoute();
|
|
|
|
|
|
+//const route = useRoute();
|
|
const dataList = ref<DDataBaseListAll[] | null>(null);
|
|
const dataList = ref<DDataBaseListAll[] | null>(null);
|
|
-const routeQuery = (str: LocationQueryValue | LocationQueryValue[]) =>
|
|
|
|
- str === "0" ? "" : str;
|
|
|
|
-const reqParams = computed<IArchiveRequest>(
|
|
|
|
- () =>
|
|
|
|
- ({
|
|
|
|
- type: routeQuery(route.query.t),
|
|
|
|
- title: route.query.sv,
|
|
|
|
- productId: routeQuery(route.query.pId),
|
|
|
|
- labelIds: routeQuery(route.query.lId),
|
|
|
|
- stageStatus: routeQuery(route.query.ss),
|
|
|
|
- spId: "",
|
|
|
|
- userId: userId,
|
|
|
|
- } as IArchiveRequest)
|
|
|
|
-);
|
|
|
|
|
|
+const props = defineProps<DTabStore>()
|
|
|
|
+//const routeQuery = (str: LocationQueryValue | LocationQueryValue[]) =>
|
|
|
|
+// str === "0" ? "" : str;
|
|
|
|
+//const reqParams = computed<IArchiveRequest>(
|
|
|
|
+// () =>
|
|
|
|
+// ({
|
|
|
|
+// type: routeQuery(route.query.t),
|
|
|
|
+// title: route.query.sv,
|
|
|
|
+// productId: routeQuery(route.query.pId),
|
|
|
|
+// labelIds: routeQuery(route.query.lId),
|
|
|
|
+// stageStatus: routeQuery(route.query.ss),
|
|
|
|
+// spId: "",
|
|
|
|
+// userId: userId,
|
|
|
|
+// } as IArchiveRequest)
|
|
|
|
+//);
|
|
|
|
+const reqParams = ref<Record<string, any>>()
|
|
const isAddStatus = ref<boolean>(false);
|
|
const isAddStatus = ref<boolean>(false);
|
|
const isEmpty = ref<boolean>(false);
|
|
const isEmpty = ref<boolean>(false);
|
|
const isShowType = (data: DDataBaseListAll): boolean => {
|
|
const isShowType = (data: DDataBaseListAll): boolean => {
|
|
- if (routeQuery(route.query.t) !== "") {
|
|
|
|
- return routeQuery(route.query.t) === data.type;
|
|
|
|
|
|
+ //if (routeQuery(route.query.t) !== "") {
|
|
|
|
+ // return routeQuery(route.query.t) === data.type;
|
|
|
|
+ //} else {
|
|
|
|
+ // return true;
|
|
|
|
+ //}
|
|
|
|
+ if (reqParams.value!.type !== "") {
|
|
|
|
+ return reqParams.value!.type === data.type;
|
|
} else {
|
|
} else {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-const formParams = ref({ allStatus: "1" });
|
|
|
|
|
|
+const formParams = ref({ allStatus: "1", userId: userId as string });
|
|
const reqArchiveList = async (res?: DetailParams) => {
|
|
const reqArchiveList = async (res?: DetailParams) => {
|
|
if (!res) {
|
|
if (!res) {
|
|
const { data } = await getArchiveList({ ...reqParams.value, ...formParams.value });
|
|
const { data } = await getArchiveList({ ...reqParams.value, ...formParams.value });
|
|
@@ -102,39 +116,54 @@ const reqArchiveList = async (res?: DetailParams) => {
|
|
...DcreptoList!,
|
|
...DcreptoList!,
|
|
];
|
|
];
|
|
isEmpty.value =
|
|
isEmpty.value =
|
|
- dataList.value![res.index!]!.dataList.length === 0 && reqParams.value.type !== "";
|
|
|
|
|
|
+ dataList.value![res.index!]!.dataList.length === 0;
|
|
dataList.value![res.index!]!.showMore = res.pageNum! > 1 && data?.length! < 5;
|
|
dataList.value![res.index!]!.showMore = res.pageNum! > 1 && data?.length! < 5;
|
|
}
|
|
}
|
|
};
|
|
};
|
|
-const isSearch = () => {
|
|
|
|
- if (route.query.t !== '0') {
|
|
|
|
- return true
|
|
|
|
- }
|
|
|
|
- if (
|
|
|
|
- (route.query.lId !== "0" && route.query.lId !== "") ||
|
|
|
|
- route.query.sv !== "" ||
|
|
|
|
- (route.query.pId !== "0" && route.query.pId !== "") ||
|
|
|
|
- (route.query.ss !== "0" && route.query.ss !== "")
|
|
|
|
- ) {
|
|
|
|
- return true;
|
|
|
|
|
|
+//const isSearch = () => {
|
|
|
|
+// if (route.query.t !== '0') {
|
|
|
|
+// return true
|
|
|
|
+// }
|
|
|
|
+// if (
|
|
|
|
+// (route.query.lId !== "0" && route.query.lId !== "") ||
|
|
|
|
+// route.query.sv !== "" ||
|
|
|
|
+// (route.query.pId !== "0" && route.query.pId !== "") ||
|
|
|
|
+// (route.query.ss !== "0" && route.query.ss !== "")
|
|
|
|
+// ) {
|
|
|
|
+// return true;
|
|
|
|
+// }
|
|
|
|
+// else return false;
|
|
|
|
+//};
|
|
|
|
+//watch(
|
|
|
|
+// () => route.query,
|
|
|
|
+// () => {
|
|
|
|
+// console.log("路由变化", route);
|
|
|
|
+// if (route.path === "/database/index" && isSearch()) {
|
|
|
|
+// formParams.value.allStatus = "1";
|
|
|
|
+// reqArchiveList();
|
|
|
|
+// } else {
|
|
|
|
+// dataList.value = []
|
|
|
|
+// }
|
|
|
|
+// },
|
|
|
|
+// {
|
|
|
|
+// immediate: true,
|
|
|
|
+// }
|
|
|
|
+//);
|
|
|
|
+const valueChange = (form: Record<string, any>): Record<string, any> => {
|
|
|
|
+ const f: Record<string, any> = {}
|
|
|
|
+ for (const key in form) {
|
|
|
|
+ f[key] = (form[key] === '0' || form[key] === 0) ? '' : form[key];
|
|
}
|
|
}
|
|
-};
|
|
|
|
-watch(
|
|
|
|
- () => route.query,
|
|
|
|
- () => {
|
|
|
|
- console.log("路由变化", route);
|
|
|
|
- if (route.path === "/database/index" && isSearch()) {
|
|
|
|
- formParams.value.allStatus = "1";
|
|
|
|
- reqArchiveList();
|
|
|
|
- } else {
|
|
|
|
- dataList.value = []
|
|
|
|
- }
|
|
|
|
- },
|
|
|
|
- {
|
|
|
|
- immediate: true,
|
|
|
|
- }
|
|
|
|
-);
|
|
|
|
-
|
|
|
|
|
|
+ console.log(f);
|
|
|
|
+ return f
|
|
|
|
+}
|
|
|
|
+watch(() => props, (val) => {
|
|
|
|
+ reqParams.value = valueChange(val)
|
|
|
|
+ reqArchiveList()
|
|
|
|
+}, {
|
|
|
|
+ immediate: true,
|
|
|
|
+ deep: true,
|
|
|
|
+})
|
|
const handleSeeMore = ($event: DetailParams) => {
|
|
const handleSeeMore = ($event: DetailParams) => {
|
|
console.log("查看更多", $event.index);
|
|
console.log("查看更多", $event.index);
|
|
reqArchiveList($event);
|
|
reqArchiveList($event);
|