清空
This commit is contained in:
@@ -1,279 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>资源分类</title>
|
||||
{include file="common/header"/}
|
||||
<el-form :inline="true">
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-plus" size="small" @click="clickAdd" plain>添加</el-button>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-delete" size="small" @click="postMultDelete" plain>批量删除</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-table :data="dataList" @selection-change="changeSelection" v-loading="loading">
|
||||
<el-table-column type="selection" width="50">
|
||||
</el-table-column>
|
||||
<el-table-column prop="source_category_id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="name" label="分类名称">
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" width="80">
|
||||
<template slot-scope="scope">
|
||||
<el-switch v-model="scope.row.status==1?true:false" active-color="#ff4949"
|
||||
@change="clickStatus(scope.row)">
|
||||
</el-switch>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" width="80">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-link type="primary" @click="clickEdit(scope.row)" :underline="false">编辑</el-link>
|
||||
<el-link type="danger" @click="clickDelete(scope.row)" :underline="false">删除</el-link>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<!-- 添加框 -->
|
||||
<el-dialog title="添加资源分类名称" :visible.sync="dialogFormAdd" width="500px" :modal-append-to-body='false' append-to-body :close-on-click-modal='false'>
|
||||
<el-form :model="formAdd" :rules="rules" ref="formAdd">
|
||||
|
||||
<el-form-item prop="name" label="分类名称" :label-width="formLabelWidth">
|
||||
<el-input size="medium" autocomplete="off" v-model="formAdd.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" label="排序" :label-width="formLabelWidth">
|
||||
<el-input-number v-model="formAdd.sort" :min="0" :max="999" size="medium" style="width: 120px;"
|
||||
controls-position="right" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="postAdd()">确认添加</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 修改框 -->
|
||||
<el-dialog title="修改资源分类信息" :visible.sync="dialogFormEdit" width="500px" :modal-append-to-body='false' append-to-body :close-on-click-modal='false'>
|
||||
<el-form :model="formEdit" :rules="rules" ref="formEdit">
|
||||
<el-form-item prop="name" label="分类名称" :label-width="formLabelWidth">
|
||||
<el-input size="medium" autocomplete="off" v-model="formEdit.name"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" label="排序" :label-width="formLabelWidth">
|
||||
<el-input-number v-model="formEdit.sort" :min="0" :max="999" size="medium" style="width: 120px;"
|
||||
controls-position="right" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="postEdit()">确认修改</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
{include file="common/footer"/}
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
this.getList();
|
||||
return {
|
||||
formLabelWidth: '80px',
|
||||
dialogFormAdd: false,
|
||||
dialogFormEdit: false,
|
||||
loading: true,
|
||||
dataList: [],
|
||||
selectList: [],
|
||||
formAdd: {
|
||||
sort: 0
|
||||
},
|
||||
formEdit: {
|
||||
},
|
||||
rules: {
|
||||
name: [ { required: true, message: '请输入分类名称', trigger: 'blur' }],
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
postMultDelete() {
|
||||
var that = this;
|
||||
if (that.selectList.length == 0) {
|
||||
that.$message.error('未选择任何分类!');
|
||||
return;
|
||||
}
|
||||
this.$confirm('即将删除选中的分类, 是否确认?', '批量删除', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.post('/admin/source_category/delete', Object.assign({}, PostBase, {
|
||||
source_category_id: that.selectList.join(",")
|
||||
}))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
changeSelection(list) {
|
||||
var that = this;
|
||||
that.selectList = [];
|
||||
for (var index in list) {
|
||||
that.selectList.push(list[index].source_category_id);
|
||||
}
|
||||
},
|
||||
postEdit() {
|
||||
var that = this;
|
||||
that.$refs["formEdit"].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('/admin/source_category/update', Object.assign({}, PostBase, that.formEdit))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
that.dialogFormEdit = false;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
postAdd() {
|
||||
var that = this;
|
||||
that.$refs['formAdd'].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('/admin/source_category/add', Object.assign({}, PostBase, that.formAdd))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
that.dialogFormAdd = false;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
clickAdd() {
|
||||
var that = this;
|
||||
that.formAdd = { sort: 0 };
|
||||
that.dialogFormAdd = true;
|
||||
},
|
||||
clickDelete(row) {
|
||||
var that = this;
|
||||
this.$confirm('即将删除这个分类, 是否确认?', '删除提醒', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.post('/admin/source_category/delete', Object.assign({}, PostBase, {
|
||||
source_category_id: row.source_category_id
|
||||
}))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
clickStatus(row) {
|
||||
var that = this;
|
||||
axios.post(row.status ? '/admin/source_category/enable' : '/admin/source_category/disable', Object.assign({}, PostBase, {
|
||||
source_category_id: row.source_category_id
|
||||
}))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
clickEdit(row) {
|
||||
var that = this;
|
||||
that.formEdit = row;
|
||||
axios.post('/admin/source_category/detail', Object.assign({}, PostBase, {
|
||||
source_category_id: row.source_category_id
|
||||
}))
|
||||
.then(function (response) {
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.formEdit = response.data.data;
|
||||
that.dialogFormEdit = true;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
},
|
||||
getList() {
|
||||
var that = this;
|
||||
that.loading = true;
|
||||
axios.post('/admin/source_category/getList', Object.assign({}, PostBase))
|
||||
.then(function (response) {
|
||||
that.loading = false;
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.dataList = response.data.data;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.loading = false;
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -1,212 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>{$node.node_title}</title>
|
||||
{include file="common/header"/}
|
||||
<el-card class="box-card" shadow="never">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>目前仅支持夸克</span>
|
||||
</div>
|
||||
<div class="text item">
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>设置夸克cookie</span>
|
||||
</div>
|
||||
<div style="font-size:14px;color:#666;">
|
||||
<el-form :model="form">
|
||||
<el-form-item>
|
||||
<el-input style="width: 100%;" v-model="form.cookie" placeholder="夸克云盘网页版的cookie"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<p>Tips:夸克云盘网页版的cookie,不懂如何获取请百度;填写并保存后才能使用下面功能</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<br>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>一键转存他人链接</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;font-size:14px;color:#666;">
|
||||
<font color=orangered>简单理解就是将别人的资源分享转成自己的并添加该资源到系统中</font>
|
||||
<p>功能说明:</p>
|
||||
<p>1、转存短剧资源到自己的网盘</p>
|
||||
<p>2、生成自己的分享链接</p>
|
||||
<p>3、将分享链接添加到该系统资源管理中</p>
|
||||
<p>Tips:该功能仅支持单条操作;资源标题重复的会跳过;复制他人分享的网盘链接,如:https://pan.quark.cn/s/fb8402aed9c4</p>
|
||||
</div>
|
||||
<el-button type="danger" @click="s1Btn">立即转存</el-button>
|
||||
</el-card>
|
||||
<br>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>每日自动更新</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;font-size:14px;color:#666;">
|
||||
<p>自动更新:<font color=orangered>转存当日及昨天的资源数据;</font></p>
|
||||
<font color=orangered>将此接口添加到计划任务中,计划任务每2个小时执行一次即可;接口地址:https://你的域名/api/source/day</font>
|
||||
<p>Tips:添加计划任务后方可生效;名称重复的资源会跳过转存;</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<br>
|
||||
<el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>转存心悦搜剧资源</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;font-size:14px;color:#666;">
|
||||
<p>全部转存:<font color=orangered>一键转存心悦搜剧所有资源到自己的网盘及系统中</font></p>
|
||||
<font color=orangered>全部转存速度比较慢,提交后请耐心等待;名称重复的资源会跳过转存;</font>
|
||||
<p>Tips:心悦搜剧:https://pan.xinyuedh.com;</p>
|
||||
</div>
|
||||
<el-button type="danger" @click="s2Btn">全部转存</el-button>
|
||||
</el-card>
|
||||
<!-- <el-card class="box-card">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>清除缓存</span>
|
||||
</div>
|
||||
<div style="margin-bottom: 20px;font-size:14px;color:#666;">
|
||||
清除缓存
|
||||
<font color=orangered>不可逆操作</font>
|
||||
</div>
|
||||
<el-button type="danger" @click="">清除缓存</el-button>
|
||||
</el-card> -->
|
||||
</div>
|
||||
</el-card>
|
||||
{include file="common/footer"/}
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
form: {
|
||||
cookie: '',
|
||||
},
|
||||
file: '',
|
||||
files: [],
|
||||
};
|
||||
},
|
||||
created() {
|
||||
this.getData();
|
||||
this.getFile()
|
||||
},
|
||||
methods: {
|
||||
getData(){
|
||||
let that = this
|
||||
axios.post('/admin/conf/getBaseConfig', Object.assign({}, PostBase))
|
||||
.then(function (response) {
|
||||
if (response.data.code == 200) {
|
||||
for (let item of response.data.data) {
|
||||
if(item.conf_key === 'quark_cookie'){
|
||||
that.form.cookie = item.conf_value
|
||||
}
|
||||
if(item.conf_key === 'quark_file'){
|
||||
that.file = item.conf_value
|
||||
}
|
||||
}
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
},
|
||||
onSubmit(){
|
||||
let that = this
|
||||
axios.post('/admin/conf/updateBaseConfig', Object.assign({}, PostBase, {
|
||||
quark_cookie: that.form.cookie
|
||||
}))
|
||||
.then(function (response) {
|
||||
if (response.data.code == 200) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
that.getFile()
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
|
||||
s1Btn(){
|
||||
let that = this
|
||||
this.$prompt('请输入夸克资源分享地址', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
inputPattern: /.+/,
|
||||
inputErrorMessage: '不能为空'
|
||||
}).then(({ value }) => {
|
||||
axios.post('/admin/source/transfer', Object.assign({}, PostBase, {
|
||||
url: value
|
||||
}))
|
||||
.then(function (res) {
|
||||
if (res.data.code == 200) {
|
||||
that.$message({
|
||||
message: res.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
that.$message.error(res.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
}).catch(() => {});
|
||||
},
|
||||
|
||||
s2Btn(){
|
||||
let that = this
|
||||
this.$confirm('全部转存速度比较慢,提交后请耐心等待, 是否继续?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.post('/admin/source/transferAll', Object.assign({}, PostBase))
|
||||
.then(function (res) {
|
||||
if (res.data.code == 200) {
|
||||
} else {
|
||||
that.$message.error(res.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
});
|
||||
that.$message({
|
||||
message: "已提交任务,稍后查看结果",
|
||||
type: 'success'
|
||||
});
|
||||
}).catch(() => {});
|
||||
|
||||
},
|
||||
|
||||
|
||||
getFile(){
|
||||
let that = this
|
||||
axios.post('/admin/source/getFiles', Object.assign({}, PostBase))
|
||||
.then(function (res) {
|
||||
if (res.data.code == 200) {
|
||||
that.files = res.data || []
|
||||
} else {
|
||||
that.$message.error(res.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -1,74 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>{$node.node_title}</title>
|
||||
{include file="common/header"/}
|
||||
|
||||
<el-table :data="dataList.data" v-loading="loading">
|
||||
<el-table-column prop="id" label="ID" align="center" width="100">
|
||||
</el-table-column>
|
||||
<el-table-column prop="content" label="用户想要的资源描述">
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="提交时间" align="center" width="200">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<div class="page">
|
||||
<el-pagination @size-change="handleSizeChange" :page-sizes="[10, 20, 50, 100,200,500]" :page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" background @current-change="changeCurrentPage"
|
||||
:current-page="dataList.current_page" :page-count="dataList.last_page" :total="dataList.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
{include file="common/footer"/}
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
dataList: [],
|
||||
form: {
|
||||
page: 1,
|
||||
per_page: 10,
|
||||
order: 'id desc'
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(per_page) {
|
||||
this.form.per_page = per_page;
|
||||
this.getList();
|
||||
},
|
||||
changeCurrentPage(page) {
|
||||
this.form.page = page;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
var that = this;
|
||||
that.loading = true;
|
||||
axios.post('/admin/feedback/getList', Object.assign({}, PostBase, that.form))
|
||||
.then(function (response) {
|
||||
that.loading = false;
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.dataList = response.data.data;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.loading = false;
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -1,417 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>{$node.node_title}</title>
|
||||
{include file="common/header"/}
|
||||
|
||||
<el-form :inline="true" @submit.native.prevent>
|
||||
<el-form-item>
|
||||
<el-button icon="el-icon-plus" size="small" @click="clickAdd" plain>添加资源</el-button>
|
||||
<el-button icon="el-icon-plus" size="small" @click="ImportShow" plain>导入资源</el-button>
|
||||
<el-button icon="el-icon-document-copy" size="small" @click="getExport" plain>导出资源</el-button>
|
||||
</el-form-item>
|
||||
<div style="float:right">
|
||||
<el-form-item style="width:120px;">
|
||||
<el-select size="small" v-model="search.source_category_id" placeholder="筛选分类">
|
||||
<el-option v-for="item in category" :key="item.source_category_id" :label="item.name" :value="item.source_category_id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-input placeholder="输入关键词搜索" size="small" v-model="search.keyword" @keyup.enter.native="getList_search"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="small" @click="getList_search" plain>搜索
|
||||
</el-button>
|
||||
<el-button icon="el-icon-refresh-left" size="small" @click="getList_search(0)" plain>重置</el-button>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
<el-table :data="dataList.data" v-loading="loading">
|
||||
<el-table-column prop="source_id" label="ID" width="60">
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="资源名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="source_category_id_name" label="资源分类">
|
||||
</el-table-column>
|
||||
<el-table-column prop="url" label="资源地址" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="is_top" label="置顶" width="90" align="center">
|
||||
<template slot-scope="scope">
|
||||
<p v-if="scope.row.is_top">
|
||||
<el-tag size="mini">置顶</el-tag>
|
||||
</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="sort" label="排序" width="90" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="入库时间" align="center" width="160">
|
||||
</el-table-column>
|
||||
<el-table-column prop="update_time" label="更新时间" align="center" width="160">
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="180" align="center">
|
||||
<template slot-scope="scope">
|
||||
<div class="order-text">
|
||||
<p>
|
||||
<el-link type="success" @click="clickEdit(scope.row)" :underline="false">编辑</el-link>
|
||||
</p>
|
||||
<p>
|
||||
<el-link type="danger" @click="clickDelete(scope.row)" :underline="false">删除</el-link>
|
||||
</p>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
|
||||
<div class="page">
|
||||
<el-pagination @size-change="handleSizeChange" :page-sizes="[10, 20, 50, 100,200,500]" :page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" background @current-change="changeCurrentPage"
|
||||
:current-page="dataList.current_page" :page-count="dataList.last_page" :total="dataList.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- 添加框 -->
|
||||
<el-dialog title="添加资源" :visible.sync="dialogFormAdd" :modal-append-to-body='false' append-to-body
|
||||
:close-on-click-modal='false' width="680px">
|
||||
<el-form :model="formAdd" :rules="rules" ref="formAdd">
|
||||
<el-form-item prop="source_category_id" label="资源分类" :label-width="formLabelWidth">
|
||||
<el-select size="medium" v-model="formAdd.source_category_id" placeholder="请选择分类">
|
||||
<el-option v-for="item in category" :key="item.source_category_id" :label="item.name" :value="item.source_category_id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="title" label="资源名称" :label-width="formLabelWidth">
|
||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源名称" v-model="formAdd.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="资源地址" :label-width="formLabelWidth">
|
||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源地址" v-model="formAdd.url"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" label="排序" :label-width="formLabelWidth">
|
||||
<el-input-number v-model="formAdd.sort" :min="0" :max="999" size="medium" style="width: 120px;"
|
||||
controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="is_top" label="置顶" :label-width="formLabelWidth">
|
||||
<el-switch v-model="formAdd.is_top"></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="postAdd()">确认添加</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
<!-- 修改框 -->
|
||||
<el-dialog title="修改资源" :visible.sync="dialogFormEdit" :modal-append-to-body='false' append-to-body
|
||||
:close-on-click-modal='false' width="680px">
|
||||
<el-form :model="formEdit" :rules="rules" ref="formEdit">
|
||||
<el-form-item prop="source_category_id" label="资源分类" :label-width="formLabelWidth">
|
||||
<el-select size="medium" v-model="formEdit.source_category_id" placeholder="请选择分类">
|
||||
<el-option v-for="item in category" :key="item.source_category_id" :label="item.name"
|
||||
:value="item.source_category_id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item prop="title" label="资源名称" :label-width="formLabelWidth">
|
||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源名称" v-model="formEdit.title"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="url" label="资源地址" :label-width="formLabelWidth">
|
||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源地址" v-model="formEdit.url"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item prop="sort" label="排序" :label-width="formLabelWidth">
|
||||
<el-input-number v-model="formEdit.sort" :min="0" :max="999" size="medium" style="width: 120px;"
|
||||
controls-position="right" />
|
||||
</el-form-item>
|
||||
<el-form-item prop="is_top" label="置顶" :label-width="formLabelWidth">
|
||||
<el-switch v-model="formEdit.is_top"></el-switch>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="postEdit()">确认修改</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 导入数据 -->
|
||||
<el-dialog title="导入资源" :visible.sync="dialogImport" :modal-append-to-body='false' append-to-body
|
||||
:close-on-click-modal='false' width="600px">
|
||||
<el-form :model="Importform">
|
||||
<el-form-item prop="source_category_id" label="资源分类" :label-width="formLabelWidth">
|
||||
<el-select size="medium" v-model="Importform.source_category_id" placeholder="请选择分类">
|
||||
<el-option v-for="item in category" :key="item.source_category_id" :label="item.name"
|
||||
:value="item.source_category_id">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="" :label-width="formLabelWidth">
|
||||
<el-upload class="upload-demo" :data="Importform" name="file"
|
||||
ref="ImportUpload"
|
||||
drag
|
||||
:auto-upload="false"
|
||||
limit="1"
|
||||
:on-exceed="handleExceed"
|
||||
:on-success="handleAvatarSuccess"
|
||||
action="/admin/source/imports"
|
||||
accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
|
||||
<i class="el-icon-upload"></i>
|
||||
<div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
||||
</el-upload>
|
||||
<span style="color: #999;">请导入夸克官方导出的csv文件</span>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" @click="ImportPost()">提交</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
{include file="common/footer"/}
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
search: {
|
||||
keyword: "",
|
||||
filter: "title",
|
||||
source_category_id: ''
|
||||
},
|
||||
formLabelWidth: '120px',
|
||||
dialogFormAdd: false,
|
||||
dialogFormEdit: false,
|
||||
loading: true,
|
||||
dataList: [],
|
||||
form: {
|
||||
page: 1,
|
||||
per_page: 10,
|
||||
order: 'source_id desc'
|
||||
},
|
||||
formAdd: {
|
||||
},
|
||||
formEdit: {
|
||||
},
|
||||
rules: {
|
||||
title: [{ required: true, message: '请输入资源名称', trigger: 'blur' }],
|
||||
url: [{ required: true, message: '请输入资源地址', trigger: 'blur' }],
|
||||
},
|
||||
dialogImport: false,
|
||||
Importform: {
|
||||
|
||||
},
|
||||
|
||||
category: [],
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getcategory();
|
||||
},
|
||||
methods: {
|
||||
getList_search(val) {
|
||||
if (val == 0) {
|
||||
this.search = {
|
||||
keyword: "",
|
||||
filter: "title",
|
||||
source_category_id: ''
|
||||
}
|
||||
}
|
||||
this.form.page = 1;
|
||||
this.getList();
|
||||
},
|
||||
handleSizeChange(per_page) {
|
||||
this.form.per_page = per_page;
|
||||
this.getList();
|
||||
},
|
||||
postEdit() {
|
||||
var that = this;
|
||||
that.$refs["formEdit"].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('/admin/source/update', Object.assign({}, PostBase, that.formEdit))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
that.dialogFormEdit = false;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
postAdd() {
|
||||
var that = this;
|
||||
that.$refs['formAdd'].validate((valid) => {
|
||||
if (valid) {
|
||||
axios.post('/admin/source/add', Object.assign({}, PostBase, that.formAdd))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
that.dialogFormAdd = false;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
clickAdd() {
|
||||
var that = this;
|
||||
that.formAdd = { status: 1, share_image: '' };
|
||||
that.dialogFormAdd = true;
|
||||
},
|
||||
clickDelete(row) {
|
||||
var that = this;
|
||||
this.$confirm('删除后,资源将无法查看,是否继续删除?', '删除提醒', {
|
||||
confirmButtonText: '删除',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
axios.post('/admin/source/delete', Object.assign({}, PostBase, {
|
||||
source_id: row.source_id
|
||||
}))
|
||||
.then(function (response) {
|
||||
that.getList();
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.$message({
|
||||
message: response.data.message,
|
||||
type: 'success'
|
||||
});
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
}).catch(() => {
|
||||
});
|
||||
},
|
||||
clickEdit(row) {
|
||||
var that = this;
|
||||
that.formEdit = row;
|
||||
axios.post('/admin/source/detail', Object.assign({}, PostBase, {
|
||||
source_id: row.source_id
|
||||
}))
|
||||
.then(function (response) {
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
response.data.data.source_category_id = response.data.data.source_category_id || undefined
|
||||
response.data.data.is_top = response.data.data.is_top?true:false
|
||||
that.formEdit = response.data.data;
|
||||
that.dialogFormEdit = true;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
},
|
||||
changeCurrentPage(page) {
|
||||
this.form.page = page;
|
||||
this.getList();
|
||||
},
|
||||
getcategory(){
|
||||
var that = this;
|
||||
axios.post('/admin/source_category/getList', Object.assign({}, PostBase))
|
||||
.then(function (response) {
|
||||
that.loading = false;
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.category = response.data.data;
|
||||
that.getList();
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.loading = false;
|
||||
that.$message.error('服务器内部错误');
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
getList() {
|
||||
var that = this;
|
||||
that.loading = true;
|
||||
axios.post('/admin/source/getList', Object.assign({}, PostBase, that.form, that.search))
|
||||
.then(function (response) {
|
||||
that.loading = false;
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.dataList = response.data.data;
|
||||
that.setcategory()
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.loading = false;
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
},
|
||||
setcategory(){
|
||||
for (let item of this.dataList.data) {
|
||||
for (let items of this.category) {
|
||||
if(item.source_category_id == items.source_category_id){
|
||||
item.source_category_id_name = items.name
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
//导入数据
|
||||
ImportShow() {
|
||||
this.Importform = {
|
||||
}
|
||||
this.dialogImport = true
|
||||
},
|
||||
handleExceed(files, fileList) {
|
||||
this.$message.warning(`只能选择一个文件`);
|
||||
},
|
||||
handleAvatarSuccess(res, file) {
|
||||
if (res.code == 200) {
|
||||
this.getList();
|
||||
this.$message({
|
||||
message: res.message,
|
||||
type: 'success'
|
||||
});
|
||||
this.dialogImport = false;
|
||||
} else {
|
||||
this.$message.error(res.message);
|
||||
}
|
||||
this.$refs.ImportUpload.clearFiles();
|
||||
},
|
||||
ImportPost(){
|
||||
this.Importform = Object.assign(this.Importform, PostBase)
|
||||
this.$nextTick(() => {
|
||||
this.$refs.ImportUpload.submit();
|
||||
})
|
||||
},
|
||||
|
||||
//数据导出
|
||||
getExport(){
|
||||
var that = this;
|
||||
var filters = Object.assign({}, PostBase, that.search);
|
||||
var url = '/admin/source/excel?';
|
||||
for (let key in filters) {
|
||||
url += key + "=" + filters[key] + "&";
|
||||
}
|
||||
window.open(url);
|
||||
that.$message.success('数据导出成功');
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -1,90 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
<head>
|
||||
<title>{$node.node_title}</title>
|
||||
{include file="common/header"/}
|
||||
|
||||
<el-table :data="dataList.data" v-loading="loading">
|
||||
<el-table-column prop="name" label="转存任务名称">
|
||||
</el-table-column>
|
||||
<el-table-column prop="total_num" label="转存总数" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="new_num" label="新增数" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="skip_num" label="重复跳过" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column prop="fail_num" label="失败数" align="center">
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag v-if="scope.row.end_time">已完成</el-tag>
|
||||
<el-tag type="danger" v-else>转存中</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="create_time" label="时间" align="center" width="240">
|
||||
<template slot-scope="scope">
|
||||
<p>任务开始:{{scope.row.create_time}}</p>
|
||||
<p v-if="scope.row.end_time">任务结束:{{scope.row.end_time}}</p>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
|
||||
<div class="page">
|
||||
<el-pagination @size-change="handleSizeChange" :page-sizes="[10, 20, 50, 100,200,500]" :page-size="10"
|
||||
layout="total, sizes, prev, pager, next, jumper" background @current-change="changeCurrentPage"
|
||||
:current-page="dataList.current_page" :page-count="dataList.last_page" :total="dataList.total">
|
||||
</el-pagination>
|
||||
</div>
|
||||
|
||||
{include file="common/footer"/}
|
||||
<script>
|
||||
var app = new Vue({
|
||||
el: '#app',
|
||||
data() {
|
||||
return {
|
||||
loading: true,
|
||||
dataList: [],
|
||||
form: {
|
||||
page: 1,
|
||||
per_page: 10,
|
||||
order: 'source_log_id desc'
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods: {
|
||||
handleSizeChange(per_page) {
|
||||
this.form.per_page = per_page;
|
||||
this.getList();
|
||||
},
|
||||
changeCurrentPage(page) {
|
||||
this.form.page = page;
|
||||
this.getList();
|
||||
},
|
||||
getList() {
|
||||
var that = this;
|
||||
that.loading = true;
|
||||
axios.post('/admin/source_log/getList', Object.assign({}, PostBase, that.form))
|
||||
.then(function (response) {
|
||||
that.loading = false;
|
||||
if (response.data.code == CODE_SUCCESS) {
|
||||
that.dataList = response.data.data;
|
||||
} else {
|
||||
that.$message.error(response.data.message);
|
||||
}
|
||||
})
|
||||
.catch(function (error) {
|
||||
that.loading = false;
|
||||
that.$message.error('服务器内部错误');
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
</html>
|
||||
Reference in New Issue
Block a user