文件

137 行
4.7 KiB
HTML
可执行文件

<!--[1.6.73]-->
<style>
.group-box {
line-height: 30px;
margin-bottom: 30px;
}
.group-title {
font-weight: normal;
padding-right: 10px;
}
.tips {
font-weight: normal;
color: #aaaaaa;
font-size: 13px;
padding-left: 30px;
}
</style>
<div id="SystemCacheApp">
<div style="margin: 10px 0 0 40px">
<el-checkbox-group v-model="clear_data" class="group-box" :disabled="clearButtonDisabled">
<p>
<el-checkbox label="appPath">
<span class="group-title">历史版本</span>
<span>{{dataSize.appPath}}KB</span>
<span class="tips">历史更新时备份的主要模块代码包(确认不想回滚代码时可清除)</span>
</el-checkbox>
</p>
<p>
<el-checkbox label="tempApp">
<span class="group-title">版本压缩包</span>
<span>{{dataSize.tempApp}}KB</span>
<span class="tips">历史更新时下载的更新文件代码包(可随时清理)</span>
</el-checkbox>
</p>
<p>
<el-checkbox label="runtime">
<span class="group-title">缓存文件</span>
<span>{{dataSize.runtime}}KB</span>
<span class="tips">数据缓存文件(谨慎清理,建议在确认无人使用系统其它功能时清理)</span>
</el-checkbox>
</p>
</el-checkbox-group>
<el-button type="danger"
:disabled="clearButtonDisabled"
@click="clearData">
<span>清除</span>
<i v-if="isClear" class="el-icon-loading"></i>
</el-button>
</div>
</div>
<script>
var SystemCacheApp = new Vue({
el: '#SystemCacheApp',
data() {
return {
clear_data: [],
dataSize: {
appPath: 0,
tempApp: 0,
runtime: 0,
},
clearButtonDisabled: true,
isClear: false,
}
},
methods: {
//清除数据
clearData() {
this.$confirm('确定删除已选数据吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.clearButtonDisabled = true;
this.isClear = true;
$.ajax({
url: '/index.php/Admin/Ucache/deldir',
type: "post",
data: {
clear_data: this.clear_data
},
success: (res) => {
this.clearButtonDisabled = false;
this.isClear = false;
if (res.status == 1) {
this.clear_data = [];
this.$message.success(res.msg);
this.unitData();
} else {
this.$message.error(res.msg);
}
},
error: () => {
this.clearButtonDisabled = false;
this.isClear = false;
}
})
}).catch(() => {
});
},
//获取数据
unitData() {
$.ajax({
url: '/index.php/Admin/Ucache/index',
type: "post",
data: {
clear_data: this.clear_data
},
success: (res) => {
if (res.status == 1) {
this.clearButtonDisabled = false;
this.dataSize = res.data;
} else {
this.$message.error(res.msg ? res.msg : '获取数据失败,请检查系统文件权限');
}
},
error: (error) => {
this.clearButtonDisabled = true;
this.$alert(error, '错误提示', {
confirmButtonText: '确定',
callback: action => {
}
});
}
})
}
},
created() {
this.unitData();
}
})
</script>