lyx-ai-word
TypeScript icon, indicating that this package has built-in type declarations

1.0.7 • Public • Published

lyx-ai-word 乐易学ai解析word组件库文档

安装

1. main.js 中引入 LyxAiWord

import LyxAiWord from 'lyx-ai-word'
import 'lyx-ai-word/dist/lyxAiWord.css'

createApp(App)
    .use(LyxAiWord)
    .mount("#app")

2. 在vue模板中使用

import { AiWordResult } from 'lyx-ai-word'

<ai-word-result
    :html="html"
    :logs="logs"
    :log-id="logId"
    @open="getQuestions"
    :questions="questions"
    @save="saveMyResource"
    @analyse="handleAnalyse"
/>

3.组件中提供的函数和接口

(1).LyxAiLogProps 日志列表

export interface LyxAiLogProps {
    logId: string
    logTime: string
}

(2).LyxAiQuestionProps ai解析试题列表

export interface LyxAiQuestionProps {
    id: string
    year: string // 试题年份
    index: number // 试题序号
    title: string // 题干
    answer: string // 答案
    parse: string // 试题解析(富文本)
    status: 0 | 1 | 2 // 题目状态(0:未操作 1:编辑过 2:已录进题库)
    subjectId: string // 科目id
    questionId: string // 科目id
    selectType: 1 | 2 // 判断题类型 1 √×类型判断题 2 TF类型判断题 | 选择题类型 1 ABC类型选择题 2 123类型选择题
    subjectName: string // 科目名称
    schoolPhase: string // 学段编码
    questionTypeId: string // 试题类型id
    schoolPhaseName: string // 学段名称
    questionTypeName: string // 试题类型名称
    hardLevel: 1 | 2 | 3 | 4 | 5 // 难易度(1简单 2一般 3中等 4困难 5特难)
    knowledge: { id: string; name: string }[] // 知识点
}

(3).assembleQuestion函数,用于解析接口返回的试题数据,返回LyxAiQuestionProps数组

{
    "QuestionDetail": {
        "Title": "<div>课题1金属材料拔尖检测<div>",
        "Answer": "",
        "QuestionTypeId": "F3E3DA08DC5D4308FC687FAB0E3EA653",
        "QuestionTypeName": "其他",
        "KnowLedges": [],
        "HardLevel": 0
    },
    "QuestionAnalysisDetailId": "C670DC089362679256F2286B9B246BF4",
    "QuestionState": 0,
    "Sort": 1
}

(4).AiWordResult 组件中的参数及方法

参数及事件名 含义
html word解析后的字符串
logs 解析日志列表(LyxAiLogProps格式)
log-id 当前展示的日志id
questions 解析后的试题列表(LyxAiQuestionProps格式)
@open 点击对应的日志文件
@save 批量存入“我的资源”
@save 批量存入“我的资源”
@analyse 全局解析和局部解析

Readme

Keywords

none

Package Sidebar

Install

npm i lyx-ai-word

Weekly Downloads

0

Version

1.0.7

License

none

Unpacked Size

363 kB

Total Files

6

Last publish

Collaborators

  • leyixue