|  | @@ -1,14 +1,20 @@
 | 
	
		
			
				|  |  |  import { tenderState } from '@/store/mobx'
 | 
	
		
			
				|  |  |  import consts from '@/utils/consts'
 | 
	
		
			
				|  |  | +import secret from '@/utils/sheets'
 | 
	
		
			
				|  |  |  import GC from '@grapecity/spread-sheets'
 | 
	
		
			
				|  |  |  import { SpreadSheets, Worksheet } from '@grapecity/spread-sheets-react'
 | 
	
		
			
				|  |  |  import { Button, message, Radio, Table, Tabs } from 'antd'
 | 
	
		
			
				|  |  |  import Modal from 'antd/lib/modal/Modal'
 | 
	
		
			
				|  |  |  import { RadioChangeEvent } from 'antd/lib/radio'
 | 
	
		
			
				|  |  |  import React, { useEffect, useState } from 'react'
 | 
	
		
			
				|  |  | -import { apiContractIncome, apiSetTemplate } from './api'
 | 
	
		
			
				|  |  | -import styles from './GCsheet.module.scss'
 | 
	
		
			
				|  |  | +import { useActivate } from 'react-activation'
 | 
	
		
			
				|  |  | +import { apiContractIncome, apiSetTemplate } from './components/Modal/api'
 | 
	
		
			
				|  |  | +import Detail from './components/Tabs/Detail'
 | 
	
		
			
				|  |  | +import File from './components/Tabs/File'
 | 
	
		
			
				|  |  | +import Receivable from './components/Tabs/Receivable'
 | 
	
		
			
				|  |  | +import styles from './index.module.scss'
 | 
	
		
			
				|  |  |  GC.Spread.Common.CultureManager.culture("zh-cn")
 | 
	
		
			
				|  |  | +GC.Spread.Sheets.LicenseKey = secret
 | 
	
		
			
				|  |  |  interface iGCsheetPorps {
 | 
	
		
			
				|  |  |    modalHandler: (type: string) => void
 | 
	
		
			
				|  |  |  }
 | 
	
	
		
			
				|  | @@ -89,7 +95,7 @@ const GCsheet: React.FC<iGCsheetPorps> = ({ modalHandler }) => {
 | 
	
		
			
				|  |  |      {
 | 
	
		
			
				|  |  |        title: '项目节',
 | 
	
		
			
				|  |  |        dataIndex: 'serial',
 | 
	
		
			
				|  |  | -      width: '40%',
 | 
	
		
			
				|  |  | +      width: '30%',
 | 
	
		
			
				|  |  |        // eslint-disable-next-line react/display-name
 | 
	
		
			
				|  |  |        render: (text: string, row: iTemplateState) => {
 | 
	
		
			
				|  |  |          const { attribution = '', serial = '' } = row
 | 
	
	
		
			
				|  | @@ -99,9 +105,13 @@ const GCsheet: React.FC<iGCsheetPorps> = ({ modalHandler }) => {
 | 
	
		
			
				|  |  |      {
 | 
	
		
			
				|  |  |        title: '名称',
 | 
	
		
			
				|  |  |        dataIndex: 'name',
 | 
	
		
			
				|  |  | -      width: '60%'
 | 
	
		
			
				|  |  | +      width: '70%'
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |    ]
 | 
	
		
			
				|  |  | +  useActivate(() =>{
 | 
	
		
			
				|  |  | +    initHandler()
 | 
	
		
			
				|  |  | +  })
 | 
	
		
			
				|  |  | +
 | 
	
		
			
				|  |  |    // modal 确认 - 回调
 | 
	
		
			
				|  |  |    const handleModalConfirm = async () => {
 | 
	
		
			
				|  |  |      setSectionTemplate({
 | 
	
	
		
			
				|  | @@ -155,6 +165,7 @@ const GCsheet: React.FC<iGCsheetPorps> = ({ modalHandler }) => {
 | 
	
		
			
				|  |  |              dataSource={tempalte.template1?.children}
 | 
	
		
			
				|  |  |              columns={columns}
 | 
	
		
			
				|  |  |              pagination={false}
 | 
	
		
			
				|  |  | +            bordered
 | 
	
		
			
				|  |  |              scroll={{ y: '300px' }}
 | 
	
		
			
				|  |  |              rowKey={record => record.id}
 | 
	
		
			
				|  |  |              defaultExpandAllRows={true}
 | 
	
	
		
			
				|  | @@ -173,6 +184,7 @@ const GCsheet: React.FC<iGCsheetPorps> = ({ modalHandler }) => {
 | 
	
		
			
				|  |  |              tempalte.template2?.children &&  tempalte.template2?.children.length? <Table
 | 
	
		
			
				|  |  |              dataSource={tempalte.template2?.children}
 | 
	
		
			
				|  |  |              columns={columns}
 | 
	
		
			
				|  |  | +            bordered
 | 
	
		
			
				|  |  |              pagination={false}
 | 
	
		
			
				|  |  |              scroll={{ y: '300px' }}
 | 
	
		
			
				|  |  |              rowKey={record => record.id}
 | 
	
	
		
			
				|  | @@ -204,9 +216,15 @@ const GCsheet: React.FC<iGCsheetPorps> = ({ modalHandler }) => {
 | 
	
		
			
				|  |  |          size="small"
 | 
	
		
			
				|  |  |          defaultActiveKey="1"
 | 
	
		
			
				|  |  |          tabBarExtraContent={{ right: <div className="pi-mg-right-5"><Button type="primary" size="small" danger className="pi-mg-right-3" onClick={() => modalHandler('close')}>关闭合同</Button><Button type="primary" size="small" onClick={() => modalHandler('edit')}>编辑合同</Button></div> }}>
 | 
	
		
			
				|  |  | -        <TabPane key="1" tab="合同详情"></TabPane>
 | 
	
		
			
				|  |  | -        <TabPane key="2" tab="合同回款"></TabPane>
 | 
	
		
			
				|  |  | -        <TabPane key="3" tab="合同文件"></TabPane>
 | 
	
		
			
				|  |  | +        <TabPane key="1" tab="合同详情">
 | 
	
		
			
				|  |  | +          <Detail></Detail>
 | 
	
		
			
				|  |  | +        </TabPane>
 | 
	
		
			
				|  |  | +        <TabPane key="2" tab="合同回款">
 | 
	
		
			
				|  |  | +          <Receivable></Receivable>
 | 
	
		
			
				|  |  | +        </TabPane>
 | 
	
		
			
				|  |  | +        <TabPane key="3" tab="合同文件">
 | 
	
		
			
				|  |  | +          <File></File>
 | 
	
		
			
				|  |  | +        </TabPane>
 | 
	
		
			
				|  |  |        </Tabs>
 | 
	
		
			
				|  |  |      </div>
 | 
	
		
			
				|  |  |    </div>
 |