chore: format

This commit is contained in:
Methapon2001 2023-12-04 02:45:11 +00:00
parent cdd2a90d06
commit d0c79673fe
No known key found for this signature in database
GPG key ID: 849924FEF46BD132
14 changed files with 3946 additions and 1413 deletions

View file

@ -1,16 +1,17 @@
# EDM Frontend
Enterprise Document Management (EDM) ส่วน frontend
Enterprise Document Management (EDM) ส่วน frontend
# ส่วนประกอบ
- Vue.js (TypeScript) ใช้ Quasar Framework เป็น UI Framework หลักสำหรับการพัฒนา
- pnpm เป็น package manager
- Library Document ใช้ typedoc, typedoc-plugin-vue
```
pnpm i -D typedoc typedoc-plugin-vue
```
สำหรับ User
## โครงสร้างโฟลเดอร์

View file

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />

File diff suppressed because it is too large Load diff

View file

@ -1,8 +1,8 @@
{
"realm": "EDM",
"auth-server-url": "https://edm-id.frappet.synology.me/",
"ssl-required": "external",
"resource": "EDM-V1",
"public-client": true,
"confidential-port": 0
}
"realm": "EDM",
"auth-server-url": "https://edm-id.frappet.synology.me/",
"ssl-required": "external",
"resource": "EDM-V1",
"public-client": true,
"confidential-port": 0
}

View file

@ -12,12 +12,12 @@ const props = withDefaults(
</script>
<template>
<q-dialog
persistent
transition-show="scale"
transition-hide="scale"
:model-value="props.open"
@update:model-value="(v) => $emit('update:open', v)"
<q-dialog
persistent
transition-show="scale"
transition-hide="scale"
:model-value="props.open"
@update:model-value="(v) => $emit('update:open', v)"
>
<q-card style="width: 400px">
<q-card-section>
@ -36,7 +36,7 @@ const props = withDefaults(
label="ยกเลิก"
flat
v-close-popup
@click="() => ($emit('update:open', !open))"
@click="() => $emit('update:open', !open)"
id="dialogDeleteClose"
/>

View file

@ -15,13 +15,12 @@ const props = withDefaults(
defineProps<{ action: boolean; viewMode: 'view_list' | 'view_module' }>(),
{
action: false,
}
},
)
const DEPT_NAME = ['ตู้เอกสาร', 'ลิ้นชัก', 'แฟ้ม', 'แฟ้มย่อย'] as const
const { getFileInfo, getFileNameFormat } = useFileInfoStore()
const { currentFolder, currentFile, currentDept, currentPath } = storeToRefs(
useTreeDataStore()
)
const { currentFolder, currentFile, currentDept, currentPath } =
storeToRefs(useTreeDataStore())
const {
createFolder,
editFolder,
@ -38,8 +37,8 @@ const currentIcon = computed(() =>
currentDept.value === 0
? 'mdi-file-cabinet'
: currentDept.value === 1
? 'inbox'
: 'o_folder_open'
? 'inbox'
: 'o_folder_open',
)
const dialogDeleteState = ref<boolean>(false)
@ -114,7 +113,7 @@ function triggerFileEdit(
keyword: string[]
category: string[]
},
pathname: string
pathname: string,
) {
fileFormState.value = true
fileFormType.value = 'edit'
@ -138,7 +137,7 @@ async function submitFileForm(
keyword: string[]
category: string[]
},
force = false
force = false,
) {
currentParam.value = value
@ -170,7 +169,7 @@ async function submitFileForm(
keyword: value.keyword,
category: value.category,
},
value.file
value.file,
)
}
fileFormData.value = {}
@ -325,7 +324,7 @@ async function submitFileForm(
keyword: value.keyword,
category: value.category,
},
value.pathname
value.pathname,
)
"
@delete="() => triggerFileDelete(value.pathname)"

View file

