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

Commit 18600f23 by 李严凡

模板创建

parent c058bf2a
...@@ -5,10 +5,12 @@ ...@@ -5,10 +5,12 @@
<div class="tasklist"> <div class="tasklist">
<div class="task-item" v-for="(item, index) in tasks" :key='index'> <div class="task-item" v-for="(item, index) in tasks" :key='index'>
<div>{{item.name}}</div> <div>{{item.name}}</div>
<div>发布者:{{item.creator}}&emsp;&emsp;发布时间:{{item.date|formatDate}}&emsp;&emsp;任务状态:已发布 <div>发布者:{{item.creator}}&emsp;&emsp;发布时间:{{item.date|formatDate}}&emsp;&emsp;任务状态:{{item.state}}
</div>
<div>
<el-button class="task-enter-btn2" type="primary" plain @click="revise(item.id)">修改</el-button>
<el-button class="task-enter-btn1" @click="deleteRow(index, item.id)" type="primary" plain>删除</el-button>
</div> </div>
<el-button class="task-enter-btn2" type="primary" plain @click="revise(item.id)">修改</el-button>
<el-button class="task-enter-btn1" @click="deleteRow(index, item.id)" type="primary" plain>删除</el-button>
</div> </div>
</div> </div>
<navigator v-model="tasks" :condition="condition"></navigator> <navigator v-model="tasks" :condition="condition"></navigator>
......
...@@ -42,9 +42,9 @@ ...@@ -42,9 +42,9 @@
<el-select v-model="domain.piecesOptions" placeholder="模板选择" > <el-select v-model="domain.piecesOptions" placeholder="模板选择" >
<el-option <el-option
v-for="i in pOptions" v-for="i in pOptions"
:key="i.pvalue" :key="i.templateId"
:label="i.plabel" :label="i.templateName"
:value="i.pvalue"> :value="i.templateId">
</el-option> </el-option>
<el-option> <el-option>
<el-button type="text" @click="dialogFormVisible = true">自定义模板</el-button> <el-button type="text" @click="dialogFormVisible = true">自定义模板</el-button>
...@@ -174,7 +174,7 @@ ...@@ -174,7 +174,7 @@
<el-dialog title="自定义模板" :visible.sync="dialogFormVisible"> <el-dialog title="自定义模板" :visible.sync="dialogFormVisible">
<el-form :model="form"> <el-form :model="form">
<el-form-item label="模板名称" :label-width="formLabelWidth"> <el-form-item label="模板名称" :label-width="formLabelWidth">
<el-input v-model="this.templateName" autocomplete="off"></el-input> <el-input v-model="form.name" autocomplete="off"></el-input>
</el-form-item> </el-form-item>
<input v-model="mm" placeholder="输入实体或属性"> <input v-model="mm" placeholder="输入实体或属性">
<!-- 树状结构--> <!-- 树状结构-->
...@@ -205,8 +205,8 @@ ...@@ -205,8 +205,8 @@
</div> </div>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="rePage">取 消</el-button> <el-button @click="rePage(0)">取 消</el-button>
<el-button type="primary" @click="rePage">确 定</el-button> <el-button type="primary" @click="rePage(1)">确 定</el-button>
</div> </div>
</el-dialog> </el-dialog>
</el-main> </el-main>
...@@ -293,14 +293,14 @@ ...@@ -293,14 +293,14 @@
}, },
formLabelWidth: '120px', formLabelWidth: '120px',
pOptions: [{ pOptions: [{
pvalue: '1', templateId: '1',
plabel: '模板1' templateName: '模板1'
}, { }, {
pvalue: '2', templateId: '2',
plabel: '模板2' templateName: '模板2'
}, { }, {
pvalue: '3', templateId: '3',
plabel: '模板3' templateName: '模板3'
}], }],
dynamicValidateForm: { dynamicValidateForm: {
//domains--文本信息 //domains--文本信息
...@@ -361,6 +361,20 @@ ...@@ -361,6 +361,20 @@
} }
}) })
} }
// this.axios({
// method:"GET",
// url:'/textAnnotation/getTemplated',
// params:{
// userId:this.uesrInfo.userId;
// }
// }).then(res=>{
// if(res.code == 1){
// this.pOptions = res.message;
// }
// else{
// alert("加载错误!!!");
// }
// })
},200); },200);
}, },
computed:{ computed:{
...@@ -601,7 +615,7 @@ ...@@ -601,7 +615,7 @@
if(ptype == 1){ if(ptype == 1){
this.dynamicValidateForm.domains.push({ this.dynamicValidateForm.domains.push({
fileList:new Array(), fileList:new Array(),
pvalue:'1', templateId:'1',
pname:'', pname:'',
createMode:false, createMode:false,
key: Date.now() key: Date.now()
...@@ -652,32 +666,40 @@ ...@@ -652,32 +666,40 @@
const parent = node.parent; const parent = node.parent;
const children = parent.data.children || parent.data; const children = parent.data.children || parent.data;
const index = children.findIndex(d => d.id === data.id); const index = children.findIndex(d => d.id === data.id);
if(index == 0){ if(node.id == 1){
alert("无法删除根模板"); alert("无法删除根模板");
return; return;
} }
children.splice(index, 1); children.splice(index, 1);
}, },
rePage(ins){ rePage(ins){
console.log("inin");
//确定创建模板 //确定创建模板
if(ins == 1){ if(ins == 1){
this.axios({ this.axios({
methode:'post', method:'POST',
url:'http://127.0.0.1:9100/api/textAnnotation/createTemplated', url:'/textAnnotation/createTemplated',
data:{ data:{
templateId:this.pOptions.length, templateId:this.pOptions.length,
templateName:this.tempalteName, templateName:this.form.name,
templateType:0, templateType:0,
createrId:this.userInfo.userId, creatorId:this.userInfo.userId,
entityList:this.entityList, entityList:this.entityList,
}, },
}).then(res=>{ }).then(res=>{
console.log(res);
if(res.code == 1){
this.pOptions = res.message;
}
else{
alert("模板创建失败");
}
this.dialogFormVisible = false;
}) })
} }
console(this.pOptions);
// // alert("111"); // // alert("111");
dialogFormVisible :false; //location.reload();
location.reload();
}, },
} }
} }
......
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