Code Monkey home page Code Monkey logo

d2-admin-start-kit's People

Contributors

aysnine avatar dependabot[bot] avatar fairyever avatar imageslr avatar sunyongmofang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

d2-admin-start-kit's Issues

本项目下安装v-charts的ve-map组件不渲染,空项目正常

今日新clone的本项目
安装echarts v-charts之后 其他图表渲染都正常
地图只占位不渲染,无报错信息打印

我在一个空项目里测了v-charts没问题 写法也没问题
又下载了完整版的d2-admin,里面的ve-map表现正常,
怀疑是否组件版本问题,于是参考完整版内的版本:
降级了echarts 由4.2.1 到 4.1.0
降级v-charts由1.19.0 到 1.17.6
问题依旧

1.6.17版本更新问题

昨晚我尝试从1.6.15手动升级到1.6.18版本,结果发现1.6.17的page整个目录结构都变了。所以能不能出一个1.6.17之后的版本(预备新项目使用)

其他问题 | 加载Vue-Amap,无法正常使用

提问|加载Vue-Amap,无法正常使用,错误信息如下

>>>>>> 错误信息 >>>>>>
index.js?ac5b:21 beforeCreate hook
util.log.js?3dbf:39 >>>>>> Vue 实例 >>>>>>
index.js?ac5b:23 VueComponent {_uid: 109, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: VueComponent, …}
util.log.js?3dbf:39 >>>>>> Error >>>>>>
index.js?ac5b:25 TypeError: Cannot read properties of null (reading 'load')
    at VueComponent.beforeCreate (index.js?8f9b:1)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at callHook (vue.runtime.esm.js?2b0e:4219)
    at VueComponent.Vue._init (vue.runtime.esm.js?2b0e:5004)
    at new VueComponent (vue.runtime.esm.js?2b0e:5154)
    at createComponentInstanceForVnode (vue.runtime.esm.js?2b0e:3283)
    at init (vue.runtime.esm.js?2b0e:3114)
    at createComponent (vue.runtime.esm.js?2b0e:5978)
    at createElm (vue.runtime.esm.js?2b0e:5925)
    at createChildren (vue.runtime.esm.js?2b0e:6053)
util.log.js?3dbf:27  D2Admin  ErrorHandler 
util.log.js?3dbf:39 >>>>>> 错误信息 >>>>>>
index.js?ac5b:21 mounted hook
util.log.js?3dbf:39 >>>>>> Vue 实例 >>>>>>
index.js?ac5b:23 VueComponent {_uid: 109, _isVue: true, $options: {…}, _renderProxy: Proxy, _self: VueComponent, …}
util.log.js?3dbf:39 >>>>>> Error >>>>>>
index.js?ac5b:25 TypeError: Cannot read properties of undefined (reading 'then')
    at VueComponent.createMap (index.js?8f9b:1)
    at VueComponent.mounted (index.js?8f9b:1)
    at invokeWithErrorHandling (vue.runtime.esm.js?2b0e:1854)
    at callHook (vue.runtime.esm.js?2b0e:4219)
    at Object.insert (vue.runtime.esm.js?2b0e:3139)
    at invokeInsertHook (vue.runtime.esm.js?2b0e:6346)
    at VueComponent.patch [as __patch__] (vue.runtime.esm.js?2b0e:6565)
    at VueComponent.Vue._update (vue.runtime.esm.js?2b0e:3948)
    at VueComponent.updateComponent (vue.runtime.esm.js?2b0e:4066)
    at Watcher.get (vue.runtime.esm.js?2b0e:4479)
content.js:1 localhost <<<<<

使用步骤:

  1. npm install -S vue-amap

  2. 在main.js 注册地图组件

// Vue
import Vue from 'vue'
import i18n from './i18n'
import App from './App'
// 核心插件
import d2Admin from '@/plugin/d2admin'
// store
import store from '@/store/index'

// 菜单和路由设置
import router from './router'
import { menuHeader, menuAside } from '@/menu'
import { frameInRoutes } from '@/router/routes'



import VueAMap from 'vue-amap';
//引入AMap-vue
Vue.use(VueAMap);
VueAMap.initAMapApiLoader = {
    key: '', // key我复制过来的时候删了 项目中存在
    plugin: ['AMap.Autocomplete', 'AMap.PlaceSearch', 'AMap.Scale', 'AMap.OverView', 'AMap.ToolBar', 'AMap.MapType', 'AMap.PolyEditor', 'AMap.CircleEditor'],
};


