Commit 53ae151f authored by smallwei's avatar smallwei

fix(cli): more and more

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