Commit 83544e8c authored by wuting's avatar wuting

Merge branch 'v2-220418' of…

Merge branch 'v2-220418' of https://gitlab.shushangyun.com/linkseeks-design/pro-platform into v2-220418
parents f9388903 2e907e69
......@@ -28,7 +28,6 @@ const fetchMemberAbilitySelect = async (params) => {
}
const SalesmanBindAdded = (props) => {
const ref = useRef<any>({})
const staticData = useRef<any>([])
const [rowSelection, rowCtl] = useRowSelectionTable({ customKey: 'relationId' })
const [realRowSelection, realRowCtl] = useRowSelectionTable({ customKey: 'relationId' })
......@@ -38,8 +37,6 @@ const SalesmanBindAdded = (props) => {
const [keywordName, setKeywordName] = useState<string>('')
const intl = useIntl()
console.log(rowSelection, rowCtl, '测试')
const fliterTableData = useMemo(() => {
if (!keywordName) {
return tableData
......@@ -63,6 +60,7 @@ const SalesmanBindAdded = (props) => {
if (res.code === 1000) {
formAction.setFieldValue('userId', [res.data])
// 添加一个remote标识, 带有此标识的 将会调用接口解绑
console.log(res.data.data.map(v => ({ ...v, isRemote: true })))
setTableData(res.data.data.map(v => ({ ...v, isRemote: true })))
}
})
......@@ -76,7 +74,6 @@ const SalesmanBindAdded = (props) => {
}, [realRowCtl.selectedRowKeys])
useEffect(() => {
console.log(tableData, 'tableData')
rowCtl.setSelectedRowKeys(tableData.map(v => v.relationId))
rowCtl.setSelectRow([...tableData])
......@@ -308,10 +305,12 @@ const SalesmanBindAdded = (props) => {
userId,
...params
})
if (code === 1000) {
setTableData(data.data)
if (code !== 1000) {
message.error(intl.formatMessage({ id: code }))
setTableData([])
return
}
return code === 1000 ? data : []
setTableData([...data.data.map(v => ({ ...v, isRemote: true }))])
} else {
return []
}
......@@ -344,11 +343,6 @@ const SalesmanBindAdded = (props) => {
actions={formAction}
editable={pageStatus !== PageStatus.PREVIEW}
previewPlaceholder=" "
effects={($, ctx) => {
$('onFieldChange', 'userId').subscribe(async state => {
fetchMemberSaleChannel({current: 1, pageSize: 10})
})
}}
schema={{
type: 'object',
properties: {
......@@ -358,9 +352,9 @@ const SalesmanBindAdded = (props) => {
'x-component': 'CustomRelevance',
'x-component-props': {
title: intl.formatMessage({ id: 'common.text.select' }),
disabled: (pageStatus === PageStatus.EDIT),
modalProps: {
title: intl.formatMessage({ id: 'channel.form.modal.salesman.title' }),
},
columns: abilityColumns,
fetchTableData: fetchMemberAbilitySelect,
......
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