diff --git a/src/pages/04_product-service/MainPage.vue b/src/pages/04_product-service/MainPage.vue
index 317965a4..31d14745 100644
--- a/src/pages/04_product-service/MainPage.vue
+++ b/src/pages/04_product-service/MainPage.vue
@@ -1,11 +1,11 @@
-
+
{
+ async (v: (typeof treeProductTypeAndGroup)[number]) => {
if (v.type === 'group') {
if (currentIdGrop !== v.id) {
filterStat.push('group');
- await enterGroup(v.id, v.name);
+ currentStatusList = [];
+ await enterGroup(v.id, v.name, v.status);
+
return;
}
@@ -1585,21 +1614,31 @@ watch(
expandedTree = expandedTree.filter((i) => v.id !== i);
currentIdGrop = '';
currentIdType = '';
+ currentStatusList = [];
productMode = 'group';
return;
}
}
if (v.type === 'type') {
+ currentStatusList = [];
+ if (v.actionDisabled) {
+ currentStatusList.push('INACTIVE');
+ }
+ if (!v.actionDisabled) {
+ currentStatusList.push('ACTIVE');
+ }
+
if (currentIdType !== v.id) {
filterStat.push('group', 'type');
- await enterType(v.id, v.name);
+ await enterType(v.id, v.name, v.status);
return;
}
if (currentIdType === v.id) {
filterStat = filterStat.filter((item) => {
return item !== 'type';
});
+ currentStatusList.splice(1);
currentIdType = '';
productMode = 'type';
expandedTree.pop();
@@ -1609,7 +1648,7 @@ watch(
}
"
@view="
- (v) => {
+ (v: (typeof treeProductTypeAndGroup)[number]) => {
if (v.type === 'type') {
editByTree = 'type';
currentStatusProduct = v.status === 'INACTIVE';
@@ -1631,8 +1670,8 @@ watch(
}
"
@edit="
- (v) => {
- editByTree = v.type;
+ (v: (typeof treeProductTypeAndGroup)[number]) => {
+ editByTree = v.type as typeof editByTree;
if (v.type === 'type') {
clearFormGroup();
currentIdType = v.id;
@@ -1650,8 +1689,8 @@ watch(
}
"
@delete="
- (v) => {
- editByTree = v.type;
+ (v: (typeof treeProductTypeAndGroup)[number]) => {
+ editByTree = v.type as typeof editByTree;
if (v.type === 'type') {
deleteProductById(v.id);
@@ -1662,323 +1701,24 @@ watch(
}
"
@change-status="
- async (v) => {
+ async (v: (typeof treeProductTypeAndGroup)[number]) => {
+ console.log(currentStatusList);
+
if (v.type === 'type') {
- triggerChangeStatus(v.id, v.status, v.type);
+ await triggerChangeStatus(v.id, v.status, v.type);
+
+ currentStatusList[0] =
+ v.status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE';
}
if (v.type === 'group') {
- triggerChangeStatus(v.id, v.status, v.type);
+ await triggerChangeStatus(v.id, v.status, v.type);
+
+ currentStatusList[0] =
+ v.status === 'INACTIVE' ? 'ACTIVE' : 'INACTIVE';
}
}
"
/>
-
-
@@ -2178,10 +1918,18 @@ watch(
async () => {
filterStat.push(productMode);
if (productMode === 'type') {
- await enterType(props.row.id, props.row.name);
+ await enterType(
+ props.row.id,
+ props.row.name,
+ props.row.status,
+ );
}
if (productMode === 'group') {
- await enterGroup(props.row.id, props.row.name);
+ await enterGroup(
+ props.row.id,
+ props.row.name,
+ props.row.status,
+ );
}
}
"
@@ -2368,19 +2116,16 @@ watch(
{
if (productMode === 'type') {
@@ -2407,14 +2152,19 @@ watch(
name="mdi-pencil-outline"
class="col-3"
size="xs"
- :style="`color: ${props.row.status !== 'INACTIVE' ? 'hsl(var(--cyan-6-hsl))' : 'none'}`"
+ style="color: hsl(var(--cyan-6-hsl))"
/>
{{ $t('edit') }}
+