模版更新
This commit is contained in:
@@ -1,18 +1,28 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="default-main">
|
<div class='default-main'>
|
||||||
<!-- 表头 -->
|
<!-- 表头 -->
|
||||||
<TableHeader date-picker>
|
<TableHeader date-picker>
|
||||||
|
<template v-slot:select>
|
||||||
|
<el-form-item label='关键词:'>
|
||||||
|
<el-input
|
||||||
|
style='width: 240px'
|
||||||
|
v-model='tableStore.table.params.searchValue'
|
||||||
|
clearable
|
||||||
|
placeholder='仅根据用户名/登录名'
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</template>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button :icon="Plus" type="primary" @click="addUser">添加</el-button>
|
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
<!-- 表格 -->
|
<!-- 表格 -->
|
||||||
<Table ref="tableRef" />
|
<Table ref='tableRef' />
|
||||||
<!-- 弹框 -->
|
<!-- 弹框 -->
|
||||||
<PopupEdit ref="popupEdit" />
|
<PopupEdit ref='popupEdit' />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script setup lang="ts">
|
<script setup lang='ts'>
|
||||||
import { Plus } from '@element-plus/icons-vue'
|
import { Plus } from '@element-plus/icons-vue'
|
||||||
import { ref, onMounted, provide, defineOptions } from 'vue'
|
import { ref, onMounted, provide, defineOptions } from 'vue'
|
||||||
import { ElMessageBox, ElMessage } from 'element-plus'
|
import { ElMessageBox, ElMessage } from 'element-plus'
|
||||||
@@ -75,7 +85,8 @@ const tableStore = new TableStore({
|
|||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1
|
return row.state !== 1
|
||||||
},
|
},
|
||||||
click: row => {}
|
click: row => {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
@@ -91,7 +102,8 @@ const tableStore = new TableStore({
|
|||||||
confirmButtonText: '确认',
|
confirmButtonText: '确认',
|
||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
inputType: 'password'
|
inputType: 'password'
|
||||||
}).then(({ value }) => {})
|
}).then(({ value }) => {
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -103,7 +115,8 @@ const tableStore = new TableStore({
|
|||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
||||||
},
|
},
|
||||||
click: row => {}
|
click: row => {
|
||||||
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'edit',
|
name: 'edit',
|
||||||
@@ -114,7 +127,8 @@ const tableStore = new TableStore({
|
|||||||
disabled: row => {
|
disabled: row => {
|
||||||
return row.state !== 1 && row.state !== 3
|
return row.state !== 1 && row.state !== 3
|
||||||
},
|
},
|
||||||
click: row => {}
|
click: row => {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
@@ -142,6 +156,7 @@ const tableStore = new TableStore({
|
|||||||
|
|
||||||
provide('tableStore', tableStore)
|
provide('tableStore', tableStore)
|
||||||
tableStore.table.params.searchState = 1
|
tableStore.table.params.searchState = 1
|
||||||
|
tableStore.table.params.searchValue = ''
|
||||||
tableStore.table.params.casualUser = -1
|
tableStore.table.params.casualUser = -1
|
||||||
tableStore.table.params.orderBy = ''
|
tableStore.table.params.orderBy = ''
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class='default-main'>
|
<div class='default-main'>
|
||||||
|
<!-- 表头 -->
|
||||||
<TableHeader date-picker>
|
<TableHeader date-picker>
|
||||||
<template v-slot:operation>
|
<template v-slot:operation>
|
||||||
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
<el-button :icon='Plus' type='primary' @click='addUser'>添加</el-button>
|
||||||
</template>
|
</template>
|
||||||
</TableHeader>
|
</TableHeader>
|
||||||
|
<!-- 表格 -->
|
||||||
<Table ref='tableRef' />
|
<Table ref='tableRef' />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -15,12 +17,7 @@ import { ElMessageBox, ElMessage } from 'element-plus'
|
|||||||
import TableStore from '@/utils/tableStore'
|
import TableStore from '@/utils/tableStore'
|
||||||
import Table from '@/components/table/index.vue'
|
import Table from '@/components/table/index.vue'
|
||||||
import TableHeader from '@/components/table/header/index.vue'
|
import TableHeader from '@/components/table/header/index.vue'
|
||||||
import PopupEdit from './popupEdit.vue'
|
|
||||||
|
|
||||||
// 注意名字不要重复,若要保持页面存活,名字需要和路由admin后面的字符保持一致
|
|
||||||
defineOptions({
|
|
||||||
name: 'auth/userlist'
|
|
||||||
})
|
|
||||||
const tableStore = new TableStore({
|
const tableStore = new TableStore({
|
||||||
url: '/user-boot/user/list',
|
url: '/user-boot/user/list',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
@@ -88,7 +85,6 @@ const tableStore = new TableStore({
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
inputType: 'password'
|
inputType: 'password'
|
||||||
}).then(({ value }) => {
|
}).then(({ value }) => {
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -102,7 +98,6 @@ const tableStore = new TableStore({
|
|||||||
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
return row.state !== 2 && row.state !== 5 && row.state !== 0 && row.state !== 4
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
@@ -115,7 +110,6 @@ const tableStore = new TableStore({
|
|||||||
return row.state !== 1 && row.state !== 3
|
return row.state !== 1 && row.state !== 3
|
||||||
},
|
},
|
||||||
click: row => {
|
click: row => {
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@@ -147,9 +141,11 @@ tableStore.table.params.searchState = 1
|
|||||||
tableStore.table.params.casualUser = -1
|
tableStore.table.params.casualUser = -1
|
||||||
tableStore.table.params.orderBy = ''
|
tableStore.table.params.orderBy = ''
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
|
// 加载数据
|
||||||
tableStore.index()
|
tableStore.index()
|
||||||
})
|
})
|
||||||
|
|
||||||
const addUser = () => {
|
const addUser = () => {
|
||||||
|
popupEdit.value.open('新增用户')
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user