Sfoglia il codice sorgente

Merge branch 'master' of https://git.hxiaoju.top/Other/Gong-Ying-Lian-API

* 'master' of https://git.hxiaoju.top/Other/Gong-Ying-Lian-API:
  记账记录
  记账
  记账
  记账类型

# Conflicts:
#	app/api/controller/Inventory.php
jason 5 mesi fa
parent
commit
e090c2c40f

+ 5 - 4
app/admin/controller/Dashboard.php

@@ -13,7 +13,7 @@ namespace app\admin\controller;
 
 use app\common\model\Admin;
 use app\common\model\delivery\Text;
-use app\common\model\User;
+use app\common\model\MoneyLog;
 use app\common\model\StockDetail;
 use app\common\model\StockConfig;
 use app\common\library\Date;
@@ -34,14 +34,15 @@ class Dashboard extends Backend
      * 查看
      */
     #[Route('GET','dashboard/index')]
-    public function index(StockConfig $stockConfig, StockDetail $stockDetail)
+    public function index(StockConfig $stockConfig, StockDetail $stockDetail, MoneyLog $moneyLog)
     {
         if($this->request->isAjax()){
-            //模拟数据面板
+            //顶部统计
+            $moneyLog = $moneyLog::getCountBalance();
             $panel=[
                 rand(100,1000),
                 rand(100,1000),
-                rand(100,1000),
+                $moneyLog['balance'], // 当前结余(所有收入-支出)
                 rand(100,1000),
             ];
             $variety = [];

+ 88 - 0
app/admin/controller/user/MoneyLog.php

@@ -0,0 +1,88 @@
+<?php
+declare (strict_types = 1);
+
+namespace app\admin\controller\user;
+
+use app\common\controller\Backend;
+use app\admin\traits\Actions;
+use think\annotation\route\Group;
+use think\annotation\route\Route;
+use app\common\model\MoneyLog as MoneyLogModel;
+
+#[Group("user/money_log")]
+class MoneyLog extends Backend
+{
+    use Actions{
+        index as private _index;
+        del as private _del;
+        multi as private _multi;
+        import as private _import;
+    }
+
+    protected function _initialize()
+    {
+        parent::_initialize();
+        $this->model = new MoneyLogModel();
+        $this->assign('typeList',  site_config('addonsd.bank_account'));
+        $this->relationField=['users'];
+    }
+
+    //查看
+    #[Route("GET,JSON","index")]
+    public function index()
+    {
+        return $this->_index();
+    }
+
+    //添加
+    #[Route("GET,POST","add")]
+    public function add()
+    {
+        //通过定义postParams来增加或覆盖post提交的表单
+        $this->postParams=[];
+        //通过定义callback回调函数来执行添加后的操作
+        $this->callback=function ($model){};
+        return $this->_add();
+    }
+
+    //修改
+    #[Route("GET,POST","edit")]
+    public function edit()
+    {
+        //通过定义postParams来增加或覆盖post提交的表单
+        $this->postParams=[];
+        //通过定义callback回调函数来执行修改后的操作
+        $this->callback=function ($model){};
+        return $this->_edit();
+    }
+
+    //删除
+    #[Route("GET,POST","del")]
+    public function del()
+    {
+        //通过定义callback回调函数来执行删除后的操作
+        $this->callback=function ($ids){};
+        return $this->_del();
+    }
+
+    //更新
+    #[Route("GET,POST","multi")]
+    public function multi()
+    {
+        //通过定义callback回调函数来执行更新后的操作
+        $this->callback=function ($ids,$field,$value){};
+        return $this->_multi();
+    }
+
+    //导入
+    #[Route("GET,POST","import")]
+    public function import()
+    {
+        //通过定义callback回调函数来处理导入的数据
+        $this->callback=function ($inserData){
+            return $inserData;
+        };
+        return $this->_import();
+    }
+
+}

+ 9 - 8
app/admin/view/dashboard/index.html

@@ -24,23 +24,24 @@
                                 </div>
                             </el-col>
                             <el-col :md="6" :sm="12" :xs="12">
-                                <div class="style-1 bkcolor3">
+                                <div class="style-1 bkcolor4">
                                     <div class="box">
-                                        <div class="box-title">月租用户</div>
-                                        <div class="box-number">{{panel[2]}}</div>
+                                        <div class="box-title">当前结余</div>
+                                        <div class="box-number">{{panel[3]}}</div>
                                     </div>
-                                    <i class="fa fa-dashcube"></i>
+                                    <i class="fa fa-exchange"></i>
                                 </div>
                             </el-col>
                             <el-col :md="6" :sm="12" :xs="12">
-                                <div class="style-1 bkcolor4">
+                                <div class="style-1 bkcolor3">
                                     <div class="box">
-                                        <div class="box-title">数据表数量</div>
-                                        <div class="box-number">{{panel[3]}}</div>
+                                        <div class="box-title">月租用户</div>
+                                        <div class="box-number">{{panel[2]}}</div>
                                     </div>
-                                    <i class="fa fa-database"></i>
+                                    <i class="fa fa-dashcube"></i>
                                 </div>
                             </el-col>
+                    
                         </el-row>
                     </el-card>
                 </div>

+ 82 - 0
app/admin/view/user/money_log/add.html

@@ -0,0 +1,82 @@
+<template>
+    <el-card shadow="never" style="border: 0;">
+        <yun-form
+            ref="yunform"
+            @render="onFormRender"
+            @submit="onSubmit"
+            @success="onSuccess"
+            @fail="onFail"
+            :data="row"
+            :columns="columns">
+            <template #default>
+                {:token_field()}
+            </template>
+    
+        </yun-form>
+    </el-card>
+</template>
+<script>
+import form from "@components/Form.js";
+export default{
+    components:{
+        'YunForm':form
+    },
+    data:{
+        columns:[
+            {field:"id",title:"ID",edit:"hidden"},
+            {field:"user_id",title:"user_id",edit:"number"},
+            {field:"type",title:"记账类型:收入 1;支出 2",edit:"select",rules:"required",searchList:{1:"是",0:"否"}},
+            {field:"type_name",title:"账变名称,记录汉字",edit:"text",rules:"required"},
+            {field:"bank_account",title:"记账账户,记录key",edit:"text",rules:"required"},
+            {field:"change",title:"变动金额",edit:"text",rules:"required"},
+            {field:"remark",title:"备注",edit:"text",rules:"required"},
+            {field:"create_date",title:"创建日期,编辑后同步修改",edit:"text",rules:"required"},
+            {field:"createtime",title:"创建时间"},
+            {field:"updatetime",title:"修改时间"},
+        ],
+        row:Yunqi.data.row || {}
+    },
+    //页面加载完成时执行
+    onLoad:function(query){
+        console.log(query);
+    },
+    //页面初始显示或在框架内显示时执行
+    onShow:function(){
+
+    },
+    //页面在框架内隐藏时执行
+    onHide:function(){
+
+    },
+    //页面在框架内关闭时执行
+    onUnload:function(){
+
+    },
+    methods: {
+        onFormRender:function(rows){
+            //表单渲染完成后执行
+        },
+        onSubmit:function(rows){
+            //表单提交前执行,返回false可以阻止表单提交
+            /**
+             * form常用方法
+             * this.$refs.yunform.setError(field,message);//聚焦表单项并显示错误信息
+             * this.$refs.yunform.hideField(field);//隐藏表单项
+             * this.$refs.yunform.showField(field);//显示表单项
+             * this.$refs.yunform.setValue(field,value);//为表单项设置值
+             * this.$refs.yunform.getValue(field);//为获取表单项的值
+             * this.$refs.yunform.setField(field,key,value);//修改表单json的其他属性值,比如rules,title,searchList等
+             */
+            return true;
+        },
+        onSuccess:function(response){
+            //表单提交成功后执行
+        },
+        onFail:function(err){
+            //表单提交失败后执行
+        }
+    }
+}
+</script>
+<style>
+</style>

+ 1 - 0
app/admin/view/user/money_log/edit.html

@@ -0,0 +1 @@
+{include vue="user/money_log/add" /}

+ 93 - 0
app/admin/view/user/money_log/index.html

@@ -0,0 +1,93 @@
+<template>
+    <el-card shadow="never">
+        <yun-table
+                :columns="columns"
+                ref="yuntable"
+                @render="onTableRender"
+                toolbar="refresh,del,import"
+                :auth="{
+           
+                    del:{:$auth->check('app\\admin\\controller\\user\\MoneyLog','del')},
+                    multi:{:$auth->check('app\\admin\\controller\\user\\MoneyLog','multi')},
+                    import:{:$auth->check('app\\admin\\controller\\user\\MoneyLog','import')},
+                }"
+                :extend="extend">
+        </yun-table>
+    </el-card>
+</template>
+<script>
+import table from "@components/Table.js";
+export default{
+    components:{
+        'YunTable':table
+    },
+    data:{
+        extend:{
+            index_url: 'user/money_log/index',
+            del_url: 'user/money_log/del',
+            multi_url: 'user/money_log/multi',
+            import_url: 'user/money_log/import',
+        },
+        columns:[
+            {checkbox: true,selectable:function (row,index){
+                //可以根据业务需求返回false让某些行不可选中
+                return true;
+            }},
+            {field:"id",title:"ID",operate:false},
+            {field:"users.nickname",title:"记账人"}, 
+            {field:"type",title:"记账类型",operate:"select",searchList:{1:"收入", 2:"支出"},formatter:Yunqi.formatter.tag},
+            {field:"type_name",title:"账变名称",operate:false},
+            {field: 'bank_account',title: __('记账账户'),operate: "select", searchList: Yunqi.data.typeList},
+            {field:"change",title:"变动金额",operate:false},
+            {field:"remark",title:"备注",operate:false},
+            {field:"create_date",title:"记账日期",operate:false},
+            //{field:"bank_account",title:"记账账户" ,typeList},
+            {field:"createtime",title:"创建时间",operate:"daterange",formatter:Yunqi.formatter.datetime},
+            {field:"updatetime",title:"修改时间",operate: false,formatter:Yunqi.formatter.datetime},
+            {
+                field: 'operate',
+                title: __('操作'),
+                width:130,
+                action:{
+                    edit:function(row){
+                        //可以根据业务需求返回false让按钮不显示
+                        return true
+                    },
+                    del:true,
+                }
+            }
+        ]
+    },
+    //页面加载完成时执行
+    onLoad:function(query){
+        console.log(query);
+    },
+    //页面初始显示或在框架内显示时执行
+    onShow:function(){
+
+    },
+    //页面在框架内隐藏时执行
+    onHide:function(){
+
+    },
+    //页面在框架内关闭时执行
+    onUnload:function(){
+
+    },
+    methods: {
+        onTableRender:function(list){
+            //表格渲染完成后执行
+            /**
+             * table常用方法
+             * this.$refs.yuntable.reset();//重新渲染整个组件,当columns修改时,需要重新渲染表格才能生效,可以执行该方法。
+             * this.$refs.yuntable.reload();//保持当前的page,重新获取数据
+             * this.$refs.yuntable.submit();//返回第一页,重新获取数据
+             * this.$refs.yuntable.expandAllTree();//树形表格展开所有节点
+             * this.$refs.yuntable.expandTree(topid);//树形表格展开指定节点
+             */
+        }
+    }
+}
+</script>
+<style>
+</style>

+ 11 - 6
app/api/controller/Inventory.php

@@ -57,18 +57,23 @@ class Inventory extends Base
         $type    = $this->request->post('type/s', '');
         $type_id = $this->request->post('type_id/s', '');
         $spec_id = $this->request->post('spec/s', '');
-        if(!empty($type))    $where['a.type'] = $type;
-        if(!empty($type_id)) $where['a.type_id'] = $type_id;
-        if(!empty($spec_id)) $where['a.variety_id'] = $spec_id;
-
+        $limit = $this->request->post('limit/d', 15);  //条数
+        $time = $this->request->post('create_time/s'); //日期
+        if(!empty($type))    $where[] = ['a.type', '=', $type];
+        if(!empty($type_id)) $where[] = ['a.type_id', '=',$type_id];
+        if(!empty($spec_id)) $where[] = ['a.variety_id', '=',$spec_id];
+        if(!empty($time)){
+            $arr = explode(',', $time);
+            $where[] = ['a.createtime', '>=', strtotime($arr[0])];
+            $where[] = ['a.createtime', '<=', strtotime($arr[1])];
+        }
         $list = $stockLog::alias('a')
                 ->leftjoin('stock_config b', 'a.variety_id = b.id')
                 ->where('a.user_id', $this->userinfo['id'])
                 ->where($where)
-                //->whereTime('a.createtime', '-2 days')
                 ->field('a.*,b.title')
                 ->order('a.id desc')
-                ->select();
+                ->paginate($limit);
         $this->success('ok', $list);
     }
 

