| | |
| | | `${$t('userManage.resManage')}`, |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | <div class="power_quire subpage_Div"> |
| | | <div class="power_quire subpage_Div" ref="container"> |
| | | <el-form |
| | | ref="form" |
| | | :model="ruleForm" |
| | | :inline="true" |
| | | > |
| | | <el-form-item :label="$t('userManage.resManageObj.name')"> |
| | | <el-input v-model="ruleForm.name"></el-input> |
| | | <div class="flex_box"> |
| | | <el-form-item :label="$t('userManage.resManageObj.name')" style="margin-right: auto"> |
| | | <el-input v-model="ruleForm.name" size="small" style="width:200px" :placeholder="$t('userManage.resManageObj.nameHolder')"> |
| | | <i slot="suffix" class="el-icon-search" @click="submitForm"></i> |
| | | </el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button |
| | | @click="submitForm('ruleForm')" |
| | | icon="el-icon-search" |
| | | size="small" |
| | | type="primary" |
| | | style="background: #1890ff" |
| | | >{{ $t('common.iquery') }}</el-button> |
| | | <el-button |
| | | @click="resetForm('ruleForm')" |
| | | icon="el-icon-refresh" |
| | | type="info" |
| | | size="small" |
| | | >{{ $t('common.empty') }}</el-button> |
| | | <el-button |
| | | v-if="menuStatus.insert" |
| | | @click="setInsertFormdialog" |
| | |
| | | type="danger" |
| | | size="small" |
| | | >{{ $t('common.delete') }}</el-button> |
| | | <!-- <el-button--> |
| | | <!-- @click="submitForm('ruleForm')"--> |
| | | <!-- icon="el-icon-search"--> |
| | | <!-- size="small"--> |
| | | <!-- type="primary"--> |
| | | <!-- style="background: #1890ff"--> |
| | | <!-- >{{ $t('common.iquery') }}</el-button>--> |
| | | <el-button |
| | | @click="resetForm('ruleForm')" |
| | | icon="el-icon-refresh" |
| | | type="info" |
| | | size="small" |
| | | >{{ $t('common.empty') }}</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | |
| | | </el-form> |
| | | </div> |
| | | <div class="table_box "> |
| | | <div class="dividing-line"></div> |
| | | <div class="table_box" :style="styleVar"> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | fit |
| | | border |
| | | @selection-change="handleSelectionChange" |
| | | height="calc(100% - 45px)" |
| | | > |
| | | <el-table-column |
| | | type="selection" |
| | |
| | | > |
| | | </el-table-column> |
| | | <el-table-column |
| | | fixed="right" |
| | | |
| | | :label="$t('common.operate')" |
| | | width="170px" |
| | | > |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div class="pagination_box"> |
| | | <div class="pagination_box" style="margin-top: 10px"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <div class="infoBox_box" v-show="showinfoBox"> |
| | | <div |
| | | class="infoBox box_div " |
| | | v-show="showinfoBox" |
| | | |
| | | > |
| | | <div |
| | | slot="header" |
| | |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | <el-dialog |
| | | :title="dialogTitle" |
| | | :visible.sync="isTransfer" |
| | | width="800px" |
| | | append-to-body |
| | | > |
| | | <el-tree |
| | |
| | | :title="$t('userManage.resManageObj.addResource')" |
| | | style="overflow: hidden" |
| | | :visible.sync="InsertFormdialog" |
| | | top="3%" |
| | | > |
| | | <el-form :model="insertform"> |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form :model="insertform" label-position="top"> |
| | | <el-form-item |
| | | :label="$t('userManage.resManageObj.name')" |
| | | :label-width="formLabelWidth" |
| | |
| | | <el-input |
| | | v-model="insertform.name" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | <el-input |
| | | v-model="insertform.server" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | <el-input |
| | | v-model="insertform.source" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | :popper-append-to-body="false" |
| | | v-model="insertform.depValue" |
| | | placeholder="请选择" |
| | | style="width:92.5%" |
| | | style="width:85%" |
| | | > |
| | | <el-option |
| | | :value="insertform.depid" |
| | |
| | | :popper-append-to-body="false" |
| | | v-model="insertform.dirValue" |
| | | placeholder="请选择" |
| | | style="width:92.5%" |
| | | style="width:85%" |
| | | > |
| | | <el-option |
| | | :value="insertform.dirid" |
| | |
| | | <el-input |
| | | v-model="insertform.descr" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('userManage.resManageObj.img')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input |
| | | <div class="BoxFlex"> |
| | | <div class="BoxFlexinput"> |
| | | <el-input |
| | | v-model="insertform.img" |
| | | disabled |
| | | autocomplete="off" |
| | | style="width:100%" |
| | | ></el-input> |
| | | <input |
| | | |
| | | </div> |
| | | |
| | | <div class="BoxFlexbutton"> |
| | | <input |
| | | name="file1" |
| | | :accept="'.jpg,.png'" |
| | | type="file" |
| | |
| | | style="display: none" |
| | | @change="insertFile" |
| | | /> |
| | | <el-link |
| | | <el-link |
| | | :title="$t('common.append')" |
| | | :underline="false" |
| | | @click="getIsertFile" |
| | | style="margin-left: 10px" |
| | | style="margin-left: 6px" |
| | | ><i class="el-icon-plus"></i></el-link> |
| | | <el-link |
| | | :title="$t('common.upload')" |
| | | :underline="false" |
| | | @click="setUploadFile(0)" |
| | | style="margin-left: 10px" |
| | | ><i class="el-icon-upload2"></i></el-link> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('userManage.resManageObj.bak')" |
| | |
| | | <el-input |
| | | v-model="insertform.bak" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | |
| | | </el-dialog> |
| | | <el-dialog |
| | | :title="$t('userManage.userInfoObj.editPermission')" |
| | | style="overflow: hidden" |
| | | |
| | | :visible.sync="EditFormdialog" |
| | | :before-close="EditFromDataClose" |
| | | > |
| | | <el-form :model="upform"> |
| | | <div style="height: 500px; overflow: auto"> |
| | | <el-form :model="upform" label-position="top"> |
| | | <el-form-item |
| | | :label="$t('userManage.resManageObj.name')" |
| | | :label-width="formLabelWidth" |
| | |
| | | <el-input |
| | | v-model="upform.name" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | <el-input |
| | | v-model="upform.server" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | <el-input |
| | | v-model="upform.source" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | |
| | | :popper-append-to-body="false" |
| | | v-model="upform.depValue" |
| | | placeholder="请选择" |
| | | style="width:92.5%" |
| | | style="width:85%" |
| | | > |
| | | <el-option |
| | | :value="upform.depid" |
| | |
| | | :popper-append-to-body="false" |
| | | v-model="upform.dirValue" |
| | | placeholder="请选择" |
| | | style="width:92.5%" |
| | | style="width:85%" |
| | | > |
| | | <el-option |
| | | :value="upform.dirid" |
| | |
| | | <el-input |
| | | v-model="upform.descr" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('userManage.resManageObj.img')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <div class="BoxFlex"> |
| | | <div class="BoxFlexinput"> |
| | | <el-input |
| | | v-model="upform.img" |
| | | disabled |
| | | autocomplete="off" |
| | | style="width:100%" |
| | | |
| | | ></el-input> |
| | | </div> |
| | | <div class="BoxFlexbutton"> |
| | | <input |
| | | name="file1" |
| | | :accept="'.jpg,.png'" |
| | |
| | | @click="setUploadFile(1)" |
| | | style="margin-left: 10px" |
| | | ><i class="el-icon-upload2"></i></el-link> |
| | | </div> |
| | | </div> |
| | | </el-form-item> |
| | | <el-form-item |
| | | :label="$t('userManage.resManageObj.bak')" |
| | |
| | | <el-input |
| | | v-model="upform.bak" |
| | | autocomplete="off" |
| | | style="width:85%" |
| | | ></el-input> |
| | | |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | <div |
| | | slot="footer" |
| | | class="dialog-footer" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import $ from 'jquery'; |
| | | import { getToken } from '../../utils/auth.js'; |
| | | import moment from 'moment'; |
| | | import MyBread from '../../components/MyBread.vue'; |
| | | import $ from "jquery"; |
| | | import { getToken } from "../../utils/auth.js"; |
| | | import moment from "moment"; |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import { |
| | | select_Res_ByPageAndCount, |
| | | insertRes, |
| | |
| | | upload_res, |
| | | selectdirTab, |
| | | selectdepTab, |
| | | } from '../../api/api.js'; |
| | | import styleDirTree from '../datamanage/styleDirTree.vue'; |
| | | import styleDepTree from '../datamanage/styleDepTree.vue'; |
| | | } from "../../api/api.js"; |
| | | import styleDirTree from "../datamanage/styleDirTree.vue"; |
| | | import styleDepTree from "../datamanage/styleDepTree.vue"; |
| | | export default { |
| | | components: { MyBread, styleDirTree, styleDepTree }, |
| | | data() { |
| | | return { |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | label: "name", |
| | | value: "id", |
| | | children: "children", |
| | | checkStrictly: true, |
| | | emitPath: false, |
| | | }, |
| | |
| | | update: false, |
| | | upload: false, |
| | | }, |
| | | formLabelWidth: '130px', |
| | | formLabelWidth: "130px", |
| | | ruleForm: {}, |
| | | isTransfer: false, |
| | | dialogTitle: '', |
| | | dialogTitle: "", |
| | | data: [], |
| | | InsertFormdialog: false, |
| | | showinfoBox: false, |
| | |
| | | ImageFile: null, |
| | | uploadFile: null, |
| | | insertform: { |
| | | img: '', |
| | | depValue: '', |
| | | dirValue: '' |
| | | img: "", |
| | | depValue: "", |
| | | dirValue: "", |
| | | }, |
| | | tableData: [], |
| | | itemdetail: {}, |
| | | upform: { img: '' }, |
| | | upform: { img: "" }, |
| | | multipleSelection: [], |
| | | count: 0, |
| | | listData: { |
| | |
| | | pageSize: 10, |
| | | }, |
| | | defaultProps: { |
| | | children: 'children', |
| | | label: 'label', |
| | | children: "children", |
| | | label: "label", |
| | | }, |
| | | tableHeight: 0, |
| | | timer: 0, |
| | | styleVar: { |
| | | height: "calc(100% - 109px)", |
| | | }, |
| | | }; |
| | | }, |
| | |
| | | } |
| | | this.getRoleTabelData(); |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.onResize); |
| | | this.calHeight(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.timer && clearTimeout(this.timer); |
| | | window.removeEventListener("resize", this.onResize); |
| | | }, |
| | | methods: { |
| | | onResize() { |
| | | this.timer && clearTimeout(this.timer); |
| | | this.timer = setTimeout(() => { |
| | | this.calHeight(); |
| | | }, 500); |
| | | }, |
| | | calHeight() { |
| | | this.$nextTick(() => { |
| | | const rect = this.$refs.container.getBoundingClientRect(); |
| | | this.tableHeight = `${rect.height + 97}px`; |
| | | // this.styleVar["height"] = `calc(100% - ${rect.height + 97}px)`; |
| | | this.styleVar["height"] = `calc(100% - ${rect.height + 30}px)`; |
| | | }); |
| | | }, |
| | | handleEditDepList(data, node, nodeData) { |
| | | this.upform.depid = data.id |
| | | this.upform.depid = data.id; |
| | | this.upform.depValue = data.name; |
| | | }, |
| | | handleEditDirList(data, node, nodeData) { |
| | | this.upform.dirid = data.id |
| | | this.upform.dirid = data.id; |
| | | this.upform.dirValue = data.name; |
| | | }, |
| | | handleDepList(data, node, nodeData) { |
| | | |
| | | this.insertform.depid = data.id |
| | | this.insertform.depid = data.id; |
| | | this.insertform.depValue = data.name; |
| | | }, |
| | | handleDirList(data, node, nodeData) { |
| | | this.insertform.dirid = data.id |
| | | this.insertform.dirid = data.id; |
| | | this.insertform.dirValue = data.name; |
| | | }, |
| | | treeData(source) { |
| | |
| | | return cloneData.filter((father) => { |
| | | // 循环所有项 |
| | | let branchArr = cloneData.filter((child) => father.id == child.pid); // 对比ID,分别上下级菜单,并返回数据 |
| | | branchArr.length > 0 ? (father.children = branchArr) : ''; // 给父级添加一个children属性,并赋值 |
| | | branchArr.length > 0 ? (father.children = branchArr) : ""; // 给父级添加一个children属性,并赋值 |
| | | // 属于同一对象问题,例如:令 a=b、c=1 ,然后再令 b.c=c , 那么 a.c=b.c=c=1 ;同理,后续令 c.d=2 ,那么 a.c.d 也是=2; |
| | | // 由此循环多次后,就能形成相应的树形数据结构 |
| | | return father.pid == 0; // 返回一级菜单 |
| | |
| | | async getDepList() { |
| | | const data = await selectdepTab(); |
| | | if (data.code != 200) { |
| | | return this.$message.error('单位列表调用失败'); |
| | | return this.$message.error("单位列表调用失败"); |
| | | } |
| | | this.depList = this.treeData(data.result) |
| | | this.depList = this.treeData(data.result); |
| | | }, |
| | | async getDirList() { |
| | | const data = await selectdirTab(); |
| | | if (data.code != 200) { |
| | | return this.$message.error('目录列表调用失败'); |
| | | return this.$message.error("目录列表调用失败"); |
| | | } |
| | | this.dirList = this.treeData(data.result) |
| | | this.dirList = this.treeData(data.result); |
| | | }, |
| | | setInsertFormdialog() { |
| | | this.getDepList(); |
| | |
| | | }, |
| | | showPermsMenu(res) { |
| | | switch (res.tag) { |
| | | case '/delete': |
| | | case "/delete": |
| | | this.menuStatus.delete = true; |
| | | break; |
| | | case '/insert': |
| | | case "/insert": |
| | | this.menuStatus.insert = true; |
| | | break; |
| | | case '/update': |
| | | case "/update": |
| | | this.menuStatus.update = true; |
| | | break; |
| | | case '/upload': |
| | | case "/upload": |
| | | this.menuStatus.upload = true; |
| | | break; |
| | | } |
| | | }, |
| | | getIsertFile() { |
| | | $('#imageFile').click(); |
| | | $("#imageFile").click(); |
| | | }, |
| | | getupdateFile() { |
| | | $('#editimageFile').click(); |
| | | $("#editimageFile").click(); |
| | | }, |
| | | async setUploadFile(res) { |
| | | var fs; |
| | | if (res == 0) { |
| | | fs = document.getElementById('imageFile'); |
| | | fs = document.getElementById("imageFile"); |
| | | } else if (res == 1) { |
| | | fs = document.getElementById('editimageFile'); |
| | | fs = document.getElementById("editimageFile"); |
| | | if (fs.files.length == 0) { |
| | | return; |
| | | } |
| | | } |
| | | var formData = new FormData(); |
| | | formData.append('file', fs.files[0]); |
| | | formData.append("file", fs.files[0]); |
| | | var val_data = await upload_res(formData); |
| | | if (val_data.code == 200) { |
| | | this.uploadFile = val_data.result; |
| | | this.$message({ |
| | | message: '上传成功!', |
| | | type: 'success', |
| | | message: "上传成功!", |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: '上传失败!', |
| | | type: 'warning', |
| | | message: "上传失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | insertFile() { |
| | | var val = document.getElementById('imageFile').files; |
| | | var val = document.getElementById("imageFile").files; |
| | | if (!val || !val.length) return; |
| | | this.insertform.img = val[0].name; |
| | | }, |
| | | updateFile() { |
| | | var val = document.getElementById('editimageFile').files; |
| | | var val = document.getElementById("editimageFile").files; |
| | | if (!val || !val.length) return; |
| | | this.upform.img = val[0].name; |
| | | }, |
| | |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | | const data = await deleteRess({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: '删除成功!', |
| | | type: 'success', |
| | | |
| | | this.$confirm("此操作将永久删除所选内容, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | const data = await deleteRess({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '删除失败!', |
| | | type: 'warning', |
| | | }); |
| | | } |
| | | // const data = await deleteRess({ ids: std.toString() }); |
| | | // if (data.code == 200) { |
| | | // this.$message({ |
| | | // message: '删除成功!', |
| | | // type: 'success', |
| | | // }); |
| | | // this.getRoleTabelData(); |
| | | // } else { |
| | | // this.$message({ |
| | | // message: '删除失败!', |
| | | // type: 'warning', |
| | | // }); |
| | | // } |
| | | }, |
| | | handleSelectionChange(val) { |
| | | this.multipleSelection = val; |
| | |
| | | this.upform = {}; |
| | | this.uploadFile = null; |
| | | this.$message({ |
| | | message: '修改成功!', |
| | | type: 'success', |
| | | message: "修改成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '修改失败!', |
| | | type: 'warning', |
| | | message: "修改失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | |
| | | this.itemdetail.updateTime |
| | | ); |
| | | |
| | | this.itemdetail.imageFile = BASE_URL + '/res/download?guid=' + row.img + '&token=' + token; |
| | | console.log(this.itemdetail.imageFile) |
| | | this.itemdetail.imageFile = |
| | | BASE_URL + "/res/download?guid=" + row.img + "&token=" + token; |
| | | console.log(this.itemdetail.imageFile); |
| | | }, |
| | | handleEdit(index, row) { |
| | | this.getDepList(); |
| | |
| | | async insertFromData() { |
| | | if (this.insertform.dirid == null || this.insertform.depid == null) { |
| | | this.$message({ |
| | | message: '请选择资源所属的目录或单位', |
| | | type: 'warning', |
| | | message: "请选择资源所属的目录或单位", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } |
| | |
| | | if (data.code == 200) { |
| | | this.InsertFormdialog = false; |
| | | this.insertform = { |
| | | img: '', |
| | | img: "", |
| | | }; |
| | | this.uploadFile = null; |
| | | this.$message({ |
| | | message: '添加成功!', |
| | | type: 'success', |
| | | message: "添加成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '添加失败!', |
| | | type: 'warning', |
| | | message: "添加失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | | async getRoleTabelData() { |
| | | if (this.listData.tab == '') { |
| | | if (this.listData.tab == "") { |
| | | delete this.listData.tab; |
| | | } |
| | | this.listData.name = this.ruleForm.name; |
| | | const data = await select_Res_ByPageAndCount(this.listData); |
| | | if (data.code != 200) { |
| | | this.$message.error('列表调用失败'); |
| | | this.$message.error("列表调用失败"); |
| | | } |
| | | this.tableData = data.result; |
| | | this.count = data.count; |
| | |
| | | if (date === undefined || date === null) { |
| | | return; |
| | | } |
| | | return moment(parseInt(date)).format('YYYY-MM-DD HH:mm:ss'); |
| | | return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss"); |
| | | }, |
| | | handleClick(row) { |
| | | this.dialogTitle = row.name; |
| | |
| | | .power_box { |
| | | height: 98%; |
| | | width: 98%; |
| | | padding: 1%; |
| | | padding: 0.5%; |
| | | |
| | | .el-input { |
| | | width: 730px; |
| | | } |
| | | |
| | | .power_quire { |
| | | padding: 10px; |
| | | //padding: 10px; |
| | | |
| | | //margin-top: 20px; |
| | | |
| | | border-radius: 5px; |
| | | |
| | | margin-bottom: 10px; |
| | | //margin-bottom: 20px; |
| | | .el-form-item { |
| | | margin: 5px; |
| | | } |
| | |
| | | } |
| | | } |
| | | </style> |
| | | |