提交 36d40337 authored 作者: 王腾飞's avatar 王腾飞

1119

上级 8655aa26
......@@ -293,7 +293,8 @@ export default {
path: '/submission/resourcecommit',
query: {
oid: item.id,
resourceType: item.resourceType
resourceType: item.resourceType,
flag: 'look'
}
})
},
......
......@@ -295,7 +295,8 @@ export default {
path: '/submission/resourcecommit',
query: {
oid: item.id,
resourceType: item.resourceType
resourceType: item.resourceType,
flag: 'look'
}
})
},
......
......@@ -295,7 +295,8 @@ export default {
path: '/submission/resourcecommit',
query: {
oid: item.id,
resourceType: item.resourceType
resourceType: item.resourceType,
flag: 'look'
}
})
},
......
......@@ -104,7 +104,8 @@ export default {
}
.mapBox {
width:46.88%;
height:50%;
height:57%;
max-height:680px;
background:#fff;
margin:1.5% auto;
padding:0 30px;
......@@ -120,6 +121,7 @@ export default {
span:nth-of-type(2) {
float:right;
margin-top:16px;
cursor:pointer;
}
}
.el-form {
......
......@@ -44,7 +44,7 @@ import {
addNewPlanAPI,
updateMetaDataPlanListAPI
} from '@/api/resourcecommit'
import { detailsAPI ,addAPI} from '@/api/metadataPlan/index'
import { detailsAPI } from '@/api/metadataPlan/index'
export default {
name: 'addnewmetadata',
data() {
......@@ -54,6 +54,7 @@ export default {
name: null,
status: 1,
type: null,
id: this.$route.query.id
},
options: [{
value: 1,
......@@ -72,6 +73,9 @@ export default {
valueisOn: true,
}
},
mounted() {
this.metaDataDetail();
},
methods: {
getStatusVal(val) {
console.log(val, '22')
......@@ -82,7 +86,22 @@ export default {
}
},
metaDataDetail() {
if (this.$route.query.id) {
detailsAPI(this.$route.query.id)
.then(res => {
console.log(res,'OPPPP')
if (res.data.code === 0) {
this.formData.description = res.data.data.description;
this.formData.name = res.data.data.name;
this.formData.status = res.data.data.status;
if (this.formData.status === 1) {
this.valueisOn = true;
} else {
this.valueisOn = false;
}
}
})
}
},
saveInfo() {
if (!this.$route.query.flag) {
......
......@@ -127,30 +127,34 @@
<div class="formBottom">
<div class="formBottomLeft">
<h2>>自定义元数据项目</h2>
<el-form label-width="110px">
<el-form-item label="论文发表卷期:">
<el-input autocomplete="off" placeholder="论文发表卷期,例如2013年第10期。"></el-input>
</el-form-item>
<el-form-item label="类名:">
<el-input autocomplete="off" placeholder="所属的22个大类。"></el-input>
</el-form-item>
<el-form-item label="子类名:">
<el-input autocomplete="off" placeholder="类名的二级类目名。"></el-input>
</el-form-item>
</el-form>
</div>
<div class="formBottomRight">
<el-select v-model="value" placeholder="请选择">
<el-select v-model="formData.moduleId" placeholder="请选择" @change="changeMetaDataVal" class="specialSelect">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:label="item.name"
:value="item.value">
</el-option>
</el-select>
<el-form label-width="86px">
<el-form-item label="描述/摘要:">
<el-input type="textarea" placeholder="著录者为论文新写的摘要。"></el-input>
<el-form label-width="110px">
<el-form-item :label="item.name + ':'" v-for="(item, key) in fieldJsonData" :key="key">
<el-input autocomplete="off" :placeholder="item.description" v-if="item.type === '1'" v-model="item.metaDataValue"></el-input>
<el-date-picker
style="width:100%;"
v-else-if="item.type === '2'"
v-model="item.metaDataValue"
type="date"
value-format="yyyy-MM-dd"
placeholder="选择日期">
</el-date-picker>
<el-select v-model="item.metaDataValue" placeholder="请选择" v-else-if="item.type === '3'" style="width:100%;">
<el-option
v-for="item1 in item.reallSelectDataArr"
:key="item1.value"
:label="item1.label"
:value="item1.value">
</el-option>
</el-select>
<el-input v-else type="textarea" autocomplete="off" :placeholder="item.description" v-model="item.metaDataValue"></el-input>
</el-form-item>
</el-form>
</div>
......@@ -171,7 +175,15 @@
import mapmark from '../mapmark'
import linkentity from '../linkentity'
import { uploadUrl, uploadPath, requestPath } from "@/utils/global";
import { resourceCommitAPI, resourceDiyTypeAPI, resourceLabelListAPI, editItemAPI, saveEditAPI } from "@/api/resourcecommit";
import {
resourceCommitAPI,
resourceDiyTypeAPI,
resourceLabelListAPI,
editItemAPI,
saveEditAPI,
getMetaDataPlanListAPI
} from "@/api/resourcecommit";
import { detailsAPI } from '@/api/metadataPlan/index'
import { convertTree } from '@/utils/format'
export default {
name: 'resourcecommit',
......@@ -196,6 +208,7 @@ export default {
addressDetail: '',
isShowSavaBtn: false,
isShowSavaBtn1: false,
fieldJsonData: null,
// timeVal: '',
formData: {
resourceType: this.$route.query.resourceType,
......@@ -236,7 +249,10 @@ export default {
],
responsibility: '',
copyright: '',
score: null
score: null,
fieldJson: null,
fieldJsonArr: [],
moduleId: null, //自定义元数据id
},
uploadFileName: null,
rulesOne: {
......@@ -268,24 +284,21 @@ export default {
resourceLabelList: [], //资源标签列表
resourceDiyType: '',
resourceLabel: [],
options: [{
value: '选项1',
label: '黄金糕'
}, {
value: '选项2',
label: '双皮奶'
}, {
value: '选项3',
label: '蚵仔煎'
}, {
value: '选项4',
label: '龙须面'
}, {
value: '选项5',
label: '北京烤鸭'
}],
options: [
// {
// value: '选项1',
// label: '黄金糕'
// }
],
optionsOne: [
// {
// value: '选项1',
// label: '黄金糕'
// }
],
value: '',
value1: [],
dateValue: null,
optionResourceDiyTypeShow: [],//资源分类的数据
optionResourceDiyType: [
// {
......@@ -304,7 +317,9 @@ export default {
this.resourceLabelListAPI();
this.getLookContent();
this.getNowTime();
this.formSixBtn();
//this.formSixBtn();
this.getMetaDataPlanList();
console.log(this.formData.fieldJsonArr, 'XXeeeeeeeeeee')
},
watch: {
$route: {
......@@ -315,7 +330,7 @@ export default {
}
},
deep: true
}
},
},
methods: {
showMark() {
......@@ -339,7 +354,6 @@ export default {
this.isShowLineEntityMark = val;
},
getEntity(val) {
console.log(val, '121212121');
this.entityData = val;
let entityArr = [];
val.map((item, index) => {
......@@ -458,6 +472,8 @@ export default {
})
},
commitResource() {// 提交资源
console.log(this.formData.fieldJsonArr, 'XX')
this.formData.fieldJson = JSON.stringify(this.formData.fieldJsonArr)
const formOne = new Promise((resolve,reject) => {
this.$refs['formOne'].validate(valid=>{
if(valid) resolve()
......@@ -494,9 +510,11 @@ export default {
},
getLookContent() {//查看
if(this.$route.query.oid && this.$route.query.flag) {
this.isShowSavaBtn1 = true;
this.isShowSavaBtn = false;
} else {
this.isShowSavaBtn1 = true;
this.isShowSavaBtn1 = false;
this.isShowSavaBtn = true;
}
if (this.$route.query.oid) {
//this.isShowSavaBtn = true;
......@@ -508,6 +526,12 @@ export default {
this.$nextTick(() => this.$refs.formOne.clearValidate())
this.$nextTick(()=>this.$refs.formTwo.clearValidate())
this.$nextTick(()=>this.$refs.formThree.clearValidate())
if (res.data.data.moduleId) {
this.changeMetaDataVal1(res.data.data.moduleId);
setTimeout(() => {
this.fieldJsonData = JSON.parse(res.data.data.fieldJson);
},100)
}
if (res.data.data.name) {
this.uploadFileName = res.data.data.name;
}
......@@ -533,6 +557,7 @@ export default {
}
},
saveEdit() {//保存编辑
this.formData.fieldJson = JSON.stringify(this.fieldJsonData)
const formOne = new Promise((resolve,reject) => {
this.$refs['formOne'].validate(valid=>{
if(valid) resolve()
......@@ -571,7 +596,54 @@ export default {
console.log(defaultDate,"()***")
this.formData.formationTime = defaultDate;
console.log(this.formData.formationTime,"()***")
},
},
getMetaDataPlanList() {
getMetaDataPlanListAPI()
.then(res => {
console.log(res, '333333');
if (res.data.code === 0) {
this.options = res.data.data;
this.options.map((item, index) => {
this.$set(item, 'value', item.id)
})
}
})
},
changeMetaDataVal1(val) {
console.log(val, '小明不愛學習');
detailsAPI(val)
.then(res => {
console.log(res, '我是根據id查找的詳情');
if (res.data.code === 0) {
this.fieldJsonData = JSON.parse(res.data.data.fieldJson);
}
})
},
changeMetaDataVal(val) {
console.log(val, '小明不愛學習');
detailsAPI(val)
.then(res => {
console.log(res, '我是根據id查找的詳情');
if (res.data.code === 0) {
this.fieldJsonData = JSON.parse(res.data.data.fieldJson);
console.log(this.fieldJsonData, '222222');
this.fieldJsonData.map((item, index) => {
this.$set(item, 'metaDataValue', null)
var itemArr = [];
item.dynamicTags.map((item1, index1) => {
let itemObj = {
value: index1,
label: item1
}
itemArr.push(itemObj)
})
this.optionsOne = itemArr;
this.$set(item, 'reallSelectDataArr', this.optionsOne)
this.formData.fieldJsonArr = this.fieldJsonData;
})
}
})
}
},
beforeRouterLeave(to, from, next) {
from.meta.keepAlive = false;
......@@ -614,12 +686,36 @@ export default {
.formLeft,.formBottomLeft {
margin-right:20px;
}
.formLeft,.formRight,.formBottomLeft,.formBottomRight {
.formLeft,.formRight{
float:left;
width:calc(50% - 10px);
background:#fff;
padding:0 40px;
}
.formBottomLeft {
width:100%;
padding:0 40px;
position:relative;
.specialSelect {
position:absolute;
right:40px;
top:40px;
}
.el-form {
display:flex;
flex-wrap:wrap;
margin-top:80px;
}
.el-form-item {
width:50%;
&:nth-of-type(2n+1) {
width:calc(50% - 40px);
}
&:nth-of-type(2n) {
margin-left:40px;
}
}
}
.formRight, .formLeft {
padding-bottom:26px;
height:758px;
......@@ -630,15 +726,6 @@ export default {
background:#fff;
margin-top:20px;
}
.formBottomRight {
.el-select {
float:right;
margin:28px 0 36px 0;
}
.el-form {
clear:both;
}
}
}
.threeBtn {
width:100%;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论