<template>
|
<div class="authorityManagement_box">
|
<My-bread
|
:list="[
|
`${$t('dataManage.dataManage')}`,
|
`${$t('dataManage.versionManage')}`,
|
]"
|
></My-bread>
|
<el-divider />
|
<div class="searchComp">
|
<el-form ref="ruleForm" :model="ruleForm" :inline="true">
|
<el-form-item :label="$t('dataManage.vmobj.keyword')" prop="name">
|
<el-input
|
v-model="ruleForm.name"
|
:placeholder="$t('common.pleaseInput')"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
@click="onSubmit('ruleForm')"
|
icon="el-icon-search"
|
size="small"
|
>{{ $t('common.iquery') }}</el-button
|
>
|
<el-button
|
@click="InsertFormdialog = true"
|
icon="el-icon-plus"
|
size="small"
|
>{{ $t('common.append') }}</el-button
|
>
|
<el-button
|
@click="resetForm('ruleForm')"
|
icon="el-icon-delete"
|
size="small"
|
>{{ $t('common.empty') }}</el-button
|
>
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="bottom">
|
<div class="leftTree">
|
<ver-dir-tree></ver-dir-tree>
|
</div>
|
<div class="rightTable">
|
<div class="table_box">
|
<el-table :data="tableData" stripe style="width: 100%" height="99%">
|
<!-- <el-table-column type="selection" width="40" /> -->
|
<el-table-column
|
align="center"
|
type="index"
|
:label="$t('dataManage.vmobj.index')"
|
width="70px"
|
/>
|
<el-table-column align="center" prop="id" v-if="false" />
|
<el-table-column
|
align="center"
|
prop="name"
|
:label="$t('dataManage.vmobj.name')"
|
/>
|
<el-table-column
|
align="center"
|
prop="depName"
|
:label="$t('dataManage.vmobj.catalogue')"
|
/>
|
<el-table-column
|
align="center"
|
prop="descr"
|
:label="$t('dataManage.vmobj.describe')"
|
/>
|
<el-table-column
|
align="center"
|
prop="createUser"
|
:label="$t('dataManage.vmobj.createonuser')"
|
/>
|
<el-table-column
|
align="center"
|
prop="createTime"
|
:label="$t('dataManage.vmobj.createontime')"
|
:formatter="formatTime"
|
/>
|
<el-table-column
|
align="center"
|
prop="UpdateUser"
|
:label="$t('dataManage.vmobj.updateonuser')"
|
/>
|
<el-table-column
|
align="center"
|
prop="updateTime"
|
:label="$t('dataManage.vmobj.updateontime')"
|
:formatter="formatTime"
|
/>
|
<el-table-column min-width="150" :label="$t('common.operate')">
|
<template slot-scope="scope">
|
<el-button
|
@click="handleEdit(scope.$index, scope.row)"
|
type="warning"
|
size="small"
|
>{{ $t('common.update') }}</el-button
|
>
|
<el-button
|
@click="handleDelete(scope.$index, scope.row)"
|
type="danger"
|
size="small"
|
>{{ $t('common.delete') }}</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
style="margin-top: 20px; margin-left: 200px"
|
class="pagination_box"
|
>
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="listData.pageIndex"
|
:page-sizes="[10, 20, 30, 40]"
|
:page-size="listData.pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="count"
|
>
|
</el-pagination>
|
</div>
|
</div>
|
</div>
|
<div class="infoBox" v-show="showinfoBox">
|
<el-card class="box-card">
|
<div slot="header" class="clearfix">
|
<span>详细信息</span>
|
<div style="float: right; cursor: pointer">
|
<i class="el-icon-close"></i>
|
</div>
|
</div>
|
<div class="contentBox">
|
<p>数据名称:{{ itemdetail.name }}</p>
|
<el-divider></el-divider>
|
<p>所属目录:{{ itemdetail.path }}</p>
|
<el-divider></el-divider>
|
<p>创建时间:{{ itemdetail.create_time }}</p>
|
<el-divider></el-divider>
|
<p>创建人员:{{ itemdetail.create_user }}</p>
|
<el-divider></el-divider>
|
<p>上传单位:{{ itemdetail.up_unit }}</p>
|
<el-divider></el-divider>
|
<p>数据状态:{{ itemdetail.status }}</p>
|
<el-divider></el-divider>
|
<p>数据版本:{{ itemdetail.version }}</p>
|
</div>
|
</el-card>
|
</div>
|
<el-dialog
|
:title="$t('dataManage.vmobj.editVersion')"
|
:visible.sync="dialogFormVisible"
|
>
|
<el-form :model="upform">
|
<el-form-item
|
:label="$t('dataManage.vmobj.name')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.name" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.catalogue')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="upform.depName"
|
autocomplete="off"
|
disabled
|
></el-input>
|
<el-button style="margin-left: 20px" @click="showVerTree(2)">{{
|
$t('common.choose')
|
}}</el-button>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.describe')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.descr" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="editFromDataClose">{{
|
$t('common.close')
|
}}</el-button>
|
<el-button @click="editFromData" type="primary">{{
|
$t('common.confirm')
|
}}</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog
|
:title="$t('dataManage.vmobj.addVersion')"
|
:visible.sync="InsertFormdialog"
|
>
|
<el-form :model="insertform">
|
<el-form-item
|
:label="$t('dataManage.vmobj.name')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.name" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.catalogue')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="insertform.path"
|
autocomplete="off"
|
disabled
|
></el-input>
|
<el-button style="margin-left: 20px" @click="showVerTree(3)">{{
|
$t('common.choose')
|
}}</el-button>
|
</el-form-item>
|
|
<el-form-item
|
:label="$t('dataManage.vmobj.describe')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.descr" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button @click="insertFromDataClose">{{
|
$t('common.close')
|
}}</el-button>
|
<el-button @click="insertFromData" type="primary">{{
|
$t('common.confirm')
|
}}</el-button>
|
</div>
|
</el-dialog>
|
<div class="leftTrees" v-if="showCata">
|
<div class="treeBox">
|
<ver-dir-trees></ver-dir-trees>
|
</div>
|
<div class="btnBox">
|
<el-button type="primary" size="small" @click="selectCataName">{{
|
$t('common.confirm')
|
}}</el-button>
|
<el-button type="primary" size="small" @click="showCata = false">{{
|
$t('common.close')
|
}}</el-button>
|
</div>
|
</div>
|
</div>
|
</template>
|
|
<script>
|
import {
|
select_Ver_ByPageAndCount,
|
insertVersion,
|
deleteVersion,
|
updateVersion,
|
} from '../../api/api';
|
import verDirTree from './verDirTree.vue';
|
import MyBread from '../../components/MyBread.vue';
|
import verDirTrees from './verDirTrees.vue';
|
import moment from 'moment';
|
export default {
|
name: 'versionManage',
|
components: { MyBread, verDirTree, verDirTrees },
|
data() {
|
return {
|
showCata: false,
|
formLabelWidth: '100px',
|
dialogFormVisible: false,
|
InsertFormdialog: false,
|
showinfoBox: false,
|
itemdetail: {},
|
upform: {},
|
ruleForm: {},
|
insertform: {},
|
tableData: [],
|
count: 0,
|
rowFlag: null,
|
listData: {
|
name: null,
|
depName: null,
|
pageIndex: 1,
|
pageSize: 10,
|
},
|
};
|
},
|
created() {
|
this.getRoleTabelData();
|
},
|
computed: {
|
pathId() {
|
return this.$store.state.cataNode.id;
|
},
|
},
|
methods: {
|
resetForm() {
|
this.ruleForm = {};
|
this.$store.state.verCateNode = {};
|
this.$bus.$emit('clearTressLabel', true);
|
this.getRoleTabelData();
|
},
|
onSubmit() {
|
this.getRoleTabelData();
|
},
|
async getRoleTabelData() {
|
if (this.listData.tab == '') {
|
delete this.listData.tab;
|
}
|
|
this.listData.name = this.ruleForm.name;
|
this.listData.depName = this.$store.state.verCateNode.name;
|
console.log(this.listData);
|
const data = await select_Ver_ByPageAndCount(this.listData);
|
console.log(data);
|
if (data.code != 200) {
|
this.$message.error('列表调用失败');
|
}
|
this.tableData = data.result;
|
this.count = data.count;
|
},
|
handleSizeChange(val) {
|
this.listData.pageSize = val;
|
this.getRoleTabelData();
|
},
|
handleCurrentChange(val) {
|
this.listData.pageIndex = val;
|
this.getRoleTabelData();
|
},
|
showVerTree(res) {
|
this.showCata = true;
|
this.rowFlag = res;
|
},
|
selectCataName() {
|
this.showCata = false;
|
if (this.rowFlag == 3) {
|
this.insertform.path = this.$store.state.verCateNodes.name;
|
this.insertform.dirid = this.$store.state.verCateNodes.id;
|
} else if (this.rowFlag == 2) {
|
this.upform.depName = this.$store.state.verCateNodes.name;
|
this.upform.dirid = this.$store.state.verCateNodes.id;
|
}
|
},
|
editFromDataClose() {
|
this.dialogFormVisible = false;
|
this.upform = {};
|
},
|
async editFromData() {
|
if (this.upform.depName == null) {
|
this.$message({
|
message: '请选择角色所属单位',
|
type: 'warning',
|
});
|
return;
|
}
|
const data = await updateVersion(this.upform);
|
if (data.code == 200) {
|
this.dialogFormVisible = false;
|
this.upform = {};
|
this.$message({
|
message: '修改成功!',
|
type: 'success',
|
});
|
this.getRoleTabelData();
|
} else {
|
this.$message({
|
message: '修改失败!',
|
type: 'warning',
|
});
|
}
|
},
|
insertFromDataClose() {
|
this.InsertFormdialog = false;
|
this.insertform = {};
|
},
|
async insertFromData() {
|
if (this.insertform.dirid == null) {
|
this.$message({
|
message: '请选择角色所属单位',
|
type: 'warning',
|
});
|
return;
|
}
|
const data = await insertVersion(this.insertform);
|
if (data.code == 200) {
|
this.InsertFormdialog = false;
|
this.insertform = {};
|
this.$message({
|
message: '添加成功!',
|
type: 'success',
|
});
|
this.getRoleTabelData();
|
} else {
|
this.$message({
|
message: '添加失败!',
|
type: 'warning',
|
});
|
}
|
},
|
formatTime(row, column) {
|
let date = row[column.property];
|
if (date === undefined || date === null) {
|
return '';
|
}
|
return moment(parseInt(date)).format('YYYY-MM-DD HH:mm:ss');
|
},
|
async handleDelete(index, row) {
|
const data = await deleteVersion(row.id);
|
if (data.code == 200) {
|
this.InsertFormdialog = false;
|
this.$message({
|
message: '删除成功!',
|
type: 'success',
|
});
|
this.getRoleTabelData();
|
} else {
|
this.$message({
|
message: '删除失败!',
|
type: 'warning',
|
});
|
}
|
},
|
handleEdit(index, row) {
|
this.dialogFormVisible = true;
|
this.upform = row;
|
},
|
},
|
watch: {
|
pathId: {
|
immediate: true,
|
handler(val) {},
|
},
|
},
|
};
|
</script>
|
<style lang="less" scoped>
|
//@import url(); 引入公共css类
|
.authorityManagement_box {
|
background: rgb(240, 242, 245);
|
border-radius: 10px;
|
height: 100%;
|
padding: 10px;
|
box-sizing: border-box;
|
.el-input {
|
width: 300px !important;
|
}
|
.leftTrees {
|
position: absolute;
|
z-index: 9999;
|
top: 9%;
|
left: 37%;
|
width: 400px;
|
height: 600px;
|
background: #f0f2f5;
|
border: 1px solid #000;
|
.treeBox {
|
height: 550px;
|
overflow: auto;
|
/deep/ .el-tree-node__content:hover {
|
background-color: rgb(153, 153, 153);
|
}
|
}
|
.btnBox {
|
width: 123px;
|
margin: 10px auto 0;
|
// background-color: red;
|
}
|
}
|
.searchComp {
|
margin: 10px auto;
|
background: #fff;
|
border-radius: 5px;
|
border: 1px solid rgb(202, 201, 204);
|
.el-form-item {
|
margin: 5px;
|
}
|
}
|
.bottom {
|
width: 100%;
|
height: 85%;
|
display: flex;
|
.leftTree {
|
width: 344px;
|
background: #f4f8ff;
|
border-radius: 10px;
|
overflow: auto;
|
}
|
.rightTable {
|
height: 100%;
|
width: 77.8%;
|
// background-color: red;
|
.table_box {
|
width: 100%;
|
height: 93%;
|
margin: 0 auto;
|
overflow: auto;
|
background: #fff;
|
// .el-table {
|
// height: 100%;
|
// }
|
// .el-table /deep/ .el-table__header-wrapper tr th {
|
// background-color: rgb(255, 255, 255) !important;
|
// color: rgb(0, 0, 0);
|
// }
|
// // 修改每行样式:
|
// .el-table /deep/ .el-table__row {
|
// background-color: rgba(255, 255, 255) !important;
|
// color: rgb(0, 0, 0);
|
// }
|
// .el-table /deep/ .el-table__body tr.current-row > td {
|
// background-color: rgb(211, 211, 211) !important;
|
// }
|
// .el-table /deep/ .el-table__body tr:hover > td {
|
// background-color: rgb(211, 211, 211) !important;
|
// }
|
// // 修改表格每行边框的样式:
|
// .el-table /deep/ td,
|
// .el-table /deep/ th.is-leaf {
|
// border-bottom: 1px solid #eee;
|
// border-right: 1px solid #eee;
|
// }
|
// .el-table /deep/ .el-table__cell {
|
// padding: 0;
|
// }
|
// 设置表格每行的高度:
|
// .el-table /deep/ .el-table__header tr,
|
// .el-table /deep/ .el-table__header th {
|
// height: 40px;
|
// }
|
// .el-table__body tr,
|
// .el-table__body td {
|
// height: 40px;
|
// padding: 0;
|
// }
|
// 设置表格边框颜色:
|
|
.el-table--border::after,
|
.el-table--group::after {
|
width: 0;
|
}
|
.el-table::before {
|
height: 0;
|
}
|
// a {
|
// color: #000;
|
// }
|
}
|
}
|
}
|
.infoBox {
|
width: 500px;
|
border: 1px solid #eee;
|
position: absolute;
|
z-index: 100;
|
top: 15%;
|
right: 25%;
|
background-color: #fff;
|
.el-card {
|
background-color: transparent;
|
span {
|
font-size: 16px;
|
font-weight: 600;
|
}
|
}
|
.contentBox {
|
margin: 0 aotu 10px;
|
p {
|
// background-color: #bfa;
|
// margin-bottom: 10px;
|
font-size: 14px;
|
}
|
}
|
}
|
/deep/ .el-dialog {
|
width: 620px !important;
|
margin-top: 10vh !important;
|
}
|
|
/deep/.el-dialog .el-input__inner {
|
width: 300px;
|
}
|
/deep/ .el-dialog__body {
|
padding: 0px 30px;
|
}
|
/deep/ .el-dialog__footer {
|
padding-top: 0 !important;
|
width: 600px;
|
display: flex;
|
margin: 0 auto;
|
justify-content: center;
|
}
|
}
|
</style>
|