|
@@ -323,80 +323,78 @@
|
|
|
const [registerImportModal, { openModal: openImportModal }] = useModal();
|
|
|
const [registerRuleUserModal, { openModal: openRuleUserModal }] = useModal();
|
|
|
|
|
|
- const [
|
|
|
- registerTable,
|
|
|
- { reload, setProps, setSelectedRowKeys, getRawDataSource, setColumns },
|
|
|
- ] = useTable({
|
|
|
- title: '',
|
|
|
- columns,
|
|
|
- formConfig: {
|
|
|
- rowProps: {
|
|
|
- gutter: 16,
|
|
|
+ const [registerTable, { reload, setProps, setSelectedRowKeys, getRawDataSource, setColumns }] =
|
|
|
+ useTable({
|
|
|
+ title: '',
|
|
|
+ columns,
|
|
|
+ formConfig: {
|
|
|
+ rowProps: {
|
|
|
+ gutter: 16,
|
|
|
+ },
|
|
|
+ schemas: searchFormSchema,
|
|
|
},
|
|
|
- schemas: searchFormSchema,
|
|
|
- },
|
|
|
- beforeFetch: (pageParams) => {
|
|
|
- //发送请求默认新增 左边树结构所选机构id
|
|
|
- const newParams = {
|
|
|
- releaseId: menuId.value,
|
|
|
- params: pageParams,
|
|
|
- order: pageParams.order,
|
|
|
- field: pageParams.field,
|
|
|
- };
|
|
|
- pageParamsInfo.value = {
|
|
|
- releaseId: menuId.value,
|
|
|
- params: pageParams,
|
|
|
- };
|
|
|
- //如果有左侧菜单 需要加上左侧树 所选项 作为参数
|
|
|
- if (listConfig.value.isLeftMenu) {
|
|
|
- newParams[listConfig.value.leftMenuConfig?.listFieldName as string] =
|
|
|
- pageParams[listConfig.value.leftMenuConfig?.listFieldName as string] || selectId.value;
|
|
|
- }
|
|
|
- newParams['headers'] = {
|
|
|
- FormId: formIdComputedRef.value,
|
|
|
- PK: pkField.value,
|
|
|
- };
|
|
|
- return newParams;
|
|
|
- },
|
|
|
- afterFetch: (res) => {
|
|
|
- filterColumns.value.map((column: any) => {
|
|
|
- if (column.onFilter) {
|
|
|
- const info = res.map((item) => item[column.dataIndex!]);
|
|
|
- column.filters = [...new Set(info)].map((item) => {
|
|
|
- return {
|
|
|
- text: item,
|
|
|
- value: item,
|
|
|
- };
|
|
|
- });
|
|
|
- column.customHeaderCell = () => {
|
|
|
- return {
|
|
|
- onmouseenter: () => {
|
|
|
- isShowFilter.value = true;
|
|
|
- showColumnIndex.value = column.dataIndex;
|
|
|
- clickColumnIndex.value = '';
|
|
|
- },
|
|
|
- onmouseleave: () => {
|
|
|
- isShowFilter.value = false;
|
|
|
- showColumnIndex.value = '';
|
|
|
- },
|
|
|
- };
|
|
|
- };
|
|
|
+ beforeFetch: (pageParams) => {
|
|
|
+ //发送请求默认新增 左边树结构所选机构id
|
|
|
+ const newParams = {
|
|
|
+ releaseId: menuId.value,
|
|
|
+ params: pageParams,
|
|
|
+ order: pageParams.order,
|
|
|
+ field: pageParams.field,
|
|
|
+ };
|
|
|
+ pageParamsInfo.value = {
|
|
|
+ releaseId: menuId.value,
|
|
|
+ params: pageParams,
|
|
|
+ };
|
|
|
+ //如果有左侧菜单 需要加上左侧树 所选项 作为参数
|
|
|
+ if (listConfig.value.isLeftMenu) {
|
|
|
+ newParams[listConfig.value.leftMenuConfig?.listFieldName as string] =
|
|
|
+ pageParams[listConfig.value.leftMenuConfig?.listFieldName as string] || selectId.value;
|
|
|
}
|
|
|
- });
|
|
|
- setColumns(filterColumns.value);
|
|
|
- },
|
|
|
- useSearchForm: true,
|
|
|
- showTableSetting: true,
|
|
|
- striped: false,
|
|
|
- isFilterByDataSoure: true,
|
|
|
- actionColumn: {
|
|
|
- width: 160,
|
|
|
- title: t('操作'),
|
|
|
- dataIndex: 'action',
|
|
|
- slots: { customRender: 'action' },
|
|
|
- },
|
|
|
- customRow,
|
|
|
- });
|
|
|
+ newParams['headers'] = {
|
|
|
+ FormId: formIdComputedRef.value,
|
|
|
+ PK: pkField.value,
|
|
|
+ };
|
|
|
+ return newParams;
|
|
|
+ },
|
|
|
+ afterFetch: (res) => {
|
|
|
+ filterColumns.value.map((column: any) => {
|
|
|
+ if (column.onFilter) {
|
|
|
+ const info = res.map((item) => item[column.dataIndex!]);
|
|
|
+ column.filters = [...new Set(info)].map((item) => {
|
|
|
+ return {
|
|
|
+ text: item,
|
|
|
+ value: item,
|
|
|
+ };
|
|
|
+ });
|
|
|
+ column.customHeaderCell = () => {
|
|
|
+ return {
|
|
|
+ onmouseenter: () => {
|
|
|
+ isShowFilter.value = true;
|
|
|
+ showColumnIndex.value = column.dataIndex;
|
|
|
+ clickColumnIndex.value = '';
|
|
|
+ },
|
|
|
+ onmouseleave: () => {
|
|
|
+ isShowFilter.value = false;
|
|
|
+ showColumnIndex.value = '';
|
|
|
+ },
|
|
|
+ };
|
|
|
+ };
|
|
|
+ }
|
|
|
+ });
|
|
|
+ setColumns(filterColumns.value);
|
|
|
+ },
|
|
|
+ useSearchForm: true,
|
|
|
+ showTableSetting: true,
|
|
|
+ striped: false,
|
|
|
+ isFilterByDataSoure: true,
|
|
|
+ actionColumn: {
|
|
|
+ width: 160,
|
|
|
+ title: t('操作'),
|
|
|
+ dataIndex: 'action',
|
|
|
+ slots: { customRender: 'action' },
|
|
|
+ },
|
|
|
+ customRow,
|
|
|
+ });
|
|
|
|
|
|
function handleFilterClick(column) {
|
|
|
clickColumnIndex.value = column.dataIndex;
|
|
@@ -789,15 +787,15 @@
|
|
|
formConfig: {
|
|
|
labelWidth: 100,
|
|
|
schemas: searchFormSchema,
|
|
|
- fieldMapToTime: searchDate.map((date) => {
|
|
|
- return [
|
|
|
- date.fieldName!,
|
|
|
- [date.fieldName + 'Start', date.fieldName + 'End'],
|
|
|
- date.format,
|
|
|
- true,
|
|
|
- ];
|
|
|
- // [['fieldTime', ['startTime', 'endTime'], 'YYYY-MM-DD']],
|
|
|
- }),
|
|
|
+ // fieldMapToTime: searchDate.map((date) => {
|
|
|
+ // return [
|
|
|
+ // date.fieldName!,
|
|
|
+ // [date.fieldName + 'Start', date.fieldName + 'End'],
|
|
|
+ // date.format,
|
|
|
+ // true,
|
|
|
+ // ];
|
|
|
+ // // [['fieldTime', ['startTime', 'endTime'], 'YYYY-MM-DD']],
|
|
|
+ // }),
|
|
|
},
|
|
|
});
|
|
|
reload();
|
|
@@ -881,20 +879,18 @@
|
|
|
async function fetchLeftData() {
|
|
|
//如果是数据字典
|
|
|
if (listConfig.value.leftMenuConfig?.datasourceType === 'dic') {
|
|
|
- treeData.value =
|
|
|
- ((await getDicDetailList({
|
|
|
- itemId: listConfig.value.leftMenuConfig.dictionaryItemId,
|
|
|
- })) as
|
|
|
- unknown) as
|
|
|
- TreeItem[];
|
|
|
+ treeData.value = (await getDicDetailList({
|
|
|
+ itemId: listConfig.value.leftMenuConfig.dictionaryItemId,
|
|
|
+ })) as unknown as TreeItem[];
|
|
|
} else if (listConfig.value.leftMenuConfig?.datasourceType === 'static') {
|
|
|
//如果是静态数据
|
|
|
treeData.value = listConfig.value.leftMenuConfig.staticData!;
|
|
|
} else if (listConfig.value.leftMenuConfig?.datasourceType === 'api') {
|
|
|
//如果是api
|
|
|
- treeData.value =
|
|
|
- ((await apiConfigFunc(listConfig.value.leftMenuConfig?.apiConfig, false)) as unknown) as
|
|
|
- TreeItem[];
|
|
|
+ treeData.value = (await apiConfigFunc(
|
|
|
+ listConfig.value.leftMenuConfig?.apiConfig,
|
|
|
+ false,
|
|
|
+ )) as unknown as TreeItem[];
|
|
|
}
|
|
|
addRenderIcon(treeData.value);
|
|
|
}
|
|
@@ -931,6 +927,8 @@
|
|
|
|
|
|
return handleSearchForm(option, schema, config, isNeedTrans, false) as FormSchema;
|
|
|
});
|
|
|
+ console.log(searchFormSchema);
|
|
|
+
|
|
|
return [searchFormSchema, searchDate];
|
|
|
}
|
|
|
|