Compare commits
No commits in common. "634bb6a20932fd60a087dc7f79b6532451312462" and "2ce291b55052a8341e9b9af7a040338a2d058562" have entirely different histories.
634bb6a209
...
2ce291b550
6 changed files with 135 additions and 105 deletions
30
astro.config.mjs
Normal file
30
astro.config.mjs
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
// @ts-check
|
||||||
|
import { defineConfig } from 'astro/config'
|
||||||
|
import solidJs from '@astrojs/solid-js'
|
||||||
|
import compressor from 'astro-compressor'
|
||||||
|
import robotsTxt from '@itsmatteomanf/astro-robots-txt'
|
||||||
|
import purgecss from 'astro-purgecss'
|
||||||
|
|
||||||
|
export default defineConfig({
|
||||||
|
output: 'static',
|
||||||
|
prefetch: true,
|
||||||
|
integrations: [
|
||||||
|
solidJs(),
|
||||||
|
compressor({ gzip: false, brotli: true }),
|
||||||
|
robotsTxt(),
|
||||||
|
purgecss({
|
||||||
|
fontFace: true,
|
||||||
|
variables: true,
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
vite: {
|
||||||
|
css: {
|
||||||
|
transformer: 'lightningcss',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
build: {
|
||||||
|
assets: '_fwt',
|
||||||
|
inlineStylesheets: 'never',
|
||||||
|
},
|
||||||
|
site: 'http://localhost:4321',
|
||||||
|
})
|
||||||
|
|
@ -14,16 +14,12 @@ interface Props {
|
||||||
width?: number
|
width?: number
|
||||||
wide?: boolean
|
wide?: boolean
|
||||||
class?: string
|
class?: string
|
||||||
function?: () => Promise<void>
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default (props: Props) => {
|
export default (props: Props) => {
|
||||||
const [isOpen, setIsOpen] = createSignal(false)
|
const [isOpen, setIsOpen] = createSignal(false)
|
||||||
|
|
||||||
const openHandler = async () => {
|
const openHandler = () => {
|
||||||
if (props.function) {
|
|
||||||
await props.function()
|
|
||||||
}
|
|
||||||
setIsOpen(true)
|
setIsOpen(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,7 +32,6 @@ export default (props: Props) => {
|
||||||
<Show when={!isOpen()}>
|
<Show when={!isOpen()}>
|
||||||
<Button label={props.label} edges={props.edges} design={props.design} onClick={openHandler} />
|
<Button label={props.label} edges={props.edges} design={props.design} onClick={openHandler} />
|
||||||
</Show>
|
</Show>
|
||||||
|
|
||||||
<Show when={isOpen()}>
|
<Show when={isOpen()}>
|
||||||
<div class="modal" onClick={closeHandler}>
|
<div class="modal" onClick={closeHandler}>
|
||||||
<Show when={props.border}>
|
<Show when={props.border}>
|
||||||
|
|
|
||||||
|
|
@ -116,7 +116,3 @@ h1
|
||||||
|
|
||||||
&__detail
|
&__detail
|
||||||
font-size: 1rem
|
font-size: 1rem
|
||||||
|
|
||||||
&__price
|
|
||||||
font-size: 1.75rem
|
|
||||||
font-weight: 700
|
|
||||||
|
|
|
||||||
|
|
@ -18,43 +18,40 @@ export default () => {
|
||||||
const [client, setClient] = createSignal('')
|
const [client, setClient] = createSignal('')
|
||||||
const [location, setLocation] = createSignal('')
|
const [location, setLocation] = createSignal('')
|
||||||
const [type, setType] = createSignal('')
|
const [type, setType] = createSignal('')
|
||||||
|
const [applicationNo, setApplicationNo] = createSignal('')
|
||||||
const [applicationList, setApplicationList] = createSignal<string[]>([])
|
|
||||||
const [nameList, setNameList] = createSignal<string[]>([])
|
|
||||||
|
|
||||||
const getListForApproval = async () => {
|
const getListForApproval = async () => {
|
||||||
try {
|
try {
|
||||||
const response = await ofetch(API + 'get-listopapproval-electrical', { parseResponse: JSON.parse })
|
const response = await ofetch(API + 'get-listopapproval-electrical', { parseResponse: JSON.parse })
|
||||||
setApplicationList(response.result)
|
return response.result
|
||||||
setNameList(response.result2)
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error)
|
console.error(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// const getListOfReadyForApprovalFiltered = async (list: number[]) => {
|
const getListOfReadyForApprovalFiltered = async (list: number[]) => {
|
||||||
// let newList: number[] = []
|
let newList: number[] = []
|
||||||
|
|
||||||
// for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
// const response = await ofetch(API + 'get-laststatus-electrical/' + list[i], { parseResponse: JSON.parse })
|
const response = await ofetch(API + 'get-laststatus-electrical/' + list[i], { parseResponse: JSON.parse })
|
||||||
// if (response.result === 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL') {
|
if (response.result === 'FOR ELECTRICAL ORDER OF PAYMENT APPROVAL') {
|
||||||
// newList.push(list[i])
|
newList.push(list[i])
|
||||||
// }
|
}
|
||||||
// }
|
}
|
||||||
|
|
||||||
// return [...newList]
|
return [...newList]
|
||||||
// }
|
}
|
||||||
|
|
||||||
// const getApplicationById = async (list: number[]) => {
|
const getApplicationById = async (list: number[]) => {
|
||||||
// let applicationList: string[] = []
|
let applicationList: string[] = []
|
||||||
|
|
||||||
// for (let i = 0; i < list.length; i++) {
|
for (let i = 0; i < list.length; i++) {
|
||||||
// const response = await ofetch(API + 'get-applicationbyid-electrical/' + list[i], { parseResponse: JSON.parse })
|
const response = await ofetch(API + 'get-applicationbyid-electrical/' + list[i], { parseResponse: JSON.parse })
|
||||||
// applicationList.push(response.result)
|
applicationList.push(response.result)
|
||||||
// }
|
}
|
||||||
|
|
||||||
// setUpdatedList([...applicationList])
|
setUpdatedList([...applicationList])
|
||||||
// }
|
}
|
||||||
|
|
||||||
const load = async () => {
|
const load = async () => {
|
||||||
// const listForApproval = await getListForApproval()
|
// const listForApproval = await getListForApproval()
|
||||||
|
|
@ -62,11 +59,12 @@ export default () => {
|
||||||
// await getApplicationById(listOfReadyForApprovalFiltered)
|
// await getApplicationById(listOfReadyForApprovalFiltered)
|
||||||
|
|
||||||
// console.log(listOfReadyForApprovalFiltered)
|
// console.log(listOfReadyForApprovalFiltered)
|
||||||
await getListForApproval()
|
await getopdetails()
|
||||||
}
|
}
|
||||||
|
|
||||||
const getopdetails = async (applicationNo: string) => {
|
const getopdetails = async () => {
|
||||||
const op = await ofetch(API + 'get-opdetails-electrical/' + applicationNo, { parseResponse: JSON.parse })
|
const op = await ofetch(API + 'get-opdetails-electrical/23512', { parseResponse: JSON.parse })
|
||||||
|
setApplicationNo(op.result[0])
|
||||||
setAssessor(op.result7[0])
|
setAssessor(op.result7[0])
|
||||||
setLocation(op.result5[0])
|
setLocation(op.result5[0])
|
||||||
setType(op.result6[0])
|
setType(op.result6[0])
|
||||||
|
|
@ -76,10 +74,33 @@ export default () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
const calculateTotal = (list: number[]) => {
|
const calculateTotal = (list: number[]) => {
|
||||||
const total = list.map((item) => parseFloat(item.toString())).reduce((acc, curr) => acc + curr, 0)
|
let total = 0
|
||||||
|
for (let i = 0; i < list.length; i++) {
|
||||||
|
total += parseInt(list[i].toString())
|
||||||
|
}
|
||||||
return total
|
return total
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const getEmployeeName = async (id: string) => {
|
||||||
|
try {
|
||||||
|
const response = await ofetch(API + 'get-employeename/' + id, { parseResponse: JSON.parse })
|
||||||
|
const result = response.result
|
||||||
|
return result
|
||||||
|
} catch {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const getPaymentName = async (id: string) => {
|
||||||
|
try {
|
||||||
|
const response = await ofetch(API + 'get-paymentname/' + id, { parseResponse: JSON.parse })
|
||||||
|
const result = response.result
|
||||||
|
return result
|
||||||
|
} catch {
|
||||||
|
return ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const displayFullname = (firstname: string, middleinitial: string, lastname: string) => {
|
const displayFullname = (firstname: string, middleinitial: string, lastname: string) => {
|
||||||
let result
|
let result
|
||||||
if (firstname.length > 0) {
|
if (firstname.length > 0) {
|
||||||
|
|
@ -153,62 +174,50 @@ export default () => {
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{applicationList().map((item, index) => (
|
<tr>
|
||||||
<tr>
|
<td>111</td>
|
||||||
<td>{item}</td>
|
<td>11</td>
|
||||||
<td>{nameList()[index]}</td>
|
<td>
|
||||||
|
<ModalButton class="modal" label="Show Details" design="bo-link" background="#121e2acc" color="#ffffffec">
|
||||||
|
<Padding top={0} left={2} right={2} bottom={0}>
|
||||||
|
<Box curved thickness={1} padding="1rem">
|
||||||
|
<span class="modal__application-number">{applicationNo()}</span>
|
||||||
|
</Box>
|
||||||
|
<section class="modal__row">
|
||||||
|
<span class="modal__row__label">Name of Applicant:</span>
|
||||||
|
<span class="modal__row__detail">{client()}</span>
|
||||||
|
</section>
|
||||||
|
|
||||||
<td>
|
<section class="modal__row">
|
||||||
<ModalButton
|
<span class="modal__row__label">Location:</span>
|
||||||
class="modal"
|
<span class="modal__row__detail">{location()}</span>
|
||||||
label="Show Details"
|
</section>
|
||||||
design="bo-link"
|
|
||||||
background="#121e2acc"
|
|
||||||
color="#ffffffec"
|
|
||||||
function={async () => {
|
|
||||||
await getopdetails(item)
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Padding top={0} left={2} right={2} bottom={0}>
|
|
||||||
<Box curved thickness={1} padding="1rem">
|
|
||||||
<span class="modal__application-number">{item}</span>
|
|
||||||
</Box>
|
|
||||||
<section class="modal__row">
|
|
||||||
<span class="modal__row__label">Name of Applicant:</span>
|
|
||||||
<span class="modal__row__detail">{nameList()[index]}</span>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
<section class="modal__row">
|
<section class="modal__row">
|
||||||
<span class="modal__row__label">Location:</span>
|
<span class="modal__row__label">Type:</span>
|
||||||
<span class="modal__row__detail">{location()}</span>
|
<span class="modal__row__detail">{type().toUpperCase()}</span>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="modal__row">
|
<section class="modal__row">
|
||||||
<span class="modal__row__label">Type:</span>
|
<span class="modal__row__label">Assessed By:</span>
|
||||||
<span class="modal__row__detail">{type().toUpperCase()}</span>
|
<span class="modal__row__detail">{assessor()}</span>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class="modal__row">
|
<section class="modal__row">
|
||||||
<span class="modal__row__label">Assessed By:</span>
|
<span class="modal__row__label">Total Fee:</span>
|
||||||
<span class="modal__row__detail">{assessor()}</span>
|
<span class="modal__row__detail">
|
||||||
</section>
|
{PESO} {totalOp().toFixed(2)}
|
||||||
|
</span>
|
||||||
|
</section>
|
||||||
|
|
||||||
<section class="modal__row">
|
<Row gap={1} padding="1rem 0 0 0">
|
||||||
<span class="modal__row__label">Total Fee:</span>
|
<Button label="Disapprove" edges="curved" design="bo-danger"></Button>
|
||||||
<span class="modal__row__detail__price">
|
<Button label="Approve" edges="curved" design="bo-primary"></Button>
|
||||||
{PESO} {totalOp().toFixed(2)}
|
</Row>
|
||||||
</span>
|
</Padding>
|
||||||
</section>
|
</ModalButton>
|
||||||
|
</td>
|
||||||
<Row gap={12} padding="2rem 0 0 0">
|
</tr>
|
||||||
<Button label="Disapprove" edges="curved" design="bo-danger"></Button>
|
|
||||||
<Button label="Approve" edges="curved" design="bo-primary"></Button>
|
|
||||||
</Row>
|
|
||||||
</Padding>
|
|
||||||
</ModalButton>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
))}
|
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</Tabs.Content>
|
</Tabs.Content>
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
// import sharp from 'sharp'
|
|
||||||
|
|
||||||
// import * as path from 'path'
|
|
||||||
|
|
||||||
// const generateFavicon = async () => {
|
|
||||||
// const inputSrc = 'src/assets/images/logo.png'
|
|
||||||
// const faviconPath = path.join(__dirname, '../public/favicon.png')
|
|
||||||
|
|
||||||
// try {
|
|
||||||
// await sharp(inputSrc).png({ quality: 90 }).resize(50).toFile(faviconPath)
|
|
||||||
// console.log('Favicon generated successfully')
|
|
||||||
// } catch (error) {
|
|
||||||
// console.error('Error generating favicon:', error)
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
// export default generateFavicon
|
|
||||||
17
src/utils/js/generateFavicon.js
Normal file
17
src/utils/js/generateFavicon.js
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
import sharp from 'sharp'
|
||||||
|
|
||||||
|
const path = require('path')
|
||||||
|
|
||||||
|
const generateFavicon = async () => {
|
||||||
|
const inputSrc = 'src/assets/images/logo.png'
|
||||||
|
const faviconPath = path.join(__dirname, '../public/favicon.png')
|
||||||
|
|
||||||
|
try {
|
||||||
|
await sharp(inputSrc).png({ quality: 90 }).resize(50).toFile(faviconPath)
|
||||||
|
console.log('Favicon generated successfully')
|
||||||
|
} catch (error) {
|
||||||
|
console.error('Error generating favicon:', error)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
export default generateFavicon
|
||||||
Loading…
Add table
Add a link
Reference in a new issue