|
@@ -2,7 +2,7 @@
|
|
|
defineOptions({
|
|
|
name: "IndexDefine"
|
|
|
});
|
|
|
-import { ref, reactive, markRaw } from "vue";
|
|
|
+import { ref, reactive, markRaw, onMounted } from "vue";
|
|
|
import dialogVue from "./components/dialog.vue";
|
|
|
import editDrawer from "./components/editDrawer.vue";
|
|
|
import logDrawer from "./components/logDrawer.vue";
|
|
@@ -11,7 +11,10 @@ import { Edit, More } from "@element-plus/icons-vue";
|
|
|
import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import { Delete, Check } from "@element-plus/icons-vue";
|
|
|
import { Search } from "@element-plus/icons-vue";
|
|
|
-import { getQuotaPageList, delQuota } from "@/api/indexDefine";
|
|
|
+import { getSelectDictListtApi, select } from "@/api/select";
|
|
|
+import { getQuotaPageList, delQuota, postUpdateDept } from "@/api/indexDefine";
|
|
|
+import { getStateData, getStateType } from "@/config/tag";
|
|
|
+import dayjs from "dayjs";
|
|
|
const value = ref("");
|
|
|
const dialogShow = ref();
|
|
|
const EditdrawerShow = ref();
|
|
@@ -19,26 +22,21 @@ const EditshowDrawer = ref(false);
|
|
|
// 日志
|
|
|
const logDrawerRef = ref();
|
|
|
const logDrawerShow = ref(false);
|
|
|
+onMounted(() => {
|
|
|
+ getSelectDictListtApi();
|
|
|
+});
|
|
|
const options = [
|
|
|
{
|
|
|
- value: "Option1",
|
|
|
- label: "Option1"
|
|
|
- },
|
|
|
- {
|
|
|
- value: "Option2",
|
|
|
- label: "Option2"
|
|
|
+ value: "0",
|
|
|
+ label: "草稿"
|
|
|
},
|
|
|
{
|
|
|
- value: "Option3",
|
|
|
- label: "Option3"
|
|
|
+ value: "1",
|
|
|
+ label: "已发布"
|
|
|
},
|
|
|
{
|
|
|
- value: "Option4",
|
|
|
- label: "Option4"
|
|
|
- },
|
|
|
- {
|
|
|
- value: "Option5",
|
|
|
- label: "Option5"
|
|
|
+ value: "2",
|
|
|
+ label: "已下架"
|
|
|
}
|
|
|
];
|
|
|
const currentPage4 = ref(5);
|
|
@@ -46,7 +44,10 @@ const pageSize4 = ref(100);
|
|
|
const params = reactive({
|
|
|
params: {
|
|
|
pageNumber: 1,
|
|
|
- pageSize: 10
|
|
|
+ pageSize: 10,
|
|
|
+ param: null,
|
|
|
+ categoryName: null,
|
|
|
+ statue: null
|
|
|
},
|
|
|
records: [],
|
|
|
total: 0
|
|
@@ -84,7 +85,6 @@ const close = () => {
|
|
|
const setEdit = row => {
|
|
|
EditshowDrawer.value = true;
|
|
|
EditdrawerShow.value.open(row);
|
|
|
- console.log(row);
|
|
|
};
|
|
|
// 删除
|
|
|
const delQuotaApi = async row => {
|
|
@@ -127,16 +127,14 @@ const logs = row => {
|
|
|
};
|
|
|
// 发布
|
|
|
const release = row => {
|
|
|
- ElMessageBox.confirm("请确认", "确定要发布这项指标吗", {
|
|
|
+ ElMessageBox.confirm("确定要发布这项指标吗", "", {
|
|
|
confirmButtonText: "确认",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: "发布成功"
|
|
|
- });
|
|
|
+ row.statue = 1;
|
|
|
+ postUpdateDeptApi(row, "上架");
|
|
|
})
|
|
|
.catch(() => {
|
|
|
ElMessage({
|
|
@@ -147,16 +145,14 @@ const release = row => {
|
|
|
};
|
|
|
// 下架
|
|
|
const offShelf = row => {
|
|
|
- ElMessageBox.confirm(" ", "确定要下架这项指标吗", {
|
|
|
+ ElMessageBox.confirm("确定要下架这项指标吗", "", {
|
|
|
confirmButtonText: "确认",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning"
|
|
|
})
|
|
|
.then(() => {
|
|
|
- ElMessage({
|
|
|
- type: "success",
|
|
|
- message: "下架成功"
|
|
|
- });
|
|
|
+ row.statue = 2;
|
|
|
+ postUpdateDeptApi(row, "下架");
|
|
|
})
|
|
|
.catch(() => {
|
|
|
ElMessage({
|
|
@@ -165,6 +161,17 @@ const offShelf = row => {
|
|
|
});
|
|
|
});
|
|
|
};
|
|
|
+// 修改信息
|
|
|
+const postUpdateDeptApi = async (row, state) => {
|
|
|
+ const res = await postUpdateDept(row);
|
|
|
+ if (res.code == 200) {
|
|
|
+ ElMessage({
|
|
|
+ type: "success",
|
|
|
+ message: `${state}成功`
|
|
|
+ });
|
|
|
+ getQuotaPageListApi();
|
|
|
+ }
|
|
|
+};
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -192,26 +199,30 @@ const offShelf = row => {
|
|
|
<div class="flex mr-2">
|
|
|
<div class="text-sm leading-8 mr-3">指标分类</div>
|
|
|
<el-select
|
|
|
- v-model="value"
|
|
|
+ v-model="params.params.categoryName"
|
|
|
clearable
|
|
|
+ filterable
|
|
|
placeholder="请选择"
|
|
|
style="width: 150px"
|
|
|
+ @change="getQuotaPageListApi"
|
|
|
>
|
|
|
<el-option
|
|
|
- v-for="item in options"
|
|
|
- :key="item.value"
|
|
|
- :label="item.label"
|
|
|
- :value="item.value"
|
|
|
+ v-for="(item, index) in select"
|
|
|
+ :key="index"
|
|
|
+ :label="item.dictValue"
|
|
|
+ :value="item.dictValue"
|
|
|
/>
|
|
|
</el-select>
|
|
|
</div>
|
|
|
<div class="flex mr-2">
|
|
|
<div class="text-sm leading-8 mr-3">状态</div>
|
|
|
<el-select
|
|
|
- v-model="value"
|
|
|
+ v-model="params.params.statue"
|
|
|
clearable
|
|
|
+ filterable
|
|
|
placeholder="请选择"
|
|
|
style="width: 150px"
|
|
|
+ @change="getQuotaPageListApi"
|
|
|
>
|
|
|
<el-option
|
|
|
v-for="item in options"
|
|
@@ -223,9 +234,12 @@ const offShelf = row => {
|
|
|
</div>
|
|
|
<div class="flex mr-2">
|
|
|
<el-input
|
|
|
+ v-model="params.params.param"
|
|
|
style="width: 300px"
|
|
|
:prefix-icon="Search"
|
|
|
+ clearable
|
|
|
placeholder="搜索指标名称、编码、口径、定义"
|
|
|
+ @change="getQuotaPageListApi"
|
|
|
/>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -244,15 +258,19 @@ const offShelf = row => {
|
|
|
<el-table-column prop="categoryName" label="指标分类" />
|
|
|
<el-table-column prop="address" label="状态">
|
|
|
<template #default="{ row }">
|
|
|
- <el-tag type="primary" effect="dark">
|
|
|
- {{ row.name }}
|
|
|
+ <el-tag :type="getStateType(row.statue)">
|
|
|
+ {{ getStateData(row.statue) }}
|
|
|
</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 prop="define" label="指标定义" />
|
|
|
+ <el-table-column prop="caliber" label="指标口径" />
|
|
|
+ <el-table-column prop="source" label="数据来源" />
|
|
|
+ <el-table-column prop="createTime" label="更新时间">
|
|
|
+ <template #default="{ row }">
|
|
|
+ {{ dayjs(row.createTime).format("YYYY-MM-DD HH:mm:ss") }}
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="操作">
|
|
|
<template #default="{ row }">
|
|
|
<!-- <el-button link :icon="Edit" /> -->
|