@ -8,15 +8,19 @@ defineEmits(['edit', 'delete'])
<q-list dense>
<q-item clickable @click="() => $emit('edit')" id="FileltemActionEdit">
<q-item-section>
<div class="row items-center white ">
<div class="row items-center white">
<q-icon name="edit" color="positive" />
<span class="q-ml-sm">แกไข</span>
</div>
</q-item-section>
</q-item>
<q-item clickable @click="() => $emit('delete')" id="FileltemActiondelete">
<q-item
clickable
@click="() => $emit('delete')"
id="FileltemActiondelete"
>
<q-item-section>
<div class="row items-center white ">
<div class="row items-center white">
<q-icon name="delete" color="negative" />
<span class="q-ml-sm">ลบ</span>
</div>
@ -27,15 +31,11 @@ defineEmits(['edit', 'delete'])
</q-btn>
</template>
<style scoped>
.white {
.white {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
display: block;
display: block;
}
</style>

View file

@ -10,9 +10,8 @@ import FileForm from './FileForm.vue'
import FolderForm from './FolderForm.vue'
const { getFormatDate, getSize, getType, getFileInfo } = useFileInfoStore()
const { listDataFile, listDataFolder, currentDept, currentPath } = storeToRefs(
useTreeDataStore()
)
const { listDataFile, listDataFolder, currentDept, currentPath } =
storeToRefs(useTreeDataStore())
const {
createFolder,
editFolder,
@ -34,18 +33,18 @@ const currentLevel = computed(() =>
currentDept.value === 0
? 'ตู้จัดเก็บเอกสาร'
: currentDept.value === 1
? 'ลิ้นชัก'
: currentDept.value === 2
? 'แฟ้ม'
: 'แฟ้มย่อย'
? 'ลิ้นชัก'
: currentDept.value === 2
? 'แฟ้ม'
: 'แฟ้มย่อย',
)
const currentIcon = computed(() =>
currentDept.value === 0
? 'mdi-file-cabinet'
: currentDept.value === 1
? 'inbox'
: 'o_folder_open'
? 'inbox'
: 'o_folder_open',
)
const folderFormState = ref<boolean>(false)
@ -121,7 +120,7 @@ function triggerFileEdit(
keyword: string[]
category: string[]
},
pathname: string
pathname: string,
) {
fileFormState.value = true
fileFormType.value = 'edit'
@ -145,7 +144,7 @@ async function submitFileForm(
keyword: string[]
category: string[]
},
force = false
force = false,
) {
currentParam.value = value
@ -170,7 +169,7 @@ async function submitFileForm(
keyword: value.keyword,
category: value.category,
},
value.file
value.file,
)
}
fileFormData.value = {}
@ -263,14 +262,12 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
<div
class="flex flex-break d justify-between space-between"
v-if="currentDept >= 1 && props.mode == 'admin' && currentDept != 4"
>
<div>
<span class="text-h6">{{ currentLevel }}</span>
</div>
<div>
<q-btn
outline
push
class="q-px-md q-ml-md q-py-sm"
@ -295,7 +292,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
:rows-per-page-options="[0]"
@row-click="onRowClick"
class="cursor"
v-if=" currentDept != 4 "
v-if="currentDept != 4"
>
<template v-slot:body-cell-name="nameRow">
<q-td style="width: 50%">
@ -331,7 +328,7 @@ const onRowClick = (evt: Event, row: TreeDataFolder, index: number) => {
@click.stop="
triggerFolderEdit(
actionsRow.row.name,
actionsRow.row.pathname
actionsRow.row.pathname,
)
"
id="listViewFolderEdit"

View file

@ -106,7 +106,6 @@ async function searchSubmit() {
v-model="searchData.value"
id="inputSearch"
@keydown.enter.prevent="searchSubmit"
>
<template v-slot:append><q-icon name="search" /></template>
</q-input>

View file

@ -4,6 +4,6 @@ export default [
{
path: '/',
name: 'UserHomePage',
component: () => import('@/modules/01_user/views/homePage.vue')
}
component: () => import('@/modules/01_user/views/homePage.vue'),
},
]

View file

@ -4,6 +4,6 @@ export default [
{
path: '/admin',
name: 'AdminHomePage',
component: () => import('@/modules/02_admin/views/homePage.vue')
}
component: () => import('@/modules/02_admin/views/homePage.vue'),
},
]

View file

@ -93,7 +93,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
currentPath.value = pathname
const res = await axiosClient.get<EhrFolder[]>(
`${apiEndpoint}${requestPath}`
`${apiEndpoint}${requestPath}`,
)
const list = res.data.map((v) => ({
@ -245,7 +245,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
description: string
keyword: string[]
category: string[]
}
},
) {
loader.show()
@ -265,7 +265,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
{
file: file.name,
...metadata,
}
},
)
if (res && res.data.upload) {
@ -294,7 +294,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
keyword: string[]
category: string[]
},
file?: File
file?: File,
) {
loader.show()
@ -309,7 +309,7 @@ export const useTreeDataStore = defineStore('changeCabinet', () => {
const res = await axiosClient.patch<{ upload: string }>(
`${apiEndpoint}${requestPath}`,
{ file: file?.name, ...metadata }
{ file: file?.name, ...metadata },
)
if (res && res.data.upload) {

View file

@ -1,9 +1,9 @@
<script lang="ts">
import { defineComponent } from "vue";
import { defineComponent } from 'vue'
export default defineComponent({
name: "Error404NotFound",
});
name: 'Error404NotFound',
})
</script>
<template>

View file

@ -1,5 +1,5 @@
{
"plugin": ["typedoc-plugin-vue"],
"entryPoints": ["src/main.ts","src/**/*.ts"],
"out": "fe-typedoc"
"plugin": ["typedoc-plugin-vue"],
"entryPoints": ["src/main.ts", "src/**/*.ts"],
"out": "fe-typedoc"
}