jobdone-shared-files v1.0.23
Vue Components
如果要使用 vue 檔,需要直接引用 node_modules 裡的檔案,例如:
import OOXX from '../../node_modules/jobdone-shared-files/OOXX.vue';
.
01.ProjectManagement/projectNavbar - 專案資訊Navbar
需要傳入的值:
數值名稱 | 說明 | 必要 |
---|---|---|
root-domain | 底層的 domain,傳入的值有無斜線皆可 | 是 |
arrow-back-link | 離開專案的連結,一般來說是底層的 ProjectList | 是 |
project-info | 可接受api url或物件,api僅支援Get請求,結構應為{name: "", caseNo: "", caseNo: "",beginDT:"",endDT:"",approvedWorkingPeriod:0, extendToDT:"",extendDays:""} | 是 |
project-apps | 可接受api url或物件,api僅支援Get請求,結構去Copy底層API取得專案所屬Module的App連結(V2 TOP) | 是 |
active-client-id | Navbar active的對象,請填入client id,不填預設active專案資訊 | N |
project-id | project id | 是 |
user-id | 傳入 user 的帳號 id | 是 |
user-picture | 傳入 user 的大頭貼 | 是 |
log-out-link | 登出連結 | 是 |
.
02.Paginate - 分頁
範例
<template>
<paginate
container-class="..."
:total-pages="..."
:current-page="..."
@to-page="...">
</paginate>
</template>
<script setup>
import paginate from 'jobdone-shared-files/paginate.vue';
<script>
可用參數
# | 參數 Attribute | 型別 Type | 預設值 Default | 選項 Option | 說明 Description |
---|---|---|---|---|---|
1 | container-class | String | '' | ' ' 'pagination-sm' 'pagination-lg' | 尺寸設定 |
2 | total-pages | Number | 1 | 任意阿拉伯數字 | 總頁數 |
3 | current-page | Number | 1 | 任意阿拉伯數字 | 當前頁碼 |
4 | page-range | Number | 5 | 任意阿拉伯數字 | 最多顯示幾個頁碼 |
可用方法
# | 參數 Attribute | 說明 Description |
---|---|---|
1 | to-page | 點選頁碼執行的動作 |
.
03.TagEditor - 標籤
範例
<template>
<tagEditor
ref="tagEditorComponent"
:auto-complete-option='autoCompleteTagList'
@update-auto-complete-option="getTagListByKeyWord">
</tagEditor>
</template>
<script setup>
import tagEditor from 'jobdone-shared-files/tagEditor.vue';
<!-- autoComplete 功能 -->
const autoCompleteTagList = ref([]);
async function getTagListByKeyWord(keyword) {
autoCompleteTagList.value = await axios.get(...).data;
}
<!-- 取得建立的TAG值 -->
const tagEditorComponent = ref(null);
const tags = ref([])
functio getTag(){
tags.value = tagEditorComponent.value.tagAry
}
<script>
可用參數
# | 參數 Attribute | 型別 Type | 預設值 Default | 選項 Option | 說明 Description |
---|---|---|---|---|---|
1 | placeholder | String | '請在此處輸入標籤文字' | 任意字串 | input的提示文字 |
2 | auto-complete | Boolean | true | true false | 是否啟用AutoComplete,啟用的話必需傳入用於AutoComplete的Array |
3 | auto-complete-option | Array | [] | ['...','...','...'] | 僅接受字串陣列。 |
4 | disabled | Boolean | false | true false | 停用 |
可用方法
# | 參數 Attribute | 說明 Description |
---|---|---|
1 | update-auto-complete-option | 文字輸入時呼叫,value為當前輸入的值,可用於刷新autoCompleteOption。 |
.
04.Tree - 樹狀結構
範例
<template>
<tree :items="items" :click-item="clickItem" size="sm">
<template v-slot:icon-start>
// 前方箭頭後的 slot 插槽
</template>
<template v-slot:icon="slotProps">
// 後方的 slot 插槽,預設為 radio icon
// 透過 slotProps 取得每一個 item 的資料
{{slotProps.item}}
</template>
</tree>
</template>
<script setup>
import tree from 'jobdone-shared-files/tree.vue';
const items = [
{
id:1,
name:'分類A',
children{
id:11,
title:'分類A'-1,
children:[
...
]
}
},{
id:2,
name:'分類B',
children{
id:12,
title:'分類B-1',
children:[
...
]
}
},
...
]
function clickItem(v){
console.log(v)
}
<script>
可用參數
# | 參數 Attribute | 型別 Type | 預設值 Default | 選項 Option | 說明 Description |
---|---|---|---|---|---|
1 | items | Array | [] | 須包含Id,名稱必須為title,子層的Key必須為children | 尺寸設定 |
2 | size | String | '' | '' 'sm' | 內容陣列 |
4 | bgColor | String | '' | '' 'white' | 用於什麼樣子的背景色上,預設用在灰色背景上。用在白背景上可使用white模式 |
可用方法
Function | 說明 Description |
---|---|
clickItem | 點選項目執行的方法 |
.
05.VueLoadingOverlay - 指定樣式讀取樣式
範例
<template>
<Loading :is-active="isLoading"></Loading>
</template>
<script setup>
import Loading from "jobdone-shared-files/vueLoadingOverlay.vue";
<!-- loading 初始化 "isLoading" => 自定義變數 -->
const isLoading = ref(false);
<!-- 開啟loading -->
function showLodaing(){
isLoading.value = true;
}
<!-- 關閉loading -->
function showLodaing(){
isLoading.value = false;
}
</script>
可用變數:
# | 參數 Attribute | 型別 Type | 預設值 Default | 說明Description |
---|---|---|---|---|
1. | full-page | Boolean | true | 是否填滿整個視窗。為False時,則填滿放置位置的父層 |
其他可用變數(統一樣式不推薦修改):
# | 參數 Attribute | 型別 Type | 預設值 Default | 說明Description |
---|---|---|---|---|
1. | is-active | Boolean | false | 開啟 / 關閉 |
2. | loader | String | bars | 圖案樣式spinner / dots / bars 三種可選 |
3. | colors | String | #fff | 圖案顏色 |
4. | background-color | String | #000 | 遮罩顏色 |
5. | opacity | Number | 0.5 | 遮罩透明度 |
.
06.lightboxWithOverview - 有縮圖的圖片光箱
<lightbox-with-overview
:pictures-data="picturesData"
ref="lightboxWithOverviewRef">
</lightbox-with-overview>
可傳入的值:
數值名稱 | 說明 | 必要 |
---|---|---|
pictures-data | 格式為: [{src: "", title: ""}] | 是 |
preview | 是否要顯示縮圖,可傳入 true or false | 否 |
display-index | 預設 index 為 0 | 否 |
preview-count | preview 的圖片陣列數量,預設為 5,可使用 lightboxWithOverviewRef?.previewPictures 與 lightboxWithOverviewRef?.otherPictureCount | 否 |
.
07.autocompleteSelect - autocomplete下拉選單
範例1:簡易型,String Array 的選單
<template>
<autocomplete-select
:opts="opts"
:selected-data="selected"
@select="(v) => selected = v">
</autocomplete-select>
</template>
<script setup>
import autocompleteSelect from 'jobdone-shared-files/autocompleteSelect.vue';
const selected =''
const opts =['汪汪汪','喵喵喵','啾啾啾']
<script>
範例2:複雜型,Object Array 的選單
<template>
<autocomplete-select
:selected-data="selected"
:opts="members"
:filter-keys="['firstName','lastName','enName']"
preview-key="enName + ' ( ' + lastName + ' ' + firstName + ' ) '"
binding-key="id"
@select="(v) => selected = v.id"
></autocomplete-select>
</template>
<script setup>
import autocompleteSelect from 'jobdone-shared-files/autocompleteSelect.vue';
const selected = '1'
const members =[{
id:'1',
firstName:'美美',
lastName:'陳',
enName:'Amy'
},{
id:'2',
firstName:'大蒙',
lastName:'王',
enName:'Jed'
},{
...
}]
<script>
範例3:自訂選單樣式()
<template>
<autocomplete-select
:selected-data="selected"
:opts="members"
:filter-keys="['firstName','lastName','enName']"
preview-key="enName + ' ( ' + lastName + ' ' + firstName + ' ) '"
binding-key="id"
@select="(v) => selected = v.id"
:html-option='true'
>
<template #option = "{ optData }">
<div>我全要喵喵喵喵!!</div>
<div>
{{optData.phoneNumber}}
</div>
<div>
{{ `${optData.enName} (${ optData.firstName } ${ optData.lastName })` }}
</div>
</template>
</autocomplete-select>
</template>
<script setup>
import autocompleteSelect from 'jobdone-shared-files/autocompleteSelect.vue';
const selected = '1'
const members =[{
id:'1',
firstName:'美美',
lastName:'陳',
enName:'Amy',
phoneNumber:'0911111111',
},{
id:'2',
firstName:'大蒙',
lastName:'王',
enName:'Jed',
phoneNumber:'092222222',
},{
...
}]
<script>
基本參數
# 參數 Attribute 型別 Type 預設值 Default 選項 Option 說明 Description 1 selected-data
String
Number
Object
none
當前選擇的值(類似平常 vModel
的用法)2 opts
Array
[]
選項列表,只接受 StringArray
NumberArray
ObjectArray
,且請陣列內容格3 placeholder
String
'請選擇'
未選擇內容時的提示文字 4 search-placeholder
String
''
自定義搜尋框的提示文字。如未設定,有選擇內容時會將選擇的內容當成提示文字,而未選擇時則顯示placeholder(參數3)的值 5 trigger-class
String
''
預覽框與輸入框的樣式CLSS,可用於驗證提示 6 list-put
String
'body'
列表Dom放置位置
清除按鈕參數
# | 參數 Attribute | 型別 Type | 預設值 Default | 選項 Option | 說明 Description |
---|---|---|---|---|---|
7 | clear-btn | Boolean | True | True False | 是否顯示清除按鈕 |
8 | clear-placeholder | String | '清除選擇' | 清除按鈕的文字 | |
9 | reset-value | String Number Object | '' | 清空選擇替換的預設值 |
Object陣列選項清單用參數
# | 參數 Attribute | 型別 Type | 預設值 Default | 選項 Option | 說明 Description |
---|---|---|---|---|---|
10 | preview-key | String | '' | 顯示指定字符連接。請填入符合規定的字串 | 用+號連接keyName和自定義字串,自定義字串請用''包起來(空白同理)。範例enName + ' ( ' + lastName + ' ' + firstName + ' ) ' |
11 | filter-key | Array | ['name'] | 字串陣列 | 傳入需要進行篩選比對的keyName,可多個。 |
12 | binding-key | String | '' | 本參數僅供提傳入供單一且為唯一值得keyName,一般用於ID。 | 如傳入的選項列表為複雜object陣列,但選中的值是某個key。可傳入Key Name以供Component辨並從傳入的陣列中找出該object。如綁定的是整個object,不需使用此參數。 |
13 | is-undefined-hint | String | '⚠️ 未找到符合原選擇的選項,可能相關資料曾發生異動 | 字串 | 傳入binding-key但比對失敗,在opts(參數2)中找不到binding-key內容與selected-data值相符的選項,用於提示的預覽文字 |
14 | html-option | Boolean | false | true false | 是否啟用自訂選項樣式,用法請參考範例3。請注意就算起啟用preview-key還是必須傳入。 |
可用方法
Function | 說明 Description |
---|---|
select | 選到項目要做什麼 |
.
.
.
Directives
01.SelectPlaceholder
<select>
未選擇值時加上Placeholder樣式
null
false
undefined
''
預設會被判斷為Placeholder,如有增減需求請參考option可用變數。
使用範例:
<template>
<select class="form-select"
v-model="selectingValue"
v-select-placeholder="{
value: selectingValue,
placeholderValue: [1,2],
excludeValue: [false],
unselectClass:'is-invalid'
}">
<option :value="null">請選擇一隻貓,這是Placeholder</option>
<option :value="false">雖然是false,但是我任性地說他一個正常的選項</option>
<option :value="1">雖然是1,但是我任性地說他Placeholder選項</option>
<option :value="2">雖然是2,但是我任性地說他Placeholder選項</option>
<option :value="3">Candy</option>
...
</select>
</template>
<script setup>
import { ref } from "vue";
import vSelectPlaceholder from 'jobdone-shared-files/common/directives/selectPlaceholder.js';
const selectingValue = ref(null)
</script>
可用變數
# | 參數 Attribute | 型別 Type | 必填 required | 預設值 Default | 說明Description |
---|---|---|---|---|---|
1 | value | -- | 是 | -- | 當前選擇內容的值 |
2 | placeholderValue | Array | 否 | [] | 除了預設會被判斷為Placeholder的值,如有其他需求可增加。 |
3 | excludeValue | Array | 否 | [] | 如預設會被判斷為Placeholder的值,需被排除判斷,可在此處排除 |
4 | unselectClass | String | 否 | '' | 如在未選擇值時希望有更多特殊樣式,可在此傳入Class。不需要加. |
.
02.textareaAutoHeight
使用範例:
<template>
<textarea v-textarea-auto-height v-model="inputValue"></textarea>
</template>
<script setup>
import { ref } from "vue";
import vTextareaAutoHeight from 'jobdone-shared-files/common/directives/textareaAutoHeight.js';
const inputValue = ref(null)
</script>
SCSS
Layout
Layout 名稱 | 說明 | 在 jobdone-shared-files 內? |
---|---|---|
LayoutBase | 客製化的 Bootstrap (5.3.0) | 是 |
LayoutProject | Project 使用的共用樣式,含開合雙欄樣式 | 是 |
LayoutSinglePage | 單頁版面的樣式,如:登入、錯誤頁、條款等 | 是 |
LayoutTwoColumn | 雙欄可開合樣式 | 是 |
LayoutDocs | 針對條文調整的樣式 | 否 |
LayoutInnerColumn | 針對 Project 雙欄樣式內的雙欄樣式 | 否 |
LayoutOutside | 針對 (底層) Project 外的共用樣式 | 否 |
Common
- Animation:目前只有 Fade In keyframe
- SelectableTable:勾選 tr focus style
- thumbnail-group:方形大頭貼與小大頭貼相疊 style
- filepond:客製化 filepond 樣式
5 days ago
5 days ago
5 days ago
5 days ago
5 days ago
5 days ago
5 days ago
5 days ago
4 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
11 days ago
12 days ago
12 days ago
12 days ago
12 days ago
12 days ago
22 days ago
22 days ago
25 days ago
25 days ago
25 days ago
25 days ago
25 days ago
25 days ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
4 months ago
4 months ago
4 months ago
5 months ago
5 months ago
5 months ago
6 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
7 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
8 months ago
8 months ago
8 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago
11 months ago