perf: 优化流水线页面切换回来不丢失查询条件

pull/243/head
xiaojunnuo 2024-11-08 10:51:41 +08:00
parent 028758c4e0
commit 4dcf6e87bc
5 changed files with 21 additions and 8 deletions

View File

@ -15,7 +15,8 @@ export const certdResources = [
path: "/certd/pipeline",
component: "/certd/pipeline/index.vue",
meta: {
icon: "ion:analytics-sharp"
icon: "ion:analytics-sharp",
cache: true
}
},
{
@ -33,7 +34,8 @@ export const certdResources = [
path: "/certd/history",
component: "/certd/history/index.vue",
meta: {
icon: "ion:timer-outline"
icon: "ion:timer-outline",
cache: true
}
},
{
@ -43,7 +45,8 @@ export const certdResources = [
component: "/certd/access/index.vue",
meta: {
icon: "ion:disc-outline",
auth: true
auth: true,
cache: true
}
},
{

View File

@ -11,7 +11,7 @@
</template>
<script lang="ts">
import { defineComponent, onMounted } from "vue";
import { defineComponent, onActivated, onMounted } from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { createAccessApi } from "/@/views/certd/access/api";
@ -26,6 +26,9 @@ export default defineComponent({
onMounted(() => {
crudExpose.doRefresh();
});
onActivated(() => {
crudExpose.doRefresh();
});
return {
crudBinding,

View File

@ -14,7 +14,7 @@
</template>
<script lang="ts" setup>
import { onMounted } from "vue";
import {onActivated, onMounted} from "vue";
import { useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { message, Modal } from "ant-design-vue";
@ -47,5 +47,8 @@ const handleBatchDelete = () => {
onMounted(() => {
crudExpose.doRefresh();
});
onActivated(() => {
crudExpose.doRefresh();
});
</script>
<style lang="less"></style>

View File

@ -14,13 +14,13 @@
</template>
<script lang="ts">
import { defineComponent, ref, onMounted } from "vue";
import { defineComponent, ref, onMounted, onActivated } from "vue";
import { useCrud, useFs } from "@fast-crud/fast-crud";
import createCrudOptions from "./crud";
import { useExpose } from "@fast-crud/fast-crud";
import PiCertdForm from "./certd-form/index.vue";
export default defineComponent({
name: "PipelineManager1",
name: "PipelineManager",
components: { PiCertdForm },
setup() {
const certdFormRef = ref();
@ -34,6 +34,10 @@ export default defineComponent({
crudExpose.doRefresh();
});
onActivated(() => {
crudExpose.doRefresh();
});
return {
crudBinding,
crudRef,

View File

@ -37,7 +37,7 @@ export class PipelineController extends CrudController<PipelineService> {
const buildQuery = qb => {
if (title) {
qb.andWhere('title like :title', { title: `%${title}%` });
qb.andWhere('title like :title', { title: `%${title}%` }).orWhere('content like :content', { content: `%${title}%` });
}
};
if (!body.sort || !body.sort?.prop) {