Commit 53ae151f authored by smallwei's avatar smallwei

fix(cli): more and more

parent f4145a14
......@@ -10,7 +10,7 @@
"test:e2e": "vue-cli-service test:e2e"
},
"dependencies": {
"@smallwei/avue": "^1.1.17",
"@smallwei/avue": "^1.1.18",
"avue-plugin-transfer": "^0.0.2",
"avue-plugin-ueditor": "^0.0.1",
"axios": "^0.18.0",
......
......@@ -82,8 +82,8 @@ export default {
list.length > 0 ? `?list` : ''
}`
}
//超时3s自动隐藏等待狂,加强用户体验
let time = 3
//超时5s自动隐藏等待框,加强用户体验
let time = 5
const timeFunc = setInterval(() => {
time--
if (time == 0) {
......
// 配置编译环境和线上环境之间的切换
let baseUrl = 'http://192.168.0.20:9999';
const env = process.env
let baseUrl = '';
let iconfontVersion = ['567566_r22zi6t8noas8aor', '567566_qo5lxgtishg', '599693_dfa50fge714', '667895_2ek3wqcg8w1', '667895_bywepfixwj8']
let iconfontUrl = `//at.alicdn.com/t/font_$key.css`;
let codeUrl = `${baseUrl}/code`
let activitiUrl = `${baseUrl}/act`
const env = process.env
let codeUrl = `/code`
let actUrl = `${window.origin}/act/modeler.html?modelId=`;
if (env.NODE_ENV == 'development') {
baseUrl = ``; // 开发环境地址
} else if (env.NODE_ENV == 'production') {
baseUrl = ``; //生产环境地址
} else if (env.NODE_ENV == 'test') {
baseUrl = ``; //测试环境地址
}
export {
baseUrl,
actUrl,
iconfontUrl,
iconfontVersion,
codeUrl,
......
......@@ -15,29 +15,30 @@
* Author: lengleng (wangiegie@gmail.com)
*/
export const tableOption = {
'border': true,
'index': true,
'indexLabel': '序号',
'stripe': true,
'menuAlign': 'center',
'menuWidth': 150,
'align': 'center',
'refreshBtn': true,
'showClomnuBtn': false,
'searchSize': 'mini',
'addBtn': true,
'editBtn': false,
'delBtn': false,
'column': [{
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
menuWidth: 150,
menuBtn: true,
align: 'center',
editBtn: false,
delBtn: false,
searchShow: false,
labelWidth: 120,
column: [{
fixed: true,
label: '模型ID',
prop: 'id',
editDisabled: true,
addVisdiplay: false
}, {
fixed: true,
label: '模型标识',
prop: 'key',
editDisabled: true
},{
}, {
label: '流程分类',
prop: 'category',
search: true
......@@ -50,6 +51,7 @@ export const tableOption = {
editDisabled: true,
addVisdiplay: false
}, {
width: 150,
label: '创建时间',
prop: 'createTime',
type: 'datetime',
......@@ -58,6 +60,7 @@ export const tableOption = {
editDisabled: true,
addVisdiplay: false
}, {
width: 150,
label: '最后更新时间',
prop: 'lastUpdateTime',
type: 'datetime',
......
......@@ -15,27 +15,28 @@
* Author: lengleng (wangiegie@gmail.com)
*/
export const tableOption = {
'border': true,
'index': true,
'indexLabel': '序号',
'stripe': true,
'menuAlign': 'center',
'menuWidth': 150,
'align': 'center',
'refreshBtn': true,
'showClomnuBtn': false,
'searchSize': 'mini',
'addBtn': false,
'editBtn': false,
'delBtn': false,
'column': [{
border: true,
index: true,
indexLabel: '序号',
stripe: true,
menuAlign: 'center',
menuWidth: 150,
menuBtn: true,
align: 'center',
addBtn: false,
editBtn: false,
delBtn: false,
searchShow: false,
column: [{
fixed: true,
label: '流程ID',
prop: 'processonDefinitionId'
}, {
fixed: true,
label: '模型标识',
prop: 'key',
editDisabled: true
},{
}, {
label: '流程分类',
prop: 'category',
search: true
......
......@@ -29,7 +29,6 @@ export default {
return {}
},
created () {
console.log(this.menu);
this.$store.dispatch("GetMenu").then(data => {
if (data.length === 0) return
this.$router.addRoutes(this.$router.$avueRouter.formatRoutes(data, true))
......
......@@ -69,7 +69,6 @@ export default {
type: 'warning'
}).then(() => {
this.$store.commit('CLEAR_LOGS');
console.log(this);
this.$parent.$parent.box = false;
this.$message({
type: 'success',
......
let RouterPlugin = function() {
this.$router = null;
this.$store = null;
};
RouterPlugin.install = function(router, store) {
this.$router = router;
......@@ -13,6 +14,8 @@ RouterPlugin.install = function(router, store) {
return result.join('&');
}
this.$router.$avueRouter = {
//全局配置
$website: this.$store.getters.website,
// 设置标题
setTitle: function(title) {
title = title ? `${title}——Avue 通用管理 系统快速开发框架` : 'Avue 通用管理 系统快速开发框架';
......@@ -55,16 +58,21 @@ RouterPlugin.install = function(router, store) {
//动态路由
formatRoutes: function(aMenu, first) {
const aRouter = []
const propsConfig = this.$website.menu.props;
const propsDefault = {
label: propsConfig.label || 'label',
path: propsConfig.path || 'path',
icon: propsConfig.icon || 'icon',
children: propsConfig.children || 'children'
}
aMenu.forEach(oMenu => {
const {
path,
component,
name,
icon,
children
} = oMenu
const path = oMenu[propsDefault.path],
component = oMenu.component,
name = oMenu[propsDefault.label],
icon = oMenu[propsDefault.icon],
children = oMenu[propsDefault.children];
if (component) {
const isChild = children.length !== 0
const isChild = children.length !== 0;
const oRouter = {
path: path,
component(resolve) {
......
......@@ -2,17 +2,24 @@ import { setToken, removeToken } from '@/util/auth'
import { setStore, getStore } from '@/util/store'
import { logout, loginByUsername, loginBySocial, getUserInfo } from '@/api/login'
import { encryption } from '@/util/util'
import webiste from '@/const/website';
import { GetMenu } from '@/api/menu'
function addPath(ele) {
ele.children.forEach(child => {
const isChild = ele.children.length !== 0;
if (isChild) {
if (!child.path.includes('http') && !child.path.includes('https')) {
child.path = `${ele.path}/${child.path?child.path:'index'}`
const propsConfig = webiste.menu.props;
const propsDefault = {
label: propsConfig.label || 'label',
path: propsConfig.path || 'path',
icon: propsConfig.icon || 'icon',
children: propsConfig.children || 'children'
}
addPath(child);
const isChild = ele[propsDefault.children] && ele[propsDefault.children].length !== 0;
if (!isChild) return
ele[propsDefault.children].forEach(child => {
if (!child[propsDefault.path].includes('http') && !child[propsDefault.path].includes('https')) {
child[propsDefault.path] = `${ele[propsDefault.path]}/${child[propsDefault.path]?child[propsDefault.path]:'index'}`
}
addPath(child);
})
}
const user = {
......
......@@ -201,3 +201,37 @@ table {
.grayMode {
filter: grayscale(100%);
}
.clearfix {
&:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
} //main-container全局样式
.app-main {
min-height: 100%
}
.filter-container {
padding-bottom: 10px;
.filter-item {
display: inline-block;
vertical-align: middle;
margin-bottom: 10px;
margin-right: 10px;
}
}
.app-container {
padding: 20px;
box-sizing: border-box;
}
.pagination-container {
padding: 20px 0;
float: right;
}
\ No newline at end of file
......@@ -30,20 +30,17 @@
@row-save="handleSave"
@row-del="rowDel">
<template slot-scope="scope"
slot="menu">
<a :href="actUrl + scope.row.id" target="_blank" type="primary" icon="el-icon-view">模型图</a>
<el-button type="success"
slot="dropMenu">
<el-dropdown-item divided
v-if="permissions.sys_log_del"
icon="el-icon-upload"
size="mini"
plain
@click="handleDeploy(scope.row,scope.index)">部署</el-button>
<el-button type="danger"
@click.native="handleView(scope.row,scope.index)">模型图</el-dropdown-item>
<el-dropdown-item divided
v-if="permissions.sys_log_del"
icon="el-icon-delete"
size="mini"
plain
@click="handleDel(scope.row,scope.index)">删除</el-button>
@click.native="handleDeploy(scope.row,scope.index)">部署</el-dropdown-item>
<el-dropdown-item divided
v-if="permissions.sys_log_del"
@click.native="handleDel(scope.row,scope.index)">删除</el-dropdown-item>
</template>
</avue-crud>
</basic-container>
......@@ -51,14 +48,13 @@
</template>
<script>
import { fetchList, delObj, addObj, deploy } from '@/api/activiti'
import { tableOption } from '@/const/crud/activiti'
import { mapGetters } from 'vuex'
export default {
import { fetchList, delObj, addObj, deploy } from '@/api/activiti'
import { tableOption } from '@/const/crud/activiti'
import { mapGetters } from 'vuex'
export default {
name: 'activiti',
data() {
data () {
return {
actUrl: '',
tableData: [],
page: {
total: 0, // 总页数
......@@ -74,16 +70,15 @@
tableOption: tableOption
}
},
created() {
this.actUrl = `http://192.168.0.20:9999/act/modeler.html?modelId=`
created () {
this.getList()
},
mounted: function() { },
mounted: function () { },
computed: {
...mapGetters(['permissions'])
},
methods: {
getList() {
getList () {
this.tableLoading = true
this.listQuery.orderByField = 'create_time'
this.listQuery.isAsc = false
......@@ -93,24 +88,34 @@
this.tableLoading = false
})
},
currentChange(val) {
currentChange (val) {
this.listQuery.page = val
this.getList()
},
sizeChange(val) {
sizeChange (val) {
this.listQuery.limit = val
this.getList()
},
handleDel(row, index) {
handleView (row, index) {
const name = `模型id为${row.id}${row.name}流程图`,
src = `${this.actUrl}${row.id}`;
this.$router.push({
path: this.$router.$avueRouter.getPath({
name: name,
src: src
})
})
},
handleDel (row, index) {
this.$refs.crud.rowDel(row, index)
},
handleDeploy: function(row, index) {
handleDeploy: function (row, index) {
var _this = this
this.$confirm('是否确认部署ID为"' + row.id + '"的模型?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
}).then(function () {
return deploy(row.id)
})
.then(data => {
......@@ -121,16 +126,16 @@
type: 'success'
})
})
.catch(function(err) { })
.catch(function (err) { })
},
rowDel: function(row, index) {
rowDel: function (row, index) {
var _this = this
this.$confirm('是否确认删除ID为"' + row.id + '"的模型?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function() {
.then(function () {
return delObj(row.id)
})
.then(data => {
......@@ -141,7 +146,7 @@
type: 'success'
})
})
.catch(function(err) { })
.catch(function (err) { })
},
/**
* @title 数据添加
......@@ -149,7 +154,7 @@
* @param done 为表单关闭函数
*
**/
handleSave: function(row, done) {
handleSave: function (row, done) {
addObj(row).then(data => {
this.tableData.push(Object.assign({}, row))
this.$message({
......@@ -164,18 +169,18 @@
/**
* 搜索回调
*/
searchChange(form) {
searchChange (form) {
this.listQuery.category = form.category
this.getList()
},
/**
* 刷新回调
*/
refreshChange() {
refreshChange () {
this.getList()
}
}
}
}
</script>
<style lang="scss" scoped>
......
......@@ -29,36 +29,26 @@
@refresh-change="refreshChange"
@row-del="rowDel">
<template slot-scope="scope"
slot="menu">
<el-button type="success"
slot="dropMenu">
<el-dropdown-item divided
v-if="permissions.sys_log_del"
icon="el-icon-view"
size="mini"
plain
@click="handlePic(scope.row,scope.index)">流程图</el-button>
<el-button type="warning"
@click.native="handlePic(scope.row,scope.index)">流程图</el-dropdown-item>
<el-dropdown-item divided
v-if="permissions.sys_log_del && scope.row.suspend"
icon="el-icon-circle-check"
size="mini"
plain
@click="handleStatus(scope.row,'active')">激活</el-button>
<el-button type="warning"
@click.native="handleStatus(scope.row,'active')">激活</el-dropdown-item>
<el-dropdown-item divided
v-if="permissions.sys_log_del && !scope.row.suspend"
icon="el-icon-circle-close"
size="mini"
plain
@click="handleStatus(scope.row,'suspend')">失效</el-button>
<el-button type="danger"
@click="handleStatus(scope.row,'suspend')">失效</el-dropdown-item>
<el-dropdown-item divided
v-if="permissions.sys_log_del"
icon="el-icon-delete"
size="mini"
plain
@click="handleDel(scope.row,scope.index)">删除</el-button>
@click="handleDel(scope.row,'suspend')">删除</el-dropdown-item>
</template>
</avue-crud>
</basic-container>
<el-dialog
title="流程图"
<el-dialog title="流程图"
:visible.sync="showPicDialog">
<img :src="actPicUrl">
</el-dialog>
......@@ -66,12 +56,12 @@
</template>
<script>
import { fetchList, delObj, addObj, status} from '@/api/process'
import { tableOption } from '@/const/crud/process'
import { mapGetters } from 'vuex'
export default {
import { fetchList, delObj, addObj, status } from '@/api/process'
import { tableOption } from '@/const/crud/process'
import { mapGetters } from 'vuex'
export default {
name: 'process',
data() {
data () {
return {
showPicDialog: false,
actPicUrl: '',
......@@ -90,15 +80,15 @@
tableOption: tableOption
}
},
created() {
created () {
this.getList()
},
mounted: function() { },
mounted: function () { },
computed: {
...mapGetters(['permissions'])
},
methods: {
getList() {
getList () {
this.tableLoading = true
this.listQuery.orderByField = 'create_time'
this.listQuery.isAsc = false
......@@ -108,26 +98,26 @@
this.tableLoading = false
})
},
currentChange(val) {
currentChange (val) {
this.listQuery.page = val
this.getList()
},
sizeChange(val) {
sizeChange (val) {
this.listQuery.limit = val
this.getList()
},
handlePic(row, index) {
this.actPicUrl = `http://192.168.0.20:9999/act/process/resource/`+row.deploymentId + '/' + row.processonDefinitionId + "/image"
handlePic (row, index) {
this.actPicUrl = `/act/process/resource/` + row.deploymentId + '/' + row.processonDefinitionId + "/image"
this.showPicDialog = true
},
handleStatus(row, type) {
handleStatus (row, type) {
var _this = this
this.$confirm('是否确认操作ID为"' + row.processonDefinitionId + '"的流程?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(function() {
return status(row.processonDefinitionId,type)
}).then(function () {
return status(row.processonDefinitionId, type)
}).then(data => {
this.getList()
_this.$message({
......@@ -135,19 +125,19 @@
message: '操作成功',
type: 'success'
})
}).catch(function(err) { })
}).catch(function (err) { })
},
handleDel(row, index) {
handleDel (row, index) {
this.$refs.crud.rowDel(row, index)
},
rowDel: function(row, index) {
rowDel: function (row, index) {
var _this = this
this.$confirm('是否确认删除ID为"' + row.deploymentId + '"的模型?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
})
.then(function() {
.then(function () {
return delObj(row.deploymentId)
})
.then(data => {
......@@ -158,23 +148,23 @@
type: 'success'
})
})
.catch(function(err) { })
.catch(function (err) { })
},
/**
* 搜索回调
*/
searchChange(form) {
searchChange (form) {
this.listQuery.category = form.category
this.getList()
},
/**
* 刷新回调
*/
refreshChange() {
refreshChange () {
this.getList()
}
}
}
}
</script>
<style lang="scss" scoped>
......
......@@ -46,8 +46,7 @@
<avue-form :option="formOption"
ref="formData"
v-model="formData"
@submit="gen()"
>
@submit="gen()">
</avue-form>
</div>
</el-dialog>
......@@ -61,7 +60,7 @@ import { tableOption, formOption } from '@/const/crud/gen'
import { mapGetters } from 'vuex'
export default {
name: 'client',
data() {
data () {
return {
tableData: [],
formData: {},
......@@ -81,15 +80,15 @@ export default {
formOption: formOption
}
},
created() {
created () {
this.getList()
},
mounted: function() { },
mounted: function () { },
computed: {
...mapGetters(['permissions'])
},
methods: {
getList() {
getList () {
this.tableLoading = true
fetchList(this.listQuery).then(response => {
this.tableData = response.data.records
......@@ -97,32 +96,31 @@ export default {
this.tableLoading = false
})
},
currentChange(val) {
currentChange (val) {
this.page.currentPage = val
this.listQuery.page = val
this.getList()
},
sizeChange(val) {
sizeChange (val) {
this.page.pageSize = val
this.listQuery.limit = val
this.getList()
},
handleDown: function(row, index) {
handleDown: function (row, index) {
this.formData.tableName = row.tableName
this.box = true
},
/**
* 刷新回调
*/
refreshChange() {
refreshChange () {
this.getList()
},
searchChange(form) {
searchChange (form) {
this.listQuery.tableName = form.tableName
this.getList()
},
gen(form) {
console.log(this.formData)
gen (form) {
handleDown(this.formData).then(response => {
this.box = true
})
......
......@@ -213,7 +213,6 @@ export default {
})
},
filterNode (value, data) {
// console.log(value);
if (!value) return true
return data.label.indexOf(value) !== -1
},
......
......@@ -386,7 +386,6 @@ export default {
this.dialogDeptVisible = false
this.form.roleDeptId = data.id
this.form.deptName = data.name
console.log(data)
},
handleDelete (row) {
delObj(row.roleId).then(response => {
......
......@@ -18,14 +18,15 @@
<template>
<div class="app-container pull-auto">
<basic-container>
<avue-crud :data="data" :option="option"/>
<avue-crud :data="data"
:option="option" />
</basic-container>
</div>
</template>
<script>
import request from '@/router/axios'
export default {
data() {
data () {
return {
obj: {},
data: [],
......@@ -48,13 +49,12 @@ export default {
}
}
},
created() {
created () {
request({
url: '/tx/admin/avueSetting',
method: 'get'
}).then((resp) => {
this.data = resp.data
console.log(resp.data)
})
}
}
......
......@@ -167,7 +167,6 @@ export default {
})
},
resetForm (formName) {
console.log(formName)
this.$refs[formName].resetFields()
},
toggleShow () {
......
......@@ -669,9 +669,9 @@
version "1.1.2"
resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-1.1.2.tgz#54c5a964462be3d4d78af631363c18d6fa91ac26"
"@smallwei/avue@^1.1.17":
version "1.1.17"
resolved "https://registry.yarnpkg.com/@smallwei/avue/-/avue-1.1.17.tgz#b0ac20dec1ca37ae56aa161e07f6fdca96ca5b9f"
"@smallwei/avue@^1.1.18":
version "1.1.18"
resolved "https://registry.yarnpkg.com/@smallwei/avue/-/avue-1.1.18.tgz#4950f0b958168c4604b696fc2e0c23694cbb406c"
dependencies:
async-validator "~1.8.1"
axios "^0.16.2"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment