消息中心添加消息选择按部门后无法获取部门数据

发布于 2022-12-28 17:47:19

其它地方可以获取到部门数据,只有消息中心无法获取到部门数据,无法选择部门
Snipaste_2022-12-28_17-46-26.jpg

查看更多

关注者
0
被浏览
422
1 个回答
fw2170
fw2170 2023-09-25
这家伙很懒,什么也没写!

修改srcviewssystemmessageCentercrud.js中ret.data.data改为ret.data
{

    title: '目标部门',
    key: 'target_dept',
    search: {
      disabled: true
    },
    width: 130,
    type: 'table-selector',
    dict: {
      cache: false,
      url: '/api/system/dept/all_dept/',
      isTree: true,
      value: 'id', // 数据字典中value字段的属性名
      label: 'name', // 数据字典中label字段的属性名
      children: 'children', // 数据字典中children字段的属性名
      getData: (url, dict, {
        form,
        component
      }) => {
        return request({
          url: url
        }).then(ret => {
          return ret.data  //修改此处
        })
      }
    },
    disabled: true,
    form: {
      rules: [ // 表单校验规则
        {
          required: true,
          message: '必填项'
        }
      ],
      itemProps: {
        class: { yxtInput: true }
      },
      component: {
        span: 24,
        show (context) {
          return context.form.target_type === 2
        },
        props: {
          multiple: true,
          elProps: {
            treeConfig: {
              transform: true,
              rowField: 'id',
              parentField: 'parent',
              expandAll: true
            },
            columns: [
              {
                field: 'name',
                title: '部门名称',
                treeNode: true
              },
              {
                field: 'status_label',
                title: '状态'
              },
              {
                field: 'parent_name',
                title: '父级部门'
              }
            ]
          }
        }
      }
    },
    component: {
      name: 'manyToMany',
      valueBinding: 'dept_info',
      children: 'name'
    }
  },
  {

撰写答案

请登录后再发布答案,点击登录

发布
问题

分享
好友

手机
浏览

扫码手机浏览