|
|
@@ -1,34 +1,43 @@
|
|
|
<template>
|
|
|
- <div class="mt10">
|
|
|
- <el-button type="primary" class="mb20 mr30" @click="isModalVisable = true"
|
|
|
- >添加版本记录</el-button
|
|
|
- >
|
|
|
- <el-popover placement="bottom" trigger="hover" :width="240">
|
|
|
- <el-timeline>
|
|
|
- <el-timeline-item
|
|
|
- v-for="item in this.$store.state.versions"
|
|
|
- center
|
|
|
- :timestamp="item.timer"
|
|
|
- placement="top"
|
|
|
- >
|
|
|
- <div class="log-card">
|
|
|
- <p style="margin-bottom: 10px">Version: {{ item.version }}</p>
|
|
|
- <div
|
|
|
- style="margin-bottom: 5px; font-size: 12px"
|
|
|
- v-for="(item1, index) in item.remarks"
|
|
|
- >
|
|
|
- {{ index + 1 }}. {{ item1.text }}
|
|
|
+ <div class="mt10 df aic jcsb">
|
|
|
+ <div>
|
|
|
+ <el-button type="primary" class="mb20 mr30" @click="isModalVisable = true"
|
|
|
+ >添加版本记录</el-button
|
|
|
+ >
|
|
|
+ <el-popover placement="bottom" trigger="hover" :width="240">
|
|
|
+ <el-timeline>
|
|
|
+ <el-timeline-item
|
|
|
+ v-for="item in this.$store.state.versions"
|
|
|
+ center
|
|
|
+ :timestamp="item.timer"
|
|
|
+ placement="top"
|
|
|
+ >
|
|
|
+ <div class="log-card">
|
|
|
+ <p style="margin-bottom: 10px">Version: {{ item.version }}</p>
|
|
|
+ <div
|
|
|
+ style="margin-bottom: 5px; font-size: 12px"
|
|
|
+ v-for="(item1, index) in item.remarks"
|
|
|
+ >
|
|
|
+ {{ index + 1 }}. {{ item1.text }}
|
|
|
+ </div>
|
|
|
</div>
|
|
|
- </div>
|
|
|
- </el-timeline-item>
|
|
|
- </el-timeline>
|
|
|
- <template #reference>
|
|
|
- <el-badge value="new">
|
|
|
- <!-- <div class="log">新功能日志</div> -->
|
|
|
- <el-button> 新功能日志</el-button>
|
|
|
- </el-badge>
|
|
|
- </template>
|
|
|
- </el-popover>
|
|
|
+ </el-timeline-item>
|
|
|
+ </el-timeline>
|
|
|
+ <template #reference>
|
|
|
+ <el-badge value="new">
|
|
|
+ <!-- <div class="log">新功能日志</div> -->
|
|
|
+ <el-button> 新功能日志</el-button>
|
|
|
+ </el-badge>
|
|
|
+ </template>
|
|
|
+ </el-popover>
|
|
|
+ </div>
|
|
|
+ <div>
|
|
|
+ <!-- <el-button @click="">返回版本记录列表</el-button>
|
|
|
+ <el-button class="mr20 ml20" type="warning" @click="trash"
|
|
|
+ >回收站</el-button
|
|
|
+ > -->
|
|
|
+ </div>
|
|
|
+
|
|
|
<el-dialog
|
|
|
title="版本管理"
|
|
|
width="500px"
|
|
|
@@ -90,67 +99,67 @@
|
|
|
</div>
|
|
|
</el-form>
|
|
|
</el-dialog>
|
|
|
- <el-table :data="versions">
|
|
|
- <el-table-column
|
|
|
- type="index"
|
|
|
- label="序号"
|
|
|
- min-width="120"
|
|
|
- align="center"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="version"
|
|
|
- label="版本号"
|
|
|
- min-width="100"
|
|
|
- align="center"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column
|
|
|
- prop="timer"
|
|
|
- label="发布时间"
|
|
|
- min-width="100"
|
|
|
- align="center"
|
|
|
- ></el-table-column>
|
|
|
- <el-table-column label="版本内容" min-width="150" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <div
|
|
|
- style="width: 100%; text-align: left"
|
|
|
- v-for="(item, index) in scope.row.remarks"
|
|
|
- >
|
|
|
- {{ index + 1 + ". " + item.text }}
|
|
|
- </div>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="状态" min-width="150" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-switch
|
|
|
- v-model="scope.row.disabled"
|
|
|
- active-color="#13ce66"
|
|
|
- :active-value="false"
|
|
|
- :inactive-value="true"
|
|
|
- inactive-color="#ff4949"
|
|
|
- @change="changeSwitch($event, scope.row._id)"
|
|
|
- />
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- <el-table-column label="操作" min-width="150" align="center">
|
|
|
- <template v-slot="scope">
|
|
|
- <el-button
|
|
|
- @click="detail(scope.row, scope.$index)"
|
|
|
- type="primary"
|
|
|
- size="small"
|
|
|
- >
|
|
|
- 修改
|
|
|
- </el-button>
|
|
|
- <el-button
|
|
|
- @click="deleteItem(scope.row._id, scope.$index)"
|
|
|
- type="danger"
|
|
|
- size="small"
|
|
|
- >
|
|
|
- 删除
|
|
|
- </el-button>
|
|
|
- </template>
|
|
|
- </el-table-column>
|
|
|
- </el-table>
|
|
|
</div>
|
|
|
+ <el-table :data="versions">
|
|
|
+ <el-table-column
|
|
|
+ type="index"
|
|
|
+ label="序号"
|
|
|
+ min-width="120"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="version"
|
|
|
+ label="版本号"
|
|
|
+ min-width="100"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="timer"
|
|
|
+ label="发布时间"
|
|
|
+ min-width="100"
|
|
|
+ align="center"
|
|
|
+ ></el-table-column>
|
|
|
+ <el-table-column label="版本内容" min-width="150" align="center">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <div
|
|
|
+ style="width: 100%; text-align: left"
|
|
|
+ v-for="(item, index) in scope.row.remarks"
|
|
|
+ >
|
|
|
+ {{ index + 1 + ". " + item.text }}
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="状态" min-width="150" align="center">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-switch
|
|
|
+ v-model="scope.row.disabled"
|
|
|
+ active-color="#13ce66"
|
|
|
+ :active-value="false"
|
|
|
+ :inactive-value="true"
|
|
|
+ inactive-color="#ff4949"
|
|
|
+ @change="changeSwitch($event, scope.row._id)"
|
|
|
+ />
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="操作" min-width="150" align="center">
|
|
|
+ <template v-slot="scope">
|
|
|
+ <el-button
|
|
|
+ @click="detail(scope.row, scope.$index)"
|
|
|
+ type="primary"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ 修改
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ @click="deleteItem(scope.row._id, scope.$index)"
|
|
|
+ type="danger"
|
|
|
+ size="small"
|
|
|
+ >
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
@@ -160,6 +169,7 @@ import { ElMessage, ElMessageBox } from "element-plus";
|
|
|
import store from "../../store";
|
|
|
const db = tcb.database();
|
|
|
const v = db.collection("huihenduo_versions");
|
|
|
+const __ = db.command;
|
|
|
|
|
|
import { reactive, ref, onMounted } from "vue";
|
|
|
let versions = ref([]);
|
|
|
@@ -176,17 +186,18 @@ function detail(item1) {
|
|
|
ruleForm.value = { version, timer, remarks };
|
|
|
|
|
|
isModalVisable.value = true;
|
|
|
- console.log(ruleForm.value);
|
|
|
}
|
|
|
|
|
|
async function deleteItem(_id) {
|
|
|
- ElMessageBox.confirm("确认删除保险单?", "Warning", {
|
|
|
+ ElMessageBox.confirm("确认删除版本日志?", "Warning", {
|
|
|
confirmButtonText: "删除",
|
|
|
cancelButtonText: "取消",
|
|
|
type: "warning",
|
|
|
})
|
|
|
.then(async () => {
|
|
|
- let res = await v.doc(_id).remove();
|
|
|
+ let res = await v.doc(_id).update({
|
|
|
+ deleted: true,
|
|
|
+ });
|
|
|
getAllVersions();
|
|
|
})
|
|
|
.catch(() => {
|
|
|
@@ -238,8 +249,9 @@ async function add() {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
-async function getAllVersions() {
|
|
|
+async function getAllVersions(listType) {
|
|
|
let res = await v
|
|
|
+ .where({ deleted: __.neq(true) })
|
|
|
.skip((currentPage.value - 1) * pageSize.value)
|
|
|
.limit(pageSize.value)
|
|
|
.get();
|
|
|
@@ -250,7 +262,7 @@ async function getAllVersions() {
|
|
|
let abledVersions = ref([]);
|
|
|
async function getAbledVersions() {
|
|
|
let res = await v
|
|
|
- .where({ disabled: false })
|
|
|
+ .where({ disabled: false, deleted: __.neq(true) })
|
|
|
.skip((currentPage.value - 1) * pageSize.value)
|
|
|
.limit(pageSize.value)
|
|
|
.get();
|