|
|
@@ -16,14 +16,29 @@
|
|
|
<div style="width: 1px; height: 14px; color: #e9e9e9; margin-right: 14px">|</div>
|
|
|
<img src="../../../assets/icons/edit.png" @click="changeEdit" class="action-img" alt="" />
|
|
|
<img src="../../../assets/icons/delete.png" @click="changeDelete" class="action-img" alt="" />
|
|
|
- <img src="../../../assets/icons/up.png" @click="changeUp" class="action-img" alt="" />
|
|
|
- <img src="../../../assets/icons/down.png" @click="changeDown" class="action-img" alt="" />
|
|
|
+ <img
|
|
|
+ src="../../../assets/icons/up.png"
|
|
|
+ @click="changeUp"
|
|
|
+ :class="{ 'action-disable': isFirst, 'action-img': !isFirst }"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
+ <img
|
|
|
+ src="../../../assets/icons/down.png"
|
|
|
+ @click="changeDown"
|
|
|
+ :class="{ 'action-disable': isLast, 'action-img': !isLast }"
|
|
|
+ alt=""
|
|
|
+ />
|
|
|
</div>
|
|
|
</template>
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
import { computed } from 'vue';
|
|
|
import { ComAddDatas, WorkshopAddDatas, WorkspaceAddDatas } from '@/api/scene/sceneOperate.ts';
|
|
|
+ import useScene from './use-scene';
|
|
|
+ import { storeToRefs } from 'pinia';
|
|
|
+
|
|
|
+ const useSceneList = useScene();
|
|
|
+ const { tableData } = storeToRefs(useSceneList);
|
|
|
|
|
|
const props = defineProps<{
|
|
|
subItem: ComAddDatas | WorkshopAddDatas | WorkspaceAddDatas;
|
|
|
@@ -39,6 +54,20 @@
|
|
|
return (props.subItem as any).workshopId ? true : false;
|
|
|
});
|
|
|
|
|
|
+ const isFirst = computed(() => {
|
|
|
+ return (props.subItem as any).serial === 0 ? true : false;
|
|
|
+ });
|
|
|
+
|
|
|
+ const isLast = computed(() => {
|
|
|
+ if ((props.subItem as any).parentId === 0) {
|
|
|
+ return (props.subItem as any).serial === tableData.value.length - 1 ? true : false;
|
|
|
+ } else {
|
|
|
+ return (props.subItem as any).serial === (props.subItem as any).parent?.children.length - 1
|
|
|
+ ? true
|
|
|
+ : false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
const changeConig = () => {
|
|
|
props.handleConig(props.subItem);
|
|
|
};
|
|
|
@@ -48,6 +77,9 @@
|
|
|
};
|
|
|
|
|
|
const changeEdit = () => {
|
|
|
+ console.log('props.subItem', props.subItem);
|
|
|
+ console.log('length', tableData.value.length);
|
|
|
+
|
|
|
props.handleEdit(props.subItem);
|
|
|
};
|
|
|
|
|
|
@@ -57,6 +89,7 @@
|
|
|
|
|
|
const changeUp = () => {
|
|
|
props.handleUp(props.subItem);
|
|
|
+ console.log('props.subItem', props.subItem);
|
|
|
};
|
|
|
|
|
|
const changeDown = () => {
|
|
|
@@ -80,6 +113,7 @@
|
|
|
color: grey;
|
|
|
line-height: 22px;
|
|
|
margin-right: 7px;
|
|
|
+ cursor: not-allowed;
|
|
|
}
|
|
|
|
|
|
.otp-btn {
|
|
|
@@ -104,4 +138,11 @@
|
|
|
height: 16px;
|
|
|
margin-top: 5px;
|
|
|
}
|
|
|
+ .action-disable {
|
|
|
+ margin-right: 10px;
|
|
|
+ height: 16px;
|
|
|
+ margin-top: 5px;
|
|
|
+ filter: grayscale(100%);
|
|
|
+ cursor: not-allowed;
|
|
|
+ }
|
|
|
</style>
|