|
|
|
@ -1,61 +1,167 @@
@@ -1,61 +1,167 @@
|
|
|
|
|
<template> |
|
|
|
|
<div> |
|
|
|
|
<BasicTable @register="registerTable" |
|
|
|
|
@fetch-success="handleSelectionChange" |
|
|
|
|
@selection-change="handleSelectionChange" |
|
|
|
|
> |
|
|
|
|
<template #toolbar> |
|
|
|
|
<a-button v-auth="['config_add']" |
|
|
|
|
type="primary" |
|
|
|
|
@click="handleAdd()" |
|
|
|
|
>新增参数</a-button> |
|
|
|
|
<a-button v-auth="['config_edit']" |
|
|
|
|
type="primary" |
|
|
|
|
:disabled="state.single" |
|
|
|
|
@click="handleEdit()" |
|
|
|
|
>修改参数</a-button> |
|
|
|
|
<a-button v-auth="['config_del']" |
|
|
|
|
type="primary" |
|
|
|
|
:disabled="state.multiple" |
|
|
|
|
@click="handleDel()" |
|
|
|
|
>删除参数</a-button> |
|
|
|
|
</template> |
|
|
|
|
<template #action="{ record }"> |
|
|
|
|
<TableAction :actions="[ |
|
|
|
|
{ |
|
|
|
|
label: '编辑', |
|
|
|
|
icon: 'fa6-regular:pen-to-square', |
|
|
|
|
auth: ['role_edit'], |
|
|
|
|
onClick: handleEdit.bind(null, record) |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '删除', |
|
|
|
|
icon: 'ant-design:delete-outlined', |
|
|
|
|
auth: ['role_del'], |
|
|
|
|
color: 'error', |
|
|
|
|
onClick: handleDel.bind(null, record) |
|
|
|
|
}]" |
|
|
|
|
/> |
|
|
|
|
</template> |
|
|
|
|
</BasicTable> |
|
|
|
|
<ConfigModal @register="registerModal" @success="handleSuccess"/> |
|
|
|
|
<div :class="[prefixCls, [`${prefixCls}-form-container`]]"> |
|
|
|
|
<AForm ref="formElRef" |
|
|
|
|
layout="inline" |
|
|
|
|
:colon="false" |
|
|
|
|
:labelCol="{ style: { width:'50px', 'margin-bottom': '5px' } }" |
|
|
|
|
:wrapperCol="{ style: { width: '300px', 'margin-bottom': '5px' } }" |
|
|
|
|
> |
|
|
|
|
<AFormItem label="标题" name="newPassword"> |
|
|
|
|
<a-input placeholder="请输入重置密码"/> |
|
|
|
|
</AFormItem> |
|
|
|
|
<AFormItem label="姓名" name="newPassword"> |
|
|
|
|
<a-input placeholder="请输入重置密码"/> |
|
|
|
|
</AFormItem> |
|
|
|
|
<AFormItem label="格式" name="newPassword"> |
|
|
|
|
<a-input placeholder="请输入重置密码"/> |
|
|
|
|
</AFormItem> |
|
|
|
|
<AFormItem> |
|
|
|
|
<a-button type="primary" |
|
|
|
|
class="mr-2">搜索</a-button> |
|
|
|
|
<a-button type="primary" |
|
|
|
|
class="mr-2">重置</a-button> |
|
|
|
|
</AFormItem> |
|
|
|
|
</AForm> |
|
|
|
|
<ATable :dataSource="dataSource" :columns="columns"> |
|
|
|
|
<template #title> |
|
|
|
|
<div style="width: 100%"> |
|
|
|
|
<div class="flex items-center"> |
|
|
|
|
<BasicTitle>{{ '参数配置列表' }}</BasicTitle> |
|
|
|
|
<div :class="`${headerPrefixCls}__toolbar`"> |
|
|
|
|
<a-button type="primary">新增</a-button> |
|
|
|
|
<a-button type="primary">编辑</a-button> |
|
|
|
|
<Divider type="vertical"/> |
|
|
|
|
<div class="table-settings"> |
|
|
|
|
<!--重做--> |
|
|
|
|
<Tooltip placement="top"> |
|
|
|
|
<template #title> |
|
|
|
|
<span>{{ t('common.redo') }}</span> |
|
|
|
|
</template> |
|
|
|
|
<RedoOutlined @click="() => { console.log(1) }"/> |
|
|
|
|
</Tooltip> |
|
|
|
|
<!--尺寸--> |
|
|
|
|
<Tooltip placement="top"> |
|
|
|
|
<template #title> |
|
|
|
|
<span>{{ t('component.table.settingDens') }}</span> |
|
|
|
|
</template> |
|
|
|
|
<Dropdown placement="bottomCenter" :trigger="['click']" :getPopupContainer="getPopupContainer"> |
|
|
|
|
<ColumnHeightOutlined /> |
|
|
|
|
<template #overlay> |
|
|
|
|
<Menu @click="()=>{console.log(2)}" selectable :selectedKeys="[]"> |
|
|
|
|
<MenuItem key="default"> |
|
|
|
|
<span>{{ t('component.table.settingDensDefault') }}</span> |
|
|
|
|
</MenuItem> |
|
|
|
|
<MenuItem key="middle"> |
|
|
|
|
<span>{{ t('component.table.settingDensMiddle') }}</span> |
|
|
|
|
</MenuItem> |
|
|
|
|
<MenuItem key="small"> |
|
|
|
|
<span>{{ t('component.table.settingDensSmall') }}</span> |
|
|
|
|
</MenuItem> |
|
|
|
|
</Menu> |
|
|
|
|
</template> |
|
|
|
|
</Dropdown> |
|
|
|
|
</Tooltip> |
|
|
|
|
<!--全屏--> |
|
|
|
|
<Tooltip placement="top"> |
|
|
|
|
<template #title> |
|
|
|
|
<span>{{ t('component.table.settingFullScreen') }}</span> |
|
|
|
|
</template> |
|
|
|
|
<FullscreenOutlined @click="() => {console.log(3)}" /> |
|
|
|
|
<!--<FullscreenExitOutlined @click="toggle" v-else />--> |
|
|
|
|
</Tooltip> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
</ATable> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
<script lang="ts" setup> |
|
|
|
|
/** |
|
|
|
|
* 提供模板规范代码参考,请尽量保证编写代码风格跟模板规范代码一致 |
|
|
|
|
* 采用ant-design-vue表格表单组件编写,采用 setup 写法 |
|
|
|
|
* Copyright © 2020-2022 <a href="http://www.entfrm.com/">entfrm</a> All rights reserved. |
|
|
|
|
* author entfrm开发团队-王翔 |
|
|
|
|
*/ |
|
|
|
|
import { BasicTable, useTable, TableAction } from '/@/components/Table'; |
|
|
|
|
import { BasicTitle } from '/@/components/Basic'; |
|
|
|
|
import { RedoOutlined, ColumnHeightOutlined, FullscreenOutlined, FullscreenExitOutlined } from '@ant-design/icons-vue'; |
|
|
|
|
import { computed, ComputedRef, ref, useSlots } from 'vue'; |
|
|
|
|
import { Table, Form, Row, Col, Divider, Tooltip, Dropdown, Menu } from 'ant-design-vue'; |
|
|
|
|
const MenuItem = Menu.Item; |
|
|
|
|
import { default as TableTitle } from '/@/components/Table/src/components/TableTitle.vue'; |
|
|
|
|
import { |
|
|
|
|
BasicTable, |
|
|
|
|
useTable, |
|
|
|
|
TableAction, |
|
|
|
|
InnerHandlers, |
|
|
|
|
ColumnChangeParam, |
|
|
|
|
BasicTableProps, |
|
|
|
|
} from '/@/components/Table'; |
|
|
|
|
import { getPopupContainer } from '/@/utils'; |
|
|
|
|
//import { list, remove } from '/@/api/platform/system/controller/config'; |
|
|
|
|
import ConfigModal from './ConfigModal.vue'; |
|
|
|
|
import { columns, searchFormSchema } from './config.data'; |
|
|
|
|
import { searchFormSchema } from './config.data'; |
|
|
|
|
import { useMessage } from '/@/hooks/web/useMessage'; |
|
|
|
|
import { reactive, toRaw } from 'vue'; |
|
|
|
|
import {reactive, toRaw, unref} from 'vue'; |
|
|
|
|
import {useModal} from "/@/components/Modal"; |
|
|
|
|
import {useDesign} from "/@/hooks/web/useDesign"; |
|
|
|
|
import { t } from '/@/hooks/web/useI18n'; |
|
|
|
|
import { createFormContext } from "/@/components/Form/src/hooks/useFormContext"; |
|
|
|
|
import {useTableHeader} from "/@/components/Table/src/hooks/useTableHeader"; |
|
|
|
|
import {basicProps} from "/@/components/Table/src/props"; |
|
|
|
|
|
|
|
|
|
const { createConfirm } = useMessage(); |
|
|
|
|
const { createMessage } = useMessage(); |
|
|
|
|
const { prefixCls } = useDesign('basic-table'); |
|
|
|
|
const { prefixCls: headerPrefixCls } = useDesign('basic-table-header'); |
|
|
|
|
|
|
|
|
|
const ATable = Table; |
|
|
|
|
const AForm = Form; |
|
|
|
|
const AFormItem = Form.Item; |
|
|
|
|
const ACol = Col; |
|
|
|
|
const ARow = Row; |
|
|
|
|
|
|
|
|
|
const handlers: InnerHandlers = { |
|
|
|
|
onColumnsChange: (data: ColumnChangeParam[]) => { |
|
|
|
|
console.log(1111); |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
const dataSource = [ |
|
|
|
|
{ |
|
|
|
|
key: '1', |
|
|
|
|
name: '胡彦斌', |
|
|
|
|
age: 32, |
|
|
|
|
address: '西湖区湖底公园1号', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
key: '2', |
|
|
|
|
name: '胡彦祖', |
|
|
|
|
age: 42, |
|
|
|
|
address: '西湖区湖底公园1号', |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const columns = [ |
|
|
|
|
{ |
|
|
|
|
title: '姓名', |
|
|
|
|
dataIndex: 'name', |
|
|
|
|
key: 'name', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '年龄', |
|
|
|
|
dataIndex: 'age', |
|
|
|
|
key: 'age', |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
title: '住址', |
|
|
|
|
dataIndex: 'address', |
|
|
|
|
key: 'address', |
|
|
|
|
}, |
|
|
|
|
]; |
|
|
|
|
|
|
|
|
|
const state = reactive({ |
|
|
|
|
// 选中数组 |
|
|
|
|