Newer
Older
KaiFengPC / src / views / project / projectConfiguration / xmlxwh / index.vue
@zhangdeliang zhangdeliang on 23 May 3 KB 初始化项目
<template>
  <div class="water-analysis-page" :key="isFlag">
    <div class="top">
      <el-form label-width="auto" ref="ruleForm" inline :model="tableData" v-show="showSearch">
        <el-form-item label="项目类型名称:" prop="projectTypeName">
          <el-input clearable v-model="tableData.projectTypeName" placeholder="请输入项目类型名称" style="width: 240px"></el-input>
        </el-form-item>
        <el-form-item label="是否启用:" prop="status">
          <el-select v-model="tableData.status" placeholder="请选择是否启用" clearable>
            <el-option v-for="dict in showList" :key="dict.stCode" :label="dict.stName" :value="dict.stCode"></el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="所属类型:" prop="ownership">
          <el-select v-model="tableData.ownership" placeholder="请选择所属类型" clearable>
            <el-option v-for="item in ownership" :key="item.value" :label="item.label" :value="item.value" />
          </el-select>
        </el-form-item>
        <el-form-item>
          <el-button type="primary" icon="Search" @click="searchForm"> 查询</el-button>
          <el-button icon="Refresh" @click="resectClcik"> 重置</el-button>
        </el-form-item>
      </el-form>
      <el-row :gutter="10" class="mb8">
        <el-col :span="1.5">
          <el-button type="primary" plain icon="Plus" @click="onCheck(4)" v-hasPermi="['system:post:add']">新增</el-button>
        </el-col>
        <right-toolbar v-model:showSearch="showSearch" @queryTable="searchForm"></right-toolbar>
      </el-row>
    </div>
    <todoDon ref="todoDonRef"></todoDon>
    <el-dialog v-model="visible" title="项目类型新增" :modal-append-to-body="false" :close-on-click-modal="false" width="50%">
      <tableDalgo ref="tableDalgoRef" :typeList="typeList" @onModalClose="onModalClose" :key="isFlag"></tableDalgo>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="primary" @click="submit">保存</el-button>
          <el-button @click="closed">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>
<script setup>
import tableDalgo from './tableDalgo.vue';
import todoDon from './todoDon.vue';
import { formatMonths } from '@/utils';
const todoDonRef = ref(null);

const showList = ref([
  { stName: '否', stCode: 1 },
  { stName: '是', stCode: 0 },
]);
const ruleForm = ref(null);
let typeList = ref({});
const { proxy } = getCurrentInstance();
const { ownership } = proxy.useDict('ownership');
const showSearch = ref(true);
import { reactive } from 'vue';
const activeName = ref('first');
const tableDalgoRef = ref();
let visible = ref(false);
let isFlag = ref(1);
//动态组件
let dataForm = reactive({
  date: formatMonths(new Date()),
  tableData: { pageNum: 1, pageSize: 10 },
  tableDateTwo: '',
  tableLoading: true,
});
let { tableData } = toRefs(dataForm);
//获取列表数据
//切换table
const handleClick = ({ props }, event) => {
  tableData.value.name = props.name;
  todoDonRef.value.search(tableData.value);
};
//搜索
const searchForm = () => {
  todoDonRef.value.search(tableData.value);
};
//重置
function resectClcik() {
  tableData.value = { pageNum: 1, pageSize: 10 };
  todoDonRef.value.search(tableData.value);
}
// 查看上报数据
const onCheck = ty => {
  visible.value = true;
  nextTick(() => {
    tableDalgoRef.value.desertFilds();
  });
};
function onModalClose() {
  visible.value = false;
  todoDonRef.value.search(tableData.value);
}
function submit() {
  tableDalgoRef.value.submit();
}
function closed() {
  visible.value = false;
}
onMounted(() => {
  // getTableData(Date.parse(date.value));
});
</script>
<style lang="scss" scoped>
.water-analysis-page {
  padding: 20px;
  height: 90vh;
}
</style>