+ 76 - 0
app/api/controller/MoneyLog.php

@@ -0,0 +1,76 @@
+<?php
+
+namespace app\api\controller;
+
+use app\common\model\StockConfig;
+use app\common\model\MoneyLog as MonuyModel;
+use app\common\model\StockLog;
+use think\exception\ValidateException;
+use app\api\validate\Money as MoneyValidate;
+use app\common\model\StockDetail;
+use think\facade\Db;
+
+//记账记录表
+class MoneyLog extends Base
+{
+
+
+
+      //记账记录
+      public function moneylog(MonuyModel $monuyModel)
+      {
+
+            $time = $this->request->post('time/d', date('Y-m'));
+            $result['count'] = $monuyModel::getCountBalance($this->userinfo['id'], $time);
+
+            $result['list']  = $monuyModel->where('user_id', $this->userinfo['id'])
+                              ->whereMonth('create_date', $time)
+                              ->order('id desc')
+                              //->group('create_date')
+                              ->paginate(10);
+            $this->success('ok', $result);
+      }
+
+      //添加记账
+      public function money(MonuyModel $monuyModel)
+      {     
+
+            $data = $this->request->post();
+            $result = false;
+            Db::startTrans();
+            try {
+                  validate(MoneyValidate::class)->scene('add')->check($data);
+            
+                  //发货数据
+                  $data['user_id'] = $this->userinfo['id'];
+                  $result = $monuyModel::create($data);
+
+                  Db::commit();
+            }catch (ValidateException $e) {
+                  Db::rollback();
+                  return $this->error($e->getError());
+            } catch (\Exception $e) {
+                  Db::rollback();
+                  $this->error($e->getMessage());
+            }
+            if ($result === false) {
+                  $this->error(__('没有新增任何数据'));
+            }
+            $this->success();
+      }
+
+
+      /**
+     * @return void 全部类型图标
+      */
+      public function getConfig()
+      {     
+            $type = $this->request->post('type/s', 'bank_account');
+            if(!in_array($type, ['bank_account', 'money_in_type', 'money_out_type'])) $this->error('参数有误');
+            $this->success('提交成功', site_config('addonsd.'.$type));
+      }
+
+   
+
+   
+}

