ISAM/isampage/src/components/ComponentCommon.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ISAM/isampage/src/components/Table/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ISAM/isampage/src/components/UnitPrice/Content/index.vue | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
ISAM/isampage/src/style.css | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
ISAM/isampage/src/components/ComponentCommon.js
@@ -1,12 +1,26 @@ import {onBeforeUnmount} from 'vue'; import { onBeforeUnmount } from "vue"; /** * * * @param {WindowEventMap} type addEventListener的事件类型 * @param {Function} fn // addEventListener的回调函数 */ export function handleListener(type,fn) { window.addEventListener(type,fn); onBeforeUnmount(() => { window.removeEventListener(type,fn); }); } export function handleListener(type, fn) { window.addEventListener(type, fn); onBeforeUnmount(() => { window.removeEventListener(type, fn); }); } /** * 数字转换为千分位 * @param {number} num * @returns {string} */ export function toThousands(num) { //整数位 let int = num.toString().split(".")[0]; //小数位 let float = num.toString().split(".")[1] || ""; return ( int.replace(/(\d)(?=(?:\d{3})+$)/g, "$1,") + (float ? "." + float : "") ); } ISAM/isampage/src/components/Table/index.vue
@@ -1,6 +1,6 @@ <template> <div> <ElTable :class="styles.container" :data="computedData" border :header-row-class-name="styles.table"> <ElTable size="large" :class="styles.container" :data="computedData" border :header-row-class-name="styles.table"> <ElTableColumn :header-align="tableAlign" prop="Approve_Role_Name" label="职位" align="center"></ElTableColumn> <ElTableColumn :header-align="tableAlign" prop="Approve_Comment" align="center" label="备注"> <template #default="{ row }"> ISAM/isampage/src/components/UnitPrice/Content/index.vue
@@ -85,6 +85,7 @@ <script setup> import { defineProps, computed } from "vue"; import { toThousands } from "../../ComponentCommon"; const props = defineProps({ content: { type: Array, @@ -100,7 +101,8 @@ return props.content.map((item) => { let res = { ...item }; res.Item_Name = item.Item_Name.split("/"); res.Unit_Price = (+res.Unit_Price).toFixed(5); res.Unit_Price =toThousands((+res.Unit_Price).toFixed(5)); res.LT = toThousands(res.LT); res.Exchange_Unit_Price = (+res.Exchange_Unit_Price).toFixed(5); return res; }); ISAM/isampage/src/style.css
@@ -4,7 +4,6 @@ box-sizing: border-box; } a{ text-decoration-line: none; color: black; } ul{