修复html属性的bug!

This commit is contained in:
Kane Wang 2023-03-17 15:11:21 +08:00
parent 8053360878
commit 6f4dbdbd7e
4 changed files with 66 additions and 66 deletions

View File

@ -36,6 +36,7 @@ module.exports = {
], ],
rules: { rules: {
indent: ["warn", 4,], indent: ["warn", 4,],
"space-in-parens": ["error", "always", { exceptions: ["empty",], },],
"no-console": process.env.NODE_ENV === "production" ? "warn" : "off", "no-console": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off", "no-debugger": process.env.NODE_ENV === "production" ? "warn" : "off",
"no-unused-vars": "warn", "no-unused-vars": "warn",

View File

@ -26,17 +26,16 @@ export default {
default: () => [], default: () => [],
}, },
}, },
setup (props) setup( props )
{ {
const ui = reactive({ const ui = reactive( {
chart_data: props.chartData, } );
});
// //
const initCharts = () => const initCharts = () =>
{ {
const chartDom = document.getElementById("chartWrapper"); const chartDom = document.getElementById( "chartWrapper" );
const myChart = echarts.init(chartDom as HTMLDivElement); const myChart = echarts.init( chartDom as HTMLDivElement );
const option = { const option = {
xAxis: { xAxis: {
type: "category", type: "category",
@ -54,7 +53,7 @@ export default {
], ],
}; };
option && myChart.setOption(option); option && myChart.setOption( option );
window.onresize = function () window.onresize = function ()
{ {
@ -63,12 +62,14 @@ export default {
}; };
}; };
onMounted(() => onMounted( () =>
{ {
initCharts(); initCharts();
}); } );
return { ui, initCharts, }; console.log( props );
return { ui, initCharts, props, };
}, },
}; };
</script> </script>

View File

@ -40,17 +40,17 @@ export default {
month: { month: {
type: String, type: String,
require: true, require: true,
default:()=>"本", default: () => "本",
}, },
leadingReward: { leadingReward: {
type: String, type: String,
require: true, require: true,
default:()=>"", default: () => "",
}, },
advanceReward: { advanceReward: {
type: String, type: String,
require: true, require: true,
default:()=>"", default: () => "",
}, },
}, },
setup() setup()
@ -102,7 +102,6 @@ export default {
width: 165px; width: 165px;
height: 100%; height: 100%;
} }
.advance-reward-wrapper { .advance-reward-wrapper {

View File

@ -28,8 +28,7 @@
</div> </div>
<div class="total-archievement-charts-wrapper"> <div class="total-archievement-charts-wrapper">
<ArchievementChart <ArchievementChart
total_archievement="435220" :chart-data="ui.chartData"
:chart_data="ui.chartData"
/> />
</div> </div>
</div> </div>
@ -71,35 +70,35 @@ export default {
{ {
const router = useRouter(); const router = useRouter();
const staffInfo = loadStaffInfo(); const staffInfo = loadStaffInfo();
const ui = reactive({ const ui = reactive( {
chartData: [200, 230, 224, 218, 135, 147, 260, 800,], chartData: [200, 230, 224, 218, 135, 147, 260, 800,],
totalArchievement: 120000000, totalArchievement: 120000000,
dishonorPersons: ["张三", "李四",], dishonorPersons: ["张三", "李四",],
}); } );
const getTotalArchievement = computed(() => const getTotalArchievement = computed( () =>
{ {
const cnyFormat = new Intl.NumberFormat("zh-cn", const cnyFormat = new Intl.NumberFormat( "zh-cn",
{ {
style: "currency", style: "currency",
currency: "CNY", currency: "CNY",
minimumFractionDigits: 0, minimumFractionDigits: 0,
}); } );
const archievement = cnyFormat.format(ui.totalArchievement); const archievement = cnyFormat.format( ui.totalArchievement );
return archievement; return archievement;
}); } );
// //
if (staffInfo.P13UID === "") if ( staffInfo.P13UID === "" )
{ {
ElMessage({ ElMessage( {
message: "登录信息失效,请重新登录!", message: "登录信息失效,请重新登录!",
type: "success", type: "success",
center: true, center: true,
}); } );
router.push("/login"); router.push( "/login" );
} }
return { ui, getTotalArchievement, }; return { ui, getTotalArchievement, };