代码优化

This commit is contained in:
仲么了
2024-01-31 14:14:51 +08:00
parent 5d09ad3459
commit 5bc06899d7
5 changed files with 18 additions and 24 deletions

View File

@@ -205,9 +205,6 @@ if (buttonsFilter.length > 3) {
buttons.value = buttonsFilter buttons.value = buttonsFilter
} }
const handlerCommand = (item: OptButton) => { const handlerCommand = (item: OptButton) => {
console.log('====================================')
console.log(item)
console.log('====================================')
switch (item.render) { switch (item.render) {
case 'basicButton': case 'basicButton':
onButtonClick(item) onButtonClick(item)

View File

@@ -116,7 +116,7 @@ const handlerHeight = () => {
const computedSearchRow = () => { const computedSearchRow = () => {
const headerForm = document.getElementById('header-form') as HTMLElement const headerForm = document.getElementById('header-form') as HTMLElement
const headerFormSecond = document.getElementById('header-form-second') as HTMLElement const headerFormSecond = document.getElementById('header-form-second') as HTMLElement
if(!headerForm) return
// 判断是否需要折叠 // 判断是否需要折叠
if (headerForm.scrollHeight > 50) { if (headerForm.scrollHeight > 50) {
showUnfoldButton.value = true showUnfoldButton.value = true

View File

@@ -4,7 +4,7 @@
<div style="flex: 1; font-weight: 700">待审核用户</div> <div style="flex: 1; font-weight: 700">待审核用户</div>
<el-button :icon="Check" type="primary" @click="addRole" class="ml10">审核通过</el-button> <el-button :icon="Check" type="primary" @click="addRole" class="ml10">审核通过</el-button>
</div> </div>
<Table ref="tableRef" @checkbox-all="" @checkbox-change="" /> <Table ref="tableRef" />
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
@@ -23,7 +23,7 @@ const tableStore = new TableStore({
method: 'POST', method: 'POST',
url: '/user-boot/user/checkUserList', url: '/user-boot/user/checkUserList',
column: [ column: [
{ width: '60', type: 'checkbox' }, // { width: '60', type: 'checkbox' },
{ title: '名称', field: 'name' }, { title: '名称', field: 'name' },
{ title: '登录名', field: 'loginName' }, { title: '登录名', field: 'loginName' },
{ title: '角色', field: 'roleName' }, { title: '角色', field: 'roleName' },
@@ -34,7 +34,7 @@ const tableStore = new TableStore({
{ title: '状态', field: 'stateName' }, { title: '状态', field: 'stateName' },
{ {
title: '操作', title: '操作',
width: '10', width: '180',
render: 'buttons', render: 'buttons',
buttons: [ buttons: [
{ {

View File

@@ -5,7 +5,6 @@
<el-button :icon="Refresh" type="primary" @click="refresh">刷新推荐码</el-button> <el-button :icon="Refresh" type="primary" @click="refresh">刷新推荐码</el-button>
</div> </div>
<Table ref="tableRef" /> <Table ref="tableRef" />
<popupForm ref="popupRef"></popupForm>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">

View File

@@ -1,30 +1,30 @@
<template> <template>
<div class='dictiontary-list-detail'> <div class="dictiontary-list-detail">
<TableHeader> <TableHeader>
<template #select> <template #select>
<el-page-header @back="$emit('close')" style='display: flex;align-items: center'> <el-page-header @back="$emit('close')" style="display: flex; align-items: center; height: 32px">
<template #content> <template #content>
<span class='text-large font-600 mr-3'> {{ props.detail.name }}详情信息 </span> <span class="text-large font-600 mr-3">{{ props.detail.name }}详情信息</span>
</template> </template>
</el-page-header> </el-page-header>
<el-form-item label='过滤筛选'> <el-form-item label="过滤筛选">
<el-input <el-input
style='width: 240px' style="width: 240px"
v-model='tableStore.table.params.searchValue' v-model="tableStore.table.params.searchValue"
clearable clearable
placeholder='请输入名称或编码筛选' placeholder="请输入名称或编码筛选"
/> />
</el-form-item> </el-form-item>
</template> </template>
<template #operation> <template #operation>
<el-button :icon='Plus' type='primary' @click='add'>新增</el-button> <el-button :icon="Plus" type="primary" @click="add">新增</el-button>
</template> </template>
</TableHeader> </TableHeader>
<Table ref='tableRef' /> <Table ref="tableRef" />
<PopupDetailEdit ref='popupEditRef'></PopupDetailEdit> <PopupDetailEdit ref="popupEditRef"></PopupDetailEdit>
</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 } from 'vue' import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore' import TableStore from '@/utils/tableStore'
@@ -132,7 +132,7 @@ tableStore.table.params.searchValue = ''
tableStore.table.params.searchState = 0 tableStore.table.params.searchState = 0
tableStore.table.params.typeId = props.detail.id tableStore.table.params.typeId = props.detail.id
if (props.detail.openLevel !== 1) { if (props.detail.openLevel !== 1) {
tableStore.table.column = tableStore.table.column.filter((item: any) => item.field !== 'levelName' ) tableStore.table.column = tableStore.table.column.filter((item: any) => item.field !== 'levelName')
} }
if (props.detail.openDescribe !== 1) { if (props.detail.openDescribe !== 1) {
tableStore.table.column = tableStore.table.column.filter((item: any) => item.field !== 'algoDescribe') tableStore.table.column = tableStore.table.column.filter((item: any) => item.field !== 'algoDescribe')
@@ -141,7 +141,6 @@ onMounted(() => {
tableStore.index() tableStore.index()
}) })
const add = () => { const add = () => {
popupEditRef.value.open('新增', { popupEditRef.value.open('新增', {
openLevel: props.detail.openLevel, openLevel: props.detail.openLevel,
openDescribe: props.detail.openDescribe, openDescribe: props.detail.openDescribe,
@@ -149,9 +148,8 @@ const add = () => {
typeId: props.detail.id typeId: props.detail.id
}) })
} }
</script> </script>
<style lang='scss'> <style lang="scss">
.dictiontary-list-detail { .dictiontary-list-detail {
position: absolute; position: absolute;
top: 0; top: 0;
@@ -160,4 +158,4 @@ const add = () => {
width: 100%; width: 100%;
background: #fff; background: #fff;
} }
</style> </style>