Commit 879010d6 authored by 徐一鸣's avatar 徐一鸣

sdk类型管理

parent 15a254da
......@@ -661,8 +661,8 @@ border-radius:8px;
.apaas_button .el-button--danger {
color: #fff;
background-color: #e15260;
border-color: #e15260;
background-color: #ad3a4a;
border-color: #ad3a4a;
}
.apaas_button .el-button.is-disabled,
......@@ -1194,4 +1194,7 @@ border-radius:8px;
}
.el-checkbox__input:hover .el-checkbox__inner {
border-color: #515fe7;
}
.el-date-editor .el-range-input {
width: 36%;
}
\ No newline at end of file
......@@ -80,9 +80,12 @@
</div>
<div class="list-container" v-else>
<list-table
ref="listTable"
:header="listHeader"
:data="listData"
:padding-left="listPaddingLeft"
:select="listSelect"
@select="selectAction"
></list-table>
</div>
......@@ -146,6 +149,10 @@ export default {
type: String,
default: () => "请输入关键字",
},
listSelect: {
type: Boolean,
default: false,
},
},
data: () => ({
showListFilter: false,
......@@ -223,6 +230,15 @@ export default {
});
}, 200);
},
selectAction(selectedItems) {
this.$emit("list-select", selectedItems);
},
clearSelection() {
this.$refs.listTable.clearSelection();
},
setSelectedRow(row, flag) {
this.$refs.listTable.setSelectedRow(row, flag);
},
},
mounted() {
this.initOtherFilter();
......
<template>
<div class="apass_table">
<el-table
ref="apassTable"
:data="data"
@sort-change="sortChange"
@row-click="rowClick"
@selection-change="selectAction"
:row-class-name="rowClassName"
>
<el-table-column
v-if="paddingLeft > 10"
:width="paddingLeft - 10"
></el-table-column>
<el-table-column type="selection" width="80" align="center" v-if="select">
<!-- checkbox -->
</el-table-column>
<el-table-column
v-for="(item, index) in header"
:label="item.label"
......@@ -303,6 +308,10 @@ export default {
type: Function,
default: null,
},
select: {
type: Boolean,
default: false,
},
},
data() {
return {
......@@ -395,6 +404,15 @@ export default {
leaveMoreActionList() {
this.showMoreActionList = false;
},
selectAction(selectedItems) {
this.$emit("select", selectedItems);
},
clearSelection() {
this.$refs.apassTable.clearSelection();
},
setSelectedRow(row, flag) {
this.$refs.apassTable.toggleRowSelection(row, flag);
},
},
};
</script>
......
<template>
<el-upload
drag
action="/apaas/static/file/upload"
:data="{
directory: 'sdk',
uniqueCode: false,
}"
:file-list="fileList"
:before-upload="beforeUpload"
:on-success="uploadSuccess"
>
<i class="el-icon-upload"></i>
<div class="el-upload__text">
<p>将文件拖到此处,或<em>点击上传</em></p>
<p class="upload_tip" v-if="tip" v-text="tip"></p>
</div>
</el-upload>
</template>
<script>
export default {
model: {
prop: "url",
event: "change",
},
props: {
url: {
type: String,
default: "",
},
tip: {
type: String,
default: "",
},
},
computed: {
fileList() {
let list = [];
if (this.url) {
let path = this.url.split("/");
list = [
{
name: path[path.length - 1],
url: this.url,
},
];
}
return list;
},
},
methods: {
getFileType(fileName) {
let startIndex = fileName.lastIndexOf(".");
if (startIndex != -1) {
return fileName
.substring(startIndex + 1, fileName.length)
.toLowerCase();
} else {
return "";
}
},
beforeUpload(file) {
const filtType = this.getFileType(file.name);
if (filtType === "rar" || filtType === "zip") {
return true;
} else {
this.$message.error("仅支持rar和zip格式!");
return false;
}
},
uploadSuccess({ data }) {
this.$emit("change", data);
},
},
};
</script>
<style scoped>
.upload_tip {
font-size: 12px;
line-height: 20px;
color: #a9aec0;
}
</style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment