|
|
1、全部采用异步请求的方式处理,在init的文件中,需要注意enumList方法的请求接口地址不能使用path变量,直接使用真实接口
- import {
- enumList
- } from './api'
- const getEnumList = async(type) => {
- const arr = []
- const response = await enumList({
- type: type
- })
- const list = response.data.list
- for (const key in list) {
- arr.push({
- text: list[key],
- value: key
- })
- }
- return arr
- }
复制代码 2、在表单中调用方法获取options
- source: {
- type: 'select',
- label: '商机来源',
- options: () => {
- return getEnumList('businessSource')
- }
- },
复制代码
3、在检索中配置list值
- export const filterInfo = {
- fieldList: [{
- label: '关键字',
- type: 'input',
- placeholder: '请输入关键字',
- value: 'DiandiBusinessOpportunityList[keywords]'
- }, {
- label: '客户名称',
- type: 'input',
- value: 'DiandiBusinessOpportunityList[name]'
- }, {
- label: '状态',
- type: 'select',
- value: 'DiandiBusinessOpportunityList[status]',
- list: 'statusList'
- }, {
- label: '商机来源',
- type: 'select',
- value: 'DiandiBusinessOpportunityList[source]',
- list: 'stjList'
- }, {
- label: '跟进人',
- type: 'select',
- value: 'DiandiBusinessOpportunityList[follower]'
- }],
- listTypeInfo: {
- stjList: () => {
- return getEnumList('businessSource')
- },
- statusList: () => {
- return getEnumList('businessStatus')
- }
- }
- }
复制代码
|
|