+ 7 - 0
app/api/route/route.php

@@ -42,6 +42,13 @@ Route::group('user', function () {
     //库存记录
     Route::rule('stocklog','inventory/stocklog','POST');
 
+    //记账
+    Route::rule('money','MoneyLog/money','POST');
+    //记账记录
+    Route::rule('moneylog','MoneyLog/moneylog','POST');
+    //记账类型配置
+    Route::rule('getMoneyType','moneyLog/getConfig','POST');
+
   })->middleware(AllowCrossDomain::class);
 
 

+ 29 - 0
app/api/validate/Money.php

@@ -0,0 +1,29 @@
+<?php
+namespace app\api\validate;
+
+use think\Validate;
+
+class Money extends Validate
+{
+    protected $rule =   [
+        'type_name'  => 'require|string',
+        'type'     => 'require|number',
+        'bank_account'  => 'require',
+        'change'        => 'require|gt:0',
+          
+    ];
+    
+    protected $message  =   [
+        'type_name'      => '参数有误',
+        'type'         => '参数有误',
+        'bank_account' => '参数有误',   
+        'change'        => '参数有误',
+    ];
+
+
+ 
+    protected $scene = [
+        'add'  =>  ['type_name','type','bank_account', 'change'],
+      
+    ]; 
+}

