升级 element plus 版本 -> 2.2.6

This commit is contained in:
吕金泽 2022-06-23 21:25:36 +08:00
parent 01e600707a
commit f9f449761b
17 changed files with 87 additions and 52 deletions

View File

@ -80,7 +80,8 @@
{ {
permission: 'data:test:save', permission: 'data:test:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElEdit', icon: 'ElEdit',
click: (row) => { click: (row) => {
magicFormTitle.value = '修改' magicFormTitle.value = '修改'
@ -89,7 +90,8 @@
}, { }, {
permission: 'data:test:delete', permission: 'data:test:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElDelete', icon: 'ElDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({
@ -104,7 +106,7 @@
] ]
} }
}) })
const formOptions = reactive({ const formOptions = reactive({
detail: { detail: {
request: { request: {
@ -145,9 +147,9 @@
props: { props: {
type: 'textarea' type: 'textarea'
} }
}] }]
}] }]
} }
}) })
</script> </script>

View File

@ -10,7 +10,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^0.24.0", "axios": "^0.24.0",
"element-plus": "^2.1.11", "element-plus": "^2.2.6",
"nprogress": "0.2.0", "nprogress": "0.2.0",
"path-browserify": "^1.0.1", "path-browserify": "^1.0.1",
"vue": "^3.2.25", "vue": "^3.2.25",

View File

@ -4,7 +4,7 @@
:plain="plain" :plain="plain"
@click="buttonClick" @click="buttonClick"
> >
{{ props_.text }} {{ props_.label }}
</el-button> </el-button>
</template> </template>
@ -78,7 +78,7 @@ export default {
if (this.btnType === 'delete') { if (this.btnType === 'delete') {
this.requestMethod_ = 'delete' this.requestMethod_ = 'delete'
this.props_.type = 'danger' this.props_.type = 'danger'
this.props_.text = '删除' this.props_.label = '删除'
this.props_.icon = 'ElIconDelete' this.props_.icon = 'ElIconDelete'
this.beforeConfirm_ = '此操作将永久删除该数据, 是否继续?' this.beforeConfirm_ = '此操作将永久删除该数据, 是否继续?'
this.successTips_ = '删除成功!' this.successTips_ = '删除成功!'

View File

@ -26,7 +26,7 @@
</div> </div>
<div v-else-if="col.type == 'btns'"> <div v-else-if="col.type == 'btns'">
<template v-for="btn in col.btns"> <template v-for="btn in col.btns">
<el-button v-if="btn.if === undefined ? true : btn.if(scope.row)" :icon="btn.icon" :key="btn.label" v-permission="btn.permission" :type="btn.type" :size="btn.size || 'small'" :class="btn.class" @click="btn.click(scope.row, scope.$index)"> <el-button v-if="btn.if === undefined ? true : btn.if(scope.row)" :icon="btn.icon" :key="btn.label" v-permission="btn.permission" :type="btn.type" :link="btn.link" :size="btn.size || 'small'" :class="btn.class" @click="btn.click(scope.row, scope.$index)">
{{ btn.label }} {{ btn.label }}
</el-button> </el-button>
</template> </template>

View File

@ -11,7 +11,8 @@ const props = defineProps({
modelValue: { modelValue: {
type: String, type: String,
default: '' default: ''
} },
itemLabel: String
}) })
const input1 = ref('') const input1 = ref('')
const input2 = ref('') const input2 = ref('')

View File

@ -43,7 +43,6 @@
tabValue.value = global.tabValue.value tabValue.value = global.tabValue.value
}) })
function openTab(item){ function openTab(item){
console.log(global.visitedViews.map(it => it.name))
proxy.$router.push({ proxy.$router.push({
path: item.props.name, path: item.props.name,
query: global.visitedViews.filter(it => it.path == item.props.name)[0].query query: global.visitedViews.filter(it => it.path == item.props.name)[0].query

View File

@ -79,8 +79,9 @@ function gen(groupPath, data){
{ {
permission: '${permissionPrefix}:save', permission: '${permissionPrefix}:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
icon: 'ElEdit', link: true,
icon: 'ElIconEdit',
click: (row) => { click: (row) => {
magicFormTitle.value = '修改' magicFormTitle.value = '修改'
formDialog.value.show(() => magicForm.value.getDetail(row.id)) formDialog.value.show(() => magicForm.value.getDetail(row.id))
@ -88,8 +89,9 @@ function gen(groupPath, data){
}, { }, {
permission: '${permissionPrefix}:delete', permission: '${permissionPrefix}:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
icon: 'ElDelete', link: true,
icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({
url: '${groupPath}/delete', url: '${groupPath}/delete',

View File

@ -91,7 +91,8 @@ const listOptions = reactive({
{ {
permission: 'user:save', permission: 'user:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
// magicForm.value.getDetail(row.id) // magicForm.value.getDetail(row.id)
@ -102,7 +103,8 @@ const listOptions = reactive({
}, { }, {
permission: 'user:delete', permission: 'user:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({

View File

@ -56,13 +56,14 @@
}, { }, {
label: '操作', label: '操作',
type: 'btns', type: 'btns',
width: 140, width: 180,
fixed: 'right', fixed: 'right',
btns: [ btns: [
{ {
permission: 'code:gen:save', permission: 'code:gen:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
formDialog.value.show() formDialog.value.show()
@ -71,7 +72,8 @@
}, { }, {
permission: 'code:gen:delete', permission: 'code:gen:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({

View File

@ -148,7 +148,8 @@ const tableOptions = reactive({
{ {
permission: 'configure:save', permission: 'configure:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
handleUpdate(row) handleUpdate(row)
@ -157,7 +158,8 @@ const tableOptions = reactive({
{ {
permission: 'configure:delete', permission: 'configure:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({

View File

@ -90,7 +90,8 @@ const tableOptions = reactive({
btns: [ btns: [
{ {
label: '上移', label: '上移',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconSortUp', icon: 'ElIconSortUp',
click: (row) => { click: (row) => {
proxy.$get('/system/dict/items/sort/up',{ proxy.$get('/system/dict/items/sort/up',{
@ -104,7 +105,8 @@ const tableOptions = reactive({
}, },
{ {
label: '下移', label: '下移',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconSortDown', icon: 'ElIconSortDown',
click: (row) => { click: (row) => {
proxy.$get('/system/dict/items/sort/down',{ proxy.$get('/system/dict/items/sort/down',{
@ -131,7 +133,8 @@ const tableOptions = reactive({
{ {
permission: 'dict:items:save', permission: 'dict:items:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
handleUpdate(row) handleUpdate(row)
@ -140,7 +143,8 @@ const tableOptions = reactive({
{ {
permission: 'dict:items:delete', permission: 'dict:items:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({

View File

@ -107,7 +107,8 @@ const tableOptions = reactive({
{ {
permission: 'dict:save', permission: 'dict:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
handleUpdate(row) handleUpdate(row)
@ -116,7 +117,8 @@ const tableOptions = reactive({
{ {
permission: 'dict:delete', permission: 'dict:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({
@ -132,7 +134,8 @@ const tableOptions = reactive({
{ {
permission: 'dict:items:view', permission: 'dict:items:view',
label: '字典项', label: '字典项',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconList', icon: 'ElIconList',
click: (row) => { click: (row) => {
dictItemsDialog.value.show() dictItemsDialog.value.show()

View File

@ -90,11 +90,12 @@ const tableOptions = reactive({
{ {
label: '排序', label: '排序',
type: 'btns', type: 'btns',
width: 150, width: 180,
btns: [ btns: [
{ {
label: '上移', label: '上移',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconSortUp', icon: 'ElIconSortUp',
click: (row) => { click: (row) => {
proxy.$get('/system/menu/sort/up',{ proxy.$get('/system/menu/sort/up',{
@ -108,7 +109,8 @@ const tableOptions = reactive({
}, },
{ {
label: '下移', label: '下移',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconSortDown', icon: 'ElIconSortDown',
click: (row) => { click: (row) => {
proxy.$get('/system/menu/sort/down',{ proxy.$get('/system/menu/sort/down',{
@ -149,13 +151,14 @@ const tableOptions = reactive({
{ {
label: '操作', label: '操作',
type: 'btns', type: 'btns',
width: 260, width: 280,
fixed: 'right', fixed: 'right',
align: 'left', align: 'left',
btns: [ btns: [
{ {
label: '添加下级菜单', label: '添加下级菜单',
type: 'text', type: 'primary',
link: true,
permission: 'menu:save', permission: 'menu:save',
icon: 'ElIconPlus', icon: 'ElIconPlus',
click: (row) => { click: (row) => {
@ -164,7 +167,8 @@ const tableOptions = reactive({
}, },
{ {
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
permission: 'menu:save', permission: 'menu:save',
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
@ -173,7 +177,8 @@ const tableOptions = reactive({
}, },
{ {
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
permission: 'menu:delete', permission: 'menu:delete',
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {

View File

@ -85,7 +85,8 @@
{ {
permission: 'online:logout', permission: 'online:logout',
label: '踢人', label: '踢人',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconBicycle', icon: 'ElIconBicycle',
click: (row) => { click: (row) => {
// currRow.value = row // currRow.value = row

View File

@ -118,11 +118,12 @@ const tableOptions = reactive({
{ {
label: '排序', label: '排序',
type: 'btns', type: 'btns',
width: 150, width: 180,
btns: [ btns: [
{ {
label: '上移', label: '上移',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconSortUp', icon: 'ElIconSortUp',
click: (row) => { click: (row) => {
proxy.$get('/system/office/sort/up',{ proxy.$get('/system/office/sort/up',{
@ -136,7 +137,8 @@ const tableOptions = reactive({
}, },
{ {
label: '下移', label: '下移',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconSortDown', icon: 'ElIconSortDown',
click: (row) => { click: (row) => {
proxy.$get('/system/office/sort/down',{ proxy.$get('/system/office/sort/down',{
@ -153,13 +155,14 @@ const tableOptions = reactive({
{ {
label: '操作', label: '操作',
type: 'btns', type: 'btns',
width: 310, width: 360,
fixed: 'right', fixed: 'right',
align: 'left', align: 'left',
btns: [ btns: [
{ {
label: '添加下级机构', label: '添加下级机构',
type: 'text', type: 'primary',
link: true,
permission: 'office:save', permission: 'office:save',
icon: 'ElIconPlus', icon: 'ElIconPlus',
click: (row) => { click: (row) => {
@ -168,7 +171,8 @@ const tableOptions = reactive({
}, },
{ {
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
permission: 'office:save', permission: 'office:save',
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
@ -177,7 +181,8 @@ const tableOptions = reactive({
}, },
{ {
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
permission: 'office:delete', permission: 'office:delete',
icon: 'ElIconDelete', icon: 'ElIconDelete',
if: (row) => { if: (row) => {
@ -194,7 +199,8 @@ const tableOptions = reactive({
{ {
permission: 'office:user:list', permission: 'office:user:list',
label: '用户列表', label: '用户列表',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconUserFilled', icon: 'ElIconUserFilled',
click: (row) => { click: (row) => {
proxy.$router.push({ proxy.$router.push({

View File

@ -118,13 +118,14 @@ const tableOptions = reactive({
{ {
label: '操作', label: '操作',
type: 'btns', type: 'btns',
width: 270, width: 300,
fixed: 'right', fixed: 'right',
btns: [ btns: [
{ {
permission: 'role:save', permission: 'role:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
handleUpdate(row) handleUpdate(row)
@ -133,7 +134,8 @@ const tableOptions = reactive({
{ {
permission: 'role:delete', permission: 'role:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
click: (row) => { click: (row) => {
proxy.$common.handleDelete({ proxy.$common.handleDelete({
@ -146,7 +148,8 @@ const tableOptions = reactive({
{ {
permission: 'role:permission', permission: 'role:permission',
label: '权限', label: '权限',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconPlus', icon: 'ElIconPlus',
click: (row) => { click: (row) => {
temp.value.id = row.id temp.value.id = row.id
@ -156,7 +159,8 @@ const tableOptions = reactive({
{ {
permission: 'role:user:list', permission: 'role:user:list',
label: '用户列表', label: '用户列表',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconUserFilled', icon: 'ElIconUserFilled',
click: (row) => { click: (row) => {
proxy.$router.push({ proxy.$router.push({

View File

@ -186,7 +186,8 @@ const tableOptions = reactive({
{ {
permission: 'user:save', permission: 'user:save',
label: '修改', label: '修改',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconEdit', icon: 'ElIconEdit',
click: (row) => { click: (row) => {
handleUpdate(row) handleUpdate(row)
@ -195,7 +196,8 @@ const tableOptions = reactive({
{ {
permission: 'user:delete', permission: 'user:delete',
label: '删除', label: '删除',
type: 'text', type: 'primary',
link: true,
icon: 'ElIconDelete', icon: 'ElIconDelete',
if: (row) => { if: (row) => {
return row.id != '1' return row.id != '1'