当前位置: 首页 > news >正文

湖南长沙网站制作ninety ajax wordpress

湖南长沙网站制作,ninety ajax wordpress,百度com百度一下你,中国各大网站名称与编辑表格外的内容联动 value 同 dataSource#xff0c;传入一个数组,是 table 渲染的元数据 T[] undefined onChange dataSource 修改时触发#xff0c;删除和修改都会触发,如果设置了 value#xff0c;Table 会成为一个受控组件。 (value:T[])void undefined recordC…与编辑表格外的内容联动 value 同 dataSource传入一个数组,是 table 渲染的元数据 T[] undefined onChange dataSource 修改时触发删除和修改都会触发,如果设置了 valueTable 会成为一个受控组件。 (value:T[])void undefined recordCreatorProps 新建一行数据的相关配置 RecordCreatorProps ButtonProps - maxLength 最大的行数到达最大行数新建按钮会自动消失 number - editable 可编辑表格的相关配置 TableRowEditable - controlled 是否受控, 如果受控每次编辑都会触发 onChange并且会修改 dataSource boolean false editableFormRef table 所有的 form带了一些表格特有的操作 React.RefEditableFormInstanceT undefinedimport type {ActionType,EditableFormInstance,ProColumns,ProFormInstance, } from ant-design/pro-components; import {EditableProTable,ProCard,ProForm,ProFormDependency,ProFormDigit, } from ant-design/pro-components; import React, { useRef, useState } from react;type DataSourceType {id: React.Key;associate?: string;questionsNum?: number;type?: string;fraction?: number;scoringMethod?: string; };const defaultData: DataSourceType[] [{id: 624748504,associate: 题库名称一,questionsNum: 10,type: multiple,scoringMethod: continuous,fraction: 20,},{id: 624691229,associate: 题库名称二,questionsNum: 10,scoringMethod: continuous,type: radio,fraction: 20,},{id: 624748503,associate: 题库名称三,questionsNum: 10,type: judge,scoringMethod: continuous,fraction: 20,},{id: 624691220,associate: 题库名称四,questionsNum: 10,scoringMethod: continuous,type: vacant,fraction: 20,}, ];export default () {const [editableKeys, setEditableRowKeys] useStateReact.Key[](() []);const formRef useRefProFormInstanceany();const actionRef useRefActionType();const editableFormRef useRefEditableFormInstance();const columns: ProColumnsDataSourceType[] [{title: 关联题库,dataIndex: associate,valueType: text,ellipsis: true,},{title: 题型,key: type,dataIndex: type,valueType: select,valueEnum: {multiple: { text: 多选题, status: Default },radio: { text: 单选题, status: Warning },vacant: {text: 填空题,status: Error,},judge: {text: 判断题,status: Success,},},},{title: 题数,dataIndex: questionsNum,valueType: digit,},{title: 计分方式,dataIndex: scoringMethod,valueType: select,request: async () [{value: discrete,label: 离散型,},{value: continuous,label: 连续型,},],fieldProps: (_, { rowIndex }) {return {onSelect: () {// 每次选中重置参数editableFormRef.current?.setRowData?.(rowIndex, { fraction: [] });},};},},{title: 分值,width: 150,dataIndex: fraction,valueType: (record) {const scoringMethod record?.scoringMethod;if (scoringMethod discrete) return select;return digit;},fieldProps: {mode: multiple,},request: async () [A, B, D, E, F].map((item, index) ({label: item,value: index,})),},{title: 操作,valueType: option,render: (_, row) [akeydeleteonClick{() {const tableDataSource formRef.current?.getFieldValue(table,) as DataSourceType[];formRef.current?.setFieldsValue({table: tableDataSource.filter((item) item.id ! row?.id),});}}移除/a,akeyeditonClick{() {actionRef.current?.startEditable(row.id);}}编辑/a,],},];return (ProCarddivstyle{{maxWidth: 800,margin: auto,}}ProForm{table: DataSourceType[];}formRef{formRef}initialValues{{table: defaultData,}}ProFormDependency name{[table]}{({ table }) {const info (table as DataSourceType[]).reduce((pre, item) {return {totalScore:pre.totalScore parseInt((item?.fraction || 0).toString(), 10),questions:pre.questions parseInt((item?.questionsNum || 0).toString(), 10),};},{ totalScore: 0, questions: 0 },);return (divstyle{{display: flex,alignItems: center,gap: 16,paddingBlockEnd: 16,}}div style{{ flex: 1 }}总分{info.totalScore}/divdiv style{{ flex: 1 }}题数{info.questions}/divdiv style{{ flex: 2 }}ProFormDigit label及格分 //divdiv style{{ flex: 2 }}ProFormDigit label考试时间(分钟) //div/div);}}/ProFormDependencyEditableProTableDataSourceTyperowKeyidscroll{{x: true,}}editableFormRef{editableFormRef}controlledactionRef{actionRef}formItemProps{{label: 题库编辑,rules: [{validator: async (_, value) {if (value.length 1) {throw new Error(请至少添加一个题库);}if (value.length 5) {throw new Error(最多可以设置五个题库);}},},],}}maxLength{10}nametablecolumns{columns}recordCreatorProps{{record: (index) {return { id: index 1 };},}}editable{{type: multiple,editableKeys,onChange: setEditableRowKeys,}}//ProForm/div/ProCard); };
http://www.pierceye.com/news/596985/

相关文章:

  • 做网站上哪买空间帝国网站管理系统安装连接不上数据库
  • 做前端网站用什么工具网站备案后怎么做实名认证
  • 做兼职那个网站比较好重庆的seo服务公司
  • 网站建设流费用南通seo排名公司
  • 河北邢台移动网站建设单片机做网站
  • 佛山网站制作的公司做文库网站怎么赚钱吗
  • 博客网站 做淘宝客咸阳网站建设推广
  • 佛山手机网站建设优化做网站要多大的画布
  • 网站结构优化包括什么网站建设定制开发
  • 做装修的有那些网站wordpress获取用户位置
  • 找事做网站公司网站网页设计
  • 网站数据哪个网站可以做图片
  • 网站添加google地图阿里云服务器可以访问国外网站吗
  • 大连免费网站制作重庆哪些网站推广公司
  • 查建设工程规划许可证网站广州模板建站公司
  • 怎么做网站的超级链接有哪些做的很漂亮的网站
  • 做旅游网站挣钱吗wordpress 虎嗅网
  • 乐清网站制作的公司php 网站源代码
  • 外国知名个人网站衡阳做网站公司
  • 女人网站源码沈阳大型网站制作公司
  • 河南外贸网站建设中国建设银行密码重置网站
  • 搭建网站是什么专业资阳网络营销顾问招聘
  • 建个门户网站网站开发人员配备
  • 营销型网站建设 上海工程造价
  • 做暧暧暖网站想建个企业网站
  • 南通做外贸的公司网站建筑招聘求职网
  • 网站排名顾问江苏省建设网站首页
  • 青岛找网站建设公司印记室内设计网站
  • 上海网站建设聚众网络网站对域名
  • 可做百科资料参考的网站福州网页定制