โครงาการ => ลักษณะโครงการ
This commit is contained in:
parent
3d60f25246
commit
b9dd4c8533
3 changed files with 60 additions and 68 deletions
|
|
@ -66,43 +66,22 @@ const formData = reactive<FormProjectDetail>({
|
||||||
developmentProjectTechniqueActuals: [],
|
developmentProjectTechniqueActuals: [],
|
||||||
projectModalActual: null,
|
projectModalActual: null,
|
||||||
projectModalPlanneds: null,
|
projectModalPlanneds: null,
|
||||||
|
strategyChildPlannedId: null, //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
|
strategyChildPlannedNode: 0, //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
|
strategyChildActualId: null, //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
|
strategyChildActualNode: 0, //node ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
});
|
});
|
||||||
|
|
||||||
const nodes = ref<any>([
|
const nodes = ref<any>([]);
|
||||||
{
|
|
||||||
orgTreeName: " แผนพัฒนากรุงเทพมหานคร ระยะ 20 ปี ระยะที่ 3",
|
|
||||||
level: "0",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
orgTreeName: "ยุทธศาสตร์ที่ 1",
|
|
||||||
level: "1",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
orgTreeName: "ยุทธศาสตร์ที่ 2",
|
|
||||||
level: "2",
|
|
||||||
children: [
|
|
||||||
{
|
|
||||||
orgTreeName: "ยุทธศาสตร์ที่ 3",
|
|
||||||
level: "3",
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const filter2 = ref<string>("");
|
const filter2 = ref<string>("");
|
||||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||||
const noData = ref<string>("ไม่มีข้อมูล");
|
const noData = ref<string>("ไม่มีข้อมูล");
|
||||||
const expanded = ref<Array<any>>([]);
|
const expanded = ref<Array<any>>([]);
|
||||||
const expanded2 = ref<Array<any>>([]);
|
const expanded2 = ref<Array<any>>([]);
|
||||||
const nodeId = ref<string>("");
|
function fetchData() {
|
||||||
const nodeId2 = ref<string>("");
|
|
||||||
async function fetchData() {
|
|
||||||
showLoader();
|
showLoader();
|
||||||
await http
|
http
|
||||||
.get(config.API.developmentMainTab("tab3", projectId.value))
|
.get(config.API.developmentMainTab("tab3", projectId.value))
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
|
|
@ -123,6 +102,26 @@ async function fetchData() {
|
||||||
formData.projectNigthHoldActual = data.projectNigthHoldActual;
|
formData.projectNigthHoldActual = data.projectNigthHoldActual;
|
||||||
formData.developmentProjectTechniqueActuals =
|
formData.developmentProjectTechniqueActuals =
|
||||||
data.developmentProjectTechniqueActuals;
|
data.developmentProjectTechniqueActuals;
|
||||||
|
formData.strategyChildPlannedId = data.strategyChildPlannedId;
|
||||||
|
formData.strategyChildPlannedNode = data.strategyChildPlannedNode;
|
||||||
|
formData.strategyChildActualId = data.strategyChildActualId;
|
||||||
|
formData.strategyChildActualNode = data.strategyChildActualNode;
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
hideLoader();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function fetchTree() {
|
||||||
|
showLoader();
|
||||||
|
http
|
||||||
|
.get(config.API.devStrategy)
|
||||||
|
.then((res) => {
|
||||||
|
const data = res.data.result;
|
||||||
|
nodes.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
messageError($q, err);
|
messageError($q, err);
|
||||||
|
|
@ -135,10 +134,9 @@ async function fetchData() {
|
||||||
async function onSubmit() {
|
async function onSubmit() {
|
||||||
dialogConfirm($q, async () => {
|
dialogConfirm($q, async () => {
|
||||||
showLoader();
|
showLoader();
|
||||||
|
|
||||||
await http
|
await http
|
||||||
.put(config.API.developmentMainTab("tab3", projectId.value), formData)
|
.put(config.API.developmentMainTab("tab3", projectId.value), formData)
|
||||||
.then((res) => {
|
.then(() => {
|
||||||
success($q, "บันทึกข้อมูลสำเร็จ");
|
success($q, "บันทึกข้อมูลสำเร็จ");
|
||||||
fetchData();
|
fetchData();
|
||||||
})
|
})
|
||||||
|
|
@ -151,14 +149,17 @@ async function onSubmit() {
|
||||||
|
|
||||||
function updateSelected(data: any, type: string) {
|
function updateSelected(data: any, type: string) {
|
||||||
if (type === "1") {
|
if (type === "1") {
|
||||||
nodeId.value = data.orgTreeName;
|
formData.strategyChildPlannedId = data.id;
|
||||||
|
formData.strategyChildPlannedNode = data.level;
|
||||||
} else if (type === "2") {
|
} else if (type === "2") {
|
||||||
nodeId2.value = data.orgTreeName;
|
formData.strategyChildActualId = data.id;
|
||||||
|
formData.strategyChildActualNode = data.level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
fetchData();
|
fetchData();
|
||||||
|
fetchTree();
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -216,8 +217,8 @@ onMounted(() => {
|
||||||
dense
|
dense
|
||||||
:nodes="nodes"
|
:nodes="nodes"
|
||||||
selected-color="primary"
|
selected-color="primary"
|
||||||
node-key="orgTreeName"
|
node-key="id"
|
||||||
label-key="orgTreeName"
|
label-key="id"
|
||||||
:filter="filter"
|
:filter="filter"
|
||||||
:no-results-label="notFound"
|
:no-results-label="notFound"
|
||||||
:no-nodes-label="noData"
|
:no-nodes-label="noData"
|
||||||
|
|
@ -227,13 +228,13 @@ onMounted(() => {
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
@click.stop="updateSelected(prop.node, '1')"
|
@click.stop="updateSelected(prop.node, '1')"
|
||||||
:active="nodeId == prop.node.orgTreeName"
|
:active="formData.strategyChildPlannedId == prop.node.id"
|
||||||
active-class="my-list-link text-white text-weight-medium bg-primary"
|
active-class="my-list-link text-primary text-weight-medium"
|
||||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-weight-medium">
|
<div class="text-weight-medium">
|
||||||
{{ prop.node.orgTreeName }}
|
{{ prop.node.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -266,8 +267,8 @@ onMounted(() => {
|
||||||
<q-tree
|
<q-tree
|
||||||
dense
|
dense
|
||||||
:nodes="nodes"
|
:nodes="nodes"
|
||||||
node-key="orgTreeName"
|
node-key="id"
|
||||||
label-key="orgTreeName"
|
label-key="id"
|
||||||
:filter="filter2"
|
:filter="filter2"
|
||||||
:no-results-label="notFound"
|
:no-results-label="notFound"
|
||||||
:no-nodes-label="noData"
|
:no-nodes-label="noData"
|
||||||
|
|
@ -277,13 +278,13 @@ onMounted(() => {
|
||||||
<q-item
|
<q-item
|
||||||
clickable
|
clickable
|
||||||
@click.stop="updateSelected(prop.node, '2')"
|
@click.stop="updateSelected(prop.node, '2')"
|
||||||
:active="nodeId2 == prop.node.orgTreeName"
|
:active="formData.strategyChildActualId == prop.node.id"
|
||||||
active-class="my-list-link text-white text-weight-medium bg-primary"
|
active-class="my-list-link text-primary text-weight-medium"
|
||||||
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
class="row col-12 items-center text-dark q-py-xs q-pl-sm rounded-borders my-list"
|
||||||
>
|
>
|
||||||
<div>
|
<div>
|
||||||
<div class="text-weight-medium">
|
<div class="text-weight-medium">
|
||||||
{{ prop.node.orgTreeName }}
|
{{ prop.node.name }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</q-item>
|
</q-item>
|
||||||
|
|
@ -498,4 +499,12 @@ onMounted(() => {
|
||||||
</q-form>
|
</q-form>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<style scoped></style>
|
<style scoped>
|
||||||
|
.my-list-link {
|
||||||
|
color: rgb(118, 168, 222);
|
||||||
|
border-radius: 5px;
|
||||||
|
background: #a3d3fb48 !important;
|
||||||
|
font-weight: 600;
|
||||||
|
border: 1px solid rgba(175, 185, 196, 0.217);
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
|
||||||
|
|
@ -79,6 +79,10 @@ interface FormProjectDetail {
|
||||||
developmentProjectTechniqueActuals: [];
|
developmentProjectTechniqueActuals: [];
|
||||||
projectModalActual?: string | null;
|
projectModalActual?: string | null;
|
||||||
projectModalPlanneds?: string | null;
|
projectModalPlanneds?: string | null;
|
||||||
|
strategyChildPlannedId: string | null; //id ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
|
strategyChildPlannedNode: number; //node ยุทธศาสตร์เป้าหมายตามแผน
|
||||||
|
strategyChildActualId: string | null; //id ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
|
strategyChildActualNode: number; //node ยุทธศาสตร์เป้าหมายตามจริง
|
||||||
}
|
}
|
||||||
|
|
||||||
export type {
|
export type {
|
||||||
|
|
|
||||||
|
|
@ -40,30 +40,7 @@ const ListMenu = ref<ItemsMenu[]>([
|
||||||
},
|
},
|
||||||
]);
|
]);
|
||||||
|
|
||||||
const nodes = ref<any>([
|
const nodes = ref<any>([]);
|
||||||
// {
|
|
||||||
// orgTreeName: " แผนพัฒนากรุงเทพมหานคร ระยะ 20 ปี ระยะที่ 3",
|
|
||||||
// level: "0",
|
|
||||||
// children: [
|
|
||||||
// {
|
|
||||||
// orgTreeName: "ยุทธศาสตร์ที่ 1",
|
|
||||||
// level: "1",
|
|
||||||
// children: [
|
|
||||||
// {
|
|
||||||
// orgTreeName: "ยุทธศาสตร์ที่ 2",
|
|
||||||
// level: "2",
|
|
||||||
// children: [
|
|
||||||
// {
|
|
||||||
// orgTreeName: "ยุทธศาสตร์ที่ 3",
|
|
||||||
// level: "3",
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
// ],
|
|
||||||
// },
|
|
||||||
]);
|
|
||||||
const filter = ref<string>("");
|
const filter = ref<string>("");
|
||||||
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
const notFound = ref<string>("ไม่พบข้อมูลที่ค้นหา");
|
||||||
const noData = ref<string>("ไม่มีข้อมูล");
|
const noData = ref<string>("ไม่มีข้อมูล");
|
||||||
|
|
@ -78,7 +55,9 @@ function fetchDataTree() {
|
||||||
const data = res.data.result;
|
const data = res.data.result;
|
||||||
nodes.value = data;
|
nodes.value = data;
|
||||||
})
|
})
|
||||||
.catch((err) => {})
|
.catch((err) => {
|
||||||
|
messageError($q, err);
|
||||||
|
})
|
||||||
.finally(() => {
|
.finally(() => {
|
||||||
hideLoader();
|
hideLoader();
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue