clear code + comment
This commit is contained in:
parent
a9609d2d7f
commit
ac70090e22
19 changed files with 231 additions and 166 deletions
|
|
@ -17,6 +17,29 @@ import DialogHeader from "@/components/DialogHeader.vue";
|
|||
|
||||
import { useCounterMixin } from "@/stores/mixin";
|
||||
|
||||
const modalDialog = ref<boolean>(false);
|
||||
const isEdit = ref<boolean>(false);
|
||||
const indicatorId = ref<string>("");
|
||||
const formIndicators = reactive<FormIndicators>({
|
||||
indicators: "",
|
||||
target: null,
|
||||
metricType: "",
|
||||
calculation: "",
|
||||
measuRement: "",
|
||||
results: "",
|
||||
obstacles: "",
|
||||
suggestions: "",
|
||||
});
|
||||
|
||||
const formProject = reactive<FormProject>({
|
||||
isBudget: false,
|
||||
isNoPass: false,
|
||||
isOutBudget: false,
|
||||
isPassAllocate: false,
|
||||
isPassNoAllocate: false,
|
||||
project: "",
|
||||
});
|
||||
|
||||
const $q = useQuasar();
|
||||
const {
|
||||
showLoader,
|
||||
|
|
@ -79,6 +102,7 @@ const columns = ref<QTableProps["columns"]>([
|
|||
style: "font-size: 14px ; ",
|
||||
},
|
||||
]);
|
||||
|
||||
const visibleColumns = ref<string[]>([
|
||||
"indicators",
|
||||
"target",
|
||||
|
|
@ -113,29 +137,7 @@ const metricTypeOp = ref<DataOption[]>([
|
|||
},
|
||||
]);
|
||||
|
||||
const modalDialog = ref<boolean>(false);
|
||||
const isEdit = ref<boolean>(false);
|
||||
const indicatorId = ref<string>("");
|
||||
const formIndicators = reactive<FormIndicators>({
|
||||
indicators: "",
|
||||
target: null,
|
||||
metricType: "",
|
||||
calculation: "",
|
||||
measuRement: "",
|
||||
results: "",
|
||||
obstacles: "",
|
||||
suggestions: "",
|
||||
});
|
||||
|
||||
const formProject = reactive<FormProject>({
|
||||
isBudget: false,
|
||||
isNoPass: false,
|
||||
isOutBudget: false,
|
||||
isPassAllocate: false,
|
||||
isPassNoAllocate: false,
|
||||
project: "",
|
||||
});
|
||||
|
||||
/** ดึงข้อมูลตัวชี้วัด */
|
||||
function fetchData() {
|
||||
showLoader();
|
||||
http
|
||||
|
|
@ -158,6 +160,11 @@ function fetchData() {
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* เปิด dialog add/edit
|
||||
* @param statusEdit true/false
|
||||
* @param data data => EDIT
|
||||
*/
|
||||
function onClickAddIndicator(
|
||||
statusEdit: boolean = false,
|
||||
data: DevelopmentEvaluations | null = null
|
||||
|
|
@ -179,6 +186,7 @@ function onClickAddIndicator(
|
|||
modalDialog.value = true;
|
||||
}
|
||||
|
||||
/** close Dialog and Clear */
|
||||
function closeDialog() {
|
||||
modalDialog.value = false;
|
||||
formIndicators.indicators = "";
|
||||
|
|
@ -191,6 +199,7 @@ function closeDialog() {
|
|||
formIndicators.suggestions = "";
|
||||
}
|
||||
|
||||
/** dialog form save data */
|
||||
function onSubmitIndicators() {
|
||||
formIndicators.target = formIndicators.target
|
||||
? Number(formIndicators.target)
|
||||
|
|
@ -216,6 +225,7 @@ function onSubmitIndicators() {
|
|||
});
|
||||
}
|
||||
|
||||
/** data delete */
|
||||
function onClickDeleteIndicator(id: string) {
|
||||
dialogRemove($q, () => {
|
||||
showLoader();
|
||||
|
|
@ -234,6 +244,7 @@ function onClickDeleteIndicator(id: string) {
|
|||
});
|
||||
}
|
||||
|
||||
/** save Main data */
|
||||
function onSubmit() {
|
||||
dialogConfirm($q, () => {
|
||||
if (formProject.project === "NOOFFER") {
|
||||
|
|
@ -260,6 +271,7 @@ function onSubmit() {
|
|||
});
|
||||
}
|
||||
|
||||
/** fetchData in page */
|
||||
onMounted(() => {
|
||||
fetchData();
|
||||
});
|
||||
|
|
@ -338,19 +350,6 @@ onMounted(() => {
|
|||
</q-td>
|
||||
</q-tr>
|
||||
</template>
|
||||
<!-- <template v-slot:pagination="scope">
|
||||
<q-pagination
|
||||
v-model="formQuery.page"
|
||||
active-color="primary"
|
||||
color="dark"
|
||||
:max="Number(totalList)"
|
||||
size="sm"
|
||||
boundary-links
|
||||
direction-links
|
||||
:max-pages="5"
|
||||
@update:model-value="fetchListProject"
|
||||
></q-pagination>
|
||||
</template> -->
|
||||
</d-table>
|
||||
</div>
|
||||
</q-card>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue