<template>
|
<div class="authorityManagement_box">
|
<My-bread
|
:list="[
|
`${$t('dataManage.dataManage')}`,
|
`${$t('dataManage.styleManage')}`,
|
]"
|
></My-bread>
|
<el-divider />
|
<div class="searchComp">
|
<el-form ref="ruleForm" :model="ruleForm" :inline="true">
|
<el-form-item :label="$t('dataManage.vmobj.keyword')" prop="name">
|
<el-input
|
v-model="ruleForm.name"
|
:placeholder="$t('common.pleaseInput')"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button
|
@click="submitForm('ruleForm')"
|
icon="el-icon-search"
|
class="primary"
|
size="small"
|
>{{ $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="btnStatus.insert"
|
@click="setInsertShow()"
|
icon="el-icon-edit"
|
type="success"
|
size="small"
|
>{{ $t('common.append') }}</el-button
|
>
|
<el-button v-if="btnStatus.delete"
|
@click="delStyleData"
|
icon="el-icon-delete"
|
type="danger"
|
size="small"
|
>{{ $t('common.delete') }}</el-button
|
>
|
</el-form-item>
|
</el-form>
|
</div>
|
<div class="bottom">
|
<div class="rightTable">
|
<div class="table_box">
|
<el-table
|
:data="tableData"
|
style="width: 100%"
|
|
height="100%"
|
@selection-change="handleSelectionChange"
|
>
|
<el-table-column type="selection" width="55" />
|
<el-table-column
|
align="center"
|
type="index"
|
:label="$t('dataManage.styleObj.index')"
|
width="70px"
|
/>
|
<el-table-column align="center" prop="id" v-if="false" />
|
<el-table-column
|
align="center"
|
prop="name"
|
:label="$t('dataManage.styleObj.name')"
|
/>
|
<el-table-column
|
align="center"
|
prop="type"
|
:label="$t('dataManage.styleObj.type')"
|
/>
|
<el-table-column
|
align="center"
|
prop="dirName"
|
:label="$t('dataManage.styleObj.dirid')"
|
/>
|
<el-table-column
|
align="center"
|
prop="depName"
|
:label="$t('dataManage.styleObj.depid')"
|
/>
|
<el-table-column
|
align="center"
|
prop="ver"
|
:label="$t('dataManage.styleObj.ver')"
|
/>
|
<el-table-column
|
align="center"
|
prop="status"
|
:label="$t('dataManage.styleObj.status')"
|
:formatter="formatStatus"
|
/>
|
<el-table-column
|
align="center"
|
prop="precision"
|
:label="$t('dataManage.styleObj.precision')"
|
/>
|
<el-table-column
|
align="center"
|
prop="descr"
|
:label="$t('dataManage.styleObj.descr')"
|
/>
|
<el-table-column
|
align="center"
|
prop="bak"
|
:label="$t('dataManage.styleObj.bak')"
|
/>
|
<el-table-column min-width="120" :label="$t('common.operate')">
|
<template slot-scope="scope">
|
<el-button
|
@click="showDetail(scope.$index, scope.row)"
|
type="primary"
|
plain
|
size="small"
|
>{{ $t('common.see') }}</el-button
|
>
|
<el-button
|
@click="handleEdit(scope.$index, scope.row)"
|
type="warning"
|
plain
|
size="small"
|
>{{ $t('common.update') }}</el-button
|
>
|
</template>
|
</el-table-column>
|
</el-table>
|
</div>
|
<div
|
style="margin-top: 20px; margin-left: 400px"
|
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('dataManage.styleObj.deInformation') }}</span>
|
<div style="float: right; cursor: pointer" @click="closeDetial">
|
<i class="el-icon-close"></i>
|
</div>
|
</div>
|
<div class="contentBox">
|
<p>
|
<label> {{ $t('dataManage.styleObj.name') }}:</label>
|
<label class="boxlabel">{{ itemdetail.name }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<p>
|
<label> {{ $t('dataManage.styleObj.type') }}:</label>
|
<label class="boxlabel">{{ itemdetail.type }}</label>
|
</p>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.dirid') }}:</label>
|
<label class="boxlabel">{{ itemdetail.dirName }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.depid') }}:</label>
|
<label class="boxlabel">{{ itemdetail.depName }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.ver') }}:</label>
|
<label class="boxlabel">{{ itemdetail.ver }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.status') }}:</label>
|
<label class="boxlabel">{{ itemdetail.status }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.descr') }}:</label>
|
<label class="boxlabel">{{ itemdetail.descr }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.fileguid') }}:</label>
|
<label class="boxlabel">{{ itemdetail.fileGuid }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.viewguid') }}:</label>
|
<label class="boxlabel"> <div style="width:440px;height:200px;">
|
<img style="width:100%; height:100%" :src="itemdetail.imageFile" alt=""/>
|
</div></label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.createUser') }}:</label>
|
<label class="boxlabel">{{ itemdetail.createUser }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.createTime') }}:</label>
|
<label class="boxlabel">{{ itemdetail.createTime }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.updateUser') }}:</label>
|
<label class="boxlabel">{{ itemdetail.updateUser }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.updateTime') }}:</label>
|
<label class="boxlabel">{{ itemdetail.updateTime }}</label>
|
</p>
|
<el-divider></el-divider>
|
<p>
|
<label> {{ $t('dataManage.styleObj.bak') }}:</label>
|
<label class="boxlabel">{{ itemdetail.bak }}</label>
|
</p>
|
<el-divider></el-divider>
|
</div>
|
</el-card>
|
</div>
|
<el-dialog
|
:title="$t('dataManage.styleObj.modifyStyleData')"
|
top="2vh"
|
style="overflow: hidden"
|
:before-close="removeUpdate"
|
:visible.sync="dialogFormVisible"
|
>
|
<el-form :model="upform">
|
<el-form-item
|
:label="$t('dataManage.styleObj.name')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.name" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.type')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.type" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.dirid')"
|
:label-width="formLabelWidth"
|
>
|
<el-cascader
|
v-model="upform.dirid"
|
:options="editcatalogOption"
|
@change="catalogChange"
|
:props="cascader" style="width:730px"
|
></el-cascader>
|
<!-- <el-input
|
v-model="upform.dirValue"
|
disabled
|
autocomplete="off"
|
></el-input
|
><el-link
|
:underline="false"
|
@click="showDirTree(1)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link> -->
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.depid')"
|
:label-width="formLabelWidth"
|
>
|
<el-cascader
|
v-model="upform.depid"
|
:options="editCompanyOption"
|
@change="editcompanyChange"
|
:props="cascader"
|
style="width:730px"
|
></el-cascader>
|
<!-- <el-input
|
v-model="upform.depValue"
|
disabled
|
autocomplete="off"
|
></el-input>
|
<el-link
|
:underline="false"
|
@click="showDepTree(1)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link> -->
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.ver')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.ver" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.status')"
|
:label-width="formLabelWidth"
|
>
|
<el-select
|
v-model="upform.status"
|
style="width: 745px"
|
:placeholder="$t('common.choose')"
|
>
|
<el-option
|
value="0"
|
:label="$t('dataManage.styleObj.deactivate')"
|
></el-option>
|
<el-option
|
value="1"
|
:label="$t('dataManage.styleObj.enable')"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.precision')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="upform.precision"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.descr')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.descr" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.fileguid')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.fileGuid" disabled autocomplete="off"></el-input>
|
<input
|
name="file1"
|
type="file"
|
id="editFile"
|
multiple="multiple"
|
style="display: none"
|
@change="editFile(0)"
|
/>
|
<el-link
|
:underline="false"
|
@click="geteditFile(0)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link>
|
<el-link v-if="btnStatus.upload"
|
:title="$t('common.upload')"
|
:underline="false"
|
@click="seteditFile(0)"
|
style="margin-left: 10px"
|
><i class="el-icon-upload2"></i
|
></el-link>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.viewguid')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.viewGuid" disabled autocomplete="off"></el-input>
|
<input
|
name="file1"
|
:accept="'.jpg,.png'"
|
type="file"
|
id="editimageFile"
|
multiple="multiple"
|
style="display: none"
|
@change="editFile(1)"
|
/>
|
<el-link
|
:underline="false"
|
@click="geteditFile(1)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link>
|
<el-link
|
:title="$t('common.upload')"
|
:underline="false"
|
@click="seteditFile(1)"
|
style="margin-left: 10px"
|
><i class="el-icon-upload2"></i
|
></el-link>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.bak')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="upform.bak" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="info" @click="removeUpdate">{{$t('common.close')}}</el-button>
|
<el-button class="primary" @click="updateForm">{{$t('common.confirm')}}</el-button>
|
</div>
|
</el-dialog>
|
<el-dialog
|
:title="$t('dataManage.styleObj.addStyleData')"
|
top="2vh"
|
style="overflow: hidden"
|
:visible.sync="InsertFormdialog"
|
:before-close="handleClose"
|
>
|
<el-form :model="insertform">
|
<el-form-item
|
:label="$t('dataManage.styleObj.name')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.name" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.type')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.type" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.dirid')"
|
:label-width="formLabelWidth"
|
>
|
<el-cascader
|
v-model="insertform.dirid"
|
:options="catalogOption"
|
@change="catalogChange"
|
:props="cascader"
|
style="width:730px"
|
></el-cascader>
|
<!-- <el-input
|
v-model="insertform.dirValue"
|
disabled
|
autocomplete="off"
|
></el-input
|
><el-link
|
:underline="false"
|
@click="showDirTree(0)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link> -->
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.depid')"
|
:label-width="formLabelWidth"
|
>
|
<el-cascader
|
v-model="insertform.depid"
|
:options="companyOption"
|
@change="companyChange"
|
:props="cascader"
|
style="width:730px"
|
></el-cascader>
|
<!-- <el-input
|
v-model="insertform.depValue"
|
disabled
|
autocomplete="off"
|
></el-input>
|
<el-link
|
:underline="false"
|
@click="showDepTree(0)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link> -->
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.ver')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.ver" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.status')"
|
:label-width="formLabelWidth"
|
>
|
<el-select
|
v-model="insertform.status"
|
style="width: 730px"
|
:placeholder="$t('common.choose')"
|
>
|
<el-option
|
value="0"
|
:label="$t('dataManage.styleObj.deactivate')"
|
></el-option>
|
<el-option
|
value="1"
|
:label="$t('dataManage.styleObj.enable')"
|
></el-option>
|
</el-select>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.precision')"
|
:label-width="formLabelWidth"
|
>
|
<el-input
|
v-model="insertform.precision"
|
autocomplete="off"
|
></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.descr')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.descr" autocomplete="off"></el-input>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.fileguid')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.fileGuid" disabled autocomplete="off" />
|
<input
|
name="file1"
|
|
type="file"
|
id="insertFile"
|
multiple="multiple"
|
style="display: none"
|
@change="insertFile(0)"
|
/>
|
<el-link
|
:underline="false"
|
@click="getInsertFile(0)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link>
|
<el-link
|
:title="$t('common.upload')"
|
:underline="false"
|
@click="setinsertFile(0)"
|
style="margin-left: 10px"
|
><i class="el-icon-upload2"></i
|
></el-link>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.viewguid')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.viewGuid" disabled autocomplete="off"/>
|
<input
|
name="file1"
|
:accept="'.jpg,.png'"
|
type="file"
|
id="insertimageFile"
|
multiple="multiple"
|
style="display: none"
|
@change="insertFile(1)"
|
/>
|
<el-link
|
:underline="false"
|
@click="getInsertFile(1)"
|
style="margin-left: 10px"
|
><i class="el-icon-plus"></i
|
></el-link>
|
<el-link
|
:title="$t('common.upload')"
|
:underline="false"
|
@click="setinsertFile(1)"
|
style="margin-left: 10px"
|
><i class="el-icon-upload2"></i
|
></el-link>
|
</el-form-item>
|
<el-form-item
|
:label="$t('dataManage.styleObj.bak')"
|
:label-width="formLabelWidth"
|
>
|
<el-input v-model="insertform.bak" autocomplete="off"></el-input>
|
</el-form-item>
|
</el-form>
|
<div slot="footer" class="dialog-footer">
|
<el-button type="info" @click="insertFromDataClose">{{$t('common.close')}}</el-button>
|
<el-button class="primary" @click="insertFromData">{{$t('common.confirm')}}</el-button>
|
</div>
|
</el-dialog>
|
<div class="leftTree" v-if="showDirCata">
|
<div class="treeBox">
|
<style-dir-tree></style-dir-tree>
|
</div>
|
<div class="btnBox">
|
<el-button class="primary" size="small" @click="selectDirCataName">{{
|
$t('common.confirm')
|
}}</el-button>
|
<el-button type="info" size="small" @click="showDirCata = false">{{
|
$t('common.close')
|
}}</el-button>
|
</div>
|
</div>
|
<div class="leftTree" v-if="showDepCata">
|
<div class="treeBox">
|
<style-dep-tree></style-dep-tree>
|
</div>
|
<div class="btnBox">
|
<el-button class="primary" size="small" @click="selectDepCataName">{{
|
$t('common.confirm')
|
}}</el-button>
|
<el-button type="info" size="small" @click="showDepCata = false">{{
|
$t('common.close')
|
}}</el-button>
|
</div>
|
</div>
|
</div>
|
</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 {
|
select_Style_ByPageAndCount,
|
insertStyle,
|
deleteStyles,
|
updateStyle,
|
upload_style,
|
queryDepTree,
|
selectdirTab
|
} from "../../api/api";
|
export default {
|
name: "styleManage",
|
components: { MyBread, styleDirTree, styleDepTree },
|
data() {
|
return {
|
dialogFormVisible: false,
|
InsertFormdialog: false,
|
showCata: false,
|
upform: {},
|
formLabelWidth: "130px",
|
showinfoBox: false,
|
itemdetail: {},
|
ruleForm: {},
|
|
backupData: [],
|
|
searchName: "",
|
multipleSelection: [],
|
upflag: false,
|
/** */
|
showDirCata: false,
|
showDepCata: false,
|
tableData: [],
|
insertform: {
|
fileGuid: null,
|
viewGuid: null,
|
},
|
dirFlag: null,
|
depFlag: null,
|
guidFile: null,
|
viewFile: null,
|
count: 0,
|
listData: {
|
name: null,
|
pageIndex: 1,
|
pageSize: 10,
|
},
|
btnStatus: {
|
select: false,
|
delete: false,
|
upload: false,
|
download: false,
|
insert: false,
|
update: false,
|
},
|
|
companyOption:[],
|
catalogOption:[],
|
editCompanyOption:[],
|
editcatalogOption:[],
|
cascader: {
|
label: 'name',
|
value: 'id',
|
children: 'children',
|
checkStrictly: true,
|
emitPath: false,
|
},
|
};
|
},
|
created() {
|
this.getRoleTabelData();
|
this.showPermsBtn();
|
this.getQueryDepTree();this.getSelectdirTab();
|
},
|
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").value = "";
|
document.getElementById("insertimageFile").value = "";
|
|
this.guidFile = '';
|
this.fileGuid = '';
|
},
|
getInsertFile(res) {
|
if (res == 0) {
|
$("#insertFile").click();
|
} else if (res == 1) {
|
$("#insertimageFile").click();
|
}
|
},
|
insertFile(res) {
|
if (res == 0) {
|
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;
|
if (!val || !val.length) return;
|
this.insertform.viewGuid = val[0].name;
|
}
|
},
|
async setinsertFile(res) {
|
if (res == 0) {
|
var fs = document.getElementById("insertFile");
|
if (fs.files.length == 0) {
|
return;
|
}
|
var formData = new FormData();
|
formData.append("file", fs.files[0]);
|
var val_data = await upload_style(formData);
|
if (val_data.code == 200) {
|
this.guidFile = val_data.result;
|
this.$message({
|
message: "上传成功!",
|
type: "success",
|
});
|
} else {
|
this.$message({
|
message: "上传失败!",
|
type: "warning",
|
});
|
}
|
} else if (res == 1) {
|
var fs = document.getElementById("insertimageFile");
|
if (fs.files.length == 0) {
|
return;
|
}
|
var formData = new FormData();
|
formData.append("file", fs.files[0]);
|
var val_data = await upload_style(formData);
|
if (val_data.code == 200) {
|
this.viewFile = val_data.result;
|
this.$message({
|
message: "上传成功!",
|
type: "success",
|
});
|
} else {
|
this.$message({
|
message: "上传失败!",
|
type: "warning",
|
});
|
}
|
}
|
},
|
geteditFile(res) {
|
if (res == 0) {
|
$("#editFile").click();
|
} else if (res == 1) {
|
$("#editimageFile").click();
|
}
|
},
|
editFile(res) {
|
if (res == 0) {
|
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;
|
if (!val || !val.length) return;
|
this.upform.viewGuid = val[0].name;
|
}
|
},
|
async seteditFile(res) {
|
if (res == 0) {
|
var fs = document.getElementById("editFile");
|
if (fs.files.length == 0) {
|
return;
|
}
|
var formData = new FormData();
|
formData.append("file", fs.files[0]);
|
var val_data = await upload_style(formData);
|
if (val_data.code == 200) {
|
this.guidFile = val_data.result;
|
this.$message({
|
message: "上传成功!",
|
type: "success",
|
});
|
} else {
|
this.$message({
|
message: "上传失败!",
|
type: "warning",
|
});
|
}
|
} else if (res == 1) {
|
var fs = document.getElementById("editimageFile");
|
if (fs.files.length == 0) {
|
return;
|
}
|
var formData = new FormData();
|
formData.append("file", fs.files[0]);
|
var val_data = await upload_style(formData);
|
if (val_data.code == 200) {
|
this.viewFile = val_data.result;
|
this.$message({
|
message: "上传成功!",
|
type: "success",
|
});
|
} else {
|
this.$message({
|
message: "上传失败!",
|
type: "warning",
|
});
|
}
|
}
|
},
|
handleSelectionChange(val) {
|
this.multipleSelection = val;
|
},
|
|
handleSizeChange(val) {
|
this.listData.pageSize = val;
|
this.getRoleTabelData();
|
},
|
handleCurrentChange(val) {
|
this.listData.pageIndex = val;
|
this.getRoleTabelData();
|
},
|
async delStyleData() {
|
var std = [];
|
for (var i in this.multipleSelection) {
|
std.push(this.multipleSelection[i].id);
|
}
|
const data = await deleteStyles({ ids: std.toString() });
|
if (data.code == 200) {
|
this.$message({
|
message: "删除成功!",
|
type: "success",
|
});
|
this.getRoleTabelData();
|
} else {
|
this.$message({
|
message: "删除失败!",
|
type: "warning",
|
});
|
}
|
},
|
showDirTree(res) {
|
this.dirFlag = res;
|
this.showDirCata = true;
|
},
|
showDepTree(res) {
|
this.depFlag = res;
|
this.showDepCata = true;
|
},
|
selectDepCataName() {
|
this.showDepCata = false;
|
switch (this.depFlag) {
|
case 0:
|
this.insertform.depValue = this.$store.state.styleDepCateNodes.name;
|
this.insertform.depid = this.$store.state.styleDepCateNodes.id;
|
break;
|
case 1:
|
this.upform.depValue = this.$store.state.styleDepCateNodes.name;
|
this.upform.depid = this.$store.state.styleDepCateNodes.id;
|
break;
|
}
|
},
|
selectDirCataName() {
|
this.showDirCata = false;
|
switch (this.dirFlag) {
|
case 0:
|
// var data = this.$store.state.styleDirCateNodes;
|
this.insertform.dirValue = this.$store.state.styleDirCateNodes.name;
|
this.insertform.dirid = this.$store.state.styleDirCateNodes.id;
|
break;
|
case 1:
|
this.upform.dirValue = this.$store.state.styleDirCateNodes.name;
|
this.upform.dirid = this.$store.state.styleDirCateNodes.id;
|
break;
|
}
|
},
|
insertFromDataClose() {
|
this.InsertFormdialog = false;
|
this.insertform= {
|
fileGuid: null,
|
viewGuid: null,
|
}
|
this.filesReset();
|
},
|
handleClose(){
|
this.InsertFormdialog = false;
|
this.insertform= {
|
fileGuid: null,
|
viewGuid: null,
|
}
|
this.filesReset();
|
},
|
async insertFromData() {
|
if (this.insertform.dirid == null || this.insertform.depid == null) {
|
this.$message({
|
message: "请选择样式所属的目录或单位",
|
type: "warning",
|
});
|
return;
|
}
|
if (this.guidFile != null) {
|
this.insertform.fileGuid = this.guidFile;
|
}
|
if (this.viewFile != null) {
|
this.insertform.viewGuid = this.viewFile;
|
}
|
const data = await insertStyle(this.insertform);
|
if (data.code == 200) {
|
this.InsertFormdialog = false;
|
this.insertform= {
|
fileGuid: null,
|
viewGuid: null,
|
}
|
this.filesReset();
|
this.$message({
|
message: "添加成功!",
|
type: "success",
|
});
|
this.getRoleTabelData();
|
} else {
|
this.$message({
|
message: "添加失败!",
|
type: "warning",
|
});
|
}
|
},
|
async getRoleTabelData() {
|
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.tableData = data.result;
|
this.count = data.count;
|
},
|
formatTime(row, column) {
|
let date = row[column.property];
|
return this.formomentTime(date);
|
},
|
formomentTime(date) {
|
if (date === undefined || date === null) {
|
return;
|
}
|
return moment(parseInt(date)).format("YYYY-MM-DD HH:mm:ss");
|
},
|
formatStatus(row, column) {
|
let date = row[column.property];
|
return this.forMontStatus(date);
|
},
|
forMontStatus(date) {
|
if (date === undefined || date === null) {
|
return;
|
}
|
switch (date) {
|
case 1:
|
return "启用";
|
break;
|
case 0:
|
return "停用";
|
break;
|
}
|
},
|
/** */
|
getflyFile() {
|
$("#flyFile").click();
|
},
|
getImageFile() {
|
$("#imageFile").click();
|
},
|
uploadflyFile() {
|
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( + "/style/upload", {
|
type: "post",
|
data: formData,
|
async: false,
|
cache: false,
|
processData: false,
|
contentType: false,
|
success: function (rs) {
|
return rs;
|
},
|
error: function (e) {
|
console.error(e);
|
},
|
});
|
|
if (this.upflag == true) {
|
this.upform.path = res.responseJSON;
|
} else {
|
this.insertform.path = res.responseJSON;
|
}
|
},
|
//图片上传
|
uploadFile() {
|
var val = document.getElementById("imageFile").files;
|
if (!val || !val.length) return;
|
var formData = new FormData();
|
formData.append("file0", val[0]);
|
var res = $.ajax(BASE_URL + "/style/upload", {
|
type: "post",
|
data: formData,
|
async: false,
|
cache: false,
|
processData: false,
|
contentType: false,
|
success: function (rs) {
|
return rs;
|
},
|
error: function (e) {
|
console.error(e);
|
},
|
});
|
if (this.upflag == true) {
|
this.upform.img = res.responseJSON;
|
} else {
|
this.insertform.img = res.responseJSON;
|
}
|
},
|
// 选择目录
|
selectCataName() {
|
if (this.upflag == true) {
|
this.upform.queryLevel = this.$store.state.catalogueName;
|
this.upform.path_id = this.$store.state.cataNode.id;
|
} else {
|
this.insertform.queryLevel = this.$store.state.catalogueName;
|
this.insertform.path_id = this.$store.state.cataNode.id;
|
}
|
|
this.$store.commit("changeCata", ""); //清空state的面包屑
|
this.$store.commit("changeNode", ""); //清空state的节点对象
|
this.showCata = false;
|
},
|
startFromData() {
|
this.count = 0;
|
this.pageSize = 1;
|
this.pageNum = 10;
|
this.getStyleData(this.pageNum, this.pageSize, this.searchName);
|
this.getStyleDataCount(this.searchName);
|
},
|
|
// 请求数据
|
getStyleData(size, index, name) {
|
StyleQuery(size, index, name).then((res) => {
|
this.tableData = res.data;
|
});
|
},
|
// 请求数据
|
getStyleDataCount(name) {
|
StyleCounnt(name).then((res) => {
|
this.count = res.data;
|
});
|
},
|
addstyle() {
|
this.$router.push("/addstyle");
|
},
|
statusFormat(res) {
|
switch (res) {
|
case "启用":
|
return 1;
|
break;
|
case "停用":
|
return 0;
|
break;
|
case "Start Using":
|
return 1;
|
break;
|
case "Stop Using":
|
return 0;
|
break;
|
}
|
},
|
async updateForm() {
|
if (this.upform.dirid == null || this.upform.depid == null) {
|
this.$message({
|
message: "请选择样式所属的目录或单位",
|
type: "warning",
|
});
|
return;
|
}
|
if (Number.isInteger(this.upform.status) == false) {
|
this.upform.status = this.statusFormat(this.upform.status);
|
}
|
if (this.guidFile != null) {
|
this.upform.fileGuid = this.guidFile;
|
}
|
if (this.viewFile != null) {
|
this.upform.viewGuid = this.viewFile;
|
}
|
const data = await updateStyle(this.upform);
|
if (data.code == 200) {
|
this.dialogFormVisible = false;
|
this.upform = {};
|
this.$message({
|
message: "修改成功!",
|
type: "success",
|
});
|
this.getRoleTabelData();
|
} else {
|
this.$message({
|
message: "修改失败!",
|
type: "warning",
|
});
|
}
|
},
|
|
removeUpdate() {
|
this.upflag = false;
|
this.dialogFormVisible = false;
|
this.upform = {};
|
// this.filesReset();
|
},
|
submitForm(formName) {
|
this.getRoleTabelData();
|
// this.$refs[formName].validate((valid) => {
|
// if (valid) {
|
// this.searchName = this.ruleForm.name.trim();
|
// this.startFromData();
|
// } else {
|
// console.log('error submit!!');
|
// return false;
|
// }
|
// });
|
},
|
resetForm(formName) {
|
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;
|
},
|
closeDetial() {
|
this.showinfoBox = false;
|
this.itemdetail = {};
|
},
|
|
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);
|
},
|
handleDelete(index, row) {
|
this.$confirm("确定是否删除?", "提示", {
|
confirmButtonText: "确定",
|
cancelButtonText: "取消",
|
type: "warning",
|
})
|
.then(() => {
|
DeletestStyle([row.id]);
|
this.$message({
|
type: "success",
|
message: "删除成功!",
|
});
|
this.startFromData();
|
})
|
.catch(() => {});
|
},
|
// 获取多选
|
|
// 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"
|
// );
|
// },
|
catalogChange(res) {
|
this.insertform.dirid = res;
|
this.upform.dirid =res;
|
|
},
|
editcompanyChange(res){
|
this.upform.depid = res;
|
},
|
companyChange(res){
|
this.insertform.depid = res;
|
|
},
|
//新增数据
|
setInsertShow(){
|
this.InsertFormdialog = true;
|
},
|
//目录列表获取
|
async getSelectdirTab() {
|
const res = await selectdirTab();
|
if (res.code != 200) {
|
this.$message.error('目录列表获取失败');
|
return;
|
}
|
this.insertform.dirid = 1;
|
this.upform.dirid = 1;
|
this.catalogOption = this.treeData(res.result);
|
this.editcatalogOption= this.treeData(res.result);
|
},
|
//单位列表获取
|
async getQueryDepTree() {
|
const res = await queryDepTree();
|
if (res.code != 200) {
|
this.$message.error('单位列表获取失败');
|
return;
|
}
|
this.insertform.depid = 1;
|
this.upform.depid = 1;
|
this.companyOption = this.treeData(res.result);
|
this.editCompanyOption= this.treeData(res.result);
|
},
|
//树列表生成
|
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;
|
|
.el-input {
|
width: 730px;
|
}
|
|
.searchComp {
|
margin: 10px auto;
|
|
border-radius: 5px;
|
border: 1px solid rgb(202, 201, 204);
|
.el-form-item {
|
margin: 5px;
|
}
|
.el-input {
|
width: 467px;
|
}
|
}
|
.leftTree {
|
position: absolute;
|
z-index: 10;
|
z-index: 9999;
|
top: 100px;
|
left: 800px;
|
width: 400px;
|
height: 600px;
|
background: #303030;
|
border: 1px solid #000;
|
.treeBox {
|
height: 550px;
|
overflow: auto;
|
/deep/ .el-tree-node__content:hover {
|
background-color: rgb(153, 153, 153);
|
}
|
}
|
.btnBox {
|
width: 160px;
|
margin: 10px auto 0;
|
// background-color: red;
|
}
|
}
|
.bottom {
|
width: 100%;
|
height: 85%;
|
.rightTable {
|
height: 100%;
|
width: 100%;
|
.table_box {
|
width: 100%;
|
height: 90%;
|
margin: 0 auto;
|
overflow: auto;
|
/*修改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;
|
}
|
}
|
|
}
|
}
|
}
|
.infoBox {
|
width: 500px;
|
|
position: absolute;
|
z-index: 100;
|
top: 15%;
|
right: 25%;
|
background-color: #303030;
|
.el-card {
|
color: white;
|
background-color: transparent;
|
span {
|
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;
|
}
|
.boxlabel {
|
margin-left: 10px;
|
}
|
}
|
/* 整体样式 */
|
.contentBox::-webkit-scrollbar {
|
width: 6px;
|
height: 6px;
|
}
|
|
/* 滚动条 */
|
.contentBox::-webkit-scrollbar-thumb {
|
background-color: #b3d8ff;
|
border-radius: 6px;
|
}
|
|
/* 滚动条鼠标经过样式 */
|
.contentBox::-webkit-scrollbar-thumb:hover {
|
background-color: #b3d8ff;
|
border-radius: 6px;
|
}
|
|
/* 滚动条轨道 */
|
.contentBox::-webkit-scrollbar-track-piece {
|
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
|
border-radius: 10px;
|
background: #ededed;
|
}
|
}
|
.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;
|
}
|
}
|
/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;
|
}
|
/deep/.el-cascader .el-input__inner {
|
border-color: #fff !important;
|
}
|
.primary {
|
background: #409eff;
|
border: #409eff;
|
color: white;
|
}
|
}
|
</style>
|