Commit 2c25bf51 authored by 田翔's avatar 田翔

fix: 文本默认值只读不显示问题,下拉框标签颜色显示问题

parent dae7deda
{
"name": "panda-xform",
"version": "4.1.4",
"description": "4.1.4 文件预览报错问题",
"keywords": [
"panda-xform"
"name": "panda-xform",
"version": "4.1.5",
"description": "4.1.5 文本默认值只读不显示问题,下拉框标签颜色显示问题",
"keywords": [
"panda-xform"
],
"main": "./lib/index.js",
"module": "./es/index.js",
"scripts": {
"build": "cross-env BUILD_TYPE=lib father-build && cross-env BUILD_TYPE=es father-build",
"dev": "node examples/server.js",
"release": "np --no-cleanup --yolo --tag",
"prepublishOnly": "yarn build",
"lint": "yarn lint:js && yarn lint:prettier",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:fix": "yarn lint:js -- --fix",
"lint:prettier": "check-prettier lint",
"prettier": "prettier -c --write **/*",
"test": "cross-env NODE_ENV=test jest"
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@babel/plugin-proposal-private-property-in-object": "^7.15.4",
"@babel/runtime": "^7.19.0",
"@wangeditor/editor": "^5.1.22",
"@wangeditor/editor-for-react": "^1.0.6",
"@wisdom-components/RichText": "^0.2.10",
"@wisdom-components/basictable": "^1.5.18",
"@wisdom-components/empty": "^1.4.7",
"antd": "4.20.7",
"antd-img-crop": "^3.14.1",
"form-render": "1.14.7",
"fr-generator": "2.8.3",
"http-proxy-middleware": "^1.0.6",
"moment": "^2.29.1",
"qrcode.react": "^3.1.0",
"react": "17.0.2",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-file-viewer": "^1.2.1",
"react-sign2": "^0.0.3",
"react-svg": "15.1.9",
"viewerjs": "^1.11.3",
"viewerjs-react": "^1.0.2",
"yarn": "^1.22.17"
},
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-jsx": "^7.12.13",
"@babel/plugin-transform-modules-amd": "^7.14.5",
"@umijs/fabric": "^2.0.7",
"@wisdom-map/amap": "1.1.0-beta.45",
"@wisdom-map/arcgismap": "1.4.0-124",
"@wisdom-map/basemap": "1.1.0-24",
"babel-loader": "^8.2.2",
"babel-plugin-import": "^1.13.3",
"check-prettier": "^1.0.3",
"colors": "^1.3.2",
"core-js": "^3.9.1",
"cross-env": "^7.0.2",
"css-loader": "^4.3.0",
"express": "^4.17.1",
"father-build": "^1.18.1",
"file-loader": "^6.2.0",
"html-loader": "^2.1.1",
"husky": "^2.3.0",
"jest": "^25.2.2",
"less": "3.9.0",
"less-loader": "5.0.0",
"lint-staged": "^9.4.2",
"np": "^5.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"prompt": "^1.0.0",
"react-dom": "^17.0.1",
"replace-in-file": "^6.2.0",
"rimraf": "^3.0.0",
"shelljs": "^0.8.4",
"slash": "^3.0.0",
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"url-loader": "^4.1.1",
"webpack": "4.46.0",
"webpack-cli": "^3.3.0",
"webpack-dev-middleware": "3.6.2",
"webpack-hot-middleware": "2.24.3"
},
"repository": {
"type": "git",
"url": ""
},
"files": [
"dist",
"es",
"lib"
],
"lint-staged": {
"**/*.{js,ts,json,css,md}": [
"yarn prettier",
"git add"
],
"main": "./lib/index.js",
"module": "./es/index.js",
"scripts": {
"build": "cross-env BUILD_TYPE=lib father-build && cross-env BUILD_TYPE=es father-build",
"dev": "node examples/server.js",
"release": "np --no-cleanup --yolo --tag",
"prepublishOnly": "yarn build",
"lint": "yarn lint:js && yarn lint:prettier",
"lint:js": "eslint --cache --ext .js,.jsx,.ts,.tsx --format=pretty ./src",
"lint:fix": "yarn lint:js -- --fix",
"lint:prettier": "check-prettier lint",
"prettier": "prettier -c --write **/*",
"test": "cross-env NODE_ENV=test jest"
},
"dependencies": {
"@ant-design/icons": "^4.7.0",
"@babel/plugin-proposal-private-property-in-object": "^7.15.4",
"@babel/runtime": "^7.19.0",
"@wangeditor/editor": "^5.1.22",
"@wangeditor/editor-for-react": "^1.0.6",
"@wisdom-components/RichText": "^0.2.10",
"@wisdom-components/basictable": "^1.5.18",
"@wisdom-components/empty": "^1.4.7",
"antd": "4.20.7",
"antd-img-crop": "^3.14.1",
"form-render": "1.14.7",
"fr-generator": "2.8.3",
"http-proxy-middleware": "^1.0.6",
"moment": "^2.29.1",
"qrcode.react": "^3.1.0",
"react": "17.0.2",
"react-dnd": "^16.0.1",
"react-dnd-html5-backend": "^16.0.1",
"react-file-viewer": "^1.2.1",
"react-sign2": "^0.0.3",
"react-svg": "15.1.9",
"viewerjs": "^1.11.3",
"viewerjs-react": "^1.0.2",
"yarn": "^1.22.17"
},
"devDependencies": {
"@babel/plugin-proposal-private-methods": "^7.14.5",
"@babel/plugin-syntax-dynamic-import": "^7.8.3",
"@babel/plugin-syntax-jsx": "^7.12.13",
"@babel/plugin-transform-modules-amd": "^7.14.5",
"@umijs/fabric": "^2.0.7",
"@wisdom-map/amap": "1.1.0-beta.45",
"@wisdom-map/arcgismap": "1.4.0-124",
"@wisdom-map/basemap": "1.1.0-24",
"babel-loader": "^8.2.2",
"babel-plugin-import": "^1.13.3",
"check-prettier": "^1.0.3",
"colors": "^1.3.2",
"core-js": "^3.9.1",
"cross-env": "^7.0.2",
"css-loader": "^4.3.0",
"express": "^4.17.1",
"father-build": "^1.18.1",
"file-loader": "^6.2.0",
"html-loader": "^2.1.1",
"husky": "^2.3.0",
"jest": "^25.2.2",
"less": "3.9.0",
"less-loader": "5.0.0",
"lint-staged": "^9.4.2",
"np": "^5.0.3",
"npm-run-all": "^4.1.5",
"prettier": "^1.18.2",
"prompt": "^1.0.0",
"react-dom": "^17.0.1",
"replace-in-file": "^6.2.0",
"rimraf": "^3.0.0",
"shelljs": "^0.8.4",
"slash": "^3.0.0",
"style-loader": "^2.0.0",
"svg-url-loader": "^7.1.1",
"url-loader": "^4.1.1",
"webpack": "4.46.0",
"webpack-cli": "^3.3.0",
"webpack-dev-middleware": "3.6.2",
"webpack-hot-middleware": "2.24.3"
},
"repository": {
"type": "git",
"url": ""
},
"files": [
"dist",
"es",
"lib"
"**/*.{js,ts}": [
"yarn lint:fix",
"git add"
]
},
"jest": {
"moduleFileExtensions": [
"js",
"ts"
],
"lint-staged": {
"**/*.{js,ts,json,css,md}": [
"yarn prettier",
"git add"
],
"**/*.{js,ts}": [
"yarn lint:fix",
"git add"
]
},
"jest": {
"moduleFileExtensions": [
"js",
"ts"
],
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.test.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/__tests__/",
"/dist/"
]
},
"author": "dengxiaofeng <1186313486@qq.com>",
"license": "MIT",
"publishConfig": {
"registry": "https://g.civnet.cn:4873"
}
}
"testMatch": [
"<rootDir>/src/**/__tests__/**/*.test.js"
],
"testPathIgnorePatterns": [
"/node_modules/",
"/fixtures/"
],
"coveragePathIgnorePatterns": [
"/node_modules/",
"/__tests__/",
"/dist/"
]
},
"author": "dengxiaofeng <1186313486@qq.com>",
"license": "MIT",
"publishConfig": {
"registry": "https://g.civnet.cn:4873"
}
}
\ No newline at end of file
......@@ -17,6 +17,7 @@ const XRender = (props, ref) => {
useImperativeHandle(ref, () => (
{
getValues,
exportForm,
form,
}
))
......@@ -64,8 +65,7 @@ const XRender = (props, ref) => {
}
childObj[s] = {
...child[s],
// presetValue: value || child[s].presetValue,
presetValue: disabledField ? value : (value || child[s].presetValue),
presetValue: value || child[s].presetValue,
textInputDefalut: child[s].presetValue,
disabled: disabledField,
required
......@@ -90,7 +90,6 @@ const XRender = (props, ref) => {
}, [schemaForm, form, startTime])
const getValues = async () => {
console.log('form', form)
let { data, errors } = await form.submit()
let formValue = []
Object.keys(data).map((k) => {
......@@ -107,6 +106,29 @@ const XRender = (props, ref) => {
}
}
const exportForm = () => {
console.log('form', form)
const { properties } = schemaForm
let array = []
let hiddenFields = Object.keys(form.getHiddenValues()).map(v => v?.split('.')?.[1])
// console.log('hiddenFields', Object.keys(form.getHiddenValues()), hiddenFields)
Object.keys(properties).map(v => {
let childObj = properties[v]?.properties || {}
let child = []
Object.keys(childObj).forEach(v => {
if (hiddenFields.includes(v) ) {
}
})
array.push({
title: properties[v].title,
type: properties[v].type,
child,
})
})
// console.log('form', form.getHiddenValues())
}
//初始化时存储外部传的额外数据
const onMount = () => {
setTimeout(() => {
......
import React from 'react'
import { CloseOutlined } from '@ant-design/icons'
import styles from './index.less'
const hexToRgba = (hex, opacity) => {
......@@ -11,7 +12,7 @@ const hexToRgba = (hex, opacity) => {
const TagPack = (props) => {
const { color, text } = props
const { color, text, onClose } = props
return (
<span
......@@ -19,6 +20,7 @@ const TagPack = (props) => {
style={{ background: hexToRgba(color, 0.4), color: color, border: color ? '1px solid' : 'none' }}
>
{text}
{onClose ? <CloseOutlined style={{ fontSize: '12px', marginLeft: '2px' }} onClick={() => onClose()} /> : null}
</span>
)
}
......
......@@ -13,16 +13,9 @@ const AccountSelector = (props) => {
const userID = window?.globalConfig?.userInfo?.OID || 1
const { value, onChange, schema, addons } = props
const { disabled, accountName, fieldshine, siteFilter, sql, isMultiple, presetValue, placeholder, fieldList } = schema
const initParams = { userID: userID, accountName, sortFields: '录入时间', direction: 'desc', total: 0, pageIndex: 1, pageSize: 100 }
const [params, setParams] = useState({
userID: userID,
accountName,
sortFields: '录入时间',
direction: 'desc',
total: 0,
pageIndex: 1,
pageSize: 100
})
const [params, setParams] = useState(initParams)
const [loading, setLoading] = useState(false)
const [dataSource, setDataSource] = useState([])
const [config, setConfig] = useState({ webShowFieldGroup: '' })
......
import React, { useState, useMemo, useEffect } from 'react'
import { Select, message, Tag } from 'antd'
import { GetSelectItemList, GetFieldValueFromTable, getStationListByUserID, getStationIDListByUserID } from '../../../../apis/process'
import TagPack from '../../../components/TagPack'
const { Option } = Select
......@@ -123,7 +124,7 @@ const ComboBox = (props) => {
const { label, value, closable, onClose } = props
const color = useMemo(() => {
let color = '#f2f4f5'
let color = ''
options.forEach(v => {
if (v.value === value) {
color = v.color
......@@ -136,20 +137,30 @@ const ComboBox = (props) => {
event.preventDefault()
event.stopPropagation()
}
if(!color) {
return label
}
return (
<Tag
color={color}
onMouseDown={onPreventMouseDown}
closable={closable}
onClose={onClose}
style={{
marginRight: 3,
}}
>
{label}
</Tag>
);
<span style={{ marginRight: '3px' }}>
<TagPack color={color} text={label} onClose={onClose} />
</span>
)
// return (
// <Tag
// color={color}
// onMouseDown={onPreventMouseDown}
// closable={closable}
// onClose={onClose}
// style={{
// marginRight: 3,
// }}
// >
// {label}
// </Tag>
// );
}
const isTagRender = color ? { tagRender } : {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment