This commit is contained in:
万纯 2021-03-01 16:47:48 +08:00
commit 6663635bb5
20 changed files with 55 additions and 440 deletions

View File

@ -1,5 +1,5 @@
{
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"changelog": {
"repo": "WeBankFinTech/fes.js",
"cacheDir": ".changelog",

View File

@ -11,7 +11,7 @@
"clean": "lerna clean",
"bootstrap": "lerna bootstrap",
"build": "father-build --watch",
"ver": "lerna version prerelease --preid alpha --no-changelog --no-commit-hooks --no-private",
"ver": "lerna version prerelease --preid rc --no-changelog --no-commit-hooks --no-private",
"release": "father-build && lerna publish from-git --dist-tag next",
"docs:dev": "vuepress dev docs --clean-cache",
"docs:build": "vuepress build docs --clean-cache"

View File

@ -1,6 +1,6 @@
{
"name": "@webank/create-fes-app",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "create a app base on fes.js",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-compiler",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-compiler",
"main": "lib/index.js",
"files": [
@ -24,8 +24,8 @@
"access": "public"
},
"dependencies": {
"@babel/register": "^7.12.13",
"@babel/preset-env": "^7.12.13",
"@babel/register": "^7.12.13",
"@umijs/utils": "3.3.3",
"commander": "^7.0.0",
"dotenv": "8.2.0",

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-access",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-access",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-enums",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-enums",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-icon",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-icon",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-jest",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-jest",
"main": "lib/index.js",
"files": [
@ -32,7 +32,7 @@
"dependencies": {
"@babel/core": "7.11.6",
"@umijs/babel-preset-umi": "3.2.24",
"@webank/fes-compiler": "^2.0.0-alpha.8",
"@webank/fes-compiler": "^2.0.0-rc.0",
"babel-core": "^7.0.0-bridge.0",
"babel-jest": "^26.6.3",
"core-js": "3.6.5",

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-layout",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-layout",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-locale",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-locale",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-model",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-model",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-request",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-request",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-plugin-vuex",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-plugin-vuex",
"main": "lib/index.js",
"files": [

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-preset-built-in",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-preset-built-in",
"main": "lib/index.js",
"types": "lib/index.d.ts",
@ -26,49 +26,49 @@
},
"dependencies": {
"@babel/core": "^7.12.13",
"@babel/preset-env": "^7.12.13",
"@babel/plugin-proposal-export-default-from": "^7.12.13",
"@babel/plugin-proposal-pipeline-operator": "^7.12.13",
"@babel/plugin-proposal-do-expressions": "^7.12.13",
"@babel/plugin-proposal-export-default-from": "^7.12.13",
"@babel/plugin-proposal-function-bind": "^7.12.13",
"@babel/plugin-proposal-pipeline-operator": "^7.12.13",
"@babel/plugin-transform-runtime": "^7.12.13",
"@babel/preset-env": "^7.12.13",
"@soda/friendly-errors-webpack-plugin": "^1.8.0",
"@umijs/utils": "3.3.3",
"@vue/babel-plugin-jsx": "^1.0.2",
"@vue/compiler-sfc": "^3.0.4",
"@webank/fes-compiler": "^2.0.0-rc.0",
"autoprefixer": "^10.2.4",
"babel-loader": "^8.2.2",
"core-js": "^3.8.3",
"babel-plugin-import": "1.13.3",
"body-parser": "^1.19.0",
"cli-highlight": "^2.1.4",
"cliui": "7.0.4",
"cookie-parser": "^1.4.5",
"copy-webpack-plugin": "^7.0.0",
"core-js": "^3.8.3",
"css-loader": "^5.0.1",
"css-minimizer-webpack-plugin": "^1.2.0",
"deepmerge": "^4.2.2",
"envinfo": "^7.7.3",
"file-loader": "^6.2.0",
"html-webpack-plugin": "^5.0.0",
"html-webpack-tags-plugin": "^3.0.0",
"webpackbar": "^5.0.0-3",
"@soda/friendly-errors-webpack-plugin": "^1.8.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-dev-server": "^3.11.2",
"babel-plugin-import": "1.13.3",
"file-loader": "^6.2.0",
"url-loader": "^4.1.1",
"raw-loader": "^4.0.2",
"css-loader": "^5.0.1",
"style-loader": "^2.0.0",
"mini-css-extract-plugin": "^1.3.5",
"css-minimizer-webpack-plugin": "^1.2.0",
"less": "3.9.0",
"less-loader": "^8.0.0",
"autoprefixer": "^10.2.4",
"postcss-loader": "^4.2.0",
"mini-css-extract-plugin": "^1.3.5",
"mockjs": "^1.1.0",
"postcss": "^8.2.4",
"postcss-flexbugs-fixes": "^5.0.2",
"postcss-loader": "^4.2.0",
"postcss-safe-parser": "^5.0.2",
"copy-webpack-plugin": "^7.0.0",
"webpack": "^5.21.0",
"deepmerge": "^4.2.2",
"@webank/fes-compiler": "^2.0.0-alpha.8",
"envinfo": "^7.7.3",
"raw-loader": "^4.0.2",
"style-loader": "^2.0.0",
"url-loader": "^4.1.1",
"vue-loader": "^16.1.2",
"cli-highlight": "^2.1.4",
"webpack": "^5.21.0",
"webpack-bundle-analyzer": "^4.4.0",
"webpack-chain": "^6.5.1",
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.5",
"mockjs": "^1.1.0"
"webpack-dev-server": "^3.11.2",
"webpackbar": "^5.0.0-3"
}
}

View File

@ -30,15 +30,12 @@ export default (api) => {
},
enableBy: () => !!process.env.ANALYZE
});
api.chainWebpack((webpackConfig, opts) => {
const { type } = opts;
if (type === 'csr') {
webpackConfig
.plugin('bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [
api.config?.analyze || {}
]);
}
api.chainWebpack((webpackConfig) => {
webpackConfig
.plugin('bundle-analyzer')
.use(require('webpack-bundle-analyzer').BundleAnalyzerPlugin, [
api.config?.analyze || {}
]);
return webpackConfig;
});
};

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes-runtime",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "@webank/fes-runtime",
"main": "dist/index.js",
"files": [

View File

@ -9,7 +9,7 @@ export default {
publicPath: '/',
access: {
roles: {
admin: ["/", "/onepiece", '/store', '/simpleList']
admin: ["/", "/onepiece", '/store']
}
},
request: {

View File

@ -3,8 +3,6 @@
import { access } from '@webank/fes';
import PageLoading from '@/components/PageLoading';
import UserCenter from '@/components/UserCenter';
import Andt from 'ant-design-vue';
import 'ant-design-vue/dist/antd.css';
export const beforeRender = {
loading: <PageLoading />,
@ -21,10 +19,6 @@ export const beforeRender = {
}
};
export const onAppCreated = ({ app }) => {
app.use(Andt);
};
export const layout = {
customHeader: <UserCenter />
};

View File

@ -1,376 +0,0 @@
<template>
<div class="generic-list-page">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="8" :sm="24">
<a-form-item label="规则编号">
<a-input v-model="queryParam.id" placeholder="" />
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="使用状态">
<a-select
v-model="queryParam.status"
placeholder="请选择"
default-value="0"
>
<a-select-option value="0">全部</a-select-option>
<a-select-option value="1">关闭</a-select-option>
<a-select-option value="2">运行中</a-select-option>
</a-select>
</a-form-item>
</a-col>
<template v-if="advanced">
<a-col :md="8" :sm="24">
<a-form-item label="调用次数">
<a-input-number
v-model="queryParam.callNo"
style="width: 100%"
/>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="更新日期">
<a-date-picker
v-model="queryParam.date"
style="width: 100%"
placeholder="请输入更新日期"
/>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="使用状态">
<a-select
v-model="queryParam.useStatus"
placeholder="请选择"
default-value="0"
>
<a-select-option value="0">全部</a-select-option>
<a-select-option value="1">关闭</a-select-option>
<a-select-option value="2">运行中</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<a-form-item label="使用状态">
<a-select
placeholder="请选择"
default-value="0"
>
<a-select-option value="0">全部</a-select-option>
<a-select-option value="1">关闭</a-select-option>
<a-select-option value="2">运行中</a-select-option>
</a-select>
</a-form-item>
</a-col>
</template>
<a-col :md="(!advanced && 8) || 24" :sm="24">
<span
class="table-page-search-submitButtons"
:style="
(advanced && {
float: 'right',
overflow: 'hidden'
}) || {}"
>
<a-button type="primary" @click="search">查询</a-button>
<a-button
style="margin-left: 8px"
@click="() => (queryParam = {})"
>重置</a-button>
<a style="margin-left: 8px" @click="toggleAdvanced">
{{advanced ? "收起" : "展开"}}
<a-icon :type="advanced ? 'up' : 'down'" />
</a>
</span>
</a-col>
</a-row>
</a-form>
</div>
<!-- <div class="table-operator">
<a-button type="primary" icon="plus" @click="handleAdd">新建</a-button>
<a-dropdown v-action:edit v-if="selectedRowKeys.length > 0">
<a-menu slot="overlay">
<a-menu-item key="1"><a-icon type="delete" />删除</a-menu-item>
<a-menu-item key="2"><a-icon type="lock" />锁定</a-menu-item>
</a-menu>
<a-button style="margin-left: 8px">
批量操作 <a-icon type="down" />
</a-button>
</a-dropdown>
</div> -->
<a-table
:columns="columns"
:data-source="listData"
:loading="queryListDataLoading"
:pagination="pagination"
@change="change"
>
<template #action="{ record }">
<span>
<a>Invite {{record.name}}</a>
<a-divider type="vertical" />
<a-popconfirm
title="Are you sure delete this task?"
ok-text="Yes"
cancel-text="No"
@confirm="confirmDelete(record)"
>
<a href="#">Delete</a>
</a-popconfirm>
</span>
</template>
</a-table>
<!-- <create-form
ref="createModal"
:visible="visible"
:loading="confirmLoading"
:model="mdl"
@cancel="handleCancel"
@ok="handleOk"
/> -->
</div>
</template>
<script>
import {
computed, reactive, ref
} from 'vue';
import { message } from 'ant-design-vue';
import { request, enums } from '@webank/fes';
const columns = [
{
title: 'Name',
dataIndex: 'name',
key: 'name'
},
{
title: 'Age',
dataIndex: 'age',
key: 'age'
},
{
title: 'Address',
dataIndex: 'address',
key: 'address 1',
ellipsis: true
},
{
title: 'Long Column Long Column Long Column',
dataIndex: 'address',
key: 'address 2',
ellipsis: true
},
{
title: 'Long Column Long Column',
dataIndex: 'address',
key: 'address 3',
ellipsis: true
},
{
title: 'Long Column',
dataIndex: 'address',
key: 'address 4',
ellipsis: true
},
{
title: '操作',
key: 'action',
slots: { customRender: 'action' }
}
];
// const data = [
// {
// key: '1',
// name: 'John Brown',
// age: 32,
// address: 'New York No. 1 Lake Park, New York No. 1 Lake Park',
// tags: ['nice', 'developer']
// },
// {
// key: '2',
// name: 'Jim Green',
// age: 42,
// address: 'London No. 2 Lake Park, London No. 2 Lake Park',
// tags: ['loser']
// },
// {
// key: '3',
// name: 'Joe Black',
// age: 32,
// address: 'Sidney No. 1 Lake Park, Sidney No. 1 Lake Park',
// tags: ['cool', 'teacher']
// }
// ];
/**
* TODO
* 新增操作
* 修改操作
* 导出操作
*/
export default {
setup() {
//
let currentQueryParam = null;
const queryParam = reactive({
id: '',
status: '',
callNo: 0,
date: null,
useStatus: ''
});
//
const advanced = ref(false);
const toggleAdvanced = () => {
advanced.value = !advanced.value;
};
const pagination = reactive({
current: 1,
pageSize: 15,
showSizeChanger: true,
total: 0
});
const queryListDataLoading = ref(true);
const listData = ref([]);
const queryTableData = () => {
queryListDataLoading.value = true;
request('api/simple/list', {
...currentQueryParam,
page: pagination
}).then((res) => {
listData.value = res.data;
queryListDataLoading.value = false;
if (res.page) {
pagination.total = res.page.total;
}
});
};
queryTableData();
const change = (currentPagination) => {
pagination.current = currentPagination.current;
pagination.pageSize = currentPagination.pageSize;
queryTableData();
};
/**
* 有两种可以选择的模式
* 1. 点击搜索的时候才进行查询
* 适合搜索条件多的情况
* 2. 改变搜素条件的时候自动进行搜索
* 适合搜索条件少的情况
*
* 默认 <=3 三个搜索条件采用自动索索的方式> 3 采用手动搜索
*/
const search = () => {
pagination.current = 1;
currentQueryParam = { ...queryParam };
};
//
// watch(queryParam, () => {
// pagination.current = 1;
// currentQueryParam = { ...queryParam };
// queryTableData();
// });
//
const transferData = computed(() => {
if (!listData.value) return [];
// TODO
const transferKeys = [];
return listData.value.map((item) => {
transferKeys.forEach((key) => {
item[key] = enums.get(key, item[key]);
});
return item;
});
});
//
const confirmDelete = (record) => {
console.log('confirm delete');
console.log(record);
request('url', ...record).then(() => {
message.success('删除成功');
this.queryTableData();
});
};
//
// const exportData = () => {
// console.log('confirm delete');
// // TODO
// request('url', ...queryParam).then(() => {
// message.success('');
// this.queryTableData();
// });
// };
return {
queryListDataLoading,
listData: transferData,
columns,
change,
pagination,
queryParam,
search,
advanced,
toggleAdvanced,
confirmDelete
};
}
};
</script>
<style lang="less">
.generic-list-page {
padding: 32px;
}
//
.table-page-search-wrapper {
.ant-form-inline {
.ant-form-item {
display: flex;
margin-bottom: 24px;
margin-right: 0;
.ant-form-item-control-wrapper {
flex: 1 1;
display: inline-block;
vertical-align: middle;
}
> .ant-form-item-label {
line-height: 32px;
padding-right: 8px;
width: auto;
}
.ant-form-item-control {
height: 32px;
line-height: 32px;
}
}
}
.table-page-search-submitButtons {
display: block;
margin-bottom: 24px;
white-space: nowrap;
}
}
</style>
<config>
{
"name": "simpleList",
"title": "列表页面"
}
</config>

View File

@ -1,6 +1,6 @@
{
"name": "@webank/fes",
"version": "2.0.0-alpha.8",
"version": "2.0.0-rc.0",
"description": "一个好用的前端管理台快速开发框架",
"preferGlobal": true,
"scripts": {
@ -40,9 +40,9 @@
],
"dependencies": {
"@umijs/utils": "3.3.3",
"@webank/fes-compiler": "^2.0.0-alpha.8",
"@webank/fes-preset-built-in": "^2.0.0-alpha.8",
"@webank/fes-runtime": "^2.0.0-alpha.8",
"@webank/fes-compiler": "^2.0.0-rc.0",
"@webank/fes-preset-built-in": "^2.0.0-rc.0",
"@webank/fes-runtime": "^2.0.0-rc.0",
"resolve-cwd": "^3.0.0"
},
"engines": {