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

提交

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