| | |
| | | `${$t('dataManage.styleManage')}`, |
| | | ]"></My-bread> |
| | | <el-divider /> |
| | | <div class="searchComp subpage_Div" style="padding: 1%;"> |
| | | <div class="searchComp subpage_Div" ref="container"> |
| | | <el-form |
| | | ref="ruleForm" |
| | | :model="ruleForm" |
| | | :inline="true" |
| | | > |
| | | <el-form-item |
| | | <div class="flex_box"> |
| | | <div style="margin-right: auto"> |
| | | <el-form-item |
| | | :label="$t('dataManage.vmobj.keyword')" |
| | | prop="name" |
| | | > |
| | |
| | | style="width:200px" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item style="float: right;"> |
| | | </div> |
| | | <div> |
| | | <el-form-item> |
| | | <el-button |
| | | v-if="btnStatus.insert" |
| | | @click="setInsertShow()" |
| | |
| | | size="small" |
| | | >{{ $t('common.empty') }}</el-button> |
| | | </el-form-item> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </el-form> |
| | | </div> |
| | | <div class="bottom"> |
| | | <div class="rightTable subpage_Div"> |
| | | <div class="table_box"> |
| | | |
| | | <div class="table_box" :style="styleVar"> |
| | | <el-table |
| | | :data="tableData" |
| | | style="width: 100%" |
| | | height="95%" |
| | | height="calc(100% - 57px)" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | <div |
| | | <div |
| | | class="pagination_box" |
| | | > |
| | | <el-pagination |
| | |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | <div |
| | | class="infoBox subpage_Div box_div" |
| | | v-show="showinfoBox" |
| | |
| | | updateStyle, |
| | | upload_style, |
| | | queryDepTree, |
| | | selectdirTab |
| | | selectdirTab, |
| | | } from "../../api/api"; |
| | | export default { |
| | | name: "styleManage", |
| | |
| | | insertFileName: "", |
| | | insertViewName: "", |
| | | |
| | | insertform: { |
| | | |
| | | }, |
| | | insertform: {}, |
| | | dialogFormVisible: false, |
| | | InsertFormdialog: false, |
| | | showCata: false, |
| | |
| | | editCompanyOption: [], |
| | | editcatalogOption: [], |
| | | cascader: { |
| | | label: 'name', |
| | | value: 'id', |
| | | children: 'children', |
| | | label: "name", |
| | | value: "id", |
| | | children: "children", |
| | | checkStrictly: true, |
| | | emitPath: false, |
| | | }, |
| | |
| | | children: "children", |
| | | label: "name", |
| | | }, |
| | | selectOptionWidth: '', |
| | | selectheight: 'auto', |
| | | defaultexpand: false |
| | | selectOptionWidth: "", |
| | | selectheight: "auto", |
| | | defaultexpand: false, |
| | | tableHeight: 0, |
| | | timer: 0, |
| | | styleVar: { |
| | | height: "calc(100% - 109px)", |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getRoleTabelData(); |
| | | this.showPermsBtn(); |
| | | this.getQueryDepTree(); this.getSelectdirTab(); |
| | | this.getQueryDepTree(); |
| | | this.getSelectdirTab(); |
| | | }, |
| | | beforeDestroy() { |
| | | this.timer && clearTimeout(this.timer); |
| | | window.removeEventListener("resize", this.onResize); |
| | | }, |
| | | mounted() { |
| | | window.addEventListener("resize", this.onResize); |
| | | this.calHeight(); |
| | | }, |
| | | 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)`; |
| | | }); |
| | | }, |
| | | showPermsBtn() { |
| | | let currentPerms = this.$store.state.currentPerms; |
| | | let permsEntity = this.$store.state.permsEntity; |
| | |
| | | document.getElementById("insertFile").value = ""; |
| | | document.getElementById("insertimageFile").value = ""; |
| | | |
| | | this.guidFile = ''; |
| | | this.fileGuid = ''; |
| | | this.guidFile = ""; |
| | | this.fileGuid = ""; |
| | | }, |
| | | getInsertFile(res) { |
| | | if (res == 0) { |
| | |
| | | } |
| | | }, |
| | | insertFileData: function (res) { |
| | | |
| | | |
| | | if (res == 0) { |
| | | let val = document.getElementById("insertFile").files; |
| | | |
| | |
| | | for (var i in this.multipleSelection) { |
| | | std.push(this.multipleSelection[i].id); |
| | | } |
| | | this.$confirm('此操作将永久删除该样式, 是否继续?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(async () => { |
| | | const data = await deleteStyles({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.$confirm("此操作将永久删除该样式, 是否继续?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(async () => { |
| | | const data = await deleteStyles({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }) |
| | | .catch(() => { |
| | | this.$message({ |
| | | message: "删除成功!", |
| | | type: "success", |
| | | type: "info", |
| | | message: "已取消删除", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }).catch(() => { |
| | | this.$message({ |
| | | type: 'info', |
| | | message: '已取消删除' |
| | | }); |
| | | }); |
| | | }, |
| | | showDirTree(res) { |
| | | this.dirFlag = res; |
| | |
| | | }, |
| | | insertFromDataClose() { |
| | | this.InsertFormdialog = false; |
| | | this.insertform = { |
| | | |
| | | } |
| | | this.insertform = {}; |
| | | this.insertFileGuid = ""; |
| | | this.insertViewGuid = "" |
| | | this.insertViewGuid = ""; |
| | | this.filesReset(); |
| | | }, |
| | | handleClose() { |
| | |
| | | this.insertform = { |
| | | fileGuid: null, |
| | | viewGuid: null, |
| | | } |
| | | }; |
| | | this.filesReset(); |
| | | }, |
| | | async insertFromData() { |
| | |
| | | this.insertform = { |
| | | fileGuid: null, |
| | | viewGuid: null, |
| | | } |
| | | }; |
| | | this.insertFileGuid = ""; |
| | | this.insertViewGuid = "" |
| | | this.insertViewGuid = ""; |
| | | this.filesReset(); |
| | | this.$message({ |
| | | message: "添加成功!", |
| | |
| | | } |
| | | this.listData.name = this.ruleForm.name; |
| | | const data = await select_Style_ByPageAndCount(this.listData); |
| | | |
| | | |
| | | if (data.code != 200) { |
| | | this.$message.error("列表调用失败"); |
| | | } |
| | |
| | | if (!val || !val.length) return; |
| | | var formData = new FormData(); |
| | | formData.append("file0", val[0]); |
| | | var res = $.ajax(+ "/style/upload", { |
| | | var res = $.ajax(+"/style/upload", { |
| | | type: "post", |
| | | data: formData, |
| | | async: false, |
| | |
| | | }, |
| | | |
| | | handleEdit(index, row) { |
| | | |
| | | this.upflag = true; |
| | | this.dialogFormVisible = true; |
| | | this.upform = row; |
| | |
| | | }); |
| | | this.startFromData(); |
| | | }) |
| | | .catch(() => { }); |
| | | .catch(() => {}); |
| | | }, |
| | | // 获取多选 |
| | | |
| | |
| | | catalogChange(res) { |
| | | this.insertform.dirid = res; |
| | | this.upform.dirid = res; |
| | | |
| | | }, |
| | | handcatalogChange(data, node, nodeData) { |
| | | this.$set(this.insertform, 'dirid', data.id) |
| | | this.$set(this.insertform, 'dirName', data.name) |
| | | this.$set(this.insertform, "dirid", data.id); |
| | | this.$set(this.insertform, "dirName", data.name); |
| | | // this.insertform.dirid = data.id; |
| | | // this.insertform.dirName = data.name |
| | | }, |
| | | handleNodeClickto(data, node, nodeData) { |
| | | this.insertform.depid = data.id |
| | | this.insertform.depid = data.id; |
| | | this.upform.dirid = data.id; |
| | | this.upform.dirName = data.name; |
| | | }, |
| | |
| | | }, |
| | | companyChange(res) { |
| | | this.insertform.depid = res; |
| | | |
| | | }, |
| | | handcompanyChange(data, node, nodeData) { |
| | | this.$set(this.insertform, 'depid', data.id) |
| | | this.$set(this.insertform, "depid", data.id); |
| | | // this.insertform.depid = data.id; |
| | | this.$set(this.insertform, 'depName', data.name) |
| | | this.$set(this.insertform, "depName", data.name); |
| | | // this.insertform.depName = data.name; |
| | | }, |
| | | //新增数据 |
| | | setInsertShow() { |
| | | this.InsertFormdialog = true; |
| | | this.$set(this, 'insertform', {}) |
| | | this.$set(this, "insertform", {}); |
| | | }, |
| | | //目录列表获取 |
| | | async getSelectdirTab() { |
| | | const res = await selectdirTab(); |
| | | if (res.code != 200) { |
| | | this.$message.error('目录列表获取失败'); |
| | | this.$message.error("目录列表获取失败"); |
| | | return; |
| | | } |
| | | this.insertform.dirid = 1; |
| | |
| | | async getQueryDepTree() { |
| | | const res = await queryDepTree(); |
| | | if (res.code != 200) { |
| | | this.$message.error('单位列表获取失败'); |
| | | this.$message.error("单位列表获取失败"); |
| | | return; |
| | | } |
| | | this.insertform.depid = 1; |
| | |
| | | this.editCompanyOption = this.treeData(res.result); |
| | | }, |
| | | handleNodeClick(data, node, nodeData) { |
| | | this.upform.depid = data.id |
| | | this.upform.depid = data.id; |
| | | this.upform.depName = data.name; |
| | | }, |
| | | //树列表生成 |
| | |
| | | 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属性,并赋值 |
| | | return father.pid == 0; // 返回一级菜单 |
| | | }); |
| | | }, |
| | | setOptionWidth(event) { |
| | | // 下拉框聚焦,设置弹框的宽度 |
| | | this.$nextTick(() => { |
| | | this.selectOptionWidth = event.srcElement.offsetWidth + 'px'; |
| | | this.selectOptionWidth = event.srcElement.offsetWidth + "px"; |
| | | }); |
| | | } |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | |
| | | } |
| | | |
| | | .searchComp { |
| | | margin: 10px auto; |
| | | padding: 8px; |
| | | margin-top: 20px; |
| | | |
| | | border-radius: 5px; |
| | | |
| | | margin-bottom: 20px; |
| | | .el-form-item { |
| | | margin: 5px; |
| | | } |
| | | .el-input { |
| | | width: 467px; |
| | | } |
| | | // .el-input { |
| | | // width: 467px; |
| | | // } |
| | | } |
| | | .leftTree { |
| | | position: absolute; |
| | |
| | | margin: 10px auto 0; |
| | | } |
| | | } |
| | | .bottom { |
| | | width: 100%; |
| | | margin-top: 1%; |
| | | height: 74%; |
| | | display: flex; |
| | | justify-content: space-between; |
| | | |
| | | .rightTable { |
| | | width: 98%; |
| | | height: 92%; |
| | | |
| | | border-radius: 5px; |
| | | padding: 1%; |
| | | .table_box { |
| | | width: 100%; |
| | | height: 93%; |
| | | margin: 0 auto; |
| | | overflow: auto; |
| | | } |
| | | } |
| | | } |
| | | .BoxFlex { |
| | | display: flex; |
| | | justify-content: space-around; |