显示转义后的html

release
YCC 2 years ago
parent 986f260e08
commit 2983dceab1

@ -74,7 +74,6 @@ class Invoice {
FKState: data.FKState,
};
});
this.invoicePage.total = json.Result[0].TotalCount;
} else {
this.invoiceList = [];
}
@ -222,12 +221,6 @@ class Invoice {
});
}
invoicePage = {
current: 1,
size: 10,
total: 0,
};
/* 测试数据 */
//账单列表范例数据
testData = [

@ -121,4 +121,12 @@ export function clickUrl(url) {
httpLink.href = url;
httpLink.target = "_blank";
httpLink.click();
}
}
export function escape2Html(str) {
var temp = document.createElement("div");
temp.innerHTML = str;
var output = temp.innerText || temp.textContent;
temp = null;
return output;
}

@ -31,6 +31,7 @@ const feedbackListColumns = [
{
title: "Post Survey",
dataIndex: "Average",
render: (text, record) => (text ? text : ""),//0
sorter: (a, b) => b.Average - a.Average,
},
{
@ -47,8 +48,7 @@ function Index() {
const showTotal = total => `Total ${feedbackList.length} items`;
useEffect(() => {
feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59")
.catch(ex => {
feedbackStore.searchFeedbackList(authStore.login.travelAgencyId, referenceNo, search_date_start.format(config.DATE_FORMAT), search_date_end.format(config.DATE_FORMAT) + " 23:59").catch(ex => {
// notification.error({
// message: `Error`,
// description: ex.message,
@ -56,7 +56,7 @@ function Index() {
// duration: 4,
// });
console.log(ex.message);
});
});
}, []);
return (

@ -12,10 +12,8 @@ const { Title } = Typography;
function Index() {
const { authStore, invoiceStore } = useStore();
const { invoiceList, invoicePage, search_date_start, search_date_end } = invoiceStore;
const { invoiceList, search_date_start, search_date_end } = invoiceStore;
const [groupNo, onGroupNoChange] = useState("");
const [arrivalDateRange, onDateRangeChange] = useState([]);
const [dataLoading, setDataLoading] = useState(false);
const { notification } = App.useApp();
const showTotal = total => `Total ${invoiceList.length} items`;
@ -26,24 +24,19 @@ function Index() {
key: "GroupName",
render: (text, record) => <NavLink to={`/invoice/detail/${record.key}/${record.gmd_gri_sn}`}>{text}</NavLink>,
},
{
{
title: "Arrival Date",
key: "LeftGDate",
dataIndex: "LeftGDate",
render: (text, record) => (isNotEmpty(text) ? formatDate(new Date(text)) : ""),
},
{
title: "人数",
key: "PersonNum",
dataIndex: "PersonNum",
},
{
title: "团总额",
title: "Total Amount",
key: "AllMoney",
dataIndex: "AllMoney",
},
{
title: "账单状态",
title: "Status",
key: "status",
render: BillStatus,
},
@ -66,22 +59,22 @@ function Index() {
initial={1}
items={[
{
title: "提交",
title: "Submitted",
//status: 'finish',
icon: <EditOutlined />,
},
{
title: "顾问",
title: "Travel Advisor",
// status: 'finish',
icon: <SolutionOutlined />,
},
{
title: "财务",
title: "Finance Dept",
//status: 'process',
icon: <AuditOutlined />,
},
{
title: "Done",
title: "Paid",
//status: 'wait',
icon: <SmileOutlined />,
},
@ -120,7 +113,7 @@ function Index() {
<Title level={3}></Title>
<Row>
<Col span={24}>
<Table bordered loading={dataLoading} pagination={{ defaultPageSize: 20, showTotal: showTotal }} columns={invoiceListColumns} dataSource={toJS(invoiceList)} />
<Table bordered pagination={{ defaultPageSize: 20, showTotal: showTotal }} columns={invoiceListColumns} dataSource={toJS(invoiceList)} />
</Col>
</Row>
</Space>

@ -27,7 +27,9 @@ function Detail() {
<Col span={16}>
<Title level={1}>{noticeInfo.CCP_BLTitle}</Title>
<Divider orientation="right">{noticeInfo.CCP_LastEditTime}</Divider>
<Paragraph>{noticeInfo.CCP_BLContent}</Paragraph>
<Paragraph>
<div dangerouslySetInnerHTML={{ __html: comm.escape2Html(noticeInfo.CCP_BLContent) }}></div>
</Paragraph>
</Col>
<Col span={4}>
<NavLink to="/notice">Back</NavLink>

Loading…
Cancel
Save