|
@@ -1,5 +1,5 @@
|
|
|
<template>
|
|
|
- <Codes v-model="isShowCodesEditForm" :role="editRole" />
|
|
|
+ <Codes v-if="isShowCodesEditForm" v-model="isShowCodesEditForm" :role="editRole" />
|
|
|
<Edit v-model="isShowRoleEditForm" :role="editRole" :type="editType" />
|
|
|
<div>
|
|
|
<el-card class="box-card" v-loading="wholeLoading" element-loading-text="Loading..." style="height: 600px">
|
|
@@ -72,7 +72,7 @@ const columns: Column<any>[] = [
|
|
|
dataKey: 'codes_cn',
|
|
|
width: 400,
|
|
|
cellRenderer: ({ cellData: codes_cn }) =>
|
|
|
- <div style="overflow-y: auto; display: flex">
|
|
|
+ <div style="overflow-y: auto; display: flex" onWheel={handleWheel}>
|
|
|
{codes_cn?.map(cn => <ElTag style="margin-right: 5px">{cn}</ElTag>)}
|
|
|
</div>
|
|
|
},
|
|
@@ -98,15 +98,15 @@ const columns: Column<any>[] = [
|
|
|
width: 400,
|
|
|
fixed: TableV2FixedDir.RIGHT,
|
|
|
flexGrow: 1,
|
|
|
- cellRenderer: ({ rowData: row }) =>
|
|
|
+ cellRenderer: (props) =>
|
|
|
<div>
|
|
|
- <ElButton type={row.valid ? 'danger' : 'success'} onClick={() => updateValid(row)}>
|
|
|
- {row.valid ? '禁用' : '启用'}
|
|
|
+ <ElButton type={props.rowData.valid ? 'danger' : 'success'} onClick={() => updateValid(props.rowData)}>
|
|
|
+ {props.rowData.valid ? '禁用' : '启用'}
|
|
|
</ElButton>
|
|
|
- <ElButton type="primary" onClick={() => showPermissionDialog(row)}>
|
|
|
+ <ElButton type="primary" onClick={() => showPermissionDialog(props.rowData)}>
|
|
|
权限
|
|
|
</ElButton>
|
|
|
- <ElButton type="primary" onClick={() => showEditDialog('update', row)}>
|
|
|
+ <ElButton type="primary" onClick={() => showEditDialog('update', props.rowData)}>
|
|
|
编辑
|
|
|
</ElButton>
|
|
|
</div>
|
|
@@ -130,7 +130,20 @@ const updateValid = throttle((row: any) => {
|
|
|
update(row)
|
|
|
})
|
|
|
|
|
|
-
|
|
|
+/**
|
|
|
+ * 把tag中的鼠标事件改为横向滚动
|
|
|
+ * @param event
|
|
|
+ */
|
|
|
+const handleWheel = (event) => {
|
|
|
+ // 判断滚轮事件是否是横向滚动
|
|
|
+ if (!event.shiftKey) {
|
|
|
+ // 取消默认的纵向滚动
|
|
|
+ event.preventDefault()
|
|
|
+ // 根据滚动方向进行横向滚动
|
|
|
+ const container = event.currentTarget
|
|
|
+ container.scrollLeft += event.deltaY
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
/**
|
|
|
* 刷新
|