徐景良 2024-07-12 14:45:05 +08:00
commit 9ebd2dd616
5 changed files with 37 additions and 6 deletions

View File

@ -84,6 +84,21 @@
showActionButtonGroup: false, showActionButtonGroup: false,
baseColProps: { lg: 24, md: 24 }, baseColProps: { lg: 24, md: 24 },
}); });
watch(() => subTableDataStore.getToSetGroupData, () => {
if(subTableDataStore.getToSetGroupData){
if (Object.keys(subTableDataStore.getGroupData).includes(tableData.field)) {
noTitleKey.value = subTableDataStore.getGroupData[tableData.field];
if (tableData.ifShow) {
onTabChange({ target: { value: noTitleKey.value } }, tableData.field);
}
} else {
noTitleKey.value = tableData.componentProps.options[0].value;
if (tableData.ifShow) {
onTabChange({ target: { value: noTitleKey.value } }, tableData.field);
}
}
}
})
watch( watch(
() => props.formData, () => props.formData,
(newVal) => { (newVal) => {
@ -199,7 +214,14 @@
} }
function changeForm() { function changeForm() {
subTableDataStore.setGroupData(getFieldsValue()); let data = getFieldsValue()
let result = {}
Object.keys(data).forEach(key => {
if(key.indexOf('card_group') == -1){
result[key] = data[key]
}
})
subTableDataStore.setGroupData(result);
} }
async function verify() { async function verify() {

View File

@ -369,6 +369,7 @@
} }
cardGourpFormData.value = obj; cardGourpFormData.value = obj;
subTableDataStore.setGroupData(obj); subTableDataStore.setGroupData(obj);
subTableDataStore.setToSetGroupData();
FieldsValue.value = obj; FieldsValue.value = obj;
setFieldsValue({ setFieldsValue({
...obj, ...obj,

View File

@ -5,6 +5,7 @@ export const subTableStore = defineStore({
state: () => ({ state: () => ({
tableDta: [], tableDta: [],
groupData: {}, groupData: {},
toSetGroupData: false,
}), }),
getters: { getters: {
getTableData(state) { getTableData(state) {
@ -13,11 +14,17 @@ export const subTableStore = defineStore({
getGroupData(state) { getGroupData(state) {
return state.groupData; return state.groupData;
}, },
getToSetGroupData(state){
return state.toSetGroupData;
}
}, },
actions: { actions: {
setTableData(data) { setTableData(data) {
this.tableDta = data; this.tableDta = data;
}, },
setToSetGroupData(){
this.toSetGroupData = true
},
setSingleData(parentFileId, data) { setSingleData(parentFileId, data) {
this.tableDta.forEach((item, i) => { this.tableDta.forEach((item, i) => {
if (item.parentFileId == parentFileId) { if (item.parentFileId == parentFileId) {
@ -38,6 +45,7 @@ export const subTableStore = defineStore({
}, },
clearGoupData() { clearGoupData() {
this.groupData = {}; this.groupData = {};
this.toSetGroupData = false;
}, },
}, },
}); });

View File

@ -39,7 +39,7 @@
</div> </div>
<div class="screen-item" style="margin-right:51px;"> <div class="screen-item" style="margin-right:51px;">
<!-- <div class="screen-item-label">图斑号</div> --> <!-- <div class="screen-item-label">图斑号</div> -->
<a-input v-model:value="params.geomid" class="item-input" placeholder="请输入图斑编号"/> <a-input allowClear v-model:value="params.geomid" class="item-input" placeholder="请输入图斑编号"/>
</div> </div>
<div class="screen-item" style="display: flex; justify-content: end;margin-bottom: 0px;"> <div class="screen-item" style="display: flex; justify-content: end;margin-bottom: 0px;">
<a-button type="primary" class="item-button" :icon="h(SearchOutlined)" @click="query"></a-button> <a-button type="primary" class="item-button" :icon="h(SearchOutlined)" @click="query"></a-button>

View File

@ -33,12 +33,11 @@
</div> </div>
<div class="screen-item" style="margin-bottom:12px;"> <div class="screen-item" style="margin-bottom:12px;">
<div class="screen-item-label">批次</div> <div class="screen-item-label">批次</div>
<a-select <a-input
allowClear class="item-input"
style="width:117px;" style="width:117px;"
v-model:value="props.infoScreenData.batch" v-model:value="props.infoScreenData.batch"
:options="batchOptions" @change="(value) => emits('mapListScreenChange',value.target.value,'batch')"
@change="(value) => emits('mapListScreenChange',value,'batch')"
/> />
</div> </div>
<div class="screen-item" style="margin-right:15px;margin-bottom:22px;"> <div class="screen-item" style="margin-right:15px;margin-bottom:22px;">
@ -73,6 +72,7 @@
</div> </div>
<div class="screen-item" style="margin-right: 14px;"> <div class="screen-item" style="margin-right: 14px;">
<a-input <a-input
allowClear
placeholder="请输入图斑编号" placeholder="请输入图斑编号"
class="item-input" class="item-input"
v-model:value="props.infoScreenData.mapNo" v-model:value="props.infoScreenData.mapNo"