Compare commits
2 Commits
4ce841529c
...
7a03aa1e2e
| Author | SHA1 | Date |
|---|---|---|
|
|
7a03aa1e2e | |
|
|
618480573c |
|
|
@ -5,6 +5,7 @@ import {
|
|||
SaveFormsParams,
|
||||
DeleteFormsParams,
|
||||
getFormsParams,
|
||||
InputCodeParams,
|
||||
} from './model/index';
|
||||
|
||||
enum Api {
|
||||
|
|
@ -18,6 +19,7 @@ enum Api {
|
|||
DownloadTemplate = '/api/FormScheme/DownTemplateFile?id=', //下载模板
|
||||
UploadFile = '/api/Files/Upload', //上传文件
|
||||
UploadData = '/api/FormScheme/ImportExcel', //导入
|
||||
GetSequenceGen = '/api/IdleLand/GetSequenceGen', //获取流水号
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -25,6 +27,8 @@ enum Api {
|
|||
*/
|
||||
export const getFormsDesignData = (params: AccountParams) =>
|
||||
defHttp.get<AccountListGetResultModel[]>({ url: Api.GETDESIGNDATA, params });
|
||||
export const getSequenceGen = (params: InputCodeParams) =>
|
||||
defHttp.get<AccountListGetResultModel[]>({ url: Api.GetSequenceGen, params });
|
||||
export const getFormsPageData = (params: AccountParams) =>
|
||||
defHttp.post<AccountListGetResultModel[]>({
|
||||
url: Api.GETFORMPAGEDATA + params.id + '&mid=' + params.mid,
|
||||
|
|
|
|||
|
|
@ -24,6 +24,12 @@ export interface AccountParams {
|
|||
rows?: string;
|
||||
mid?: string;
|
||||
}
|
||||
export interface InputCodeParams {
|
||||
lng?: string;
|
||||
lat?: string;
|
||||
prefix?: string;
|
||||
sec_prefix?: string;
|
||||
}
|
||||
export interface SaveFormsParams {
|
||||
schemeId?: string;
|
||||
isUpdate?: any;
|
||||
|
|
|
|||
|
|
@ -239,25 +239,25 @@
|
|||
|
||||
// 数据绘制完成判断
|
||||
const handlerDealFeature = (feature) => {
|
||||
if(map.getLayer('area-label')){
|
||||
map.removeLayer('area-label');
|
||||
map.removeSource('area-label');
|
||||
}
|
||||
// if(map.getLayer('area-label')){
|
||||
// map.removeLayer('area-label');
|
||||
// map.removeSource('area-label');
|
||||
// }
|
||||
let area = turf.area(feature);
|
||||
const centroid = turf.centroid(feature);
|
||||
let labelText = `${area.toFixed(2)} m²`;
|
||||
map.addLayer({
|
||||
id: `area-label`, // 确保 ID 唯一
|
||||
id: feature.id, // 确保 ID 唯一
|
||||
type: "symbol",
|
||||
source: {
|
||||
type: "geojson",
|
||||
data: centroid
|
||||
},
|
||||
// layout: {
|
||||
// "text-field": labelText, // 显示面积
|
||||
// "text-size": 14,
|
||||
// "text-anchor": "center"
|
||||
// },
|
||||
layout: {
|
||||
"text-field": labelText, // 显示面积
|
||||
"text-size": 14,
|
||||
"text-anchor": "center"
|
||||
},
|
||||
paint: {
|
||||
"text-color": "#ff0000"
|
||||
}
|
||||
|
|
@ -281,9 +281,9 @@
|
|||
};
|
||||
// 删除数据
|
||||
const handlerDeleteFeature = (feature) => {
|
||||
if(map.getLayer('area-label')){
|
||||
map.removeLayer('area-label');
|
||||
map.removeSource('area-label');
|
||||
if(map.getLayer(feature.id)){
|
||||
map.removeLayer(feature.id);
|
||||
map.removeSource(feature.id);
|
||||
}
|
||||
for (let i = 0; i < geoms.value.length; i++) {
|
||||
if (geoms.value[i].id == feature.id) {
|
||||
|
|
|
|||
|
|
@ -1285,6 +1285,16 @@ const componentAttrs: IBaseComponentProps = {
|
|||
],
|
||||
},
|
||||
},
|
||||
],
|
||||
InputCode: [
|
||||
{
|
||||
name: 'placeholder',
|
||||
label: '占位符',
|
||||
component: 'Input',
|
||||
componentProps: {
|
||||
placeholder: '请输入占位符',
|
||||
},
|
||||
}
|
||||
]
|
||||
};
|
||||
|
||||
|
|
@ -1310,6 +1320,7 @@ deleteProps(componentAttrs['StrengthMeter'], 'defaultValue');
|
|||
deleteProps(componentAttrs['StrengthMeter'], 'suffix');
|
||||
|
||||
componentAttrs['AddressDetails'] = componentAttrs['AddressInput'];
|
||||
componentAttrs['InputCode'] = componentAttrs['InputCode'];
|
||||
|
||||
//组件属性
|
||||
// name 控件的属性
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@ componentMap.set('Button', Button);
|
|||
componentMap.set('Calendar', Calendar);
|
||||
componentMap.set('Input', Input);
|
||||
componentMap.set('InputGuid', Input);
|
||||
componentMap.set('InputCode', Input);
|
||||
componentMap.set('InputGroup', Input.Group);
|
||||
componentMap.set('InputPassword', Input.Password);
|
||||
componentMap.set('InputSearch', Input.Search);
|
||||
|
|
|
|||
|
|
@ -143,6 +143,14 @@ export const customComponents: IVFormComponent[] = [
|
|||
colProps: { span: 24 },
|
||||
componentProps: {},
|
||||
},
|
||||
{
|
||||
component: 'InputCode',
|
||||
label: '编号',
|
||||
icon: 'bi:braces-asterisk',
|
||||
field: '',
|
||||
colProps: { span: 24 },
|
||||
componentProps: {},
|
||||
},
|
||||
];
|
||||
|
||||
// 左侧控件列表与初始化的控件属性
|
||||
|
|
|
|||
|
|
@ -156,7 +156,7 @@
|
|||
import { FormSchema } from '@/components/Table';
|
||||
import { BasicModal, useModalInner } from '@/components/Modal';
|
||||
import { BasicForm, useForm } from '@/components/Form';
|
||||
import { saveFormsData } from '@/api/formrender/index';
|
||||
import { saveFormsData,getSequenceGen } from '@/api/formrender/index';
|
||||
import { useMessage } from '@/hooks/web/useMessage';
|
||||
import { useUserStore } from '@/store/modules/user';
|
||||
import { create, saveDraft } from '@/api/sys/WFProcess';
|
||||
|
|
@ -170,12 +170,12 @@
|
|||
import CreateOrModifyComponent from '@/views/demo/onlineform/formCall/CreateOrModifyComponent/index.vue';
|
||||
import dayjs from 'dayjs';
|
||||
import Icon from '@/components/Icon/Icon.vue';
|
||||
|
||||
import { useRoute } from 'vue-router';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import ImagePreview from "@/components/Upload/src/components/image_preview.vue";
|
||||
import { userFormFileStore } from '@/store/modules/formFileUrl';
|
||||
const subTableDataStore = subTableStore();
|
||||
|
||||
const route = useRoute();
|
||||
// import FormRender from '@/views/demo/form-design/components/VFormCreate/components/FormRender.vue';
|
||||
|
||||
const emit = defineEmits(['success']);
|
||||
|
|
@ -189,6 +189,7 @@
|
|||
const formColumns: any = ref([]);
|
||||
const tabsColumns: any = ref([]);
|
||||
const flowCode = ref('');
|
||||
const oldRecord = ref();
|
||||
const userStore = useUserStore();
|
||||
const userInfo: any = userStore.getUserInfo;
|
||||
const formData = reactive({
|
||||
|
|
@ -250,6 +251,10 @@
|
|||
|
||||
isUpdate.value = !!data?.isUpdate;
|
||||
isDetail.value = !!data?.isDetail;
|
||||
if(unref(isUpdate)){
|
||||
oldRecord.value = data.record
|
||||
}
|
||||
console.log('aaddd123',data)
|
||||
const arr: FormSchema[] = [];
|
||||
data.tab.forEach((item) => {
|
||||
if (item.field == 'Tabs') {
|
||||
|
|
@ -726,9 +731,43 @@
|
|||
});
|
||||
}
|
||||
query = { ...query, ...subTableDataStore.getGroupData };
|
||||
params.data = JSON.stringify(query);
|
||||
console.log('query222', query);
|
||||
|
||||
let lngLat, jtxz, jtxz1, code, inputCode, address, address1
|
||||
formColumns.value.forEach(item =>{
|
||||
if(item.componentProps.fieldName == 'SpecificNature' || item.label == '具体性质'){
|
||||
jtxz = query[item.field]
|
||||
if (unref(isUpdate)){
|
||||
jtxz1 = oldRecord.value[item.field]
|
||||
}
|
||||
}
|
||||
if(item.component == 'AddressDetails'){
|
||||
address = query[item.field]
|
||||
lngLat = JSON.parse(address)[0].center
|
||||
if (unref(isUpdate)){
|
||||
address1 = oldRecord.value[item.field]
|
||||
}
|
||||
}
|
||||
if(item.component == 'InputCode'){
|
||||
inputCode = item.field
|
||||
}
|
||||
})
|
||||
let codetype = route.query.code
|
||||
let obj = {
|
||||
lng: lngLat[0],
|
||||
lat: lngLat[1],
|
||||
prefix: codetype,
|
||||
sec_prefix: jtxz
|
||||
}
|
||||
if(address != address1 || jtxz != jtxz1){
|
||||
let codeId = await getSequenceGen(obj);
|
||||
query[inputCode] = codeId
|
||||
}
|
||||
|
||||
params.data = JSON.stringify(query);
|
||||
|
||||
console.log('params222', params);
|
||||
|
||||
const data = await saveFormsData(params);
|
||||
if (data) {
|
||||
setModalProps({ confirmLoading: true });
|
||||
|
|
|
|||
|
|
@ -1071,7 +1071,6 @@
|
|||
};
|
||||
const addressModification = (column, record) => {
|
||||
let arr = JSON.parse(record[column.dataIndex])
|
||||
console.log('arr123', arr)
|
||||
if(arr){
|
||||
return arr[0].address
|
||||
}else{
|
||||
|
|
|
|||
Loading…
Reference in New Issue