增加分类
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
APP_DEBUG = true
|
APP_DEBUG = false
|
||||||
SYSTEM_SALT= YAdmin
|
SYSTEM_SALT= YAdmin
|
||||||
|
|
||||||
[APP]
|
[APP]
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ location / {
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
3、程序使用不收费,但不负责搭建,搭建过程遇到问题,可以私聊或群里咨询
|
||||||
|
完全小白可付费搭建,可联系作者或群友
|
||||||
|
|
||||||
|
|
||||||
## 后台管理截图
|
## 后台管理截图
|
||||||
|
|
||||||
@@ -75,3 +78,4 @@ location / {
|
|||||||
请加微信l1417716300,请备注来源
|
请加微信l1417716300,请备注来源
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -26,11 +26,11 @@ class Source extends QfShop
|
|||||||
];
|
];
|
||||||
$this->insertFields = [
|
$this->insertFields = [
|
||||||
//允许添加的字段列表
|
//允许添加的字段列表
|
||||||
"title","url","status","is_delete"
|
"source_category_id","title","url","status","is_delete","sort","is_top"
|
||||||
];
|
];
|
||||||
$this->updateFields = [
|
$this->updateFields = [
|
||||||
//允许更新的字段列表
|
//允许更新的字段列表
|
||||||
"title","url","status","is_delete"
|
"source_category_id","title","url","status","is_delete","sort","is_top"
|
||||||
];
|
];
|
||||||
$this->insertRequire = [
|
$this->insertRequire = [
|
||||||
//添加时必须填写的字段
|
//添加时必须填写的字段
|
||||||
@@ -65,8 +65,11 @@ class Source extends QfShop
|
|||||||
//从请求中获取筛选数据的数组
|
//从请求中获取筛选数据的数组
|
||||||
$map = $this->getDataFilterFromRequest();
|
$map = $this->getDataFilterFromRequest();
|
||||||
$map[] = ['is_delete','=',0];
|
$map[] = ['is_delete','=',0];
|
||||||
|
if(!empty(input('source_category_id'))){
|
||||||
|
$map[] = ['source_category_id','=',input('source_category_id')];
|
||||||
|
}
|
||||||
//从请求中获取排序方式
|
//从请求中获取排序方式
|
||||||
$order = $this->getorderfromRequest();
|
$order = ['is_top' => 'desc','sort' => 'desc','source_id' => 'desc'];
|
||||||
//设置Model中的 per_page
|
//设置Model中的 per_page
|
||||||
$this->setGetListPerPage();
|
$this->setGetListPerPage();
|
||||||
//查询数据
|
//查询数据
|
||||||
@@ -217,6 +220,7 @@ class Source extends QfShop
|
|||||||
|
|
||||||
//删除这个文件
|
//删除这个文件
|
||||||
unlink("./uploads/".$saveName);
|
unlink("./uploads/".$saveName);
|
||||||
|
|
||||||
// 生成二维码
|
// 生成二维码
|
||||||
foreach ($excel_array as $k => $v) {
|
foreach ($excel_array as $k => $v) {
|
||||||
$patterns = '/^\d+\.|\d+\-/';
|
$patterns = '/^\d+\.|\d+\-/';
|
||||||
@@ -238,6 +242,7 @@ class Source extends QfShop
|
|||||||
if (empty($res) && $url) {
|
if (empty($res) && $url) {
|
||||||
$data[$k]['title'] = $title;
|
$data[$k]['title'] = $title;
|
||||||
$data[$k]['url'] = $url;
|
$data[$k]['url'] = $url;
|
||||||
|
$data[$k]['source_category_id'] = input('source_category_id')??0;
|
||||||
$data[$k]['update_time'] = time();
|
$data[$k]['update_time'] = time();
|
||||||
$data[$k]['create_time'] = time();
|
$data[$k]['create_time'] = time();
|
||||||
$i++;
|
$i++;
|
||||||
|
|||||||
@@ -0,0 +1,258 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\admin\controller;
|
||||||
|
|
||||||
|
use think\App;
|
||||||
|
use app\admin\QfShop;
|
||||||
|
use app\model\SourceCategory as SourceCategoryModel;
|
||||||
|
|
||||||
|
class SourceCategory extends QfShop
|
||||||
|
{
|
||||||
|
public function __construct(App $app)
|
||||||
|
{
|
||||||
|
parent::__construct($app);
|
||||||
|
//查询列表时允许的字段
|
||||||
|
$this->selectList = "*";
|
||||||
|
//查询详情时允许的字段
|
||||||
|
$this->selectDetail = "*";
|
||||||
|
//筛选字段
|
||||||
|
$this->searchFilter = [
|
||||||
|
"source_category_id" => "=",
|
||||||
|
"name"=>"like"
|
||||||
|
];
|
||||||
|
$this->insertFields = [
|
||||||
|
//允许添加的字段列表
|
||||||
|
"name","sort","status"
|
||||||
|
];
|
||||||
|
$this->updateFields = [
|
||||||
|
//允许更新的字段列表
|
||||||
|
"name","sort","status"
|
||||||
|
];
|
||||||
|
$this->insertRequire = [
|
||||||
|
//添加时必须填写的字段
|
||||||
|
// "字段名称"=>"该字段不能为空"
|
||||||
|
"name"=>"分类名称必须填写",
|
||||||
|
];
|
||||||
|
$this->updateRequire = [
|
||||||
|
//修改时必须填写的字段
|
||||||
|
// "字段名称"=>"该字段不能为空"
|
||||||
|
"name"=>"分类名称必须填写",
|
||||||
|
];
|
||||||
|
$this->model = new SourceCategoryModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取列表接口
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function getList()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
//查询数据
|
||||||
|
$dataList = $this->model->order('sort', 'desc')->select();
|
||||||
|
return jok('数据获取成功', $dataList);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取详情基类 子类自动继承 如有特殊需求 可重写到子类 请勿修改父类方法
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function detail()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
$source_category_id = input("source_category_id");
|
||||||
|
if (!$source_category_id) {
|
||||||
|
return jerr("ID参数必须填写", 400);
|
||||||
|
}
|
||||||
|
//根据主键获取一行数据
|
||||||
|
$item = $this->model->where("source_category_id", $source_category_id)->field($this->selectDetail)->find();
|
||||||
|
if (empty($item)) {
|
||||||
|
return jerr("没有查询到数据", 404);
|
||||||
|
}
|
||||||
|
return jok('数据加载成功', $item);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 添加接口基类 子类自动继承 如有特殊需求 可重写到子类 请勿修改父类方法
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function add()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
//校验Insert字段是否填写
|
||||||
|
$error = $this->validateInsertFields();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
//从请求中获取Insert数据
|
||||||
|
$data = $this->getInsertDataFromRequest();
|
||||||
|
//添加这行数据
|
||||||
|
$data['create_time'] = time();
|
||||||
|
$data['update_time'] = time();
|
||||||
|
$this->model->insertGetId($data);
|
||||||
|
return jok('添加成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改接口基类 子类自动继承 如有特殊需求 可重写到子类 请勿修改父类方法
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function update()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
$source_category_id = input("source_category_id");
|
||||||
|
if (!$source_category_id) {
|
||||||
|
return jerr("ID参数必须填写", 400);
|
||||||
|
}
|
||||||
|
//根据主键获取一行数据
|
||||||
|
$item = $this->model->where("source_category_id", $source_category_id)->field($this->selectDetail)->find();
|
||||||
|
if (empty($item)) {
|
||||||
|
return jerr("数据查询失败", 404);
|
||||||
|
}
|
||||||
|
//校验Update字段是否填写
|
||||||
|
$error = $this->validateUpdateFields();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
//从请求中获取Update数据
|
||||||
|
$data = $this->getUpdateDataFromRequest();
|
||||||
|
//根据主键更新这条数据
|
||||||
|
$data['update_time'] = time();
|
||||||
|
$this->model->where("source_category_id", $source_category_id)->update($data);
|
||||||
|
return jok('修改成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除接口基类 子类自动继承 如有特殊需求 可重写到子类 请勿修改父类方法
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function delete()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
$source_category_id = input("source_category_id");
|
||||||
|
if (!$source_category_id) {
|
||||||
|
return jerr("ID参数必须填写", 400);
|
||||||
|
}
|
||||||
|
if (isInteger($source_category_id)) {
|
||||||
|
//根据主键获取一行数据
|
||||||
|
$item = $this->model->where("source_category_id", $source_category_id)->field($this->selectDetail)->find();
|
||||||
|
if (empty($item)) {
|
||||||
|
return jerr("数据查询失败", 404);
|
||||||
|
}
|
||||||
|
//单个操作
|
||||||
|
$map = ["source_category_id" => $source_category_id];
|
||||||
|
$this->model->where($map)->delete();
|
||||||
|
} else {
|
||||||
|
//批量操作
|
||||||
|
$list = explode(',', $source_category_id);
|
||||||
|
$this->model->where("source_category_id", 'in', $list)->delete();
|
||||||
|
}
|
||||||
|
return jok('删除成功');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 禁用接口基类 子类自动继承 如有特殊需求 可重写到子类 请勿修改父类方法
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function disable()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
$source_category_id = input("source_category_id");
|
||||||
|
if (!$source_category_id) {
|
||||||
|
return jerr("ID参数必须填写", 400);
|
||||||
|
}
|
||||||
|
if (isInteger($source_category_id)) {
|
||||||
|
//根据主键获取一行数据
|
||||||
|
$item = $this->model->where("source_category_id", $source_category_id)->field($this->selectDetail)->find();
|
||||||
|
if (empty($item)) {
|
||||||
|
return jerr("数据查询失败", 404);
|
||||||
|
}
|
||||||
|
//单个操作
|
||||||
|
$map = ["source_category_id" => $source_category_id];
|
||||||
|
$this->model->where($map)->update([
|
||||||
|
"status" => 1,
|
||||||
|
"update_time" => time(),
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
//批量操作
|
||||||
|
$list = explode(',', $source_category_id);
|
||||||
|
$this->model->where("source_category_id", 'in', $list)->update([
|
||||||
|
"status" => 1,
|
||||||
|
"update_time" => time(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return jok("禁用成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 启用接口基类 子类自动继承 如有特殊需求 可重写到子类 请勿修改父类方法
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function enable()
|
||||||
|
{
|
||||||
|
//校验Access与RBAC
|
||||||
|
$error = $this->access();
|
||||||
|
if ($error) {
|
||||||
|
return $error;
|
||||||
|
}
|
||||||
|
$source_category_id = input("source_category_id");
|
||||||
|
if (!$source_category_id) {
|
||||||
|
return jerr("ID参数必须填写", 400);
|
||||||
|
}
|
||||||
|
if (isInteger($source_category_id)) {
|
||||||
|
//根据主键获取一行数据
|
||||||
|
$item = $this->model->where("source_category_id", $source_category_id)->field($this->selectDetail)->find();
|
||||||
|
if (empty($item)) {
|
||||||
|
return jerr("数据查询失败", 404);
|
||||||
|
}
|
||||||
|
//单个操作
|
||||||
|
$map = ["source_category_id" => $source_category_id];
|
||||||
|
$this->model->where($map)->update([
|
||||||
|
"status" => 0,
|
||||||
|
"update_time" => time(),
|
||||||
|
]);
|
||||||
|
} else {
|
||||||
|
//批量操作
|
||||||
|
$list = explode(',', $source_category_id);
|
||||||
|
$this->model->where("source_category_id", 'in', $list)->update([
|
||||||
|
"status" => 0,
|
||||||
|
"update_time" => time(),
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
return jok("启用成功");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ namespace app\api\controller;
|
|||||||
|
|
||||||
use app\api\QfShop;
|
use app\api\QfShop;
|
||||||
use app\model\Source as SourceModel;
|
use app\model\Source as SourceModel;
|
||||||
|
use app\model\SourceCategory as SourceCategoryModel;
|
||||||
|
|
||||||
class Search extends QfShop
|
class Search extends QfShop
|
||||||
{
|
{
|
||||||
@@ -34,4 +35,11 @@ class Search extends QfShop
|
|||||||
$data = $SourceModel->getHot(input(''));
|
$data = $SourceModel->getHot(input(''));
|
||||||
return jok('获取成功',$data);
|
return jok('获取成功',$data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getCategory()
|
||||||
|
{
|
||||||
|
$SourceCategoryModel = new SourceCategoryModel();
|
||||||
|
$data = $SourceCategoryModel->getList(input(''));
|
||||||
|
return jok('获取成功',$data);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+21
-3
@@ -37,6 +37,19 @@ class Source extends QfShop
|
|||||||
'time' => 'timestamp',
|
'time' => 'timestamp',
|
||||||
];
|
];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* hasOne qf_source_category
|
||||||
|
* @access public
|
||||||
|
* @return mixed
|
||||||
|
*/
|
||||||
|
public function category()
|
||||||
|
{
|
||||||
|
return $this
|
||||||
|
->hasOne(SourceCategory::class, 'source_category_id', 'source_category_id')
|
||||||
|
->joinType('left')
|
||||||
|
->field('source_category_id,name');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @description: 获取一个信息
|
* @description: 获取一个信息
|
||||||
@@ -48,8 +61,8 @@ class Source extends QfShop
|
|||||||
$map[] = ['status', '=', 1];
|
$map[] = ['status', '=', 1];
|
||||||
$map[] = ['is_delete', '=', 0];
|
$map[] = ['is_delete', '=', 0];
|
||||||
$map[] = ['source_id', '=', $data['id']];
|
$map[] = ['source_id', '=', $data['id']];
|
||||||
$field = 'source_id as id,title,url,update_time as time';
|
$field = 'source_id as id,source_category_id,title,url,update_time as time';
|
||||||
$result = $this->where($map)->field($field)->find();
|
$result = $this->with('category')->where($map)->field($field)->find();
|
||||||
if(!is_null($result)){
|
if(!is_null($result)){
|
||||||
$result->inc('page_views')->update();
|
$result->inc('page_views')->update();
|
||||||
}
|
}
|
||||||
@@ -90,6 +103,10 @@ class Source extends QfShop
|
|||||||
unset($map[array_search(['is_time', '=', 0], $map)]);
|
unset($map[array_search(['is_time', '=', 0], $map)]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!empty($data['category_id'])){
|
||||||
|
$map[] = ['source_category_id', '=', $data['category_id']];
|
||||||
|
}
|
||||||
|
|
||||||
$result['total_result'] = $this->where($map)->count();
|
$result['total_result'] = $this->where($map)->count();
|
||||||
if ($result['total_result'] <= 0) {
|
if ($result['total_result'] <= 0) {
|
||||||
return $result;
|
return $result;
|
||||||
@@ -101,7 +118,8 @@ class Source extends QfShop
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result['items'] = $this->setDefaultOrder($order)
|
$result['items'] = $this->setDefaultOrder($order)
|
||||||
->field('source_id as id,title,url,update_time as time,is_time')
|
->field('source_id as id,source_category_id,title,url,update_time as time,is_time')
|
||||||
|
->with('category')
|
||||||
->where($map)
|
->where($map)
|
||||||
->withSearch(['page', 'order'], $data)
|
->withSearch(['page', 'order'], $data)
|
||||||
->select()->each(function($item,$key){
|
->select()->each(function($item,$key){
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace app\model;
|
||||||
|
|
||||||
|
use app\model\QfShop;
|
||||||
|
|
||||||
|
class SourceCategory extends QfShop
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 获取列表
|
||||||
|
* @access public
|
||||||
|
* @param array $data 外部数据
|
||||||
|
* @return array|false
|
||||||
|
* @throws
|
||||||
|
*/
|
||||||
|
public function getList(array $data)
|
||||||
|
{
|
||||||
|
|
||||||
|
// 搜索条件
|
||||||
|
$map = [];
|
||||||
|
$map[] = ['status', '=', 0];
|
||||||
|
$result = $this->where($map)->order('sort', 'desc')->select();
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,279 @@
|
|||||||
|
<!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>
|
||||||
@@ -12,6 +12,12 @@
|
|||||||
<el-button icon="el-icon-document-copy" size="small" @click="getExport" plain>导出资源</el-button>
|
<el-button icon="el-icon-document-copy" size="small" @click="getExport" plain>导出资源</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<div style="float:right">
|
<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-form-item>
|
||||||
<el-input placeholder="输入关键词搜索" size="small" v-model="search.keyword" @keyup.enter.native="getList_search"></el-input>
|
<el-input placeholder="输入关键词搜索" size="small" v-model="search.keyword" @keyup.enter.native="getList_search"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@@ -27,11 +33,22 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="title" label="资源名称">
|
<el-table-column prop="title" label="资源名称">
|
||||||
</el-table-column>
|
</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 prop="url" label="资源地址" align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column prop="create_time" label="入库时间" align="center" width="200">
|
<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>
|
||||||
<el-table-column prop="update_time" label="更新时间" align="center" width="200">
|
<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>
|
||||||
<el-table-column label="操作" width="180" align="center">
|
<el-table-column label="操作" width="180" align="center">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@@ -61,12 +78,25 @@
|
|||||||
<el-dialog title="添加资源" :visible.sync="dialogFormAdd" :modal-append-to-body='false' append-to-body
|
<el-dialog title="添加资源" :visible.sync="dialogFormAdd" :modal-append-to-body='false' append-to-body
|
||||||
:close-on-click-modal='false' width="680px">
|
:close-on-click-modal='false' width="680px">
|
||||||
<el-form :model="formAdd" :rules="rules" ref="formAdd">
|
<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-form-item prop="title" label="资源名称" :label-width="formLabelWidth">
|
||||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源名称" v-model="formAdd.title"></el-input>
|
<el-input size="medium" autocomplete="off" placeholder="请输入资源名称" v-model="formAdd.title"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="url" label="资源地址" :label-width="formLabelWidth">
|
<el-form-item prop="url" label="资源地址" :label-width="formLabelWidth">
|
||||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源地址" v-model="formAdd.url"></el-input>
|
<el-input size="medium" autocomplete="off" placeholder="请输入资源地址" v-model="formAdd.url"></el-input>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="postAdd()">确认添加</el-button>
|
<el-button type="primary" @click="postAdd()">确认添加</el-button>
|
||||||
@@ -76,12 +106,26 @@
|
|||||||
<el-dialog title="修改资源" :visible.sync="dialogFormEdit" :modal-append-to-body='false' append-to-body
|
<el-dialog title="修改资源" :visible.sync="dialogFormEdit" :modal-append-to-body='false' append-to-body
|
||||||
:close-on-click-modal='false' width="680px">
|
:close-on-click-modal='false' width="680px">
|
||||||
<el-form :model="formEdit" :rules="rules" ref="formEdit">
|
<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-form-item prop="title" label="资源名称" :label-width="formLabelWidth">
|
||||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源名称" v-model="formEdit.title"></el-input>
|
<el-input size="medium" autocomplete="off" placeholder="请输入资源名称" v-model="formEdit.title"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item prop="url" label="资源地址" :label-width="formLabelWidth">
|
<el-form-item prop="url" label="资源地址" :label-width="formLabelWidth">
|
||||||
<el-input size="medium" autocomplete="off" placeholder="请输入资源地址" v-model="formEdit.url"></el-input>
|
<el-input size="medium" autocomplete="off" placeholder="请输入资源地址" v-model="formEdit.url"></el-input>
|
||||||
</el-form-item>
|
</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>
|
</el-form>
|
||||||
<div slot="footer" class="dialog-footer">
|
<div slot="footer" class="dialog-footer">
|
||||||
<el-button type="primary" @click="postEdit()">确认修改</el-button>
|
<el-button type="primary" @click="postEdit()">确认修改</el-button>
|
||||||
@@ -92,7 +136,13 @@
|
|||||||
<el-dialog title="导入资源" :visible.sync="dialogImport" :modal-append-to-body='false' append-to-body
|
<el-dialog title="导入资源" :visible.sync="dialogImport" :modal-append-to-body='false' append-to-body
|
||||||
:close-on-click-modal='false' width="600px">
|
:close-on-click-modal='false' width="600px">
|
||||||
<el-form :model="Importform">
|
<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-form-item label="" :label-width="formLabelWidth">
|
||||||
<el-upload class="upload-demo" :data="Importform" name="file"
|
<el-upload class="upload-demo" :data="Importform" name="file"
|
||||||
ref="ImportUpload"
|
ref="ImportUpload"
|
||||||
@@ -122,7 +172,8 @@
|
|||||||
return {
|
return {
|
||||||
search: {
|
search: {
|
||||||
keyword: "",
|
keyword: "",
|
||||||
filter: "title"
|
filter: "title",
|
||||||
|
source_category_id: ''
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '120px',
|
||||||
dialogFormAdd: false,
|
dialogFormAdd: false,
|
||||||
@@ -146,17 +197,20 @@
|
|||||||
Importform: {
|
Importform: {
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
category: [],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
this.getList();
|
this.getcategory();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getList_search(val) {
|
getList_search(val) {
|
||||||
if (val == 0) {
|
if (val == 0) {
|
||||||
this.search = {
|
this.search = {
|
||||||
keyword: "",
|
keyword: "",
|
||||||
filter: "title"
|
filter: "title",
|
||||||
|
source_category_id: ''
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.form.page = 1;
|
this.form.page = 1;
|
||||||
@@ -253,6 +307,8 @@
|
|||||||
}))
|
}))
|
||||||
.then(function (response) {
|
.then(function (response) {
|
||||||
if (response.data.code == CODE_SUCCESS) {
|
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.formEdit = response.data.data;
|
||||||
that.dialogFormEdit = true;
|
that.dialogFormEdit = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -267,6 +323,24 @@
|
|||||||
this.form.page = page;
|
this.form.page = page;
|
||||||
this.getList();
|
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() {
|
getList() {
|
||||||
var that = this;
|
var that = this;
|
||||||
that.loading = true;
|
that.loading = true;
|
||||||
@@ -275,6 +349,7 @@
|
|||||||
that.loading = false;
|
that.loading = false;
|
||||||
if (response.data.code == CODE_SUCCESS) {
|
if (response.data.code == CODE_SUCCESS) {
|
||||||
that.dataList = response.data.data;
|
that.dataList = response.data.data;
|
||||||
|
that.setcategory()
|
||||||
} else {
|
} else {
|
||||||
that.$message.error(response.data.message);
|
that.$message.error(response.data.message);
|
||||||
}
|
}
|
||||||
@@ -284,6 +359,15 @@
|
|||||||
that.$message.error('服务器内部错误');
|
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() {
|
ImportShow() {
|
||||||
|
|||||||
@@ -249,10 +249,29 @@ INSERT INTO `qf_node` (`node_id`, `node_title`, `node_desc`, `node_module`, `nod
|
|||||||
(109, '资源管理', '', 'qfadmin', 'source', 'index', 108, 1, 1, 'el-icon-folder-opened', NULL, 0, 1622538567, 1712213423),
|
(109, '资源管理', '', 'qfadmin', 'source', 'index', 108, 1, 1, 'el-icon-folder-opened', NULL, 0, 1622538567, 1712213423),
|
||||||
(112, '转存管理', '', 'qfadmin', 'source', 'deposit', 108, 1, 1, 'el-icon-crop', NULL, 0, 1712112542, 1712213455),
|
(112, '转存管理', '', 'qfadmin', 'source', 'deposit', 108, 1, 1, 'el-icon-crop', NULL, 0, 1712112542, 1712213455),
|
||||||
(113, '转存日志', '', 'qfadmin', 'source', 'log', 108, 1, 1, 'el-icon-discover', NULL, 0, 1712208103, 1712213467),
|
(113, '转存日志', '', 'qfadmin', 'source', 'log', 108, 1, 1, 'el-icon-discover', NULL, 0, 1712208103, 1712213467),
|
||||||
(114, '用户需求', '', 'qfadmin', 'source', 'feedback', 108, 1, 1, 'el-icon-edit', NULL, 0, 1712230638, 1712230717);
|
(114, '用户需求', '', 'qfadmin', 'source', 'feedback', 108, 1, 1, 'el-icon-edit', NULL, 0, 1712230638, 1712230717),
|
||||||
|
(118, '分类管理', '', 'qfadmin', 'source', 'category', 108, 0, 1, 'el-icon-s-operation', NULL, 0, 1712230638, 1712230717);
|
||||||
|
|
||||||
-- --------------------------------------------------------
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
--
|
||||||
|
-- 表的结构 `qf_source_category`
|
||||||
|
--
|
||||||
|
|
||||||
|
CREATE TABLE `qf_source_category` (
|
||||||
|
`source_category_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分类名称',
|
||||||
|
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
`status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
|
||||||
|
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||||
|
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`source_category_id`) USING BTREE
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='分类表';
|
||||||
|
|
||||||
|
|
||||||
|
-- --------------------------------------------------------
|
||||||
|
|
||||||
|
|
||||||
--
|
--
|
||||||
-- 表的结构 `qf_source`
|
-- 表的结构 `qf_source`
|
||||||
--
|
--
|
||||||
@@ -268,6 +287,9 @@ CREATE TABLE `qf_source` (
|
|||||||
`is_delete` tinyint(3) NOT NULL DEFAULT '0' COMMENT '是否删除 0=正常 1=软删除',
|
`is_delete` tinyint(3) NOT NULL DEFAULT '0' COMMENT '是否删除 0=正常 1=软删除',
|
||||||
`is_time` int(11) NOT NULL DEFAULT '0' COMMENT '是否临时文件',
|
`is_time` int(11) NOT NULL DEFAULT '0' COMMENT '是否临时文件',
|
||||||
`fid` varchar(255) NOT NULL DEFAULT '' COMMENT '网盘文件标识',
|
`fid` varchar(255) NOT NULL DEFAULT '' COMMENT '网盘文件标识',
|
||||||
|
`source_category_id` int(11) NOT NULL DEFAULT 0 COMMENT '分类ID',
|
||||||
|
`sort` int(11) NOT NULL DEFAULT 99 COMMENT '排序',
|
||||||
|
`is_top` int(11) NOT NULL DEFAULT 0 COMMENT '是否置顶',
|
||||||
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
`create_time` int(11) NOT NULL DEFAULT '0' COMMENT '创建时间',
|
||||||
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间'
|
`update_time` int(11) NOT NULL DEFAULT '0' COMMENT '修改时间'
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会议管理表';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='会议管理表';
|
||||||
|
|||||||
@@ -6,3 +6,25 @@ ALTER TABLE `qf_source` ADD COLUMN `is_time` int(11) NOT NULL DEFAULT 0 COMMENT
|
|||||||
ADD COLUMN `fid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网盘文件标识';
|
ADD COLUMN `fid` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '网盘文件标识';
|
||||||
|
|
||||||
文件替换整个app文件(除了app/index这个文件夹不要替换,如果替换了重新传前端文件即可)
|
文件替换整个app文件(除了app/index这个文件夹不要替换,如果替换了重新传前端文件即可)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
6.17 更新资源分类
|
||||||
|
更新数据库
|
||||||
|
记得先备份!记得先备份!记得先备份!
|
||||||
|
执行以下sql语句
|
||||||
|
ALTER TABLE `qf_source` ADD COLUMN `source_category_id` int(11) NOT NULL DEFAULT 0 COMMENT '分类ID';
|
||||||
|
ALTER TABLE `qf_source` ADD COLUMN `sort` int(11) NOT NULL DEFAULT 99 COMMENT '排序';
|
||||||
|
ALTER TABLE `qf_source` ADD COLUMN `is_top` int(11) NOT NULL DEFAULT 0 COMMENT '是否置顶';
|
||||||
|
INSERT INTO `qf_node` VALUES (118, '分类管理', '', 'qfadmin', 'source', 'category', 108, 0, 1, 'el-icon-s-operation', NULL, 0, 0, 0);
|
||||||
|
CREATE TABLE `qf_source_category` (
|
||||||
|
`source_category_id` int(11) NOT NULL AUTO_INCREMENT,
|
||||||
|
`name` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT '分类名称',
|
||||||
|
`sort` int(11) NOT NULL DEFAULT 0 COMMENT '排序',
|
||||||
|
`status` int(11) NOT NULL DEFAULT 0 COMMENT '状态',
|
||||||
|
`create_time` int(11) NOT NULL DEFAULT 0 COMMENT '创建时间',
|
||||||
|
`update_time` int(11) NOT NULL DEFAULT 0 COMMENT '修改时间',
|
||||||
|
PRIMARY KEY (`source_category_id`) USING BTREE
|
||||||
|
) ENGINE = InnoDB AUTO_INCREMENT = 9 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci COMMENT = '分类表' ROW_FORMAT = Dynamic;
|
||||||
|
|
||||||
|
文件替换整个app文件(除了app/index这个文件夹不要替换,如果替换了重新传前端文件即可)
|
||||||
Reference in New Issue
Block a user