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

1115

上级 bb11a050
......@@ -133,6 +133,14 @@ export function getMetaDataPlanListAPI(params) { //元数据方案列表
})
}
export function updateMetaDataPlanListAPI(data) { //更新元数据方案
return request({
url: `${requestPath.common}/module/update`,
method: 'post',
data
})
}
......
......@@ -7,7 +7,7 @@
<div class="metaDataForm">
<h2>添加元数据方案</h2>
<el-form label-width="86px" :model="formData">
<el-form-item label="资源类型:">
<el-form-item label="资源类型:" v-if="!this.$route.query.flag">
<el-select v-model="formData.type" placeholder="请选择">
<el-option
v-for="item in options"
......@@ -41,8 +41,10 @@
<script>
import {
addNewPlanAPI
addNewPlanAPI,
updateMetaDataPlanListAPI
} from '@/api/resourcecommit'
import { detailsAPI ,addAPI} from '@/api/metadataPlan/index'
export default {
name: 'addnewmetadata',
data() {
......@@ -74,23 +76,36 @@ export default {
getStatusVal(val) {
console.log(val, '22')
if (val) {
alert(1)
this.formData.status = 1;
} else {
alert(0)
this.formData.status = 0;
}
},
metaDataDetail() {
},
saveInfo() {
addNewPlanAPI(this.formData)
.then(res => {
console.log(res, 'YUIIII')
if (res.data.code === 0) {
this.$message.success('添加元数据方案保存成功')
} else {
this.$message.error('添加元数据方案保存失败')
}
})
if (!this.$route.query.flag) {
addNewPlanAPI(this.formData)
.then(res => {
console.log(res, 'YUIIII')
if (res.data.code === 0) {
this.$message.success('添加元数据方案保存成功')
} else {
this.$message.error('添加元数据方案保存失败')
}
})
} else {
updateMetaDataPlanListAPI(this.formData)
.then(res => {
if (res.data.code === 0) {
this.$message.success('更新元数据方案保存成功')
} else {
this.$message.error('更新元数据方案保存失败')
}
})
}
this.$router.back(-1)
}
}
}
......
......@@ -14,7 +14,7 @@
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
{{ item.name.substring(0,1) }}
</dt>
<dd>
<h3>{{ item.name }}</h3>
......@@ -24,7 +24,7 @@
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
<el-button type="primary" icon="el-icon-view" size="mini" @click="lookDetail(item)">查看</el-button>
</div>
</li>
</ul>
......@@ -35,7 +35,7 @@
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
{{ item.name.substring(0,1) }}
</dt>
<dd>
<h3>{{ item.name }}</h3>
......@@ -45,7 +45,7 @@
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
<el-button type="primary" icon="el-icon-view" size="mini" @click="lookDetail(item)">查看</el-button>
</div>
</li>
</ul>
......@@ -56,7 +56,7 @@
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
{{ item.name.substring(0,1) }}
</dt>
<dd>
<h3>{{ item.name }}</h3>
......@@ -66,7 +66,7 @@
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
<el-button type="primary" icon="el-icon-view" size="mini" @click="lookDetail(item)">查看</el-button>
</div>
</li>
</ul>
......@@ -77,7 +77,7 @@
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
{{ item.name.substring(0,1) }}
</dt>
<dd>
<h3>{{ item.name }}</h3>
......@@ -87,7 +87,7 @@
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
<el-button type="primary" icon="el-icon-view" size="mini" @click="lookDetail(item)">查看</el-button>
</div>
</li>
</ul>
......@@ -142,6 +142,15 @@ export default {
this.listData = res.data.data;
}
})
},
lookDetail(item) {
console.log(item, '()(((99')
this.$router.push({
path: 'metadataplan_details',
query: {
id: item.id
}
})
}
}
}
......
......@@ -27,7 +27,7 @@
</div>
</div>
<div class="itme_group item_bottom">
<el-button type="primary" icon="el-icon-edit" class="edit_btn">编辑信息</el-button>
<el-button type="primary" icon="el-icon-edit" class="edit_btn" @click="goEditFun">编辑信息</el-button>
</div>
</div>
</div>
......@@ -246,6 +246,15 @@ export default {
}
this.$refs['addItemForm'].resetFields();
this.getDetail();
},
goEditFun() {
this.$router.push({
path: 'addnewmetadata',
query: {
flag: 1,
id: this.$route.query.id
}
})
}
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论