<template>
|
<div class="authorityManagement_box">
|
<My-bread :list="[
|
`${$t('dataManage.dataManage')}`,
|
`${$t('dataManage.metadataManage')}`,
|
]"></My-bread>
|
<el-divider />
|
<div class="inquire">
|
<el-form
|
ref="queryForm"
|
:model="queryForm"
|
:inline="true"
|
>
|
<el-form-item>
|
<el-cascader
|
v-model="queryForm.dirid"
|
:show-all-levels="false"
|
:options="companyOption"
|
@change="handleChange"
|
:props="{
|
label: 'name',
|
value: 'id',
|
children: 'children',
|
checkStrictly: true,
|
emitPath: false,
|
}"
|
></el-cascader>
|
</el-form-item>
|
<el-form-item>
|
<el-cascader
|
v-model="queryForm.dirid"
|
:show-all-levels="false"
|
:options="companyOption1"
|
@change="handleChange1"
|
:props="{
|
label: 'name',
|
value: 'id',
|
children: 'children',
|
checkStrictly: true,
|
emitPath: false,
|
}"
|
></el-cascader>
|
</el-form-item>
|
<el-form-item prop="name">
|
<el-input
|
v-model="queryForm.name"
|
:placeholder="$t('common.pleaseInput')"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
@click="queryInfo()"
|
icon="el-icon-search"
|
class="primary"
|
size="small"
|
>{{ $t('common.iquery') }}</el-button>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
@click="resetInfo('queryForm')"
|
icon="el-icon-refresh"
|
type="info"
|
size="small"
|
>{{ $t('common.reset') }}</el-button>
|
</el-form-item>
|
|
<!-- <el-form-item v-if="btnStatus.insert">
|
<el-button
|
type="success"
|
size="small"
|
@click="showAddDialog"
|
icon="el-icon-plus"
|
>{{ $t('common.append') }}</el-button
|
>
|
</el-form-item> -->
|
<el-form-item v-if="btnStatus.delete">
|
<el-button
|
type="danger"
|
size="small"
|
@click="deleteMetaInfo"
|
icon="el-icon-delete"
|
>{{ $t('common.delete') }}</el-button>
|
</el-form-item>
|
<el-form-item v-if="btnStatus.download">
|
<el-button
|
@click="downFormData"
|
icon="el-icon-download"
|
type="success"
|
size="small"
|
>{{ $t('common.download') }}</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="bottom">
|
<!-- <div class="leftTree">
|
<el-tree
|
ref="tree"
|
:props="defaultProps"
|
node-key="id"
|
:data="optionCount"
|
:default-expanded-keys="[1]"
|
:current-node-key="1"
|
:expand-on-click-node="false"
|
:default-expand-all="false"
|
draggable
|
@node-click="handleNodeClick"
|
>
|
|
</span>
|
</el-tree>
|
|
</div> -->
|
<div class="rightTable">
|
<div class="table_box">
|
<el-table
|
:data="tableData"
|
style="width: 100%"
|
@selection-change="handleSelectionChange"
|
height="99%"
|
>
|
<el-table-column
|
type="selection"
|
width="55"
|
/>
|
<el-table-column
|
prop="name"
|
:label="$t('dataManage.vmobj.name')"
|
/>
|
<el-table-column
|
prop="type"
|
:label="$t('dataManage.vmobj.format')"
|
/>
|
<el-table-column
|
prop="sizes"
|
:label="$t('dataManage.vmobj.size')"
|
:formatter="stateFormatSizes"
|
/>
|
<el-table-column
|
prop="depName"
|
:label="$t('dataManage.vmobj.depName')"
|
/>
|
<el-table-column
|
prop="dirName"
|
:label="$t('dataManage.vmobj.dirName')"
|
/>
|
|
<el-table-column :label="$t('dataManage.dataUpObj.tableName')">
|
<template slot-scope="scope">
|
<a @click="detail(scope.row)">{{
|
scope.row.tab
|
}}</a>
|
</template>
|
</el-table-column>
|
|
<el-table-column
|
prop="gather"
|
:label="$t('dataManage.vmobj.gather')"
|
:formatter="formatData"
|
/>
|
<el-table-column
|
prop="describe"
|
:label="$t('dataManage.vmobj.describe')"
|
/>
|
<el-table-column
|
prop="uname"
|
:label="$t('dataManage.vmobj.createonuser')"
|
/>
|
<el-table-column
|
prop="createTime"
|
:label="$t('dataManage.vmobj.createontime')"
|
:formatter="formatData"
|
/>
|
<el-table-column
|
min-width="100"
|
:label="$t('common.operate')"
|
>
|
<template slot-scope="scope">
|
<el-link
|
style="color: white"
|
@click="showDetail(scope.row)"
|
>{{
|
$t('common.details')
|
}}</el-link>
|
<el-link
|
@click="editInfo(scope.row)"
|
style="margin-left: 10px; color: white"
|
>{{ $t('common.edit') }}</el-link>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
style="margin-top: 10px"
|
class="pagination_box"
|
>
|
<el-pagination
|
@size-change="handleSizeChange"
|
@current-change="handleCurrentChange"
|
:current-page="listData.pageIndex"
|
:page-sizes="[10, 20, 50, 100]"
|
: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>{{ $t('common.details') }}</span>
|
<div
|
style="float: right; cursor: pointer"
|
@click="closeDetial"
|
>
|
<i class="el-icon-close"></i>
|
</div>
|
</div>
|
<div class="contentBox">
|
<p>{{ $t('dataManage.vmobj.name') }}:{{ itemdetail.name }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t('dataManage.vmobj.format') }}:{{ itemdetail.type }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t('common.size') }}:{{ setInfoBoxSize(itemdetail.sizes) }}</p>
|
<el-divider></el-divider>
|
<p>{{ $t('dataManage.vmobj.depName') }}:{{ itemdetail.depName }}</p>
|
<el-divider></el-divider>
|
<p>
|
{{ $t('dataManage.vmobj.gather') }}:{{
|
setInfoBoxTime(itemdetail.gather)
|
}}
|
</p>
|
<el-divider></el-divider>
|
<p>
|
{{ $t('dataManage.vmobj.describe') }}:{{ itemdetail.describe }}
|
</p>
|
<el-divider></el-divider>
|
<p>
|
{{ $t('dataManage.vmobj.createonuser') }}:{{ itemdetail.uname }}
|
</p>
|
<el-divider></el-divider>
|
<p>
|
{{ $t('dataManage.vmobj.createontime') }}:{{
|
setInfoBoxTime(itemdetail.createTime)
|
}}
|
</p>
|
<el-divider></el-divider>
|
<p>
|
{{ $t('dataManage.vmobj.updateonuser') }}:{{
|
itemdetail.updateUser
|
}}
|
</p>
|
<el-divider></el-divider>
|
<p>
|
{{ $t('dataManage.vmobj.updateontime') }}:{{
|
setInfoBoxTime(itemdetail.updateTime)
|
}}
|
</p>
|
</div>
|
</el-card>
|
</div>
|
<el-dialog
|
width="510px"
|
top="5vh"
|
:title="
|
behavior == '新增用户'
|
? `${$t('common.append')}`
|
: `${$t('common.update')}`
|
"
|
:visible.sync="dialogFormVisible"
|
:before-close="handleClose"
|
>
|
<el-form
|
:model="editForm"
|
ref="editForm"
|
>
|
<el-form-item
|
:label="$t('dataManage.vmobj.name')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="editForm.name"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.format')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="editForm.type"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.size')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="editForm.sizes"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.depName')"
|
:label-width="formLabelWidth"
|
>
|
<!-- <el-input v-model="editForm.depName" autocomplete="off"></el-input> -->
|
<el-cascader
|
v-model="editForm.depid"
|
:options="companyOption"
|
:props="cascader"
|
style="width:350px"
|
></el-cascader>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.dirName')"
|
:label-width="formLabelWidth"
|
>
|
<!-- <el-input v-model="editForm.depName" autocomplete="off"></el-input> -->
|
<el-cascader
|
v-model="editForm.dirid"
|
:options="dirComPanyOption"
|
:props="cascader"
|
style="width:350px"
|
></el-cascader>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.vmobj.describe')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="editForm.describe"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<!-- <el-form-item
|
:label="$t('dataManage.vmobj.gather')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="editForm.gather" autocomplete="off"></el-input>
|
</el-form-item> -->
|
</el-form>
|
<div
|
v-if="behavior == '修改信息'"
|
slot="footer"
|
class="dialog-footer"
|
>
|
<el-button
|
size="medium"
|
@click="cancelEdit()"
|
>{{
|
$t('common.reset')
|
}}</el-button>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="sendEdit('editForm')"
|
v-loading.fullscreen.lock="fullscreenLoading"
|
>{{ $t('common.submit') }}</el-button>
|
</div>
|
<div
|
v-else
|
slot="footer"
|
class="dialog-footer"
|
>
|
<el-button
|
size="medium"
|
@click="cancelAdd('editForm')"
|
>{{
|
$t('common.reset')
|
}}</el-button>
|
<el-button
|
size="medium"
|
type="primary"
|
@click="sendAdd('editForm')"
|
v-loading.fullscreen.lock="fullscreenLoading"
|
>{{ $t('common.submit') }}</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog
|
:title="$t('common.details')"
|
:visible.sync="dialogVisible"
|
width="70%"
|
>
|
<div style="height:600px">
|
<el-table
|
ref="filterTable"
|
:data="dbTableData"
|
height="90%"
|
border
|
style="width: 100%"
|
>
|
<el-table-column
|
width="60"
|
align="center"
|
type="index"
|
:label="$t('common.index')"
|
/>
|
<el-table-column
|
v-for="(item, index) in attributeData"
|
:key="index"
|
:label="item.alias"
|
:prop="item.field"
|
show-overflow-tooltip
|
align="center"
|
></el-table-column>
|
</el-table>
|
<div
|
style="margin-top: 10px"
|
class="pagination_box"
|
>
|
<el-pagination
|
@size-change="handleLoaderSizeChange"
|
@current-change="handleLoaderCurrentChange"
|
:current-page="listLoader.pageIndex"
|
:page-sizes="[10, 20, 30, 40]"
|
:page-size="listLoader.pageSize"
|
layout="total, sizes, prev, pager, next, jumper"
|
:total="count1"
|
>
|
</el-pagination>
|
</div>
|
</div>
|
|
</el-dialog>
|
<div
|
class="downloadBox"
|
v-if="showCodeBox"
|
>
|
<h4 style="padding: 20px">{{$t('common.passworld')}}</h4>
|
<el-form
|
:model="codeForm"
|
:rules="rules"
|
ref="codeForm"
|
label-width="100px"
|
class="codeForm"
|
>
|
<el-form-item
|
:label="$t('common.passworld')"
|
prop="password"
|
>
|
<el-input
|
type="password"
|
v-model="codeForm.password"
|
show-password
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('common.SPassword')"
|
prop="repassword"
|
>
|
<el-input
|
type="password"
|
v-model="codeForm.repassword"
|
show-password
|
></el-input>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
class="primary"
|
size="small"
|
@click="download('codeForm')"
|
>{{$t('common.confirm')}}</el-button>
|
<el-button
|
type="info"
|
size="small"
|
@click="closeDown('codeForm')"
|
>{{$t('common.cancel')}}</el-button>
|
</el-form-item>
|
</el-form>
|
</div>
|
<iframe
|
id="downFrame"
|
src=""
|
style="display: none; border: 0; padding: 0; height: 0; width: 0"
|
></iframe>
|
</div>
|
</template>
|
|
<script>
|
import $ from 'jquery'
|
import { getToken } from '@/utils/auth';
|
import {
|
select_meta_ByPageAndCount,
|
// queryDataCount,
|
updateMeta,
|
deleteMeta,
|
insertMeta,
|
selectDictTab,
|
selectdirTab,
|
selectdepTab,
|
meta_downloadReq,
|
sign_getPublicKey,
|
meta_selectDownloadFile,
|
meta_selectFields,
|
meta_selectByPageForUpload
|
} from '../../api/api';
|
|
import MyBread from '../../components/MyBread.vue';
|
export default {
|
name: 'metadataManage',
|
components: { MyBread },
|
data() {
|
var repasswordValidator = (rule, value, callback) => {
|
if (value === '') {
|
callback(new Error('请再次输入密码'));
|
} else if (value !== this.codeForm.password) {
|
callback(new Error('两次输入密码不一致!'));
|
} else {
|
callback();
|
}
|
};
|
var passwordValidator = (rule, value, callback) => {
|
var passwordreg =
|
/^(?![a-zA-Z]+$)(?![A-Z0-9]+$)(?![A-Z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![a-z0-9]+$)(?![a-z\W!@#$%^&*`~()\\-_+=,.?;<>]+$)(?![0-9\W!@#$%^&*`~()\\-_+=,.?;<>]+$)[a-zA-Z0-9\W!@#$%^&*`~()\\-_+=,.?;<>]{12,20}$/;
|
if (!passwordreg.test(value)) {
|
callback(
|
new Error('密码必须由数字、字母、特殊字符组合,请输入13-20位')
|
);
|
} else {
|
callback();
|
}
|
};
|
return {
|
defaultProps: {
|
children: 'children',
|
label: 'name',
|
},
|
dirComPanyOption: [],
|
companyOption: [],
|
companyOption1: [],
|
activeName: '',
|
optionCount: [],
|
showCodeBox: false,
|
value: true,
|
multipleSelection: [],
|
formLabelWidth: '120px',
|
dialogFormVisible: false,
|
editForm: {},
|
showinfoBox: false,
|
fullscreenLoading: false,
|
itemdetail: {},
|
queryForm: {
|
name: '',
|
dirid: '',
|
depid: ''
|
},
|
behavior: '',
|
initialForm: '',
|
codeForm: {
|
password: '',
|
repassword: '',
|
},
|
rules: {
|
password: [{ required: true, message: '请输入密码', trigger: 'blur' }, { validator: passwordValidator, trigger: 'blur' }],
|
repassword: [
|
{ required: true, message: '请输入确认密码', trigger: 'blur' },
|
{ validator: repasswordValidator, trigger: 'blur' },
|
],
|
},
|
tableData: [],
|
dbTableData: [],
|
count: 0,
|
currentPage: 1,
|
pageSize: 10,
|
pageIndex: 1,
|
btnStatus: {
|
select: false,
|
delete: false,
|
upload: false,
|
download: false,
|
insert: false,
|
update: false,
|
},
|
listData: {
|
pageSize: 10,
|
pageIndex: 1,
|
name: null,
|
dirid: null,
|
depid: null
|
},
|
cascader: {
|
label: 'name',
|
value: 'id',
|
children: 'children',
|
checkStrictly: true,
|
emitPath: false,
|
},
|
dialogVisible: false,
|
listLoader: {
|
id: null,
|
pageSize: 1,
|
pageSize: 10,
|
},
|
count1: 0,
|
attributeData: [],
|
};
|
},
|
created() {
|
|
this.getSelectDictTab();
|
this.showPermsBtn();
|
this.getQueryDepTree();
|
this.getQueryDirTree();
|
this.signGetPublicKey();
|
},
|
|
methods: {
|
async detail(res) {
|
var val = res.tab.split(".");
|
const data = await meta_selectFields({
|
ns: val[0],
|
tab: val[1]
|
})
|
|
if (data.code != 200) {
|
this.$message.error('字段列表调用失败');
|
return
|
}
|
|
this.dialogVisible = true;
|
|
|
this.attributeData = data.result;
|
|
this.listLoader = {
|
id: res.id,
|
pageIndex: 1,
|
pageSize: 10,
|
}
|
this.getDataLoaderSelectDbData();
|
},
|
|
async getDataLoaderSelectDbData() {
|
const data1 = await meta_selectByPageForUpload(this.listLoader);
|
if (data1.code != 200) {
|
this.$message.error('字段列表调用失败');
|
return
|
}
|
debugger
|
var option = data1.result;
|
for (var i in option) {
|
option[i].dirid = option[i].dirName;
|
option[i].depid = option[i].depName;
|
option[i].createuser = option[i].createName;
|
option[i].updateuser = option[i].updateName;
|
option[i].verid = option[i].verName;
|
if (option[i].createtime != null) {
|
option[i].createtime = this.setInfoBoxTime(option[i].createtime)
|
}
|
if (option[i].updatetime != null) {
|
option[i].updatetime = this.setInfoBoxTime(option[i].updatetime)
|
}
|
|
}
|
this.dbTableData = data1.result;
|
this.count1 = data1.count;
|
},
|
handleLoaderSizeChange(val) {
|
this.listLoader.pageIndex = 1;
|
this.listLoader.pageSize = val;
|
this.getDataLoaderSelectDbData();
|
},
|
handleLoaderCurrentChange(val) {
|
this.listLoader.pageIndex = val;
|
this.getDataLoaderSelectDbData();
|
},
|
|
async signGetPublicKey() {
|
const res = await sign_getPublicKey();
|
if (res && res.code == 200) {
|
window.encrypt = new JSEncrypt();
|
encrypt.setPublicKey(res.result);
|
}
|
},
|
//单位列表获取
|
async getQueryDepTree() {
|
const res = await selectdepTab();
|
if (res.code != 200) {
|
this.$message.error('单位列表获取失败');
|
return;
|
}
|
this.companyOption1 = this.treeData(res.result);
|
this.queryForm.dirid = this.companyOption1[0].id
|
},
|
async getQueryDirTree() {
|
const res = await selectdirTab();
|
if (res.code != 200) {
|
this.$message.error('单位列表获取失败');
|
return;
|
}
|
this.companyOption = this.treeData(res.result);
|
this.queryForm.dirid = this.companyOption[0].id
|
},
|
handleChange(value) {
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.queryForm.dirid = value;
|
this.getMetaData();
|
},
|
handleChange1(value) {
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.queryForm.depid = value;
|
this.getMetaData();
|
},
|
//格式化列表
|
formatData(row, column) {
|
let data = row[column.property];
|
if (data == null) {
|
return data;
|
}
|
return this.format(data);
|
},
|
setInfoBoxTime(res) {
|
if (res == null) {
|
return res;
|
}
|
return this.format(res);
|
},
|
setInfoBoxSize(res) {
|
if (res >= 1024) {
|
return parseFloat(res / 1024).toFixed(3) + ' GB';
|
} else {
|
return res + ' MB';
|
}
|
},
|
//格式化时间
|
format(shijianchuo) {
|
//shijianchuo是整数,否则要parseInt转换
|
var time = new Date(shijianchuo);
|
var y = time.getFullYear();
|
var m = time.getMonth() + 1;
|
var d = time.getDate();
|
var h = time.getHours();
|
var mm = time.getMinutes();
|
var s = time.getSeconds();
|
return (
|
y +
|
'-' +
|
this.add0(m) +
|
'-' +
|
this.add0(d) +
|
' ' +
|
h +
|
':' +
|
mm +
|
':' +
|
s
|
);
|
},
|
//格式化时间
|
add0(m) {
|
return m < 10 ? '0' + m : m;
|
},
|
//单位转换
|
stateFormatSizes(row, column) {
|
if (row.sizes >= 1024) {
|
const val = parseFloat(row.sizes / 1024).toFixed(3);
|
return val + ' GB';
|
} else {
|
return row.sizes + ' MB';
|
}
|
},
|
//目录树获取
|
async getSelectDictTab() {
|
const res = await selectdirTab();
|
if (res.code != 200) {
|
this.$message.error('列表调用失败');
|
}
|
this.optionCount = this.treeData(res.result);
|
this.dirComPanyOption = this.treeData(res.result);
|
this.listData.dirid = this.optionCount[0].id;
|
this.getMetaData();
|
},
|
handleNodeClick(data) {
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.listData.dirid = data.id;
|
this.getMetaData();
|
},
|
getTableDesc(res) {
|
this.activeName = res.tab;
|
},
|
//显示权限按钮
|
showPermsBtn() {
|
let currentPerms = this.$store.state.currentPerms;
|
let permsEntity = this.$store.state.permsEntity;
|
permsEntity
|
.filter((item) => item.perms == currentPerms)
|
.map((item) => (this.btnStatus[item.tag.substr(1)] = true));
|
},
|
// ShowWindowFly(res) {
|
// console.log(res);
|
// if (res == '') return;
|
// if (res.indexOf('.xls') != -1) {
|
// this.showMetadata(res, true);
|
// } else if (res.indexOf('.doc') != -1) {
|
// this.showMetadata(res, true);
|
// } else if (res.indexOf('.png') != -1) {
|
// this.showMetadata(res, true);
|
// } else if (res.indexOf('.jpg') != -1) {
|
// this.showMetadata(res, true);
|
// } else if (res.indexOf('.pdf') != -1) {
|
// this.showMetadata(res, true);
|
// } else if (res.indexOf('.fly') != -1) {
|
// this.showMetadata(res, false);
|
// } else if (res.indexOf('.mpt') != -1) {
|
// this.showMetadata(res, false);
|
// }
|
// },
|
// showMetadata(res, flag) {
|
// var metaUrl;
|
// if (flag == true) {
|
// metaUrl = res;
|
// } else if (flag == false) {
|
// metaUrl = ifreamUrl + '/LFWeb/MetaPop.html?name=' + res;
|
// }
|
// window.open(
|
// metaUrl,
|
// '',
|
// 'height=800, width=1500, top=150, left=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no'
|
// );
|
// },
|
// 请求数据内容
|
getMetaData() {
|
this.listData.depid = this.queryForm.depid;
|
this.listData.dirid = this.listData.dirid
|
select_meta_ByPageAndCount(this.listData).then((res) => {
|
|
this.tableData = res.result;
|
this.count = res.count;
|
});
|
},
|
// 查询
|
queryInfo() {
|
this.listData.name = this.queryForm.name.trim();
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.getMetaData();
|
},
|
// 重置查询
|
resetInfo(formName) {
|
this.$refs[formName].resetFields();
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.listData.name = null;
|
this.queryForm.dirid = this.companyOption[0].id;
|
this.queryForm.depid = this.companyOption1[0].id
|
this.getMetaData();
|
},
|
//新增按钮
|
showAddDialog() {
|
this.behavior = '新增用户';
|
this.editForm = {};
|
this.dialogFormVisible = true;
|
},
|
cancelAdd(formName) {
|
this.editForm = {};
|
this.$refs[formName].resetFields();
|
},
|
sendAdd(formName) {
|
this.$refs[formName].validate((valid) => {
|
if (valid) {
|
console.log(this.editForm);
|
this.fullscreenLoading = true;
|
insertMeta(this.editForm)
|
.then((res) => {
|
setTimeout(() => {
|
this.fullscreenLoading = false;
|
if (res.code == 200) {
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.getMetaData();
|
this.$message({
|
message: '添加成功',
|
type: 'success',
|
});
|
this.editForm = {};
|
this.dialogFormVisible = false;
|
}
|
}, 500);
|
})
|
.catch((res) => {
|
alert('修改失败,请重试!');
|
this.fullscreenLoading = false;
|
});
|
} else {
|
console.log('error submit!!');
|
return false;
|
}
|
});
|
},
|
// 获取多选选中的对象
|
handleSelectionChange(val) {
|
this.multipleSelection = val;
|
},
|
// 删除多条
|
deleteMetaInfo() {
|
this.$confirm('确定是否删除所选内容?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then(() => {
|
var std = [];
|
for (var i in this.multipleSelection) {
|
std.push(this.multipleSelection[i].id);
|
}
|
deleteMeta({ ids: std.toString() }).then((res) => {
|
if (res.code == 200) {
|
this.$message({
|
type: 'success',
|
message: '删除成功!',
|
});
|
this.multipleSelection = [];
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.getMetaData();
|
} else {
|
this.$message.error('删除失败');
|
this.multipleSelection = [];
|
}
|
});
|
})
|
.catch(() => {
|
this.$message('已取消删除');
|
});
|
},
|
|
// 查看界面
|
showDetail(row) {
|
// console.log(index, row);
|
this.showinfoBox = true;
|
this.itemdetail = row;
|
},
|
// 关闭查看
|
closeDetial() {
|
this.showinfoBox = false;
|
this.itemdetail = {};
|
},
|
// 修改界面
|
editInfo(row) {
|
// console.log(row);
|
delete row.createTime;
|
delete row.createUser;
|
delete row.updateUser;
|
delete row.updateUser;
|
this.initialForm = JSON.stringify(row); //备份
|
this.behavior = '修改信息';
|
this.editForm = JSON.parse(JSON.stringify(row));
|
this.dialogFormVisible = true;
|
},
|
handleClose(done) {
|
this.$confirm('确认关闭?')
|
.then((_) => {
|
this.editForm = {};
|
done();
|
})
|
.catch((_) => { });
|
},
|
|
// 提交修改
|
sendEdit() {
|
this.$confirm('是否确定编辑?', '提示', {
|
confirmButtonText: '确定',
|
cancelButtonText: '取消',
|
type: 'warning',
|
})
|
.then(() => {
|
this.dialogFormVisible = false;
|
updateMeta(this.editForm).then((res) => {
|
setTimeout(() => {
|
this.fullscreenLoading = false;
|
if (res.code == 200) {
|
this.listData.pageSize = 10;
|
this.listData.pageIndex = 1;
|
this.getMetaData();
|
this.$message({
|
message: '修改成功',
|
type: 'success',
|
});
|
this.editForm = {};
|
this.dialogFormVisible = false;
|
}
|
}, 500);
|
});
|
})
|
.catch(() => {
|
alert('修改失败,请重试!');
|
this.fullscreenLoading = false;
|
});
|
},
|
cancelEdit() {
|
this.$nextTick(() => {
|
this.editForm = JSON.parse(this.initialForm);
|
});
|
},
|
async download() {
|
var std = [];
|
for (var i in this.multipleSelection) {
|
std.push(this.multipleSelection[i].id)
|
}
|
var obj = {
|
pwd: encrypt.encrypt(this.codeForm.repassword),
|
ids: std
|
};
|
const res = await meta_downloadReq(JSON.stringify(obj))
|
|
if (res.code != 200) {
|
this.$message.error('下载请求失败');
|
return
|
}
|
|
var downObj = {
|
guid: res.result,
|
pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword))
|
}
|
const data = await meta_selectDownloadFile(downObj)
|
|
if (data.code != 200) {
|
this.$message.error('下载请求失败');
|
return
|
}
|
var token = getToken()
|
var url = BASE_URL + "/meta/downloadFile?token=" + token + "&guid=" + res.result + "&pwd=" + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
|
|
$("#downFrame").attr("src", url).click();
|
this.closeDown();
|
},
|
closeDown() {
|
this.showCodeBox = false;
|
this.codeForm.password = '';
|
this.codeForm.repassword = '';
|
},
|
downFormData() {
|
if (this.multipleSelection.length == 0) {
|
alert('请先选择要下载的文件');
|
return;
|
}
|
this.showCodeBox = true;
|
},
|
|
handleSizeChange(val) {
|
this.listData.pageSize = val;
|
this.listData.pageIndex = 1;
|
this.getMetaData();
|
},
|
handleCurrentChange(val) {
|
this.listData.pageIndex = val;
|
this.getMetaData();
|
},
|
//树列表生成
|
treeData(source) {
|
let cloneData = JSON.parse(JSON.stringify(source)); // 对源数据深度克隆
|
return cloneData.filter((father) => {
|
// 循环所有项
|
let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据
|
branchArr.length > 0 ? (father.children = branchArr) : ''; // 给父级添加一个children属性,并赋值
|
return father.pid == 0; // 返回一级菜单
|
});
|
},
|
},
|
};
|
</script>
|
<style lang="less" scoped>
|
//@import url(); 引入公共css类
|
.authorityManagement_box {
|
height: 81%;
|
width: 97%;
|
position: absolute;
|
box-sizing: border-box;
|
|
.inquire {
|
position: relative;
|
overflow: auto;
|
padding-bottom: 8px;
|
border: 1px solid white;
|
border-radius: 5px;
|
padding: 1%;
|
.el-form-item {
|
margin: 5px;
|
}
|
}
|
.bottom {
|
width: 100%;
|
margin-top: 1%;
|
height: 74%;
|
display: flex;
|
justify-content: space-between;
|
.leftTree {
|
width: 15%;
|
height: 100%;
|
border: 1px solid white;
|
border-radius: 5px;
|
padding: 1%;
|
max-height: 670px;
|
overflow-y: auto;
|
li {
|
color: white;
|
border-bottom: 1px solid white;
|
line-height: 30px;
|
text-align: center;
|
}
|
li:hover {
|
background: rgba(255, 255, 255, 0.3);
|
}
|
.active {
|
color: #409eff;
|
}
|
}
|
.rightTable {
|
width: 98%;
|
height: 100%;
|
border: 1px solid white;
|
|
border-radius: 5px;
|
padding: 1%;
|
.table_box {
|
width: 100%;
|
height: 93%;
|
margin: 0 auto;
|
overflow: auto;
|
}
|
}
|
}
|
.infoBox {
|
width: 500px;
|
position: absolute;
|
z-index: 100;
|
top: 10%;
|
right: 25%;
|
background: #303030;
|
color: #fff;
|
.el-card {
|
background-color: transparent;
|
color: #fff;
|
span {
|
color: #fff;
|
font-size: 16px;
|
font-weight: 600;
|
}
|
}
|
.contentBox {
|
margin: 0 aotu 10px;
|
height: 500px;
|
overflow: auto;
|
p {
|
// background-color: #bfa;
|
// margin-bottom: 10px;
|
font-size: 14px;
|
}
|
}
|
}
|
|
.dotClass {
|
width: 10px;
|
height: 10px;
|
border-radius: 50%;
|
display: block;
|
margin-left: 10px; //这个用于圆点居中
|
}
|
.downloadBox {
|
position: absolute;
|
top: 20%;
|
left: 40%;
|
padding: 20px;
|
background: #303030;
|
width: 30%;
|
border: 1px solid gray;
|
border-radius: 10px;
|
color: white;
|
}
|
/*修改table 表体的背景颜色和文字颜色*/
|
/deep/ .el-table {
|
background-color: transparent;
|
|
th,
|
td {
|
background-color: transparent;
|
}
|
.el-table__expanded-cell {
|
background-color: transparent !important;
|
}
|
|
// 表头背景色
|
th.el-table__cell {
|
background-color: #303030;
|
color: #fff;
|
}
|
tr > td {
|
background-color: #303030;
|
color: #fff;
|
}
|
|
// hover效果
|
tr:hover > td {
|
background-color: rgba(255, 255, 255, 0.3) !important;
|
}
|
|
tbody tr:hover {
|
background-color: rgba(255, 255, 255, 0.3) !important;
|
// text-align: center;
|
}
|
|
// 滚动条宽高
|
.el-table__body-wrapper::-webkit-scrollbar {
|
width: 5px;
|
height: 5px;
|
}
|
|
.el-table__body-wrapper::-webkit-scrollbar {
|
width: 5px;
|
/*滚动条宽度*/
|
height: 5px;
|
/*滚动条高度*/
|
}
|
/*定义滚动条轨道 内阴影+圆角*/
|
.el-table__body-wrapper::-webkit-scrollbar-track {
|
box-shadow: 0px 1px 3px #216fe6 inset;
|
/*滚动条的背景区域的内阴影*/
|
border-radius: 10px;
|
}
|
|
/*定义滑块 内阴影+圆角*/
|
.el-table__body-wrapper::-webkit-scrollbar-thumb {
|
box-shadow: 0px 1px 3px #216fe6 inset;
|
border-radius: 6px;
|
background-color: #216fe6;
|
}
|
}
|
/deep/.el-form-item__label {
|
color: white;
|
}
|
// 设置输入框的背景色、字体颜色、边框属性设置;
|
/deep/.el-input__inner {
|
background-color: transparent !important ;
|
color: #fff;
|
border: 1px solid;
|
}
|
/deep/ .el-dialog {
|
background: #303030;
|
}
|
/deep/.el-range-editor.is-active,
|
.el-range-editor.is-active:hover,
|
.el-select .el-input.is-focus .el-input__inner {
|
border: 1px solid;
|
}
|
/deep/.el-dialog__title {
|
color: white;
|
}
|
/deep/ .el-select .el-input__inner {
|
border-color: #fff !important;
|
}
|
.pagination_box {
|
margin-top: 20px;
|
/deep/.el-input__inner {
|
background-color: transparent !important;
|
border: 1px solid;
|
color: white;
|
}
|
/deep/.el-pagination__total {
|
color: white;
|
}
|
/deep/.el-pagination__jump {
|
color: white;
|
}
|
/deep/.el-pager li.active {
|
color: #409eff;
|
}
|
/deep/.el-pager li {
|
color: white;
|
background: transparent;
|
}
|
/deep/.el-pager li {
|
color: white;
|
}
|
/deep/.btn-prev {
|
background: transparent;
|
}
|
/deep/.btn-next {
|
background: transparent;
|
}
|
/deep/.btn-next i {
|
color: white;
|
}
|
/deep/.btn-prev i {
|
color: white;
|
}
|
}
|
.primary {
|
background: #409eff;
|
border: #409eff;
|
color: white;
|
}
|
|
}
|
/deep/ .el-select .el-input__inner {
|
border-color: #fff !important;
|
}
|
/deep/.el-input__inner {
|
background-color: transparent !important ;
|
color: #fff;
|
border: 1px solid white !important;
|
}
|
</style>
|