|
@@ -3,10 +3,13 @@ defineOptions({
|
|
|
name: "IndexDefine"
|
|
|
});
|
|
|
import { ref } from "vue";
|
|
|
-import dialogVue from "./dialog.vue";
|
|
|
+import dialogVue from "./components/dialog.vue";
|
|
|
+import drawerVue from "./components/drawer.vue";
|
|
|
import { Edit, More } from "@element-plus/icons-vue";
|
|
|
const value = ref("");
|
|
|
const dialogShow = ref();
|
|
|
+const drawerShow = ref();
|
|
|
+const showDrawer = ref(false);
|
|
|
const options = [
|
|
|
{
|
|
|
value: "Option1",
|
|
@@ -71,15 +74,20 @@ const newAddIndex = () => {
|
|
|
const close = () => {
|
|
|
showDialog.value = false;
|
|
|
};
|
|
|
-const setShow = ref(false);
|
|
|
-const setting = row => {
|
|
|
- row.show = !row.show;
|
|
|
- setShow.value = !setShow.value;
|
|
|
+const edit = row => {
|
|
|
+ showDrawer.value = true;
|
|
|
+ drawerShow.value.open();
|
|
|
+ console.log(row);
|
|
|
+};
|
|
|
+const setDelete = row => {
|
|
|
+ console.log(row);
|
|
|
+ console.log(11111);
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div>
|
|
|
+ <drawerVue ref="drawerShow" v-model:drawerValue="showDrawer" />
|
|
|
<dialogVue
|
|
|
ref="dialogShow"
|
|
|
v-model:modelValue="showDialog"
|
|
@@ -153,15 +161,28 @@ const setting = row => {
|
|
|
<el-table-column prop="address" label="更新时间" />
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="{ row }">
|
|
|
- <el-button link :icon="Edit" />
|
|
|
- <el-button link :icon="More" @click="setting(row)" />
|
|
|
- <div v-if="row.show" class="setBox">
|
|
|
- <p>删除</p>
|
|
|
- <p>发布</p>
|
|
|
- <p>下架</p>
|
|
|
- <p>日志</p>
|
|
|
- <p>数据</p>
|
|
|
- </div>
|
|
|
+ <!-- <el-button link :icon="Edit" /> -->
|
|
|
+ <el-dropdown trigger="click">
|
|
|
+ <span class="el-dropdown-link navbar-bg-hover select-none">
|
|
|
+ <el-icon @click="edit(row)"><Edit /></el-icon>
|
|
|
+ </span>
|
|
|
+ </el-dropdown>
|
|
|
+ <el-dropdown class="ml-2" trigger="click">
|
|
|
+ <span class="el-dropdown-link navbar-bg-hover select-none">
|
|
|
+ <el-icon><More /></el-icon>
|
|
|
+ </span>
|
|
|
+ <template #dropdown>
|
|
|
+ <el-dropdown-menu class="setting">
|
|
|
+ <el-dropdown-item @click="setDelete(row)">
|
|
|
+ 删除
|
|
|
+ </el-dropdown-item>
|
|
|
+ <el-dropdown-item> 发布 </el-dropdown-item>
|
|
|
+ <el-dropdown-item> 下架 </el-dropdown-item>
|
|
|
+ <el-dropdown-item> 日志 </el-dropdown-item>
|
|
|
+ <el-dropdown-item> 数据 </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
@@ -197,12 +218,7 @@ const setting = row => {
|
|
|
// background-color: #f2f3f5; /* 设置背景色 */
|
|
|
}
|
|
|
|
|
|
-.setBox {
|
|
|
- position: absolute;
|
|
|
- right: 50px;
|
|
|
- z-index: 999 !important;
|
|
|
+.setting {
|
|
|
font-size: 12px;
|
|
|
- background: #fff;
|
|
|
- border: 1px solid red;
|
|
|
}
|
|
|
</style>
|