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

sdk类型管理

parent 15a254da
...@@ -661,8 +661,8 @@ border-radius:8px; ...@@ -661,8 +661,8 @@ border-radius:8px;
.apaas_button .el-button--danger { .apaas_button .el-button--danger {
color: #fff; color: #fff;
background-color: #e15260; background-color: #ad3a4a;
border-color: #e15260; border-color: #ad3a4a;
} }
.apaas_button .el-button.is-disabled, .apaas_button .el-button.is-disabled,
...@@ -1195,3 +1195,6 @@ border-radius:8px; ...@@ -1195,3 +1195,6 @@ border-radius:8px;
.el-checkbox__input:hover .el-checkbox__inner { .el-checkbox__input:hover .el-checkbox__inner {
border-color: #515fe7; border-color: #515fe7;
} }
.el-date-editor .el-range-input {
width: 36%;
}
\ No newline at end of file
...@@ -80,9 +80,12 @@ ...@@ -80,9 +80,12 @@
</div> </div>
<div class="list-container" v-else> <div class="list-container" v-else>
<list-table <list-table
ref="listTable"
:header="listHeader" :header="listHeader"
:data="listData" :data="listData"
:padding-left="listPaddingLeft" :padding-left="listPaddingLeft"
:select="listSelect"
@select="selectAction"
></list-table> ></list-table>
</div> </div>
...@@ -146,6 +149,10 @@ export default { ...@@ -146,6 +149,10 @@ export default {
type: String, type: String,
default: () => "请输入关键字", default: () => "请输入关键字",
}, },
listSelect: {
type: Boolean,
default: false,
},
}, },
data: () => ({ data: () => ({
showListFilter: false, showListFilter: false,
...@@ -223,6 +230,15 @@ export default { ...@@ -223,6 +230,15 @@ export default {
}); });
}, 200); }, 200);
}, },
selectAction(selectedItems) {
this.$emit("list-select", selectedItems);
},
clearSelection() {
this.$refs.listTable.clearSelection();
},
setSelectedRow(row, flag) {
this.$refs.listTable.setSelectedRow(row, flag);
},
}, },
mounted() { mounted() {
this.initOtherFilter(); this.initOtherFilter();
......
<template> <template>
<div class="apass_table"> <div class="apass_table">
<el-table <el-table
ref="apassTable"
:data="data" :data="data"
@sort-change="sortChange" @sort-change="sortChange"
@row-click="rowClick" @row-click="rowClick"
@selection-change="selectAction"
:row-class-name="rowClassName" :row-class-name="rowClassName"
> >
<el-table-column <el-table-column
v-if="paddingLeft > 10" v-if="paddingLeft > 10"
:width="paddingLeft - 10" :width="paddingLeft - 10"
></el-table-column> ></el-table-column>
<el-table-column type="selection" width="80" align="center" v-if="select">
<!-- checkbox -->
</el-table-column>
<el-table-column <el-table-column
v-for="(item, index) in header" v-for="(item, index) in header"
:label="item.label" :label="item.label"
...@@ -303,6 +308,10 @@ export default { ...@@ -303,6 +308,10 @@ export default {
type: Function, type: Function,
default: null, default: null,
}, },
select: {
type: Boolean,
default: false,
},
}, },
data() { data() {
return { return {
...@@ -395,6 +404,15 @@ export default { ...@@ -395,6 +404,15 @@ export default {
leaveMoreActionList() { leaveMoreActionList() {
this.showMoreActionList = false; this.showMoreActionList = false;
}, },
selectAction(selectedItems) {
this.$emit("select", selectedItems);
},
clearSelection() {
this.$refs.apassTable.clearSelection();
},
setSelectedRow(row, flag) {
this.$refs.apassTable.toggleRowSelection(row, flag);
},
}, },
}; };
</script> </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