文档服务地址:http://47.92.0.57:3000/ 周报索引地址:http://47.92.0.57:3000/s/NruNXRYmV

Commit a3a2a862 by 李严凡

模板删除

parent cd771858
......@@ -271,15 +271,15 @@
<!-- <div class="block" v-for="(entity,index) in this.templateList">-->
<el-select v-model="templateChoose" placeholder="模板选择" >
<el-option
v-for="i in pOptions"
:key="i.templateId"
:label="i.templateName"
:value="i.templateId">
v-for="(item,index) in pOptions"
:key="item.templateId"
:label="item.templateName"
:value="index">
</el-option>
<!-- <el-button @click="createModle">查看</el-button>-->
<el-button @click="createModle">查看</el-button>
</el-select>
<el-tree
:data="this.pOptions[templateChoose-1].entityList"
:data="this.pOptions[templateChoose].entityList"
node-key="id"
default-expand-all
:expand-on-click-node="false">
......@@ -301,7 +301,7 @@
<!-- </span>-->
</span>
</el-tree>
<!-- <el-button>删除模板</el-button>-->
<el-button type="primary" @click="delTemplate(templateChoose)">删除模板</el-button>
<!-- </div>-->
</el-row>
<el-row :gutter="20">
......@@ -834,6 +834,7 @@
},
createModle(){
console.log(this.templateChoose);
console.log(this.pOptions);
},
append(data,mm) {
//type = 0 ,最下面的子节点,对应描述value;type=1,根节点,对应子类children
......@@ -855,51 +856,94 @@
children.splice(index, 1);
},
rePage(ins){
console.log(this.entityList);
//确定创建模板
// if(ins == 1){
// this.axios({
// method:'POST',
// url:'/textAnnotation/createTemplated',
// data:{
// templateId:this.pOptions.length+1,
// templateName:this.form.name,
// templateType:0,
// creatorId:this.userInfo.userId,
// entityList:this.entityList,
// },
// }).then(res=>{
// if(res.code == 1){
// this.pOptions = res.message;
// }
// else{
// alert("模板创建失败");
// }
// this.dialogFormVisible = false;
// })
// }
// console(this.pOptions);
// console.log(this.entityList);
// console.log("111");
// 确定创建模板
var max = -1;
for(var i = 0 ; i < this.pOptions.length ; i++){
if(this.pOptions[i].templateId > max)
max = this.pOptions[i].templateId;
};
if(ins == 1){
this.axios({
method:'POST',
url:'/textAnnotation/createTemplated',
data:{
templateId:max+1,
templateName:this.form.name,
templateType:0,
creatorId:this.userInfo.userId,
entityList:this.entityList,
},
}).then(res=>{
console.log(res);
if(res.code == 1){
this.pOptions = res.message;
}
else{
alert("模板创建失败");
}
this.dialogFormVisible = false;
})
}
// console(this.pOptions);
// // alert("111");
//location.reload();
},
delTemplate(index){
console.log(this.pOptions);
//
this.$confirm('此操作将永久删除改模板', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.axios({
method:"POST",
data:{
creatorId:this.userInfo.userId,
templateId:this.pOptions[index].templateId
},
url:'textAnnotation/deleteTemplate',
}).then(res=>{
console.log(res.return_code);
if(res.return_code == 200){
this.$message({
type: 'success',
message: '删除成功!'
});
this.pOptions.splice(index,1);
}
else{
alert("未知错误,删除失败");
}
});
}).catch(() => {
this.$message({
type: 'info',
message: '已取消删除'
});
});
console.log(this.pOptions);
},
checkTemplate(){
this.templateVisible=true;
this.axios({
method:"POST",
data:{
creatorId:this.userInfo.userId,
},
url:"/textAnnotation/getTemplated"
}).then(res=>{
console.log("///");
console.log(res);
if(res.code == 0){
alert("模板获取失败");
}
else{
this.templateDetailList = res.message;
}
})
// this.axios({
// method:"POST",
// data:{
// creatorId:this.userInfo.userId,
// },
// url:"/textAnnotation/getTemplated"
// }).then(res=>{
// console.log("///");
// console.log(res);
// if(res.code == 0){
// alert("模板获取失败");
// }
// else{
// this.templateDetailList = res.message;
// }
// })
// this.templateDetailList = this.pOptions;
}
}
......
<template>
<div class="select-container">
<el-container style="margin-top: 40px">
<el-aside
class="sidebar"
......@@ -130,7 +130,7 @@ export default {
// 从通用传来文本信息
// TODO quary instead of params to fix the bug during refreshing 没办法统一改就task存字段,刷新后去库里找
this.file = JSON.parse(decodeURIComponent(this.$route.params.file));
this.executor = JSON.parse(decodeURIComponent(this.$route.params.executor));
this.executor = JSON.parse(decodeURIComponent(this.$route.params.executor));
// this.task = JSON.parse(decodeURIComponent(this.$route.params.task));
},
methods: {
......@@ -239,8 +239,12 @@ export default {
this.commentScore = false;
this.$message("打分成功");
}
}
},
submit(){
alert("inin");
},
},
mounted: function() {
this.insertDocument();
}
......
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