|
|
@@ -0,0 +1,435 @@
|
|
|
+<!--
|
|
|
+ * @Author: tengmingxue 1473375109@qq.com
|
|
|
+ * @Date: 2023-08-15 22:08:21
|
|
|
+ * @LastEditors: tengmingxue 1473375109@qq.com
|
|
|
+ * @LastEditTime: 2023-08-16 18:09:33
|
|
|
+ * @FilePath: \xld-gis-admin\src\views\resource\map\SourceDetail.vue
|
|
|
+ * @Description: 地图资源明细界面
|
|
|
+-->
|
|
|
+<template>
|
|
|
+ <div class="source-detail">
|
|
|
+ <a-form ref="formRef" :model="formState" :rules="rules" style="width: 100%">
|
|
|
+ <div class="compontents">
|
|
|
+ <div class="title">基本信息</div>
|
|
|
+ <a-row class="form-container">
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="code" label="资源编码" name="code" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.code" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="name" label="资源名称" name="name" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.name" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="aliasname" label="资源别名" name="aliasname" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.aliasname" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="systag" label="资源标签" name="systag" class="label-form-item">
|
|
|
+ <a-select v-model:value="formState.systag">
|
|
|
+ <template v-for="tag in serviceTags" :key="tag.code">
|
|
|
+ <a-select-option :value="tag.value">{{ tag.label }}</a-select-option>
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="24" class="form-col">
|
|
|
+ <a-form-item
|
|
|
+ ref="description"
|
|
|
+ label="资源描述"
|
|
|
+ name="description"
|
|
|
+ class="label-form-item"
|
|
|
+ >
|
|
|
+ <a-textarea v-model:value="formState.description" :rows="2" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="24" class="form-col">
|
|
|
+ <a-form-item ref="thumbnail" label="缩略图" name="thumbnail" class="label-form-item">
|
|
|
+ <a-upload action="" v-model:file-list="fileList">
|
|
|
+ <a-button style="background-color: #0671dd; color: #fff; border-radius: 4px">
|
|
|
+ <upload-outlined></upload-outlined>
|
|
|
+ 文件上传
|
|
|
+ </a-button>
|
|
|
+ </a-upload>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+
|
|
|
+
|
|
|
+ <div class="compontents">
|
|
|
+ <div class="title">描述信息</div>
|
|
|
+ <a-row class="form-container">
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="restype" label="资源类型" name="restype" class="label-form-item">
|
|
|
+ <a-select v-model:value="formState.restype">
|
|
|
+ <template v-for="tag in serviceTypes" :key="tag.id">
|
|
|
+ <a-select-option :value="tag.id">{{ tag.name }}</a-select-option>
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="coordinate" label="坐标系" name="coordinate" class="label-form-item">
|
|
|
+ <a-select v-model:value="formState.coordinate">
|
|
|
+ <template v-for="tag in sysCoors" :key="tag.ID">
|
|
|
+ <a-select-option :value="tag.ID">{{ tag.GEOMNAME }}</a-select-option>
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="24" class="form-col">
|
|
|
+ <a-form-item ref="addr" label="服务地址" name="addr" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.addr" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="range" label="数据范围" name="range" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.range" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="source" label="数据来源" name="source" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.source" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="restype" label="密级" name="secrets" class="label-form-item">
|
|
|
+ <a-select v-model:value="formState.secrets">
|
|
|
+ <template v-for="tag in secrets" :key="tag.code">
|
|
|
+ <a-select-option :value="tag.code">{{ tag.name }}</a-select-option>
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item
|
|
|
+ ref="sourcetable"
|
|
|
+ label="数据表"
|
|
|
+ name="sourcetable"
|
|
|
+ class="label-form-item"
|
|
|
+ >
|
|
|
+ <a-input v-model:value="formState.sourcetable" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="collect" label="保管单位" name="collect" class="label-form-item">
|
|
|
+ <a-select v-model:value="formState.collect">
|
|
|
+ <template v-for="tag in collectDept" :key="tag.code">
|
|
|
+ <a-select-option :value="tag.code">{{ tag.name }}</a-select-option>
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="respUnit" label="责任处室" name="respUnit" class="label-form-item">
|
|
|
+ <a-select v-model:value="formState.respUnit">
|
|
|
+ <template v-for="tag in respDept" :key="tag.code">
|
|
|
+ <a-select-option :value="tag.code">{{ tag.name }}</a-select-option>
|
|
|
+ </template>
|
|
|
+ </a-select>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="source" label="发布日期" name="source" class="label-form-item">
|
|
|
+ <!-- <a-input v-model:value="formState.publishtime" disabled /> -->
|
|
|
+ <a-date-picker
|
|
|
+ v-model:value="formState.publishtime"
|
|
|
+ format="YYYY-MM-DD hh:mm:ss"
|
|
|
+ style="width: 100%"
|
|
|
+ disabled
|
|
|
+ show-time
|
|
|
+ >
|
|
|
+ <template #renderExtraFooter>extra footer</template>
|
|
|
+ </a-date-picker>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="source" label="发布者" name="source" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.publisher" disabled />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item
|
|
|
+ ref="updatetype"
|
|
|
+ label="更新方式"
|
|
|
+ name="updatetype"
|
|
|
+ class="label-form-item"
|
|
|
+ >
|
|
|
+ <a-input v-model:value="formState.updatetype" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item
|
|
|
+ ref="updatetime"
|
|
|
+ label="更新时间"
|
|
|
+ name="updatetime"
|
|
|
+ class="label-form-item"
|
|
|
+ >
|
|
|
+ <a-date-picker
|
|
|
+ v-model:value="formState.updatetime"
|
|
|
+ format="YYYY-MM-DD hh:mm:ss"
|
|
|
+ style="width: 100%"
|
|
|
+ disabled
|
|
|
+ show-time
|
|
|
+ >
|
|
|
+ <template #renderExtraFooter>extra footer</template>
|
|
|
+ </a-date-picker>
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="epsccode" label="EPSCCode" name="epsccode" class="label-form-item">
|
|
|
+ <a-input v-model:value="formState.epsccode" />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="12" class="form-col">
|
|
|
+ <a-form-item ref="epsccode" label="运行状态" name="epsccode" class="label-form-item">
|
|
|
+ <a-switch
|
|
|
+ checked-children=""
|
|
|
+ un-checked-children=""
|
|
|
+ v-model:checked="formState.runstatus"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+
|
|
|
+ <a-col :span="8" class="form-col">
|
|
|
+ <a-form-item ref="epsccode" label="是否公开" name="epsccode" class="label-form-item">
|
|
|
+ <a-switch
|
|
|
+ checked-children=""
|
|
|
+ un-checked-children=""
|
|
|
+ v-model:checked="formState.public"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8" class="form-col">
|
|
|
+ <a-form-item ref="epsccode" label="是否共享" name="epsccode" class="label-form-item">
|
|
|
+ <a-switch
|
|
|
+ checked-children=""
|
|
|
+ un-checked-children=""
|
|
|
+ v-model:checked="formState.share"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ <a-col :span="8" class="form-col">
|
|
|
+ <a-form-item ref="epsccode" label="是否展开" name="epsccode" class="label-form-item">
|
|
|
+ <a-switch
|
|
|
+ checked-children=""
|
|
|
+ un-checked-children=""
|
|
|
+ v-model:checked="formState.open"
|
|
|
+ />
|
|
|
+ </a-form-item>
|
|
|
+ </a-col>
|
|
|
+ </a-row>
|
|
|
+ </div>
|
|
|
+ </a-form>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script lang="ts">
|
|
|
+import {
|
|
|
+ defineComponent,
|
|
|
+ ref,
|
|
|
+ toRefs,
|
|
|
+ toRaw,
|
|
|
+ unref,
|
|
|
+ computed,
|
|
|
+ unref,
|
|
|
+ nextTick,
|
|
|
+ reactive,
|
|
|
+ UnwrapRef,
|
|
|
+ onMounted,
|
|
|
+} from 'vue';
|
|
|
+import { BasicForm, useForm } from '/@/components/Form/index';
|
|
|
+import { UploadOutlined } from '@ant-design/icons-vue';
|
|
|
+import { ValidateErrorEntity } from 'ant-design-vue/es/form/interface';
|
|
|
+import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
+const { t } = useI18n(); //加载国际化
|
|
|
+// 加载菜单数据
|
|
|
+import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
+import { Moment } from 'moment';
|
|
|
+import { getServiceTypes } from '/@/api/resource/map';
|
|
|
+import { serviceTypes,serviceTags,secrets,sysCoors,respDept,collectDept } from './map.data';
|
|
|
+
|
|
|
+const props = {
|
|
|
+ source: { type: Object, default: null },
|
|
|
+};
|
|
|
+interface FormState {
|
|
|
+ code: string;
|
|
|
+ name: string;
|
|
|
+ aliasname: string;
|
|
|
+ systag: string[];
|
|
|
+ description: string;
|
|
|
+ restype: string;
|
|
|
+ coordinate: string;
|
|
|
+ addr: string;
|
|
|
+ range: string;
|
|
|
+ source: string;
|
|
|
+ secrets: string;
|
|
|
+ sourcetable: string;
|
|
|
+ collect: string;
|
|
|
+ respUnit: string;
|
|
|
+ publishtime: string;
|
|
|
+ publisher: string;
|
|
|
+ updatetype: string;
|
|
|
+ updatetime: string;
|
|
|
+ epsccode: string;
|
|
|
+ runstatus: boolean;
|
|
|
+ public: boolean;
|
|
|
+ share: boolean;
|
|
|
+ open: boolean;
|
|
|
+ // date1: Moment | undefined;
|
|
|
+}
|
|
|
+export default defineComponent({
|
|
|
+ name: 'SourceDetail',
|
|
|
+ components: { BasicForm, UploadOutlined },
|
|
|
+ props,
|
|
|
+ setup(props, { emit }) {
|
|
|
+ const data = reactive({
|
|
|
+ detail: props.detail,
|
|
|
+ fileList: [],
|
|
|
+ serviceTags: serviceTags,
|
|
|
+ secrets:secrets, //密级
|
|
|
+ sysCoors:sysCoors, //坐标系
|
|
|
+ serviceTypes: serviceTypes, //资源类型
|
|
|
+ respDept: respDept, //责任科室
|
|
|
+ collectDept: collectDept, //保管部门
|
|
|
+ });
|
|
|
+ console.log('责任科室',respDept)
|
|
|
+ const formRef = ref();
|
|
|
+ const formState: UnwrapRef<FormState> = reactive({
|
|
|
+ code: '',
|
|
|
+ name: '',
|
|
|
+ aliasname: '',
|
|
|
+ systag: [],
|
|
|
+ description: '',
|
|
|
+ restype: '',
|
|
|
+ coordinate: '',
|
|
|
+ addr: '',
|
|
|
+ range: '',
|
|
|
+ source: '',
|
|
|
+ secrets: '',
|
|
|
+ sourcetable: '',
|
|
|
+ collect: '',
|
|
|
+ respUnit: '',
|
|
|
+ publishtime: '',
|
|
|
+ publisher: '',
|
|
|
+ updatetype: '',
|
|
|
+ updatetime: '',
|
|
|
+ epsccode: '',
|
|
|
+ runstatus: true,
|
|
|
+ public: false,
|
|
|
+ share: false,
|
|
|
+ open: false,
|
|
|
+ date1: undefined,
|
|
|
+ });
|
|
|
+ const rules = {
|
|
|
+ name: [
|
|
|
+ { required: true, message: '请填写资源名称', trigger: 'blur' },
|
|
|
+ { min: 3, max: 20, message: '长度必须在3到20个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ aliasname: [
|
|
|
+ { required: true, message: '请输入资源别名', trigger: 'blur' },
|
|
|
+ { min: 3, max: 20, message: '长度必须在3到20个字符', trigger: 'blur' },
|
|
|
+ ],
|
|
|
+ systag: [{ required: true, message: '请选择系统标签', trigger: 'change' }],
|
|
|
+ restype: [{ required: true, message: '请选择资源类型', trigger: 'change' }],
|
|
|
+ coordinate: [{ required: true, message: '请选择坐标系', trigger: 'change' }],
|
|
|
+ addr: [{ required: true, message: 'Please input Activity name', trigger: 'blur' }],
|
|
|
+
|
|
|
+ date1: [{ required: true, message: 'Please pick a date', trigger: 'change', type: 'object' }],
|
|
|
+ type: [
|
|
|
+ {
|
|
|
+ type: 'array',
|
|
|
+ required: true,
|
|
|
+ message: 'Please select at least one activity type',
|
|
|
+ trigger: 'change',
|
|
|
+ },
|
|
|
+ ],
|
|
|
+ resource: [{ required: true, message: 'Please select activity resource', trigger: 'change' }],
|
|
|
+ desc: [{ required: true, message: 'Please input activity form', trigger: 'blur' }],
|
|
|
+ };
|
|
|
+ const { createMessage } = useMessage();
|
|
|
+ const submitForm = () => {
|
|
|
+ formRef.value
|
|
|
+ .validate()
|
|
|
+ .then(() => {
|
|
|
+ console.log('values', formState, toRaw(formState));
|
|
|
+ })
|
|
|
+ .catch((error: ValidateErrorEntity<FormState>) => {
|
|
|
+ console.log('error', error);
|
|
|
+ createMessage.error('请完成必填信息!');
|
|
|
+ });
|
|
|
+ };
|
|
|
+ const resetForm = () => {
|
|
|
+ formRef.value.resetFields();
|
|
|
+ };
|
|
|
+
|
|
|
+
|
|
|
+ onMounted(() => {
|
|
|
+
|
|
|
+ });
|
|
|
+ return {
|
|
|
+ ...toRefs(data),
|
|
|
+ formRef,
|
|
|
+ rules,
|
|
|
+ formState,
|
|
|
+ submitForm,
|
|
|
+ resetForm,
|
|
|
+ createMessage,
|
|
|
+ };
|
|
|
+ },
|
|
|
+});
|
|
|
+</script>
|
|
|
+
|
|
|
+ <style scoped lang="less">
|
|
|
+.source-detail {
|
|
|
+ height: 100%;
|
|
|
+ width: 100%;
|
|
|
+ padding: 0 20px;
|
|
|
+ .compontents {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ .title {
|
|
|
+ height: 19px;
|
|
|
+ line-height: 18px;
|
|
|
+ padding-left: 6px;
|
|
|
+ margin-bottom: 20px;
|
|
|
+ border-left: 3px solid #0671dd;
|
|
|
+ font-family: Source Han Sans CN;
|
|
|
+ font-size: 16px;
|
|
|
+ font-weight: 350;
|
|
|
+ letter-spacing: 0px;
|
|
|
+ }
|
|
|
+ .form-container {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ .form-col {
|
|
|
+ height: 100%;
|
|
|
+ }
|
|
|
+ .form-col-left {
|
|
|
+ padding-right: 20px;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+.label-form-item {
|
|
|
+ :deep(.ant-form-item-label) {
|
|
|
+ width: 90px;
|
|
|
+ }
|
|
|
+ :deep(.ant-form-item-control) {
|
|
|
+ width: calc(100% - 90px);
|
|
|
+ }
|
|
|
+}
|
|
|
+</style>
|
|
|
+
|