+ 61 - 0
app/common/model/MoneyLog.php

@@ -0,0 +1,61 @@
+<?php
+declare(strict_types=1);
+
+namespace app\common\model;
+
+use think\Model;
+
+class MoneyLog Extends Model
+{
+    // 自动写入时间戳字段
+    protected $autoWriteTimestamp = true;
+    protected $createTime = 'createtime';
+    protected $updateTime = 'updatetime';
+
+    protected $type = [
+        'createtime'     =>  'timestamp:Y-m-d H:i',
+        'updatetime'     =>  'timestamp:Y-m-d H:i',
+    ];
+
+    const TYPE_INCOME = 1;
+    const TYPE_EXPENDITURE = 2;
+
+    //
+    public function users()
+    {
+        return $this->hasOne(User::class,'id','user_id')->field('id,nickname');
+    }
+
+
+    public function stockconfig()
+    {
+        return $this->hasOne(StockConfig::class,'id','variety_id')->field('id,title');
+    }
+    
+
+
+    //按照类型统计 收入- 支出
+    public static function getCountBalance(int $user_id = 0, string $time = '')
+    {
+        $income = self::where('type', self::TYPE_INCOME);
+        if(!empty($user_id) && !empty($time)){
+            $income = $income->where('user_id', $user_id)->whereMonth('create_date', $time);
+
+        }
+        $income = $income->sum('change');
+        //支出
+        $expenditure = self::where('type', self::TYPE_EXPENDITURE);
+        if(!empty($user_id) && !empty($time)){
+            $expenditure = $expenditure->where('user_id', $user_id)->whereMonth('create_date', $time);
+        }
+        $expenditure = $expenditure->sum('change');
+        $balance = $income - $expenditure;
+        return [
+            'balance' => $balance,
+            'income' => $income,
+            'expenditure' => $expenditure
+            
+        ];
+    }
+
+}

