123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242 |
- import { BasicColumn } from '/@/components/Table';
- import { FormSchema } from '/@/components/Table';
- import { defHttp } from '/@/utils/http/axios';
- //列表数据
- export const columns: BasicColumn[] = [
- {
- title: 'IMO',
- align: 'center',
- dataIndex: 'imo',
- },
- {
- title: '船名称(ship name)',
- align: 'center',
- dataIndex: 'shipName',
- },
- {
- title: 'hull number',
- align: 'center',
- dataIndex: 'hullNumber',
- },
- {
- title: '船类型(ship type)',
- align: 'center',
- dataIndex: 'shipType',
- },
- {
- title: '船厂(ship factory)',
- align: 'center',
- dataIndex: 'shipFactory',
- },
- {
- title: '造船日期(ship date)',
- align: 'center',
- dataIndex: 'shipDate',
- },
- {
- title: '关联客户(relate customer)',
- align: 'center',
- dataIndex: 'relateCustomer',
- },
- ];
- //查询数据
- export const searchFormSchema: FormSchema[] = [
- {
- label: 'IMO',
- field: 'imo',
- component: 'JInput',
- labelWidth: 180,
- // colProps: {span: 8},
- },
- {
- label: '船名称(ship name)',
- field: 'shipName',
- labelWidth: 150,
- component: 'JInput',
- // colProps: {span: 8},
- },
- {
- label: 'hull number',
- field: 'hullNumber',
- component: 'JInput',
- labelWidth: 150,
- //colProps: {span: 6},
- },
- {
- label: '船厂(ship factory)',
- field: 'shipFactory',
- component: 'JDictSelectTag',
- labelWidth: 180,
- componentProps: {
- dictCode: 'ship_factory',
- showSearch: true,
- },
- //colProps: {span: 6},
- },
- {
- label: '关联客户(relate customer)',
- field: 'relateCustomer',
- component: 'JSelect',
- componentProps: {
- getOptionUrl: () => defHttp.get({ url: '/cuspCode/cuspCustomerProfile/list?pageSize=-1'}),
- showField:"currency_dictText+name"
- },
- labelWidth: 180,
- colProps: {span: 12},
- },
-
-
- {
- label: '序列号(serial number)',
- field: 'serialNumber',
- component: 'JInput',
- labelWidth: 150,
- //colProps: {span: 6},
- },
- {
- label: '造船日期(ship date)',
- field: 'shipDate',
- component: 'RangePicker',
- labelWidth: 180,
- componentProps: {
- valueType: 'Date',
- showTime: false,
- },
- //colProps: {span: 6},
- },
- {
- label: '船类型(ship type)',
- field: 'shipType',
- component: 'JDictSelectTag',
- labelWidth: 180,
- componentProps: {
- dictCode: 'ship_type',
- showSearch: true,
- },
- //colProps: {span: 6},
- },
- {
- label: '状态(status)',
- field: 'status',
- component: 'JDictSelectTag',
- componentProps: {
- dictCode: 'valid_status',
- },
- //colProps: {span: 6},
- },
- ];
- //表单数据
- export const formSchema: FormSchema[] = [
- {
- label: 'IMO',
- field: 'imo',
- component: 'Input',
- componentProps: {
- AutoComplete: 'off',
- },
- // required: true,
- },
- {
- label: '船名称(ship name)',
- field: 'shipName',
- component: 'Input',
- required: true,
- componentProps: ({ formModel }) => {
- return {
- AutoComplete: 'off',
- onblur: ({ currentTarget }) => {
- const stringLog = currentTarget.value;
- let newString = '';
- for (let i = 0; i < stringLog.length; i++) {
- if (/^[A-Za-z]$/.test(stringLog[i]) && /^[a-z]$/.test(stringLog[i])) {
- newString = newString + stringLog[i].toUpperCase();
- } else {
- newString = newString + stringLog[i];
- }
- }
- formModel.shipName = newString;
- },
- };
- },
- },
- {
- label: 'hull number',
- field: 'hullNumber',
- component: 'Input',
- componentProps: {
- AutoComplete: 'off',
- },
- },
- {
- label: '船类型(ship type)',
- field: 'shipType',
- component: 'JDictSelectTag',
- componentProps: {
- dictCode: 'ship_type',
- showSearch: true,
- getPopupContainer: (node) => document.body,
- },
- },
- {
- label: '船厂(ship factory)',
- field: 'shipFactory',
- component: 'JDictSelectTag',
- componentProps: {
- dictCode: 'ship_factory',
- showSearch: true,
- getPopupContainer: (node) => document.body,
- },
- },
- {
- label: '造船日期(ship date)',
- field: 'shipDate',
- component: 'MonthPicker',
- componentProps: {
- showTime: false,
- valueFormat: 'YYYY-MM',
- getPopupContainer: (node) => document.body,
- },
- },
- {
- label: '状态(status)',
- field: 'status',
- component: 'JDictSelectTag',
- defaultValue: 1,
- componentProps: {
- dictCode: 'valid_status',
- stringToNumber: true,
- },
- },
- // TODO 主键隐藏字段,目前写死为ID
- {
- label: '',
- field: 'id',
- component: 'Input',
- show: false,
- },
- ];
- // 高级查询数据
- export const superQuerySchema = {
- status: { title: '状态(1-启用,0-停用)', order: 0, view: 'number', type: 'number', dictCode: '' },
- imo: { title: '唯一编号', order: 2, view: 'text', type: 'string' },
- shipName: { title: '船名称', order: 3, view: 'text', type: 'string' },
- hullNumber: { title: 'hull number', order: 4, view: 'text', type: 'string' },
- shipType: { title: '船类型', order: 5, view: 'list', type: 'string', dictCode: '' },
- shipFactory: { title: '船厂', order: 6, view: 'list', type: 'string', dictCode: '' },
- shipDate: { title: '造船日期', order: 7, view: 'datetime', type: 'string' },
- notes: { title: '备注', order: 8, view: 'text', type: 'string' },
- };
- /**
- * 流程表单调用这个方法获取formSchema
- * @param param
- */
- export function getBpmFormSchema(_formData): FormSchema[] {
- // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema
- return formSchema;
- }
|