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