|
@@ -4,7 +4,7 @@
|
|
|
* @Author: code4eat awesomedema@gmail.com
|
|
|
* @Date: 2022-12-16 09:42:52
|
|
|
* @LastEditors: code4eat awesomedema@gmail.com
|
|
|
- * @LastEditTime: 2023-04-18 11:00:35
|
|
|
+ * @LastEditTime: 2023-05-10 15:12:52
|
|
|
* @FilePath: /BudgetManaSystem/src/pages/budgetMana/monthlySet/index.tsx
|
|
|
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
|
|
|
*/
|
|
@@ -24,7 +24,7 @@ import closeIcon from '../../../../../public/images/treenode_collapse.png';
|
|
|
import type { ColumnsType, TableRowSelection } from 'antd/es/table/interface';
|
|
|
|
|
|
import { createFromIconfontCN } from '@ant-design/icons';
|
|
|
-import { addData, delData, editData, getMenuRelaActDic, getTableDataRequest, getTreeData, getTreeDataRespType, updateFuncDic } from './service';
|
|
|
+import { addData, delData, editData, getMenuContentType, getMenuRelaActDic, getTableDataRequest, getTreeData, getTreeDataRespType, updateFuncDic } from './service';
|
|
|
import { TransferDirection, TransferItem } from 'antd/es/transfer';
|
|
|
|
|
|
import difference from 'lodash/difference';
|
|
@@ -37,7 +37,7 @@ import DirectoryTree from 'antd/es/tree/DirectoryTree';
|
|
|
import { ActionType, ProColumns } from '@ant-design/pro-table';
|
|
|
import KCTable from '@/components/kcTable';
|
|
|
import { getDeepestTreeData } from '@/utils';
|
|
|
-import ProForm, { ModalForm, ProFormDependency, ProFormDigit, ProFormItem, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
|
|
|
+import ProForm, { ModalForm, ProFormDependency, ProFormDigit, ProFormInstance, ProFormItem, ProFormRadio, ProFormSelect, ProFormText, ProFormTextArea } from '@ant-design/pro-form';
|
|
|
import { KCInput } from '@/components/KCInput';
|
|
|
import { UserRelaSeletDataListType } from '@/service/user';
|
|
|
|
|
@@ -76,11 +76,13 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
const [tableDataSearchKeywords, set_tableDataSearchKeywords] = useState<string>('');
|
|
|
|
|
|
const [currentOperateRow, set_currentOperateRow] = useState<any | undefined>(undefined); //当前操作的表格行数据
|
|
|
-
|
|
|
+
|
|
|
+ const [contentType, set_contentType] = useState<any[]>([]); //菜单内容类型列表
|
|
|
|
|
|
const tableRef = useRef<ActionType>();
|
|
|
|
|
|
-
|
|
|
+ const formRef = useRef<ProFormInstance>();
|
|
|
+
|
|
|
const transferTableColumn = [
|
|
|
{
|
|
|
title: '功能名称',
|
|
@@ -147,7 +149,8 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
1: '报告',
|
|
|
2: '大屏',
|
|
|
3: '填报',
|
|
|
- 4: '空白'
|
|
|
+ 4: '空白',
|
|
|
+ 5: '静态'
|
|
|
}
|
|
|
|
|
|
},
|
|
@@ -204,6 +207,13 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
set_currentSelectedTreeNode(node);
|
|
|
};
|
|
|
|
|
|
+ const getContentType = async () => {
|
|
|
+ const resp = await getMenuContentType();
|
|
|
+ if (resp) {
|
|
|
+ set_contentType(resp.list);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
const getTableData = async (params: any, sort: any, filter: any) => {
|
|
|
set_reload(false);
|
|
@@ -492,7 +502,6 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
|
|
|
|
|
|
const UpDataActBtn = ({ record, type }: { record: any, type: 'EDIT' | 'ADD' }) => {
|
|
|
-
|
|
|
return (
|
|
|
|
|
|
<ModalForm
|
|
@@ -503,13 +512,12 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
trigger={
|
|
|
type == 'EDIT' ? <a key="edit" >编辑</a> : record ? <a className='add'>添加</a> : <span>新增</span>
|
|
|
}
|
|
|
+ formRef={formRef}
|
|
|
grid={true}
|
|
|
|
|
|
onFinish={(val) => {
|
|
|
set_currentOperateRow(record);
|
|
|
-
|
|
|
return updateTable(type, val, record)
|
|
|
-
|
|
|
}}
|
|
|
>
|
|
|
<ProFormText
|
|
@@ -594,13 +602,30 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
placeholder="请输入"
|
|
|
width={100}
|
|
|
colProps={{ span: 8 }}
|
|
|
- options={[
|
|
|
- { label: '一般', value: 0 },
|
|
|
- { label: '报告', value: 1 },
|
|
|
- { label: '大屏', value: 2 },
|
|
|
- { label: '填报', value: 3 },
|
|
|
- { label: '空白', value: 4 },
|
|
|
- ]}
|
|
|
+ request={async () => {
|
|
|
+ if(contentType){
|
|
|
+ return contentType.map((a:any)=>({label:a.name,value:Number(a.code)}))
|
|
|
+ }
|
|
|
+ return []
|
|
|
+ }}
|
|
|
+ fieldProps={{
|
|
|
+ onChange(value, option) {
|
|
|
+ if (value == 1) {
|
|
|
+ //报告页面
|
|
|
+ const need = contentType.filter((item:any)=>item.code == `${value}`);
|
|
|
+ if(need.length>0)
|
|
|
+ formRef.current?.setFieldValue('url',need[0].value);
|
|
|
+ }
|
|
|
+ },
|
|
|
+ }}
|
|
|
+ // options={[
|
|
|
+ // { label: '一般', value: 0 },
|
|
|
+ // { label: '报告', value: 1 },
|
|
|
+ // { label: '大屏', value: 2 },
|
|
|
+ // { label: '填报', value: 3 },
|
|
|
+ // { label: '空白', value: 4 },
|
|
|
+ // { label: '静态', value: 5 },
|
|
|
+ // ]}
|
|
|
rules={[{ required: true, message: '类型不能为空!' }]}
|
|
|
/>
|
|
|
<ProFormDependency name={['contentType']}>
|
|
@@ -683,6 +708,7 @@ const MonthlyInfoCheck: React.FC = () => {
|
|
|
|
|
|
useEffect(() => {
|
|
|
getTreeReqFunc();
|
|
|
+ getContentType();
|
|
|
}, []);
|
|
|
|
|
|
|