Merge pull request 'Update tooltip s4 + add view button to switch page' (#36) from dev-nghiantt-fix-bugs into dev

Reviewed-on: #36
This commit is contained in:
dev
2025-08-06 10:32:48 +09:00
5 changed files with 173 additions and 53 deletions

View File

@ -52,6 +52,7 @@
selectBoxTimeItemList.minInterval ? selectBoxTimeItemList.minInterval : 1 selectBoxTimeItemList.minInterval ? selectBoxTimeItemList.minInterval : 1
" "
@update:propsValue="selectTimeValue1 = $event" @update:propsValue="selectTimeValue1 = $event"
customClass="select-large"
/> />
<!-- <div v-show="isRange" class="mx-3" :style="{ lineHeight: 0 }">~</div> --> <!-- <div v-show="isRange" class="mx-3" :style="{ lineHeight: 0 }">~</div> -->
@ -99,6 +100,7 @@
selectBoxTimeItemList.minInterval ? selectBoxTimeItemList.minInterval : 1 selectBoxTimeItemList.minInterval ? selectBoxTimeItemList.minInterval : 1
" "
@update:propsValue="selectTimeValue2 = $event" @update:propsValue="selectTimeValue2 = $event"
customClass="select-large"
/> />
</div> </div>
</v-col> </v-col>

View File

@ -22,7 +22,7 @@
outlined outlined
:menu-props="{ auto: true, offsetY: true }" :menu-props="{ auto: true, offsetY: true }"
:hide-details="true" :hide-details="true"
:class="'v-select__custom'" :class="['v-select__custom', customClass]"
:disabled="disabled" :disabled="disabled"
:readonly="readonly" :readonly="readonly"
@click="setDatepickerHide" @click="setDatepickerHide"
@ -106,6 +106,10 @@ export default {
require: false, require: false,
default: 1, default: 1,
}, },
customClass: {
type: String,
require: false,
},
}, },
emits: ["update:propsValue"], emits: ["update:propsValue"],
data() { data() {

View File

@ -20,6 +20,12 @@
</v-card> </v-card>
</v-col> </v-col>
</v-row> </v-row>
<!-- Create the line between date picker and form -->
<v-row class="my-5" no-gutters>
<v-col>
<div style="height: 1px; background-color: #ccc;"></div>
</v-col>
</v-row>
<v-row class="search-box" align="center" no-gutters style="height: 44px;"> <v-row class="search-box" align="center" no-gutters style="height: 44px;">
<v-col :cols="4"> <v-col :cols="4">
<label for="" class="search-box-label"> <label for="" class="search-box-label">

View File

@ -803,7 +803,7 @@ export default {
header: "NO", header: "NO",
name: "rowNum", name: "rowNum",
width: 70, width: 70,
align: "center", align: "right",
// hidden: true, // hidden: true,
}, },
{ {

View File

@ -104,7 +104,6 @@
:is="loadGrid ? 'Grid' : null" :is="loadGrid ? 'Grid' : null"
:gridName="gridName" :gridName="gridName"
:parentPrgmId="myPrgmId" :parentPrgmId="myPrgmId"
@dblClick="gridDoubleClickEvent"
/> />
<!-- <!--
<component <component
@ -143,7 +142,6 @@ import SelectBox from "@/components/common/select/SelectBox";
import SelectCmCycle from "@/components/common/select/SelectCmCycle"; import SelectCmCycle from "@/components/common/select/SelectCmCycle";
import DatePicker from "@/components/common/Datepicker"; import DatePicker from "@/components/common/Datepicker";
import Grid from "~/components/common/Grid"; import Grid from "~/components/common/Grid";
import PageTitle from "@/components/common/PageTitle";
let myTitle; let myTitle;
let myPrgmId; let myPrgmId;
@ -170,7 +168,6 @@ export default {
SelectCmCycle, SelectCmCycle,
DatePicker, DatePicker,
Grid, Grid,
PageTitle,
}, },
data() { data() {
return { return {
@ -204,6 +201,7 @@ export default {
computed: { computed: {
...mapState({ ...mapState({
pageData: (state) => state.pageData[myPrgmId], pageData: (state) => state.pageData[myPrgmId],
isDarkMode: "isDarkMode",
}), }),
fromDt() { fromDt() {
return this.pageData.fromDt; return this.pageData.fromDt;
@ -237,6 +235,16 @@ export default {
await this.search(); await this.search();
} }
}, },
isDarkMode(newVal) {
// Switch mode for 10 tooltips
for (let i = 0; i < 10; i++) {
const tooltipEl = document.getElementById(`tooltipElement_${i}`);
if (tooltipEl) {
tooltipEl.classList.remove("light-mode", "dark-mode");
tooltipEl.classList.add(newVal ? "dark-mode" : "light-mode");
}
}
},
}, },
async beforeCreate() { async beforeCreate() {
myPrgmId = this.$route.query.prgmId; myPrgmId = this.$route.query.prgmId;
@ -357,13 +365,79 @@ export default {
gridInit() { gridInit() {
const gridHeight = this.$refs.gridParent.offsetHeight - 30; const gridHeight = this.$refs.gridParent.offsetHeight - 30;
const _this = this; const _this = this;
// Define custom button
class CustomButton {
constructor(props,pageData) {
const { grid, rowKey, columnInfo } = props;
const gridData = grid.store.data.rawData;
const value = gridData[rowKey][columnInfo.name];
const onClickCallback = columnInfo.renderer.options.onClick;
this.disabled = columnInfo.renderer.options.disabled || false;
const elDiv = document.createElement('div');
elDiv.innerHTML = `<span>${value}</span>`;
$(elDiv).addClass('tui-grid-cell-content d-flex justify-space-between');
const el2 = document.createElement('button');
$(el2).addClass('edit-btn blue--text');
el2.innerText = '보기';
elDiv.appendChild(el2);
this.el = elDiv;
if (!this.disabled && typeof onClickCallback === 'function') {
// click 이벤트
this.el.addEventListener('click', function(event) {
onClickCallback(rowKey);
});
}
}
getElement() {
return this.el;
}
getValue() {
// return this.el.value;
}
mounted() {
// this.el.focus();
}
}
var columnList = [ var columnList = [
{ header: "NO", name: "no", align: "right", width: 80 }, { header: "NO", name: "no", align: "right", width: 80 },
{ header: "fabId", name: "fabId", hidden: true }, { header: "fabId", name: "fabId", hidden: true },
{ header: "FAB", name: "fabNm", align: "left" }, { header: "FAB", name: "fabNm", align: "left" },
{ header: "eqpmGrpId", name: "eqpmGrpId", hidden: true }, { header: "eqpmGrpId", name: "eqpmGrpId", hidden: true },
{ header: "설비그룹", name: "eqpmGrpNm", align: "left", width: 200 }, { header: "설비그룹", name: "eqpmGrpNm", align: "left", width: 200,
// Render custom button to switch page instead of double click on row
renderer: {
type: CustomButton,
options: {
value: '보기',
onClick: (rowKey) => {
const gridInstance = this.$refs[this.gridName].gridInstance;
const eventRowData = gridInstance.invoke("getRow", rowKey);
const data = {
cmCycle: this.pageData.cmCycle,
fromDt: this.pageData.fromDt,
fabId: this.selectValue01,
eqpmKindId: this.selectValue02,
eqpmGrpId: this.selectValue03,
eqpmId: eventRowData.eqpmId,
};
const key = "tick_" + Math.random();
this.$router.push({
name: "ems-effc-EnrgUseEqpmDetlMntrPage",
query: {
prgmId: "PRG0082",
},
params: {
...data,
key: key,
},
});
}
}
}
},
{ header: "eqpmId", name: "eqpmId", hidden: true }, { header: "eqpmId", name: "eqpmId", hidden: true },
{ header: "설비명", name: "eqpmNm", align: "left", width: 200 }, { header: "설비명", name: "eqpmNm", align: "left", width: 200 },
{ {
@ -472,6 +546,10 @@ export default {
}, },
], ],
}, },
pageOptions: {
useClient: true,
perPage: 3,
}
}; };
this.setGridOption({ this.setGridOption({
@ -693,6 +771,7 @@ function numberFormatter({ value }) {
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
::v-deep {
@for $i from 0 through 9 { @for $i from 0 through 9 {
#gridParent > * { #gridParent > * {
// .tui-grid-content-area{ // .tui-grid-content-area{
@ -715,18 +794,46 @@ function numberFormatter({ value }) {
display: block; display: block;
position: absolute; position: absolute;
min-width: 100%; min-width: 100%;
bottom: 30px; bottom: 40px;
z-index: 1000000000; z-index: 1000000000;
align: "center"; align: "center";
color: #f2f2f2; color: #f2f2f2;
background-color: #7f7f7f; background-color: #000000d9;
// width : 77px; // width : 77px;
width: 200%; width: 200%;
left: -50%; left: -50%;
border-radius: 3px; border-radius: 4px;
padding: 6px 0px;
word-break: keep-all; word-break: keep-all;
white-space: pre-wrap; white-space: pre-wrap;
// Light mode
&.light-mode {
background-color: #000000d9;
} }
// Dark mode
&.dark-mode {
background-color: #424242;
}
&::after {
content: "";
position: absolute;
top: 100%;
left: 50%;
margin-left: -6px;
border-width: 6px;
border-style: solid;
}
&.light-mode::after {
border-color: #000000d9 transparent transparent transparent;
}
&.dark-mode::after {
border-color: #424242 transparent transparent transparent;
}
}
.tui-grid-rside-area { .tui-grid-rside-area {
display: none; display: none;
overflow: visible; overflow: visible;
@ -742,4 +849,5 @@ function numberFormatter({ value }) {
overflow-y: visible; overflow-y: visible;
} }
} }
}
</style> </style>