Merge branch 'master' into feature/V2-系统多语言
This commit is contained in:
commit
bc2034adc7
|
|
@ -54,6 +54,12 @@
|
|||
<div class="content unicode" style="display: block;">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">批量更新</div>
|
||||
<div class="code-name">&#xe696;</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont"></span>
|
||||
<div class="name">全部</div>
|
||||
|
|
@ -138,9 +144,9 @@
|
|||
<pre><code class="language-css"
|
||||
>@font-face {
|
||||
font-family: 'iconfont';
|
||||
src: url('iconfont.woff2?t=1698914262517') format('woff2'),
|
||||
url('iconfont.woff?t=1698914262517') format('woff'),
|
||||
url('iconfont.ttf?t=1698914262517') format('truetype');
|
||||
src: url('iconfont.woff2?t=1701833672416') format('woff2'),
|
||||
url('iconfont.woff?t=1701833672416') format('woff'),
|
||||
url('iconfont.ttf?t=1701833672416') format('truetype');
|
||||
}
|
||||
</code></pre>
|
||||
<h3 id="-iconfont-">第二步:定义使用 iconfont 的样式</h3>
|
||||
|
|
@ -166,6 +172,15 @@
|
|||
<div class="content font-class">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-pilianggengxin"></span>
|
||||
<div class="name">
|
||||
批量更新
|
||||
</div>
|
||||
<div class="code-name">.icon-pilianggengxin
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<span class="icon iconfont icon-quanbu"></span>
|
||||
<div class="name">
|
||||
|
|
@ -292,6 +307,14 @@
|
|||
<div class="content symbol">
|
||||
<ul class="icon_lists dib-box">
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-pilianggengxin"></use>
|
||||
</svg>
|
||||
<div class="name">批量更新</div>
|
||||
<div class="code-name">#icon-pilianggengxin</div>
|
||||
</li>
|
||||
|
||||
<li class="dib">
|
||||
<svg class="icon svg-icon" aria-hidden="true">
|
||||
<use xlink:href="#icon-quanbu"></use>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
@font-face {
|
||||
font-family: "iconfont"; /* Project id 4257468 */
|
||||
src: url('iconfont.woff2?t=1698914262517') format('woff2'),
|
||||
url('iconfont.woff?t=1698914262517') format('woff'),
|
||||
url('iconfont.ttf?t=1698914262517') format('truetype');
|
||||
src: url('iconfont.woff2?t=1701833672416') format('woff2'),
|
||||
url('iconfont.woff?t=1701833672416') format('woff'),
|
||||
url('iconfont.ttf?t=1701833672416') format('truetype');
|
||||
}
|
||||
|
||||
.iconfont {
|
||||
|
|
@ -13,6 +13,10 @@
|
|||
-moz-osx-font-smoothing: grayscale;
|
||||
}
|
||||
|
||||
.icon-pilianggengxin:before {
|
||||
content: "\e696";
|
||||
}
|
||||
|
||||
.icon-quanbu:before {
|
||||
content: "\e603";
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because one or more lines are too long
|
|
@ -5,6 +5,13 @@
|
|||
"css_prefix_text": "icon-",
|
||||
"description": "",
|
||||
"glyphs": [
|
||||
{
|
||||
"icon_id": "2442443",
|
||||
"name": "批量更新",
|
||||
"font_class": "pilianggengxin",
|
||||
"unicode": "e696",
|
||||
"unicode_decimal": 59030
|
||||
},
|
||||
{
|
||||
"icon_id": "5925304",
|
||||
"name": "全部",
|
||||
|
|
|
|||
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -86,7 +86,7 @@
|
|||
|
||||
.expand-th:hover {
|
||||
.toogle-lock-tool {
|
||||
width: 30%;
|
||||
width: 37%;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -118,7 +118,7 @@
|
|||
justify-content: center;
|
||||
align-items: center;
|
||||
|
||||
& > :first-child {
|
||||
& > :not(:last-child) {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
|
|
@ -165,6 +165,12 @@
|
|||
}
|
||||
}
|
||||
|
||||
tr:hover .editable-cell {
|
||||
padding: 4px 11px;
|
||||
border: 1px solid #d9d9d9;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
:global {
|
||||
.ant-btn-link {
|
||||
height: inherit !important;
|
||||
|
|
@ -260,7 +266,15 @@
|
|||
}
|
||||
|
||||
th, td {
|
||||
font-size: 12px
|
||||
font-size: 12px;
|
||||
|
||||
.ant-form-item {
|
||||
margin-bottom: 0;
|
||||
|
||||
.ant-input-number {
|
||||
width: 100%;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,10 @@ const CalcExplainFooter: FunctionComponent<Props> = (props) => {
|
|||
<UnlockOutlined/>
|
||||
<span>{i18n["当前状态未锁定,点击锁定"]}</span>
|
||||
</div>
|
||||
<div className={styles["icon-item"]}>
|
||||
<Icon type="icon-pilianggengxin"/>
|
||||
<span>{i18n["批量更新"]}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -13,20 +13,23 @@ interface OwnProps {
|
|||
dataIndex?: string;
|
||||
title?: string;
|
||||
lockStatus?: string;
|
||||
dataType?: string;
|
||||
onHandleFormulatd?: any;
|
||||
i18n?: any;
|
||||
pattern?: number;
|
||||
calcDetail?: boolean; //查看详情页面
|
||||
}
|
||||
|
||||
type Props = OwnProps;
|
||||
|
||||
const customTableTitle: FunctionComponent<Props> = (props) => {
|
||||
const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {} } = props;
|
||||
const { dataIndex, title, lockStatus, onHandleFormulatd, i18n = {}, pattern, dataType, calcDetail } = props;
|
||||
|
||||
const handleToggleSalaryItemVal = (salaryItemId: string, type: string) => {
|
||||
const handleToggleSalaryItemVal = (salaryItemId: string, type: string, updateParams: any = {}) => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
payload: { id: "LOCKING", params: { lockType: type, salaryItemId } }
|
||||
payload: { id: "LOCKING", params: { lockType: type, salaryItemId, ...updateParams } }
|
||||
},
|
||||
"*"
|
||||
);
|
||||
|
|
@ -36,12 +39,16 @@ const customTableTitle: FunctionComponent<Props> = (props) => {
|
|||
<div className={classnames(styles["expand-th"])}>
|
||||
<div className={styles["title-text"]} title={title} onClick={() => onHandleFormulatd(dataIndex)}>{title}</div>
|
||||
{
|
||||
!!lockStatus &&
|
||||
!!lockStatus && !calcDetail &&
|
||||
<div className={styles["toogle-lock-tool"]}>
|
||||
<Icon type="icon-piliangsuoding" title={i18n["点击锁定所有解锁的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "LOCK")}/>
|
||||
<Icon type="icon-piliangjiesuo" title={i18n["点击解锁所有锁定的项目值"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "UNLOCK")}/>
|
||||
<Icon type="icon-pilianggengxin" title={i18n["批量更新"]}
|
||||
onClick={() => handleToggleSalaryItemVal(dataIndex as string, "BATCHUPDATE", {
|
||||
pattern, salaryItemName: title, dataType
|
||||
})}/>
|
||||
</div>
|
||||
}
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ const index: FunctionComponent<Props> = (props) => {
|
|||
const [pageInfo, setPageInfo] = useState<Partial<PaginationData>>({});
|
||||
const [i18n, setI18n] = useState<any>({});
|
||||
const [showTotalCell, setShowTotalCell] = useState<boolean>(false);
|
||||
const [isDetailTable, setIsDetailTable] = useState<boolean>(false);
|
||||
const [sumRowlistUrl, setSumRowlistUrl] = useState<string>("");
|
||||
const [payload, setPayload] = useState<string>("");
|
||||
|
||||
|
|
@ -44,10 +45,11 @@ const index: FunctionComponent<Props> = (props) => {
|
|||
if (!_.isEmpty(data)) {
|
||||
const {
|
||||
columns, dataSource, pageInfo, selectedRowKeys, i18n: i18nRes = {},
|
||||
showTotalCell = false, sumRowlistUrl = "", payload = {}
|
||||
showTotalCell = false, sumRowlistUrl = "", payload = {}, calcDetail
|
||||
} = data;
|
||||
setSumRowlistUrl(sumRowlistUrl);
|
||||
setShowTotalCell(showTotalCell);
|
||||
setIsDetailTable(calcDetail);
|
||||
setI18n(i18nRes);
|
||||
setPayload(payload);
|
||||
setPageInfo(pageInfo);
|
||||
|
|
@ -128,9 +130,10 @@ const index: FunctionComponent<Props> = (props) => {
|
|||
};
|
||||
return (<Table
|
||||
rowKey="id" size="small" bordered className={styles.tableWrapper}
|
||||
columns={columns} dataSource={dataSource} rowSelection={rowSelection}
|
||||
dataSource={dataSource} rowSelection={rowSelection}
|
||||
scroll={{ x: 1200, y: `calc(100vh - ${!showTotalCell ? 165 : 200}px)` }}
|
||||
footer={() => <CalcExplainFooter i18n={i18n}/>}
|
||||
columns={!isDetailTable ? columns : _.filter(columns, o => o.dataIndex !== "operate")}
|
||||
footer={() => !isDetailTable ? <CalcExplainFooter i18n={i18n}/> : null}
|
||||
pagination={{
|
||||
...paginationFun(pageInfo, sizeChange, onChange, i18n),
|
||||
size: "default"
|
||||
|
|
|
|||
|
|
@ -28,15 +28,15 @@ const ReportTable: FC = (props) => {
|
|||
setI18n(i18n);
|
||||
setColumns(_.map(columns, (item, index: number) => {
|
||||
if (index === 0) {
|
||||
return { ...item, fixed: "left" };
|
||||
return { ...item, fixed: "left", ellipsis: true };
|
||||
}
|
||||
return {
|
||||
...item,
|
||||
children: _.map(item.children, child => {
|
||||
return {
|
||||
...child,
|
||||
...child, ellipsis: true,
|
||||
render: (text: string, record: any) => {
|
||||
return <Button type="link" onClick={() => {
|
||||
return <Button type="link" block onClick={() => {
|
||||
window.parent.postMessage(
|
||||
{
|
||||
type: "turn",
|
||||
|
|
|
|||
|
|
@ -110,3 +110,16 @@ export const paginationAction = (pageInfo = {}, i18n = {}, onChange, onShowSizeC
|
|||
showSizeChanger: true
|
||||
};
|
||||
};
|
||||
/*
|
||||
* Author: 黎永顺
|
||||
* Description:
|
||||
* Params: 格式化钱
|
||||
* Date: 2023/12/6
|
||||
*/
|
||||
export const toDecimal_n = (num, decimalPlaces) => {
|
||||
if (num === null || !isFinite(num)) return null
|
||||
if (decimalPlaces < 0) return null;
|
||||
const multiplier = Math.pow(10, decimalPlaces);
|
||||
const roundedNum = Math.round(num * multiplier) / multiplier;
|
||||
return roundedNum.toFixed(decimalPlaces);
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue