增加模板删除方法

master
张博文 5 months ago
parent 44357f4fcb
commit 43a10db83a

@ -201,7 +201,7 @@
.fixed-icon { .fixed-icon {
width: 89px; width: 89px;
height: 66px; height: 53px;
margin-top: 14px; margin-top: 14px;
} }
} }

@ -23,7 +23,7 @@
<div class="temp-btns"> <div class="temp-btns">
<i class="el-icon-view temp-tip-icon" @click="showPreview(index)"></i> <i class="el-icon-view temp-tip-icon" @click="showPreview(index)"></i>
<i class="el-icon-edit temp-tip-icon" @click="toSetting('/configue/uni-template/detail',item.id)"></i> <i class="el-icon-edit temp-tip-icon" @click="toSetting('/configue/uni-template/detail',item.id)"></i>
<i class="el-icon-delete temp-tip-icon" v-if="!item.defaultTemplate"></i> <i class="el-icon-delete temp-tip-icon" v-if="!item.defaultTemplate" @click="deleteTemp(item.id)"></i>
</div> </div>
</div> </div>
<div class="temp-add-btn" @click="toSetting('/configue/uni-template/detail')"> <div class="temp-add-btn" @click="toSetting('/configue/uni-template/detail')">
@ -56,7 +56,7 @@
</template> </template>
<script> <script>
import { getUniTemplatePage } from "@/api/configure/uniTemplate"; import { getUniTemplatePage, deleteUniTemplate } from "@/api/configure/uniTemplate";
import appPreview from '@/components/Customer/appPreview'; import appPreview from '@/components/Customer/appPreview';
export default { export default {
@ -115,7 +115,18 @@ export default {
}; };
console.log(this.previewInfo); console.log(this.previewInfo);
}); });
},
deleteTemp(id) {
this.$confirm('确认删除该模板?')
.then(() => {
deleteUniTemplate(id).then(() => {
this.$message.success('删除成功');
this.getList();
});
})
.catch(() => {
this.$message.info('已取消');
});
}, },
async getList() { async getList() {
let res = await getUniTemplatePage(this.searchForm); let res = await getUniTemplatePage(this.searchForm);

@ -1997,7 +1997,7 @@
const loading = Loading.service({ text: '加载中...', target: '.setting-main' }); const loading = Loading.service({ text: '加载中...', target: '.setting-main' });
updateHarvestBatchConfig(params).then(({}) => { updateHarvestBatchConfig(params).then(({}) => {
this.$message.info('保存成功'); this.$message.success('保存成功');
// //
this.getHarvestBatchConfig(id, languageTypeId); this.getHarvestBatchConfig(id, languageTypeId);
}).finally(() => { }).finally(() => {

Loading…
Cancel
Save