1.6.4 • Published 1 year ago

yasuo-sdk v1.6.4

Weekly downloads
-
License
-
Repository
-
Last release
1 year ago

yasuo-sdk

此项目提供以下功能: 1. 问题反馈集合 2. Table表格集合 3. 分页 4. 搜索栏 5. 页面整体布局包括 菜单,面包屑 layout等 6. 自定义表单 ...

使用方法:

    npm install yasuo-sdk
    
    // main.ts
    import YasuoSdk from 'yasuo-sdk'
    app.use(YasuoSdk) 

发布方法

    npm run build
    
    // 更改 package.json version
    version: 'x.x.x'

    npm publish

feedbackQuestion(问题反馈)

            <feedback-question
              onHandleClickConfirm={(data: any) => {
                handleClickFeedBack(data, 'ok')
              }}
              onHandleClickCancel={(data: any) => handleClickFeedBack(data, 'cancel')}
              fileType="base64"
              tips={i18n.global.t(
                '仅允许上传jpeg/png图片格式, 且最多支持9张图片 (仅允许上传小于1M的图片,超过请改为截图上传)'
              )}
              isCurrentUrl
              isNeedPaste
              visible={feedbackQuestionObj.visible}
            />
属性名说明类型默认值
filteType所返回的图片格式,当设置为'base64时'返回编码,当设置为file时返回文件对象stringbase64
tips反馈框底部备注信息stirng仅允许上传jpeg/png图片格式, 且最多支持9张图片
isCurrentCaptureScreen当提交反馈时是否需要截屏当前屏幕booleanfalse
isCurrentUrl当提交反馈时是否需要当前路由链接booleanfalse
isNeedPaste是否支持粘贴截图booleanfalse
limitNumber最大支持图片数量number9
onHandleClickConfirm单击确定的回调事件Function
onHandleClickCancel单机取消的回调事件Function

Table(Table页合集)

    <Table-index
      class="tableIndex"
      data={{
        searchListData: {
          list: [
            {
              label: '报告类型',
              value: 'report_type',
              type: 'select',
              option: [
                {
                  value: 'function_testing',
                  label: '功能测试'
                },
                {
                  value: 'performance_testing',
                  label: '性能测试'
                }
              ]
            }
          ],
          onQuery: async (params: any) => {
            console.log(params, 'params')
            const response: any = await service({
              url: '/api/v1/test_report/record',
              method: 'get',
              data: {
                page: params?.page || 1,
                page_size: params?.page_size || 10,
                report_type: params?.report_type,
                test_branch: params?.test_branch,
                biz_id: 2,
                create_user: params?.create_user,
                dept_id: 795
              }
            })
            console.log(response, 'roro')
            return {
              response: response?.results?.data || [],
              total: response?.results?.total || 0
            }
          },
          prefix: () => {
            return (
              <div>
                <el-button type="primary">新增测试报告</el-button>
              </div>
            )
          }
          // suffix: () => {
          //   return <div>2222</div>
          // }
        },
        // tableData: [],
        stripe: true,
        isPage: true,
        isSearch: true,
        tableColumns: [
          {
            label: '部门/业务',
            prop: 'dept_name'
          },
          {
            label: '报告类型',
            prop: 'report_type'
          },
          {
            label: '测试结果',
            prop: 'test_result'
          }
        ],
        slots: {
          header: ({ column, $index }: any) => {
            return $index === 0 ? '部门/业务' : column.label
          },
          default: (record: any) => {
            console.log(record, 'roroor')
          }
        }
      }}
    />
属性名说明类型默认值
tableColumnstable的列数据Array[]
stripe是否开启斑马纹booleantrue
slots请看element-table官方支持header default
isPage是否启用分页booleantrue
isSearch是否启用顶部搜索栏booleantrue
searchListData如果启用顶不搜索栏则必传SearchListType{}

SearchList(筛选栏列表)

          <SearchListIndex
            ref={searchList}
            data={{
              list: [
                {
                  label: '报告类型',
                  value: 'report_type',
                  type: 'select',
                  option: [
                    {
                      value: 'function_testing',
                      label: '功能测试'
                    },
                    {
                      value: 'performance_testing',
                      label: '性能测试'
                    }
                  ]
                }
              ],
              onQuery: async (params: any) => {
                console.log(params, 'params')
                const response: any = await service({
                  url: '/api/v1/test_report/record',
                  method: 'get',
                  data: {
                    page: params?.page || 1,
                    page_size: params?.page_size || 10,
                    report_type: params?.report_type,
                    test_branch: params?.test_branch,
                    biz_id: 2,
                    create_user: params?.create_user,
                    dept_id: 795
                  }
                })
                console.log(response, 'roro')
                return {
                  response: response?.results?.data || [],
                  total: response?.results?.total || 0
                }
              },
              prefix: () => {
                return (
                  <div>
                    <el-button type="primary">新增测试报告</el-button>
                  </div>
                )
              },
              suffix: () => {
                return <div>2222</div>
              }
            }}
            onHandleClickConfirm={handleClickConfirm}
            onHandleClickCancel={handleClickCancel}
          />
属性名说明类型默认值/返回值
list筛选栏数据listType[]
onQuery筛选栏筛选接口Function
prefix筛选栏前置自定义Function
suffix筛选栏后置自定义Function
handleClickConfirm点击确定回调Function筛选条件数据
handleClickCancel点击重置回调Function

listType:

属性名说明类型默认值/返回值
labellabelstring
value绑定值string
type类型stringinput,select,date,dateTime,cascader
option部份类型需要的option{value: stirng, label: string}[]>[]

Layout(整体结构)

          <Layout-index
            data={{
              route: route.value,
              routeList: RouteList,
              userInfo: {
                name: '亚索',
                avatar: ''
              },
              isLang: true
            }}
            v-slots={{
              container: () => {
                return <router-view></router-view>
              }
            }}
          />
属性名说明类型默认值/返回值
routeList路由列表routeListType[][]
routevueRoutevueRouteType
userInfo用户信息userInfoType{}
isLang是否需要切换语言booleantrue
suffix后置自定义显示Function

routeListType:

属性名说明类型默认值/返回值
path路由地址string‘/’
title路由标题string
icon路由图标(iconfly)stirng''
children子路由routeListType[][]
menu是否在菜单展示booleantrue

userInfoType:

属性名说明类型默认值/返回值
name用户姓名string‘’
avatar用户头像string’‘
1.6.4

1 year ago

1.6.3

1 year ago

1.6.2

1 year ago

1.6.1

1 year ago

1.6.0

1 year ago

1.5.9

1 year ago

1.5.8

1 year ago

1.5.7

1 year ago

1.5.6

1 year ago

1.5.5

1 year ago

1.5.4

1 year ago

1.5.3

1 year ago

1.5.2

1 year ago

1.5.1

1 year ago

1.5.0

1 year ago

1.4.9

1 year ago

1.4.8

1 year ago

1.4.6

1 year ago

1.4.5

1 year ago

1.4.4

1 year ago

1.4.3

1 year ago

1.4.2

1 year ago

1.4.1

1 year ago

1.4.7

1 year ago

1.4.0

1 year ago

1.3.9

1 year ago

1.3.8

1 year ago

1.3.7

1 year ago

1.3.6

1 year ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.1

1 year ago

1.3.0

1 year ago

1.2.0

1 year ago

1.2.8

1 year ago

1.1.9

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago