|
@@ -57,25 +57,25 @@ const config = computed(() => {
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "回复人",
|
|
|
- prop: "dictKey",
|
|
|
+ prop: "authorName",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "内容",
|
|
|
+ label: "回复内容",
|
|
|
prop: "content",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
- label: "时间",
|
|
|
+ label: "回复时间",
|
|
|
prop: "createTime",
|
|
|
},
|
|
|
},
|
|
|
{
|
|
|
attrs: {
|
|
|
label: "操作",
|
|
|
- align: "right",
|
|
|
+ align: "center",
|
|
|
},
|
|
|
// 渲染 el-button,一般用在最后一列。
|
|
|
renderHTML(row) {
|
|
@@ -88,25 +88,7 @@ const config = computed(() => {
|
|
|
},
|
|
|
el: "button",
|
|
|
click() {
|
|
|
- // 弹窗提示是否删除
|
|
|
- ElMessageBox.confirm("此操作将删除该数据, 是否继续?", "提示", {
|
|
|
- confirmButtonText: "确定",
|
|
|
- cancelButtonText: "取消",
|
|
|
- type: "warning",
|
|
|
- }).then(() => {
|
|
|
- // 删除
|
|
|
- proxy
|
|
|
- .post("/dictTenantData/delete", {
|
|
|
- id: row.id,
|
|
|
- })
|
|
|
- .then((res) => {
|
|
|
- ElMessage({
|
|
|
- message: "删除成功",
|
|
|
- type: "success",
|
|
|
- });
|
|
|
- getList();
|
|
|
- });
|
|
|
- });
|
|
|
+ prefixDel(row);
|
|
|
},
|
|
|
},
|
|
|
];
|
|
@@ -144,13 +126,40 @@ const getList = async (req) => {
|
|
|
}, 200);
|
|
|
});
|
|
|
};
|
|
|
+
|
|
|
+const prefixDel = (row) => {
|
|
|
+ ElMessageBox.confirm("你是否删除此回复?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ proxy.post("/topicReplies/hasFloorReply", { floorId: row.id }).then((res) => {
|
|
|
+ if(res){
|
|
|
+ ElMessageBox.confirm("此回复下有其他用户的回复,删除后所有回复也将一并删除,是否确认删除?", "提示", {
|
|
|
+ confirmButtonText: "确定",
|
|
|
+ cancelButtonText: "取消",
|
|
|
+ type: "warning",
|
|
|
+ }).then(() => {
|
|
|
+ del(row.id)
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ del(row.id)
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+};
|
|
|
+
|
|
|
+const del = (id) => {
|
|
|
+ proxy.post("/topicReplies/deleteAndChild", { id: id }).then((res) => {
|
|
|
+ ElMessage({
|
|
|
+ message: "操作成功",
|
|
|
+ type: "success",
|
|
|
+ });
|
|
|
+ getList();
|
|
|
+ });
|
|
|
+}
|
|
|
getList();
|
|
|
</script>
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
-.dictTenantDtl {
|
|
|
-}
|
|
|
-.tenant {
|
|
|
- padding: 20px;
|
|
|
-}
|
|
|
</style>
|