Commit 9af5bebe authored by “yiyousong”'s avatar “yiyousong”

fix:修改删除弹窗

parent fa22e803
......@@ -55,14 +55,12 @@ export default {
// 异步获取子区域
onLoadData(treeNode) {
return new Promise((resolve) => {
console.log(treeNode.dataRef.id);
getListByParentId({
parentId: treeNode.dataRef.id,
}).then((res) => {
const { data } = res.data;
treeNode.dataRef.children = data.data;
this.treeData = [...this.treeData];
console.log(this.treeData);
resolve();
});
// if (treeNode.dataRef.children) {
......
......@@ -3,17 +3,7 @@
<div class="left">
<div class="header">
<h3 class="titel">站点业务列表</h3>
<a-popconfirm
:title="
deleteData.length
? '确定要从站点移除所选业务吗?'
: '请先勾选数据。'
"
@confirm="handleDelAll"
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a-button type="danger"> 批量移除 </a-button>
</a-popconfirm>
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button>
<a-button class="add-btn" @click="showModal"> 新增业务 </a-button>
</div>
<div class="table-content">
......@@ -55,13 +45,12 @@
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a-popconfirm
title="确定要从站点删除该业务吗?"
@confirm="handleDel(text.id, text)"
<a
href="javascript:;"
class="delete"
@click="handleDel(text.id, text)"
>删除</a
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</template>
</a-table>
</div>
......@@ -147,14 +136,12 @@
</template>
<template slot="action" slot-scope="text">
<a class="jion" @click="handleIn(text.id)">加入</a>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDelRight(+text.id)"
<a
href="javascript:;"
class="delete"
@click="handleDelRight(+text.id)"
>删除</a
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</template>
</a-table>
</div>
......@@ -331,17 +318,33 @@ export default {
// this.getBusinessListData();
// },
// 删除
async handleDel(num, data) {
let res = await delSiteBusiness({ id: num });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getSiteBusinessData();
this.$refs.addprofession.getBusinessData();
this.deleteData = [];
this.$bus.$emit("delBusiness");
this.$bus.$emit("delBusinessMatter", data);
}
handleDel(num, data) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delSiteBusiness({ id: num });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getSiteBusinessData();
_this.$refs.addprofession.getBusinessData();
_this.deleteData = [];
_this.$bus.$emit("delBusiness");
_this.$bus.$emit("delBusinessMatter", data);
}
},
onCancel() {
console.log("Cancel");
},
});
},
//新增业务
......@@ -362,6 +365,7 @@ export default {
// 批量删除
handleDelAll() {
if (this.deleteData.length <= 0) {
this.$message.warning("请先勾选数据");
return;
} else {
let arr = [...this.deleteData];
......@@ -438,13 +442,29 @@ export default {
}
},
// 删除-右
async handleDelRight(val) {
let res = await businessDel({ id: val });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getBusinessListData();
}
handleDelRight(val) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await businessDel({ id: val });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getBusinessListData();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 自定义表格展开图标
expandIcon(props) {
......
......@@ -5,17 +5,7 @@
<h3 class="titel">站点事项列表</h3>
<div class="header-bottom">
<div class="left-btn">
<a-popconfirm
:title="
deleteData.length
? '确定要从站点移除所选事项吗?'
: '请先勾选数据。'
"
@confirm="handleDelAll"
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a-button type="danger"> 批量移除 </a-button>
</a-popconfirm>
<a-button type="danger" @click="handleDelAll"> 批量移除 </a-button>
<!-- <a-button class="add-btn" @click="addItems"> 新增事项 </a-button> -->
</div>
<div class="search-box">
......@@ -87,13 +77,12 @@
</template>
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a-popconfirm
title="确定要从站点移除该事项吗?"
@confirm="handleDel(text.id, text)"
<a
href="javascript:;"
class="delete"
@click="handleDel(text.id, text)"
>移除</a
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a href="javascript:;" class="delete">移除</a>
</a-popconfirm>
</template>
</a-table>
</div>
......@@ -173,13 +162,12 @@
<a href="javascript:;" class="jion" @click="handleIn(text.id)"
>加入</a
>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDelRight(text.id)"
<a
href="javascript:;"
class="delete"
@click="handleDelRight(text.id)"
>删除</a
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</template>
</a-table>
</div>
......@@ -334,7 +322,6 @@ export default {
}
this.leftTotal = pageInfo.totalResult;
this.matterSiteData = data;
console.log(data);
this.leftLoading = false;
},
// 获取事项列表
......@@ -368,16 +355,32 @@ export default {
this.getMatterSiteData();
},
// 左边删除
async handleDel(val, row) {
let res = await delSiteMatter({ id: String(val) });
let { msg, code } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getMatterSiteData();
this.deleteData = "";
this.$bus.$emit("delMatterSiteData");
this.$bus.$emit("delMatterSiteRelevance", row);
}
handleDel(val, row) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "确定要移除所选事项吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delSiteMatter({ id: String(val) });
let { msg, code } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getMatterSiteData();
_this.deleteData = "";
_this.$bus.$emit("delMatterSiteData");
_this.$bus.$emit("delMatterSiteRelevance", row);
}
},
onCancel() {
console.log("Cancel");
},
});
},
//新增事项
......@@ -399,6 +402,7 @@ export default {
// 批量删除
handleDelAll() {
if (this.deleteData.length <= 0) {
this.$message.warning("请先勾选数据");
return;
} else {
let str = [...this.deleteData].map((v) => v.id).join(",");
......@@ -468,12 +472,28 @@ export default {
},
// 右边删除
async handleDelRight(val) {
let res = await delMatter({ id: String(val) });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getMatterListData();
}
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delMatter({ id: String(val) });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getMatterListData();
}
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
......
......@@ -6,15 +6,8 @@
<a-button type="primary" style="margin-right: 10px" @click="handleAdd"
>新增模块</a-button
>
<a-popconfirm
:title="
selectedRowKeys.length ? '确定要删除所选模块吗?' : '请先勾选模块'
"
@confirm="handleDelAll"
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a-button type="danger">批量删除模块</a-button>
</a-popconfirm>
<a-button type="danger" @click="handleDelAll">批量删除模块</a-button>
</div>
<div class="search-box">
<a-input-search
......@@ -87,13 +80,9 @@
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a-popconfirm
title="确定删除该模块吗?"
@confirm="handleDel(text.id)"
<a href="javascript:;" class="delete" @click="handleDel(text.id)"
>删除</a
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</template>
</a-table>
</div>
......@@ -349,6 +338,7 @@ export default {
if (this.selectedRowKeys.length) {
this.handleDel(this.selectedRowKeys.join(","));
} else {
this.$message.warning("请先勾选模块");
return;
}
},
......@@ -358,13 +348,29 @@ export default {
this.visible = true;
},
// 删除
async handleDel(num) {
let res = await delMode({ id: num });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getmodelList();
}
handleDel(num) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delMode({ id: num });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getmodelList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 分页
handleChange(num) {
......
......@@ -18,13 +18,7 @@
@click="addWindowMatter"
>添加窗口事项</a-button
>
<a-popconfirm
:title="allDel ? '删除不可恢复,确定要删除吗?' : '请先勾选数据'"
@confirm="handleDelAll"
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a-button type="danger">批量删除</a-button>
</a-popconfirm>
<a-button type="danger" @click="handleDelAll">批量删除</a-button>
</div>
<div class="search">
<a-input-search
......@@ -76,13 +70,9 @@
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDel(+text.id)"
<a href="javascript:;" @click="handleDel(+text.id)" class="delete"
>删除</a
>
<a-icon slot="icon" type="question-circle-o" style="color: red" />
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</template>
</a-table>
</div>
......@@ -360,21 +350,36 @@ export default {
this.Visible = false;
},
// 删除
async handleDel(num) {
let res = await delWindowmatter({ id: num });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getWindowmatterData();
} else {
this.$message.error(msg);
}
handleDel(num) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delWindowmatter({ id: num });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getWindowmatterData();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 批量删除
handleDelAll() {
if (this.allDel) {
this.handleDel(this.allDel);
} else {
this.$message.warning("请先勾选数据");
return;
}
},
......
......@@ -484,6 +484,7 @@ export default {
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
async onOk() {
let res = await delDept({ id: num });
let { code, msg } = res.data;
......@@ -543,6 +544,7 @@ export default {
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
async onOk() {
let res = await delWindow({ id: num });
let { code, msg } = res.data;
......
......@@ -70,17 +70,7 @@
<!-- 操作 -->
<template slot="action" slot-scope="text">
<a type="primary" @click="handleEdit(text)" class="edit">编辑</a>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDel(text.id)"
>
<a-icon
slot="icon"
type="question-circle-o"
style="color: red"
/>
<a class="delet">删除</a>
</a-popconfirm>
<a class="delet" @click="handleDel(text.id)">删除</a>
</template>
</a-table>
</div>
......@@ -243,13 +233,29 @@ export default {
this.getHolidayData();
},
// 删除
async handleDel(num) {
let res = await DelHoliday({ id: num });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getHolidayData();
}
handleDel(num) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await DelHoliday({ id: num });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getHolidayData();
}
},
onCancel() {
console.log("Cancel");
},
});
},
},
};
......
......@@ -23,18 +23,9 @@
<a-button type="primary" @click="editSiteInfo(item)"
>编辑</a-button
>
<a-popconfirm
placement="left"
title="删除后不可恢复,确定要删除吗?"
@confirm="deleteSite(item.id)"
<a-button type="danger" @click="deleteSite(item.id)"
>删除</a-button
>
<a-icon
slot="icon"
type="question-circle-o"
style="color: red"
/>
<a-button type="danger">删除</a-button>
</a-popconfirm>
</div>
</div>
......@@ -282,7 +273,6 @@ export default {
async getSiteList(info = {}) {
let res = await getSiteList(info);
let { data, dict } = res.data.data;
console.log(dict);
data.forEach((v) => {
v.modelIds = v.modelIds.split(",");
v.modelData = Object.keys(dict.modelIds).reduce(
......@@ -307,13 +297,29 @@ export default {
// },
// 删除
async deleteSite(val) {
let res = await deleteSite({ id: val });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getSiteList({ areaID: this.areaID });
}
deleteSite(val) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await deleteSite({ id: val });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getSiteList({ areaID: _this.areaID });
}
},
onCancel() {
console.log("Cancel");
},
});
},
//查看全部
cookAll(text) {
......
......@@ -69,17 +69,12 @@
<a href="javascript:;" class="edit" @click="handleEdit(text)"
>编辑</a
>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDel(text.id)"
<a
href="javascript:;"
class="delete"
@click="handleDel(text.id)"
>删除</a
>
<a-icon
slot="icon"
type="question-circle-o"
style="color: red"
/>
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</a-space>
</template>
</a-table>
......@@ -183,17 +178,12 @@
<template slot="action" slot-scope="text">
<a-space>
<a class="edit" @click="handleEditRight(text)">编辑</a>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDelRight(text.id)"
<a
href="javascript:;"
class="delete"
@click="handleDelRight(text.id)"
>删除</a
>
<a-icon
slot="icon"
type="question-circle-o"
style="color: red"
/>
<a href="javascript:;" class="delete">删除</a>
</a-popconfirm>
</a-space>
</template>
</a-table>
......@@ -455,19 +445,7 @@ export default {
if (!this.leftSelectedRowKeys.length) {
this.$message.warning("请先勾选数据");
} else {
let _this = this;
_this.$confirm({
title: "确定要删除所勾选数据吗?",
// content: "Some descriptions",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
onOk() {
_this.handleDel(_this.leftSelectedRowKeys.join(","));
},
onCancel() {},
});
this.handleDel(this.leftSelectedRowKeys.join(","));
}
},
// 右边选择
......@@ -479,21 +457,7 @@ export default {
if (!this.rightSelectedRowKeys.length) {
this.$message.warning("请先勾选数据");
} else {
let _this = this;
_this.$confirm({
title: "确定要删除所勾选数据吗?",
// content: "Some descriptions",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
onOk() {
_this.handleDelRight(_this.rightSelectedRowKeys.join(","));
},
onCancel() {
console.log("Cancel");
},
});
this.handleDelRight(this.rightSelectedRowKeys.join(","));
}
},
// 左边编辑
......@@ -503,16 +467,30 @@ export default {
this.$refs.AddTemplate.onEdit(row);
},
// 左边删除
async handleDel(val) {
let res = await deleteTemplate({ id: val });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.leftSelectedRowKeys = [];
this.getTemplateList();
} else {
this.$message.error(msg);
}
handleDel(val) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await deleteTemplate({ id: val });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.leftSelectedRowKeys = [];
_this.getTemplateList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 右边编辑
handleEditRight(row) {
......@@ -521,16 +499,30 @@ export default {
this.$refs.AddField.onEdit(row);
},
// 右边删除
async handleDelRight(val) {
let res = await deleteField({ id: val });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.rightSelectedRowKeys = [];
this.getFieldList();
} else {
this.$message.error(msg);
}
handleDelRight(val) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await deleteField({ id: val });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.rightSelectedRowKeys = [];
_this.getFieldList();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 新增皮肤模板成功刷新列表
addSuccess() {
......
......@@ -141,8 +141,11 @@ export default {
this.$confirm({
title: "系统提示",
content: "此操作将删除该皮肤信息,是否继续?",
icon: "<Icon type='question-circle'>",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await skinDelete({ id: val });
......@@ -154,7 +157,9 @@ export default {
_this.$message.error(msg);
}
},
onCancel() {},
onCancel() {
console.log("Cancel");
},
});
},
},
......
......@@ -193,10 +193,12 @@ export default {
this.$confirm({
title: "系统提示",
content: "此操作将删除该分类下的所有皮肤信息,是否继续?",
width: 450,
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "<Icon type='question-circle'>",
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await categoryDelete({ id: String(val) });
let { code, msg } = res.data;
......@@ -213,10 +215,12 @@ export default {
this.$confirm({
title: "系统提示",
content: "此操作将删除该分类信息,是否继续?",
width: 450,
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "<Icon type='question-circle'>",
maskClosable: true,
icon: "exclamation-circle",
async onOk() {
let res = await categoryDelete({ id: String(val) });
let { code, msg } = res.data;
......
......@@ -134,17 +134,7 @@
<a class="edit-pwd" type="primary" @click="changePwd(text)"
>修改密码</a
>
<a-popconfirm
title="删除不可恢复,确定要删除吗?"
@confirm="handleDel(text.id)"
>
<a-icon
slot="icon"
type="question-circle-o"
style="color: red"
/>
<a class="delet">删除</a>
</a-popconfirm>
<a class="delet" @click="handleDel(text.id)">删除</a>
</a-space>
</span>
</a-table>
......@@ -368,15 +358,29 @@ export default {
this.getWorkmanData();
},
// 删除
async handleDel(val) {
let res = await delWorkman({ id: val });
let { code, msg } = res.data;
if (code === 1) {
this.$message.success(msg);
this.getWorkmanData();
} else {
this.$message.error(msg);
}
handleDel(val) {
let _this = this;
this.$confirm({
title: "系统提示",
content: "删除不可恢复,确定要删除吗?",
okText: "确定",
okType: "danger",
cancelText: "取消",
centered: true,
icon: "exclamation-circle",
maskClosable: true,
async onOk() {
let res = await delWorkman({ id: val });
let { code, msg } = res.data;
if (code === 1) {
_this.$message.success(msg);
_this.getWorkmanData();
}
},
onCancel() {
console.log("Cancel");
},
});
},
// 搜索
onSearch(val) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment