Newer
Older
KaiFengPC / src / views / floodSys / assetManage / RiverSaection.vue
@鲁yixuan 鲁yixuan on 19 Aug 8 KB updata
<template>
  <div class="publicContainer">
    <el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch">
      <el-form-item label="断面名称:" prop="searchContent">
        <el-input v-model="queryParams.searchContent" placeholder="请输入断面名称" clearable style="width: 180px" />
      </el-form-item>
      <el-form-item label="所属河道:" prop="fileTag1">
        <el-select v-model="queryParams.fileTag1" placeholder="请选择所属河道" clearable style="width: 100%">
          <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
        </el-select>
      </el-form-item>

      <el-form-item label="目标水质:" prop="fileTag1">
        <el-select v-model="queryParams.fileTag1" placeholder="请选择目标水质" clearable style="width: 100%">
          <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
        </el-select>
      </el-form-item>

      <el-form-item>
        <el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
        <el-button type="primary" icon="Plus" @click="handleAdd">新增</el-button>
        <el-button icon="Refresh" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <!-- 表格 -->
    <el-table :data="dataList" v-loading="loading" stripe :max-height="580">
      <el-table-column type="index" width="55" label="序号" />
      <el-table-column label="断面编码" prop="q" />
      <el-table-column label="断面名称" prop="w" />
      <el-table-column label="所属河道" prop="e" />
      <el-table-column label="断面面积" prop="r" />
      <el-table-column label="断面长度" prop="t" />
      <el-table-column label="断面水质" prop="y" />

      <el-table-column label="设计洪峰流量(m3/s)">
        <el-table-column prop="monthPlan1" label="20%" />
        <el-table-column prop="monthPlan2" label="10%" />
        <el-table-column prop="monthPlan3" label="5%" />
        <el-table-column prop="monthPlan4" label="2%" />
        <el-table-column prop="monthPlan5" label="1%" />
      </el-table-column>

      <el-table-column label="区属" prop="i" />
      <el-table-column label="空间数据" prop="o" />
      <el-table-column label="操作" width="240">
        <template #default="scope">
          <el-button link icon="View" type="primary" @click="handleDetail(scope.row, 'view')">查看</el-button>
          <el-button link type="warning" icon="Edit" @click="handleUpdate(scope.row, 'view')">修改</el-button>
          <el-button link type="danger" icon="Delete" @click="handleDelete(scope.row, 'view')">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <!-- 分页 -->
    <pagination
      v-show="total > 0"
      :total="total"
      v-model:page="queryParams.pageNum"
      v-model:limit="queryParams.pageSize"
      @pagination="getList"
    />
    <!-- 新增弹窗 -->
    <el-dialog :title="title" v-model="open" width="800px" append-to-body :close-on-click-modal="false">
      <el-form ref="roleRef" :model="form" :rules="rules" label-width="130px" :disabled="multiple">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="断面名称:" prop="w">
              <el-input v-model="form.w" placeholder="请输入断面名称" clearable style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="断面编码:" prop="w">
              <el-input v-model="form.w" placeholder="请输入断面编码" clearable style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="所属区属:" prop="fileTag1">
              <el-select v-model="form.fileTag1" placeholder="请选择所属区属" clearable style="width: 100%">
                <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所属河道:" prop="fileTag1">
              <el-select v-model="form.fileTag1" placeholder="请选择水所属河道" clearable style="width: 100%">
                <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="断面面积:" prop="lon">
              <el-input-number v-model="form.lon" placeholder="请输入断面面积" style="width: 100%" controls-position="right" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="断面面积:" prop="lat">
              <el-input-number v-model="form.lat" placeholder="请输入断面面积" style="width: 100%" controls-position="right" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="断面水质:" prop="fileTag1">
              <el-select v-model="form.fileTag1" placeholder="请选择断面水质" clearable style="width: 100%">
                <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="目标水质:" prop="fileTag1">
              <el-select v-model="form.fileTag1" placeholder="请选择目标水质" clearable style="width: 100%">
                <el-option v-for="dict in document_tag" :key="dict.value" :label="dict.label" :value="dict.value" />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="空间数据:" prop="w">
              <el-input type="textarea" v-model="form.w" placeholder="请输入空间数据" clearable style="width: 100%" />
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submitForm">确 定</el-button>
          <el-button @click="cancel">取 消</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup name="RiverSaection">
const { proxy } = getCurrentInstance();
const open = ref(false);
const multiple = ref(false);
const showSearch = ref(true);
const Xcfrequency = ref([
  {
    value: 'tian',
    label: '天',
  },
  {
    value: 'zhou',
    label: '周',
  },
]);
const loading = ref(true);
const total = ref(0);
const title = ref('');
const dataList = ref([]);
const AllData = reactive({
  id: '',
  form: {},
  queryParams: {
    pageNum: 1,
    pageSize: 10,
    caseType: 1,
    handleStatus: '',
    searchContent: '',
  },
  rules: {
    id: [{ required: true, message: '请输入', trigger: 'blur' }],
    eventDescription: [{ required: true, message: '请输入', trigger: 'blur' }],
  },
});
const { queryParams, form, rules } = toRefs(AllData);
//搜索
function handleQuery() {
  getList();
}
//重置
function resetQuery() {
  proxy.resetForm('queryRef');
  handleQuery();
}
// 新增
function handleAdd() {
  title.value = '新增河道断面';
  open.value = true;
  form.value = {};
  multiple.value = false;
  form.value.fileTag = Xcfrequency.value[0].value;
}
// 新增中取消事件
function cancel() {
  open.value = false;
  proxy.resetForm('roleRef');
}

// 巡查频率下拉框点击事件
function changeStation(value) {
  // console.log(value, 'value');
}

//查看详情操作
function handleDetail(row) {
  open.value = true;
  title.value = '查看河道断面';
  multiple.value = true;
  form.value = row;
}
// 修改按钮操作
function handleUpdate(row) {
  open.value = true;
  title.value = '修改河道断面';
  multiple.value = false;
  form.value = { ...row };
}

/** 搜索列表 */
const getList = async () => {
  // loading.value = true;
  loading.value = false;
};

onMounted(() => {
  getList();
});
</script>
<style scoped lang="scss">
.dituclass {
  width: 100%;
  height: 300px;
  // background: red;
  margin-bottom: 10px;
  border: 1px solid #004565;
}
</style>