提交 a00d3af1 编写于 作者: jlj05024111@163.com's avatar jlj05024111@163.com

feat: 更新多项数据选择视图样式

上级 66e33e48
......@@ -78,6 +78,7 @@ export const MPickupView = defineComponent({
modelData: pickupViewPanel,
context: this.c.context,
params: this.c.params,
singleSelect: false,
},
on: {
neuronInit: this.c.nerve.onNeuronInit(pickupViewPanel.name),
......@@ -140,8 +141,13 @@ export const MPickupView = defineComponent({
this.ns.is('selected', this.isSelected(item)),
]}
on-click={() => this.handleSelectionClick(item)}
>
<div
class={this.ns.bem('right', 'list-item', 'text')}
title={item.srfmajortext}
>
{item.srfmajortext}
</div>
<i-icon
type='ios-close'
size={24}
......
......@@ -9,6 +9,7 @@ export const PickupTreeView = defineComponent({
modelPath: { type: String, required: true },
modal: { type: Object as PropType<IModal> },
noLoadDefault: { type: Boolean, required: false },
singleSelect: { type: Boolean, default: true },
},
setup(props) {
const { proxy } = getCurrentInstance()!;
......@@ -27,6 +28,7 @@ export const PickupTreeView = defineComponent({
modelData: tree,
context: this.c.context,
params: this.c.params,
singleSelect: this.singleSelect,
},
on: {
neuronInit: this.c.nerve.onNeuronInit(tree.name),
......
......@@ -26,6 +26,7 @@ export const PickupView = defineComponent({
modelData: pickupViewPanel,
context: this.c.context,
params: this.c.params,
singleSelect: true,
},
on: {
neuronInit: this.c.nerve.onNeuronInit(pickupViewPanel.name),
......
......@@ -12,6 +12,7 @@ export const PickupViewPanel = defineComponent({
context: { type: Object as PropType<IContext>, required: true },
params: { type: Object as PropType<IParams>, default: () => ({}) },
noLoadDefault: { type: Boolean, default: false },
singleSelect: { type: Boolean, default: undefined },
},
setup(props) {
const { proxy } = getCurrentInstance()!;
......@@ -41,6 +42,7 @@ export const PickupViewPanel = defineComponent({
modal: this.modal,
modelPath: this.viewPath,
noLoadDefault: this.noLoadDefault,
singleSelect: this.singleSelect,
},
on: {
neuronInit: this.c.nerve.onNeuronInit('embedView'),
......
......@@ -6,6 +6,8 @@ import {
defineComponent,
getCurrentInstance,
h,
nextTick,
onMounted,
PropType,
ref,
} from 'vue';
......@@ -23,6 +25,10 @@ export const TreeControl = defineComponent({
params: { type: Object as PropType<IParams>, default: () => ({}) },
defaultSelectKeys: { type: Array<string>, required: false },
isSelectFirstDefault: { type: Boolean, required: false },
singleSelect: {
type: Boolean,
default: true,
},
},
setup(props) {
const ns = useNamespace('control-treeview');
......@@ -114,6 +120,20 @@ export const TreeControl = defineComponent({
);
};
const onCheck = () => {
if (treeRef.value) {
const selected = treeRef.value.getCheckedNodes();
c.setSelectData(selected);
}
};
onMounted(() => {
c.nerve.self.evt.on('selectionChange', async selects => {
await nextTick();
treeRef.value!.setCheckedKeys(selects.map(item => item.id));
});
});
return {
c,
ns,
......@@ -124,6 +144,7 @@ export const TreeControl = defineComponent({
loadData,
defaultProps,
renderContent,
onCheck,
};
},
render() {
......@@ -145,11 +166,13 @@ export const TreeControl = defineComponent({
'current-node-key': this.currentKey,
lazy: true,
load: this.loadData,
'show-checkbox': !this.singleSelect,
'expand-on-click-node': false,
'render-content': this.renderContent,
},
on: {
'current-change': this.onCurrentChange,
check: this.onCheck,
},
})}
</control-layout>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册