|
|
|
@@ -164,7 +164,10 @@ |
|
|
|
<v-data-table |
|
|
|
:items='allCols[item.value]' |
|
|
|
:headers='headers' |
|
|
|
hide-default-footer |
|
|
|
:height="fullHeight*7/9" |
|
|
|
fixed-header |
|
|
|
:footer-props="{'items-per-page-options': [30, 40, 50, 60]}" |
|
|
|
:items-per-page="30" |
|
|
|
> |
|
|
|
<template v-slot:item.isselect='{ item }'> |
|
|
|
{{item.isselect === 'true' ? '選項':'文字'}} |
|
|
|
@@ -179,92 +182,12 @@ |
|
|
|
{{item.isselect === 'true' ? '是':'否'}} |
|
|
|
</template> |
|
|
|
<template v-slot:item.actions='{ item }'> |
|
|
|
<!--修改資產群駔欄位對話--> |
|
|
|
<v-dialog |
|
|
|
v-model='dialogModify' |
|
|
|
@click:outside='close' |
|
|
|
:retain-focus="false" |
|
|
|
overlay-opacity="0" |
|
|
|
<v-btn |
|
|
|
icon |
|
|
|
@click='openDialogModifyCol(item)' |
|
|
|
> |
|
|
|
<template v-slot:activator='{ on, attrs }'> |
|
|
|
<v-btn |
|
|
|
v-bind='attrs' |
|
|
|
v-on='on' |
|
|
|
icon |
|
|
|
@click='modifyColItem = JSON.parse(JSON.stringify(item))' |
|
|
|
> |
|
|
|
<v-icon>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 |
|
|
|
v-for='(header, index) in headers' |
|
|
|
:key='index' |
|
|
|
cols='12' |
|
|
|
sm='6' |
|
|
|
md='4' |
|
|
|
class='d-flex' |
|
|
|
> |
|
|
|
<v-text-field |
|
|
|
v-if="header.text !== '' && header.value !== 'isselect' && isBooleanCol.indexOf(header.value) < 0" |
|
|
|
:label='header.text' |
|
|
|
:value="modifyColItem[header.value]" |
|
|
|
hint='必填' |
|
|
|
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-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='modifyCol' |
|
|
|
> |
|
|
|
修改 |
|
|
|
</v-btn> |
|
|
|
</v-card-actions> |
|
|
|
</v-card> |
|
|
|
</v-dialog> |
|
|
|
<v-icon>mdi-pencil</v-icon> |
|
|
|
</v-btn> |
|
|
|
<v-icon |
|
|
|
small |
|
|
|
@click='deleteCol(item)' |
|
|
|
@@ -358,45 +281,114 @@ |
|
|
|
</v-card-actions> |
|
|
|
</v-card> |
|
|
|
</v-dialog> |
|
|
|
<!--新增資產群組欄位選項對話--> |
|
|
|
<v-dialog |
|
|
|
width="40%" |
|
|
|
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="11" class="d-flex align-center"> |
|
|
|
<v-text-field outlined rounded hide-details |
|
|
|
v-model="insertSelectItem"/> |
|
|
|
<v-btn class="ml-2" @click='pushInsertSelectItem'>新增</v-btn> |
|
|
|
</v-col> |
|
|
|
</v-row> |
|
|
|
<v-card class="mt-2 col-10" |
|
|
|
style="border: 1px solid grey;min-height: 500px;border-radius: 10px"> |
|
|
|
<v-chip |
|
|
|
v-for="(insertSelectItem, index) in insertSelectItems" |
|
|
|
:key="index" |
|
|
|
class="col-12 my-1" |
|
|
|
color="secondary" |
|
|
|
> |
|
|
|
{{insertSelectItem}} |
|
|
|
<v-icon small class="ml-4" @click="deleteInsertSelectItem(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> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
</v-data-table> |
|
|
|
</v-tab-item> |
|
|
|
</v-tabs-items> |
|
|
|
<!--新增資產群組欄位選項對話--> |
|
|
|
<!--修改資產群駔欄位對話--> |
|
|
|
<v-dialog |
|
|
|
width="40%" |
|
|
|
v-model='dialogInsertSelectItem' |
|
|
|
@click:outside='closeDialogInsertSelectItem' |
|
|
|
v-model='dialogModify' |
|
|
|
@click:outside='close' |
|
|
|
:retain-focus="false" |
|
|
|
overlay-opacity="0" |
|
|
|
> |
|
|
|
<v-card> |
|
|
|
<v-card-title> |
|
|
|
<span class='headline font-weight-bold'>編輯選項</span> |
|
|
|
<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='pushInsertSelectItem'>新增</v-btn> |
|
|
|
<v-col |
|
|
|
v-for='(header, index) in headers' |
|
|
|
:key='index' |
|
|
|
cols='12' |
|
|
|
sm='6' |
|
|
|
md='4' |
|
|
|
class='d-flex' |
|
|
|
> |
|
|
|
<v-text-field |
|
|
|
v-if="header.text !== '' && header.value !== 'isselect' && isBooleanCol.indexOf(header.value) < 0" |
|
|
|
:label='header.text' |
|
|
|
:value="modifyColItem[header.value]" |
|
|
|
hint='必填' |
|
|
|
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-row> |
|
|
|
<v-card class="mt-2 col-10" |
|
|
|
style="border: 1px solid grey;min-height: 500px;border-radius: 10px"> |
|
|
|
<v-chip |
|
|
|
v-for="(insertSelectItem, index) in insertSelectItems" |
|
|
|
:key="index" |
|
|
|
class="col-12 my-1" |
|
|
|
color="secondary" |
|
|
|
> |
|
|
|
{{insertSelectItem}} |
|
|
|
<v-icon small class="ml-4" @click="deleteInsertSelectItem(index)">mdi-close |
|
|
|
</v-icon> |
|
|
|
</v-chip> |
|
|
|
</v-card> |
|
|
|
</v-container> |
|
|
|
</v-card-text> |
|
|
|
<v-card-actions> |
|
|
|
@@ -404,9 +396,16 @@ |
|
|
|
<v-btn |
|
|
|
color='blue darken-1' |
|
|
|
text |
|
|
|
@click='closeDialogInsertSelectItem' |
|
|
|
@click='close' |
|
|
|
> |
|
|
|
關閉 |
|
|
|
取消 |
|
|
|
</v-btn> |
|
|
|
<v-btn |
|
|
|
color='blue darken-1' |
|
|
|
text |
|
|
|
@click='modifyCol' |
|
|
|
> |
|
|
|
修改 |
|
|
|
</v-btn> |
|
|
|
</v-card-actions> |
|
|
|
</v-card> |
|
|
|
@@ -475,6 +474,7 @@ |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
fullHeight: 0, |
|
|
|
dialogInsert: false, |
|
|
|
dialogModify: false, |
|
|
|
dialogNewAssertGroup: false, |
|
|
|
@@ -550,6 +550,12 @@ |
|
|
|
this.getTypes(); |
|
|
|
this.inventoryItems = []; |
|
|
|
this.getCols(); |
|
|
|
this.fullHeight = window.innerHeight; |
|
|
|
console.log(this.fullHeight); |
|
|
|
window.onresize = () => { |
|
|
|
// this.fullWidth = window.innerWidth; |
|
|
|
this.fullHeight = window.innerHeight; |
|
|
|
}; |
|
|
|
}, |
|
|
|
computed: {}, |
|
|
|
watch: { |
|
|
|
@@ -578,6 +584,10 @@ |
|
|
|
// console.log(col); |
|
|
|
console.log(this.modifySelectItems); |
|
|
|
}, |
|
|
|
openDialogModifyCol(item) { |
|
|
|
this.modifyColItem = JSON.parse(JSON.stringify(item)); |
|
|
|
this.dialogModify = true; |
|
|
|
}, |
|
|
|
closeDialogInsertSelectItem() { |
|
|
|
this.dialogInsertSelectItem = false; |
|
|
|
}, |
|
|
|
|