diff --git a/package.json b/package.json index 13e14e7a..c4dd493a 100644 --- a/package.json +++ b/package.json @@ -99,8 +99,8 @@ "@types/qs": "^6.9.7", "@types/showdown": "^1.9.4", "@types/sortablejs": "^1.10.7", - "@typescript-eslint/eslint-plugin": "^5.20.0", - "@typescript-eslint/parser": "^5.20.0", + "@typescript-eslint/eslint-plugin": "^7.6.0", + "@typescript-eslint/parser": "^7.6.0", "@vitejs/plugin-legacy": "^1.8.1", "@vitejs/plugin-vue": "^2.3.1", "@vitejs/plugin-vue-jsx": "^1.3.10", diff --git a/src/components/Table/src/components/settings/ColumnSetting.vue b/src/components/Table/src/components/settings/ColumnSetting.vue index 9ab060d3..eb7e411c 100644 --- a/src/components/Table/src/components/settings/ColumnSetting.vue +++ b/src/components/Table/src/components/settings/ColumnSetting.vue @@ -35,6 +35,9 @@ {{ t('common.resetText') }} + + {{ t('common.editText') }} + @@ -211,6 +214,20 @@ return ret } + /** + * @description: 根据路由path获取当前表格的id + */ + const getPermissionId = () => { + var pid: string = '' + usePermissionStore().getWrouteList.forEach((item: any) => { + item.children[0].children?.forEach((item2) => { + if (fullPath.value.indexOf(item2.path) != -1) { + pid = item2.id + } + }) + }) + return pid + } async function init() { const Wcolumns = getColumns() let columns = [] @@ -218,7 +235,7 @@ let Apidata = { permissionId: '', } - usePermissionStore().getWrouteList.forEach((item) => { + usePermissionStore().getWrouteList.forEach((item: any) => { item.children[0].children?.forEach((item2) => { if (fullPath.value.indexOf(item2.path) != -1) { Apidata.permissionId = item2.id @@ -345,6 +362,11 @@ let sortable: Sortable let sortableOrder: string[] = [] + // 将列表添加到列表设置菜单页面中 + const editTable = () => { + const pid = getPermissionId() + console.log(pid) + } // reset columns function reset() { state.checkedList = [...state.defaultCheckList] @@ -354,7 +376,11 @@ setColumns(table.getCacheColumns()) sortable.sort(sortableOrder) } - + /** + * @description: 将表格添加至列表设置 + * @param: { id: 表格id } + */ + // Open the pop-up window for drag and drop initialization function handleVisibleChange() { if (inited) return @@ -474,6 +500,7 @@ showIndexColumn: table.getBindValues.value.showIndexColumn, }), } + console.log(usePermissionStore().getWrouteList) usePermissionStore().getWrouteList.forEach((item) => { item.children[0].children?.forEach((item2) => { if (fullPath.value.indexOf(item2.path) != -1) { @@ -481,7 +508,6 @@ } }) }) - const res: API.DataResult = await UpdateUserFieldSet(Apidata) if (res.succeeded) { emit('columns-change', data) @@ -505,6 +531,7 @@ onChange, plainOptions, reset, + editTable, prefixCls, columnListRef, handleVisibleChange, diff --git a/src/locales/lang/en/common.ts b/src/locales/lang/en/common.ts index b919e03c..79b5db51 100644 --- a/src/locales/lang/en/common.ts +++ b/src/locales/lang/en/common.ts @@ -6,6 +6,7 @@ export default { saveText: 'Save', delText: 'Delete', resetText: 'Reset', + editText: 'Edit', searchText: 'Search', queryText: 'Search', diff --git a/src/locales/lang/zh-CN/common.ts b/src/locales/lang/zh-CN/common.ts index 9d34bce6..fd2ced50 100644 --- a/src/locales/lang/zh-CN/common.ts +++ b/src/locales/lang/zh-CN/common.ts @@ -6,6 +6,7 @@ export default { saveText: '保存', delText: '删除', resetText: '重置', + editText: '编辑', searchText: '搜索', queryText: '查询', diff --git a/src/views/baseinfo/columnset/api.ts b/src/views/baseinfo/columnset/api.ts new file mode 100644 index 00000000..c551307f --- /dev/null +++ b/src/views/baseinfo/columnset/api.ts @@ -0,0 +1,18 @@ +/* + * @Description: 基础配置 -> 列表设置接口 + * @Author: lijj + * @Date: 2024-04-16 14:44:08 + */ +import { request } from '/@/utils/request' +import { DataResult, PageRequest } from '/@/api/model/baseModel' +enum Api { + list = '/mainApi/ColumnSet/GetColumnSetList', +} +// 列表数据 +export function getColumnSetList(data: PageRequest) { + return request({ + url: Api.list, + method: 'post', + data, + }) +} diff --git a/src/views/baseinfo/columnset/index.vue b/src/views/baseinfo/columnset/index.vue new file mode 100644 index 00000000..4b47e3a5 --- /dev/null +++ b/src/views/baseinfo/columnset/index.vue @@ -0,0 +1,50 @@ + + + + diff --git a/src/views/baseinfo/formset/index.vue b/src/views/baseinfo/formset/index.vue index 3cb4a91e..c14406a6 100644 --- a/src/views/baseinfo/formset/index.vue +++ b/src/views/baseinfo/formset/index.vue @@ -1,3 +1,8 @@ +