|
@@ -7,9 +7,10 @@ import { getAccountList, getUserGroup } from '/@/api/system/system';
|
|
|
import { getAreaTree } from '/@/api/oem/index';
|
|
|
import { ref } from 'vue';
|
|
|
|
|
|
-interface FormSchemaNew extends FormSchema {
|
|
|
- dataOptions?: Array<any>;
|
|
|
-}
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
export let areaTree: any[] = [];
|
|
|
export const areaCodeSchema = {
|
|
|
field: 'areaCode',
|
|
@@ -198,259 +199,272 @@ export const searchFormSchema: FormSchema[] = [
|
|
|
},
|
|
|
},
|
|
|
];
|
|
|
-export const rescueTeamFormSchema: FormSchemaNew[] = [
|
|
|
- {
|
|
|
- field: 'companyId',
|
|
|
- label: '单位名称',
|
|
|
- component: 'ApiTreeSelect',
|
|
|
- required: true,
|
|
|
- colProps: { span: 12 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '请选择',
|
|
|
- api: async () => {
|
|
|
- const data = await screenLinkOrganizationGetApi();
|
|
|
- copyTransFun(data as any as any[]);
|
|
|
- return data;
|
|
|
- },
|
|
|
- labelField: 'itemText',
|
|
|
- valueField: 'id',
|
|
|
- dropdownStyle: {
|
|
|
- height: '200px',
|
|
|
- },
|
|
|
- onChange: (value) => {
|
|
|
- if (!value) {
|
|
|
- userLists.value = [];
|
|
|
- }
|
|
|
- getUserGroup({
|
|
|
- groupid: value,
|
|
|
- }).then((data) => {
|
|
|
- if (data.length) {
|
|
|
- userLists.value = data.map((item) => {
|
|
|
- return {
|
|
|
- label: item.realName,
|
|
|
- value: item.id,
|
|
|
- phoneNumber: item.phoneNumber,
|
|
|
- deptId: value,
|
|
|
- level: item.realName,
|
|
|
- position: item.expertTitleId,
|
|
|
- };
|
|
|
- });
|
|
|
- } else {
|
|
|
+export const rescueTeamFormSchema = (disabled): any => {
|
|
|
+ const data = [
|
|
|
+ {
|
|
|
+ field: 'companyId',
|
|
|
+ label: '单位名称',
|
|
|
+ component: 'ApiTreeSelect',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ placeholder: '请选择',
|
|
|
+ disabled: disabled,
|
|
|
+ api: async () => {
|
|
|
+ const data = await screenLinkOrganizationGetApi();
|
|
|
+ copyTransFun(data as any as any[]);
|
|
|
+ return data;
|
|
|
+ },
|
|
|
+ labelField: 'itemText',
|
|
|
+ valueField: 'id',
|
|
|
+ dropdownStyle: {
|
|
|
+ height: '200px',
|
|
|
+ },
|
|
|
+ onChange: (value) => {
|
|
|
+ if (!value) {
|
|
|
userLists.value = [];
|
|
|
}
|
|
|
- });
|
|
|
+ getUserGroup({
|
|
|
+ groupid: value,
|
|
|
+ }).then((data) => {
|
|
|
+ if (data.length) {
|
|
|
+ userLists.value = data.map((item) => {
|
|
|
+ return {
|
|
|
+ label: item.realName,
|
|
|
+ value: item.id,
|
|
|
+ phoneNumber: item.phoneNumber,
|
|
|
+ deptId: value,
|
|
|
+ level: item.realName,
|
|
|
+ position: item.expertTitleId,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ userLists.value = [];
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
},
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'areaCodes',
|
|
|
- label: '所属区域',
|
|
|
- component: 'Cascader',
|
|
|
- required: true,
|
|
|
- colProps: { span: 12 },
|
|
|
- componentProps: () => {
|
|
|
- return {
|
|
|
- options: areaTree,
|
|
|
- fieldNames: {
|
|
|
- label: 'name',
|
|
|
- value: 'code',
|
|
|
- children: 'areas',
|
|
|
- },
|
|
|
- changeOnSelect: true,
|
|
|
- showSearch: {
|
|
|
- filter: (inputValue: string, path: any[]) => {
|
|
|
- return path.some(
|
|
|
- (option) =>
|
|
|
- (option.code + '').indexOf(inputValue) > -1 ||
|
|
|
- option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1
|
|
|
- );
|
|
|
+ {
|
|
|
+ field: 'areaCodes',
|
|
|
+ label: '所属区域',
|
|
|
+ component: 'Cascader',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: () => {
|
|
|
+ return {
|
|
|
+ options: areaTree,
|
|
|
+ disabled: disabled,
|
|
|
+ fieldNames: {
|
|
|
+ label: 'name',
|
|
|
+ value: 'code',
|
|
|
+ children: 'areas',
|
|
|
},
|
|
|
- },
|
|
|
- placeholder: '城镇/街道',
|
|
|
- params: { parentId: '511503' },
|
|
|
- displayRender: ({ labels }: { labels: string[] }) => {
|
|
|
- return labels[labels.length - 1];
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- };
|
|
|
+ changeOnSelect: true,
|
|
|
+ showSearch: {
|
|
|
+ filter: (inputValue: string, path: any[]) => {
|
|
|
+ return path.some(
|
|
|
+ (option) =>
|
|
|
+ (option.code + '').indexOf(inputValue) > -1 ||
|
|
|
+ option.name.toLowerCase().indexOf(inputValue.toLowerCase()) > -1
|
|
|
+ );
|
|
|
+ },
|
|
|
+ },
|
|
|
+ placeholder: '城镇/街道',
|
|
|
+ params: { parentId: '511503' },
|
|
|
+ displayRender: ({ labels }: { labels: string[] }) => {
|
|
|
+ return labels[labels.length - 1];
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ };
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'liableId',
|
|
|
- label: '责任人姓名',
|
|
|
- component: 'Select',
|
|
|
- required: true,
|
|
|
- colProps: { span: 8 },
|
|
|
- dataOptions: userLists.value,
|
|
|
- componentProps: ({ formModel }) => {
|
|
|
- return {
|
|
|
- placeholder: '请选择联系人姓名',
|
|
|
- options: userLists.value,
|
|
|
- onChange: (code: string) => {
|
|
|
-
|
|
|
- const item = userLists.value.find(function (item) {
|
|
|
- return item.value == code;
|
|
|
- });
|
|
|
- formModel.liablePosition = item?.position;
|
|
|
- formModel.liablePhone = item?.phoneNumber;
|
|
|
- },
|
|
|
- };
|
|
|
+ {
|
|
|
+ field: 'liableId',
|
|
|
+ label: '责任人姓名',
|
|
|
+ component: 'Select',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 8 },
|
|
|
+ dataOptions: userLists.value,
|
|
|
+ componentProps: ({ formModel }) => {
|
|
|
+ return {
|
|
|
+ placeholder: '请选择责任人人姓名',
|
|
|
+ disabled: disabled,
|
|
|
+ options: userLists.value,
|
|
|
+ onChange: (code: string) => {
|
|
|
+
|
|
|
+ const item = userLists.value.find(function (item) {
|
|
|
+ return item.value == code;
|
|
|
+ });
|
|
|
+ formModel.liablePosition = item?.position;
|
|
|
+ formModel.liablePhone = item?.phoneNumber;
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'liablePosition',
|
|
|
- label: '责任人职务',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 8 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '',
|
|
|
- disabled: true,
|
|
|
+ {
|
|
|
+ field: 'liablePosition',
|
|
|
+ label: '责任人职务',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ placeholder: '',
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'liablePhone',
|
|
|
- label: '责任人电话',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 8 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '',
|
|
|
- disabled: true,
|
|
|
+ {
|
|
|
+ field: 'liablePhone',
|
|
|
+ label: '责任人电话',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ placeholder: '',
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'contactId',
|
|
|
- label: '联系人姓名',
|
|
|
- component: 'Select',
|
|
|
- required: true,
|
|
|
- colProps: { span: 8 },
|
|
|
- dataOptions: userLists.value,
|
|
|
- componentProps: ({ formModel }) => {
|
|
|
- return {
|
|
|
- placeholder: '请选择联系人姓名',
|
|
|
- options: userLists.value,
|
|
|
- onChange: (code: string) => {
|
|
|
-
|
|
|
- const item = userLists.value.find(function (item) {
|
|
|
- return item.value == code;
|
|
|
- });
|
|
|
- formModel.contactPosition = item?.position;
|
|
|
- formModel.contactPhone = item?.phoneNumber;
|
|
|
- },
|
|
|
- };
|
|
|
+ {
|
|
|
+ field: 'contactId',
|
|
|
+ label: '联系人姓名',
|
|
|
+ component: 'Select',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 8 },
|
|
|
+ dataOptions: userLists.value,
|
|
|
+ componentProps: ({ formModel }) => {
|
|
|
+ return {
|
|
|
+ placeholder: '请选择联系人姓名',
|
|
|
+ options: userLists.value,
|
|
|
+ disabled: disabled,
|
|
|
+ onChange: (code: string) => {
|
|
|
+
|
|
|
+ const item = userLists.value.find(function (item) {
|
|
|
+ return item.value == code;
|
|
|
+ });
|
|
|
+ formModel.contactPosition = item?.position;
|
|
|
+ formModel.contactPhone = item?.phoneNumber;
|
|
|
+ },
|
|
|
+ };
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'contactPosition',
|
|
|
- label: '联系人职务',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 8 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '',
|
|
|
- disabled: true,
|
|
|
+ {
|
|
|
+ field: 'contactPosition',
|
|
|
+ label: '联系人职务',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ placeholder: '',
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'contactPhone',
|
|
|
- label: '联系人电话',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 8 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '',
|
|
|
- disabled: true,
|
|
|
+ {
|
|
|
+ field: 'contactPhone',
|
|
|
+ label: '联系人电话',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 8 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ placeholder: '',
|
|
|
+ disabled: true,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'firsttimeResponsePerson',
|
|
|
- label: '第一时间响应人数',
|
|
|
- component: 'InputNumber',
|
|
|
- required: true,
|
|
|
- colProps: { span: 12 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '请选择',
|
|
|
+ {
|
|
|
+ field: 'firsttimeResponsePerson',
|
|
|
+ label: '第一时间响应人数',
|
|
|
+ component: 'InputNumber',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ disabled: disabled,
|
|
|
+ placeholder: '请选择',
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'maxResponsePerson',
|
|
|
- label: '最大响应人数',
|
|
|
- component: 'InputNumber',
|
|
|
- required: true,
|
|
|
- colProps: { span: 12 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '请选择',
|
|
|
+ {
|
|
|
+ field: 'maxResponsePerson',
|
|
|
+ label: '最大响应人数',
|
|
|
+ component: 'InputNumber',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ disabled: disabled,
|
|
|
+ placeholder: '请选择',
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'content',
|
|
|
- label: '救援领域内容和功能',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 24 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '请选择',
|
|
|
+ {
|
|
|
+ field: 'content',
|
|
|
+ label: '救援领域内容和功能',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ disabled: disabled,
|
|
|
+ placeholder: '请选择',
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'longitude',
|
|
|
- label: '经度',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 12 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '请选择',
|
|
|
+ {
|
|
|
+ field: 'longitude',
|
|
|
+ label: '经度',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ disabled: disabled,
|
|
|
+ placeholder: '请选择',
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'latitude',
|
|
|
- label: '纬度',
|
|
|
- component: 'Input',
|
|
|
- required: true,
|
|
|
- colProps: { span: 12 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '请选择',
|
|
|
+ {
|
|
|
+ field: 'latitude',
|
|
|
+ label: '纬度',
|
|
|
+ component: 'Input',
|
|
|
+ required: true,
|
|
|
+ colProps: { span: 12 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ disabled: disabled,
|
|
|
+ placeholder: '请选择',
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
- {
|
|
|
- field: 'remark',
|
|
|
- label: '备注',
|
|
|
- component: 'InputTextArea',
|
|
|
- required: false,
|
|
|
- colProps: { span: 24 },
|
|
|
- componentProps: {
|
|
|
- maxLength: 255,
|
|
|
- placeholder: '',
|
|
|
- rows: 3,
|
|
|
- width: 200,
|
|
|
+ {
|
|
|
+ field: 'remark',
|
|
|
+ label: '备注',
|
|
|
+ component: 'InputTextArea',
|
|
|
+ required: false,
|
|
|
+ colProps: { span: 24 },
|
|
|
+ componentProps: {
|
|
|
+ maxLength: 255,
|
|
|
+ disabled: disabled,
|
|
|
+ placeholder: '',
|
|
|
+ rows: 3,
|
|
|
+ width: 200,
|
|
|
+ },
|
|
|
},
|
|
|
- },
|
|
|
-];
|
|
|
+ ];
|
|
|
+ return data;
|
|
|
+};
|