|
@@ -4,12 +4,17 @@ defineOptions({
|
|
|
});
|
|
|
import { ref } from "vue";
|
|
|
import dialogVue from "./components/dialog.vue";
|
|
|
-import drawerVue from "./components/drawer.vue";
|
|
|
+import editDrawer from "./components/editDrawer.vue";
|
|
|
+import DetailsDrawer from "./components/DetailsDrawer.vue";
|
|
|
+import IndexDefineImport from "./import/index.vue";
|
|
|
import { Edit, More } from "@element-plus/icons-vue";
|
|
|
+import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
const value = ref("");
|
|
|
const dialogShow = ref();
|
|
|
-const drawerShow = ref();
|
|
|
-const showDrawer = ref(false);
|
|
|
+const EditdrawerShow = ref();
|
|
|
+const DetailsdrawerShow = ref();
|
|
|
+const EditshowDrawer = ref(false);
|
|
|
+const DetailsshowDrawer = ref(false);
|
|
|
const options = [
|
|
|
{
|
|
|
value: "Option1",
|
|
@@ -74,129 +79,168 @@ const newAddIndex = () => {
|
|
|
const close = () => {
|
|
|
showDialog.value = false;
|
|
|
};
|
|
|
-const edit = row => {
|
|
|
- showDrawer.value = true;
|
|
|
- drawerShow.value.open();
|
|
|
+// 编辑
|
|
|
+const setEdit = row => {
|
|
|
+ EditshowDrawer.value = true;
|
|
|
+ EditdrawerShow.value.open();
|
|
|
console.log(row);
|
|
|
};
|
|
|
+// 删除
|
|
|
const setDelete = row => {
|
|
|
console.log(row);
|
|
|
- console.log(11111);
|
|
|
+ ElMessageBox.confirm("指标删除后无法恢复", "确定要删除这项指标吗", {
|
|
|
+ confirmButtonText: "确认",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning"
|
|
|
+ })
|
|
|
+ .then(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: "删除成功"
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ ElMessage({
|
|
|
+ type: "info",
|
|
|
+ message: "已取消"
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+// 详情
|
|
|
+const setDetails = row => {
|
|
|
+ DetailsshowDrawer.value = true;
|
|
|
+ DetailsdrawerShow.value.open();
|
|
|
+ console.log(row);
|
|
|
+};
|
|
|
+// 批量导入
|
|
|
+const sizeImport = ref(false);
|
|
|
+const GoSizeImport = () => {
|
|
|
+ sizeImport.value = !sizeImport.value;
|
|
|
};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
|
<div>
|
|
|
- <drawerVue ref="drawerShow" v-model:drawerValue="showDrawer" />
|
|
|
- <dialogVue
|
|
|
- ref="dialogShow"
|
|
|
- v-model:modelValue="showDialog"
|
|
|
- @closeDialog="close"
|
|
|
- />
|
|
|
- <div class="w-[100%]">
|
|
|
- <div class="mb-2 flex gap-2 justify-between flex-wrap">
|
|
|
- <div class="flex mt-2">
|
|
|
- <div class="flex mr-2">
|
|
|
- <div class="text-sm leading-8 mr-3">指标分类</div>
|
|
|
- <el-select
|
|
|
- v-model="value"
|
|
|
- clearable
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 150px"
|
|
|
- >
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ <IndexDefineImport v-if="sizeImport" @handleImport="GoSizeImport" />
|
|
|
+ <div v-else>
|
|
|
+ <editDrawer ref="EditdrawerShow" v-model:drawerValue="EditshowDrawer" />
|
|
|
+ <DetailsDrawer
|
|
|
+ ref="DetailsdrawerShow"
|
|
|
+ v-model:drawerValue="DetailsshowDrawer"
|
|
|
+ />
|
|
|
+ <dialogVue
|
|
|
+ ref="dialogShow"
|
|
|
+ v-model:modelValue="showDialog"
|
|
|
+ @closeDialog="close"
|
|
|
+ />
|
|
|
+ <div class="w-[100%]">
|
|
|
+ <div class="mb-2 flex gap-2 justify-between flex-wrap">
|
|
|
+ <div class="flex mt-2">
|
|
|
+ <div class="flex mr-2">
|
|
|
+ <div class="text-sm leading-8 mr-3">指标分类</div>
|
|
|
+ <el-select
|
|
|
+ v-model="value"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 150px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="flex mr-2">
|
|
|
+ <div class="text-sm leading-8 mr-3">状态</div>
|
|
|
+ <el-select
|
|
|
+ v-model="value"
|
|
|
+ clearable
|
|
|
+ placeholder="请选择"
|
|
|
+ style="width: 150px"
|
|
|
+ >
|
|
|
+ <el-option
|
|
|
+ v-for="item in options"
|
|
|
+ :key="item.value"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.value"
|
|
|
+ />
|
|
|
+ </el-select>
|
|
|
+ </div>
|
|
|
+ <div class="flex mr-2">
|
|
|
+ <el-input
|
|
|
+ style="width: 300px"
|
|
|
+ placeholder="搜索指标名称、编码、口径、定义"
|
|
|
/>
|
|
|
- </el-select>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- <div class="flex mr-2">
|
|
|
- <div class="text-sm leading-8 mr-3">状态</div>
|
|
|
- <el-select
|
|
|
- v-model="value"
|
|
|
- clearable
|
|
|
- placeholder="请选择"
|
|
|
- style="width: 150px"
|
|
|
+ <div class="flex pt-2 mr-6">
|
|
|
+ <el-button class="mr-2" @click="GoSizeImport">批量导入</el-button>
|
|
|
+ <el-button type="primary" class="mr-2" @click="newAddIndex"
|
|
|
+ >创建指标</el-button
|
|
|
>
|
|
|
- <el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
- />
|
|
|
- </el-select>
|
|
|
</div>
|
|
|
- <div class="flex mr-2">
|
|
|
- <el-input
|
|
|
- style="width: 300px"
|
|
|
- placeholder="搜索指标名称、编码、口径、定义"
|
|
|
- />
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div class="flex pt-2 mr-6">
|
|
|
- <el-button class="mr-2">批量导入</el-button>
|
|
|
- <el-button type="primary" class="mr-2" @click="newAddIndex"
|
|
|
- >创建指标</el-button
|
|
|
- >
|
|
|
</div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- <div class="mt-8">
|
|
|
- <el-table :data="tableData" style="width: 100%">
|
|
|
- <el-table-column prop="date" label="指标编号" width="100" />
|
|
|
- <el-table-column prop="name" label="指标名称" />
|
|
|
- <el-table-column prop="address" label="指标分类" />
|
|
|
- <el-table-column prop="address" label="状态">
|
|
|
- <template #default="{ row }">
|
|
|
- <el-tag type="primary" effect="dark">
|
|
|
- {{ row.name }}
|
|
|
- </el-tag>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column prop="address" label="指标定义" />
|
|
|
- <el-table-column prop="address" label="指标口径" />
|
|
|
- <el-table-column prop="address" label="数据来源" />
|
|
|
- <el-table-column prop="address" label="更新时间" />
|
|
|
- <el-table-column label="操作">
|
|
|
- <template #default="{ row }">
|
|
|
- <!-- <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>
|
|
|
- </div>
|
|
|
- <div class="float-right mt-8">
|
|
|
- <el-pagination
|
|
|
- v-model:current-page="currentPage4"
|
|
|
- v-model:page-size="pageSize4"
|
|
|
- :page-sizes="[100, 200, 300, 400]"
|
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
|
|
- :total="400"
|
|
|
- @size-change="handleSizeChange"
|
|
|
- @current-change="handleCurrentChange"
|
|
|
- />
|
|
|
+ <div class="mt-8">
|
|
|
+ <el-table :data="tableData" style="width: 100%">
|
|
|
+ <el-table-column prop="date" label="指标编号" width="100" />
|
|
|
+ <el-table-column prop="name" label="指标名称" />
|
|
|
+ <el-table-column prop="address" label="指标分类" />
|
|
|
+ <el-table-column prop="address" label="状态">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <el-tag type="primary" effect="dark">
|
|
|
+ {{ row.name }}
|
|
|
+ </el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column prop="address" label="指标定义" />
|
|
|
+ <el-table-column prop="address" label="指标口径" />
|
|
|
+ <el-table-column prop="address" label="数据来源" />
|
|
|
+ <el-table-column prop="address" label="更新时间" />
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template #default="{ row }">
|
|
|
+ <!-- <el-button link :icon="Edit" /> -->
|
|
|
+ <el-dropdown trigger="click">
|
|
|
+ <span class="el-dropdown-link navbar-bg-hover select-none">
|
|
|
+ <el-icon @click="setEdit(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-item @click="setDetails(row)">
|
|
|
+ 详情
|
|
|
+ </el-dropdown-item>
|
|
|
+ </el-dropdown-menu>
|
|
|
+ </template>
|
|
|
+ </el-dropdown>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ </div>
|
|
|
+ <div class="float-right mt-8">
|
|
|
+ <el-pagination
|
|
|
+ v-model:current-page="currentPage4"
|
|
|
+ v-model:page-size="pageSize4"
|
|
|
+ :page-sizes="[100, 200, 300, 400]"
|
|
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
|
+ :total="400"
|
|
|
+ @size-change="handleSizeChange"
|
|
|
+ @current-change="handleCurrentChange"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|