|
|
@ -39,22 +39,29 @@
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
</el-form>
|
|
|
|
</el-form>
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-row :gutter="10" class="mb8">
|
|
|
|
<el-button type="primary" icon="Plus" @click="toAdd">新增基地/资源圃</el-button>
|
|
|
|
<el-button type="primary" @click="exportExcel">导出Excel</el-button>
|
|
|
|
<el-button type="primary" icon="Download" @click="exportExcel">导出Excel</el-button>
|
|
|
|
<el-button type="primary" @click="toAdd" plain>新增基地/资源圃</el-button>
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList" :columns="columns"></right-toolbar>
|
|
|
|
</el-row>
|
|
|
|
</el-row>
|
|
|
|
|
|
|
|
|
|
|
|
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange" border>
|
|
|
|
<el-table v-loading="loading" :data="tableList" @selection-change="handleSelectionChange">
|
|
|
|
<el-table-column type="selection" width="50" align="center" />
|
|
|
|
<el-table-column label="基地/资源圃名称" align="center" key="baseName" prop="baseName"
|
|
|
|
<el-table-column label="基地/资源圃名称" align="center" key="baseName" prop="baseName" v-if="columns[0].visible" />
|
|
|
|
v-if="columns[0].visible"/>
|
|
|
|
<el-table-column label="基地类型" align="center" key="baseType" prop="baseTypeName" v-if="columns[1].visible" :show-overflow-tooltip="true" >
|
|
|
|
<el-table-column label="基地类型" align="center" key="baseType" prop="baseTypeName" v-if="columns[1].visible"
|
|
|
|
|
|
|
|
:show-overflow-tooltip="true">
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="所属省份" align="center" key="administrativeDivisionName" prop="administrativeDivisionName" v-if="columns[2].visible" :show-overflow-tooltip="true" />
|
|
|
|
<el-table-column label="所属省份" align="center" key="administrativeDivisionName"
|
|
|
|
<el-table-column label="地理位置" align="center" key="position" prop="dept.position" v-if="columns[3].visible" :show-overflow-tooltip="true" />
|
|
|
|
prop="administrativeDivisionName" v-if="columns[2].visible" :show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="战地面积(亩)" align="center" key="area" prop="area" v-if="columns[4].visible" width="120" />
|
|
|
|
<el-table-column label="地理位置" align="center" key="position" prop="dept.position" v-if="columns[3].visible"
|
|
|
|
<el-table-column label="基地坐标(经度)" align="center" key="longitude" prop="longitude" v-if="columns[5].visible" width="120" />
|
|
|
|
:show-overflow-tooltip="true"/>
|
|
|
|
<el-table-column label="基地坐标(纬度)" align="center" key="latitude" prop="latitude" v-if="columns[6].visible"></el-table-column>
|
|
|
|
<el-table-column label="战地面积(亩)" align="center" key="area" prop="area" v-if="columns[4].visible"
|
|
|
|
<el-table-column label="创建人" align="center" prop="createUserName" v-if="columns[7].visible" width="160"></el-table-column>
|
|
|
|
width="120"/>
|
|
|
|
|
|
|
|
<el-table-column label="基地坐标(经度)" align="center" key="longitude" prop="longitude"
|
|
|
|
|
|
|
|
v-if="columns[5].visible" width="120"/>
|
|
|
|
|
|
|
|
<el-table-column label="基地坐标(纬度)" align="center" key="latitude" prop="latitude"
|
|
|
|
|
|
|
|
v-if="columns[6].visible"></el-table-column>
|
|
|
|
|
|
|
|
<el-table-column label="创建人" align="center" prop="createUserName" v-if="columns[7].visible"
|
|
|
|
|
|
|
|
width="160"></el-table-column>
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[8].visible" width="160">
|
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" v-if="columns[8].visible" width="160">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
|
<span>{{ parseTime(scope.row.createTime) }}</span>
|
|
|
@ -62,15 +69,9 @@
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
|
|
|
<el-table-column label="操作" align="center" width="150" class-name="small-padding fixed-width">
|
|
|
|
<template #default="scope">
|
|
|
|
<template #default="scope">
|
|
|
|
<el-tooltip content="详情" placement="top">
|
|
|
|
<el-link type="info" @click="handleView(scope.row)">详情</el-link>
|
|
|
|
<el-button link type="primary" @click="handleView(scope.row)">详情</el-button>
|
|
|
|
<el-link type="primary" @click="handleUpdate(scope.row)" class="operate-edit">修改</el-link>
|
|
|
|
</el-tooltip>
|
|
|
|
<el-link type="danger" @click="delBreedingBase(scope.row)">删除</el-link>
|
|
|
|
<el-tooltip content="修改" placement="top">
|
|
|
|
|
|
|
|
<el-button link type="primary" @click="handleUpdate(scope.row)">修改</el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
<el-tooltip content="删除" placement="top">
|
|
|
|
|
|
|
|
<el-button link type="primary" @click="delBreedingBase(scope.row)">删除</el-button>
|
|
|
|
|
|
|
|
</el-tooltip>
|
|
|
|
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</el-table-column>
|
|
|
|
</el-table-column>
|
|
|
|
<template #empty>
|
|
|
|
<template #empty>
|
|
|
@ -105,7 +106,7 @@ import dayjs from "dayjs";
|
|
|
|
// 表单绑定
|
|
|
|
// 表单绑定
|
|
|
|
const breedingBaseFormRef = ref(null)
|
|
|
|
const breedingBaseFormRef = ref(null)
|
|
|
|
const router = useRouter();
|
|
|
|
const router = useRouter();
|
|
|
|
const { proxy } = getCurrentInstance();
|
|
|
|
const {proxy} = getCurrentInstance();
|
|
|
|
const tableList = ref([]);
|
|
|
|
const tableList = ref([]);
|
|
|
|
const loading = ref(false);
|
|
|
|
const loading = ref(false);
|
|
|
|
const showSearch = ref(true);
|
|
|
|
const showSearch = ref(true);
|
|
|
@ -115,20 +116,20 @@ const multiple = ref(true);
|
|
|
|
const total = ref(0);
|
|
|
|
const total = ref(0);
|
|
|
|
// 列显隐信息
|
|
|
|
// 列显隐信息
|
|
|
|
const columns = ref([
|
|
|
|
const columns = ref([
|
|
|
|
{ key: 0, label: `基地/资源圃名称`, visible: true },
|
|
|
|
{key: 0, label: `基地/资源圃名称`, visible: true},
|
|
|
|
{ key: 1, label: `基地类型`, visible: true },
|
|
|
|
{key: 1, label: `基地类型`, visible: true},
|
|
|
|
{ key: 2, label: `所属省份`, visible: true },
|
|
|
|
{key: 2, label: `所属省份`, visible: true},
|
|
|
|
{ key: 3, label: `地里位置`, visible: true },
|
|
|
|
{key: 3, label: `地里位置`, visible: true},
|
|
|
|
{ key: 4, label: `占地面积`, visible: true },
|
|
|
|
{key: 4, label: `占地面积`, visible: true},
|
|
|
|
{ key: 5, label: `基地坐标(经度)`, visible: true },
|
|
|
|
{key: 5, label: `基地坐标(经度)`, visible: true},
|
|
|
|
{ key: 6, label: `基地坐标(纬度)`, visible: true },
|
|
|
|
{key: 6, label: `基地坐标(纬度)`, visible: true},
|
|
|
|
{ key: 7, label: `创建人`, visible: true },
|
|
|
|
{key: 7, label: `创建人`, visible: true},
|
|
|
|
{ key: 8, label: `创建时间`, visible: true },
|
|
|
|
{key: 8, label: `创建时间`, visible: true},
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
const exportExcel = () => {
|
|
|
|
const exportExcel = () => {
|
|
|
|
proxy.download("/baseNurseryInfo/export", {
|
|
|
|
proxy.download("/baseNurseryInfo/export", {
|
|
|
|
...queryParams.value,
|
|
|
|
...queryParams.value,
|
|
|
|
},`智能育种基地/种质资源圃列表-${dayjs().format('YYYY年MM月DD日')}.xlsx`);
|
|
|
|
}, `智能育种基地/种质资源圃列表-${dayjs().format('YYYY年MM月DD日')}.xlsx`);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const data = reactive({
|
|
|
|
const data = reactive({
|
|
|
|
form: {},
|
|
|
|
form: {},
|
|
|
@ -139,15 +140,15 @@ const data = reactive({
|
|
|
|
baseType: undefined,
|
|
|
|
baseType: undefined,
|
|
|
|
administrativeDivisionId: undefined
|
|
|
|
administrativeDivisionId: undefined
|
|
|
|
},
|
|
|
|
},
|
|
|
|
provincesOptions:provinceAndCityData.map((item) => {
|
|
|
|
provincesOptions: provinceAndCityData.map((item) => {
|
|
|
|
return {
|
|
|
|
return {
|
|
|
|
value:Number(item.value),
|
|
|
|
value: Number(item.value),
|
|
|
|
label: item.label
|
|
|
|
label: item.label
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}),
|
|
|
|
}),
|
|
|
|
baseTypeOptions:[
|
|
|
|
baseTypeOptions: [
|
|
|
|
{ label: '智能育种基地', value: 1},
|
|
|
|
{label: '智能育种基地', value: 1},
|
|
|
|
{ label: '种质资源圃', value: 2}
|
|
|
|
{label: '种质资源圃', value: 2}
|
|
|
|
]
|
|
|
|
]
|
|
|
|
});
|
|
|
|
});
|
|
|
|
// 删除育种基地
|
|
|
|
// 删除育种基地
|
|
|
@ -168,10 +169,10 @@ const delBreedingBase = (item) => {
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// 提交成功回调
|
|
|
|
// 提交成功回调
|
|
|
|
const submitSuccess = (value) =>{
|
|
|
|
const submitSuccess = (value) => {
|
|
|
|
getList()
|
|
|
|
getList()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const { queryParams, form,} = toRefs(data);
|
|
|
|
const {queryParams, form,} = toRefs(data);
|
|
|
|
|
|
|
|
|
|
|
|
/** 查询列表 */
|
|
|
|
/** 查询列表 */
|
|
|
|
function getList() {
|
|
|
|
function getList() {
|
|
|
@ -179,32 +180,37 @@ function getList() {
|
|
|
|
selBreedingBasePage(queryParams.value).then(res => {
|
|
|
|
selBreedingBasePage(queryParams.value).then(res => {
|
|
|
|
tableList.value = res.rows;
|
|
|
|
tableList.value = res.rows;
|
|
|
|
total.value = res.total;
|
|
|
|
total.value = res.total;
|
|
|
|
}).finally(()=>{
|
|
|
|
}).finally(() => {
|
|
|
|
loading.value = false;
|
|
|
|
loading.value = false;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
/** 搜索按钮操作 */
|
|
|
|
function handleQuery() {
|
|
|
|
function handleQuery() {
|
|
|
|
queryParams.value.pageNum = 1;
|
|
|
|
queryParams.value.pageNum = 1;
|
|
|
|
getList();
|
|
|
|
getList();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
/** 重置按钮操作 */
|
|
|
|
function resetQuery() {
|
|
|
|
function resetQuery() {
|
|
|
|
proxy.resetForm("queryRef");
|
|
|
|
proxy.resetForm("queryRef");
|
|
|
|
handleQuery();
|
|
|
|
handleQuery();
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
function handleExport() {
|
|
|
|
function handleExport() {
|
|
|
|
proxy.download("system/user/export", {
|
|
|
|
proxy.download("system/user/export", {
|
|
|
|
...queryParams.value,
|
|
|
|
...queryParams.value,
|
|
|
|
},`user_${new Date().getTime()}.xlsx`);
|
|
|
|
}, `user_${new Date().getTime()}.xlsx`);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 选择条数 */
|
|
|
|
/** 选择条数 */
|
|
|
|
function handleSelectionChange(selection) {
|
|
|
|
function handleSelectionChange(selection) {
|
|
|
|
ids.value = selection.map(item => item.id);
|
|
|
|
ids.value = selection.map(item => item.id);
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
single.value = selection.length != 1;
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
multiple.value = !selection.length;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
/** 修改按钮操作 */
|
|
|
|
function handleUpdate(row) {
|
|
|
|
function handleUpdate(row) {
|
|
|
|
breedingBaseFormRef.value.toUpdate(row)
|
|
|
|
breedingBaseFormRef.value.toUpdate(row)
|
|
|
@ -215,19 +221,21 @@ const handleView = (row) => {
|
|
|
|
const toAdd = () => {
|
|
|
|
const toAdd = () => {
|
|
|
|
breedingBaseFormRef.value.toAdd()
|
|
|
|
breedingBaseFormRef.value.toAdd()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
onMounted(()=>{
|
|
|
|
onMounted(() => {
|
|
|
|
getList()
|
|
|
|
getList()
|
|
|
|
})
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
</script>
|
|
|
|
<style scoped lang="scss">
|
|
|
|
<style scoped lang="scss">
|
|
|
|
.base-title{
|
|
|
|
.base-title {
|
|
|
|
margin: 10px 0;
|
|
|
|
margin: 10px 0;
|
|
|
|
.handoff-model{
|
|
|
|
|
|
|
|
|
|
|
|
.handoff-model {
|
|
|
|
padding-right: 20px;
|
|
|
|
padding-right: 20px;
|
|
|
|
text-align: right;
|
|
|
|
text-align: right;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
.el-form-item{
|
|
|
|
|
|
|
|
|
|
|
|
.el-form-item {
|
|
|
|
width: 100%;
|
|
|
|
width: 100%;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|