Skip to content

Commit

Permalink
chore(ElementProCrud): 修改ProCrud引入方式,升级版本至@0.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
BoBoooooo committed Dec 8, 2020
1 parent d52c563 commit 390c7cd
Show file tree
Hide file tree
Showing 11 changed files with 29 additions and 27 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 0.1.0 (2020-11-27)
# 0.1.0 (2020-12-08)

### 🌟 新功能
范围|描述|commitId
Expand All @@ -24,6 +24,7 @@
范围|描述|commitId
--|--|--
- | code style perf | [4083144](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/4083144)
- | fix prop name | [d52c563](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/d52c563)
- | perf some code | [bfffe42](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/bfffe42)
bg | 删除loginbg、api等 | [27091ee](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/27091ee)
code | 代码风格调整 | [4b3bc2b](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/4b3bc2b)
Expand Down Expand Up @@ -77,6 +78,7 @@
### 📦 持续集成
范围|描述|commitId
--|--|--
env | 修改dev后台端口号 | [e8f5b5c](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/e8f5b5c)
- | 升级element-pro-crud 至 0.1.2版本 | [f0e397c](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/f0e397c)
- | 移除多余依赖 | [6053408](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/6053408)
- | dev port 8888 | [b923308](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/b923308)
Expand Down Expand Up @@ -113,6 +115,7 @@
- | CRUD插件版本更新至[@0](https://github.com/0).2.7 | [654adc2](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/654adc2)
- | Element-Pro-Crud Update to 0.2.4 | [c68eb99](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/c68eb99)
- | remove crud component | [46b322e](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/46b322e)
- | remove GenerateFormDialog | [537c157](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/537c157)
- | router typescript 支持 | [da9bcdb](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/da9bcdb)
- | update version to 0.2.1 | [99076b5](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/99076b5)
axios | 优化axios部分逻辑 | [6f960c4](https://github.com/BoBoooooo/BoBo-Vue-Admin/commit/6f960c4)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"axios": "^0.19.2",
"core-js": "3.6.5",
"dayjs": "1.8.20",
"element-pro-crud": "^0.3",
"element-pro-crud": "^0.5",
"element-ui": "^2.13.2",
"inquirer": "^6.5.2",
"lodash": "^4.17.14",
Expand Down
6 changes: 5 additions & 1 deletion src/api/system/form.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ export function getTableDetail(tablename) {
});
}

/**
* 获取所有表单设计json
* @param tablename
*/
export function getFormDetail(tablename) {
return axios({
url: '/form/detail',
Expand All @@ -41,7 +45,7 @@ export function getFormDetail(tablename) {
}

/**
*
* 获取表中所有字段信息
* @param {String} tablename
*/
export function getFormKey(tablename) {
Expand Down
3 changes: 1 addition & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ import lodash from 'lodash';
import dayjs from 'dayjs';
import axios from '@/plugins/axios';// axios中统一设置Token
import store from '@/store/index';// store内做了局部持久化
import ElementProCrud from 'element-pro-crud';
import App from './App.vue';// 下方$mount把App.vue挂载到public/index.html
import { router } from './router';// router内启用了懒加载
import 'normalize.css';// 重置css
import '@/plugins/element-pro-crud';// 引入element-pro-crud
import 'element-pro-crud/lib/ProCrud.css'; // 此处css引入需要放到element-ui css引入之前,避免样式覆盖问题

import '@/plugins/element';// vue-cli3.0以插件形式引入elementui
import '@/permission'; // 权限控制
import '@/styles/index.scss'; // 全局样式
import '@/icons/autoImportSvg'; // 自动导入src/icon目录下的svg图标

Vue.use(ElementProCrud);

/* 这里改写原型链,将axios设置为Vue的原型属性,
之后可以在组件的methods中使用this.axios发起请求。
Expand Down
15 changes: 15 additions & 0 deletions src/plugins/element-pro-crud.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* @file: pro crud 组件注册
* @author: BoBo
* @copyright: NanJing Anshare Tech .Com
* @Date: 2020-12-08 14:31:55
*/
import Vue from 'vue';
import ElementProCrud from 'element-pro-crud';
import { crud } from '@/api/public/crud';
import * as pluginsApi from '@/api/system/form';

Vue.use(ElementProCrud, {
...pluginsApi,
crud,
});
1 change: 0 additions & 1 deletion src/views/devTools/Dict.vue
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
:tableParams="tableParams"
:remoteFuncs="remoteFuncs"
:visibleList="{
tableTitle:false,
btnDel:true,
}">
</CrudTable>
Expand Down
17 changes: 1 addition & 16 deletions src/views/devTools/FormDesigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:btnAddOnClick="btnAddOnClick"
fullHeight
:visibleList="{
tableTitle:false,
btnDel:true,
}">
<!-- 以后这里会改成form -->
Expand All @@ -27,8 +26,7 @@
</CrudTable>
<FormDesignerDialog ref="dialog"
tableName="dynamictables"
@after-save="dialogOnClose"
:remoteFuncs="remoteFuncs" />
@after-save="dialogOnClose"/>
</div>
</template>

Expand All @@ -42,19 +40,6 @@ import { Vue, Component } from 'vue-property-decorator';
name: 'FormDesigner',
})
export default class FormDesigner extends Vue {
remoteFuncs = {
getTablesOfDB(resolve) {
// 请求表名列表
getTables().then((res) => {
const options = res.data.map(item => ({
label: item.TABLE_NAME,
value: item.TABLE_NAME,
}));
resolve(options);
});
},
};
// 添加按钮点击事件
btnAddOnClick() {
this.$refs.dialog.showDialog();
Expand Down
1 change: 0 additions & 1 deletion src/views/devTools/TableDesigner.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
:btnAddOnClick="btnAddOnClick"
fullHeight
:visibleList="{
tableTitle:false,
btnDel:true,
}">
<template slot="btnCustom"
Expand Down
1 change: 0 additions & 1 deletion src/views/system/Dept.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
btnExport: false,
btnAdd: false,
btnDel:true,
tableTitle:false,
conditionTitle: false,
actionColumnBtnAdd: true,
}"
Expand Down
1 change: 0 additions & 1 deletion src/views/system/Role.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
fullHeight
orderCondition="timestamp desc"
:visibleList="{
tableTitle:false,
btnDel:true,
}" />
</div>
Expand Down
4 changes: 2 additions & 2 deletions vue.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ module.exports = {
'/axios@0.19.2/dist/axios.min.js',
'/lodash@4.17.14/lodash.min.js',
'/core-js@2.6.5/client/shim.min.js',
'/element-pro-crud@latest/lib/ProCrud.umd.min.js',
'/element-pro-crud@latest/lib/ProCrud.css',
'/element-pro-crud@0.5.0/lib/ProCrud.umd.min.js',
'/element-pro-crud@0.5.0/lib/ProCrud.css',
],
append: false,
// hash: true,
Expand Down

0 comments on commit 390c7cd

Please sign in to comment.