sonar qube
This commit is contained in:
@@ -1399,7 +1399,7 @@ export default {
|
|||||||
...mapActions(ConformanceInputStore, [''])
|
...mapActions(ConformanceInputStore, [''])
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.isShowBarOpen = this.conformanceLogCreateCheckId || this.conformanceFilterCreateCheckId ? false : true;
|
this.isShowBarOpen = !(this.conformanceLogCreateCheckId || this.conformanceFilterCreateCheckId);
|
||||||
// 選取 list 的結果
|
// 選取 list 的結果
|
||||||
this.$emitter.on('actListData', (data) => {
|
this.$emitter.on('actListData', (data) => {
|
||||||
this.selectConformanceTask = data;
|
this.selectConformanceTask = data;
|
||||||
|
|||||||
@@ -502,6 +502,7 @@ export async function leaveAccountManagementToRemind(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
if(result.isConfirmed) {
|
if(result.isConfirmed) {
|
||||||
|
return;
|
||||||
} else {
|
} else {
|
||||||
modalStore.openModal();
|
modalStore.openModal();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,11 +26,23 @@ export function setLineChartData(baseData, xMax, xMin, isPercent, yMax, yMin) {
|
|||||||
let e = 2;
|
let e = 2;
|
||||||
let f = baseData[1].y;
|
let f = baseData[1].y;
|
||||||
b = (e*d - a*d - f*a - f*c) / (e - c - a)
|
b = (e*d - a*d - f*a - f*c) / (e - c - a)
|
||||||
if(isPercent) {
|
if(isPercent) { // sonar-qube
|
||||||
b = b >= 1 ? 1 : b <= 0 ? 0 : b;
|
if (b >= 1) {
|
||||||
|
b = 1;
|
||||||
|
} else if (b <= 0) {
|
||||||
|
b = 0;
|
||||||
|
} else {
|
||||||
|
b = b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
b = b >= yMax ? yMax : b <= yMin ? yMin : b;
|
if (b >= yMax) {
|
||||||
|
b = yMax;
|
||||||
|
} else if (b <= yMin) {
|
||||||
|
b = yMin;
|
||||||
|
} else {
|
||||||
|
b = b;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// y 軸最大值
|
// y 軸最大值
|
||||||
@@ -41,17 +53,16 @@ export function setLineChartData(baseData, xMax, xMin, isPercent, yMax, yMin) {
|
|||||||
let me = 11;
|
let me = 11;
|
||||||
let mf;
|
let mf;
|
||||||
mf = (mb*me - mb*mc -md*me + md*ma) / (ma - mc);
|
mf = (mb*me - mb*mc -md*me + md*ma) / (ma - mc);
|
||||||
if(isPercent) {
|
if (isPercent) {
|
||||||
mf = mf >= 1 ? 1 : mf <= 0 ? 0 : mf;
|
if (mf >= 1) {
|
||||||
|
mf = 1;
|
||||||
|
} else if (mf <= 0) {
|
||||||
|
mf = 0;
|
||||||
}
|
}
|
||||||
else {
|
} else if (mf >= yMax) {
|
||||||
if (mf >= yMax) {
|
|
||||||
mf = yMax;
|
mf = yMax;
|
||||||
} else if (mf <= yMin) {
|
} else if (mf <= yMin) {
|
||||||
mf = yMin;
|
mf = yMin;
|
||||||
} else {
|
|
||||||
mf = mf;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// 添加最小值
|
// 添加最小值
|
||||||
|
|||||||
@@ -234,7 +234,6 @@ export function getDateLabelByMinMaxDate(date, maxDate, minDate) {
|
|||||||
// 計算相差的小時、分鐘、秒
|
// 計算相差的小時、分鐘、秒
|
||||||
const diffHours = Math.floor(timeDiff / (60 * 60));
|
const diffHours = Math.floor(timeDiff / (60 * 60));
|
||||||
const diffMinutes = Math.floor(timeDiff / 60);
|
const diffMinutes = Math.floor(timeDiff / 60);
|
||||||
const diffSeconds = Math.floor(timeDiff);
|
|
||||||
|
|
||||||
// 顯示結果
|
// 顯示結果
|
||||||
if (diffMonths > 1) {
|
if (diffMonths > 1) {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
'text-[#FF3366]': !isAccountUnique,
|
'text-[#FF3366]': !isAccountUnique,
|
||||||
'border-[#FF3366]': !isAccountUnique,
|
'border-[#FF3366]': !isAccountUnique,
|
||||||
}"
|
}"
|
||||||
@focus="onInputAccountFocus" :readonly="!isEditable"
|
:readonly="!isEditable"
|
||||||
@dblclick="onInputDoubleClick"
|
@dblclick="onInputDoubleClick"
|
||||||
/>
|
/>
|
||||||
<div v-show="!isAccountUnique" class="error-wrapper my-2">
|
<div v-show="!isAccountUnique" class="error-wrapper my-2">
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
<input id="input_first_pwd" class="outline-none p-1 w-[352px]" :type="isPwdEyeOn ? 'text' : 'password'"
|
<input id="input_first_pwd" class="outline-none p-1 w-[352px]" :type="isPwdEyeOn ? 'text' : 'password'"
|
||||||
v-model="inputPwd" :readonly="!isEditable" @dblclick="onInputDoubleClick"/>
|
v-model="inputPwd" :readonly="!isEditable" @dblclick="onInputDoubleClick"/>
|
||||||
<img v-if="isPwdEyeOn" src='@/assets/icon-eye-open.svg' class="absolute right-[8px] cursor-pointer"
|
<img v-if="isPwdEyeOn" src='@/assets/icon-eye-open.svg' class="absolute right-[8px] cursor-pointer"
|
||||||
@click="togglePwdEyeBtn"/>
|
@click="togglePwdEyeBtn" alt=""/>
|
||||||
<img v-else src='@/assets/icon-eye-hide.svg' class="absolute right-[8px] cursor-pointer" @click="togglePwdEyeBtn" alt="eye"/>
|
<img v-else src='@/assets/icon-eye-hide.svg' class="absolute right-[8px] cursor-pointer" @click="togglePwdEyeBtn" alt="eye"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -143,7 +143,6 @@ import { useModalStore } from '@/stores/modal.js';
|
|||||||
import { useRouter } from 'vue-router';
|
import { useRouter } from 'vue-router';
|
||||||
import { useToast } from 'vue-toast-notification';
|
import { useToast } from 'vue-toast-notification';
|
||||||
import useAcctMgmtStore from '@/stores/acctMgmt';
|
import useAcctMgmtStore from '@/stores/acctMgmt';
|
||||||
import useLoginStore from '@/stores/login';
|
|
||||||
import ModalHeader from "./ModalHeader.vue";
|
import ModalHeader from "./ModalHeader.vue";
|
||||||
import IconChecked from "@/components/icons/IconChecked.vue";
|
import IconChecked from "@/components/icons/IconChecked.vue";
|
||||||
import { MODAL_CREATE_NEW, MODAL_ACCT_EDIT, } from '@/constants/constants.js';
|
import { MODAL_CREATE_NEW, MODAL_ACCT_EDIT, } from '@/constants/constants.js';
|
||||||
@@ -280,19 +279,6 @@ export default defineComponent({
|
|||||||
isSetActivedChecked.value = !isSetActivedChecked.value;
|
isSetActivedChecked.value = !isSetActivedChecked.value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onInputAccountFocus = async() => {
|
|
||||||
// if(!isAccountUnique.value) {
|
|
||||||
// // 之所以要轉回true,是為了讓使用者可以繼續填寫不被阻擋
|
|
||||||
// isAccountUnique.value = true;
|
|
||||||
// }
|
|
||||||
// if(isConfirmDisabled.value){
|
|
||||||
// // 所有欄位都要填寫,confirm按鈕才可點選
|
|
||||||
// if(validateInputLengthAndEquality(inputUserAccount.value, inputName.value, inputPwd.value, inputConfirmPwd.value, isPwdMatched.value)
|
|
||||||
// ){
|
|
||||||
// isConfirmDisabled.value = false;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
const onInputNameFocus = () => {
|
const onInputNameFocus = () => {
|
||||||
if(isConfirmDisabled.value){
|
if(isConfirmDisabled.value){
|
||||||
@@ -350,7 +336,6 @@ export default defineComponent({
|
|||||||
MODAL_CREATE_NEW,
|
MODAL_CREATE_NEW,
|
||||||
modalTitle,
|
modalTitle,
|
||||||
isAccountUnique,
|
isAccountUnique,
|
||||||
onInputAccountFocus,
|
|
||||||
isEditable,
|
isEditable,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -638,9 +638,7 @@ console.log("TODO:", datasetsPrimary, )
|
|||||||
default:
|
default:
|
||||||
primeVueSetOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位
|
primeVueSetOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位
|
||||||
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
||||||
let value = context.parsed.y;
|
let value = context.parsed.x === null ? "n/a" : context.parsed.x;
|
||||||
|
|
||||||
value = context.parsed.x === null ? "n/a" : context.parsed.x;
|
|
||||||
switch (context.datasetIndex) {
|
switch (context.datasetIndex) {
|
||||||
case 0: // Primary
|
case 0: // Primary
|
||||||
return `${labelPrimary}: ${value}`;
|
return `${labelPrimary}: ${value}`;
|
||||||
@@ -923,9 +921,6 @@ console.log("TODO:", datasetsPrimary, )
|
|||||||
* @param { string } xUnit x 軸單位
|
* @param { string } xUnit x 軸單位
|
||||||
*/
|
*/
|
||||||
getCaseByTaskHorizontalBarChart(chartData, content, isSingle, xUnit = 'count') {
|
getCaseByTaskHorizontalBarChart(chartData, content, isSingle, xUnit = 'count') {
|
||||||
const maxX = chartData.x_axis.max;
|
|
||||||
const getSimpleTimeLabel = simpleTimeLabel;
|
|
||||||
const getFollowTimeLabel = followTimeLabel;
|
|
||||||
const labelPrimary = chartData.data[0].label;
|
const labelPrimary = chartData.data[0].label;
|
||||||
const labelSecondary = chartData.data[1].label;
|
const labelSecondary = chartData.data[1].label;
|
||||||
let primeVueSetData = {};
|
let primeVueSetData = {};
|
||||||
@@ -1042,13 +1037,12 @@ console.log("TODO:", datasetsPrimary, )
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
switch (xUnit) {
|
switch (xUnit) {
|
||||||
|
case 'dummy':
|
||||||
case 'count':
|
case 'count':
|
||||||
default:
|
default:
|
||||||
primeVueSetOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位
|
primeVueSetOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位
|
||||||
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
||||||
let value = context.parsed.y;
|
let value = context.parsed.x === null ? "n/a" : context.parsed.x;
|
||||||
|
|
||||||
value = context.parsed.x === null ? "n/a" : context.parsed.x;
|
|
||||||
switch (context.datasetIndex) {
|
switch (context.datasetIndex) {
|
||||||
case 0: // Primary
|
case 0: // Primary
|
||||||
return `${labelPrimary}: ${value}`;
|
return `${labelPrimary}: ${value}`;
|
||||||
@@ -1215,9 +1209,7 @@ console.log("TODO:", datasetsPrimary, )
|
|||||||
case 'date':
|
case 'date':
|
||||||
default:
|
default:
|
||||||
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
||||||
let value = context.parsed.y;
|
let value = context.parsed.x === null ? "n/a" : getSimpleTimeLabel(context.parsed.x, 2);
|
||||||
|
|
||||||
value = context.parsed.x === null ? "n/a" : getSimpleTimeLabel(context.parsed.x, 2);
|
|
||||||
switch (context.datasetIndex) {
|
switch (context.datasetIndex) {
|
||||||
case 0: // Primary
|
case 0: // Primary
|
||||||
return `${labelPrimary}: ${value}`;
|
return `${labelPrimary}: ${value}`;
|
||||||
|
|||||||
@@ -3,8 +3,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import Moment from 'moment';
|
import { ref, onMounted } from 'vue';
|
||||||
import { computed, ref, onMounted } from 'vue';
|
|
||||||
import {
|
import {
|
||||||
setTimeStringFormatBaseOnTimeDifference,
|
setTimeStringFormatBaseOnTimeDifference,
|
||||||
mapTimestampToAxisTicksByFormat,
|
mapTimestampToAxisTicksByFormat,
|
||||||
|
|||||||
@@ -487,6 +487,7 @@ export default {
|
|||||||
};
|
};
|
||||||
break;
|
break;
|
||||||
case 'count':
|
case 'count':
|
||||||
|
default:
|
||||||
primeVueSetOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位
|
primeVueSetOption.scales.x.ticks.precision = 0; // x 軸顯示小數點後 0 位
|
||||||
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
primeVueSetOption.plugins.tooltip.callbacks.label = function(context) {
|
||||||
return `${content.x}: ${context.parsed.x}`;
|
return `${content.x}: ${context.parsed.x}`;
|
||||||
|
|||||||
Reference in New Issue
Block a user