| | |
| | | <a-form-item label="项目名称" :name="FormProject.PROJECT_NAME"> |
| | | <a-input v-model:value="formState[FormProject.PROJECT_NAME]" placeholder="项目名称" /> |
| | | </a-form-item> |
| | | <a-form-item label="平台名称" :name="FormProject.PLATFORMNAME"> |
| | | <a-input v-model:value="formState[FormProject.PLATFORMNAME]" placeholder="平台名称" /> |
| | | </a-form-item> |
| | | <a-form-item label="绑定编码" :name="FormProject.BINDCODE"> |
| | | <a-input v-model:value="formState[FormProject.BINDCODE]" placeholder="绑定编码" /> |
| | | </a-form-item> |
| | | <a-form-item label="项目简介" :name="FormProject.PROJCECT_INTRO"> |
| | | <a-textarea :auto-size="{ minRows: 4, maxRows: 8 }" type="textarea" |
| | | v-model:value="formState[FormProject.PROJCECT_INTRO]" placeholder="项目简介" /> |
| | | </a-form-item> |
| | | <a-form-item> |
| | | <!-- <a-form-item> |
| | | <div class="application flex-display flex-align-center flex-justify-between"> |
| | | <p>申请码加入项目</p> |
| | | <div class="btn dis_opticy"> |
| | |
| | | </div> |
| | | <div class="latitude" v-if="latitude && latitude != 0"> |
| | | 经纬度:{{ latitude }}°N {{ longitude }}°E</div> |
| | | </a-form-item> |
| | | </a-form-item> --> |
| | | </a-form> |
| | | <WeatherDrawer v-model:show="drawerConfig.weatherDrawer" title="以下设置仅在当前项目中生效"> |
| | | <!-- <WeatherDrawer v-model:show="drawerConfig.weatherDrawer" title="以下设置仅在当前项目中生效"> |
| | | <ComWeather v-model="formState" /> |
| | | </WeatherDrawer> |
| | | <WeatherDrawer v-model:show="drawerConfig.userDrawer" title="添加成员"> |
| | | <ComUser v-model="formState" /> |
| | | </WeatherDrawer> |
| | | </WeatherDrawer> --> |
| | | </div> |
| | | <div class="fix-button"> |
| | | <a-button @click="submit" style="width: 100%;height: 36px;justify-content: center;" |
| | |
| | | import { Form, message } from 'ant-design-vue' |
| | | import { cloneDeep } from 'lodash' |
| | | import { add, detail, edit as projectEdit } from '/@/api/project-page/index' |
| | | import { getPlatformInfo, editPlatformInfo, addPlatformInfo } from '/@/api/manage' |
| | | import { addPoint } from '/@/hooks/use-center-point' |
| | | import { useMyStore } from '/@/store/index' |
| | | const { appContext } = getCurrentInstance() |
| | |
| | | }) |
| | | const formState = ref<FormState>({ |
| | | [FormProject.PROJECT_NAME]: '', |
| | | [FormProject.PROJECT_STATUS]: '', |
| | | // [FormProject.PROJECT_STATUS]: '', |
| | | [FormProject.BINDCODE]: '', |
| | | [FormProject.PROJCECT_INTRO]: '', |
| | | [FormProject.LONGITUDE]: null, |
| | | [FormProject.LATITUDE]: null, |
| | | [FormProject.USERLIST]: [], |
| | | [FormProject.PROJECT_BLOCKING]: { |
| | | [blocking.CLOUDBLOCKINGCONFIGENABLE]: '1', |
| | | [blocking.WEATHERREPORTENABLE]: '1', |
| | | [blocking.WINDSPEED]: 12, |
| | | [blocking.WINDSPEEDREPORT]: 15, |
| | | [blocking.RAIN]: 3 |
| | | } |
| | | [FormProject.PLATFORMNAME]: '', |
| | | }) |
| | | const drawerConfig = ref({ |
| | | userDrawer: false, |
| | |
| | | // 获取项目详情 |
| | | const getDetail = async () => { |
| | | if (!route.query.id) return |
| | | const id = route.query.id |
| | | const res = await detail(id) |
| | | if (res.code !== 5000) return |
| | | const res = await getPlatformInfo() |
| | | console.log(res, '项目详情') |
| | | if (res.code !== 0) return |
| | | formState.value = res.data |
| | | addPoint(global.$viewer, res.data.id, res.data.latitude, res.data.latitude) |
| | | store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: formState.value.latitude, longitude: formState.value.longitude }) |
| | | // addPoint(global.$viewer, res.data.id, res.data.latitude, res.data.latitude) |
| | | // store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: formState.value.latitude, longitude: formState.value.longitude }) |
| | | } |
| | | // 编辑项目 |
| | | const editProject = async () => { |
| | | const res = await projectEdit(formState.value) |
| | | if (res.code !== 5000) return |
| | | const res = await editPlatformInfo(formState.value) |
| | | if (res.code !== 0) return |
| | | message.success('修改成功') |
| | | router.go(-1) |
| | | store.commit('SET_CENTER_CONFIG_TYPE', false) |
| | | store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: null, longitude: null }) |
| | | // store.commit('SET_CENTER_CONFIG_TYPE', false) |
| | | // store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: null, longitude: null }) |
| | | } |
| | | // 新增项目 |
| | | const addProject = async () => { |
| | | const res = await add(formState.value) |
| | | if (res.code !== 5000) return |
| | | const res = await addPlatformInfo(formState.value) |
| | | if (res.code !== 0) return |
| | | message.success('保存成功') |
| | | router.go(-1) |
| | | store.commit('SET_CENTER_CONFIG_TYPE', false) |
| | | store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: null, longitude: null }) |
| | | // store.commit('SET_CENTER_CONFIG_TYPE', false) |
| | | // store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: null, longitude: null }) |
| | | } |
| | | const goBack = () => { |
| | | router.go(-1) |
| | | store.commit('SET_CENTER_CONFIG_TYPE', false) |
| | | store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: null, longitude: null }) |
| | | // store.commit('SET_CENTER_CONFIG_TYPE', false) |
| | | // store.commit('SET_CENTER_CONFIG_LATITUDE', { latitude: null, longitude: null }) |
| | | } |
| | | // 天气组飞侧边栏 |
| | | const openDrawer = (name: string) => { |
| | |
| | | } |
| | | // 表单验证提交 |
| | | const submit = () => { |
| | | formState.value[FormProject.LATITUDE] = latitude.value |
| | | formState.value[FormProject.LONGITUDE] = longitude.value |
| | | projectForm.value.validate().then(async () => { |
| | | if (route.query.id) { |
| | | editProject() |