样式调整
							parent
							
								
									c1ef57ea36
								
							
						
					
					
						commit
						79b6b03c8d
					
				| 
						 | 
				
			
			@ -2,9 +2,12 @@
 | 
			
		|||
  <el-descriptions :column="column" border>
 | 
			
		||||
    <template v-for="item in options" :key="item.key">
 | 
			
		||||
      <el-descriptions-item
 | 
			
		||||
        label-class-name="my-label"
 | 
			
		||||
        content-class-name="my-content"
 | 
			
		||||
        v-if="!item.hidden"
 | 
			
		||||
        :label="item.label"
 | 
			
		||||
        :span="item.span || 1"
 | 
			
		||||
        width="150px"
 | 
			
		||||
      >
 | 
			
		||||
        <slot :name="item.key">
 | 
			
		||||
          <template v-if="item.value">
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -53,11 +53,20 @@
 | 
			
		|||
        >添加上级平台</el-button
 | 
			
		||||
      >
 | 
			
		||||
    </div>
 | 
			
		||||
    <el-form ref="formRef1" label-width="220px" label-position="right">
 | 
			
		||||
    <el-form
 | 
			
		||||
      ref="formRef1"
 | 
			
		||||
      label-width="220px"
 | 
			
		||||
      label-position="right"
 | 
			
		||||
      :rules="thirdRules"
 | 
			
		||||
    >
 | 
			
		||||
      <el-row :gutter="24" v-for="(item, index) in thirdList" :key="index">
 | 
			
		||||
        <el-divider></el-divider>
 | 
			
		||||
        <el-col :span="12">
 | 
			
		||||
          <el-form-item label="上级对接平台">
 | 
			
		||||
          <el-form-item
 | 
			
		||||
            label="上级对接平台"
 | 
			
		||||
            :prop="thirdPlatformId"
 | 
			
		||||
            :rules="thirdRules.thirdPlatformId"
 | 
			
		||||
          >
 | 
			
		||||
            <el-select
 | 
			
		||||
              :disabled="thirdListOptions.length === 0"
 | 
			
		||||
              v-model="item.thirdPlatformId"
 | 
			
		||||
| 
						 | 
				
			
			@ -73,7 +82,11 @@
 | 
			
		|||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
        <el-col :span="12">
 | 
			
		||||
          <el-form-item label="上级平台编码" prop="thirdPlatformCode">
 | 
			
		||||
          <el-form-item
 | 
			
		||||
            label="上级平台编码"
 | 
			
		||||
            :prop="thirdPlatformCode"
 | 
			
		||||
            :rules="thirdRules.thirdPlatformCode"
 | 
			
		||||
          >
 | 
			
		||||
            <el-input v-model="item.thirdPlatformCode"></el-input>
 | 
			
		||||
          </el-form-item>
 | 
			
		||||
        </el-col>
 | 
			
		||||
