Commit 83b3d983 authored by 彭俊龙's avatar 彭俊龙

提交

parent 9b671adc
{
"name": "panda-xform",
"version": "6.10.71",
"description": "6.10.71 解决台账编辑功能白屏问题",
"version": "6.10.78",
"description": "6.10.78 解决台账编辑功能白屏问题",
"keywords": [
"panda-xform"
],
......
......@@ -61,33 +61,18 @@ const ValueEdit = (props) => {
const property = isStoreID ? 'userID' : 'userName'
useEffect(() => {
console.log('ValueEdit', props)
if (widget === 'TextInput') {
let value = presetValue
if (loaclPaths.includes(value)) {
if (value === '【本人姓名】') {
if (isStoreID) {
value = userInfo.OID + ''
} else {
value = userInfo.fullName
}
} else if (value === '【本人部门】') {
if (isStoreID) {
value = userInfo.depart.OID + ''
} else {
value = userInfo.depart.name
}
}
onChange({ fieldName, fieldValue: value })
}
}else if(widget === 'PersonSelector'){
getUsers()
}else if(widget === 'RelevanceSelect'){
getTableData();
if(fieldTableKey){
eventEmitter.on(`${record.ID}_event`, (val)=> dealParentData(val))
}else if(presetValue){
eventEmitter.emit(`${record.ID}_event`, presetValue)
}
switch (widget) {
case 'TextInput':
dealText();
break;
case 'PersonSelector':
getUsers();
break;
case 'RelevanceSelect':
dealSelect();
break;
default:
break;
}
return () => {
if(fieldTableKey){
......@@ -97,6 +82,37 @@ const ValueEdit = (props) => {
}, [])
const dealSelect = ()=>{
setTimeout(()=>{
getTableData();
}, 100)
if(fieldTableKey){
eventEmitter.on(`${record.ID}_event`, (val)=> dealParentData(val))
}
}
const dealText = () =>{
let value = presetValue
if (loaclPaths.includes(value)) {
if (value === '【本人姓名】') {
if (isStoreID) {
value = userInfo.OID + ''
} else {
value = userInfo.fullName
}
} else if (value === '【本人部门】') {
if (isStoreID) {
value = userInfo.depart.OID + ''
} else {
value = userInfo.depart.name
}
}
onChange({ fieldName, fieldValue: value })
}
}
const dealParentData = async (val) => {
if (!whereField) {
console.log('请选择联动字段!')
......@@ -147,13 +163,14 @@ const ValueEdit = (props) => {
console.log('请选择展示字段名!')
return
}
const { code, data, msg } = await GetFieldValueByTableName({
const res = await GetFieldValueByTableName({
params: {
tableName: tableName,
fieldName: `${displayName},${_fieldName}`,
},
data: []
})
const { code, data, msg } = res;
if (code === 0) {
if (Array.isArray(data)) {
setPullDown(data.map(v => {
......
......@@ -358,7 +358,9 @@ const RelationForm = (props) => {
const getDataSourceOther = async (values) => {
setLoadingOther(true)
const { code, data } = await GetAccountPageList({ ...paramsOther, ...values })
const { code, data } = await GetAccountPageList({ ...paramsOther, ...values, extendQuery: {
caseNo: codes['工单编号']
}, })
if (code === 0) {
setDataSourceOther(data?.jsonData ? JSON.parse(data?.jsonData) : [])
setParamsOther({ ...paramsOther, total: data.totalCount })
......
......@@ -96,18 +96,19 @@ const RelevanceSelect = (props) => {
}
const getChildrenSchemaByKey = (key) => {
if(sourceType != '表数据') return null;
let schema = null;
for(const k of Object.keys(addons.formData)){
for(const s of Object.keys(addons.formData[k])){
const path = `${k}.${s}`
let _schema = addons?.getSchemaByPath(path)
if(_schema?.fieldTableKey === key){
schema = _schema
break;
}
if(sourceType != '表数据') return null;
const formData = addons.formData
for(const k of Object.keys(formData).filter(f=> f != 'relationForm')){
for(const s of Object.keys(formData[k])){
const path = `${k}.${s}`
let _schema = addons?.getSchemaByPath(path)
if(_schema?.fieldTableKey === key){
schema = _schema
break;
}
}
}
}
return schema
}
......@@ -127,7 +128,7 @@ const RelevanceSelect = (props) => {
if (Array.isArray(enums)) {
enums.forEach(v => {
if (sourceType === '数据字典') {
children.push(<Option value={v.nodeValue} key={i}>{v.nodeValue}</Option>)
children.push(<Option value={v.nodeValue} key={v}>{v.nodeValue}</Option>)
} else {
let displayData = v?.find(v=> v.fieldName === displayName)
let fieldNameData = v?.find(v=> v.fieldName === fieldName)
......
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