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

1115

上级 cae896b6
......@@ -117,6 +117,22 @@ export function getlinkedResAPI(params) { //关联实体弹窗的已链接资源
})
}
export function addNewPlanAPI(data) { //新增元数据方案
return request({
url: `${requestPath.common}/module/save`,
method: 'post',
data
})
}
export function getMetaDataPlanListAPI(params) { //元数据方案列表
return request({
url: `${requestPath.common}/module/list`,
method: 'get',
params
})
}
......
......@@ -260,6 +260,16 @@ export const asyncRouterMap = [{
routerIds: ['090401'],
search:true
},
},{
path: 'addnewmetadata',
component: _import('submission/metadatamange/addnewmetadata'),
name: 'addnewmetadata',
meta: {
title: '添加元数据方案',
routerIds: ['090401'],
search:true,
},
hidden: true
}]
}]
},
......
<template>
<div class="addNewPlanBox">
<div class="metaDataTop">
<em>提交新资源</em>
<span>刷新</span>
</div>
<div class="metaDataForm">
<h2>添加元数据方案</h2>
<el-form label-width="86px" :model="formData">
<el-form-item label="资源类型:">
<el-select v-model="formData.type" placeholder="请选择">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="方案名称:">
<el-input autocomplete="off" placeholder="请输入方案名称" v-model="formData.name"></el-input>
</el-form-item>
<el-form-item label="方案描述:">
<el-input type="textarea" v-model="formData.description" placeholder="请输入方案描述"></el-input>
</el-form-item>
<el-form-item label="是否启用:">
<el-switch
v-model="valueisOn"
@change="getStatusVal"
>
</el-switch>
</el-form-item>
</el-form>
<div class="twoBtn">
<el-button type="info" icon="el-icon-close" size="middle" @click="$router.back(-1)">取消</el-button>
<el-button type="primary" icon="el-icon-upload" size="middle" @click="saveInfo">保存</el-button>
</div>
</div>
</div>
</template>
<script>
import {
addNewPlanAPI
} from '@/api/resourcecommit'
export default {
name: 'addnewmetadata',
data() {
return {
formData: {
description: null,
name: null,
status: 1,
type: null,
},
options: [{
value: 1,
label: '文本类资源'
}, {
value: 2,
label: '图像类资源'
}, {
value: 3,
label: '音频类资源'
}, {
value: 4,
label: '视频类资源'
}],
value: '',
valueisOn: true,
}
},
methods: {
getStatusVal(val) {
console.log(val, '22')
if (val) {
alert(1)
this.formData.status = 1;
} else {
alert(0)
this.formData.status = 0;
}
},
saveInfo() {
addNewPlanAPI(this.formData)
.then(res => {
console.log(res, 'YUIIII')
if (res.data.code === 0) {
this.$message.success('添加元数据方案保存成功')
} else {
this.$message.error('添加元数据方案保存失败')
}
})
}
}
}
</script>
<style lang="less" scoped>
.addNewPlanBox {
width:100%;
padding:37px 40px 20px;
display:flex;
flex-direction:column;
height:100%;
}
.metaDataTop {
width:100%;
padding-bottom:23px;
em {
color:#3F4560;
font-size:20px;
font-style:normal;
}
span {
float:right;
width:50px;
font-size:14px;
color:#868BA3;
background:url(../../../assets/img/sx.png) no-repeat;
background-size:12px 12px;
background-position:37px 2px;
}
}
.metaDataForm {
background:#fff;
padding:0 15px;
h2 {
font-size:16px;
color:#222;
font-weight:500;
margin-bottom:30px;
}
.el-select {
width:100%;
}
}
.twoBtn {
text-align:center;
padding-bottom:100px;
margin-top:50px;
}
</style>
\ No newline at end of file
......@@ -5,27 +5,143 @@
<span>刷新</span>
</div>
<div class="metaDataPlanList">
<el-button type="primary" icon="el-icon-plus" size="middle" class="addNewPlanBtn" @click="goAddPage">添加元数据方案</el-button>
<h2>元数据方案列表</h2>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick">
<el-tab-pane label="用户管理" name="first">用户管理</el-tab-pane>
<el-tab-pane label="配置管理" name="second">配置管理</el-tab-pane>
<el-tab-pane label="角色管理" name="third">角色管理</el-tab-pane>
<el-tab-pane label="定时任务补偿" name="fourth">定时任务补偿</el-tab-pane>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick" class="elTab">
<el-tab-pane label="文本" name="first">
<ul>
<li v-for="(item, key) in listData" :key="key">
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
</dt>
<dd>
<h3>{{ item.name }}</h3>
<p>创建者:{{ item.createrName }}</p>
<p>{{ item.description }}</p>
</dd>
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
</div>
</li>
</ul>
</el-tab-pane>
<el-tab-pane label="图像" name="second">
<ul>
<li v-for="(item, key) in listData" :key="key">
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
</dt>
<dd>
<h3>{{ item.name }}</h3>
<p>创建者:{{ item.createrName }}</p>
<p>{{ item.description }}</p>
</dd>
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
</div>
</li>
</ul>
</el-tab-pane>
<el-tab-pane label="音频" name="third">
<ul>
<li v-for="(item, key) in listData" :key="key">
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
</dt>
<dd>
<h3>{{ item.name }}</h3>
<p>创建者:{{ item.createrName }}</p>
<p>{{ item.description }}</p>
</dd>
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
</div>
</li>
</ul>
</el-tab-pane>
<el-tab-pane label="视频" name="fourth">
<ul>
<li v-for="(item, key) in listData" :key="key">
<dl>
<dt>
<!-- <img src="../../../assets/img/default.png" alt=""> -->
</dt>
<dd>
<h3>{{ item.name }}</h3>
<p>创建者:{{ item.createrName }}</p>
<p>{{ item.description }}</p>
</dd>
</dl>
<div>
<p>{{ item.createTime}}</p>
<el-button type="primary" icon="el-icon-view" size="mini">查看</el-button>
</div>
</li>
</ul>
</el-tab-pane>
</el-tabs>
</div>
</div>
</template>
<script>
import {
getMetaDataPlanListAPI
} from '@/api/resourcecommit'
export default {
name: 'metadataplan',
data() {
return {
activeName: 'first'
activeName: 'first',
typeData: {
type: 1,
},
listData: []
}
},
mounted() {
this.getMetaDataPlanList();
},
methods: {
handleClick(tab, event) {
console.log(tab, event);
console.log(tab, event, 'KLLL');
if (tab.index === '0') {
this.typeData.type = 1;
} else if (tab.index === '1') {
this.typeData.type = 2;
} else if (tab.index === '2') {
this.typeData.type = 3;
} else {
this.typeData.type = 4;
}
this.getMetaDataPlanList();
},
goAddPage() {
this.$router.push({
path: 'addnewmetadata'
})
},
getMetaDataPlanList() {
getMetaDataPlanListAPI(this.typeData)
.then(res => {
console.log(res, '没错,我就是最帅的列表了')
if (res.data.code === 0) {
this.listData = res.data.data;
}
})
}
}
}
......@@ -39,6 +155,7 @@ export default {
flex-direction:column;
height:100%;
}
.metaDataTop {
width:100%;
padding-bottom:23px;
......@@ -57,4 +174,84 @@ export default {
background-position:37px 2px;
}
}
.metaDataPlanList {
position:relative;
background:#fff;
padding:0 15px;
h2 {
font-size:16px;
color:#222;
font-weight:500;
margin-bottom:30px;
}
}
.addNewPlanBtn {
position:absolute;
right:15px;
top:61px;
z-index:2;
}
.elTab {
ul {
margin-block-start:0;
margin-block-end:0;
padding-inline-start:0;
li {
list-style:none;
display:flex;
align-items:center;
margin-bottom:35px;
padding:15px 0;
dl {
display:flex;
align-items:center;
flex:1;
dt {
width:40px;
height:40px;
border-radius:50%;
text-align:center;
line-height:40px;
background:#2DCEE3;
color:#fff;
img {
width:100%;
height:100%;
border-radius:50%;
}
}
dd {
font-size:14px;
margin-inline-start:0px;
margin-left:20px;
h3 {
font-size:#333;
font-weight:600;
margin-block-start:0em;
margin-block-end:0em;
}
p {
color:#555;
margin-block-start:0em;
margin-block-end:0em;
&:nth-of-type(1) {
margin:10px 0;
}
}
}
}
div {
p {
margin-block-start:0em;
margin-block-end:0em;
color:#00B5B8;
margin-bottom:10px;
}
}
}
}
}
</style>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论