+ 1 - 1
runtime/admin/temp/2e007af573c2a3e955bb2c5a54d1f252.php

@@ -1,4 +1,4 @@
-<?php /*a:1:{s:64:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\index\index.html";i:1750736984;}*/ ?>
+<?php /*a:1:{s:64:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\index\index.html";i:1751866917;}*/ ?>
 <!DOCTYPE html>
 <html <?php if($config['elementUi']['dark']): ?>class="dark"<?php endif; ?>>
 <head>

+ 1 - 1
runtime/admin/temp/634c45885a6c7b54a439b16462f437f0-js.php

@@ -1,4 +1,4 @@
-<?php /*a:2:{s:65:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\develop\crud.html";i:1750736984;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1750736984;}*/ ?>
+<?php /*a:2:{s:65:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\develop\crud.html";i:1751866917;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1751866917;}*/ ?>
 
     import selectpage from "http://yun.cn/assets/js/components/SelectPage.js";
     import fieldlist from "http://yun.cn/assets/js/components/Fieldlist.js";

+ 1 - 1
runtime/admin/temp/634c45885a6c7b54a439b16462f437f0.php

@@ -1,4 +1,4 @@
-<?php /*a:2:{s:65:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\develop\crud.html";i:1750736984;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1750736984;}*/ ?>
+<?php /*a:2:{s:65:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\develop\crud.html";i:1751866917;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1751866917;}*/ ?>
 <!DOCTYPE html>
 <html <?php if($config['elementUi']['dark']): ?>class="dark"<?php endif; ?>>
 <head>

+ 8 - 142
runtime/admin/temp/b353996ff73b3f877e532ecb62c627e6-js.php