// 核心插件
Vue.use(d2Admin)

new Vue({
    router,
    store,
    i18n,
    render: h => h(App),
    created() {
        // 处理路由 得到每一级的路由设置
        this.$store.commit('d2admin/page/init', frameInRoutes)
            // 设置顶栏菜单
        this.$store.commit('d2admin/menu/headerSet', menuHeader)
            // 设置侧边栏菜单
        this.$store.commit('d2admin/menu/asideSet', menuAside)
            // 初始化菜单搜索功能
        this.$store.commit('d2admin/search/init', menuHeader)
    },
    mounted() {
        // 展示系统信息
        this.$store.commit('d2admin/releases/versionShow')
            // 用户登录后从数据库加载一系列的设置
        this.$store.dispatch('d2admin/account/load')
            // 获取并记录用户 UA
        this.$store.commit('d2admin/ua/get')
            // 初始化全屏监听
        this.$store.dispatch('d2admin/fullscreen/listen')
    }
}).$mount('#app')
<template>
  <d2-container>
    <template slot="header">header</template>
    <el-container style="height: 650px">
      <!-- 地图 -->
      <el-aside style="width: 65%">
        <div style="width: 100%; height: 100%">
          <!-- 地图区域 -->
          <el-amap
            vid="amapDemo"
            view-mode="3D"
            map-style="amap://styles/whitesmoke"
            :zoom="amapContext.map.zoom"
            :center="amapContext.map.center"
            :pitch="amapContext.map.pitch"
            :rotation="amapContext.map.rotation"
            :show-indoor-map="false"
          > </el-amap>
        </div>
      </el-aside>
 </el-container>
</d2-container>
</template>

