日志模型修复

dev_2022-03-03
Jo 3 years ago
parent 422498ecd4
commit df328fca73
  1. 2
      src/components/Sidebar.vue
  2. 2
      src/setting.js
  3. 72
      src/views/data/Data.vue
  4. 180
      src/views/data/Framework.vue
  5. 119
      src/views/data/Introduce.vue
  6. 122
      src/views/data/Product.vue
  7. 43
      src/views/serve/addModel.vue
  8. 20
      src/views/serve/backstage/index.vue
  9. 13
      src/views/serve/backstage/model.vue
  10. 226
      src/views/serve/projectList.vue
  11. 13
      src/views/system/addLog.vue
  12. 26
      src/views/system/manageLog.vue

@ -99,7 +99,7 @@ export default {
},
watch:{
"$route.path":function(val){
this.items.map(e=>{
this.menuList.map(e=>{
if(val.replace('/', '')===e.index){
this.handleSelect(val.replace('/', ''))
this.$forceUpdate();

@ -13,7 +13,7 @@ if (isDev) {
// jumpPath = "http://39.108.250.202/judgmentPoint/";
jumpPath = "http://192.168.31.125:8087/"; // 本地调试-需要启动本地判分点系统
// host = "http://www.huorantech.cn:9000";//线上
host = "http://39.108.250.202:9000";//测试
host = "http://39.108.250.202:9000/";//测试
// host = 'http://192.168.31.151:9000/'// 榕
// host = 'http://192.168.31.137:9000'// 赓
} else if (isTest) {

@ -1,18 +1,12 @@
<template>
<div class="wrap">
<div class="page data">
<div class="tabs" v-if="showTabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{item}}</a>
</div>
<div class="score-table" v-if="active == 'first'">
<Product></Product>
</div>
<div class="score-table" v-else-if="active == 'second'">
<Framework></Framework>
</div>
<div class="score-table" v-else>
<Introduce></Introduce>
</div>
<Product v-if="active == 'first'"></Product>
<Framework v-else-if="active == 'second'"></Framework>
<Introduce v-else></Introduce>
</div>
</template>
@ -65,60 +59,8 @@ export default {
</script>
<style lang="scss" scoped>
.wrap {
width: 100%;
box-shadow: 0px 0px 21px 0px rgba(48, 115, 248, 0.1);
text-align: center;
overflow: hidden;
.header {
width: 97%;
display: flex;
justify-content: space-between;
margin: 0 auto;
margin-top: 16px;
p {
margin-top: 14px;
font-size: 20px;
font-family: MicrosoftYaHeil;
color: #333333;
}
}
.score-table {
margin: 18px auto 0;
position: relative;
.block {
position: absolute;
right: 0px;
bottom: -50px;
}
}
.el-pagination.is-background .el-pager li:not(.disabled).active {
background-color: #9278ff;
color: #fff;
}
}
/deep/.tabs{
display: flex;
align-items: center;
padding: 20px 1.5% 20px;
margin: 0;
z-index: 999;
background-color: #fff;
.item{
padding: 12px 20px;
margin-right: 10px;
color:#606266;
line-height: 1;
border-radius: 4px;
background-color: #fff;
border: 1px solid #dcdfe6;
cursor: pointer;
&.active{
color: #fff;
background-color: #9278ff;
border-color: #9278ff;
}
}
.data {
min-height: 100%;
padding: 0;
}
</style>

@ -1,70 +1,66 @@
<template>
<div class="wrap">
<el-container>
<!-- 左边的分类 -->
<el-aside width="300px">
<div class="plus">
<i class="el-icon-circle-plus-outline" @click.stop="addType(0)"></i>
</div>
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :title="node.label">{{ node.label }}</span>
<span class="actions">
<i class="el-icon-circle-plus-outline" @click.stop="addType(node)" v-if="data.level != 6" v-auth="'/data:数据架构:新增分类'"></i>
<i class="el-icon-edit" @click.stop="editType(node)" v-auth="'/data:数据架构:编辑分类'"></i>
<i class="el-icon-delete" @click.stop="delType(node)" v-auth="'/data:数据架构:删除分类'"></i>
</span>
<div class="side">
<div class="plus">
<i class="el-icon-circle-plus-outline" @click.stop="addType(0)"></i>
</div>
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick">
<span class="custom-tree-node" slot-scope="{ node, data }">
<span :title="node.label">{{ node.label }}</span>
<span class="actions">
<i class="el-icon-circle-plus-outline" @click.stop="addType(node)" v-if="data.level != 6" v-auth="'/data:数据架构:新增分类'"></i>
<i class="el-icon-edit" @click.stop="editType(node)" v-auth="'/data:数据架构:编辑分类'"></i>
<i class="el-icon-delete" @click.stop="delType(node)" v-auth="'/data:数据架构:删除分类'"></i>
</span>
</el-tree>
</el-aside>
<!-- 右边的表 -->
<el-main style="padding-top: 0">
<el-card class="main-wrap" shadow="hover">
<el-form label-width="80px" class="flex-between mgb20">
<div class="flex-center">
<el-form-item label="更新时间" style="margin: 0 20px 0 0">
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initData"></el-date-picker>
</el-form-item>
<el-input placeholder="请输入数据表名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input>
</div>
<div>
<el-button type="primary" round @click="batchImport" v-auth="'/data:数据架构:导入数据'">导入数据</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth="'/data:数据架构:批量删除'">批量删除</el-button>
</div>
</el-form>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="tableComment" label="数据表名称" align="center">
<template slot-scope="scope">
{{scope.row.tableComment ? scope.row.tableComment : scope.row.showName}}
</template>
</el-table-column>
<el-table-column prop="showName" label="产品表名称" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止日期" width="180" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="100" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="100" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="180" align="center"></el-table-column>
<el-table-column label="操作" width="260" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth="'/data:数据架构:预览'">预览</el-button>
<el-button type="text" @click="delTable(scope.row)" v-auth="'/data:数据架构:删除'">删除</el-button>
<el-button type="text" @click="editName(scope.row)" v-auth="'/data:数据架构:编辑产品表名'">编辑产品表名</el-button>
<el-button type="text" @click="editHead(scope.row)" v-auth="'/data:数据架构:编辑产品表头'">编辑产品表头</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total">
</el-pagination>
</div>
</el-card>
</el-main>
</el-container>
</span>
</el-tree>
</div>
<!-- 右边的表 -->
<div class="right">
<el-form label-width="80px" class="flex-between mgb20">
<div class="flex-center">
<el-form-item label="更新时间" style="margin: 0 20px 0 0">
<el-date-picker v-model="updateTime" type="date" placeholder="选择日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" @change="initData"></el-date-picker>
</el-form-item>
<el-input placeholder="请输入数据表名称" v-model="keyword" prefix-icon="el-icon-search" clearable></el-input>
</div>
<div>
<el-button type="primary" round @click="batchImport" v-auth="'/data:数据架构:导入数据'">导入数据</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth="'/data:数据架构:批量删除'">批量删除</el-button>
</div>
</el-form>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="70" label="序号" align="center"></el-table-column>
<el-table-column prop="tableComment" label="数据表名称" align="center">
<template slot-scope="scope">
{{scope.row.tableComment ? scope.row.tableComment : scope.row.showName}}
</template>
</el-table-column>
<el-table-column prop="showName" label="产品表名称" align="center"></el-table-column>
<el-table-column prop="timeRange" label="起止日期" width="180" align="center"></el-table-column>
<el-table-column prop="dataTotal" label="数据总量" width="100" align="center"></el-table-column>
<el-table-column prop="dataSize" label="数据大小" width="100" align="center">
<template slot-scope="scope">
{{scope.row.dataSize}}M
</template>
</el-table-column>
<el-table-column prop="updateTime" label="更新时间" width="180" align="center"></el-table-column>
<el-table-column label="操作" width="260" align="center">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth="'/data:数据架构:预览'">预览</el-button>
<el-button type="text" @click="delTable(scope.row)" v-auth="'/data:数据架构:删除'">删除</el-button>
<el-button type="text" @click="editName(scope.row)" v-auth="'/data:数据架构:编辑产品表名'">编辑产品表名</el-button>
<el-button type="text" @click="editHead(scope.row)" v-auth="'/data:数据架构:编辑产品表头'">编辑产品表头</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" :current-page="page" @current-change="handleCurrentChange" :total="total">
</el-pagination>
</div>
</div>
<!-- 导入数据 -->
<el-dialog title="导入" :visible.sync="importVisible" width="80%" center @close="closeImport" class="dialog" :close-on-click-modal="false">
<el-container style="padding: 20px 0 20px 20px;background-color: #f0f0f0;">
@ -740,39 +736,35 @@ export default {
};
</script>
<style lang="scss" scoped>
.wrap, .el-container{
min-height: calc(100vh - 290px);
}
.el-aside, .main-wrap{
height: calc(100vh - 290px);
overflow: auto;
}
/deep/.el-container{
height: 100%;
padding-bottom: 0;
.el-aside{
padding: 15px;
background-color: #fff;
.plus{
text-align: right;
color: #9278FF;
cursor: pointer;
}
.custom-tree-node{
flex: 1;
display: inline-flex;
justify-content: space-between;
align-items: center;
.actions{
i{
margin-left: 5px;
color: #9278FF;
}
.wrap {
display: flex;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 374px);
padding: 24px 0;
}
.plus{
text-align: right;
color: #9278FF;
cursor: pointer;
}
.custom-tree-node{
flex: 1;
display: inline-flex;
justify-content: space-between;
align-items: center;
.actions{
i{
margin-left: 5px;
color: #9278FF;
}
}
}
.el-main{
height: 100%;
}
}
</style>

@ -1,56 +1,52 @@
<template>
<div>
<el-container>
<el-aside width="350px">
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick"></el-tree>
</el-aside>
<div class="wrap">
<div class="side">
<el-tree ref="type" :data="typeList" node-key="id" accordion :default-expanded-keys="defaultActive" :current-node-key="categoryId" :props="defaultProps" :highlight-current="true" @current-change="typeClick"></el-tree>
</div>
<el-main style="padding-top: 0">
<el-card shadow="hover" class="card">
<div class="flex-between" style="margin-bottom: 10px;">
<p>数据简介</p>
<el-button v-if="introduceText && !editing" type="primary" @click="editing = !editing" v-auth="'/data:数据简介:编辑'">编辑</el-button>
</div>
<div class="intro" v-if="!introduceText && !editing">
<p class="text">请添加简介</p>
<div class="btn">
<el-button type="primary" @click="edit">添加</el-button>
</div>
</div>
<template v-if="introduceText || editing">
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
<div class="field">
<p class="label">数据源</p>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
</div>
</template>
<div class="field">
<p class="label">关键字</p>
<div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<span v-if="editing">
<el-button @click="save" style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
</span>
</div>
<div class="tag-wrap">
<el-tag
:key="tag.id"
:type="editing ? '' : 'info'"
v-for="tag in keywordList"
:closable="editing"
:disable-transitions="false"
@close="delKeyword(tag)">
{{tag.keyword}}
</el-tag>
</div>
</div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmData"> </el-button>
</div>
</el-card>
</el-main>
</el-container>
<div class="right">
<div class="flex-between" style="margin-bottom: 10px;">
<p>数据简介</p>
<el-button v-if="introduceText && !editing" type="primary" @click="editing = !editing" v-auth="'/data:数据简介:编辑'">编辑</el-button>
</div>
<div class="intro" v-if="!introduceText && !editing">
<p class="text">请添加简介</p>
<div class="btn">
<el-button type="primary" @click="edit">添加</el-button>
</div>
</div>
<template v-if="introduceText || editing">
<el-input placeholder="请输入简介" v-model="introduce" type="textarea" rows="5" :disabled="!editing"></el-input>
<div class="field">
<p class="label">数据源</p>
<el-input style="width: 250px" placeholder="请输入数据源" v-model="dataSource" type="text" :disabled="!editing"></el-input>
</div>
</template>
<div class="field">
<p class="label">关键字</p>
<div class="tag-add" v-if="editing">
<el-input placeholder="请输入关键字" size="small" v-model="newKeyword"></el-input>
<span v-if="editing">
<el-button @click="save" style="color: #9076FF;border: 1px solid #9076FF;border-radius:5px;height: 25px;line-height: 0px"> </el-button>
</span>
</div>
<div class="tag-wrap">
<el-tag
:key="tag.id"
:type="editing ? '' : 'info'"
v-for="tag in keywordList"
:closable="editing"
:disable-transitions="false"
@close="delKeyword(tag)">
{{tag.keyword}}
</el-tag>
</div>
</div>
<div class="btns" v-if="editing">
<el-button @click="editing = false"> </el-button>
<el-button type="primary" @click="confirmData"> </el-button>
</div>
</div>
</div>
</template>
<script>
@ -214,15 +210,18 @@ export default {
};
</script>
<style lang="scss" scoped>
.el-aside, .card {
height: calc(100vh - 290px);
overflow: auto;
}
/deep/.el-container{
background-color: #f0f0f0;
.el-aside{
padding: 15px;
background-color: #fff;
.wrap {
display: flex;
padding: 0 24px;
.side {
width: 300px;
padding: 24px 10px 24px 0;
margin-right: 24px;
border-right: 1px solid rgba(0, 0, 0, 0.06);
}
.right {
width: calc(100% - 374px);
padding: 24px 0;
}
.intro{
padding: 20px;

@ -1,68 +1,56 @@
<template>
<div>
<el-card shadow="hover" class="mgb20">
<div class="page">
<h6 class="p-title">筛选</h6>
<div class="tool">
<ul class="filter">
<li>
<label>创建日期</label>
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</li>
<li>
<label>状态</label>
<el-select v-model="status" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</li>
</ul>
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
<div>
<el-form label-width="80px" class="flex-between">
<div class="flex-center no-mb">
<el-form-item label="创建日期">
<el-date-picker v-model="date" align="right" unlink-panels type="daterange" start-placeholder="开始日期" end-placeholder="结束日期" format="yyyy-MM-dd" value-format="yyyy-MM-dd" clearable></el-date-picker>
</el-form-item>
<el-form-item label="状态">
<el-select v-model="status" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in statusList" :key="index" :label="item.name" :value="item.value"></el-option>
</el-select>
</el-form-item>
</div>
<el-form-item>
<el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</el-form-item>
</el-form>
</div>
</div>
</el-card>
<el-card shadow="hover" class="card">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>产品列表</span>
</div>
<div>
<el-button type="primary" round @click="add" v-auth="'/data:产品管理:新增'">新增</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth="'/data:产品管理:批量删除'">批量删除</el-button>
</div>
<el-input placeholder="请输入产品名称" prefix-icon="el-icon-search" v-model="keyword" clearable></el-input>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="tableNum" label="数据量(表)" align="center"></el-table-column>
<el-table-column prop="userName" label="创建人" align="center"></el-table-column>
<el-table-column prop="orderNum" label="订单数量" align="center"></el-table-column>
<el-table-column prop="market" label="市场价(元)" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="orderNature" label="状态" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-text="scope.row.status ? '上架' : '下架'" :active-value="1" :inactive-value="0" @change="switchOff($event,scope.row,scope.$index)" v-auth="'/data:产品管理:上架'"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth="'/data:产品管理:预览'">预览</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth="'/data:产品管理:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/data:产品管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" :current-page="page" :total="totals"></el-pagination>
</div>
<div class="tool">
<div></div>
<div>
<el-button type="primary" round @click="add" v-auth="'/data:产品管理:新增'">新增</el-button>
<el-button type="primary" round @click="delAllSelection" v-auth="'/data:产品管理:批量删除'">批量删除</el-button>
</div>
</el-card>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" @selection-change="handleSelectionChange" row-key="id">
<el-table-column type="selection" width="55" align="center" :reserve-selection="true"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center"></el-table-column>
<el-table-column prop="productName" label="产品名称" align="center"></el-table-column>
<el-table-column prop="tableNum" label="数据量(表)" align="center"></el-table-column>
<el-table-column prop="userName" label="创建人" align="center"></el-table-column>
<el-table-column prop="orderNum" label="订单数量" align="center"></el-table-column>
<el-table-column prop="market" label="市场价(元)" align="center"></el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="orderNature" label="状态" align="center">
<template slot-scope="scope">
<el-switch v-model="scope.row.status" :active-text="scope.row.status ? '上架' : '下架'" :active-value="1" :inactive-value="0" @change="switchOff($event,scope.row,scope.$index)" v-auth="'/data:产品管理:上架'"></el-switch>
</template>
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="preview(scope.row)" v-auth="'/data:产品管理:预览'">预览</el-button>
<el-button type="text" @click="edit(scope.row)" v-auth="'/data:产品管理:编辑'">编辑</el-button>
<el-button type="text" @click="handleDelete(scope.row)" v-auth="'/data:产品管理:删除'">删除</el-button>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background layout="total, prev, pager, next" @current-change="handleCurrentChange" :current-page="page" :total="totals"></el-pagination>
</div>
<el-dialog :title="isDetail ? '查看产品' : (id ? '编辑产品' : '新增产品')" :visible.sync="productVisible" width="30%" center @close="closeProduct" class="dialog" :close-on-click-modal="false">
<el-form ref="form" label-width="98px" :disabled="isDetail">
@ -635,21 +623,9 @@ export default {
</script>
<style lang="scss" scoped>
.card {
min-height: calc(100vh - 420px);
}
/deep/ .no-mb .el-form-item{
margin-bottom: 0;
}
/deep/.el-input--suffix .el-input__inner{
padding-right: 56px;
}
/deep/.el-container{
.el-aside{
padding: 15px;
background-color: #fff;
}
}
.type-wrap{
height: 450px;
overflow:auto;

@ -16,16 +16,18 @@
<el-card shadow="hover">
<el-form label-width="80px" :disabled="isDetail">
<el-form-item label="模型名称">
<div class="item name">
<label>模型名称</label>
<el-input placeholder="请输入模型名称" v-model="form.modelName" maxlength="25" style="width: 400px"></el-input>
</el-form-item>
<el-form-item label="模型代码">
</div>
<div class="item code">
<label>模型代码</label>
<codemirror
:key="codeKey"
:code.sync="form.modelDemo"
:readOnly="isDetail"
></codemirror>
</el-form-item>
</div>
</el-form>
</el-card>
</div>
@ -46,7 +48,8 @@ export default {
modelName: '',
modelDemo: ''
},
codeKey: 1
codeKey: 1,
submiting: false
};
},
mounted() {
@ -75,10 +78,12 @@ export default {
},
//
submit(postStatus){
if (this.submiting) return false
const { modelName, modelDemo } = this.form
const id = this.id
if (!modelName) return this.$message.error('请输入模型名称')
if (!modelDemo) return this.$message.error('请输入模型代码')
this.submiting = true
const data = {
categoryId: this.categoryId,
modelName,
@ -90,12 +95,16 @@ export default {
this.$post(this.api.updateSysModelDemo, data).then(res => {
this.$message.success('编辑成功')
this.$router.back()
}).catch(res => {})
}).catch(res => {
this.submiting = false
})
} else {
this.$post(this.api.saveSysModelDemo, data).then(res => {
this.$message.success('新增成功')
this.$router.back()
}).catch(res => {})
}).catch(res => {
this.submiting = false
})
}
},
}
@ -103,5 +112,23 @@ export default {
</script>
<style lang="scss" scoped>
.item {
display: flex;
margin-bottom: 20px;
label {
padding: 0 15px 0 20px;
}
&.name {
align-items: center;
label {
text-align: right;
}
}
&.code {
flex-direction: column;
label {
margin-bottom: 15px;
}
}
}
</style>

@ -1,11 +1,16 @@
<template>
<div class="page" style="padding: 0">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<div>
<el-card shadow="hover" class="mgb20">
<el-page-header :content="'系统后台 / '+ $route.query.name" @back="back"></el-page-header>
</el-card>
<div class="page" style="padding: 0">
<div class="tabs">
<a class="item" v-for="(item,index) in tabs" :key="index" :class="{active: index == active}" @click="tabChange(index)">{{ item }}</a>
</div>
<model v-if="active == 'model'"></model>
<sourceModel v-if="active == 'sourceModel'"></sourceModel>
<model v-if="active == 'model'"></model>
<sourceModel v-if="active == 'sourceModel'"></sourceModel>
</div>
</div>
</template>
@ -40,6 +45,9 @@ export default {
type: index
}
})
},
back() {
this.$router.push('/configure')
}
}
};

@ -72,7 +72,8 @@ export default {
multipleSelection: [],
modelVisible: false,
modelLoading: false,
modelData: []
modelData: [],
submiting: false
};
},
components: {
@ -211,10 +212,13 @@ export default {
},
//
submit() {
if (this.submiting) return false
const data = []
const systemId = this.systemId
const list = this.$refs.model.getCheckedNodes() //
const categoryId = this.$refs.tree.$refs.tree.getCurrentKey() //
if (!list.length) return this.$message.error('请选择模型')
this.submiting = true
list.map(e => {
// categoryId
e.categoryId && data.push({
@ -226,7 +230,12 @@ export default {
this.$post(this.api.saveReferenceDemo, data).then(res => {
this.modelVisible = false
this.initData()
}).catch(res => {})
setTimeout(() => {
this.submiting = false
}, 2000)
}).catch(res => {
this.submiting = false
})
}
}
};

@ -1,124 +1,116 @@
<template>
<div>
<el-row :gutter="20">
<el-col :span="24">
<el-card v-if="showBack" shadow="hover" class="mgb20">
<el-page-header :content="'实验项目管理 / '+titleName" @back="goBack"></el-page-header>
</el-card>
</el-col>
<el-card v-if="showBack" shadow="hover" class="mgb20">
<el-page-header :content="'实验项目管理 / '+titleName" @back="goBack"></el-page-header>
</el-card>
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
</div>
<div>
<el-form label-width="80px">
<el-col :span="4">
<el-form-item label="创建人">
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人"
@change="initData">
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="状态">
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="权限">
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in permissionsList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search"
v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</el-card>
</el-col>
<el-card shadow="hover" class="mgb20">
<div>
<div class="flex-center mgb20">
<p class="hr_tag"></p>
<span>筛选</span>
</div>
</div>
<div>
<el-form label-width="80px">
<el-col :span="4">
<el-form-item label="创建人">
<el-select v-model="queryData.founder" clearable placeholder="请选择创建人"
@change="initData">
<el-option v-for="(item,index) in founderList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="状态">
<el-select v-model="queryData.state" clearable placeholder="请选择状态" @change="initData">
<el-option v-for="(item,index) in stateList" :key="index" :label="item.label"
:value="item.value"></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="4">
<el-form-item label="权限">
<el-select v-model="queryData.permissions" placeholder="请选择" @change="initData">
<el-option
v-for="item in permissionsList"
:key="item.value"
:label="item.label"
:value="item.value"
></el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6">
<el-form-item>
<el-input placeholder="请输入项目名称" prefix-icon="el-icon-search"
v-model="keyword" clearable></el-input>
</el-form-item>
</el-col>
</el-form>
</div>
</el-card>
<el-col :span="24">
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>项目列表</span>
</div>
<div>
<el-button type="primary" round @click="add" class="mag">新增项目</el-button>
<el-button type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="projectId"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center"></el-table-column>
<el-table-column v-if='queryData.founder == 1' prop="schoolName" label="学校名字" align="center"></el-table-column>
<el-table-column prop="founder" label="创建人" align="center">
<template slot-scope="scope">
{{ founderKeys[scope.row.founder] }}
</template>
</el-table-column>
<el-table-column label="权限" align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">
编辑
</el-button>
<el-button type="text" @click="handleDelete(scope.row.projectId)">
删除
</el-button>
<el-button type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-model="scope.row.ztOpen"
:active-text="scope.row.ztOpen ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff(scope.row)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</el-card>
</el-col>
</el-row>
<el-card shadow="hover" class="mgb20">
<div class="flex-between mgb20">
<div class="flex-center">
<p class="hr_tag"></p>
<span>项目列表</span>
</div>
<div>
<el-button type="primary" round @click="add" class="mag">新增项目</el-button>
<el-button type="primary" round @click="delAllData">批量删除</el-button>
</div>
</div>
<el-table :data="listData" class="table" ref="table" stripe header-align="center" row-key="projectId"
@selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center"></el-table-column>
<el-table-column type="index" width="100" label="序号" align="center">
<template slot-scope="scope">{{ scope.$index + (page - 1) * pageSize + 1 }}</template>
</el-table-column>
<el-table-column prop="projectName" label="实验项目名称" align="center"></el-table-column>
<el-table-column v-if='queryData.founder == 1' prop="schoolName" label="学校名字" align="center"></el-table-column>
<el-table-column prop="founder" label="创建人" align="center">
<template slot-scope="scope">
{{ founderKeys[scope.row.founder] }}
</template>
</el-table-column>
<el-table-column label="权限" align="center">
<template slot-scope="scope">
{{ permissionsKeys[scope.row.permissions] }}
</template>
</el-table-column>
<el-table-column prop="createTime" label="创建时间" align="center"></el-table-column>
<el-table-column prop="status" label="状态" align="center">
<template slot-scope="scope">
{{ stateKeys[scope.row.state] }}
</template>
</el-table-column>
<el-table-column label="操作" align="center">
<template slot-scope="scope">
<el-button type="text" @click="edit(scope.row)">
编辑
</el-button>
<el-button type="text" @click="handleDelete(scope.row.projectId)">
删除
</el-button>
<el-button type="text" @click="copyData(scope.row.projectId)">复制</el-button>
<el-switch
v-model="scope.row.ztOpen"
:active-text="scope.row.ztOpen ? '关闭' : '启用'"
:active-value="0"
:inactive-value="1"
style="margin: 0 10px 0 10px"
@change="switchOff(scope.row)"
></el-switch>
</template>
</el-table-column>
</el-table>
<div class="pagination">
<el-pagination background @current-change="handleCurrentChange" :current-page="page" layout="total, prev, pager, next" :total="total"></el-pagination>
</div>
</el-card>
<!--复制对话框-->
<el-dialog title="复制" :visible.sync="copyVisible" width="24%" center :close-on-click-modal="false">

@ -103,7 +103,8 @@ export default {
originContent: {
type: '',
content: ''
}
},
submiting: false
};
},
mounted() {
@ -151,10 +152,12 @@ export default {
},
//
submit(draft){
if (this.submiting) return false
const { versionName, logContents } = this.form
const id = this.id
if (!versionName) return this.$message.error('请输入版本标题')
if (!logContents.length || !logContents.find(e => e.type !== '' && e.content)) return this.$message.error('请输入更新内容')
this.submiting = true
const data = {
platformId: this.platformId,
versionName,
@ -168,12 +171,16 @@ export default {
this.$post(this.api.listUpdate, data).then(res => {
this.$message.success('编辑成功')
this.$router.back()
}).catch(res => {})
}).catch(res => {
this.submiting = false
})
} else {
this.$post(this.api.logAdd, data).then(res => {
this.$message.success('新增成功')
this.$router.back()
}).catch(res => {})
}).catch(res => {
this.submiting = false
})
}
},
}

@ -140,15 +140,31 @@ export default {
}).catch(res => {})
}).catch(() => {})
},
//
switchOff(val, row) {
changeStatus(logId, open, draft) {
this.$post(this.api.listUpdate, {
logId: row.logId,
open: val
logId,
open,
draft
}).then(res => {
this.$message.success(val ? '禁用成功' : '启用成功')
this.$message.success(open ? '禁用成功' : '启用成功')
this.getData()
}).catch(res => {})
},
//
switchOff(val, row) {
const logId = row.logId
if (row.draft && !val) {
this.$confirm('是否要发布该日志?', '提示', {
type: 'success'
}).then(() => {
this.changeStatus(logId, val, 0)
}).catch(() => {
this.changeStatus(logId, val, 1)
})
} else {
this.changeStatus(logId, val, row.draft)
}
},
//
verChange(i) {
document.querySelector(`#ver${i}`).scrollIntoView()

Loading…
Cancel
Save