@@ -1,28 +1,13 @@
-<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\dashboard\index.html";i:1750736984;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1750736984;}*/ ?>
+<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\dashboard\index.html";i:1751875716;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1751866917;}*/ ?>
 
     export default{
         data:{
             echarts:'',
             panel:[],
-            line:{
-                date:[],
-                data:[]
-            },
-            table:[],
-            bar:{
-                date:[],
-                name:[],
-                data:[]
-            },
-            pie:[],
-            order:{
-                percentage:[0,0]
-            },
-            filterForm:{
-                table:'all',
-                select:'one',
-                datepicker:['2023-01-01','2023-02-01'],
-            }
+            list:[],
+            box:[],
+            material:[]
+          
         },
         onLoad:function (){
             Yunqi.use('/assets/js/echarts.min.js').then(res=>{
@@ -34,129 +19,10 @@
             parseData:function (){
                 Yunqi.ajax.get('dashboard/index',{}).then(res=>{
                     this.panel=res.panel;
-                    this.line=res.line;
-                    this.table=res.table;
-                    this.bar=res.bar;
-                    this.pie=res.pie;
-                    this.order=res.order;
-                    this.chart1();
-                    this.chart2();
-                    this.chart3();
+                    this.list=res.variety;
+                    this.box=res.box;
+                    this.material=res.material;
                 });
             },
-            chart1:function () {
-                let mychart = this.echarts.init(document.getElementById('chart1'), 'walden');
-                mychart.setOption({
-                    title: {text: '每日新增用户数',left: 'center'},
-                    tooltip: {
-                        trigger: 'axis'
-                    },
-                    toolbox: {
-                        show: false,
-                        feature: {
-                            magicType: {show: true, type: ['stack', 'tiled']},
-                            saveAsImage: {show: true}
-                        }
-                    },
-                    xAxis: {
-                        type: 'category',
-                        boundaryGap: false,
-                        data: this.line.date
-                    },
-                    yAxis: {},
-                    grid: [{
-                        left: 40,
-                        top: 40,
-                        right: 0,
-                        bottom:30
-                    }],
-                    series: [{
-                        name: '注册用户',
-                        type: 'line',
-                        smooth: true,
-                        areaStyle: {
-                            normal: {}
-                        },
-                        lineStyle: {
-                            normal: {
-                                width: 1.5
-                            }
-                        },
-                        data: this.line.data
-                    }]
-                });
-                window.addEventListener('resize',()=>{
-                    mychart.resize();
-                });
-            },
-            chart2:function (){
-                let mychart = this.echarts.init(document.getElementById('chart2'))
-                mychart.setOption({
-                    title: {text: '消费比例图',left: 'center'},
-                    legend: {
-                        orient: 'horizontal',
-                        bottom: 0,
-                    },
-                    series: [{
-                        type: 'pie',
-                        data:this.pie,
-                        label: {
-                            normal: {
-                                show: true,
-                                formatter: "¥{c}",
-                            }
-                        }
-                    }]
-                });
-                window.addEventListener('resize',()=>{
-                    mychart.resize();
-                });
-            },
-            chart3:function (){
-                let mychart = this.echarts.init(document.getElementById('chart3'))
-                mychart.setOption({
-                    title: {text: '消费日历图',left: 'center'},
-                    legend: {
-                        orient: 'vertical',
-                        left: 'left',
-                    },
-                    yAxis: {},
-                    xAxis: {
-                        data: this.bar.date
-                    },
-                    grid: [{
-                        left: 100,
-                        top: 40,
-                        right: 40,
-                        bottom:20
-                    }],
-                    series: [
-                        {
-                            type: 'bar',
-                            name:this.bar.name[0],
-                            data: this.bar.data[0]
-                        },
-                        {
-                            type: 'bar',
-                            name:this.bar.name[1],
-                            data: this.bar.data[1]
-                        },
-                        {
-                            type: 'bar',
-                            name:this.bar.name[2],
-                            data: this.bar.data[2]
-                        }
-                    ]
-                });
-                window.addEventListener('resize',()=>{
-                    mychart.resize();
-                });
-            },
-            changeForm:function (type){
-                if(type){
-                    this.filterForm.table=type;
-                }
-                this.parseData();
-            }
         }
     }

+ 93 - 136
runtime/admin/temp/b353996ff73b3f877e532ecb62c627e6.php

@@ -1,4 +1,4 @@
-<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\dashboard\index.html";i:1750736984;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1750736984;}*/ ?>
+<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\dashboard\index.html";i:1751875716;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1751866917;}*/ ?>
 <!DOCTYPE html>
 <html <?php if($config['elementUi']['dark']): ?>class="dark"<?php endif; ?>>
 <head>
@@ -74,7 +74,6 @@
 }
 .style-3{
     padding: 10px;
-    width: 87%;
     margin:0 auto;
     text-align: center;
 }
@@ -82,7 +81,6 @@
     text-align: left;
 }
 .style-3 .box{
-    height: 190px;
     display: flex;
     flex-direction: column;
     justify-content: space-around;
@@ -91,15 +89,22 @@
     text-align: left;
 }
 .style-3 .box-number-top{
-    font-size: 26px;
+    font-size: 20px;
 }
 .style-3 .box-number-bottom{
-    color: darkgrey;
+     font-size: 24px;
+     color: blueviolet;
 }
 .style-3 .box-content{
     display: flex;
-    justify-content: space-between;
+    /* justify-content: space-between; */
     align-items: center;
+    flex-wrap: wrap;
+}
+
+.box-content .box-content-right{
+    min-width: 150px;
+    padding-bottom: 16px;
 }
 .style-3 .icon{
     color: #fff;
@@ -145,9 +150,9 @@
             <el-main style="padding: 0px;border-radius:4px;" id="mainScrollbar">
                 <el-scrollbar>
                     
-    <div style="overflow: hidden;max-width: 100%;">
+    <div style="max-width: 100%;">
         <el-row :gutter="10">
-            <el-col :md="18" :xs="24" :sm="24">
+            <el-col :md="24" :xs="24" :sm="24">
                 <div class="card-container">
                     <el-card shadow="always" body-style="padding-bottom:10px;">
                         <el-row>
@@ -170,151 +175,103 @@
                                 </div>
                             </el-col>
                             <el-col :md="6" :sm="12" :xs="12">
-                                <div class="style-1 bkcolor3">
+                                <div class="style-1 bkcolor4">
                                     <div class="box">
-                                        <div class="box-title">月租用户</div>
-                                        <div class="box-number">{{panel[2]}}</div>
+                                        <div class="box-title">当前结余</div>
+                                        <div class="box-number">{{panel[3]}}</div>
                                     </div>
-                                    <i class="fa fa-dashcube"></i>
+                                    <i class="fa fa-exchange"></i>
                                 </div>
                             </el-col>
                             <el-col :md="6" :sm="12" :xs="12">
-                                <div class="style-1 bkcolor4">
+                                <div class="style-1 bkcolor3">
                                     <div class="box">
-                                        <div class="box-title">数据表数量</div>
-                                        <div class="box-number">{{panel[3]}}</div>
+                                        <div class="box-title">月租用户</div>
+                                        <div class="box-number">{{panel[2]}}</div>
                                     </div>
-                                    <i class="fa fa-database"></i>
+                                    <i class="fa fa-dashcube"></i>
                                 </div>
                             </el-col>
+                    
                         </el-row>
                     </el-card>
                 </div>
-                <div class="card-container">
-                    <el-card shadow="always">
-                        <template #header>
-                            <div class="header">
-                                <div class="title"><i class="fa fa-caret-right"></i>折线图</div>
-                            </div>
-                        </template>
-                        <div class="chart1" id="chart1"></div>
-                    </el-card>
-                </div>
-                <div class="card-container">
-                    <el-card shadow="always">
-                        <template #header>
-                            <div class="header">
-                                <div class="title"><i class="fa fa-caret-right"></i>表格</div>
-                                <div class="right-filter">
-                                    <el-button-group>
-                                        <el-button @click="changeForm('all')" size="small" :type="(filterForm.table=='all')?'primary':''">全部</el-button>
-                                        <el-button @click="changeForm('today')" size="small" :type="(filterForm.table=='today')?'primary':''">今日</el-button>
-                                        <el-button @click="changeForm('week')" size="small" :type="(filterForm.table=='week')?'primary':''">本周</el-button>
-                                        <el-button @click="changeForm('month')" size="small" :type="(filterForm.table=='month')?'primary':''">当月</el-button>
-                                    </el-button-group>
-                                </div>
-                            </div>
-                        </template>
-                        <el-table :data="table">
-                            <el-table-column label="排名" prop="sort"></el-table-column>
-                            <el-table-column label="会员" prop="name"></el-table-column>
-                            <el-table-column label="下单">
-                                <template #default="{row}">{{row.total}}笔</template>
-                            </el-table-column>
-                            <el-table-column label="金额">
-                                <template #default="{row}">¥{{row.money}}</template>
-                            </el-table-column>
-                        </el-table>
-                    </el-card>
-                </div>
-                <div class="card-container">
-                    <el-card shadow="always">
-                        <template #header>
-                            <div class="header">
-                                <div class="title"><i class="fa fa-caret-right"></i>柱状图</div>
-                                <div class="right-filter">
-                                    <el-form :model="filterForm">
-                                        <el-form-item label="统计时间" style="margin-bottom: 0;">
-                                            <el-select v-model="filterForm.select" style="margin-right: 10px;width: 150px;" @change="changeForm(0)">
-                                                <el-option label="第一项" value="one"></el-option>
-                                                <el-option label="第二项" value="two"></el-option>
-                                                <el-option label="第三项" value="three"></el-option>
-                                            </el-select>
-                                            <el-date-picker @change="changeForm(0)" v-model="filterForm.datepicker" style="width: 250px;" type="daterange" range-separator="到"></el-date-picker>
-                                        </el-form-item>
-                                    </el-form>
-                                </div>
-                            </div>
-                        </template>
-                        <div class="chart3" id="chart3"></div>
-                    </el-card>
-                </div>
-            </el-col>
-            <el-col :md="6" :xs="24" :sm="24">
-                <div class="card-container left">
-                    <el-card shadow="always">
-                        <div style="font-weight: bold;margin-bottom: 10px;">😀欢迎您,<?php echo $auth->nickname; ?>!</div>
-                        <el-alert type="success" :closable="false">行到水穷处,坐看云起时。在线乞讨公司,贵阳云起信息科技,跪求打赏😭</el-alert>
-                        <div class="pay">
-                            <img src="<?php echo request()->domain(); ?>/assets/img/pay.png">
-                        </div>
-                    </el-card>
-                </div>
-                <div class="card-container left">
-                    <el-card shadow="always">
-                        <template #header>
-                            <div class="header">
-                                <div class="title"><i class="fa fa-caret-right"></i>进度框样式</div>
-                            </div>
-                        </template>
-                        <el-row>
-                            <el-col :span="24">
-                                <div class="style-2">
-                                    <div class="box">
-                                        <el-progress type="circle" :percentage="order.percentage[0]"></el-progress>
-                                        <div class="box-title">销售目标</div>
-                                        <div class="box-number">{{order.count}}单/{{order.total}}单</div>
+              
+              
+                           <div class="card-container left">
+                            <el-card shadow="always">
+                                <template #header>
+                                    <div class="header">
+                                        <div class="title"><i class="fa fa-caret-right"></i>红薯品种</div>
                                     </div>
-                                </div>
-                            </el-col>
-                            <el-col :span="24">
-                                <div class="style-3">
-                                    <div class="box">
-                                        <div class="box-title">今日销售额</div>
-                                        <div class="box-content">
-                                            <div class="box-content-left">
-                                                <div class="box-number-top">¥{{order.today}}</div>
-                                                <div class="box-number-bottom">昨日销售额:¥{{order.yestoday}}</div>
+                                </template>
+                                <el-row>
+                                    <el-col :span="24">
+                                        <div class="style-3">
+                                            <div class="box">
+                                    
+                                                <div class="box-content">
+                                                    <div class="box-content-right" v-for="item in list">
+                                                        <div class="box-number-top">{{item.name}}</div>
+                                                        <div class="box-number-bottom">{{item.num}}</div>
+                                                    </div>
+                                                </div>
+                                
                                             </div>
-                                            <div class="icon bkcolor3" v-if="order.percentage[1]<50">
-                                                <i class="fa fa-arrow-down"></i>
-                                            </div>
-                                            <div class="icon bkcolor2" v-if="order.percentage[1]>=50 && order.percentage[1]<100">
-                                                <i class="fa fa-arrow-down"></i>
-                                            </div>
-                                            <div class="icon bkcolor4" v-if="order.percentage[1]>=100">
-                                                <i class="fa fa-arrow-up"></i>
+                                        </div>
+                                    </el-col>
+                                </el-row>
+                            </el-card>
+                        </div>
+                           <div class="card-container left">
+                            <el-card shadow="always">
+                                <template #header>
+                                    <div class="header">
+                                        <div class="title"><i class="fa fa-caret-right"></i>包装箱</div>
+                                    </div>
+                                </template>
+                                <el-row>
+                                    <el-col :span="24">
+                                        <div class="style-3">
+                                            <div class="box">
+                                                <div class="box-content">
+                                                    <div class="box-content-right" v-for="item in box">
+                                                        <div class="box-number-top">{{item.name}}</div>
+                                                        <div class="box-number-bottom">{{item.num}}</div>
+                                                    </div>
+                                                 
+                                                </div>
                                             </div>
                                         </div>
-                                        <el-progress v-if="order.percentage[1]<50" :percentage="order.percentage[1]" color="#F56C6C"></el-progress>
-                                        <el-progress v-if="order.percentage[1]>=50 && order.percentage[1]<100" :percentage="order.percentage[1]" color="#E6A23C"></el-progress>
-                                        <el-progress v-if="order.percentage[1]>=100" :percentage="order.percentage[1]" color="#45991b"></el-progress>
+                                    </el-col>
+                                </el-row>
+                            </el-card>
+                        </div>
+          
+                        <div class="card-container left">
+                            <el-card shadow="always">
+                                <template #header>
+                                    <div class="header">
+                                        <div class="title"><i class="fa fa-caret-right"></i>耗材</div>
                                     </div>
-                                </div>
-                            </el-col>
-                        </el-row>
-                    </el-card>
-                </div>
-                <div class="card-container left">
-                    <el-card shadow="always">
-                        <template #header>
-                            <div class="header">
-                                <div class="title"><i class="fa fa-caret-right"></i>饼状图</div>
-                            </div>
-                        </template>
-                        <div class="chart2" id="chart2"></div>
-                    </el-card>
-                </div>
+                                </template>
+                                <el-row>
+                                    <el-col :span="24">
+                                        <div class="style-3">
+                                            <div class="box">
+                                                <div class="box-content">
+                                                    <div class="box-content-right" v-for="item in material">
+                                                        <div class="box-number-top">{{item.name}}</div>
+                                                        <div class="box-number-bottom">{{item.num}}</div>
+                                                    </div>
+                                                </div>
+                                            </div>
+                                        </div>
+                                    </el-col>
+                                </el-row>
+                            </el-card>
+                        </div>
+              
             </el-col>
         </el-row>
     </div>

+ 1 - 1
runtime/admin/temp/bfef4e19370cd6bfd7952c0196e36297-js.php

@@ -1,4 +1,4 @@
-<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\auth\rule\index.html";i:1750736984;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1750736984;}*/ ?>
+<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\auth\rule\index.html";i:1751866917;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1751866917;}*/ ?>
 
     import table from "http://yun.cn/assets/js/components/Table.js";
     export default{

+ 1 - 1
runtime/admin/temp/bfef4e19370cd6bfd7952c0196e36297.php

@@ -1,4 +1,4 @@
-<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\auth\rule\index.html";i:1750736984;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1750736984;}*/ ?>
+<?php /*a:2:{s:68:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\auth\rule\index.html";i:1751866917;s:63:"D:\phpEnv\www\Gong-Ying-Lian-API\app\admin\view\layout\vue.html";i:1751866917;}*/ ?>
 <!DOCTYPE html>
 <html <?php if($config['elementUi']['dark']): ?>class="dark"<?php endif; ?>>
 <head>

File diff suppressed because it is too large
+ 0 - 0
runtime/cache/7a/b2b683b6c3e8e0985917962d853b9c.php


Some files were not shown because too many files changed in this diff