| | |
| | | >{{ $t('common.delete') }}</el-button |
| | | > |
| | | </el-form-item> |
| | | <!-- <el-form-item v-if="btnStatus.download"> |
| | | <el-form-item v-if="btnStatus.download"> |
| | | <el-button |
| | | @click="downFormData" |
| | | icon="el-icon-download" |
| | |
| | | size="small" |
| | | >{{ $t('common.download') }}</el-button |
| | | > |
| | | </el-form-item> --> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div class="bottom"> |
| | |
| | | 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" |
| | |
| | | :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)">{{ |
| | |
| | | > |
| | | </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">请输入下载包密码</h4> |
| | | <h4 style="padding: 20px">{{$t('common.passworld')}}</h4> |
| | | <el-form |
| | | :model="codeForm" |
| | | :rules="rules" |
| | |
| | | label-width="100px" |
| | | class="codeForm" |
| | | > |
| | | <el-form-item label="密码" prop="password"> |
| | | <el-input type="password" v-model="codeForm.password"></el-input> |
| | | <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="确认密码" prop="repassword"> |
| | | <el-input type="password" v-model="codeForm.repassword"></el-input> |
| | | <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 type="primary" size="small" @click="download('codeForm')" |
| | | >确定</el-button |
| | | <el-button class="primary" size="small" @click="download('codeForm')" |
| | | >{{$t('common.confirm')}}</el-button |
| | | > |
| | | <el-button type="info" size="small" @click="closeDown('codeForm')" |
| | | >取消</el-button |
| | | >{{$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, |
| | |
| | | selectDictTab, |
| | | selectdirTab, |
| | | queryDepTree, |
| | | |
| | | meta_downloadReq, |
| | | sign_getPublicKey, |
| | | meta_selectDownloadFile, |
| | | meta_selectFields, |
| | | meta_selectByPageForUpload |
| | | } from '../../api/api'; |
| | | |
| | | import MyBread from '../../components/MyBread.vue'; |
| | | export default { |
| | | name: 'metadataManage', |
| | |
| | | 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: { |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'name', |
| | | }, |
| | | dirComPanyOption:[], |
| | | dirComPanyOption: [], |
| | | companyOption: [], |
| | | activeName: '', |
| | | optionCount: [], |
| | |
| | | repassword: '', |
| | | }, |
| | | rules: { |
| | | password: [{ required: true, message: '请输入密码', trigger: 'blur' }], |
| | | 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, |
| | |
| | | pageSize: 10, |
| | | pageIndex: 1, |
| | | name: null, |
| | | dirid:null, |
| | | dirid: null, |
| | | }, |
| | | cascader: { |
| | | label: 'name', |
| | |
| | | checkStrictly: true, |
| | | emitPath: false, |
| | | }, |
| | | dialogVisible: false, |
| | | listLoader: { |
| | | id: null, |
| | | pageSize: 1, |
| | | pageSize: 10, |
| | | }, |
| | | count1: 0, |
| | | attributeData: [], |
| | | }; |
| | | }, |
| | | created() { |
| | |
| | | this.getSelectDictTab(); |
| | | this.showPermsBtn(); |
| | | this.getQueryDepTree(); |
| | | 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 queryDepTree(); |
| | |
| | | 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(); |
| | | 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.pageSize = 10; |
| | | this.listData.pageIndex = 1; |
| | | this.listData.dirid = data.id; |
| | | this.getMetaData(); |
| | | this.getMetaData(); |
| | | }, |
| | | getTableDesc(res) { |
| | | this.activeName = res.tab; |
| | |
| | | .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' |
| | | ); |
| | | }, |
| | | // 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() { |
| | | select_meta_ByPageAndCount(this.listData).then((res) => { |
| | | debugger |
| | | |
| | | this.tableData = res.result; |
| | | this.count = res.count; |
| | | }); |
| | |
| | | this.editForm = {}; |
| | | done(); |
| | | }) |
| | | .catch((_) => {}); |
| | | .catch((_) => { }); |
| | | }, |
| | | |
| | | // 提交修改 |
| | |
| | | this.editForm = JSON.parse(this.initialForm); |
| | | }); |
| | | }, |
| | | download() {}, |
| | | 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 = ''; |
| | |
| | | .downloadBox { |
| | | position: absolute; |
| | | top: 20%; |
| | | left: 50%; |
| | | left: 40%; |
| | | padding: 20px; |
| | | |
| | | width: 20%; |
| | | border: 1px solid #000; |
| | | background: #303030; |
| | | width: 30%; |
| | | border: 1px solid gray; |
| | | border-radius: 10px; |
| | | color: white; |
| | | } |
| | | /*修改table 表体的背景颜色和文字颜色*/ |
| | | /deep/ .el-table { |