| 
						 | 
				
			
			@ -164,7 +177,6 @@ const props = defineProps({
 | 
			
		|||
const { data: servicePlatformList } = await getBusServicePlatformListAll();
 | 
			
		||||
const emits = defineEmits(["getData"]);
 | 
			
		||||
const { formRef, validate, reset } = useForm();
 | 
			
		||||
// const { formRef, reset } = useForm();
 | 
			
		||||
const form = ref({
 | 
			
		||||
  companyName: "", // 企业名称
 | 
			
		||||
  code: "", // 统一社会信用代码
 | 
			
		||||
| 
						 | 
				
			
			@ -254,7 +266,10 @@ const rules = {
 | 
			
		|||
    { required: true, message: "是否粉尘涉爆企业", trigger: "change" },
 | 
			
		||||
  ],
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
const thirdRules = {
 | 
			
		||||
  thirdPlatformId: [{ required: true }],
 | 
			
		||||
  thirdPlatformCode: [{ required: true }],
 | 
			
		||||
};
 | 
			
		||||
const baseInfoOptions = [
 | 
			
		||||
  { key: "companyName", label: "企业名称" },
 | 
			
		||||
  { key: "code", label: "统一社会信用代码" },
 | 
			
		||||
| 
						 | 
				
			
			@ -337,13 +352,13 @@ const fnGetData = async () => {
 | 
			
		|||
  if (!props.corpInfoId) return;
 | 
			
		||||
  const { data } = await getBusCompanyInfo({ id: props.corpInfoId });
 | 
			
		||||
  form.value = data;
 | 
			
		||||
  if (form.value.province) {
 | 
			
		||||
    form.value.area = [form.value.province, form.value.city, form.value.county];
 | 
			
		||||
  }
 | 
			
		||||
  form.value.area = form.value.province
 | 
			
		||||
    ? [form.value.province, form.value.city, form.value.county]
 | 
			
		||||
    : [];
 | 
			
		||||
  form.value.sectorId = data.sectorId.split(",");
 | 
			
		||||
  if (form.value.longitude) {
 | 
			
		||||
    form.value.address = `${form.value.longitude}-${form.value.latitude}`;
 | 
			
		||||
  }
 | 
			
		||||
  form.value.address = form.value.longitude
 | 
			
		||||
    ? `${form.value.longitude}-${form.value.latitude}`
 | 
			
		||||
    : "";
 | 
			
		||||
  thirdList.value = data.thirdList;
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -394,12 +409,8 @@ const fnSubmitMap = () => {
 | 
			
		|||
const checkThirdListItem = () => {
 | 
			
		||||
  for (let i = 0; i < thirdList.value.length; i++) {
 | 
			
		||||
    const obj = thirdList.value[i];
 | 
			
		||||
    if (
 | 
			
		||||
      !obj.thirdPlatformId ||
 | 
			
		||||
      !obj.thirdPlatformCode ||
 | 
			
		||||
      !obj.majorHazardCode
 | 
			
		||||
    ) {
 | 
			
		||||
      ElMessage.error("上级对接平台、企业编码、重大危险源编码不能为空");
 | 
			
		||||
    if (!obj.thirdPlatformId || !obj.thirdPlatformCode) {
 | 
			
		||||
      ElMessage.error("上级对接平台、企业编码不能为空");
 | 
			
		||||
      return false;
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
| 
						 | 
				
			
			@ -415,6 +426,7 @@ const fnSubmit = debounce(
 | 
			
		|||
    if (check) {
 | 
			
		||||
      const sectorName = sectorIdRef.value.getCheckedNodes();
 | 
			
		||||
      const [province = "", city = "", county = ""] = form.value.area;
 | 
			
		||||
 | 
			
		||||
      const sectorId = form.value.sectorId.join(",");
 | 
			
		||||
      const params = {
 | 
			
		||||
        ...form.value,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,11 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <app-search v-model="searchForm" :options @submit="resetPagination" />
 | 
			
		||||
    <app-search
 | 
			
		||||
      v-model="searchForm"
 | 
			
		||||
      :options
 | 
			
		||||
      label-width="150px"
 | 
			
		||||
      @submit="resetPagination"
 | 
			
		||||
    />
 | 
			
		||||
    <el-button type="primary" class="mb-10" @click="fnAddorEdit('add')">
 | 
			
		||||
      新增平台
 | 
			
		||||
    </el-button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -12,7 +12,7 @@
 | 
			
		|||
    <el-divider content-position="left">企业属性信息</el-divider>
 | 
			
		||||
    <app-info-builder :options="propsOptions" :info> </app-info-builder>
 | 
			
		||||
    <el-divider content-position="left">对接上级平台信息</el-divider>
 | 
			
		||||
    <div v-for="(item, index) in thirdList" :key="index">
 | 
			
		||||
    <div v-for="(item, index) in thirdList" :key="index" class="mb-10">
 | 
			
		||||
      <app-info-builder :options="thirdListOptions" :info="item">
 | 
			
		||||
        <template #thirdPlatformId>
 | 
			
		||||
          {{ fnPlatformName(target.thirdList, item.thirdPlatformId) }}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,6 +1,11 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <app-search v-model="searchForm" :options @submit="resetPagination" />
 | 
			
		||||
    <app-search
 | 
			
		||||
      v-model="searchForm"
 | 
			
		||||
      :options
 | 
			
		||||
      label-width="150px"
 | 
			
		||||
      @submit="resetPagination"
 | 
			
		||||
    />
 | 
			
		||||
    <el-button type="primary" class="mb-10" @click="fnAddorEdit('add')">
 | 
			
		||||
      新增平台
 | 
			
		||||
    </el-button>
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,57 +0,0 @@
 | 
			
		|||
<template>
 | 
			
		||||
  <div>
 | 
			
		||||
    <app-info-builder :options :info>
 | 
			
		||||
      <template #platformLevel>
 | 
			
		||||
        {{ translationStatus(info.platformLevel, platformLevelOptions) }}
 | 
			
		||||
      </template>
 | 
			
		||||
      <template #platformStatus>
 | 
			
		||||
        {{ translationStatus(info.platformStatus, STATUS_LIST) }}
 | 
			
		||||
      </template>
 | 
			
		||||
      <template #frequency>
 | 
			
		||||
        {{ translationStatus(info.frequency, frequencyOptions) }}
 | 
			
		||||
      </template>
 | 
			
		||||
    </app-info-builder>
 | 
			
		||||
  </div>
 | 
			
		||||
</template>
 | 
			
		||||
 | 
			
		||||
<script setup>
 | 
			
		||||
import { useRoute } from "vue-router";
 | 
			
		||||
import AppInfoBuilder from "@/components/info_builder/index.vue";
 | 
			
		||||
import { ref } from "vue";
 | 
			
		||||
import { getBusThirdPlatform } from "@/request/database.js";
 | 
			
		||||
import { STATUS_LIST } from "@/assets/js/constant.js";
 | 
			
		||||
import { translationStatus } from "@/assets/js/utils.js";
 | 
			
		||||
const route = useRoute();
 | 
			
		||||
const { id } = route.query;
 | 
			
		||||
const info = ref({});
 | 
			
		||||
const platformLevelOptions = [
 | 
			
		||||
  { name: "国家", id: 1 },
 | 
			
		||||
  { name: "省平台", id: 2 },
 | 
			
		||||
  { name: "市平台", id: 3 },
 | 
			
		||||
  { name: "县平台", id: 4 },
 | 
			
		||||
  { name: "园区", id: 5 },
 | 
			
		||||
];
 | 
			
		||||
const frequencyOptions = [
 | 
			
		||||
  { name: "实时", id: 0 },
 | 
			
		||||
  { name: "每日", id: 1 },
 | 
			
		||||
  { name: "每周", id: 2 },
 | 
			
		||||
  { name: "每月", id: 3 },
 | 
			
		||||
];
 | 
			
		||||
const options = [
 | 
			
		||||
  { key: "platformName", label: "平台名称" },
 | 
			
		||||
  { key: "platformCode", label: "平台编码" },
 | 
			
		||||
  { key: "platformLevel", label: "级别" },
 | 
			
		||||
  { key: "area", label: "归属属地" },
 | 
			
		||||
  { key: "url", label: "对接地址" },
 | 
			
		||||
  { key: "platformStatus", label: "状态" },
 | 
			
		||||
  { key: "frequency", label: "推送频率" },
 | 
			
		||||
];
 | 
			
		||||
const fnGetData = async () => {
 | 
			
		||||
  const { data } = await getBusThirdPlatform({ id: id });
 | 
			
		||||
  info.value = data;
 | 
			
		||||
  info.value.area = `${info.value.province},${info.value.city}, ${info.value.county}`;
 | 
			
		||||
};
 | 
			
		||||
fnGetData();
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
<style scoped lang="scss"></style>
 | 
			
		||||
		Loading…
	
		Reference in New Issue