From 6ce55f27b5681f1934ef45be187045e58f394ebd Mon Sep 17 00:00:00 2001
From: lzhe <181968431@qq.com>
Date: 星期一, 15 四月 2024 23:43:56 +0800
Subject: [PATCH] 1
---
src/views/console/authority/datascope.vue | 202 +++++++++++++++++++++++++++++++++
src/views/console/resource/attach.vue | 140 +++++++++++------------
2 files changed, 268 insertions(+), 74 deletions(-)
diff --git a/src/views/console/authority/datascope.vue b/src/views/console/authority/datascope.vue
new file mode 100644
index 0000000..1f5b2ae
--- /dev/null
+++ b/src/views/console/authority/datascope.vue
@@ -0,0 +1,202 @@
+<!--
+ * @Author: lzhe lzhe@example.com
+ * @Date: 2024-03-26 10:28:33
+ * @LastEditors: lzhe lzhe@example.com
+ * @LastEditTime: 2024-04-02 17:48:31
+ * @FilePath: /smart-web/src/views/master/person/main/index.vue
+ * @Description: 杩欐槸榛樿璁剧疆,璇疯缃甡customMade`, 鎵撳紑koroFileHeader鏌ョ湅閰嶇疆 杩涜璁剧疆: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
+-->
+<template>
+ <div class="dict-main">
+ <el-form :inline="true" :model="searchData" abel-width="120px">
+ <el-form-item label="鑿滃崟鍚嶇О">
+ <el-input v-model="searchData.name" placeholder="鑿滃崟鍚嶇О" clearable />
+ </el-form-item>
+ <el-form-item label="鑿滃崟缂栧彿">
+ <el-input v-model="searchData.code" placeholder="鑿滃崟缂栧彿" clearable></el-input>
+ </el-form-item>
+ <el-form-item label="鎵�灞炲簲鐢�">
+ <el-select v-model="searchData.belongApplication" style="width: 100%">
+ <el-option key="CPS" label="CPS" value="CPS"/>
+ <el-option key="FMS" label="FMS" value="FMS"/>
+ </el-select>
+ </el-form-item>
+ <el-form-item>
+ <el-button type="primary" @click="searchclick">鎼滅储</el-button>
+ <el-button @click="searchClearBtn">娓呯┖</el-button>
+ </el-form-item>
+ </el-form>
+ <div>
+ <div class="dict-table">
+ <el-table ref="multipleTableRef" :data="tableData" border row-key="id" style="width: 100%" class="multipleTableRef" @selection-change="handleSelectionChange" :tree-props="{ children: 'children', hasChildren: 'has' }">
+ <el-table-column type="selection" width="55" />
+ <el-table-column prop="name" label="鑿滃崟鍚嶇О"></el-table-column>
+ <el-table-column prop="path" label="璺敱鍦板潃"></el-table-column>
+ <el-table-column prop="source" label="鑿滃崟鍥炬爣">
+ <template #default="scope">
+ <component v-if="icons.includes(scope.row.source)" style="width: 20px;height: 20px;"
+ :is='scope.row.source'></component>
+ </template>
+ </el-table-column>
+ <el-table-column prop="code" label="鑿滃崟缂栧彿"></el-table-column>
+ <el-table-column prop="alias" label="鑿滃崟鍒悕"></el-table-column>
+ <el-table-column prop="sort" label="鑿滃崟鎺掑簭"></el-table-column>
+ <el-table-column prop="isOpen" label="鏂扮獥鍙�">
+ <template #default="scope">
+ <div>{{scope.row.isOpen == 0?"鏄�":"鍚�"}}</div>
+ </template>
+ </el-table-column>
+ <el-table-column prop="belongApplication" label="鎵�灞炲簲鐢�"></el-table-column>
+ <!-- <el-table-column prop="attachSize" label="闄勪欢澶у皬">
+ <template #default="scope">
+ <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_del(scope.row, scope.$index)">鏉冮檺閰嶇疆</el-button>
+ </template>
+ </el-table-column>
+ </el-table>
+ </div>
+ </div>
+ </div>
+</template>
+<script>
+ import * as ElementPlusIconsVue from '@element-plus/icons-vue'
+ let icons = []
+ for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
+ icons.push(key)
+ }
+ export default {
+ name: "attach",
+ data(){
+ return {
+ icons,
+ belongApplicationList: [],
+ fileDialogVisible: false,
+ getModalData: [],
+ selection: [],
+ total: 0,
+ searchData: {
+ name: "",
+ code: "",
+ belongApplication: "",
+ parentId: ""
+ },
+ dialog: {
+ save: false,
+ allocation: false
+ },
+ tableData: []
+ }
+ },
+ created(){
+
+ },
+ mounted(){
+ this.searchBtn();
+ },
+ components: {
+ ...ElementPlusIconsVue
+ },
+ methods: {
+ exportFile(row,index){
+ window.open(row.link);
+ },
+ codeClick() {
+
+ },
+ searchClearBtn() {
+ this.searchData = {
+ name: "",
+ code: "",
+ belongApplication: "",
+ parentId: ""
+ }
+ this.searchBtn();
+ },
+ searchclick() {
+ this.searchBtn();
+ },
+ searchBtn() {
+ var obj = {};
+ for(var key in this.searchData) {
+ if(this.searchData[key]) {
+ obj[key] = this.searchData[key];
+ }
+ }
+ this.$HTTP.get("/api/blade-system/menu/lazy-menu-list",obj).then(res=> {
+ if(res.code == 200) {
+ this.tableData = res.data;
+ }
+ })
+ },
+ //鍒犻櫎
+ table_del(row) {
+
+ },
+ //鏌ョ湅
+ table_show(row){
+ this.dialog.save = true
+ this.$nextTick(() => {
+ this.$refs.saveDialog.open('show').setData(row)
+ })
+ },
+ handleSelectionChange(selection) {
+ this.selection = selection;
+ },
+ changeDepartment() {
+ this.departmentVisible = true;
+ },
+ handleSizeChange(val) {
+ console.log(`姣忛〉 ${val} 鏉);
+ this.searchData.current = "1";
+ this.searchData.size = val;
+ this.searchBtn();
+ },
+ handleCurrentChange(val) {
+ console.log(`褰撳墠椤�: ${val}`);
+ this.searchData.current = val;
+ this.searchBtn();
+ }
+ }
+ }
+</script>
+
+<style scoped>
+ .dict-main {
+ background-color: #fff;
+ margin: 8px;
+ padding: 8px;
+ }
+ .dict-Btn {
+ display: flex;
+ justify-content: space-between;
+ border-bottom: 1px solid #dcdfe6;
+ margin-bottom: 8px;
+ padding-left: 8px;
+ padding-right: 8px;
+ }
+ .dict-btn-bottom {
+ padding-left: 8px;
+ padding-right: 8px;
+ margin-bottom: 8px;
+ }
+ .dict-table {
+ padding-left: 8px;
+ padding-right: 8px;
+ margin-bottom: 8px;
+
+ }
+ .multipleTableRef {
+ margin-bottom: 8px;
+ }
+ .attachSize {
+ color:#3b8e8e;
+ padding: 0 10px;
+ font-size: 12px;
+ background-color: #ebf4f4;
+ border: 1px solid #d8e8e8;
+ }
+</style>
diff --git a/src/views/console/resource/attach.vue b/src/views/console/resource/attach.vue
index fa9a24a..90b8a14 100644
--- a/src/views/console/resource/attach.vue
+++ b/src/views/console/resource/attach.vue
@@ -9,11 +9,14 @@
<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>
@@ -22,32 +25,28 @@
</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>
@@ -63,20 +62,34 @@
</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"
},
@@ -84,13 +97,6 @@
save: false,
allocation: false
},
- leftActive: true,
- input: '',
- options: [{
- value: '閫夐」1',
- label: '榛勯噾绯�'
- }],
- input3: '',
tableData: []
}
},
@@ -104,16 +110,24 @@
},
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"
}
@@ -125,18 +139,18 @@
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);
})
},
//鍒犻櫎
@@ -145,7 +159,7 @@
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();
@@ -153,24 +167,6 @@
})
}).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);
- })
- }
})
},
//鏌ョ湅
@@ -183,7 +179,7 @@
handleSelectionChange(selection) {
this.selection = selection;
},
- delData() {
+ delFile() {
if(this.selection.length == 0) {
this.$message({
message: '璇烽�夋嫨鑷冲皯涓�鏉℃暟鎹�',
@@ -197,7 +193,7 @@
})
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();
@@ -206,13 +202,6 @@
},
changeDepartment() {
this.departmentVisible = true;
- },
- changeTab(name) {
- if(name == 1) {
- this.leftActive = true;
- }else {
- this.leftActive = false;
- }
},
handleSizeChange(val) {
console.log(`姣忛〉 ${val} 鏉);
@@ -243,10 +232,6 @@
padding-left: 8px;
padding-right: 8px;
}
- .searchStatus {
- margin-right: 6px;
- width: 200px;
- }
.dict-btn-bottom {
padding-left: 8px;
padding-right: 8px;
@@ -261,4 +246,11 @@
.multipleTableRef {
margin-bottom: 8px;
}
+ .attachSize {
+ color:#3b8e8e;
+ padding: 0 10px;
+ font-size: 12px;
+ background-color: #ebf4f4;
+ border: 1px solid #d8e8e8;
+ }
</style>
--
Gitblit v1.9.3