显示转义后的html

release
YCC 2 years ago
parent 986f260e08
commit 2983dceab1

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

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

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

@ -27,7 +27,9 @@ function Detail() {
<Col span={16}> <Col span={16}>
<Title level={1}>{noticeInfo.CCP_BLTitle}</Title> <Title level={1}>{noticeInfo.CCP_BLTitle}</Title>
<Divider orientation="right">{noticeInfo.CCP_LastEditTime}</Divider> <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>
<Col span={4}> <Col span={4}>
<NavLink to="/notice">Back</NavLink> <NavLink to="/notice">Back</NavLink>

Loading…
Cancel
Save