| | |
| | | prop="descr" |
| | | :label="$t('dataManage.styleObj.descr')" |
| | | /> |
| | | <el-table-column |
| | | <!-- <el-table-column |
| | | align="center" |
| | | prop="fileGuid" |
| | | :label="$t('dataManage.styleObj.fileguid')" |
| | |
| | | prop="updateTime" |
| | | :label="$t('dataManage.styleObj.updateTime')" |
| | | :formatter="formatTime" |
| | | /> |
| | | /> --> |
| | | <el-table-column |
| | | align="center" |
| | | prop="bak" |
| | | :label="$t('dataManage.styleObj.bak')" |
| | | /> |
| | | <el-table-column min-width="150" :label="$t('common.operate')"> |
| | | <el-table-column min-width="120" :label="$t('common.operate')"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | @click="showDetail(scope.$index, scope.row)" |
| | |
| | | <el-divider></el-divider> |
| | | <p> |
| | | <label> {{ $t('dataManage.styleObj.fileguid') }}:</label> |
| | | <label class="boxlabel">{{ itemdetail.fileguid }}</label> |
| | | <label class="boxlabel">{{ itemdetail.fileGuid }}</label> |
| | | </p> |
| | | <el-divider></el-divider> |
| | | <p> |
| | | <label> {{ $t('dataManage.styleObj.viewguid') }}:</label> |
| | | <label class="boxlabel">{{ itemdetail.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.fileguid')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input v-model="upform.fileGuid" autocomplete="off"></el-input> |
| | | <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 |
| | | :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" autocomplete="off"></el-input> |
| | | <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')" |
| | |
| | | > |
| | | <el-select |
| | | v-model="insertform.status" |
| | | style="width: 745px" |
| | | style="width: 730px" |
| | | :placeholder="$t('common.choose')" |
| | | > |
| | | <el-option |
| | |
| | | :label="$t('dataManage.styleObj.descr')" |
| | | :label-width="formLabelWidth" |
| | | > |
| | | <el-input v-model="insertform.descr" autocomplete="off"></el-input> |
| | | <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" autocomplete="off"></el-input> |
| | | <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" autocomplete="off"></el-input> |
| | | <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')" |
| | |
| | | <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'; |
| | |
| | | select_Style_ByPageAndCount, |
| | | insertStyle, |
| | | deleteStyles, |
| | | updateStyle |
| | | updateStyle, |
| | | upload_style |
| | | } from '../../api/api'; |
| | | export default { |
| | | name: 'styleManage', |
| | |
| | | showDirCata: false, |
| | | showDepCata: false, |
| | | tableData: [], |
| | | insertform: {}, |
| | | insertform: { |
| | | fileGuid: null, |
| | | viewGuid: null, |
| | | }, |
| | | dirFlag: null, |
| | | depFlag: null, |
| | | guidFile: null, |
| | | viewFile: null, |
| | | count: 0, |
| | | listData: { |
| | | name: null, |
| | |
| | | this.getRoleTabelData(); |
| | | }, |
| | | methods: { |
| | | filesReset() { |
| | | document.getElementById('insertFile').reset(); |
| | | document.getElementById('insertimageFile').reset(); |
| | | this.guidFile = null; |
| | | this.fileGuid = null; |
| | | }, |
| | | 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; |
| | | }, |
| | |
| | | insertFromDataClose() { |
| | | this.InsertFormdialog = false; |
| | | this.insertform = {}; |
| | | this.filesReset(); |
| | | }, |
| | | async insertFromData() { |
| | | if (this.insertform.dirid == null || this.insertform.depid == null) { |
| | |
| | | }); |
| | | 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 = {}; |
| | | |
| | | this.filesReset(); |
| | | this.$message({ |
| | | message: '添加成功!', |
| | | type: 'success', |
| | |
| | | addstyle() { |
| | | this.$router.push('/addstyle'); |
| | | }, |
| | | statusFormat(res){ |
| | | switch(res){ |
| | | statusFormat(res) { |
| | | switch (res) { |
| | | case "启用": |
| | | return 1; |
| | | break; |
| | | case "停用": |
| | | return 0; |
| | | case "停用": |
| | | return 0; |
| | | break; |
| | | case "Start Using": |
| | | case "Start Using": |
| | | return 1; |
| | | break; |
| | | case "Stop Using": |
| | | return 0; |
| | | case "Stop Using": |
| | | return 0; |
| | | break; |
| | | } |
| | | }, |
| | |
| | | }); |
| | | return; |
| | | } |
| | | if(Number.isInteger(this.upform.status) == false){ |
| | | this.upform.status = this.statusFormat(this.upform.status) |
| | | } |
| | | const data = await updateStyle(this.upform); |
| | | 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 = {}; |
| | |
| | | removeUpdate() { |
| | | this.upflag = false; |
| | | this.dialogFormVisible = false; |
| | | this.upform = {} |
| | | this.upform = {}; |
| | | this.filesReset(); |
| | | }, |
| | | submitForm(formName) { |
| | | this.getRoleTabelData() |
| | |
| | | // }); |
| | | }, |
| | | 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 |
| | | }, |
| | | closeDetial() { |
| | | this.showinfoBox = false; |
| | |
| | | box-sizing: border-box; |
| | | |
| | | .el-input { |
| | | width: 745px; |
| | | width: 730px; |
| | | } |
| | | |
| | | .searchComp { |