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