-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathdata.ts
More file actions
84 lines (79 loc) · 51 KB
/
Copy pathdata.ts
File metadata and controls
84 lines (79 loc) · 51 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
export const a = {
oldFile: {
fileName: null,
content: "",
},
newFile: {
fileName: "src/components/MultiLevelReview/AddReviewConfigModal.tsx",
content:
"import type { DepoCatalogueReviewers, UpdateCatalogueReviewersParams } from '@/apis/modules/catalogue/module';\nimport { DepoCatalogueReviewEnum } from '@/apis/modules/catalogue/module';\nimport { gsModalSize } from '@/utils/commonVariable';\nimport { Button, Form, Modal, Radio, message } from 'antd';\nimport { useEffect, useMemo, useState } from 'react';\nimport { UserSelect } from '../UserSelect';\nimport { useCatalogueTree } from '@/hooks/useCatalogueTree';\nimport type { IUserInfo } from '@/apis/modules/user/module';\nimport { updateCatalogueReviewers } from '@/apis/modules/catalogue';\n\nexport const AddReviewConfig = ({ currentReviewList }: { currentReviewList: DepoCatalogueReviewers }) => {\n const [isOpen, setIsOpen] = useState(false);\n\n const [loading, setLoading] = useState(false);\n\n const [userList, setUserList] = useState<IUserInfo[]>([]);\n\n const { computedSelectItem, reloadCatalogueItemReviewers } = useCatalogueTree.useShallowSelector((s) => ({\n computedSelectItem: s.computedSelectItem,\n reloadCatalogueItemReviewers: s.getCatalogueItemReviewers,\n }));\n\n const [form] = Form.useForm<{ reviewers: number[]; type: DepoCatalogueReviewEnum }>();\n\n const selectedList = useMemo(() => currentReviewList.map(i => i.reviewers || []).reduce((p, c) => p.concat(c), []), [currentReviewList])\n\n useEffect(() => {\n return () => form.resetFields();\n }, [form, isOpen]);\n\n const onSubmit = async () => {\n if (loading) return;\n try {\n setLoading(true);\n const formValue = await form.validateFields();\n if (!computedSelectItem) {\n message.error('意料之外的错误,请刷新重试');\n return;\n }\n const params: UpdateCatalogueReviewersParams = {\n dirId: computedSelectItem.id,\n updateCatalogueReviewLevels: [\n {\n level: currentReviewList.length + 1,\n type: formValue.type,\n reviewers: userList\n .filter((i) => formValue.reviewers.includes(i.id))\n .map((i) => ({ id: i.id, username: i.username, nickname: i.nickname })),\n },\n ],\n };\n const response = await updateCatalogueReviewers(params);\n if (response.success) {\n await reloadCatalogueItemReviewers();\n setIsOpen(false);\n }\n } finally {\n setLoading(false);\n }\n };\n\n return (\n <>\n <Button onClick={() => setIsOpen(true)}>新增审查层级</Button>\n <Modal\n title=\"新增审查层级\"\n visible={isOpen}\n okText=\"提交更改\"\n width={gsModalSize}\n onOk={onSubmit}\n confirmLoading={loading}\n onCancel={() => setIsOpen(false)}\n >\n <Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} initialValues={{ type: DepoCatalogueReviewEnum.OR }}>\n <Form.Item label=\"直接审查人\" name=\"reviewers\" rules={[{ required: true, message: '请选择审查人' }]}>\n <UserSelect\n mode=\"multiple\"\n onLoad={(list) => setUserList(list)}\n disableItems={selectedList}\n filterOption={(input, option) => !!option?.label?.toString().toLowerCase().includes(input?.toLowerCase())}\n />\n </Form.Item>\n <Form.Item label=\"审查条件\" name=\"type\" rules={[{ required: true, message: '请选择审查条件' }]}>\n <Radio.Group size=\"middle\" style={{ width: '100%' }}>\n <Radio.Button value={DepoCatalogueReviewEnum.AND}>会签</Radio.Button>\n <Radio.Button value={DepoCatalogueReviewEnum.OR}>或签</Radio.Button>\n </Radio.Group>\n </Form.Item>\n </Form>\n </Modal>\n </>\n );\n};",
},
hunks: [
"--- /dev/null\n+++ src/components/MultiLevelReview/AddReviewConfigModal.tsx\n@@ -0,0 +1,93 @@\n+import type { DepoCatalogueReviewers, UpdateCatalogueReviewersParams } from '@/apis/modules/catalogue/module';\n+import { DepoCatalogueReviewEnum } from '@/apis/modules/catalogue/module';\n+import { gsModalSize } from '@/utils/commonVariable';\n+import { Button, Form, Modal, Radio, message } from 'antd';\n+import { useEffect, useMemo, useState } from 'react';\n+import { UserSelect } from '../UserSelect';\n+import { useCatalogueTree } from '@/hooks/useCatalogueTree';\n+import type { IUserInfo } from '@/apis/modules/user/module';\n+import { updateCatalogueReviewers } from '@/apis/modules/catalogue';\n+\n+export const AddReviewConfig = ({ currentReviewList }: { currentReviewList: DepoCatalogueReviewers }) => {\n+ const [isOpen, setIsOpen] = useState(false);\n+\n+ const [loading, setLoading] = useState(false);\n+\n+ const [userList, setUserList] = useState<IUserInfo[]>([]);\n+\n+ const { computedSelectItem, reloadCatalogueItemReviewers } = useCatalogueTree.useShallowSelector((s) => ({\n+ computedSelectItem: s.computedSelectItem,\n+ reloadCatalogueItemReviewers: s.getCatalogueItemReviewers,\n+ }));\n+\n+ const [form] = Form.useForm<{ reviewers: number[]; type: DepoCatalogueReviewEnum }>();\n+\n+ const selectedList = useMemo(() => currentReviewList.map(i => i.reviewers || []).reduce((p, c) => p.concat(c), []), [currentReviewList])\n+\n+ useEffect(() => {\n+ return () => form.resetFields();\n+ }, [form, isOpen]);\n+\n+ const onSubmit = async () => {\n+ if (loading) return;\n+ try {\n+ setLoading(true);\n+ const formValue = await form.validateFields();\n+ if (!computedSelectItem) {\n+ message.error('意料之外的错误,请刷新重试');\n+ return;\n+ }\n+ const params: UpdateCatalogueReviewersParams = {\n+ dirId: computedSelectItem.id,\n+ updateCatalogueReviewLevels: [\n+ {\n+ level: currentReviewList.length + 1,\n+ type: formValue.type,\n+ reviewers: userList\n+ .filter((i) => formValue.reviewers.includes(i.id))\n+ .map((i) => ({ id: i.id, username: i.username, nickname: i.nickname })),\n+ },\n+ ],\n+ };\n+ const response = await updateCatalogueReviewers(params);\n+ if (response.success) {\n+ await reloadCatalogueItemReviewers();\n+ setIsOpen(false);\n+ }\n+ } finally {\n+ setLoading(false);\n+ }\n+ };\n+\n+ return (\n+ <>\n+ <Button onClick={() => setIsOpen(true)}>新增审查层级</Button>\n+ <Modal\n+ title=\"新增审查层级\"\n+ visible={isOpen}\n+ okText=\"提交更改\"\n+ width={gsModalSize}\n+ onOk={onSubmit}\n+ confirmLoading={loading}\n+ onCancel={() => setIsOpen(false)}\n+ >\n+ <Form form={form} labelCol={{ span: 4 }} wrapperCol={{ span: 20 }} initialValues={{ type: DepoCatalogueReviewEnum.OR }}>\n+ <Form.Item label=\"直接审查人\" name=\"reviewers\" rules={[{ required: true, message: '请选择审查人' }]}>\n+ <UserSelect\n+ mode=\"multiple\"\n+ onLoad={(list) => setUserList(list)}\n+ disableItems={selectedList}\n+ filterOption={(input, option) => !!option?.label?.toString().toLowerCase().includes(input?.toLowerCase())}\n+ />\n+ </Form.Item>\n+ <Form.Item label=\"审查条件\" name=\"type\" rules={[{ required: true, message: '请选择审查条件' }]}>\n+ <Radio.Group size=\"middle\" style={{ width: '100%' }}>\n+ <Radio.Button value={DepoCatalogueReviewEnum.AND}>会签</Radio.Button>\n+ <Radio.Button value={DepoCatalogueReviewEnum.OR}>或签</Radio.Button>\n+ </Radio.Group>\n+ </Form.Item>\n+ </Form>\n+ </Modal>\n+ </>\n+ );\n+};\n",
],
};
export const b = {
newFile: {
fileName: "a/packages/myreact-reactivity/src/reactive/feature.ts",
content:
'import { Component, createElement, useState, useCallback, useMemo } from "@my-react/react";\n\nimport { proxyRefs, ReactiveEffect } from "../api";\n\nimport type { UnwrapRef } from "../api";\nimport type { LikeReactNode } from "@my-react/react";\n\ntype LifeCycle = {\n onBeforeMount: Array<() => void>;\n\n onMounted: Array<() => void>;\n\n onBeforeUpdate: Array<() => void>;\n\n onUpdated: Array<() => void>;\n\n onBeforeUnmount: Array<() => void>;\n\n onUnmounted: Array<() => void>;\n\n hasHookInstalled: boolean;\n\n canUpdateComponent: boolean;\n};\n\n/**\n * @internal\n */\nexport let globalInstance: LifeCycle | null = null;\n\nexport function createReactive<P extends Record<string, unknown>, S extends Record<string, unknown>>(props?: {\n setup: () => S;\n render?: (props: UnwrapRef<S> & P) => LikeReactNode;\n}) {\n const setup = typeof props === "function" ? props : props.setup;\n\n const render = typeof props === "function" ? null : props.render;\n\n class ForBeforeUnmount extends Component<{ ["$$__instance__$$"]: LifeCycle; children: LikeReactNode }> {\n componentWillUnmount(): void {\n this.props.$$__instance__$$.onBeforeUnmount.forEach((f) => f());\n }\n\n render() {\n return this.props.children;\n }\n }\n\n class ForBeforeMount extends Component<{ ["$$__instance__$$"]: LifeCycle; children: LikeReactNode }> {\n componentDidMount(): void {\n this.props.$$__instance__$$.onBeforeMount.forEach((f) => f());\n }\n\n render() {\n return this.props.children;\n }\n }\n\n class RenderWithLifeCycle extends Component<\n {\n ["$$__trigger__$$"]: () => void;\n ["$$__instance__$$"]: LifeCycle;\n ["$$__reactiveState__$$"]: UnwrapRef<S>;\n children?: (props: UnwrapRef<S> & P) => LikeReactNode;\n } & P\n > {\n componentDidMount(): void {\n this.props.$$__instance__$$.onMounted.forEach((f) => f());\n }\n\n componentDidUpdate(): void {\n this.props.$$__instance__$$.onUpdated.forEach((f) => f());\n }\n\n componentWillUnmount(): void {\n this.props.$$__instance__$$.onUnmounted.forEach((f) => f());\n this.reactiveEffect.stop();\n }\n\n shouldComponentUpdate(): boolean {\n this.props.$$__instance__$$.canUpdateComponent = false;\n this.props.$$__instance__$$.onBeforeUpdate.forEach((f) => f());\n this.props.$$__instance__$$.canUpdateComponent = true;\n return true;\n }\n\n reactiveEffect = new ReactiveEffect(() => {\n const { children, $$__trigger__$$, $$__reactiveState__$$, $$__instance__$$, ...last } = this.props;\n const targetRender = (render || children) as (props: UnwrapRef<S> & P) => LikeReactNode;\n const element = targetRender?.({ ...last, ...$$__reactiveState__$$ } as UnwrapRef<S> & P) || null;\n return element;\n }, this.props.$$__trigger__$$);\n\n render() {\n return createElement(ForBeforeMount, { ["$$__instance__$$"]: this.props.$$__instance__$$, children: this.reactiveEffect.run() });\n }\n }\n\n class Render extends Component<\n {\n ["$$__trigger__$$"]: () => void;\n ["$$__reactiveState__$$"]: UnwrapRef<S>;\n children?: (props: UnwrapRef<S> & P) => LikeReactNode;\n } & P\n > {\n componentWillUnmount(): void {\n this.reactiveEffect.stop();\n }\n\n reactiveEffect = new ReactiveEffect(() => {\n const { children, $$__trigger__$$, $$__reactiveState__$$, $$__instance__$$, ...last } = this.props;\n const targetRender = (render || children) as (props: UnwrapRef<S> & P) => LikeReactNode;\n const element = targetRender?.({ ...last, ...$$__reactiveState__$$ } as UnwrapRef<S> & P) || null;\n return element;\n }, this.props.$$__trigger__$$);\n\n render() {\n return this.reactiveEffect.run();\n }\n }\n\n const MyReactReactiveComponent = (props: P & { children?: (props: UnwrapRef<S> & P) => LikeReactNode }) => {\n const [instance] = useState(() => ({\n onBeforeMount: [],\n onBeforeUpdate: [],\n onBeforeUnmount: [],\n onMounted: [],\n onUpdated: [],\n onUnmounted: [],\n hasHookInstalled: false,\n canUpdateComponent: true,\n }));\n\n const state = useMemo(() => {\n globalInstance = instance;\n\n const state = proxyRefs(setup());\n\n globalInstance = null;\n\n return state;\n }, []);\n\n if (__DEV__) {\n for (const key in props) {\n if (key in state) {\n console.warn(`duplicate key ${key} in Component props and reactive state, please fix this usage`);\n }\n }\n if (props["children"] && typeof props["children"] !== "function") {\n throw new Error("the component which return from createReactive() expect a function children");\n }\n }\n\n const [, setState] = useState(() => 0);\n\n const updateCallback = useCallback(() => {\n if (instance.canUpdateComponent) {\n setState((i) => i + 1);\n }\n }, []);\n\n if (instance.hasHookInstalled) {\n return createElement(ForBeforeUnmount, {\n ["$$__instance__$$"]: instance,\n children: createElement(RenderWithLifeCycle, {\n ...props,\n ["$$__trigger__$$"]: updateCallback,\n ["$$__reactiveState__$$"]: state,\n ["$$__instance__$$"]: instance,\n }),\n }) as LikeReactNode;\n } else {\n return createElement(Render, { ...props, ["$$__trigger__$$"]: updateCallback, ["$$__reactiveState__$$"]: state }) as LikeReactNode;\n }\n };\n\n return MyReactReactiveComponent;\n}\n',
},
hunks: [
'diff --git a/packages/myreact-reactivity/src/reactive/feature.ts b/packages/myreact-reactivity/src/reactive/feature.ts\nindex 5b301628..15aac42f 100644\n--- a/packages/myreact-reactivity/src/reactive/feature.ts\n+++ b/packages/myreact-reactivity/src/reactive/feature.ts\n@@ -74,7 +74,7 @@ export function createReactive<P extends Record<string, unknown>, S extends Reco\n \n componentWillUnmount(): void {\n this.props.$$__instance__$$.onUnmounted.forEach((f) => f());\n- this.effect.stop();\n+ this.reactiveEffect.stop();\n }\n \n shouldComponentUpdate(): boolean {\n@@ -84,7 +84,7 @@ export function createReactive<P extends Record<string, unknown>, S extends Reco\n return true;\n }\n \n- effect = new ReactiveEffect(() => {\n+ reactiveEffect = new ReactiveEffect(() => {\n const { children, $$__trigger__$$, $$__reactiveState__$$, $$__instance__$$, ...last } = this.props;\n const targetRender = (render || children) as (props: UnwrapRef<S> & P) => LikeReactNode;\n const element = targetRender?.({ ...last, ...$$__reactiveState__$$ } as UnwrapRef<S> & P) || null;\n@@ -92,7 +92,7 @@ export function createReactive<P extends Record<string, unknown>, S extends Reco\n }, this.props.$$__trigger__$$);\n \n render() {\n- return createElement(ForBeforeMount, { ["$$__instance__$$"]: this.props.$$__instance__$$, children: this.effect.run() });\n+ return createElement(ForBeforeMount, { ["$$__instance__$$"]: this.props.$$__instance__$$, children: this.reactiveEffect.run() });\n }\n }\n \n@@ -104,10 +104,10 @@ export function createReactive<P extends Record<string, unknown>, S extends Reco\n } & P\n > {\n componentWillUnmount(): void {\n- this.effect.stop();\n+ this.reactiveEffect.stop();\n }\n \n- effect = new ReactiveEffect(() => {\n+ reactiveEffect = new ReactiveEffect(() => {\n const { children, $$__trigger__$$, $$__reactiveState__$$, $$__instance__$$, ...last } = this.props;\n const targetRender = (render || children) as (props: UnwrapRef<S> & P) => LikeReactNode;\n const element = targetRender?.({ ...last, ...$$__reactiveState__$$ } as UnwrapRef<S> & P) || null;\n@@ -115,7 +115,7 @@ export function createReactive<P extends Record<string, unknown>, S extends Reco\n }, this.props.$$__trigger__$$);\n \n render() {\n- return this.effect.run();\n+ return this.reactiveEffect.run();\n }\n }\n',
],
};
export const c = {
newFile: {
fileName: "a/packages/myreact-dom/src/client/tools/highlight.ts",
content:
'import { STATE_TYPE, include } from "@my-react/react-shared";\n\nimport { enableHighlight } from "@my-react-dom-shared";\n\nimport type { MyReactFiberNode } from "@my-react/react-reconciler";\nimport type { ClientDomDispatch } from "@my-react-dom-client/renderDispatch";\n\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport const debounce = <T extends Function>(callback: T, time?: number): T => {\n let id = null;\n return ((...args) => {\n clearTimeout(id);\n id = setTimeout(() => {\n callback.call(null, ...args);\n }, time || 40);\n }) as unknown as T;\n};\n\n/**\n * @internal\n */\nexport class HighLight {\n /**\n * @type HighLight\n */\n static instance: HighLight | undefined = undefined;\n\n /**\n *\n * @returns HighLight\n */\n static getHighLightInstance = () => {\n HighLight.instance = HighLight.instance || new HighLight();\n\n return HighLight.instance;\n };\n\n mask: HTMLCanvasElement | null = null;\n\n range = document.createRange();\n\n running = false;\n\n __pendingUpdate__: Set<MyReactFiberNode> = new Set();\n\n __pendingAppend__: Set<MyReactFiberNode> = new Set();\n\n __pendingSetRef__: Set<MyReactFiberNode> = new Set();\n\n __pendingWarn__: Set<MyReactFiberNode> = new Set();\n\n width = 0;\n\n height = 0;\n\n constructor() {\n this.mask = document.createElement("canvas");\n this.mask.setAttribute("data-highlight", "@my-react");\n this.mask.style.cssText = `\n position: fixed;\n z-index: 99999999;\n left: 0;\n top: 0;\n pointer-events: none;\n `;\n document.documentElement.prepend(this.mask);\n this.setSize();\n window.addEventListener("resize", this.setSize);\n }\n\n setSize = debounce(() => {\n this.width = window.innerWidth || document.documentElement.clientWidth;\n\n this.height = window.innerHeight || document.documentElement.clientHeight;\n\n this.mask.width = this.width;\n\n this.mask.height = this.height;\n });\n\n highLight = (fiber: MyReactFiberNode, type: "update" | "append" | "setRef" | "warn") => {\n if (fiber.nativeNode) {\n switch (type) {\n case "update":\n this.__pendingUpdate__.add(fiber);\n break;\n case "append":\n this.__pendingAppend__.add(fiber);\n break;\n case "setRef":\n this.__pendingSetRef__.add(fiber);\n break;\n case "warn":\n this.__pendingWarn__.add(fiber);\n }\n }\n\n if (!this.running) {\n this.running = true;\n requestAnimationFrame(this.flashPending);\n }\n };\n\n flashPending = () => {\n const context = this.mask.getContext("2d");\n\n const allPendingUpdate = new Set(this.__pendingUpdate__);\n\n this.__pendingUpdate__.clear();\n\n context.strokeStyle = "rgba(200,50,50,0.8)";\n\n allPendingUpdate.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n try {\n const node = fiber.nativeNode as HTMLElement;\n if (node.nodeType === Node.TEXT_NODE) {\n this.range.selectNodeContents(node);\n } else {\n this.range.selectNode(node);\n }\n const rect = this.range.getBoundingClientRect();\n if (\n (rect.width || rect.height) &&\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n ) {\n // do the highlight paint\n const left = rect.left - 0.5;\n const top = rect.top - 0.5;\n const width = rect.width + 1;\n const height = rect.height + 1;\n context.strokeRect(\n left < 0 ? 0 : left,\n top < 0 ? 0 : top,\n width > window.innerWidth ? window.innerWidth : width,\n height > window.innerHeight ? window.innerHeight : height\n );\n }\n } catch {\n void 0;\n }\n });\n\n const allPendingAppend = new Set(this.__pendingAppend__);\n\n this.__pendingAppend__.clear();\n\n allPendingAppend.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n try {\n const node = fiber.nativeNode as HTMLElement;\n if (node.nodeType === Node.TEXT_NODE) {\n this.range.selectNodeContents(node);\n } else {\n this.range.selectNode(node);\n }\n const rect = this.range.getBoundingClientRect();\n if (\n (rect.width || rect.height) &&\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n ) {\n // do the highlight paint\n const left = rect.left - 0.5;\n const top = rect.top - 0.5;\n const width = rect.width + 1;\n const height = rect.height + 1;\n context.strokeRect(\n left < 0 ? 0 : left,\n top < 0 ? 0 : top,\n width > window.innerWidth ? window.innerWidth : width,\n height > window.innerHeight ? window.innerHeight : height\n );\n }\n } catch {\n void 0;\n }\n });\n\n const allPendingSetRef = new Set(this.__pendingSetRef__);\n\n this.__pendingSetRef__.clear();\n\n allPendingSetRef.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n try {\n const node = fiber.nativeNode as HTMLElement;\n if (node.nodeType === Node.TEXT_NODE) {\n this.range.selectNodeContents(node);\n } else {\n this.range.selectNode(node);\n }\n const rect = this.range.getBoundingClientRect();\n if (\n (rect.width || rect.height) &&\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n ) {\n // do the highlight paint\n const left = rect.left - 0.5;\n const top = rect.top - 0.5;\n const width = rect.width + 1;\n const height = rect.height + 1;\n context.strokeRect(\n left < 0 ? 0 : left,\n top < 0 ? 0 : top,\n width > window.innerWidth ? window.innerWidth : width,\n height > window.innerHeight ? window.innerHeight : height\n );\n }\n } catch {\n void 0;\n }\n });\n\n context.strokeStyle = "rgba(230,150,40,0.8)";\n\n const allPendingWarn = new Set(this.__pendingWarn__);\n\n this.__pendingWarn__.clear();\n\n allPendingWarn.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n try {\n const node = fiber.nativeNode as HTMLElement;\n if (node.nodeType === Node.TEXT_NODE) {\n this.range.selectNodeContents(node);\n } else {\n this.range.selectNode(node);\n }\n const rect = this.range.getBoundingClientRect();\n if (\n (rect.width || rect.height) &&\n rect.top >= 0 &&\n rect.left >= 0 &&\n rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n ) {\n // do the highlight paint\n const left = rect.left - 0.5;\n const top = rect.top - 0.5;\n const width = rect.width + 1;\n const height = rect.height + 1;\n context.strokeRect(\n left < 0 ? 0 : left,\n top < 0 ? 0 : top,\n width > window.innerWidth ? window.innerWidth : width,\n height > window.innerHeight ? window.innerHeight : height\n );\n }\n } catch {\n void 0;\n }\n });\n\n setTimeout(() => {\n context.clearRect(0, 0, this.width, this.height);\n this.running = false;\n if (this.__pendingUpdate__.size || this.__pendingAppend__.size || this.__pendingSetRef__.size) {\n this.running = true;\n this.flashPending();\n }\n }, 100);\n };\n}\n\nexport const highlightUpdateFiber = function (this: ClientDomDispatch, fiber: MyReactFiberNode) {\n if (this.isAppMounted && !this.isHydrateRender && !this.isServerRender && (enableHighlight.current || window.__highlight__)) {\n HighLight.getHighLightInstance().highLight(fiber, "update");\n }\n};\n',
},
hunks: [
"diff --git a/packages/myreact-dom/src/client/tools/highlight.ts b/packages/myreact-dom/src/client/tools/highlight.ts\nindex 13cba7db..002becdc 100644\n--- a/packages/myreact-dom/src/client/tools/highlight.ts\n+++ b/packages/myreact-dom/src/client/tools/highlight.ts\n@@ -112,31 +112,35 @@ export class HighLight {\n \n allPendingUpdate.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n- const node = fiber.nativeNode as HTMLElement;\n- if (node.nodeType === Node.TEXT_NODE) {\n- this.range.selectNodeContents(node);\n- } else {\n- this.range.selectNode(node);\n- }\n- const rect = this.range.getBoundingClientRect();\n- if (\n- (rect.width || rect.height) &&\n- rect.top >= 0 &&\n- rect.left >= 0 &&\n- rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n- ) {\n- // do the highlight paint\n- const left = rect.left - 0.5;\n- const top = rect.top - 0.5;\n- const width = rect.width + 1;\n- const height = rect.height + 1;\n- context.strokeRect(\n- left < 0 ? 0 : left,\n- top < 0 ? 0 : top,\n- width > window.innerWidth ? window.innerWidth : width,\n- height > window.innerHeight ? window.innerHeight : height\n- );\n+ try {\n+ const node = fiber.nativeNode as HTMLElement;\n+ if (node.nodeType === Node.TEXT_NODE) {\n+ this.range.selectNodeContents(node);\n+ } else {\n+ this.range.selectNode(node);\n+ }\n+ const rect = this.range.getBoundingClientRect();\n+ if (\n+ (rect.width || rect.height) &&\n+ rect.top >= 0 &&\n+ rect.left >= 0 &&\n+ rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n+ rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n+ ) {\n+ // do the highlight paint\n+ const left = rect.left - 0.5;\n+ const top = rect.top - 0.5;\n+ const width = rect.width + 1;\n+ const height = rect.height + 1;\n+ context.strokeRect(\n+ left < 0 ? 0 : left,\n+ top < 0 ? 0 : top,\n+ width > window.innerWidth ? window.innerWidth : width,\n+ height > window.innerHeight ? window.innerHeight : height\n+ );\n+ }\n+ } catch {\n+ void 0;\n }\n });\n \n@@ -146,31 +150,35 @@ export class HighLight {\n \n allPendingAppend.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n- const node = fiber.nativeNode as HTMLElement;\n- if (node.nodeType === Node.TEXT_NODE) {\n- this.range.selectNodeContents(node);\n- } else {\n- this.range.selectNode(node);\n- }\n- const rect = this.range.getBoundingClientRect();\n- if (\n- (rect.width || rect.height) &&\n- rect.top >= 0 &&\n- rect.left >= 0 &&\n- rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n- ) {\n- // do the highlight paint\n- const left = rect.left - 0.5;\n- const top = rect.top - 0.5;\n- const width = rect.width + 1;\n- const height = rect.height + 1;\n- context.strokeRect(\n- left < 0 ? 0 : left,\n- top < 0 ? 0 : top,\n- width > window.innerWidth ? window.innerWidth : width,\n- height > window.innerHeight ? window.innerHeight : height\n- );\n+ try {\n+ const node = fiber.nativeNode as HTMLElement;\n+ if (node.nodeType === Node.TEXT_NODE) {\n+ this.range.selectNodeContents(node);\n+ } else {\n+ this.range.selectNode(node);\n+ }\n+ const rect = this.range.getBoundingClientRect();\n+ if (\n+ (rect.width || rect.height) &&\n+ rect.top >= 0 &&\n+ rect.left >= 0 &&\n+ rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n+ rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n+ ) {\n+ // do the highlight paint\n+ const left = rect.left - 0.5;\n+ const top = rect.top - 0.5;\n+ const width = rect.width + 1;\n+ const height = rect.height + 1;\n+ context.strokeRect(\n+ left < 0 ? 0 : left,\n+ top < 0 ? 0 : top,\n+ width > window.innerWidth ? window.innerWidth : width,\n+ height > window.innerHeight ? window.innerHeight : height\n+ );\n+ }\n+ } catch {\n+ void 0;\n }\n });\n \n@@ -180,31 +188,35 @@ export class HighLight {\n \n allPendingSetRef.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n- const node = fiber.nativeNode as HTMLElement;\n- if (node.nodeType === Node.TEXT_NODE) {\n- this.range.selectNodeContents(node);\n- } else {\n- this.range.selectNode(node);\n- }\n- const rect = this.range.getBoundingClientRect();\n- if (\n- (rect.width || rect.height) &&\n- rect.top >= 0 &&\n- rect.left >= 0 &&\n- rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n- ) {\n- // do the highlight paint\n- const left = rect.left - 0.5;\n- const top = rect.top - 0.5;\n- const width = rect.width + 1;\n- const height = rect.height + 1;\n- context.strokeRect(\n- left < 0 ? 0 : left,\n- top < 0 ? 0 : top,\n- width > window.innerWidth ? window.innerWidth : width,\n- height > window.innerHeight ? window.innerHeight : height\n- );\n+ try {\n+ const node = fiber.nativeNode as HTMLElement;\n+ if (node.nodeType === Node.TEXT_NODE) {\n+ this.range.selectNodeContents(node);\n+ } else {\n+ this.range.selectNode(node);\n+ }\n+ const rect = this.range.getBoundingClientRect();\n+ if (\n+ (rect.width || rect.height) &&\n+ rect.top >= 0 &&\n+ rect.left >= 0 &&\n+ rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n+ rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n+ ) {\n+ // do the highlight paint\n+ const left = rect.left - 0.5;\n+ const top = rect.top - 0.5;\n+ const width = rect.width + 1;\n+ const height = rect.height + 1;\n+ context.strokeRect(\n+ left < 0 ? 0 : left,\n+ top < 0 ? 0 : top,\n+ width > window.innerWidth ? window.innerWidth : width,\n+ height > window.innerHeight ? window.innerHeight : height\n+ );\n+ }\n+ } catch {\n+ void 0;\n }\n });\n \n@@ -216,31 +228,35 @@ export class HighLight {\n \n allPendingWarn.forEach((fiber) => {\n if (include(fiber.state, STATE_TYPE.__unmount__)) return;\n- const node = fiber.nativeNode as HTMLElement;\n- if (node.nodeType === Node.TEXT_NODE) {\n- this.range.selectNodeContents(node);\n- } else {\n- this.range.selectNode(node);\n- }\n- const rect = this.range.getBoundingClientRect();\n- if (\n- (rect.width || rect.height) &&\n- rect.top >= 0 &&\n- rect.left >= 0 &&\n- rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n- rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n- ) {\n- // do the highlight paint\n- const left = rect.left - 0.5;\n- const top = rect.top - 0.5;\n- const width = rect.width + 1;\n- const height = rect.height + 1;\n- context.strokeRect(\n- left < 0 ? 0 : left,\n- top < 0 ? 0 : top,\n- width > window.innerWidth ? window.innerWidth : width,\n- height > window.innerHeight ? window.innerHeight : height\n- );\n+ try {\n+ const node = fiber.nativeNode as HTMLElement;\n+ if (node.nodeType === Node.TEXT_NODE) {\n+ this.range.selectNodeContents(node);\n+ } else {\n+ this.range.selectNode(node);\n+ }\n+ const rect = this.range.getBoundingClientRect();\n+ if (\n+ (rect.width || rect.height) &&\n+ rect.top >= 0 &&\n+ rect.left >= 0 &&\n+ rect.right <= (window.innerWidth || document.documentElement.clientWidth) &&\n+ rect.bottom <= (window.innerHeight || document.documentElement.clientHeight)\n+ ) {\n+ // do the highlight paint\n+ const left = rect.left - 0.5;\n+ const top = rect.top - 0.5;\n+ const width = rect.width + 1;\n+ const height = rect.height + 1;\n+ context.strokeRect(\n+ left < 0 ? 0 : left,\n+ top < 0 ? 0 : top,\n+ width > window.innerWidth ? window.innerWidth : width,\n+ height > window.innerHeight ? window.innerHeight : height\n+ );\n+ }\n+ } catch {\n+ void 0;\n }\n });\n",
],
};
export const d = {
oldFile: {
fileName: "src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue",
content:
"<template>\n <div>\n <div>\n <SimpleFilters ref=\"filterRef\" v-model=\"params\" :items=\"filters\" @conditions-search=\"handleSearch\" />\n </div>\n <BasicTable\n ref=\"tableRef\"\n manual-request\n :request=\"queryCaseResult<LLMReportCase>\"\n :params=\"finalParams\"\n :columns=\"columns\"\n >\n <template #aiResults_header>\n <span v-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Assert\"> 分析结果 </span>\n <span v-else-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Mark_Avg\"> 平均分 </span>\n <span v-else-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Mark_Sum\"> 总分 </span>\n <span v-else>结果</span>\n </template>\n <template #aiResults=\"{ row }\">\n <el-tag\n v-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Assert && row.analyzeResult\"\n :type=\"AnalyzeResultInfo[row.analyzeResult]?.type\"\n >\n {{ AnalyzeResultInfo[row.analyzeResult]?.label }}\n </el-tag>\n <span\n v-else-if=\"\n [ResAnalysisTmpTypeEnum.LLM_Mark_Avg, ResAnalysisTmpTypeEnum.LLM_Mark_Sum].includes(currentAnalyzeType)\n \"\n >\n {{ row.score }}\n </span>\n </template>\n </BasicTable>\n </div>\n</template>\n<script lang=\"ts\" setup>\n import { ResAnalysisTmpTypeEnum } from '@/apis/wqe-aggregation/orderTemplate';\n import {\n SingleResultType,\n LLMReportCase,\n QueryCaseResultRequest,\n queryCaseResult,\n AnalyzeResult,\n } from '@/apis/wqe-case/result/singleResult';\n import { createDrawer } from '@/components/basic/basicDrawer';\n import { BasicTableInstance, Column } from '@/components/basic/basicTable';\n import { FilterConditionDto } from '@/components/business/filters';\n import SimpleFilters, { FiltersItem } from '@/components/business/simpleFilters';\n\n import { SingleResultTestResultOptions } from '../../common';\n import CaseDetail from '../caseDetail';\n\n /**\n * 分析结果\n */\n const AnalyzeResultInfo = {\n [AnalyzeResult.Wait]: { label: '待分析', type: '' },\n [AnalyzeResult.Pass]: { label: '通过', type: 'success' },\n [AnalyzeResult.NotPass]: { label: '不通过', type: 'danger' },\n [AnalyzeResult.Ignore]: { label: '忽略', type: 'info' },\n } as const;\n\n /**\n * 页面配置\n */\n const filters: FiltersItem[] = [\n { label: '流程结果', key: 'statusDesc', type: 'select', props: { options: SingleResultTestResultOptions } },\n { label: '用例编号', key: 'useCaseCode', type: 'input' },\n { label: '测试点', key: 'testPointName', type: 'input' },\n { label: '前提条件', key: 'preCondition', type: 'input' },\n { label: 'prompt', key: 'prompt', type: 'input' },\n { label: '输入', key: 'input', type: 'input' },\n { label: '预期结果', key: 'expectedResult', type: 'input' },\n ];\n const router = useRouter();\n const handleCheckDetail = (row: { id: string }) => {\n router.push({ query: { ...router.currentRoute.value.query, caseResultId: row.id } });\n createDrawer({\n title: '',\n content: CaseDetail,\n width: '100vw',\n customHeader: true,\n drawerProps: {\n showClose: false,\n onClose() {\n router.replace({ query: { ...router.currentRoute.value.query, caseResultId: '' } });\n return true;\n },\n },\n });\n };\n const columns: Column[] = [\n { prop: 'useCaseCode', label: '用例编号', width: '220px' },\n { prop: 'testPointName', label: '测试点', width: '220px' },\n { prop: 'preCondition', label: '前提条件', width: '220px' },\n { prop: 'prompt', label: 'prompt', width: '220px' },\n { prop: 'input', label: '输入', width: '220px' },\n { prop: 'expectedResult', label: '预期结果', width: '220px' },\n { prop: 'statusDesc', label: '流程结果', width: '220px' },\n { prop: 'aiResults', label: '结果', width: '200px', slot: true, headerSlot: true },\n { prop: 'escape', label: '返回耗时', width: '220px' },\n {\n prop: 'actions',\n label: '操作',\n fixed: 'right',\n buttons: [{ label: '详情', handler: handleCheckDetail }],\n },\n ];\n /**\n * 搜索\n */\n const route = useRoute();\n const currentJobId = route.query.jobId as string;\n const currentType = route.query.toolType as string as SingleResultType;\n const tableRef = ref<BasicTableInstance>();\n const props = defineProps<{ runSeq: number; currentAnalyzeType?: ResAnalysisTmpTypeEnum }>();\n const params = ref<Record<string, any>>({});\n const finalParams = ref<QueryCaseResultRequest>({\n conditions: [],\n toolType: currentType,\n jobId: currentJobId,\n runSeq: props.runSeq,\n });\n watch(\n () => props.runSeq,\n (val) => (finalParams.value.runSeq = val)\n );\n const handleSearch = (conditions: FilterConditionDto[][]) => {\n finalParams.value.conditions = conditions;\n tableRef.value?.reset();\n };\n const filterRef = ref();\n const setStatus = (statusDesc: string) => {\n params.value.statusDesc = statusDesc;\n filterRef.value?.search();\n };\n\n defineExpose({ reset: () => tableRef.value?.reset(), setStatus });\n</script>\n<style scoped lang=\"scss\"></style>\n",
},
newFile: {
fileName: "src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue",
content:
"<template>\n <div>\n <div>\n <SimpleFilters ref=\"filterRef\" v-model=\"params\" :items=\"filters\" @conditions-search=\"handleSearch\" />\n </div>\n <BasicTable\n ref=\"tableRef\"\n manual-request\n selection\n tool-bar\n v-model:selection-rows=\"selectionRows\"\n row-key=\"id\"\n :request=\"queryCaseResult<LLMReportCase>\"\n :params=\"finalParams\"\n :columns=\"columns\"\n >\n <template #headers>\n <el-button size=\"small\" :disabled=\"!selectionRows.length\" @click=\"handleExport\" :loading=\"exporting\">\n 导出数据\n </el-button>\n </template>\n <template #aiResults_header>\n <span v-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Assert\"> 分析结果 </span>\n <span v-else-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Mark_Avg\"> 平均分 </span>\n <span v-else-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Mark_Sum\"> 总分 </span>\n <span v-else>结果</span>\n </template>\n <template #aiResults=\"{ row }\">\n <el-tag\n v-if=\"currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Assert && row.analyzeResult\"\n :type=\"AnalyzeResultInfo[row.analyzeResult]?.type\"\n >\n {{ AnalyzeResultInfo[row.analyzeResult]?.label }}\n </el-tag>\n <span\n v-else-if=\"\n [ResAnalysisTmpTypeEnum.LLM_Mark_Avg, ResAnalysisTmpTypeEnum.LLM_Mark_Sum].includes(currentAnalyzeType)\n \"\n >\n {{ row.score }}\n </span>\n </template>\n </BasicTable>\n </div>\n</template>\n<script lang=\"ts\" setup>\n import { ResAnalysisTmpTypeEnum } from '@/apis/wqe-aggregation/orderTemplate';\n import {\n SingleResultType,\n LLMReportCase,\n QueryCaseResultRequest,\n queryCaseResult,\n AnalyzeResult,\n } from '@/apis/wqe-case/result/singleResult';\n import { exportLLMSingleResultCases } from '@/apis/wqe-testcase/result';\n import { createDrawer } from '@/components/basic/basicDrawer';\n import { BasicTableInstance, Column } from '@/components/basic/basicTable';\n import { FilterConditionDto } from '@/components/business/filters';\n import SimpleFilters, { FiltersItem } from '@/components/business/simpleFilters';\n\n import { SingleResultTestResultOptions } from '../../common';\n import CaseDetail from '../caseDetail';\n\n /**\n * 分析结果\n */\n const AnalyzeResultInfo = {\n [AnalyzeResult.Wait]: { label: '待分析', type: '' },\n [AnalyzeResult.Pass]: { label: '通过', type: 'success' },\n [AnalyzeResult.NotPass]: { label: '不通过', type: 'danger' },\n [AnalyzeResult.Ignore]: { label: '忽略', type: 'info' },\n } as const;\n\n /**\n * 页面配置\n */\n const filters: FiltersItem[] = [\n { label: '流程结果', key: 'statusDesc', type: 'select', props: { options: SingleResultTestResultOptions } },\n { label: '用例编号', key: 'useCaseCode', type: 'input' },\n { label: '测试点', key: 'testPointName', type: 'input' },\n { label: '前提条件', key: 'preCondition', type: 'input' },\n { label: 'prompt', key: 'prompt', type: 'input' },\n { label: '输入', key: 'input', type: 'input' },\n { label: '预期结果', key: 'expectedResult', type: 'input' },\n ];\n const router = useRouter();\n const handleCheckDetail = (row: { id: string }) => {\n router.push({ query: { ...router.currentRoute.value.query, caseResultId: row.id } });\n createDrawer({\n title: '',\n content: CaseDetail,\n width: '100vw',\n customHeader: true,\n drawerProps: {\n showClose: false,\n onClose() {\n router.replace({ query: { ...router.currentRoute.value.query, caseResultId: '' } });\n return true;\n },\n },\n });\n };\n const columns: Column[] = [\n { prop: 'useCaseCode', label: '用例编号', width: '220px' },\n { prop: 'testPointName', label: '测试点', width: '220px' },\n { prop: 'preCondition', label: '前提条件', width: '220px' },\n { prop: 'prompt', label: 'prompt', width: '220px' },\n { prop: 'input', label: '输入', width: '220px' },\n { prop: 'expectedResult', label: '预期结果', width: '220px' },\n { prop: 'statusDesc', label: '流程结果', width: '220px' },\n { prop: 'aiResults', label: '结果', width: '200px', slot: true, headerSlot: true },\n { prop: 'escape', label: '返回耗时', width: '220px' },\n {\n prop: 'actions',\n label: '操作',\n fixed: 'right',\n buttons: [{ label: '详情', handler: handleCheckDetail }],\n },\n ];\n /**\n * 搜索\n */\n const route = useRoute();\n const currentJobId = route.query.jobId as string;\n const currentType = route.query.toolType as string as SingleResultType;\n const tableRef = ref<BasicTableInstance>();\n const props = defineProps<{ runSeq: number; currentAnalyzeType?: ResAnalysisTmpTypeEnum }>();\n const params = ref<Record<string, any>>({});\n const finalParams = ref<QueryCaseResultRequest>({\n conditions: [],\n toolType: currentType,\n jobId: currentJobId,\n runSeq: props.runSeq,\n });\n watch(\n () => props.runSeq,\n (val) => (finalParams.value.runSeq = val)\n );\n const handleSearch = (conditions: FilterConditionDto[][]) => {\n finalParams.value.conditions = conditions;\n tableRef.value?.reset();\n };\n const filterRef = ref();\n const setStatus = (statusDesc: string) => {\n params.value.statusDesc = statusDesc;\n filterRef.value?.search();\n };\n\n defineExpose({ reset: () => tableRef.value?.reset(), setStatus });\n\n /**\n * 导出数据\n */\n const exporting = ref(false);\n const selectionRows = ref<LLMReportCase[]>([]);\n const handleExport = () => {\n exporting.value = true;\n exportLLMSingleResultCases({\n caseResultIds: selectionRows.value.map((item) => item.id),\n toolType: currentType,\n jobId: currentJobId,\n runSeq: props.runSeq,\n }).finally(() => {\n exporting.value = false;\n });\n };\n</script>\n<style scoped lang=\"scss\"></style>\n",
},
hunks: [
'--- src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue\n+++ src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue\n@@ -6,10 +6,19 @@\n <BasicTable\n ref="tableRef"\n manual-request\n+ selection\n+ tool-bar\n+ v-model:selection-rows="selectionRows"\n+ row-key="id"\n :request="queryCaseResult<LLMReportCase>"\n :params="finalParams"\n :columns="columns"\n >\n+ <template #headers>\n+ <el-button size="small" :disabled="!selectionRows.length" @click="handleExport" :loading="exporting">\n+ 导出数据\n+ </el-button>\n+ </template>\n <template #aiResults_header>\n <span v-if="currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Assert"> 分析结果 </span>\n <span v-else-if="currentAnalyzeType === ResAnalysisTmpTypeEnum.LLM_Mark_Avg"> 平均分 </span>\n',
"--- src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue\n+++ src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue\n@@ -43,6 +52,7 @@\n queryCaseResult,\n AnalyzeResult,\n } from '@/apis/wqe-case/result/singleResult';\n+ import { exportLLMSingleResultCases } from '@/apis/wqe-testcase/result';\n import { createDrawer } from '@/components/basic/basicDrawer';\n import { BasicTableInstance, Column } from '@/components/basic/basicTable';\n import { FilterConditionDto } from '@/components/business/filters';\n",
'--- src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue\n+++ src/views/test/result/singleResult/singleResultDetail/llm/components/result.vue\n@@ -137,5 +147,22 @@\n };\n \n defineExpose({ reset: () => tableRef.value?.reset(), setStatus });\n+\n+ /**\n+ * 导出数据\n+ */\n+ const exporting = ref(false);\n+ const selectionRows = ref<LLMReportCase[]>([]);\n+ const handleExport = () => {\n+ exporting.value = true;\n+ exportLLMSingleResultCases({\n+ caseResultIds: selectionRows.value.map((item) => item.id),\n+ toolType: currentType,\n+ jobId: currentJobId,\n+ runSeq: props.runSeq,\n+ }).finally(() => {\n+ exporting.value = false;\n+ });\n+ };\n </script>\n <style scoped lang="scss"></style>\n',
],
};
export const e = {
oldFile: {
fileName: "src/apis/modules/catalog/module.ts",
content:
"export type CataLogTreeItem = {\n id: number;\n depoId: number;\n key: string;\n level: number;\n title: string;\n value: string;\n isLeaf: boolean;\n parentId: number;\n inherited: boolean;\n createTime: string;\n updateTime: string;\n reviewers: string;\n // TODO\n state: number;\n children: null | CataLogTreeItem[];\n};\n\nexport type ApplyCataLogItem = {\n applyId: number;\n catalogId: number;\n createTime: string;\n updateTime: string;\n // TODO\n deleted: number;\n\n id: number;\n remark: string | null;\n // TODO\n reviewState: number;\n\n reviewers: string;\n version: number;\n}\n",
},
newFile: {
fileName: null,
content: null,
},
hunks: [
"--- src/apis/modules/catalog/module.ts\n+++ /dev/null\n@@ -1,34 +0,0 @@\n-export type CataLogTreeItem = {\n- id: number;\n- depoId: number;\n- key: string;\n- level: number;\n- title: string;\n- value: string;\n- isLeaf: boolean;\n- parentId: number;\n- inherited: boolean;\n- createTime: string;\n- updateTime: string;\n- reviewers: string;\n- // TODO\n- state: number;\n- children: null | CataLogTreeItem[];\n-};\n-\n-export type ApplyCataLogItem = {\n- applyId: number;\n- catalogId: number;\n- createTime: string;\n- updateTime: string;\n- // TODO\n- deleted: number;\n-\n- id: number;\n- remark: string | null;\n- // TODO\n- reviewState: number;\n-\n- reviewers: string;\n- version: number;\n-}\n",
],
};
export const f = {
oldFile: {
fileName: "src/apis/modules/catalog/index.ts",
content:
"import request from '@/apis/fetcher';\nimport type { BasicResponse } from '@/apis/fetcher/type';\nimport type { ApplyCataLogItem, CataLogTreeItem } from './module';\n\nexport const getCataLogTree = (repoId: number) => {\n return request<BasicResponse<CataLogTreeItem[]>>(`/api/catalogue/getCatalogTree/${repoId}`, {\n method: 'GET',\n description: '根据仓库ID获取目录树结构',\n });\n};\n\nexport const getApplyCataLogById = (applyId: number) => {\n return request<BasicResponse<ApplyCataLogItem[]>>(`/api/applyCatalog/getCatalogById/${applyId}`, {\n method: 'GET',\n description: '根据申请ID获取目录结构',\n });\n};\n\nexport const getMrApplyCataLogById = (applyId: number) => {\n return request<BasicResponse<ApplyCataLogItem[]>>(`/api/mrApplyCatalog/getCatalogById/${applyId}`, {\n method: 'GET',\n description: '根据ID获取MR目录结构',\n });\n};\n",
},
newFile: {
fileName: null,
content: null,
},
hunks: [
"--- src/apis/modules/catalog/index.ts\n+++ /dev/null\n@@ -1,24 +0,0 @@\n-import request from '@/apis/fetcher';\n-import type { BasicResponse } from '@/apis/fetcher/type';\n-import type { ApplyCataLogItem, CataLogTreeItem } from './module';\n-\n-export const getCataLogTree = (repoId: number) => {\n- return request<BasicResponse<CataLogTreeItem[]>>(`/api/catalogue/getCatalogTree/${repoId}`, {\n- method: 'GET',\n- description: '根据仓库ID获取目录树结构',\n- });\n-};\n-\n-export const getApplyCataLogById = (applyId: number) => {\n- return request<BasicResponse<ApplyCataLogItem[]>>(`/api/applyCatalog/getCatalogById/${applyId}`, {\n- method: 'GET',\n- description: '根据申请ID获取目录结构',\n- });\n-};\n-\n-export const getMrApplyCataLogById = (applyId: number) => {\n- return request<BasicResponse<ApplyCataLogItem[]>>(`/api/mrApplyCatalog/getCatalogById/${applyId}`, {\n- method: 'GET',\n- description: '根据ID获取MR目录结构',\n- });\n-};\n",
],
};