pageSearch.js 1.5 KB
Newer Older
1 2 3 4 5 6 7 8
import moment from 'moment';
import { Link } from 'react-router-dom';
import React, { Fragment } from 'react';
import { getAppList } from '@/webPublic/Services';
import { redText } from '@/pages/zydxg/CheckManage/PiciSetting/publicFunc';

const width = 110;
const handlePageSearch = (props) => {
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
	const pageSearch = {
		search: {
			url: '/asdasd/asdgggki',
			field: {
				groupId: {
					//
					required: true,
					defaultValue: props.typeList[0].key,
				},
			},
			getInfo: (data, url) => {
				return getAppList(data);
			},
			giveFieldsToFormValues: true,
			afterFormValuesChange: (key, oldValue, getPage) => {
				getPage();
			},
			responseCallBack: (response) => {
				return response;
			},
			condition: [
				{
					key: 'groupId',
					name: '类别',
					type: 'radioGroup',
					options: props.typeList,
				},
			],
			nameSpan: { big: 2, small: 4 },
			fileSpan: { big: 2, small: 2 },
		},
		tableRowKey: 'id',
		columns: [
			{
				dataIndex: 'groupName',
				title: '类别',
				width,
			},
			{
				dataIndex: 'name',
				title: '应用名',
				width: width + 150,
			},
			{
				dataIndex: 'isAuthorized',
				title: '是否已授权',
				render: (text, record) => {
					//  return '未授权';
					const includesIds = props.authorizedApp.map((x) => {
						return x.appId;
					});
					if (record && record.id && includesIds.includes(record.id)) {
						return redText('已授权');
					} else {
						return '未授权';
					}
				},
			},
		],
	};
	return pageSearch;
70 71 72
};

export default handlePageSearch;