| | |
| | | size="small" |
| | | >{{ $t('common.empty') }}</el-button |
| | | > |
| | | <el-button |
| | | <el-button v-if="btnStatus.insert" |
| | | @click="InsertFormdialog = true" |
| | | icon="el-icon-edit" |
| | | type="success" |
| | | size="small" |
| | | >{{ $t('common.append') }}</el-button |
| | | > |
| | | <el-button |
| | | <el-button v-if="btnStatus.delete" |
| | | @click="delStyleData" |
| | | icon="el-icon-delete" |
| | | type="danger" |
| | |
| | | <el-input v-model="upform.fileGuid" disabled autocomplete="off"></el-input> |
| | | <input |
| | | name="file1" |
| | | |
| | | type="file" |
| | | id="editFile" |
| | | multiple="multiple" |
| | |
| | | style="margin-left: 10px" |
| | | ><i class="el-icon-plus"></i |
| | | ></el-link> |
| | | <el-link |
| | | <el-link v-if="btnStatus.upload" |
| | | :title="$t('common.upload')" |
| | | :underline="false" |
| | | @click="seteditFile(0)" |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import $ from 'jquery'; |
| | | import moment from 'moment'; |
| | | import { |
| | | getToken |
| | | } from '../../utils/auth.js' |
| | | import MyBread from '../../components/MyBread.vue'; |
| | | import styleDirTree from './styleDirTree.vue'; |
| | | import styleDepTree from './styleDepTree.vue'; |
| | | import $ from "jquery"; |
| | | import moment from "moment"; |
| | | import { getToken } from "../../utils/auth.js"; |
| | | import MyBread from "../../components/MyBread.vue"; |
| | | import styleDirTree from "./styleDirTree.vue"; |
| | | import styleDepTree from "./styleDepTree.vue"; |
| | | import { |
| | | select_Style_ByPageAndCount, |
| | | insertStyle, |
| | | deleteStyles, |
| | | updateStyle, |
| | | upload_style |
| | | } from '../../api/api'; |
| | | upload_style, |
| | | } from "../../api/api"; |
| | | export default { |
| | | name: 'styleManage', |
| | | name: "styleManage", |
| | | components: { MyBread, styleDirTree, styleDepTree }, |
| | | data() { |
| | | return { |
| | |
| | | InsertFormdialog: false, |
| | | showCata: false, |
| | | upform: {}, |
| | | formLabelWidth: '130px', |
| | | formLabelWidth: "130px", |
| | | showinfoBox: false, |
| | | itemdetail: {}, |
| | | ruleForm: { |
| | | }, |
| | | ruleForm: {}, |
| | | |
| | | backupData: [], |
| | | |
| | | searchName: '', |
| | | searchName: "", |
| | | multipleSelection: [], |
| | | upflag: false, |
| | | /** */ |
| | |
| | | pageIndex: 1, |
| | | pageSize: 10, |
| | | }, |
| | | btnStatus: { |
| | | select: false, |
| | | delete: false, |
| | | upload: false, |
| | | download: false, |
| | | insert: false, |
| | | update: false, |
| | | }, |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getRoleTabelData(); |
| | | this.showPermsBtn(); |
| | | }, |
| | | methods: { |
| | | 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)); |
| | | }, |
| | | filesReset() { |
| | | document.getElementById('insertFile').reset(); |
| | | document.getElementById('insertimageFile').reset(); |
| | | document.getElementById("insertFile").reset(); |
| | | document.getElementById("insertimageFile").reset(); |
| | | this.guidFile = null; |
| | | this.fileGuid = null; |
| | | }, |
| | | getInsertFile(res) { |
| | | if (res == 0) { |
| | | $('#insertFile').click(); |
| | | $("#insertFile").click(); |
| | | } else if (res == 1) { |
| | | $('#insertimageFile').click(); |
| | | $("#insertimageFile").click(); |
| | | } |
| | | }, |
| | | insertFile(res) { |
| | | if (res == 0) { |
| | | var val = document.getElementById('insertFile').files; |
| | | var val = document.getElementById("insertFile").files; |
| | | if (!val || !val.length) return; |
| | | this.insertform.fileGuid = val[0].name; |
| | | } else if (res == 1) { |
| | | var val = document.getElementById('insertimageFile').files; |
| | | var val = document.getElementById("insertimageFile").files; |
| | | if (!val || !val.length) return; |
| | | this.insertform.viewGuid = val[0].name; |
| | | } |
| | |
| | | if (val_data.code == 200) { |
| | | this.guidFile = val_data.result; |
| | | this.$message({ |
| | | message: '上传成功!', |
| | | type: 'success', |
| | | message: "上传成功!", |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: '上传失败!', |
| | | type: 'warning', |
| | | message: "上传失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | } else if (res == 1) { |
| | |
| | | if (val_data.code == 200) { |
| | | this.viewFile = val_data.result; |
| | | this.$message({ |
| | | message: '上传成功!', |
| | | type: 'success', |
| | | message: "上传成功!", |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: '上传失败!', |
| | | type: 'warning', |
| | | message: "上传失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | } |
| | | }, |
| | | geteditFile(res) { |
| | | if (res == 0) { |
| | | $('#editFile').click(); |
| | | $("#editFile").click(); |
| | | } else if (res == 1) { |
| | | $('#editimageFile').click(); |
| | | $("#editimageFile").click(); |
| | | } |
| | | }, |
| | | editFile(res) { |
| | | if (res == 0) { |
| | | var val = document.getElementById('editFile').files; |
| | | var val = document.getElementById("editFile").files; |
| | | if (!val || !val.length) return; |
| | | this.upform.fileGuid = val[0].name; |
| | | } else if (res == 1) { |
| | | var val = document.getElementById('editimageFile').files; |
| | | var val = document.getElementById("editimageFile").files; |
| | | if (!val || !val.length) return; |
| | | this.upform.viewGuid = val[0].name; |
| | | } |
| | |
| | | if (val_data.code == 200) { |
| | | this.guidFile = val_data.result; |
| | | this.$message({ |
| | | message: '上传成功!', |
| | | type: 'success', |
| | | message: "上传成功!", |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: '上传失败!', |
| | | type: 'warning', |
| | | message: "上传失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | } else if (res == 1) { |
| | |
| | | if (val_data.code == 200) { |
| | | this.viewFile = val_data.result; |
| | | this.$message({ |
| | | message: '上传成功!', |
| | | type: 'success', |
| | | message: "上传成功!", |
| | | type: "success", |
| | | }); |
| | | } else { |
| | | this.$message({ |
| | | message: '上传失败!', |
| | | type: 'warning', |
| | | message: "上传失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | } |
| | |
| | | const data = await deleteStyles({ ids: std.toString() }); |
| | | if (data.code == 200) { |
| | | this.$message({ |
| | | message: '删除成功!', |
| | | type: 'success', |
| | | message: "删除成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '删除失败!', |
| | | type: 'warning', |
| | | message: "删除失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | }, |
| | |
| | | async insertFromData() { |
| | | if (this.insertform.dirid == null || this.insertform.depid == null) { |
| | | this.$message({ |
| | | message: '请选择样式所属的目录或单位', |
| | | type: 'warning', |
| | | message: "请选择样式所属的目录或单位", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } |
| | |
| | | |
| | | this.filesReset(); |
| | | 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_Style_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"); |
| | | }, |
| | | formatStatus(row, column) { |
| | | let date = row[column.property]; |
| | |
| | | } |
| | | switch (date) { |
| | | case 1: |
| | | return '启用'; |
| | | return "启用"; |
| | | break; |
| | | case 0: |
| | | return '停用'; |
| | | return "停用"; |
| | | break; |
| | | } |
| | | }, |
| | | /** */ |
| | | getflyFile() { |
| | | $('#flyFile').click(); |
| | | $("#flyFile").click(); |
| | | }, |
| | | getImageFile() { |
| | | $('#imageFile').click(); |
| | | $("#imageFile").click(); |
| | | }, |
| | | uploadflyFile() { |
| | | var val = document.getElementById('flyFile').files; |
| | | var val = document.getElementById("flyFile").files; |
| | | if (!val || !val.length) return; |
| | | if (!val || !val.length) return; |
| | | var formData = new FormData(); |
| | | formData.append('file0', val[0]); |
| | | var res = $.ajax(serverUrl + 'Style/Upload', { |
| | | type: 'post', |
| | | formData.append("file0", val[0]); |
| | | var res = $.ajax(serverUrl + "Style/Upload", { |
| | | type: "post", |
| | | data: formData, |
| | | async: false, |
| | | cache: false, |
| | |
| | | }, |
| | | //图片上传 |
| | | uploadFile() { |
| | | var val = document.getElementById('imageFile').files; |
| | | var val = document.getElementById("imageFile").files; |
| | | if (!val || !val.length) return; |
| | | var formData = new FormData(); |
| | | formData.append('file0', val[0]); |
| | | var res = $.ajax(serverUrl + 'Style/Upload', { |
| | | type: 'post', |
| | | formData.append("file0", val[0]); |
| | | var res = $.ajax(serverUrl + "Style/Upload", { |
| | | type: "post", |
| | | data: formData, |
| | | async: false, |
| | | cache: false, |
| | |
| | | this.insertform.path_id = this.$store.state.cataNode.id; |
| | | } |
| | | |
| | | this.$store.commit('changeCata', ''); //清空state的面包屑 |
| | | this.$store.commit('changeNode', ''); //清空state的节点对象 |
| | | this.$store.commit("changeCata", ""); //清空state的面包屑 |
| | | this.$store.commit("changeNode", ""); //清空state的节点对象 |
| | | this.showCata = false; |
| | | }, |
| | | startFromData() { |
| | |
| | | }); |
| | | }, |
| | | addstyle() { |
| | | this.$router.push('/addstyle'); |
| | | this.$router.push("/addstyle"); |
| | | }, |
| | | statusFormat(res) { |
| | | switch (res) { |
| | |
| | | async updateForm() { |
| | | if (this.upform.dirid == null || this.upform.depid == null) { |
| | | this.$message({ |
| | | message: '请选择样式所属的目录或单位', |
| | | type: 'warning', |
| | | message: "请选择样式所属的目录或单位", |
| | | type: "warning", |
| | | }); |
| | | return; |
| | | } |
| | | if (Number.isInteger(this.upform.status) == false) { |
| | | this.upform.status = this.statusFormat(this.upform.status) |
| | | this.upform.status = this.statusFormat(this.upform.status); |
| | | } |
| | | if (this.guidFile != null) { |
| | | this.upform.fileGuid = this.guidFile; |
| | |
| | | this.dialogFormVisible = false; |
| | | this.upform = {}; |
| | | this.$message({ |
| | | message: '修改成功!', |
| | | type: 'success', |
| | | message: "修改成功!", |
| | | type: "success", |
| | | }); |
| | | this.getRoleTabelData(); |
| | | } else { |
| | | this.$message({ |
| | | message: '修改失败!', |
| | | type: 'warning', |
| | | message: "修改失败!", |
| | | type: "warning", |
| | | }); |
| | | } |
| | | |
| | | |
| | | }, |
| | | |
| | | removeUpdate() { |
| | |
| | | this.filesReset(); |
| | | }, |
| | | submitForm(formName) { |
| | | this.getRoleTabelData() |
| | | this.getRoleTabelData(); |
| | | // this.$refs[formName].validate((valid) => { |
| | | // if (valid) { |
| | | // this.searchName = this.ruleForm.name.trim(); |
| | |
| | | // }); |
| | | }, |
| | | resetForm(formName) { |
| | | this.ruleForm = {} |
| | | this.ruleForm = {}; |
| | | this.getRoleTabelData(); |
| | | }, |
| | | showDetail(index, row) { |
| | | var token = getToken(); |
| | | this.showinfoBox = true; |
| | | this.itemdetail = row; |
| | | this.itemdetail.createTime = this.formomentTime(this.itemdetail.createTime); |
| | | this.itemdetail.updateTime = this.formomentTime(this.itemdetail.updateTime); |
| | | this.itemdetail.imageFile = BASE_URL + "/res/download?guid=" + row.viewGuid + "&token=" + token |
| | | this.itemdetail.createTime = this.formomentTime( |
| | | this.itemdetail.createTime |
| | | ); |
| | | this.itemdetail.updateTime = this.formomentTime( |
| | | this.itemdetail.updateTime |
| | | ); |
| | | this.itemdetail.imageFile = |
| | | BASE_URL + "/res/download?guid=" + row.viewGuid + "&token=" + token; |
| | | }, |
| | | closeDetial() { |
| | | this.showinfoBox = false; |
| | |
| | | }, |
| | | |
| | | handleEdit(index, row) { |
| | | |
| | | this.upflag = true; |
| | | this.dialogFormVisible = true; |
| | | this.upform = row; |
| | | this.upform.depValue = row.depName; |
| | | this.upform.dirValue = row.dirName; |
| | | this.upform.status = this.forMontStatus(row.status) |
| | | this.upform.status = this.forMontStatus(row.status); |
| | | }, |
| | | handleDelete(index, row) { |
| | | this.$confirm('确定是否删除?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning', |
| | | this.$confirm("确定是否删除?", "提示", { |
| | | confirmButtonText: "确定", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | DeletestStyle([row.id]); |
| | | this.$message({ |
| | | type: 'success', |
| | | message: '删除成功!', |
| | | type: "success", |
| | | message: "删除成功!", |
| | | }); |
| | | this.startFromData(); |
| | | }) |
| | |
| | | |
| | | ShowWindowFly(res) { |
| | | window.open( |
| | | ifreamUrl + '/LFWeb/poper.html?name=' + res, |
| | | '', |
| | | 'height=800, width=1500, top=150, left=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no' |
| | | ifreamUrl + "/LFWeb/poper.html?name=" + res, |
| | | "", |
| | | "height=800, width=1500, top=150, left=350, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no" |
| | | ); |
| | | }, |
| | | }, |