| | |
| | | <template> |
| | | <div class="dict-main"> |
| | | <el-form :inline="true" :model="searchData" abel-width="120px"> |
| | | <el-form-item label="åå
¸ç¼å·"> |
| | | <el-input v-model="searchData.code" placeholder="åå
¸ç¼å·" clearable /> |
| | | <el-form-item label="éä»¶åå"> |
| | | <el-input v-model="searchData.domainName" placeholder="éä»¶åå" clearable /> |
| | | </el-form-item> |
| | | <el-form-item label="åå
¸åç§°"> |
| | | <el-input v-model="searchData.dictValue" placeholder="åå
¸åç§°" clearable></el-input> |
| | | <el-form-item label="éä»¶åç§°"> |
| | | <el-input v-model="searchData.name" placeholder="éä»¶åç§°" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="éä»¶åå"> |
| | | <el-input v-model="searchData.originalName" placeholder="éä»¶åå" clearable></el-input> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="primary" @click="searchclick">æç´¢</el-button> |
| | |
| | | </el-form> |
| | | <div> |
| | | <div class="dict-Btn"> |
| | | <div class="dict-btn-bottom"> |
| | | <el-button type="primary" @click="addData">+ æ°å¢</el-button> |
| | | <el-button type="danger" plain @click="delData">å é¤</el-button> |
| | | <div class="dict-btn-bottom"> |
| | | <el-button @click="showUpload" icon="el-icon-upload">ä¸ä¼ </el-button> |
| | | <el-button @click="delFile" type="danger" icon="el-icon-delete">å é¤</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="dict-table"> |
| | | <el-table ref="multipleTableRef" :data="tableData" border style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange"> |
| | | <el-table-column type="selection" width="55" /> |
| | | <el-table-column prop="code" label="åå
¸ç¼å·"> |
| | | <el-table-column prop="link" label="éä»¶å°å"></el-table-column> |
| | | <el-table-column prop="domainName" label="éä»¶åå"></el-table-column> |
| | | <el-table-column prop="name" label="éä»¶åç§°"></el-table-column> |
| | | <el-table-column prop="originalName" label="éä»¶åå"></el-table-column> |
| | | <el-table-column prop="extension" label="éä»¶æå±å"></el-table-column> |
| | | <el-table-column prop="attachSize" label="é件大å°"> |
| | | <template #default="scope"> |
| | | <el-check-tag type="info" checked @change="table_allocation(scope.row, scope.$index)">{{scope.row.code}}</el-check-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="dictValue" label="åå
¸åç§°"></el-table-column> |
| | | <el-table-column prop="sort" label="åå
¸æåº"></el-table-column> |
| | | <el-table-column prop="isSealed" label="å°å"> |
| | | <template #default="scope"> |
| | | <div>{{scope.row.isSealed == 0?"å¦":"æ¯"}}</div> |
| | | <span class="attachSize">{{scope.row.attachSize}} B</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column fixed="right" label="æä½"> |
| | | <template #default="scope"> |
| | | <el-button text type="primary" size="small" @click="table_show(scope.row, scope.$index)">æ¥ç</el-button> |
| | | <el-button type="text" size="small" @click="table_edit(scope.row, scope.$index)">ç¼è¾</el-button> |
| | | <el-button text type="primary" size="small" @click="table_del(scope.row, scope.$index)">å é¤</el-button> |
| | | <el-button text type="primary" size="small" @click="table_allocation(scope.row, scope.$index)">åå
¸é
ç½®</el-button> |
| | | <el-button text type="primary" size="small" @click="exportFile(scope.row, scope.$index)">ä¸è½½</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | <el-dialog title="é件管ç" v-model="fileDialogVisible" :width="600"> |
| | | <span>éä»¶ä¸ä¼ </span> |
| | | <el-upload |
| | | class="upload-demo" |
| | | drag |
| | | :headers="authorization" |
| | | :on-success="handleAvatarSuccess" |
| | | action="/api/blade-resource/oss/endpoint/put-file-attach"> |
| | | <i class="el-icon-upload"></i> |
| | | <div class="el-upload__text">å°æä»¶æå°æ¤å¤ï¼æ<em>ç¹å»ä¸ä¼ </em></div> |
| | | </el-upload> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | <script> |
| | | export default { |
| | | name: "attach", |
| | | data(){ |
| | | return { |
| | | authorization: {Authorization: "Basic c2FiZXI6c2FiZXJfc2VjcmV0"}, |
| | | fileDialogVisible: false, |
| | | getModalData: [], |
| | | selection: [], |
| | | total: 0, |
| | | searchData: { |
| | | code: "", |
| | | dictValue: "", |
| | | domainName: "", |
| | | name: "", |
| | | originalName: "", |
| | | current: "1", |
| | | size: "15" |
| | | }, |
| | |
| | | save: false, |
| | | allocation: false |
| | | }, |
| | | leftActive: true, |
| | | input: '', |
| | | options: [{ |
| | | value: 'é项1', |
| | | label: 'é»éç³' |
| | | }], |
| | | input3: '', |
| | | tableData: [] |
| | | } |
| | | }, |
| | |
| | | |
| | | }, |
| | | methods: { |
| | | exportFile(row,index){ |
| | | window.open(row.link); |
| | | }, |
| | | handleAvatarSuccess(res, file) { |
| | | this.fileDialogVisible = false; |
| | | this.searchClearBtn(); |
| | | }, |
| | | showUpload() { |
| | | this.fileDialogVisible = true; |
| | | }, |
| | | codeClick() { |
| | | |
| | | }, |
| | | addDictSuccess(addDictForm) { |
| | | this.searchClearBtn(); |
| | | }, |
| | | searchClearBtn() { |
| | | this.searchData = { |
| | | code: "", |
| | | dictValue: "", |
| | | domainName: "", |
| | | name: "", |
| | | originalName: "", |
| | | current: "1", |
| | | size: "15" |
| | | } |
| | |
| | | this.searchBtn(); |
| | | }, |
| | | searchBtn() { |
| | | this.$HTTP.get("/api/blade-system/dict/parent-list",this.searchData).then(res=> { |
| | | var obj = {}; |
| | | for(var key in this.searchData) { |
| | | if(this.searchData[key]) { |
| | | obj[key] = this.searchData[key]; |
| | | } |
| | | } |
| | | this.$HTTP.get("/api/blade-resource/attach/list",obj).then(res=> { |
| | | if(res.code == 200) { |
| | | this.tableData = res.data.records; |
| | | this.total = res.data.total; |
| | | console.log(this.tableData,this.tota) |
| | | } |
| | | }) |
| | | }, |
| | | //åå
¸é
ç½® |
| | | table_allocation(row) { |
| | | this.dialog.allocation = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.allocationDialog.open('edit').setData(row); |
| | | }) |
| | | }, |
| | | //å é¤ |
| | |
| | | this.$confirm(`ç¡®å®å°éæ©æ°æ®å é¤?`, '', { |
| | | type: 'warning' |
| | | }).then(() => { |
| | | this.$HTTP.post("/api/blade-system/dict/remove?ids="+row.id).then(res=> { |
| | | this.$HTTP.post("/api/blade-resource/attach/remove?ids="+row.id).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("æä½æå"); |
| | | that.searchBtn(); |
| | |
| | | }) |
| | | }).catch(() => { |
| | | |
| | | }) |
| | | }, |
| | | //æ·»å |
| | | addData(){ |
| | | this.dialog.save = true |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open() |
| | | }) |
| | | }, |
| | | table_edit(row){ |
| | | this.dialog.save = true |
| | | this.$HTTP.get("/api/blade-system/dict/detail?id="+row.id).then(res=> { |
| | | if(res.code == 200) { |
| | | this.dialog.save = true; |
| | | this.$nextTick(() => { |
| | | this.$refs.saveDialog.open('edit').setData(res.data); |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | //æ¥ç |
| | |
| | | handleSelectionChange(selection) { |
| | | this.selection = selection; |
| | | }, |
| | | delData() { |
| | | delFile() { |
| | | if(this.selection.length == 0) { |
| | | this.$message({ |
| | | message: 'è¯·éæ©è³å°ä¸æ¡æ°æ®', |
| | |
| | | }) |
| | | selStr = selStr.replace(/,$/, ''); |
| | | var that = this; |
| | | this.$HTTP.post("/api/blade-system/dict/remove?ids="+selStr).then(res=> { |
| | | this.$HTTP.post("/api/blade-resource/attach/remove?ids="+selStr).then(res=> { |
| | | if(res.code == 200) { |
| | | that.$message.success("æä½æå"); |
| | | that.searchclick(); |
| | |
| | | }, |
| | | changeDepartment() { |
| | | this.departmentVisible = true; |
| | | }, |
| | | changeTab(name) { |
| | | if(name == 1) { |
| | | this.leftActive = true; |
| | | }else { |
| | | this.leftActive = false; |
| | | } |
| | | }, |
| | | handleSizeChange(val) { |
| | | console.log(`æ¯é¡µ ${val} æ¡`); |
| | |
| | | padding-left: 8px; |
| | | padding-right: 8px; |
| | | } |
| | | .searchStatus { |
| | | margin-right: 6px; |
| | | width: 200px; |
| | | } |
| | | .dict-btn-bottom { |
| | | padding-left: 8px; |
| | | padding-right: 8px; |
| | |
| | | .multipleTableRef { |
| | | margin-bottom: 8px; |
| | | } |
| | | .attachSize { |
| | | color:#3b8e8e; |
| | | padding: 0 10px; |
| | | font-size: 12px; |
| | | background-color: #ebf4f4; |
| | | border: 1px solid #d8e8e8; |
| | | } |
| | | </style> |