ํ‹ฐ์Šคํ† ๋ฆฌ ๋ทฐ

๐Ÿ’ฌ iframe(HTML Inline Frame) ์ด๋ž€

ํ•ด๋‹น ์›น ํŽ˜์ด์ง€ ์•ˆ์— ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋ฅผ ๋ถˆ๋Ÿฌ์™€์„œ ์‚ฝ์ž…ํ•  ์ˆ˜ ์žˆ๋‹ค.

 

๐Ÿ“Œ  ํ”„๋กœ์ ํŠธ ๊ตฌ์„ฑ ๋ฐฉ์‹

์ง€๊ธˆ ์ง„ํ–‰ํ•˜๋Š” ํ”„๋กœ์ ํŠธ๋Š” main-proejct / dev-project ๋กœ ์„œ๋น„์Šค๋ฅผ ๋‚˜๋ˆ ์„œ ๊ตฌ์„ฑํ–ˆ๋‹ค.

Main Project : ๋กœ๊ทธ์ธ, ๋ฉ”๋‰ด, ์‚ฌ์šฉ์ž, ๊ฐ ์„œ๋น„์Šค iframe ์—ฐ๊ฒฐ์„ ๊ด€๋ฆฌํ•˜๋Š” ํ”„๋กœ์ ํŠธ

Dev Project : ๊ฐœ๋ฐœํ•˜๋Š” ํ™”๋ฉด์„ ๊ด€๋ฆฌํ•˜๋Š” ํ”„๋กœ์ ํŠธ (iframe์•ˆ์— ๋“ค์–ด๊ฐ)

 

๐Ÿ“Œ  ํ”„๋กœ์ ํŠธ ์‹คํ–‰

Main / Dev ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•˜๊ณ  (npm run serve)

Main Url๋กœ ์ ‘์†ํ•œ ํ›„, Dev ์„œ๋น„์Šค๋ฅผ iframe์œผ๋กœ ํ˜ธ์ถœํ•œ๋‹ค.

๐Ÿ“Œ  Main Project์˜ Template

<template>
	<div class="h-100">
		<iframe ref="iframeRef" :name="name" :src="`${url}?${queryString}`" frameborder="0" class="w-100 h-100" @load="load"> </iframe>
	</div>
</template>

<script>
// ... ์ƒ๋žต

computed: {
	queryString() {
    	const params = { ...this.iframeParam, ...this.screenParam };
        const str = Object.entries(params)
            .map(e => e.join('=')
            .join('&');
        return str;
    }
}

</script>

src์— Dev ์„œ๋น„์Šค์˜ ๋ผ์šฐํŠธ๋ฅผ ๋„ฃ์–ด์ค€๋‹ค.

 

โœ… name : iframe์˜ name

โœ… url : iframe ํ˜ธ์ถœ ์ฃผ์†Œ (Dev-Project ์ฃผ์†Œ)

โœ… iframeParam : iframe์— ํƒœ์šธ QueryString ๊ฐ์ฒด

โœ… screenParam : Menu ์‹œ์Šฝ๋ฉ”์—์„œ ์‚ฌ์šฉ์ค‘์ธ ๋ชจ๋“  iframe์˜ ๊ณตํ†ต QueryString ๊ฐ์ฒด (ํฐํŠธ,์–ธ์–ด ๋“ฑ)

 

๐Ÿ“Œ  ํ”„๋กœ์ ํŠธ ์‹คํ–‰

Main / Dev ํ”„๋กœ์ ํŠธ๋ฅผ ์‹คํ–‰ํ•˜๊ณ  (npm run serve)

Main Url๋กœ ์ ‘์†ํ•œ ํ›„, Dev ์„œ๋น„์Šค๋ฅผ iframe์œผ๋กœ ํ˜ธ์ถœํ•œ๋‹ค.

 

๐Ÿ“Œ  ํ”„๋กœ์ ํŠธ ๊ตฌ์กฐ

Main Url (Network) : http://xx.xx.xx.82:8081 

Dev Url (Network) : http://ee.ee.ee.82:3001 

๋ฉ”๋‰ด๋ฅผ ๋ˆ„๋ฅผ ๋•Œ๋งˆ๋‹ค main์€ ๋™์ผํ•˜๊ณ , iframe์•ˆ์˜ src๋งŒ ๋ณ€๊ฒฝ๋˜๋ฉฐ ํ™”๋ฉด์„ ํ˜ธ์ถœํ•œ๋‹ค.

 

๐Ÿ“Œ  Main/Dev ํ”„๋กœ์ ํŠธ์˜ routes

โ—ผ Main Project์˜ routes.js 

const LoginLayout = () => import('@/views/Layout/Login/LoginLayout.vue');
const LoginPage = () => import('@/views/Pages/Login/LoginPage.vue');
const InitPasswordForm = () => import('@/views/Pages/Login/Content/InitPasswordForm.vue');
const ResetForm = () => import('@/views/Pages/Login/Content/ResetForm.vue');

const routes = [
	{
		path: '/',
		name: '',
		redirect: '/login',
		component: LoginLayout,
		children: [
			//๋กœ๊ทธ์ธ ํŽ˜์ด์ง€
			{
				path: '/login',
				name: 'Login',
				component: LoginPage
			},

			//๋น„๋ฐ€๋ฒˆํ˜ธ ์ดˆ๊ธฐํ™” ํŽ˜์ด์ง€
			{
				path: '/initPassword',
				name: 'InitPassword',
				component: InitPasswordForm
			},

			//๋น„๋ฐ€๋ฒˆํ˜ธ ๋ณ€๊ฒฝ ํŽ˜์ด์ง€
			{
				path: '/reset',
				name: 'Reset',
				component: ResetForm
			}
		]
	},
];

export default routes;

 

โ—ผ Dev Project์˜ routes.js 

// ๊ธฐ๋ณธ ๋ ˆ์ด์•„์›ƒ
const DefaultLayout = () => import('@common/Layout/DefaultLayout');

// ๋ชจ๋‹ˆํ„ฐ๋ง 
const RealtimeCollectionStatus = () => import('@common/Monitoring/RealtimeCollectionStatus/RealtimeCollectionStatus.vue');
const AlarmHistory = () => import('@common/Monitoring/AlarmHistory/AlarmHistory.vue');


// ์ถ”๊ฐ€ํ•œ ํŽ˜์ด์ง€ Route ์ •๋ณด
const children = [
	{
		path: '/RealtimeCollectionStatus',
		component: RealtimeCollectionStatus
	},
	{
		path: '/alarmHistory',
		component: AlarmHistory
	}
]

const routes = [
	{
		path: '/',
		component: DefaultLayout,
		children
	}
];

export default routes;

 

 

 

 

 

๊ณต์ง€์‚ฌํ•ญ
์ตœ๊ทผ์— ์˜ฌ๋ผ์˜จ ๊ธ€
์ตœ๊ทผ์— ๋‹ฌ๋ฆฐ ๋Œ“๊ธ€
Total
Today
Yesterday
๋งํฌ
ยซ   2025/08   ยป
์ผ ์›” ํ™” ์ˆ˜ ๋ชฉ ๊ธˆ ํ† 
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
๊ธ€ ๋ณด๊ด€ํ•จ