列表设置

szh-new
lijingjia 7 months ago
parent 408d0b7deb
commit 2fb35404d5

@ -56,6 +56,7 @@
"file-saver": "^2.0.5", "file-saver": "^2.0.5",
"intro.js": "^5.1.0", "intro.js": "^5.1.0",
"lodash-es": "^4.17.21", "lodash-es": "^4.17.21",
"mitt": "^3.0.1",
"mockjs": "^1.1.0", "mockjs": "^1.1.0",
"moment": "^2.30.1", "moment": "^2.30.1",
"nprogress": "^0.2.0", "nprogress": "^0.2.0",

@ -35,6 +35,7 @@
<a-button size="small" type="link" @click="reset"> <a-button size="small" type="link" @click="reset">
{{ t('common.resetText') }} {{ t('common.resetText') }}
</a-button> </a-button>
<!-- 编辑按钮 -->
<a-button size="small" type="link" @click="editTable"> <a-button size="small" type="link" @click="editTable">
{{ t('common.editText') }} {{ t('common.editText') }}
</a-button> </a-button>
@ -128,8 +129,11 @@
import { cloneDeep, omit } from 'lodash-es' import { cloneDeep, omit } from 'lodash-es'
import Sortablejs from 'sortablejs' import Sortablejs from 'sortablejs'
import type Sortable from 'sortablejs' import type Sortable from 'sortablejs'
import { UpdateUserFieldSet, GetUserFieldSet } from './ColumnSettingApi' import { UpdateUserFieldSet, GetUserFieldSet, editColumnSet } from './ColumnSettingApi'
import { usePermissionStore } from '/@/store/modules/permission' import { usePermissionStore } from '/@/store/modules/permission'
//
import { useMessage } from '/@/hooks/web/useMessage'
const { createMessage } = useMessage()
interface State { interface State {
checkAll: boolean checkAll: boolean
isInit?: boolean isInit?: boolean
@ -217,16 +221,18 @@
/** /**
* @description: 根据路由path获取当前表格的id * @description: 根据路由path获取当前表格的id
*/ */
const getPermissionId = () => { const getPermissionInfo = () => {
var pid: string = '' var permissionId: string = ''
usePermissionStore().getWrouteList.forEach((item: any) => { var permissionName: string = ''
item.children[0].children?.forEach((item2) => { usePermissionStore().getWrouteList.forEach((res: any) => {
if (fullPath.value.indexOf(item2.path) != -1) { res.children[0].children?.forEach((row) => {
pid = item2.id if (fullPath.value.indexOf(row.path) != -1) {
permissionId = row.id
permissionName = row.name
} }
}) })
}) })
return pid return { permissionId, permissionName }
} }
async function init() { async function init() {
const Wcolumns = getColumns() const Wcolumns = getColumns()
@ -243,7 +249,6 @@
}) })
}) })
const res: API.DataResult = await GetUserFieldSet(Apidata) const res: API.DataResult = await GetUserFieldSet(Apidata)
console.log(res.data)
let firstTime = false let firstTime = false
if (res.data == null) { if (res.data == null) {
firstTime = true firstTime = true
@ -282,10 +287,7 @@
columns2.push(item) columns2.push(item)
} }
}) })
columns = [...columns, ...columns2] columns = [...columns, ...columns2]
console.log(Wcolumns, columns)
} }
table.setProps({ table.setProps({
rowSelection: JSON.parse(res.data.content).rowSelection ? defaultRowSelection : undefined, rowSelection: JSON.parse(res.data.content).rowSelection ? defaultRowSelection : undefined,
@ -364,8 +366,18 @@
let sortableOrder: string[] = [] let sortableOrder: string[] = []
// //
const editTable = () => { const editTable = () => {
const pid = getPermissionId() const Apidata = {
console.log(pid) id: 0,
templateName: '列表设置',
content: JSON.stringify({
columns: getColumns()
})
}
editColumnSet(Object.assign(Apidata, getPermissionInfo())).then(res => {
if (res.succeeded) {
createMessage.success('成功添加报表到列表设置!')
}
})
} }
// reset columns // reset columns
function reset() { function reset() {

@ -1,9 +1,11 @@
// @ts-ignore
import { request } from '/@/utils/request' import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel' import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api { import { EditConfigModel } from '@logicflow/core'
UpdateUserFieldSet = '/mainApi/Common/UpdateUserFieldSet', const Api = {
GetUserFieldSet = '/mainApi/Common/GetUserFieldSet', UpdateUserFieldSet: '/mainApi/Common/UpdateUserFieldSet',
GetUserFieldSet: '/mainApi/Common/GetUserFieldSet',
EditColumnSet: '/mainApi/columnSet/EditColumnSet'
// EditColumnSet: '/mainApi/ColumnSet/EditColumnSet',
} }
// 更新用户字段设置 (Auth) // 更新用户字段设置 (Auth)
export function UpdateUserFieldSet(data: PageRequest) { export function UpdateUserFieldSet(data: PageRequest) {
@ -21,3 +23,12 @@ export function GetUserFieldSet(query) {
params: query, params: query,
}) })
} }
// 将列表增加到列表设置
export function editColumnSet(data: PageRequest) {
return request<DataResult>({
url: Api.EditColumnSet,
method: 'post',
data,
})
}

@ -1,111 +1,111 @@
import type { App } from 'vue' // import type { App } from 'vue'
import { Icon } from './Icon' // import { Icon } from './Icon'
import { Button } from './Button' // import { Button } from './Button'
import VXETable from 'vxe-table' // import VXETable from 'vxe-table'
import 'vxe-table/lib/style.css' // import 'vxe-table/lib/style.css'
import { // import {
// Need // // Need
Button as AntButton, // Button as AntButton,
Select, // Select,
Alert, // Alert,
Checkbox, // Checkbox,
DatePicker, // DatePicker,
Radio, // Radio,
Switch, // Switch,
Card, // Card,
List, // List,
Tabs, // Tabs,
Descriptions, // Descriptions,
Tree, // Tree,
Table, // Table,
Divider, // Divider,
Modal, // Modal,
Drawer, // Drawer,
TreeSelect, // TreeSelect,
Dropdown, // Dropdown,
Tag, // Tag,
Tooltip, // Tooltip,
Badge, // Badge,
Popover, // Popover,
Upload, // Upload,
Transfer, // Transfer,
Steps, // Steps,
PageHeader, // PageHeader,
Result, // Result,
Empty, // Empty,
Avatar, // Avatar,
Menu, // Menu,
Breadcrumb, // Breadcrumb,
Form, // Form,
Input, // Input,
Row, // Row,
Col, // Col,
Spin, // Spin,
Space, // Space,
Layout, // Layout,
Collapse, // Collapse,
Slider, // Slider,
InputNumber, // InputNumber,
Carousel, // Carousel,
Popconfirm, // Popconfirm,
Skeleton, // Skeleton,
Cascader, // Cascader,
Rate, // Rate,
} from 'ant-design-vue' // } from 'ant-design-vue'
const compList = [AntButton.Group, Icon] // const compList = [AntButton.Group, Icon]
export function registerGlobComp(app: App) { // export function registerGlobComp(app: App) {
// app.use(Input).use(Button).use(Layout) // // app.use(Input).use(Button).use(Layout)
compList.forEach((comp) => { // compList.forEach((comp) => {
app.component(comp.name || comp.displayName, comp) // app.component(comp.name || comp.displayName, comp)
}) // })
app // app
.use(Select) // .use(Select)
.use(Alert) // .use(Alert)
.use(Button) // .use(Button)
.use(Breadcrumb) // .use(Breadcrumb)
.use(Checkbox) // .use(Checkbox)
.use(DatePicker) // .use(DatePicker)
.use(Radio) // .use(Radio)
.use(Switch) // .use(Switch)
.use(Card) // .use(Card)
.use(List) // .use(List)
.use(Descriptions) // .use(Descriptions)
.use(Tree) // .use(Tree)
.use(TreeSelect) // .use(TreeSelect)
.use(Table) // .use(Table)
.use(Divider) // .use(Divider)
.use(Modal) // .use(Modal)
.use(Drawer) // .use(Drawer)
.use(Dropdown) // .use(Dropdown)
.use(Tag) // .use(Tag)
.use(Tooltip) // .use(Tooltip)
.use(Badge) // .use(Badge)
.use(Popover) // .use(Popover)
.use(Upload) // .use(Upload)
.use(Transfer) // .use(Transfer)
.use(Steps) // .use(Steps)
.use(PageHeader) // .use(PageHeader)
.use(Result) // .use(Result)
.use(Empty) // .use(Empty)
.use(Avatar) // .use(Avatar)
.use(Menu) // .use(Menu)
.use(Tabs) // .use(Tabs)
.use(Form) // .use(Form)
.use(Input) // .use(Input)
.use(Row) // .use(Row)
.use(Col) // .use(Col)
.use(Spin) // .use(Spin)
.use(Space) // .use(Space)
.use(Layout) // .use(Layout)
.use(Collapse) // .use(Collapse)
.use(Slider) // .use(Slider)
.use(InputNumber) // .use(InputNumber)
.use(Carousel) // .use(Carousel)
.use(Popconfirm) // .use(Popconfirm)
.use(Skeleton) // .use(Skeleton)
.use(Cascader) // .use(Cascader)
.use(Rate) // .use(Rate)
.use(VXETable) // .use(VXETable)
} // }

@ -1,3 +1,8 @@
<!--
* @Description:
* @Author: lijj
* @Date: 2024-04-15 17:08:08
-->
<template> <template>
<RouterView> <RouterView>
<template #default="{ Component, route }"> <template #default="{ Component, route }">
@ -49,9 +54,9 @@
const openCache = computed(() => unref(getOpenKeepAlive) && unref(getShowMultipleTab)) const openCache = computed(() => unref(getOpenKeepAlive) && unref(getShowMultipleTab))
const getCaches = computed((): string[] => { const getCaches = computed((): string[] => {
if (!unref(getOpenKeepAlive)) { // if (!unref(getOpenKeepAlive)) {
return [] // return []
} // }
return tabStore.getCachedTabList return tabStore.getCachedTabList
}) })

@ -1,3 +1,8 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-15 17:08:08
*/
import 'virtual:windi-base.css' import 'virtual:windi-base.css'
import 'virtual:windi-components.css' import 'virtual:windi-components.css'
import '/@/design/index.less' import '/@/design/index.less'
@ -12,9 +17,11 @@ import { setupRouterGuard } from '/@/router/guard'
import { setupStore } from '/@/store' import { setupStore } from '/@/store'
import { setupGlobDirectives } from '/@/directives' import { setupGlobDirectives } from '/@/directives'
import { setupI18n } from '/@/locales/setupI18n' import { setupI18n } from '/@/locales/setupI18n'
import { registerGlobComp } from '/@/components/registerGlobComp' // import { registerGlobComp } from '/@/components/registerGlobComp'
import { isDevMode } from './utils/env' import { isDevMode } from './utils/env'
// 引入全局css 后面吧element归纳进去
import '/@/styles/index.scss'
import '/@/styles/element/index.scss' import '/@/styles/element/index.scss'
import ElementPlus from 'element-plus' import ElementPlus from 'element-plus'
@ -39,7 +46,7 @@ async function bootstrap() {
// Register global components // Register global components
// 注册全局组件 // 注册全局组件
registerGlobComp(app) // registerGlobComp(app)
// Multilingual configuration // Multilingual configuration
// 多语言配置 // 多语言配置

@ -1,3 +1,8 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-15 17:08:08
*/
import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types' import type { AppRouteRecordRaw, AppRouteModule } from '/@/router/types'
import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic' import { PAGE_NOT_FOUND_ROUTE, REDIRECT_ROUTE } from '/@/router/routes/basic'

@ -204,7 +204,6 @@ export const usePermissionStore = defineStore({
menuList.sort((a, b) => { menuList.sort((a, b) => {
return (a.meta?.orderNo || 0) - (b.meta?.orderNo || 0) return (a.meta?.orderNo || 0) - (b.meta?.orderNo || 0)
}) })
// 设置菜单列表 // 设置菜单列表
this.setFrontMenuList(menuList) this.setFrontMenuList(menuList)

@ -0,0 +1,30 @@
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
color: #262626;
padding: 0;
margin: 0;
}
// UI
h1 {
font-size: 18px;
}
h2 {
font-size: 16px;
}
h3 {
font-size: 14px;
font-weight: bold!important;
height: 40px;
line-height: 40px;
padding-left: 15px;
border-bottom: 0.7px solid #D9D9D9;
}
h4 {
font-size: 12px;
}
h5 {
font-size: 12px;
color: #8C8C8C;
margin-bottom: 8px;
}

@ -1,6 +1,6 @@
// import dark theme // import dark theme
@use "element-plus/theme-chalk/src/dark/css-vars.scss" as *; @use "element-plus/theme-chalk/src/dark/css-vars.scss" as *;
@import './common.scss';
:root { :root {
.el-segmented { .el-segmented {
--el-segmented-radius: var(--el-border-radius-base); --el-segmented-radius: var(--el-border-radius-base);
@ -68,3 +68,4 @@ code {
background-color: var(--el-color-primary-light-9); background-color: var(--el-color-primary-light-9);
color: var(--el-color-primary); color: var(--el-color-primary);
} }

@ -0,0 +1,8 @@
/*
* @Description:
* @Author: lijj
* @Date: 2024-04-18 15:14:02
*/
import mitt from 'mitt'
const emitter = mitt()
export default emitter

@ -7,6 +7,7 @@ import { request } from '/@/utils/request'
import { DataResult, PageRequest } from '/@/api/model/baseModel' import { DataResult, PageRequest } from '/@/api/model/baseModel'
enum Api { enum Api {
list = '/mainApi/ColumnSet/GetColumnSetList', list = '/mainApi/ColumnSet/GetColumnSetList',
edit = '/mainApi/ColumnSet/EditColumnSet',
} }
// 列表数据 // 列表数据
export function getColumnSetList(data: PageRequest) { export function getColumnSetList(data: PageRequest) {
@ -16,3 +17,12 @@ export function getColumnSetList(data: PageRequest) {
data, data,
}) })
} }
// 编辑列表
export function editColumnSet(data: PageRequest) {
return request<DataResult>({
url: Api.edit,
method: 'post',
data,
})
}

@ -53,8 +53,8 @@ export const columns: BasicColumn[] = [
] ]
export const searchFormSchema: FormSchema[] = [ export const searchFormSchema: FormSchema[] = [
{ {
field: 'TemplateName', field: 'permissionName',
label: '模板名称', label: '权限模块名称',
component: 'Input', component: 'Input',
colProps: { span: 6 }, colProps: { span: 6 },
}, },

@ -0,0 +1,98 @@
<!--
* @Description: 基础配置 -> 列表设置 -> 列表设置弹窗内容组件 -> 表格列拖动组件
* @Author: lijj
* @Date: 2024-04-16 10:33:31
-->
<template>
<div class="ds-table-set-content-col-drag">
<!-- 列数据表头集合 -->
<transition-group tag="div" class="container">
<a-button
v-for="item in colData"
:key="item.value"
:type="btnType(item.value)"
draggable="true"
@click="chooseCol(item)"
@dragstart="handleDragStart($event, item)"
@dragover.prevent="handleDragOver($event, item)"
@dragenter="handleDragEnter($event, item)"
@dragend="handleDragEnd($event, item)"
>
{{ item.title }}
</a-button>
</transition-group>
</div>
</template>
<script setup>
import { inject, ref, nextTick, provide } from 'vue'
import emitter from '/@/utils/Bus'
//
const content = JSON.parse(inject('colData').value.content)
const colData = ref(content.columns)
// value
const colName = ref()
//
const btnType = (v) => {
if (v === colName.value) return 'primary'
return 'default'
}
provide('colDataEnd', colData)
//
const chooseCol = (item) => {
if (colName.value && colName.value === item.value) {
colName.value = null
emitter.emit('chooseCol', {})
} else {
colName.value = item.value
emitter.emit('chooseCol', item)
}
}
//
let dragging = {}
//
let ending = {}
//
const handleDragStart = (e, item) => {
dragging = item
}
//
const handleDragOver = (e) => {
e.dataTransfer.dropEffect = 'move'
}
//
const handleDragEnter = (e, item) => {
e.dataTransfer.effectAllowed = 'move'
ending = item
}
//
const handleDragEnd = () => {
if (ending.key === dragging.key) {
return
}
//
let newItems = [...colData.value]
//
const src = newItems.indexOf(dragging)
//
const dst = newItems.indexOf(ending)
newItems.splice(src, 1, ...newItems.splice(dst, 1, newItems[src]))
colData.value = newItems
}
const getColList = () => {
return colData
}
defineExpose({
getColList
})
</script>
<style lang="scss">
.ds-table-set-content-col-drag {
padding: 15px;
.ant-btn {
margin: 0 10px 10px 0;
transition: all linear 0.3s;
}
}
</style>

@ -0,0 +1,176 @@
<!--
* @Description: 基础配置 -> 列表设置 -> 列表设置弹窗内容组件 -> 操作列组件
* @Author: lijj
* @Date: 2024-04-16 10:33:31
-->
<template>
<div class="ds-table-set-content-col-set">
<a-form ref="form" :model="formData" :rules="rules">
<a-form-item label="列头标题(中文)" name="title">
<a-input v-model:value="formData.title" :disabled="formDisable" />
</a-form-item>
<a-form-item label="列头标题(英文)" name="enTitle">
<a-input v-model:value="formData.enTitle" :disabled="formDisable" />
</a-form-item>
<a-form-item label="对其方式">
<a-select
v-model:value="formData.align"
:disabled="formDisable"
placeholder="请选择"
:get-popup-container="
triggerNode => {
return triggerNode.parentNode || document.body
}
"
>
<a-select-option v-for="item in alignOptions" :key="item.value" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="路径">
<a-input
v-model:value="formData.dataIndex"
:disabled="formDisable"
@blur="validate('dataIndex', { trigger: 'blur' }).catch(() => {})"
/>
</a-form-item>
<a-form-item label="列宽">
<a-input
v-model:value="formData.width"
:disabled="formDisable"
@blur="validate('width', { trigger: 'blur' }).catch(() => {})"
/>
</a-form-item>
<a-form-item label="固定列">
<a-select
v-model:value="formData.fixed"
:disabled="formDisable"
placeholder="请选择"
:get-popup-container="
triggerNode => {
return triggerNode.parentNode || document.body
}
"
>
<a-select-option v-for="item in fixedOptions" :key="item.value" :value="item.value">
{{ item.label }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item label="是否显示">
<a-radio-group :disabled="formDisable" v-model:value="formData.visible">
<a-radio :value="true"></a-radio>
<a-radio :value="false"></a-radio>
</a-radio-group>
</a-form-item>
</a-form>
</div>
</template>
<script lang="ts" setup>
import { reactive, ref, onMounted, nextTick } from 'vue'
import emitter from '/@/utils/Bus'
const formDisable = ref(true)
const form = ref()
onMounted(() => {
emitter.on('chooseCol', (item: any) => {
if (item.value) {
formDisable.value = false
} else {
formDisable.value = true
form.value.resetFields()
}
formData.value = item.value || ''
formData.title = item.title || ''
formData.enTitle = item.enTitle || ''
formData.dataIndex = item.dataIndex || ''
formData.width = item.width || ''
formData.fixed = item.fixed || ''
formData.visible = item.visible || ''
})
})
const formData = reactive({
//
title: '',
//
enTitle: '',
//
align: 'left',
//
dataIndex: '',
//
width: '',
//
fixed: '',
//
visible: true,
//
value: ''
})
//
const alignOptions = [
{ label: '靠左', value: 'left' },
{ label: '居中', value: 'center' },
{ label: '靠右', value: 'right' }
]
//
const fixedOptions = [
{ label: '不固定', value: false },
{ label: '左固定', value: 'left' },
{ label: '右固定', value: 'right' }
]
//
const rules = {
title: [
{
required: true,
message: '请输入列头中文标题',
trigger: 'blur'
}
],
enTitle: [
{
required: true,
message: '请输入列头英文标题',
trigger: 'blur'
}
]
}
// 1: 2:3:
const onSubmit = async () => {
if (formDisable.value) {
return { res: 1 }
} else {
const flag = await new Promise((resolve) => {
form.value.validate()
.then(() => {
return resolve({ res: 2, formData })
})
.catch(() => {
return resolve({ res: 3 })
})
})
return flag
}
}
defineExpose({
onSubmit
})
</script>
<style lang="scss">
.ds-table-set-content-col-set {
.ant-form-item {
display: table-caption;
margin: 0 0 10px 15px;
width: 170px;
}
.ant-form-item-label > label {
color: #262626;
height: 27px;
font-size: 12px;
font-weight: 500;
}
}
</style>

@ -0,0 +1,57 @@
<!--
* @Description: 基础配置 -> 列表设置 -> 列表设置弹窗内容组件
* @Author: lijj
* @Date: 2024-04-16 10:33:31
-->
<template>
<div class="table-set-content">
<div class="flex">
<div class="table-box">
<!-- 表格列区域组件 -->
<TableColDrag ref="TableColDragRef" />
</div>
<div class="opt-box">
<h3>列属性设置</h3>
<!-- 表格操作列组件 -->
<TableColSet ref="TableColSetRef" />
</div>
</div>
</div>
</template>
<script lang="ts" setup>
import { ref, defineExpose } from 'vue'
//
import TableColSet from './tableColSet.vue'
//
import TableColDrag from './tableColDrag.vue'
const TableColDragRef = ref()
const TableColSetRef = ref()
const submit = async () => {
const flag = await TableColSetRef.value.onSubmit()
console.log(flag)
return flag
}
const getColList = () => {
return TableColDragRef.value.getColList()
}
defineExpose({
submit,
getColList
})
</script>
<style lang="scss">
.table-set-content {
.flex {
display: flex;
.opt-box {
width: 200px;
border-left: 1px solid #d9d9d9;
}
.table-box {
flex: 1;
}
}
}
</style>

@ -20,16 +20,87 @@
</template> </template>
</template> </template>
</BasicTable> </BasicTable>
<a-modal
v-if="visible"
:visible="visible"
title="报表列设置"
width="60%"
@ok="handleOk"
@cancel="handleCancel"
>
<TableSet ref="TableSetRef" :col-data="colData" />
<!--右下角按钮-->
<template #footer>
<a-button
pre-icon="ant-design:close-outlined"
type="warning"
:loading="loading"
ghost
style="margin-right: 0.8rem"
@click="handleCancel"
>取消</a-button
>
<a-button
type="success"
:loading="loading"
pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem"
@click="handleOk(true)"
>仅保存</a-button
>
<a-button
pre-icon="ant-design:check-circle-outlined"
type="primary"
:loading="loading"
@click="handleOk(false)"
>保存并关闭</a-button
>
</template>
</a-modal>
</div> </div>
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from 'vue' import { ref, provide, unref } from 'vue'
import { BasicTable, useTable, TableAction } from '/@/components/Table' import { BasicTable, useTable, TableAction } from '/@/components/Table'
import { getColumnSetList } from './api' //
import { useModal } from '/@/components/Modal' import TableSet from './components/tableSet.vue'
//
import { getColumnSetList, editColumnSet } from './api'
//
import { columns, searchFormSchema } from './columns' import { columns, searchFormSchema } from './columns'
let filterInfo: Partial<Recordable<string[]>> = [] //
const [registerModal, { openModal }] = useModal() const TableSetRef = ref()
// boolean
const visible = ref<boolean>(false)
// loading
const loading = ref(false)
//
const handleOk = async (flag) => {
let colList = unref(TableSetRef?.value?.getColList())
const submitForm = await TableSetRef?.value?.submit()
if (submitForm.res === 2) {
colList.forEach((row, index) => {
if (row.value == submitForm.formData.value) {
colList[index] = submitForm.formData
}
})
}
colData.value.content = JSON.stringify({ columns: colList })
loading.value = true
editColumnSet(colData.value).then(res => {
if (res.succeeded) {
}
loading.value = false
visible.value = flag
})
}
//
const handleCancel = () => {
visible.value = false
}
const colData = ref({})
provide('colData', colData)
const [registerTable, { getForm, getPaginationRef }] = useTable({ const [registerTable, { getForm, getPaginationRef }] = useTable({
title: '可设置列表', title: '可设置列表',
api: async (p) => { api: async (p) => {
@ -49,18 +120,6 @@
sortConditions: [], sortConditions: [],
}, },
} }
/* 排序字段 */
// if (!!sortInfo.columnKey) {
// postParam.pageCondition.sortConditions.push({
// sortField: sortInfo.field,
// listSortDirection: sortInfo.order === 'ascend' ? 0 : 1,
// })
// } else {
// postParam.pageCondition.sortConditions.push({
// sortField: 'auditTime',
// listSortDirection: 0,
// })
// }
let condition: API.ConditionItem[] = [] let condition: API.ConditionItem[] = []
if (!!data.TemplateName) { if (!!data.TemplateName) {
condition.push({ condition.push({
@ -69,19 +128,6 @@
ConditionalType: 1, ConditionalType: 1,
}) })
} }
// /* */
// if (filterInfo === null) {
// } else {
// // console.log(filterInfo);
// // console.log('' + filterInfo.auditStatus);
// if (!!filterInfo.auditStatus && filterInfo.auditStatus.length > 0) {
// condition.push({
// FieldName: 'AuditStatus',
// FieldValue: filterInfo.auditStatus.join(),
// ConditionalType: 6,
// })
// }
// }
postParam.queryCondition = JSON.stringify(condition) postParam.queryCondition = JSON.stringify(condition)
return postParam return postParam
}, },
@ -91,7 +137,6 @@
schemas: searchFormSchema, schemas: searchFormSchema,
}, },
sortFn: (sorter) => { sortFn: (sorter) => {
// console.log(':' + sorter);
sortInfo = sorter sortInfo = sorter
}, },
filterFn: (filters) => { filterFn: (filters) => {
@ -110,16 +155,9 @@
fixed: 'right', fixed: 'right',
}, },
}) })
function handleCreate() {
openModal(true, {
isParent: false,
isUpdate: false,
})
}
function handleAudit(record: Recordable) { function handleAudit(record: Recordable) {
openModal(true, { console.log(record)
record, visible.value = true
isUpdate: true, colData.value = record
})
} }
</script> </script>

