Commit ec541dd1 authored by hzl's avatar hzl

feat: 处理缓存bug和添加count字段

parent 69cc1448
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
<span v-else style="color: #999;">暂无备注</span> <span v-else style="color: #999;">暂无备注</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="count" label="文件数量" width="100" align="center">
<template slot-scope="scope">
<el-tag type="info" size="small">{{ scope.row.count || 0 }}</el-tag>
</template>
</el-table-column>
<el-table-column label="操作" align="center" width="120"> <el-table-column label="操作" align="center" width="120">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button <el-button
...@@ -118,7 +123,7 @@ ...@@ -118,7 +123,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button> <el-button @click="handleCancel">取消</el-button>
<el-button type="primary" @click="submitForm" :loading="submitLoading">确定</el-button> <el-button type="primary" @click="submitForm" :loading="submitLoading">确定</el-button>
</div> </div>
</el-dialog> </el-dialog>
...@@ -492,14 +497,35 @@ export default { ...@@ -492,14 +497,35 @@ export default {
this.dialogTitle = '新增资源组' this.dialogTitle = '新增资源组'
this.dialogVisible = true this.dialogVisible = true
// 重置表单验证 // 重置表单验证和上传组件
this.$nextTick(() => { this.$nextTick(() => {
if (this.$refs.form) { if (this.$refs.form) {
this.$refs.form.resetFields() this.$refs.form.resetFields()
} }
// 重置上传组件状态
if (this.$refs.uploadComponent) {
this.$refs.uploadComponent.reset()
}
}) })
}, },
// 处理取消
handleCancel() {
// 重置上传组件状态
if (this.$refs.uploadComponent) {
this.$refs.uploadComponent.reset()
}
// 清空表单数据
this.form = {
id: null,
name: '',
uploadedFiles: [],
remark: ''
}
// 关闭对话框
this.dialogVisible = false
},
// 处理详情 // 处理详情
handleDetail(row) { handleDetail(row) {
this.currentResourceGroup = row this.currentResourceGroup = row
...@@ -572,6 +598,10 @@ export default { ...@@ -572,6 +598,10 @@ export default {
createResourceGroup(formData).then(response => { createResourceGroup(formData).then(response => {
if (response.status === 200) { if (response.status === 200) {
this.$message.success('创建成功') this.$message.success('创建成功')
// 重置上传组件状态
if (this.$refs.uploadComponent) {
this.$refs.uploadComponent.reset()
}
this.dialogVisible = false this.dialogVisible = false
this.fetchData() this.fetchData()
} else { } else {
......
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