宜搭开发包
    正在准备搜索索引...

    宜搭开发包

    欢迎!

    Yida Dev Bundle(宜搭开发包)是由帕鲁开发的一系列宜搭增强外挂库,深度适配钉钉教育的业务场景。您可以使用它们创造出惊人的效果,只需要一行代码。

    您可以在宜搭页面生命周期钩子函数 didMount() 里远程引用,这会将所有库全部挂载到顶级作用域:

    // @ts-check

    export async function didMount() {
    window.g = this
    await g.utils.loadScript("https://cdn.ahkdxx.cn/yida-dev-bundle/dist/latest.js")

    // 你也可以使用金丝雀频道来预览实验中特性:
    // await g.utils.loadScript("https://cdn.ahkdxx.cn/yida-dev-bundle/dist/canary.js")

    // 以上的均可以用 GitHub 源代替:
    // await g.utils.loadScript("https://yida-dev-bundle.pal.xrl.im/latest.js")
    // await g.utils.loadScript("https://yida-dev-bundle.pal.xrl.im/canary.js")
    }

    目前有以下库:

    名称 描述 适用场景示例 参考
    EZPush 快速推送信息到钉钉 向群组定期分享公众号文章 源码
    Infection 侵入式地影响组件的行为模式 令下拉选择框变为学年学期组件 源码
    Mock 为特定模式的应用提供演示数据 生成 2000 个人的姓名、身份证号和手机号 源码
    QuickMap 作为应用和表单的 ORM 将实例的一对多转换为多个一对一关系 源码
    Zeppelin 组合多个组件实现复杂业务目标 在页内实现表格搜索 源码

    和以下工具类:

    名称 描述 参考
    CountMap 对象序列计数图 源码
    CSSBuilder 从对象构建 CSS 字符串 源码
    DateX 具有 Temporal 风味的日期对象 源码
    Debounce 防抖 源码
    Logger 日志发生器 源码
    Member 成员字段行为归一化 源码
    Memo 检查对象是否发生变化 源码
    SchoolDays 学校日期 源码
    Tasks 处理异步任务序列 源码
    Throttle 节流 源码
    Tube 管道 源码

    阅读 API 文档 以了解更多。

    const tableData = g.$("<table_field_id>").getValue()
    await Tasks.of(
    ["<bot_secret_1>", "<bot_secret_2>", "<bot_secret_3>"].map(
    (s) => () =>
    EZPush.FeedCard.of(s).post({
    links: tableData.map((row) => ({
    title: row["<text_field_id_1>"],
    messageURL: row["<text_field_id_2>"],
    picURL: row["<picture_field_id>"][0].url,
    })),
    }),
    ),
    )
    Infection.SchoolYear.of()
    .compose(Infection.Semester.of())
    .compose(Infection.Week.of())
    .infect("<text_field_id>")
    .setDefaultValue()
    const idG = Mock.ID.of()
    const telG = Mock.Tel.of()
    g.$("<table_field_id>").setValue(
    Mock.PersonalName.of()
    .want(50)
    .map((e) => ({
    "<text_field_id_1>": e,
    "<text_field_id_2>": idG.wantOne(),
    "<text_field_id_3>": telG.wantOne(),
    })),
    )
    const history = await QuickMap.use().select({}, void 0, void 0, {
    originatorId: g.utils.getLoginUserId(),
    })
    g.$("<number_field_id>").setValue(history.length)

    仅限自定义页面可以在单一表格上使用多次 Zeppelin,表单中在单一表格上最多只能使用一次 Zeppelin

    const titleCompute = () => `${g.utils.getLoginUserName()}${g.$("<text_field_id>").getValue()}数据`
    Zeppelin.TableExporter.of().compose("<button_field_id_1>", "<table_field_id>", titleCompute)
    Zeppelin.ViewCapturer.of().compose("<button_field_id_2>", "<table_field_id>", titleCompute)