|
|
@@ -8,18 +8,13 @@ |
|
|
background-color='grey lighten-4' |
|
|
background-color='grey lighten-4' |
|
|
show-arrows |
|
|
show-arrows |
|
|
> |
|
|
> |
|
|
<v-tab |
|
|
|
|
|
v-for='item in assertGroup' |
|
|
|
|
|
:key='item.text' |
|
|
|
|
|
class=' font-weight-bold' |
|
|
|
|
|
|
|
|
|
|
|
> |
|
|
|
|
|
<v-icon small>{{ item.text }}</v-icon> |
|
|
|
|
|
</v-tab> |
|
|
|
|
|
<div class="d-flex align-center"> |
|
|
<div class="d-flex align-center"> |
|
|
|
|
|
<!--新增資產群駔對話--> |
|
|
<v-dialog |
|
|
<v-dialog |
|
|
v-model='dialogNewAssertGroup' |
|
|
v-model='dialogNewAssertGroup' |
|
|
@click:outside='close' |
|
|
@click:outside='close' |
|
|
|
|
|
:retain-focus="false" |
|
|
|
|
|
overlay-opacity="0" |
|
|
> |
|
|
> |
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
<v-btn |
|
|
<v-btn |
|
|
@@ -44,19 +39,19 @@ |
|
|
class='d-flex' |
|
|
class='d-flex' |
|
|
> |
|
|
> |
|
|
<v-text-field |
|
|
<v-text-field |
|
|
v-model="assertGroupDescript" |
|
|
|
|
|
|
|
|
v-model="insertAssertGroupDescript" |
|
|
label='群組名稱' |
|
|
label='群組名稱' |
|
|
hint='必填' |
|
|
hint='必填' |
|
|
/> |
|
|
/> |
|
|
</v-col> |
|
|
</v-col> |
|
|
<v-col |
|
|
<v-col |
|
|
v-model="assertGroupTablename" |
|
|
|
|
|
cols='12' |
|
|
cols='12' |
|
|
sm='6' |
|
|
sm='6' |
|
|
md='4' |
|
|
md='4' |
|
|
class='d-flex' |
|
|
class='d-flex' |
|
|
> |
|
|
> |
|
|
<v-text-field |
|
|
<v-text-field |
|
|
|
|
|
v-model="insertAssertGroupTablename" |
|
|
label='資料庫表格名稱' |
|
|
label='資料庫表格名稱' |
|
|
hint='必填' |
|
|
hint='必填' |
|
|
/> |
|
|
/> |
|
|
@@ -76,7 +71,7 @@ |
|
|
<v-btn |
|
|
<v-btn |
|
|
color='blue darken-1' |
|
|
color='blue darken-1' |
|
|
text |
|
|
text |
|
|
@click='mockInsertAssertGroup' |
|
|
|
|
|
|
|
|
@click='insertAssertGroup' |
|
|
> |
|
|
> |
|
|
新增 |
|
|
新增 |
|
|
</v-btn> |
|
|
</v-btn> |
|
|
@@ -84,40 +79,120 @@ |
|
|
</v-card> |
|
|
</v-card> |
|
|
</v-dialog> |
|
|
</v-dialog> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
<v-tab |
|
|
|
|
|
v-for='(item, index) in assertGroup' |
|
|
|
|
|
:key='index' |
|
|
|
|
|
class=' font-weight-bold' |
|
|
|
|
|
@mouseover="showTabOptionIcon(index)" |
|
|
|
|
|
@mouseleave="optionIconShow = -1" |
|
|
|
|
|
> |
|
|
|
|
|
<v-icon small>{{ item.text }}</v-icon> |
|
|
|
|
|
<v-spacer></v-spacer> |
|
|
|
|
|
<!--修改資產群駔對話--> |
|
|
|
|
|
<v-dialog |
|
|
|
|
|
:id="index" |
|
|
|
|
|
v-model='dialogModifyAssertGroupName' |
|
|
|
|
|
:retain-focus="false" |
|
|
|
|
|
overlay-opacity="0" |
|
|
|
|
|
@click:outside='close' |
|
|
|
|
|
> |
|
|
|
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
v-bind='attrs' |
|
|
|
|
|
v-on='on' |
|
|
|
|
|
icon |
|
|
|
|
|
> |
|
|
|
|
|
<v-icon v-show="optionIconShow === index" small |
|
|
|
|
|
@click="modifyAssertGroup = JSON.parse(JSON.stringify(item))">mdi-pencil |
|
|
|
|
|
</v-icon> |
|
|
|
|
|
</v-btn> |
|
|
|
|
|
</template> |
|
|
|
|
|
<v-card> |
|
|
|
|
|
<v-card-title> |
|
|
|
|
|
<span class='headline font-weight-bold'>修改資產群組名稱</span> |
|
|
|
|
|
</v-card-title> |
|
|
|
|
|
<v-card-text> |
|
|
|
|
|
<v-container> |
|
|
|
|
|
<v-row> |
|
|
|
|
|
<v-col |
|
|
|
|
|
cols='12' |
|
|
|
|
|
sm='6' |
|
|
|
|
|
md='4' |
|
|
|
|
|
class='d-flex' |
|
|
|
|
|
> |
|
|
|
|
|
<v-text-field |
|
|
|
|
|
v-model="modifyAssertGroup.text" |
|
|
|
|
|
label='群組名稱' |
|
|
|
|
|
hint='必填' |
|
|
|
|
|
/> |
|
|
|
|
|
</v-col> |
|
|
|
|
|
</v-row> |
|
|
|
|
|
</v-container> |
|
|
|
|
|
</v-card-text> |
|
|
|
|
|
<v-card-actions> |
|
|
|
|
|
<v-spacer></v-spacer> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
color='blue darken-1' |
|
|
|
|
|
text |
|
|
|
|
|
@click='close' |
|
|
|
|
|
> |
|
|
|
|
|
取消 |
|
|
|
|
|
</v-btn> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
color='blue darken-1' |
|
|
|
|
|
text |
|
|
|
|
|
@click='modifyAssertGroupName' |
|
|
|
|
|
> |
|
|
|
|
|
修改 |
|
|
|
|
|
</v-btn> |
|
|
|
|
|
</v-card-actions> |
|
|
|
|
|
</v-card> |
|
|
|
|
|
</v-dialog> |
|
|
|
|
|
<v-btn icon> |
|
|
|
|
|
<v-icon v-show="optionIconShow === index" small @click="deleteAssertGroup(item)"> |
|
|
|
|
|
mdi-delete |
|
|
|
|
|
</v-icon> |
|
|
|
|
|
</v-btn> |
|
|
|
|
|
</v-tab> |
|
|
|
|
|
<div class="d-flex align-center"> |
|
|
|
|
|
</div> |
|
|
<v-tabs-items v-model='currentTab'> |
|
|
<v-tabs-items v-model='currentTab'> |
|
|
<v-tab-item |
|
|
<v-tab-item |
|
|
v-for='cols in inventoryItems' |
|
|
|
|
|
:key='cols.index' |
|
|
|
|
|
|
|
|
v-for='(item, index) in assertGroup' |
|
|
|
|
|
:key='index' |
|
|
> |
|
|
> |
|
|
<v-data-table |
|
|
<v-data-table |
|
|
:items='cols' |
|
|
|
|
|
|
|
|
:items='allCols[item.value]' |
|
|
:headers='headers' |
|
|
:headers='headers' |
|
|
hide-default-footer |
|
|
hide-default-footer |
|
|
> |
|
|
> |
|
|
<template v-slot:item.actions='{ item }'> |
|
|
<template v-slot:item.actions='{ item }'> |
|
|
|
|
|
<!--修改資產群駔欄位對話--> |
|
|
<v-dialog |
|
|
<v-dialog |
|
|
v-model='dialogModify' |
|
|
v-model='dialogModify' |
|
|
@click:outside='close' |
|
|
@click:outside='close' |
|
|
|
|
|
:retain-focus="false" |
|
|
|
|
|
overlay-opacity="0" |
|
|
> |
|
|
> |
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
<v-btn |
|
|
<v-btn |
|
|
v-bind='attrs' |
|
|
v-bind='attrs' |
|
|
v-on='on' |
|
|
v-on='on' |
|
|
icon |
|
|
icon |
|
|
@click='log(item)' |
|
|
|
|
|
|
|
|
@click='modifyColItem = JSON.parse(JSON.stringify(item))' |
|
|
> |
|
|
> |
|
|
<v-icon>mdi-pencil</v-icon> |
|
|
<v-icon>mdi-pencil</v-icon> |
|
|
</v-btn> |
|
|
</v-btn> |
|
|
</template> |
|
|
</template> |
|
|
<v-card> |
|
|
<v-card> |
|
|
<v-card-title> |
|
|
<v-card-title> |
|
|
<span class='headline font-weight-bold'>修改</span> |
|
|
|
|
|
|
|
|
<span class='headline font-weight-bold'>修改欄位</span> |
|
|
</v-card-title> |
|
|
</v-card-title> |
|
|
<v-card-text> |
|
|
<v-card-text> |
|
|
<v-container> |
|
|
<v-container> |
|
|
<v-row> |
|
|
<v-row> |
|
|
<v-col |
|
|
<v-col |
|
|
v-for='(val, key, index) in item' |
|
|
|
|
|
|
|
|
v-for='(header, index) in headers' |
|
|
:key='index' |
|
|
:key='index' |
|
|
cols='12' |
|
|
cols='12' |
|
|
sm='6' |
|
|
sm='6' |
|
|
@@ -125,12 +200,36 @@ |
|
|
class='d-flex' |
|
|
class='d-flex' |
|
|
> |
|
|
> |
|
|
<v-text-field |
|
|
<v-text-field |
|
|
v-if='headers[index]' |
|
|
|
|
|
:label='headers[index].text' |
|
|
|
|
|
v-bind:value='val' |
|
|
|
|
|
|
|
|
v-if="header.text !== '' && header.value !== 'isselect' && isBooleanCol.indexOf(header.value) < 0" |
|
|
|
|
|
:label='header.text' |
|
|
|
|
|
:value="modifyColItem[header.value]" |
|
|
hint='必填' |
|
|
hint='必填' |
|
|
v-on:input='oninput(modifyCol, key, $event)' |
|
|
|
|
|
|
|
|
v-on:input='oninput(modifyColItem, header.value, $event)' |
|
|
|
|
|
/> |
|
|
|
|
|
<v-select |
|
|
|
|
|
v-if="header.value === 'isselect' && isBooleanCol.indexOf(header.value) < 0" |
|
|
|
|
|
:label='header.text' hint='必填' |
|
|
|
|
|
:value="modifyColItem[header.value]" |
|
|
|
|
|
v-on:input='oninput(modifyColItem, header.value, $event)' |
|
|
|
|
|
:items="selectColItem.isselect" |
|
|
|
|
|
:item-text="selectColItem.isselect.text" |
|
|
|
|
|
:item-value="selectColItem.isselect.value" |
|
|
|
|
|
/> |
|
|
|
|
|
<v-select |
|
|
|
|
|
v-if="header.value && isBooleanCol.indexOf(header.value) >= 0" |
|
|
|
|
|
:label='header.text' hint='必填' |
|
|
|
|
|
:value="modifyColItem[header.value]" |
|
|
|
|
|
v-on:input='oninput(modifyColItem, header.value, $event)' |
|
|
|
|
|
:items="selectColItem.boolean" |
|
|
|
|
|
:item-text="selectColItem.boolean.text" |
|
|
|
|
|
:item-value="selectColItem.boolean.value" |
|
|
/> |
|
|
/> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
v-if="header.value === 'isselect' && modifyColItem.isselect === 'true'" |
|
|
|
|
|
@click='dialogModifySelectItem = true' |
|
|
|
|
|
> |
|
|
|
|
|
編輯選項 |
|
|
|
|
|
</v-btn> |
|
|
</v-col> |
|
|
</v-col> |
|
|
</v-row> |
|
|
</v-row> |
|
|
</v-container> |
|
|
</v-container> |
|
|
@@ -147,7 +246,7 @@ |
|
|
<v-btn |
|
|
<v-btn |
|
|
color='blue darken-1' |
|
|
color='blue darken-1' |
|
|
text |
|
|
text |
|
|
@click='modifyOne(item)' |
|
|
|
|
|
|
|
|
@click='modifyCol(modifyColItem)' |
|
|
> |
|
|
> |
|
|
修改 |
|
|
修改 |
|
|
</v-btn> |
|
|
</v-btn> |
|
|
@@ -156,17 +255,20 @@ |
|
|
</v-dialog> |
|
|
</v-dialog> |
|
|
<v-icon |
|
|
<v-icon |
|
|
small |
|
|
small |
|
|
@click='deleteOne(item)' |
|
|
|
|
|
|
|
|
@click='deleteCol(item)' |
|
|
> |
|
|
> |
|
|
mdi-delete |
|
|
mdi-delete |
|
|
</v-icon> |
|
|
</v-icon> |
|
|
</template> |
|
|
</template> |
|
|
<template v-slot:footer> |
|
|
<template v-slot:footer> |
|
|
<div class='d-flex ma-2'> |
|
|
<div class='d-flex ma-2'> |
|
|
<v-spacer/> |
|
|
|
|
|
|
|
|
<v-spacer/> |
|
|
|
|
|
<!--新增資產群駔欄位對話--> |
|
|
<v-dialog |
|
|
<v-dialog |
|
|
v-model='dialogInsert' |
|
|
v-model='dialogInsert' |
|
|
@click:outside='close' |
|
|
@click:outside='close' |
|
|
|
|
|
:retain-focus="false" |
|
|
|
|
|
overlay-opacity="0" |
|
|
> |
|
|
> |
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
<v-btn |
|
|
<v-btn |
|
|
@@ -179,13 +281,13 @@ |
|
|
</template> |
|
|
</template> |
|
|
<v-card> |
|
|
<v-card> |
|
|
<v-card-title> |
|
|
<v-card-title> |
|
|
<span class='headline font-weight-bold'>新增</span> |
|
|
|
|
|
|
|
|
<span class='headline font-weight-bold'>新增欄位</span> |
|
|
</v-card-title> |
|
|
</v-card-title> |
|
|
<v-card-text> |
|
|
<v-card-text> |
|
|
<v-container> |
|
|
<v-container> |
|
|
<v-row> |
|
|
<v-row> |
|
|
<v-col |
|
|
<v-col |
|
|
v-for='(val, key, index) in insertCol' |
|
|
|
|
|
|
|
|
v-for='(header, index) in headers' |
|
|
:key='index' |
|
|
:key='index' |
|
|
cols='12' |
|
|
cols='12' |
|
|
sm='6' |
|
|
sm='6' |
|
|
@@ -193,12 +295,33 @@ |
|
|
class='d-flex' |
|
|
class='d-flex' |
|
|
> |
|
|
> |
|
|
<v-text-field |
|
|
<v-text-field |
|
|
v-if='headers[index]' |
|
|
|
|
|
:label='headers[index].text' |
|
|
|
|
|
v-bind:value='val' |
|
|
|
|
|
|
|
|
v-if="header.text !== '' && header.value !== 'isselect' && isBooleanCol.indexOf(header.value) < 0" |
|
|
|
|
|
:label='header.text' |
|
|
hint='必填' |
|
|
hint='必填' |
|
|
v-on:input='oninput(insertCol, key, $event)' |
|
|
|
|
|
|
|
|
v-on:input='oninput(insertColItem, header.value, $event)' |
|
|
|
|
|
/> |
|
|
|
|
|
<v-select |
|
|
|
|
|
v-if="header.value === 'isselect' && isBooleanCol.indexOf(header.value) < 0" |
|
|
|
|
|
:label='header.text' hint='必填' |
|
|
|
|
|
v-on:input='oninput(insertColItem, header.value, $event)' |
|
|
|
|
|
:items="selectColItem.isselect" |
|
|
|
|
|
:item-text="selectColItem.isselect.text" |
|
|
|
|
|
:item-value="selectColItem.isselect.value" |
|
|
/> |
|
|
/> |
|
|
|
|
|
<v-select |
|
|
|
|
|
v-if="header.value && isBooleanCol.indexOf(header.value) >= 0" |
|
|
|
|
|
:label='header.text' hint='必填' |
|
|
|
|
|
v-on:input='oninput(insertColItem, header.value, $event)' |
|
|
|
|
|
:items="selectColItem.boolean" |
|
|
|
|
|
:item-text="selectColItem.boolean.text" |
|
|
|
|
|
:item-value="selectColItem.boolean.value" |
|
|
|
|
|
/> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
v-if="header.value === 'isselect' && insertColItem.isselect === 'true'" |
|
|
|
|
|
@click='dialogInsertSelectItem = true' |
|
|
|
|
|
> |
|
|
|
|
|
編輯選項 |
|
|
|
|
|
</v-btn> |
|
|
</v-col> |
|
|
</v-col> |
|
|
</v-row> |
|
|
</v-row> |
|
|
</v-container> |
|
|
</v-container> |
|
|
@@ -215,9 +338,9 @@ |
|
|
<v-btn |
|
|
<v-btn |
|
|
color='blue darken-1' |
|
|
color='blue darken-1' |
|
|
text |
|
|
text |
|
|
@click='modifyOne(item)' |
|
|
|
|
|
|
|
|
@click='insertCol(item)' |
|
|
> |
|
|
> |
|
|
修改 |
|
|
|
|
|
|
|
|
新增 |
|
|
</v-btn> |
|
|
</v-btn> |
|
|
</v-card-actions> |
|
|
</v-card-actions> |
|
|
</v-card> |
|
|
</v-card> |
|
|
@@ -227,13 +350,140 @@ |
|
|
</v-data-table> |
|
|
</v-data-table> |
|
|
</v-tab-item> |
|
|
</v-tab-item> |
|
|
</v-tabs-items> |
|
|
</v-tabs-items> |
|
|
|
|
|
<!--新增資產群組欄位選項對話--> |
|
|
|
|
|
<v-dialog |
|
|
|
|
|
width="80%" |
|
|
|
|
|
v-model='dialogInsertSelectItem' |
|
|
|
|
|
@click:outside='closeDialogInsertSelectItem' |
|
|
|
|
|
:retain-focus="false" |
|
|
|
|
|
overlay-opacity="0" |
|
|
|
|
|
> |
|
|
|
|
|
<v-card> |
|
|
|
|
|
<v-card-title> |
|
|
|
|
|
<span class='headline font-weight-bold'>編輯選項</span> |
|
|
|
|
|
</v-card-title> |
|
|
|
|
|
<v-card-text> |
|
|
|
|
|
<v-container> |
|
|
|
|
|
<v-row> |
|
|
|
|
|
<v-col cols="3" class="d-flex align-center"> |
|
|
|
|
|
<v-text-field outlined rounded hide-details |
|
|
|
|
|
v-model="insertSelectItem"/> |
|
|
|
|
|
<v-btn class="ml-2" @click='pushSelectItem'>新增</v-btn> |
|
|
|
|
|
</v-col> |
|
|
|
|
|
</v-row> |
|
|
|
|
|
<v-card class="mt-2 elevation-2" |
|
|
|
|
|
style="border: 1px solid grey;min-height: 250px;border-radius: 10px"> |
|
|
|
|
|
<v-chip |
|
|
|
|
|
v-for="(insertSelectItem, index) in insertSelectItems" |
|
|
|
|
|
:key="index" |
|
|
|
|
|
class="ma-2" |
|
|
|
|
|
color="secondary" |
|
|
|
|
|
> |
|
|
|
|
|
{{insertSelectItem}} |
|
|
|
|
|
<v-icon small class="ml-4" @click="deleteSelectItem(index)">mdi-close</v-icon> |
|
|
|
|
|
</v-chip> |
|
|
|
|
|
</v-card> |
|
|
|
|
|
</v-container> |
|
|
|
|
|
</v-card-text> |
|
|
|
|
|
<v-card-actions> |
|
|
|
|
|
<v-spacer></v-spacer> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
color='blue darken-1' |
|
|
|
|
|
text |
|
|
|
|
|
@click='closeDialogInsertSelectItem' |
|
|
|
|
|
> |
|
|
|
|
|
關閉 |
|
|
|
|
|
</v-btn> |
|
|
|
|
|
</v-card-actions> |
|
|
|
|
|
</v-card> |
|
|
|
|
|
</v-dialog> |
|
|
|
|
|
<!--修改資產群組欄位選項對話--> |
|
|
|
|
|
<v-dialog |
|
|
|
|
|
width="40%" |
|
|
|
|
|
v-model='dialogModifySelectItem' |
|
|
|
|
|
@click:outside='closeDialogModifySelectItem' |
|
|
|
|
|
:retain-focus="false" |
|
|
|
|
|
overlay-opacity="0" |
|
|
|
|
|
> |
|
|
|
|
|
<v-card> |
|
|
|
|
|
<v-card-title> |
|
|
|
|
|
<span class='headline font-weight-bold'>編輯選項</span> |
|
|
|
|
|
</v-card-title> |
|
|
|
|
|
<v-card-text> |
|
|
|
|
|
<v-container> |
|
|
|
|
|
<v-row> |
|
|
|
|
|
<v-col cols="11" class="d-flex align-center"> |
|
|
|
|
|
<v-text-field outlined rounded hide-details |
|
|
|
|
|
v-model="insertSelectItem"/> |
|
|
|
|
|
<v-btn class="ml-2" @click='pushSelectItem'>新增</v-btn> |
|
|
|
|
|
</v-col> |
|
|
|
|
|
</v-row> |
|
|
|
|
|
<v-card |
|
|
|
|
|
max-width="80%" |
|
|
|
|
|
class="mt-2" |
|
|
|
|
|
style="border: 1px solid grey; border-radius: 10px" |
|
|
|
|
|
> |
|
|
|
|
|
<v-card-text> |
|
|
|
|
|
<v-chip-group |
|
|
|
|
|
v-model="selection" |
|
|
|
|
|
column |
|
|
|
|
|
> |
|
|
|
|
|
<draggable @start="dragStart" @end="dragEnd"> |
|
|
|
|
|
<v-chip v-for="(modifySelectItem, i) in modifySelectItems" :key="i" color="secondary" class="col-12" draggable> |
|
|
|
|
|
{{ modifySelectItem }} |
|
|
|
|
|
</v-chip> |
|
|
|
|
|
</draggable> |
|
|
|
|
|
</v-chip-group> |
|
|
|
|
|
</v-card-text> |
|
|
|
|
|
</v-card> |
|
|
|
|
|
</v-container> |
|
|
|
|
|
</v-card-text> |
|
|
|
|
|
<v-card-actions> |
|
|
|
|
|
<v-spacer></v-spacer> |
|
|
|
|
|
<v-btn |
|
|
|
|
|
color='blue darken-1' |
|
|
|
|
|
text |
|
|
|
|
|
@click='closeDialogModifySelectItem' |
|
|
|
|
|
> |
|
|
|
|
|
關閉 |
|
|
|
|
|
</v-btn> |
|
|
|
|
|
</v-card-actions> |
|
|
|
|
|
</v-card> |
|
|
|
|
|
<div id="app"> |
|
|
|
|
|
<v-app id="inspire"> |
|
|
|
|
|
<v-card |
|
|
|
|
|
max-width="400" |
|
|
|
|
|
class="mx-auto" |
|
|
|
|
|
> |
|
|
|
|
|
<v-card-text> |
|
|
|
|
|
<v-chip-group |
|
|
|
|
|
v-model="selection" |
|
|
|
|
|
column |
|
|
|
|
|
active-class="primary--text" |
|
|
|
|
|
> |
|
|
|
|
|
<draggable v-model="tags" @start="dragStart" @end="dragEnd"> |
|
|
|
|
|
<v-chip v-for="(tag, i) in tags" :key="i" draggable> |
|
|
|
|
|
{{ tag.name }} |
|
|
|
|
|
</v-chip> |
|
|
|
|
|
</draggable> |
|
|
|
|
|
</v-chip-group> |
|
|
|
|
|
</v-card-text> |
|
|
|
|
|
</v-card> |
|
|
|
|
|
</v-app> |
|
|
|
|
|
</div> |
|
|
|
|
|
</v-dialog> |
|
|
</v-tabs> |
|
|
</v-tabs> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</template> |
|
|
</template> |
|
|
<script> |
|
|
<script> |
|
|
|
|
|
import draggable from 'vuedraggable'; |
|
|
|
|
|
|
|
|
export default { |
|
|
export default { |
|
|
name: '', |
|
|
name: '', |
|
|
|
|
|
components: { |
|
|
|
|
|
draggable, |
|
|
|
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
dialogInsert: false, |
|
|
dialogInsert: false, |
|
|
@@ -242,34 +492,68 @@ |
|
|
// dialogSearch: false, |
|
|
// dialogSearch: false, |
|
|
title: '資訊資產群組', |
|
|
title: '資訊資產群組', |
|
|
headers: [ |
|
|
headers: [ |
|
|
|
|
|
{'text': '', 'value': 'actions', fixed: true, sortable: false}, |
|
|
{'text': '中文名稱', 'value': 'descript'}, |
|
|
{'text': '中文名稱', 'value': 'descript'}, |
|
|
{'text': '資料庫欄位名稱', 'value': 'colname'}, |
|
|
{'text': '資料庫欄位名稱', 'value': 'colname'}, |
|
|
{'text': '型態', 'value': 'type'}, |
|
|
|
|
|
{'text': '文字框或選項', 'value': 'select'}, |
|
|
|
|
|
|
|
|
// {'text': '型態', 'value': 'type'}, |
|
|
|
|
|
{'text': '文字框或選項', 'value': 'isselect'}, |
|
|
{'text': '順序', 'value': 'index'}, |
|
|
{'text': '順序', 'value': 'index'}, |
|
|
{'text': '必填', 'value': 'require'}, |
|
|
|
|
|
{'text': '', 'value': 'actions', sortable: false} |
|
|
|
|
|
|
|
|
{'text': '必填', 'value': 'isrequire'}, |
|
|
|
|
|
{'text': '可匯出', 'value': 'isexport'}, |
|
|
|
|
|
{'text': '可搜尋', 'value': 'issearch'}, |
|
|
], |
|
|
], |
|
|
inventoryItems: [], |
|
|
|
|
|
insertCol: { |
|
|
|
|
|
|
|
|
allCols: [], |
|
|
|
|
|
insertColItem: { |
|
|
'tablename': '', |
|
|
'tablename': '', |
|
|
|
|
|
'descript': '', |
|
|
'colname': '', |
|
|
'colname': '', |
|
|
'level': null, |
|
|
'level': null, |
|
|
'descript': '', |
|
|
|
|
|
'type': '', |
|
|
|
|
|
'select': '', |
|
|
|
|
|
'search': '', |
|
|
|
|
|
'export': '', |
|
|
|
|
|
'require': '' |
|
|
|
|
|
|
|
|
// 'type': '', |
|
|
|
|
|
'index': '', |
|
|
|
|
|
'isselect': '', |
|
|
|
|
|
'issearch': '', |
|
|
|
|
|
'isexport': '', |
|
|
|
|
|
'isrequire': '' |
|
|
|
|
|
}, |
|
|
|
|
|
isBooleanCol: ['isexport', 'isrequire', 'issearch'], |
|
|
|
|
|
selectColItem: { |
|
|
|
|
|
'isselect': [{'text': '文字', 'value': 'false'}, |
|
|
|
|
|
{'text': '選項', 'value': 'true'}] |
|
|
|
|
|
, 'boolean': [{'text': '是', 'value': 'true'}, |
|
|
|
|
|
{'text': '否', 'value': 'false'}] |
|
|
}, |
|
|
}, |
|
|
modifyCol: {}, |
|
|
|
|
|
|
|
|
modifyColItem: {}, |
|
|
assertGroup: [], |
|
|
assertGroup: [], |
|
|
currentTab: 0, |
|
|
currentTab: 0, |
|
|
types: [], |
|
|
types: [], |
|
|
// selectItem: {}, |
|
|
// selectItem: {}, |
|
|
// searchItem: {}, |
|
|
// searchItem: {}, |
|
|
assertGroupDescript: '', |
|
|
|
|
|
assertGroupTablename: '', |
|
|
|
|
|
|
|
|
insertAssertGroupDescript: '', |
|
|
|
|
|
insertAssertGroupTablename: '', |
|
|
|
|
|
optionIconShow: -1, |
|
|
|
|
|
dialogModifyAssertGroupName: false, |
|
|
|
|
|
modifyAssertGroup: { |
|
|
|
|
|
text: '', |
|
|
|
|
|
valsue: '', |
|
|
|
|
|
}, |
|
|
|
|
|
dialogInsertSelectItem: false, |
|
|
|
|
|
insertSelectItems: [], |
|
|
|
|
|
insertSelectItem: '', |
|
|
|
|
|
modifySelectItems: [], |
|
|
|
|
|
modifySelectItem: '', |
|
|
|
|
|
dialogModifySelectItem: false, |
|
|
|
|
|
selection: null, |
|
|
|
|
|
currentTag: null, |
|
|
|
|
|
tags: [{ |
|
|
|
|
|
name: 'Shoping', |
|
|
|
|
|
},{ |
|
|
|
|
|
name: 'Art', |
|
|
|
|
|
}, { |
|
|
|
|
|
name: 'Tech', |
|
|
|
|
|
}, { |
|
|
|
|
|
name: 'Creative Writing' |
|
|
|
|
|
} |
|
|
|
|
|
], |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async mounted() { |
|
|
async mounted() { |
|
|
@@ -277,26 +561,80 @@ |
|
|
this.getTabs(); |
|
|
this.getTabs(); |
|
|
this.getTypes(); |
|
|
this.getTypes(); |
|
|
this.inventoryItems = []; |
|
|
this.inventoryItems = []; |
|
|
this.getInventoryItem(); |
|
|
|
|
|
|
|
|
this.getCols(); |
|
|
}, |
|
|
}, |
|
|
computed: {}, |
|
|
computed: {}, |
|
|
watch: { |
|
|
watch: { |
|
|
currentTab() { |
|
|
currentTab() { |
|
|
// // this.getTabs(); |
|
|
|
|
|
console.log(this.assertGroup[this.currentTab].value); |
|
|
|
|
|
this.getTypes(); |
|
|
this.getTypes(); |
|
|
this.getInventoryItem(); |
|
|
|
|
|
|
|
|
this.getCols(); |
|
|
|
|
|
}, |
|
|
|
|
|
dialogModifySelectItem() { |
|
|
|
|
|
this.getModifySelectItems(); |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
log(col) { |
|
|
|
|
|
console.log(col); |
|
|
|
|
|
|
|
|
// eslint-disable-next-line no-unused-vars |
|
|
|
|
|
log() { |
|
|
|
|
|
// console.log(col); |
|
|
|
|
|
console.log(this.modifySelectItems); |
|
|
|
|
|
}, |
|
|
|
|
|
dragStart() { |
|
|
|
|
|
|
|
|
|
|
|
if (this.modifySelectItems[this.selection]) { |
|
|
|
|
|
this.currentTag = this.modifySelectItems[this.selection]; |
|
|
|
|
|
} |
|
|
|
|
|
else { |
|
|
|
|
|
this.currentTag = null; |
|
|
|
|
|
} |
|
|
|
|
|
// console.log(this.selection); |
|
|
|
|
|
// console.log(this.currentTag); |
|
|
|
|
|
// console.log(this.tags[0].name); |
|
|
|
|
|
}, |
|
|
|
|
|
dragEnd() { |
|
|
|
|
|
var self = this; |
|
|
|
|
|
console.log(this.currentTag); |
|
|
|
|
|
if (this.currentTag) { |
|
|
|
|
|
this.modifySelectItems.forEach((x, i) => { |
|
|
|
|
|
if (x === self.currentTag) self.selection = i; |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
// console.log(this.selection); |
|
|
|
|
|
// console.log(this.currentTag); |
|
|
|
|
|
console.log(this.modifySelectItems[0]); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
closeDialogInsertSelectItem() { |
|
|
|
|
|
this.dialogInsertSelectItem = false |
|
|
|
|
|
this.insertSelectItems = []; |
|
|
|
|
|
}, |
|
|
|
|
|
getModifySelectItems() { |
|
|
|
|
|
this.$axios.get(`/assert/selectItems?tablename=${this.modifyColItem.tablename}&&colname=${this.modifyColItem.colname}`).then((resp) => { |
|
|
|
|
|
console.log(resp.data.data); |
|
|
|
|
|
this.modifySelectItems = resp.data.data; |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
closeDialogModifySelectItem() { |
|
|
|
|
|
this.dialogModifySelectItem = false; |
|
|
|
|
|
this.modifySelectItems = []; |
|
|
|
|
|
}, |
|
|
|
|
|
pushSelectItem() { |
|
|
|
|
|
if (this.insertSelectItems.indexOf(this.insertSelectItem) >= 0 || this.insertSelectItem === '') { |
|
|
|
|
|
alert('選項不得重複或為空'); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.insertSelectItems.push(this.insertSelectItem); |
|
|
|
|
|
this.insertSelectItem = ''; |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
deleteSelectItem(index) { |
|
|
|
|
|
this.insertSelectItems.splice(index, 1); |
|
|
}, |
|
|
}, |
|
|
oninput(item, key, val) { |
|
|
oninput(item, key, val) { |
|
|
this.$set(item, key, val); |
|
|
this.$set(item, key, val); |
|
|
}, |
|
|
}, |
|
|
getTabs() { |
|
|
|
|
|
this.$axios.get(`/assert/assertGroups`).then((resp) => { |
|
|
|
|
|
|
|
|
async getTabs() { |
|
|
|
|
|
await this.$axios.get(`/assert/assertGroups`).then((resp) => { |
|
|
|
|
|
this.assertGroup = []; |
|
|
resp.data.data.forEach((item) => { |
|
|
resp.data.data.forEach((item) => { |
|
|
let header = {'text': null, 'value': null}; |
|
|
let header = {'text': null, 'value': null}; |
|
|
header.text = item.descript; |
|
|
header.text = item.descript; |
|
|
@@ -312,25 +650,34 @@ |
|
|
this.types = resp.data.data; |
|
|
this.types = resp.data.data; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
getInventoryItem() { |
|
|
|
|
|
|
|
|
getCols() { |
|
|
const tablename = this.assertGroup[this.currentTab] ? this.assertGroup[this.currentTab].value : 'hardware'; |
|
|
const tablename = this.assertGroup[this.currentTab] ? this.assertGroup[this.currentTab].value : 'hardware'; |
|
|
this.$axios.get(`/assert/InventoryItems?tablename=${tablename}`).then((resp) => { |
|
|
|
|
|
this.inventoryItems = resp.data.data; |
|
|
|
|
|
|
|
|
this.$axios.get(`/assert/allCols?tablename=${tablename}`).then((resp) => { |
|
|
|
|
|
this.allCols = resp.data.data; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
insertOne() { |
|
|
|
|
|
this.insertItem.tablename = this.tablename; |
|
|
|
|
|
this.$axios.post(`/inventory?`, this.insertItem).then(() => { |
|
|
|
|
|
delete this.insertItem.tablename; |
|
|
|
|
|
this.getInventories(); |
|
|
|
|
|
this.close(); |
|
|
|
|
|
|
|
|
insertCol() { |
|
|
|
|
|
for (const key in this.insertColItem) { |
|
|
|
|
|
if (this.insertColItem[key] === '') { |
|
|
|
|
|
alert('所有資料不可為空'); |
|
|
|
|
|
return; |
|
|
|
|
|
} else { |
|
|
|
|
|
this.insertColItem.tablename = this.assertGroup[this.currentTab].value; |
|
|
|
|
|
this.insertColItem.insertselectItems = this.insertSelectItems; |
|
|
|
|
|
this.$axios.post(`/assert/col`, this.insertColItem).then(() => { |
|
|
|
|
|
this.getCols(); |
|
|
|
|
|
this.close(); |
|
|
|
|
|
this.insertSelectItems = []; |
|
|
|
|
|
} |
|
|
|
|
|
); |
|
|
} |
|
|
} |
|
|
); |
|
|
|
|
|
|
|
|
} |
|
|
}, |
|
|
}, |
|
|
close() { |
|
|
close() { |
|
|
this.dialogInsert = false; |
|
|
this.dialogInsert = false; |
|
|
this.dialogModify = false; |
|
|
this.dialogModify = false; |
|
|
this.dialogNewAssertGroup = false; |
|
|
this.dialogNewAssertGroup = false; |
|
|
|
|
|
this.dialogModifyAssertGroupName = false; |
|
|
}, |
|
|
}, |
|
|
isDisabled(key) { |
|
|
isDisabled(key) { |
|
|
const disabledKey = ['id']; |
|
|
const disabledKey = ['id']; |
|
|
@@ -350,23 +697,23 @@ |
|
|
this.selectItem = resp.data.data; |
|
|
this.selectItem = resp.data.data; |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
modifyOne(item) { |
|
|
|
|
|
|
|
|
modifyCol(item) { |
|
|
|
|
|
console.log(item); |
|
|
item.tablename = this.tablename; |
|
|
item.tablename = this.tablename; |
|
|
this.$axios.put(`/inventory?`, item).then(() => { |
|
|
|
|
|
this.getInventories(); |
|
|
|
|
|
|
|
|
this.$axios.put(`/assert/col`, item).then(() => { |
|
|
|
|
|
this.getCols(); |
|
|
this.close(); |
|
|
this.close(); |
|
|
} |
|
|
} |
|
|
); |
|
|
); |
|
|
}, |
|
|
}, |
|
|
deleteOne(item) { |
|
|
|
|
|
|
|
|
deleteCol(item) { |
|
|
let yes = confirm('確定刪除'); |
|
|
let yes = confirm('確定刪除'); |
|
|
if (yes) { |
|
|
if (yes) { |
|
|
this.$axios.delete(`/deleteOne?tablename=${this.tablename}&&id=${item.id}`).then(() => { |
|
|
|
|
|
this.getInventories(); |
|
|
|
|
|
|
|
|
this.$axios.delete(`/assert/deleteCol?tablename=${item.tablename}&&colname=${item.colname}`).then(() => { |
|
|
|
|
|
this.getCols(); |
|
|
alert('已刪除'); |
|
|
alert('已刪除'); |
|
|
}); |
|
|
}); |
|
|
} |
|
|
} |
|
|
console.log(item); |
|
|
|
|
|
}, |
|
|
}, |
|
|
exportFile() { |
|
|
exportFile() { |
|
|
let yes = confirm('確定匯出'); |
|
|
let yes = confirm('確定匯出'); |
|
|
@@ -378,19 +725,34 @@ |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
}, |
|
|
}, |
|
|
mockInsertAssertGroup() { |
|
|
|
|
|
// this.$axios.get(`/assert/assertGroups`).then((resp) => { |
|
|
|
|
|
// resp.data.data.forEach((item) => { |
|
|
|
|
|
// let header = {'text': null, 'value': null}; |
|
|
|
|
|
// header.text = item.descript; |
|
|
|
|
|
// header.value = item.tablename; |
|
|
|
|
|
// this.assertGroup.push(header); |
|
|
|
|
|
// }); |
|
|
|
|
|
this.assertGroup.push({'text': this.assertGroupDescript, 'value': this.assertGroupTablename}); |
|
|
|
|
|
console.log(this.assertGroup); |
|
|
|
|
|
// }); |
|
|
|
|
|
|
|
|
async insertAssertGroup() { |
|
|
|
|
|
await this.$axios.post(`/assert/assertGroups`, { |
|
|
|
|
|
assertGroupDescript: this.insertAssertGroupDescript, |
|
|
|
|
|
assertGroupTablename: this.insertAssertGroupTablename |
|
|
|
|
|
}); |
|
|
|
|
|
await this.getTabs(); |
|
|
this.close(); |
|
|
this.close(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
showTabOptionIcon(index) { |
|
|
|
|
|
this.optionIconShow = index; |
|
|
|
|
|
}, |
|
|
|
|
|
async deleteAssertGroup(item) { |
|
|
|
|
|
let yes = confirm('確認刪除此群組?'); |
|
|
|
|
|
if (yes) { |
|
|
|
|
|
await this.$axios.delete(`/assert/assertGroups?tablename=${item.value}`).then(() => { |
|
|
|
|
|
this.getTabs(); |
|
|
|
|
|
alert('已刪除'); |
|
|
|
|
|
}); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
async modifyAssertGroupName() { |
|
|
|
|
|
await this.$axios.put(`/assert/assertGroups?tablename=${this.modifyAssertGroup.value}&&newDescript=${this.modifyAssertGroup.text}`).then(() => { |
|
|
|
|
|
this.getTabs(); |
|
|
|
|
|
alert('已修改'); |
|
|
|
|
|
this.close(); |
|
|
|
|
|
}); |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|