fix: bug#10080
This commit is contained in:
parent
4aa06e4ad1
commit
dbe58704d8
|
@ -1,14 +1,6 @@
|
||||||
<template>
|
<template>
|
||||||
<j-modal
|
<j-modal class="add-device-or-product-dialog-container" title="绑定" width="1440px" :maskClosable="false" @ok="confirm"
|
||||||
class="add-device-or-product-dialog-container"
|
:confirmLoading="loading" @cancel="cancel" visible>
|
||||||
title="绑定"
|
|
||||||
width="1440px"
|
|
||||||
:maskClosable="false"
|
|
||||||
@ok="confirm"
|
|
||||||
:confirmLoading="loading"
|
|
||||||
@cancel="cancel"
|
|
||||||
visible
|
|
||||||
>
|
|
||||||
<h5 class="row">
|
<h5 class="row">
|
||||||
<AIcon type="ExclamationCircleOutlined" style="margin-right: 6px" />
|
<AIcon type="ExclamationCircleOutlined" style="margin-right: 6px" />
|
||||||
只能分配有“共享”权限的资产数据
|
只能分配有“共享”权限的资产数据
|
||||||
|
@ -16,74 +8,40 @@
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<span style="margin-right: 8px">批量配置</span>
|
<span style="margin-right: 8px">批量配置</span>
|
||||||
<j-switch
|
<j-switch v-model:checked="bulkBool" checked-children="开" un-checked-children="关" style="width: 56px" />
|
||||||
v-model:checked="bulkBool"
|
|
||||||
checked-children="开"
|
|
||||||
un-checked-children="关"
|
|
||||||
style="width: 56px"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-show="bulkBool">
|
<div v-show="bulkBool">
|
||||||
<j-checkbox-group v-model:value="bulkList" :options="options" />
|
<j-checkbox-group v-model:value="bulkList" :options="options" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<pro-search
|
<pro-search type="simple" :columns="searchColumns" target="category-bind-modal" @search="search" />
|
||||||
type="simple"
|
<j-pro-table ref="tableRef" :request="table.requestFun" :gridColumn="2" :params="queryParams" :rowSelection="{
|
||||||
:columns="searchColumns"
|
selectedRowKeys: table._selectedRowKeys.value,
|
||||||
target="category-bind-modal"
|
onSelect: selectChange
|
||||||
@search="search"
|
}" @cancelSelect="table.cancelSelect" :columns="columns">
|
||||||
/>
|
|
||||||
<j-pro-table
|
|
||||||
ref="tableRef"
|
|
||||||
:request="table.requestFun"
|
|
||||||
:gridColumn="2"
|
|
||||||
:params="queryParams"
|
|
||||||
:rowSelection="{
|
|
||||||
selectedRowKeys: table._selectedRowKeys.value,
|
|
||||||
onChange: selectChange,
|
|
||||||
}"
|
|
||||||
@cancelSelect="table.cancelSelect"
|
|
||||||
:columns="columns"
|
|
||||||
>
|
|
||||||
<template #card="slotProps">
|
<template #card="slotProps">
|
||||||
<CardBox
|
<CardBox :value="slotProps" :actions="[{ key: 1 }]" v-bind="slotProps" :active="table._selectedRowKeys.value.includes(slotProps.id)
|
||||||
:value="slotProps"
|
" @click="table.onSelectChange" :status="slotProps.state?.value"
|
||||||
:actions="[{ key: 1 }]"
|
:statusText="slotProps.state?.text" :statusNames="{
|
||||||
v-bind="slotProps"
|
|
||||||
:active="
|
|
||||||
table._selectedRowKeys.value.includes(slotProps.id)
|
|
||||||
"
|
|
||||||
@click="table.onSelectChange"
|
|
||||||
:status="slotProps.state?.value"
|
|
||||||
:statusText="slotProps.state?.text"
|
|
||||||
:statusNames="{
|
|
||||||
online: 'processing',
|
online: 'processing',
|
||||||
offline: 'error',
|
offline: 'error',
|
||||||
notActive: 'warning',
|
notActive: 'warning',
|
||||||
}"
|
}">
|
||||||
>
|
|
||||||
<template #img>
|
<template #img>
|
||||||
<slot name="img">
|
<slot name="img">
|
||||||
<img
|
<img :src="getImage('/device-product.png')" style="cursor: pointer" />
|
||||||
:src="getImage('/device-product.png')"
|
|
||||||
style="cursor: pointer"
|
|
||||||
/>
|
|
||||||
</slot>
|
</slot>
|
||||||
</template>
|
</template>
|
||||||
<template #content>
|
<template #content>
|
||||||
<h3 class="card-item-content-title" style='margin-bottom: 18px;'>
|
<h3 class="card-item-content-title" style='margin-bottom: 18px;'>
|
||||||
<Ellipsis style="width: calc(100% - 100px);"
|
<Ellipsis style="width: calc(100% - 100px);">
|
||||||
>
|
{{ slotProps.name }}
|
||||||
{{ slotProps.name }}
|
</Ellipsis>
|
||||||
</Ellipsis>
|
|
||||||
</h3>
|
</h3>
|
||||||
<j-row>
|
<j-row>
|
||||||
<j-col :span="12">
|
<j-col :span="12">
|
||||||
<div class="card-item-content-text">ID</div>
|
<div class="card-item-content-text">ID</div>
|
||||||
<div
|
<div style="cursor: pointer" class="card-item-content-value">
|
||||||
style="cursor: pointer"
|
|
||||||
class="card-item-content-value"
|
|
||||||
>
|
|
||||||
{{ slotProps.id }}
|
{{ slotProps.id }}
|
||||||
</div>
|
</div>
|
||||||
</j-col>
|
</j-col>
|
||||||
|
@ -91,17 +49,10 @@
|
||||||
<div class="card-item-content-text">
|
<div class="card-item-content-text">
|
||||||
资产权限
|
资产权限
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div style="cursor: pointer" class="card-item-content-value"
|
||||||
style="cursor: pointer"
|
@click="(e) => e.stopPropagation()">
|
||||||
class="card-item-content-value"
|
<j-checkbox-group v-model:value="slotProps.selectPermissions
|
||||||
@click="(e) => e.stopPropagation()"
|
" :options="slotProps.permissionList" />
|
||||||
>
|
|
||||||
<j-checkbox-group
|
|
||||||
v-model:value="
|
|
||||||
slotProps.selectPermissions
|
|
||||||
"
|
|
||||||
:options="slotProps.permissionList"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</j-col>
|
</j-col>
|
||||||
</j-row>
|
</j-row>
|
||||||
|
@ -110,27 +61,16 @@
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #permission="slotProps">
|
<template #permission="slotProps">
|
||||||
<div
|
<div style="cursor: pointer" class="card-item-content-value" @click="(e) => e.stopPropagation()">
|
||||||
style="cursor: pointer"
|
<j-checkbox-group v-model:value="slotProps.selectPermissions" :options="slotProps.permissionList" />
|
||||||
class="card-item-content-value"
|
|
||||||
@click="(e) => e.stopPropagation()"
|
|
||||||
>
|
|
||||||
<j-checkbox-group
|
|
||||||
v-model:value="slotProps.selectPermissions"
|
|
||||||
:options="slotProps.permissionList"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<template #state="slotProps">
|
<template #state="slotProps">
|
||||||
<BadgeStatus
|
<BadgeStatus :status="slotProps.state.value" :text="slotProps.state.text" :statusNames="{
|
||||||
:status="slotProps.state.value"
|
online: 'processing',
|
||||||
:text="slotProps.state.text"
|
offline: 'error',
|
||||||
:statusNames="{
|
notActive: 'warning',
|
||||||
online: 'processing',
|
}"></BadgeStatus>
|
||||||
offline: 'error',
|
|
||||||
notActive: 'warning',
|
|
||||||
}"
|
|
||||||
></BadgeStatus>
|
|
||||||
</template>
|
</template>
|
||||||
<template #registryTime="slotProps">
|
<template #registryTime="slotProps">
|
||||||
<span>{{
|
<span>{{
|
||||||
|
@ -216,23 +156,23 @@ const columns = props.queryColumns.filter(
|
||||||
);
|
);
|
||||||
|
|
||||||
const searchColumns = computed(() => {
|
const searchColumns = computed(() => {
|
||||||
return props.queryColumns.map(item => {
|
return props.queryColumns.map(item => {
|
||||||
if (departmentStore.productId) {
|
if (departmentStore.productId) {
|
||||||
if (item.dataIndex === 'productName') {
|
if (item.dataIndex === 'productName') {
|
||||||
item.search.first = true
|
item.search.first = true
|
||||||
item.search.componentProps = {
|
item.search.componentProps = {
|
||||||
mode: 'multiple',
|
mode: 'multiple',
|
||||||
"max-tag-count": "responsive"
|
"max-tag-count": "responsive"
|
||||||
}
|
}
|
||||||
item.search.defaultTermType = 'eq'
|
item.search.defaultTermType = 'eq'
|
||||||
item.search.defaultOnceValue = departmentStore.productId
|
item.search.defaultOnceValue = departmentStore.productId
|
||||||
|
|
||||||
} else if (item.search && 'first' in item.search) {
|
} else if (item.search && 'first' in item.search) {
|
||||||
delete item.search.first
|
delete item.search.first
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return item
|
return item
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
const queryParams = ref({});
|
const queryParams = ref({});
|
||||||
|
@ -371,14 +311,14 @@ const table: any = {
|
||||||
item.state === 1
|
item.state === 1
|
||||||
? 'online'
|
? 'online'
|
||||||
: item.state === 0
|
: item.state === 0
|
||||||
? 'offline'
|
? 'offline'
|
||||||
: '',
|
: '',
|
||||||
text:
|
text:
|
||||||
item.state === 1
|
item.state === 1
|
||||||
? '正常'
|
? '正常'
|
||||||
: item.state === 0
|
: item.state === 0
|
||||||
? '禁用'
|
? '禁用'
|
||||||
: '',
|
: '',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -403,18 +343,18 @@ const table: any = {
|
||||||
queryCount.value += 1;
|
queryCount.value += 1;
|
||||||
if (props.parentId) {
|
if (props.parentId) {
|
||||||
let terms = [{
|
let terms = [{
|
||||||
column: 'id',
|
column: 'id',
|
||||||
termType: 'dim-assets$not',
|
termType: 'dim-assets$not',
|
||||||
value: {
|
value: {
|
||||||
assetType: props.assetType,
|
assetType: props.assetType,
|
||||||
targets: [
|
targets: [
|
||||||
{
|
{
|
||||||
type: 'org',
|
type: 'org',
|
||||||
id: props.parentId,
|
id: props.parentId,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
type: 'and'
|
type: 'and'
|
||||||
}]
|
}]
|
||||||
|
|
||||||
// if (
|
// if (
|
||||||
|
@ -427,7 +367,7 @@ const table: any = {
|
||||||
// terms[0].terms.pop();
|
// terms[0].terms.pop();
|
||||||
// }
|
// }
|
||||||
if (oParams.terms && oParams.terms.length > 0) {
|
if (oParams.terms && oParams.terms.length > 0) {
|
||||||
terms = [ ...oParams.terms, ...terms]
|
terms = [...oParams.terms, ...terms]
|
||||||
}
|
}
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
|
@ -469,18 +409,22 @@ table.init();
|
||||||
// table._selectedRowKeys.value = okRows.map((item) => item.id);
|
// table._selectedRowKeys.value = okRows.map((item) => item.id);
|
||||||
// };
|
// };
|
||||||
// fix: bug#10749
|
// fix: bug#10749
|
||||||
const selectChange = (keys: string[], rows: any[]) => {
|
const selectChange = (record: any,selected: boolean,selectedRows: any,) => {
|
||||||
table.selectedRows = rows;
|
if(selected){
|
||||||
table._selectedRowKeys.value = keys;
|
table._selectedRowKeys.value.push(record?.id)
|
||||||
|
}else{
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log(record,selected,selectedRows);
|
||||||
};
|
};
|
||||||
|
|
||||||
const cancel = () => {
|
const cancel = () => {
|
||||||
departmentStore.setProductId()
|
departmentStore.setProductId()
|
||||||
emits('update:visible', false)
|
emits('update:visible', false)
|
||||||
}
|
}
|
||||||
|
|
||||||
const search = (query: any) => {
|
const search = (query: any) => {
|
||||||
queryParams.value = query
|
queryParams.value = query
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
@ -490,11 +434,13 @@ const search = (query: any) => {
|
||||||
height: calc(100vh - 400px);
|
height: calc(100vh - 400px);
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
h5 {
|
h5 {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
background-color: #f6f6f6;
|
background-color: #f6f6f6;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.row {
|
.row {
|
||||||
margin-bottom: 12px;
|
margin-bottom: 12px;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue