New file |
| | |
| | | { |
| | | "plugins": [ |
| | | [ |
| | | "@vue/babel-plugin-jsx", |
| | | { |
| | | "theme": "vue3" |
| | | } |
| | | ] |
| | | ] |
| | | } |
| | |
| | | }, |
| | | "devDependencies": { |
| | | "@vitejs/plugin-vue": "^5.0.5", |
| | | "@vue/babel-plugin-jsx": "^1.2.2", |
| | | "vite": "^5.3.1" |
| | | } |
| | | }, |
| | |
| | | }, |
| | | "devDependencies": { |
| | | "@vitejs/plugin-vue": "^5.0.5", |
| | | "@vue/babel-plugin-jsx": "^1.2.2", |
| | | "vite": "^5.3.1" |
| | | } |
| | | } |
New file |
| | |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import { ref } from 'vue'; |
| | | |
| | | export default function useTableSearch() { |
| | | const searchText = ref(''); |
| | | const searchedColumn = ref(''); |
| | | |
| | | const handleSearch = (selectedKeys, confirm, dataIndex) => { |
| | | confirm(); |
| | | searchText.value = selectedKeys[0]; |
| | | searchedColumn.value = dataIndex; |
| | | }; |
| | | |
| | | const handleReset = (clearFilters) => { |
| | | clearFilters({ |
| | | confirm: true, |
| | | }); |
| | | searchText.value = ''; |
| | | }; |
| | | |
| | | const getColumnSearchProps = (dataIndex) => ({ |
| | | filterDropdown: ({ setSelectedKeys, selectedKeys, confirm, clearFilters }) => ( |
| | | <div style="padding: 8px"> |
| | | <a-input |
| | | v-model:value={selectedKeys[0]} |
| | | placeholder={formatMessage('common.search.placeholder','请搜索')} |
| | | style="width: 188px; margin-bottom: 8px; display: block;" |
| | | onChange={(e) => setSelectedKeys(e.target.value ? [e.target.value] : [])} |
| | | onPressEnter={() => handleSearch(selectedKeys, confirm, dataIndex)} |
| | | /> |
| | | <a-button |
| | | type="primary" |
| | | onClick={() => handleSearch(selectedKeys, confirm, dataIndex)} |
| | | size="small" |
| | | style="width: 90px; margin-right: 8px" |
| | | > |
| | | {formatMessage('common.search','搜索')} |
| | | </a-button> |
| | | <a-button onClick={() => handleReset(clearFilters)} size="small" style="width: 90px"> |
| | | {formatMessage('common.reset','重置')} |
| | | </a-button> |
| | | </div> |
| | | ), |
| | | onFilter: (value, record) => |
| | | record[dataIndex] |
| | | ? record[dataIndex].toString().toLowerCase().includes(value.toLowerCase()) |
| | | : '', |
| | | }); |
| | | |
| | | return { |
| | | searchText, |
| | | searchedColumn, |
| | | getColumnSearchProps, |
| | | }; |
| | | } |
| | | |
| | |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: formatMessage('db.sys_language.name', '名称'), |
| | | dataIndex: 'name', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('name'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_language.language_id', '国际化ID'), |
| | | dataIndex: 'languageId', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('languageId'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_language.locale', '地区'), |
| | | dataIndex: 'locale', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('locale'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_language.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_language.update_time', '修改时间'), |
| | | dataIndex: 'updateTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('updateTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_language.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | |
| | | { |
| | |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | { |
| | | title: formatMessage('db.sys_operation_record.namespace', '名称空间'), |
| | | dataIndex: 'namespace', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.url', '接口地址'), |
| | | dataIndex: 'url', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.appkey', '平台密钥'), |
| | | dataIndex: 'appkey', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.timestamp', '时间戳'), |
| | | dataIndex: 'timestamp', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.client_ip', '客户端IP'), |
| | | dataIndex: 'clientIp', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.request', '请求内容'), |
| | | dataIndex: 'request', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.response', '响应内容'), |
| | | dataIndex: 'response', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.spend_time', '消耗时间'), |
| | | dataIndex: 'spendTime', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.err', '异常内容'), |
| | | dataIndex: 'err', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.result', '结果'), |
| | | dataIndex: 'result$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.user_id', '用户'), |
| | | dataIndex: 'userId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.namespace', '名称空间'), |
| | | dataIndex: 'namespace', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('namespace'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.url', '接口地址'), |
| | | dataIndex: 'url', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('url'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.appkey', '平台密钥'), |
| | | dataIndex: 'appkey', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('appkey'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.timestamp', '时间戳'), |
| | | dataIndex: 'timestamp', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('timestamp'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.client_ip', '客户端IP'), |
| | | dataIndex: 'clientIp', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('clientIp'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.request', '请求内容'), |
| | | dataIndex: 'request', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('request'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.response', '响应内容'), |
| | | dataIndex: 'response', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('response'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.spend_time', '消耗时间'), |
| | | dataIndex: 'spendTime', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('spendTime'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.err', '异常内容'), |
| | | dataIndex: 'err', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('err'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.result', '结果'), |
| | | dataIndex: 'result$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('result$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.user_id', '用户'), |
| | | dataIndex: 'userId$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('userId$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.create_time', '添加时间'), |
| | | dataIndex: 'createTime$', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('createTime$'), |
| | | }, |
| | | { |
| | | title: formatMessage('db.sys_operation_record.memo', '备注'), |
| | | dataIndex: 'memo', |
| | | width: 140, |
| | | ellipsis: true, |
| | | ...getColumnSearchProps('memo'), |
| | | }, |
| | | |
| | | { |
| | | title: formatMessage('common.operation', '操作'), |
| | |
| | | sb.append(" {\n") |
| | | .append(" title: formatMessage('db.").append(table).append(".").append(column.getName()).append("', '").append(column.getComment()).append("'),").append("\n") |
| | | .append(" dataIndex: '"); |
| | | StringBuilder rowKey = new StringBuilder(); |
| | | if ("Date".equals(column.getType()) || !Cools.isEmpty(column.getEnums()) || !Cools.isEmpty(column.getForeignKeyMajor())){ |
| | | // 时间、枚举 格式化 主键修饰 |
| | | sb.append(column.getHumpName()).append("\\$"); |
| | | rowKey.append(column.getHumpName()).append("\\$"); |
| | | } else { |
| | | sb.append(column.getHumpName()); |
| | | rowKey.append(column.getHumpName()); |
| | | } |
| | | sb.append(rowKey); |
| | | sb.append("',\n") |
| | | .append(" width: 140,\n") |
| | | .append(" ellipsis: true,\n"); |
| | | .append(" ellipsis: true,\n") |
| | | .append(" ...getColumnSearchProps('").append(rowKey).append("'),\n"); |
| | | // if (!Cools.isEmpty(column.getEnums())) { |
| | | // sb.append(" customRender: (column) => {\n"); |
| | | // sb.append(" let typeMap = {"); |
| | |
| | | import { logout } from '@/config.js'; |
| | | import EditView from './edit.vue' |
| | | import { formatMessage } from '@/utils/localeUtils.js'; |
| | | import useTableSearch from '@/utils/tableUtils.jsx'; |
| | | const context = getCurrentInstance()?.appContext.config.globalProperties; |
| | | |
| | | const router = useRouter(); |
| | |
| | | let tableData = ref([]); |
| | | getPage(); |
| | | |
| | | const { |
| | | getColumnSearchProps, |
| | | } = useTableSearch(); |
| | | |
| | | const columns = [ |
| | | @{TABLECOLUMNS} |
| | | { |