fix: bug#15420、16072、16195、16208、16218、16220、16222

This commit is contained in:
leiqiaochu 2023-07-11 16:52:07 +08:00
parent 80651c4df8
commit 5f680d23b9
6 changed files with 38 additions and 14 deletions

View File

@ -130,7 +130,7 @@
<j-select <j-select
placeholder="请选择" placeholder="请选择"
v-if="item.type.type === 'enum'" v-if="item.type.type === 'enum'"
v-model:value="formData.data[item.name]" v-model:value="formData.data[item.property]"
> >
<j-select-option <j-select-option
v-for="el in item?.type?.type === 'enum' && v-for="el in item?.type?.type === 'enum' &&
@ -346,6 +346,10 @@ const form = reactive<Record<string, any>>({
const formData = reactive<Record<string, any>>({ const formData = reactive<Record<string, any>>({
data: productStore.current?.configuration || {}, data: productStore.current?.configuration || {},
}); });
const fun = () =>{
console.log(formData.data,productStore.current?.configuration)
}
fun()
// //
const productTypes = ref([]) const productTypes = ref([])
const productData = reactive({ const productData = reactive({
@ -662,10 +666,10 @@ const getData = async (accessId?: string) => {
item.name === '流传输模式' && item.name === '流传输模式' &&
(!productStore.current?.configuration || (!productStore.current?.configuration ||
!productStore.current?.configuration.hasOwnProperty( !productStore.current?.configuration.hasOwnProperty(
item.name, item.property,
)) ))
) { ) {
formData.data[item.name] = formData.data[item.property] =
item.type.expands?.defaultValue; item.type.expands?.defaultValue;
} }
}); });

View File

@ -307,6 +307,7 @@ const handleSubmit = () => {
if (res.success) { if (res.success) {
onlyMessage('操作成功'); onlyMessage('操作成功');
_vis.value = false; _vis.value = false;
loading.value = false;
emit('submit'); emit('submit');
} else { } else {
loading.value = false; loading.value = false;

View File

@ -396,9 +396,11 @@ const handleSubmit = () => {
: { id, streamMode, manufacturer, model, firmware, ...extraParams }; : { id, streamMode, manufacturer, model, firmware, ...extraParams };
} else { } else {
// //
params = !id const getParmas = () =>{
? { others, id, ...extraParams } if(others?.stream_mode){
: { others.stream_mode = streamMode
}
return{
others, others,
id, id,
streamMode, streamMode,
@ -407,6 +409,10 @@ const handleSubmit = () => {
firmware, firmware,
...extraParams, ...extraParams,
}; };
}
params = !id
? { others, id, ...extraParams }
: getParmas()
} }
formRef.value formRef.value

View File

@ -54,7 +54,9 @@
<div class="card-item-content-text"> <div class="card-item-content-text">
厂商 厂商
</div> </div>
<div>{{ slotProps.manufacturer }}</div> <Ellipsis style="width: calc(100% - 20px);">
<div>{{ slotProps.manufacturer }}</div>
</Ellipsis>
</j-col> </j-col>
<j-col :span="12"> <j-col :span="12">
<div class="card-item-content-text"> <div class="card-item-content-text">
@ -66,7 +68,7 @@
<div class="card-item-content-text"> <div class="card-item-content-text">
型号 型号
</div> </div>
<Ellipsis>{{ slotProps.model }}</Ellipsis> <Ellipsis style="width: calc(100% - 20px);">{{ slotProps.model }}</Ellipsis>
</j-col> </j-col>
<j-col :span="12"> <j-col :span="12">
<div class="card-item-content-text"> <div class="card-item-content-text">
@ -186,6 +188,7 @@ const columns = [
search: { search: {
type: 'string', type: 'string',
}, },
ellipsis: true,
}, },
{ {
title: '名称', title: '名称',
@ -195,12 +198,14 @@ const columns = [
type: 'string', type: 'string',
first: true, first: true,
}, },
ellipsis: true,
}, },
{ {
title: '接入方式', title: '接入方式',
dataIndex: 'provider', dataIndex: 'provider',
key: 'provider', key: 'provider',
scopedSlots: true, scopedSlots: true,
width:120,
search: { search: {
type: 'select', type: 'select',
options: PROVIDER_OPTIONS, options: PROVIDER_OPTIONS,
@ -223,12 +228,14 @@ const columns = [
search: { search: {
type: 'string', type: 'string',
}, },
ellipsis: true,
}, },
{ {
title: '产品名称', title: '产品名称',
dataIndex: 'productId', dataIndex: 'productId',
key: 'productId', key: 'productId',
scopedSlots: true, scopedSlots: true,
ellipsis: true,
search: { search: {
type: 'select', type: 'select',
options: () => options: () =>

View File

@ -27,8 +27,8 @@
:params="queryParams" :params="queryParams"
:rowSelection="{ :rowSelection="{
selectedRowKeys: table._selectedRowKeys.value, selectedRowKeys: table._selectedRowKeys.value,
onSelect: selectChange, onSelect: table.onSelectChange,
onSelectNone: ()=> table._selectedRowKeys.value = [], onSelectNone: table.cancelSelect,
onSelectAll: selectAll onSelectAll: selectAll
}" }"
:columns="columns" :columns="columns"
@ -266,6 +266,7 @@ const table: any = {
selectedRowKeys.splice(index, 1); selectedRowKeys.splice(index, 1);
table.selectedRows.splice(index, 1); table.selectedRows.splice(index, 1);
} }
table._selectedRowKeys.value = selectedRowKeys
}, },
// //
cancelSelect: () => { cancelSelect: () => {
@ -438,17 +439,21 @@ const selectAll = (selected: Boolean, selectedRows: any,changeRows:any) => {
changeRows.map((i: any) => { changeRows.map((i: any) => {
if (!table._selectedRowKeys.value.includes(i.id)) { if (!table._selectedRowKeys.value.includes(i.id)) {
table._selectedRowKeys.value.push(i.id) table._selectedRowKeys.value.push(i.id)
table.selectedRows.push(i)
} }
}) })
} else { } else {
const arr = changeRows.map((item: any) => item.id) const arr = changeRows.map((item: any) => item.id)
const _ids: string[] = []; const _ids: string[] = [];
table._selectedRowKeys.value.map((i: any) => { const _row: any[] = [];
if (!arr.includes(i)) { table.selectedRows.map((i: any) => {
_ids.push(i) if (!arr.includes(i.id)) {
_ids.push(i.id)
_row.push(i)
} }
}) })
table._selectedRowKeys.value = _ids table._selectedRowKeys.value = _ids;
table.selectedRows = _row;
} }
} }
const cancel = () => { const cancel = () => {

View File

@ -175,6 +175,7 @@ const form = reactive({
submit: () => { submit: () => {
const api = form.data.id ? updateDepartment_api : addDepartment_api; const api = form.data.id ? updateDepartment_api : addDepartment_api;
form.data.parentId = form.data.parentId ? form.data.parentId : '';
return api(form.data); return api(form.data);
}, },
}); });