|
@@ -54,26 +54,20 @@
|
|
|
</el-form-item> -->
|
|
|
|
|
|
<el-form-item label="系统平台:" prop="systemName">
|
|
|
- <el-select
|
|
|
- v-model="form.systemName"
|
|
|
- placeholder="请选择"
|
|
|
- >
|
|
|
+ <el-select v-model="form.systemName" placeholder="请选择">
|
|
|
<!-- <el-option label="永天智慧电力平台" :value="1"></el-option>
|
|
|
<el-option label="伍继智慧电力平台" :value="2"></el-option>
|
|
|
<el-option label="电力运营管理平台" :value="3"></el-option> -->
|
|
|
|
|
|
<el-option
|
|
|
- v-for="(item, index) in getPlatformBoxList"
|
|
|
- :key="index"
|
|
|
- :label="item.platformName"
|
|
|
- :value="item.id"
|
|
|
- ></el-option>
|
|
|
-
|
|
|
-
|
|
|
+ v-for="(item, index) in getPlatformBoxList"
|
|
|
+ :key="index"
|
|
|
+ :label="item.platformName"
|
|
|
+ :value="item.id"
|
|
|
+ ></el-option>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
|
|
|
-
|
|
|
<el-form-item label="邮箱地址:" prop="email">
|
|
|
<el-input v-model="form.email"></el-input>
|
|
|
</el-form-item>
|
|
@@ -85,9 +79,28 @@
|
|
|
|
|
|
<el-form-item label="">
|
|
|
<div
|
|
|
- style="width: 670px; height: 130px; background: rgba(0, 0, 0, 0.2);text-align:center"
|
|
|
+ style="
|
|
|
+ width: 670px;
|
|
|
+ height: 130px;
|
|
|
+ background: rgba(0, 0, 0, 0.2);
|
|
|
+ text-align: center;
|
|
|
+ position: relative;
|
|
|
+ "
|
|
|
>
|
|
|
地图api待接入
|
|
|
+
|
|
|
+ <div
|
|
|
+ class="map"
|
|
|
+ id="mapF"
|
|
|
+ style="
|
|
|
+ height: 100%;
|
|
|
+ z-index: 99;
|
|
|
+ position: absolute;
|
|
|
+ top: 0;
|
|
|
+ left: 0;
|
|
|
+ width: 100%;
|
|
|
+ "
|
|
|
+ ></div>
|
|
|
</div>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注:" prop="remark">
|
|
@@ -101,7 +114,7 @@
|
|
|
</el-form-item>
|
|
|
|
|
|
<br />
|
|
|
-
|
|
|
+
|
|
|
<div style="text-align: right">
|
|
|
<el-button @click="closeDialog(0)">取消</el-button>
|
|
|
<el-button type="primary" @click="submitForm()">保存</el-button>
|
|
@@ -110,12 +123,15 @@
|
|
|
</el-dialog>
|
|
|
</template>
|
|
|
<script>
|
|
|
+// 地图
|
|
|
+import AMap from 'AMap'
|
|
|
import { useStore } from 'vuex'
|
|
|
-import { defineComponent, ref, watchEffect ,onMounted} from 'vue'
|
|
|
+import { defineComponent, ref, watchEffect, onMounted } from 'vue'
|
|
|
import * as api from '@/api/tenantManage/tenantUnit.js'
|
|
|
import { ElMessage } from 'element-plus'
|
|
|
// import { parseTime } from '@/utils'
|
|
|
import { validatorPhone, parseTime, isEmail } from '@/utils'
|
|
|
+
|
|
|
export default defineComponent({
|
|
|
name: 'DialogComponent',
|
|
|
emits: ['closeDialog'],
|
|
@@ -136,7 +152,7 @@ export default defineComponent({
|
|
|
const form = ref({})
|
|
|
const formInfo = ref(null)
|
|
|
|
|
|
- const getPlatformBoxList = ref([])
|
|
|
+ const getPlatformBoxList = ref([])
|
|
|
|
|
|
const roleValid = (rule, value, callback) => {
|
|
|
rule
|
|
@@ -151,25 +167,23 @@ export default defineComponent({
|
|
|
const submitForm = () => {
|
|
|
formInfo.value.validate((valid) => {
|
|
|
if (valid) {
|
|
|
-
|
|
|
var aa = form.value
|
|
|
- if (aa.tenantTerm == 3) {
|
|
|
- aa.tenantTerm = '永久有效'
|
|
|
+ if (aa.tenantTerm == 3) {
|
|
|
+ aa.tenantTerm = '永久有效'
|
|
|
+ }
|
|
|
+ if (aa.tenantTerm == 4) {
|
|
|
+ if (!form.value.value1) {
|
|
|
+ ElMessage.warning('请选择日期')
|
|
|
+ return
|
|
|
}
|
|
|
- if (aa.tenantTerm == 4) {
|
|
|
- if (!form.value.value1) {
|
|
|
- ElMessage.warning('请选择日期')
|
|
|
- return
|
|
|
- }
|
|
|
- aa.tenantTerm = form.value.value1
|
|
|
+ aa.tenantTerm = form.value.value1
|
|
|
|
|
|
- parseTime
|
|
|
-
|
|
|
- aa.tenantTerm
|
|
|
- ? (aa.tenantTerm = parseTime(aa.tenantTerm).substring(0, 10))
|
|
|
- : ''
|
|
|
- }
|
|
|
+ parseTime
|
|
|
|
|
|
+ aa.tenantTerm
|
|
|
+ ? (aa.tenantTerm = parseTime(aa.tenantTerm).substring(0, 10))
|
|
|
+ : ''
|
|
|
+ }
|
|
|
|
|
|
if (props.dialogTitle === '新增') {
|
|
|
api.addTenantData(form.value).then((requset) => {
|
|
@@ -203,13 +217,34 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
|
|
|
+ function initMap(){
|
|
|
+ // AMap start
|
|
|
+ var map = new AMap.Map('mapF', {
|
|
|
+ resizeEnable: true,
|
|
|
+ })
|
|
|
+ //为地图注册click事件获取鼠标点击出的经纬度坐标
|
|
|
+ map.on('click', function (e) {
|
|
|
+ form.value.geoPosition = e.lnglat.getLng() + ',' + e.lnglat.getLat()
|
|
|
+ })
|
|
|
+ // AMap end
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
const open = () => {
|
|
|
- form.value = props.itemInfo;
|
|
|
+ initMap()
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ form.value = props.itemInfo
|
|
|
console.log('form.value')
|
|
|
console.log(form.value)
|
|
|
|
|
|
- optionselect()
|
|
|
-
|
|
|
+ optionselect()
|
|
|
}
|
|
|
|
|
|
// 关闭弹框
|
|
@@ -227,7 +262,6 @@ export default defineComponent({
|
|
|
function optionselect() {
|
|
|
api.getPlatformBoxList().then((requset) => {
|
|
|
if (requset.status === 'SUCCESS') {
|
|
|
-
|
|
|
getPlatformBoxList.value = requset.data
|
|
|
} else {
|
|
|
ElMessage.error(requset.msg)
|
|
@@ -235,8 +269,6 @@ export default defineComponent({
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-
|
|
|
-
|
|
|
watchEffect((fn, options) => {
|
|
|
fn, options
|
|
|
showDialog.value = props.show_Dialog
|
|
@@ -248,9 +280,7 @@ export default defineComponent({
|
|
|
return time.getTime() <= Date.now() - timeRange * 1
|
|
|
}
|
|
|
|
|
|
- onMounted(() => {
|
|
|
-
|
|
|
- })
|
|
|
+ onMounted(() => {})
|
|
|
|
|
|
return {
|
|
|
pickerEndDate,
|
|
@@ -259,10 +289,13 @@ export default defineComponent({
|
|
|
closeDialog,
|
|
|
open,
|
|
|
|
|
|
+ // map123,
|
|
|
store,
|
|
|
beginTime,
|
|
|
showDialog,
|
|
|
|
|
|
+ initMap,
|
|
|
+
|
|
|
checked: true,
|
|
|
form,
|
|
|
formInfo,
|