data: function () {
    // for sidebar left
    return {
      meta: {
        dataSourceList: [
          {
            value: "static",
            label: "静态",
          },
        ],
        dataIdList: [
          {
            value: "static",
            label: "静态无须指定",
          },
        ],
      },
      amapContext: {
        // 地图参数
        map: {
          center: [116.473778, 39.990661],
          position: [116.473778, 39.990661],
          zoom: 14,
          pitch: 0,
          rotation: 15,
          polyLine: [],
        },
      
      }

  .......

生产环境如何不出现debugger

为了统一格式,请将下面一行复制到 `Title` 栏,然后删除这部分
🤔 提问 | 生产环境如何不出现debugger

就是打包上传了之后 在实际环境中使用的时候 点击某个按钮
如果出现请求错误就会自动Debugger,用户体验好差啊。。

[Discussion]在解决page.opened丢失问题时产生的一个疑惑

[项目背景]

使用D2Admin ICE.在整合权限管理时,参考了d2-admin-pm的方案,同时在Vuex | page中增加了refreshupdateaction.

[Bug产生]

main.js中的处理路由的代码移至router/index.js,如下

// main.js
import {
  frameInRoutes
} from './routerConfig'
......
created(){
    // 处理路由 得到每一级的路由设置
    this.$store.commit('d2admin/page/init', frameInRoutes)
}
......
// router/index.js
......
import routes , { frameInRoutes } from '../routerConfig'

Vue.use(VueRouter)

// 导出路由 在 main.js 里使用
const router = new VueRouter({
  routes
})

// 处理路由 得到每一级的路由设置
store.commit('d2admin/page/init', frameInRoutes)
......

[预期效果]

打开首页、页面1、页面2,此时刷新浏览器,应该依然打开这三个标签页

image

[Bug效果]

打开首页、页面1、页面2,此时刷新页面,却只加载出来页面2和首页两个标签。
而打开多个标签时,刷新浏览器后,除了当前路由对应的页面2和首页,其他标签全部丢失。
如果当前路由就是首页,那么刷新后就只剩一个首页

image

在路由拦截afterEachdb/get打印了page.opened,在刷新浏览器前,opened.length和标签数是保持一致的。刷新浏览器后,尝试在加载页面的过程中逐步打印opened,均是上述Bug中的结果。
(main.js->mounted->dispatch('d2admin/account/load')->dispatch('d2admin/page/openedLoad'))

目前处理是把router/index.js中的路由处理移回main.js中,但对于bug的产生还是一头雾水。
请问有什么好的建议或思路来排查可能的原因吗

🖐 其它问题 | 新手上路遇到的问题和心路历程

初学者感到有些繁琐
背景: 未接触过vue等相关框架,用过Jquery等,又一定的前端开发基础
经历: 4天认真仔细地看完了整个开发文档+elmentUI大部分文档API

问题: 我的项目仅需一个上传简单数据的平台,而项目封装过于严格和庞大。虽然这几天攻克了一个又一个问题(头疼),最终还是卡在了axios跨域post请求上(postman可以跑通)。最终决定放弃使用该框架。
项目优点: 显然,集成了很多模板,本身也模板化管理。适用于商业级项目,利于后期工程管理。
项目缺点: 模块化也是问题所在,尤其是对小白来说,大量新模块的引入+严格工程模块化直接摸不着头脑。/头疼 本身该分支是start-kit,个人认为应该再降低些门槛,减少使用者相关面上的知识水平。

建议: 减弱框架对复杂模块的集成和封装,降低需要修改的配置,只保留核心即可。更适用于小型项目上手以及初学者入门该体系。文档还可以再详细些,尤其是封装过的模块。

当然,作者很辛苦,也非常感谢作者的付出。绝无贬低作者辛勤付出之意。
以上仅为作为完全小白的我,这几天的使用心得和小建议,使用过程很曲折,痛苦。

👾 BUG | D2 CRUD V2组件中新增表单form-data-change事件问题

对于el-selelct、el-number等类型的表单控件change事件回调的{key,value}中value为变化前的值,貌似和手册中表单事件监听的描述不符,烦请测试,谢谢!

接收一个对象参数 {key, value},key 为改变的字段,value 为改变后的值。

🎮 示例相关 | store的commit方式问题

async asideLoad ({ state, dispatch }) {
// store 赋值
const menu = await dispatch('d2admin/db/get', {
dbName: 'sys',
path: 'menu',
defaultValue: setting.menu,
user: true
}, { root: true })
state.asideCollapse = menu.asideCollapse !== undefined ? menu.asideCollapse : setting.menu.asideCollapse
state.asideTransition = menu.asideTransition !== undefined ? menu.asideTransition : setting.menu.asideTransition
}

实例代码中直接在action中修改state的状态这里有些不妥。

更改 Vuex 的 store 中的状态的唯一方法是提交 mutation。
-vuex文档

English Version

Hi,

I really love this admin panel and the UI in Vue. Do you have this in English version btw.

I see the locale setting in ii8n but something that can be defaulted to English version would help.

Thanks

Not Found - GET http://registry.npm.taobao.org/@xtuc/long/-/long-4.2.2.tgz - [not_found] document not found

👾 BUG |  Not Found - GET http://registry.npm.taobao.org/@xtuc/long/-/long-4.2.2.tgz - [not_found] document not found

github上克隆到本地后执行npm i,报下面错误。

npm ERR! code E404
npm ERR! 404 Not Found - GET http://registry.npm.taobao.org/@xtuc/long/-/long-4.2.2.tgz - [not_found] document not found
npm ERR! 404
npm ERR! 404  '@xtuc/long@http://registry.npm.taobao.org/@xtuc/long/-/long-4.2.2.tgz' is not in the npm registry.
npm ERR! 404 You should bug the author to publish it (or use the name yourself!)
npm ERR! 404
npm ERR! 404 Note that you can also install from a
npm ERR! 404 tarball, folder, http url, or git url.

npm ERR! A complete log of this run can be found in:
npm ERR!     D:\SoftWares\Scoop\persist\nodejs\cache\_logs\2021-06-07T06_03_36_507Z-debug.log

api的接口,只能用api.XXXX的方法调用吗

比如
const res = await this.$api.GET_MENU_DATA();
const res = await this.$api.SYS_USER_LOGIN();

这样,如果项目大一点,接口的方法只能再$api下面,变为
const res = await this.$api.demo.GET_MENU_DATA();
const res = await this.$api.user.SYS_USER_LOGIN();
吗,
我是小白,不是刚刚接触这个框架

🤔 提问 | 请问下类似于page1的icon如何添加?

为了统一格式,请将下面一行复制到 `Title` 栏,然后删除这部分
🤔 提问 | 你的标题

请问下类似于page1的icon如何添加?
{
path: 'xxxx',
name: 'xxxx',
icon: 'line-chart',
meta: {
title: 'xxxx',
auth: true
},
component: _import('demo/xxxx')
}

尝试在router.js中加入 但并无效果

能否支持布局可控

如果业务简单 可能不需要顶部菜单 只需要左侧菜单就能实现业务。
image

如果业务复杂 需要顶部菜单点击后列出左侧菜单
image

能否全局有个可控切换

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.