@ -17,16 +17,18 @@
ghost ghost
style="margin-right: 0.8rem" style="margin-right: 0.8rem"
@click="closeModal" @click="closeModal"
>取消</a-button
> >
取消
</a-button>
<a-button <a-button
type="success" type="success"
:loading="loading" :loading="loading"
pre-icon="ant-design:check-outlined" pre-icon="ant-design:check-outlined"
style="margin-right: 0.8rem" style="margin-right: 0.8rem"
@click="handleSave(false)" @click="handleSave(false)"
>仅保存</a-button
> >
仅保存
</a-button>
<a-button <a-button
pre-icon="ant-design:check-circle-outlined" pre-icon="ant-design:check-circle-outlined"
type="primary" type="primary"

@ -72,6 +72,7 @@
rowId.value = data.record.id rowId.value = data.record.id
const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) }) const res: API.DataResult = await getCodeGoodsTypeInfo({ id: unref(rowId) })
if (res.succeeded) { if (res.succeeded) {
console.log(res, 2222)
setFieldsValue({ setFieldsValue({
...res.data, ...res.data,
}) })
@ -188,6 +189,7 @@
async function handleSave(exit) { async function handleSave(exit) {
try { try {
const values = await validate() const values = await validate()
console.log(values,111)
setModalProps({ confirmLoading: true, loading: true }) setModalProps({ confirmLoading: true, loading: true })
// TODO custom api // TODO custom api
console.log(values) console.log(values)

@ -28,9 +28,9 @@ export default ({ command, mode }: ConfigEnv): UserConfig => {
const viteEnv = wrapperEnv(env) const viteEnv = wrapperEnv(env)
const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY, VITE_DROP_CONSOLE } = viteEnv const { VITE_PORT, VITE_PUBLIC_PATH, VITE_PROXY, VITE_DROP_CONSOLE } = viteEnv
console.log(process.env.NODE_ENV)
const isBuild = command === 'build' const isBuild = command === 'build'
hmr: false
return { return {
base: VITE_PUBLIC_PATH, base: VITE_PUBLIC_PATH,
root, root,

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save