|
@@ -5,10 +5,11 @@ import SubmitBtn from '@com/SubmitBtn.vue'
|
|
|
|
|
|
const queryForm = reactive({
|
|
const queryForm = reactive({
|
|
station: '',
|
|
station: '',
|
|
|
|
+ lineIds: [],
|
|
wtIds: [],
|
|
wtIds: [],
|
|
|
|
+ type: '',
|
|
st: Date.now() - 30 * 24 * 60 * 60 * 1000,
|
|
st: Date.now() - 30 * 24 * 60 * 60 * 1000,
|
|
et: Date.now(),
|
|
et: Date.now(),
|
|
- interval: 3
|
|
|
|
})
|
|
})
|
|
/**场站 */
|
|
/**场站 */
|
|
const stationList = ref([])
|
|
const stationList = ref([])
|
|
@@ -24,17 +25,29 @@ const funStationChange = (stationId) => {
|
|
if (stationId) {
|
|
if (stationId) {
|
|
funGetWind(stationId)
|
|
funGetWind(stationId)
|
|
} else {
|
|
} else {
|
|
|
|
+ queryForm.wtIds = []
|
|
windList.value = []
|
|
windList.value = []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-/**风机 */
|
|
|
|
|
|
+/**项目 */
|
|
const checkAll = ref(true)
|
|
const checkAll = ref(true)
|
|
const windList = ref([])
|
|
const windList = ref([])
|
|
const funGetWind = async (stationId) => {
|
|
const funGetWind = async (stationId) => {
|
|
- const res = await request.get("/base/windturbine", {params: { stationId }})
|
|
|
|
|
|
+ const res = await request.get("/base/project", {params: { stationId }})
|
|
windList.value = res.data
|
|
windList.value = res.data
|
|
queryForm.wtIds = res.data.map(o => o.id)
|
|
queryForm.wtIds = res.data.map(o => o.id)
|
|
checkAll.value = true
|
|
checkAll.value = true
|
|
|
|
+ if (windList.value.length) {
|
|
|
|
+ funGetLine(queryForm.wtIds)
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+const funWindChange = (windArr) => {
|
|
|
|
+ if (windArr?.length) {
|
|
|
|
+ funGetLine(windArr)
|
|
|
|
+ } else {
|
|
|
|
+ queryForm.lineIds = []
|
|
|
|
+ lineList.value = []
|
|
|
|
+ }
|
|
}
|
|
}
|
|
const funCheckAll = () => {
|
|
const funCheckAll = () => {
|
|
checkAll.value = !checkAll.value
|
|
checkAll.value = !checkAll.value
|
|
@@ -44,6 +57,23 @@ const funCheckAll = () => {
|
|
queryForm.wtIds = []
|
|
queryForm.wtIds = []
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+/**期次 */
|
|
|
|
+const checkLineAll = ref(true)
|
|
|
|
+const lineList = ref([])
|
|
|
|
+const funGetLine = async (wtIds) => {
|
|
|
|
+ const res = await request.get("/base/line", {params: { projectId: wtIds.join() }})
|
|
|
|
+ lineList.value = res.data
|
|
|
|
+ queryForm.lineIds = res.data.map(o => o.id)
|
|
|
|
+ checkLineAll.value = true
|
|
|
|
+}
|
|
|
|
+const funCheckLineAll = () => {
|
|
|
|
+ checkLineAll.value = !checkLineAll.value
|
|
|
|
+ if(checkLineAll.value){
|
|
|
|
+ queryForm.lineIds = lineList.value.map(o => o.id)
|
|
|
|
+ }else{
|
|
|
|
+ queryForm.lineIds = []
|
|
|
|
+ }
|
|
|
|
+}
|
|
/**导出 */
|
|
/**导出 */
|
|
const emits = defineEmits(['submit'])
|
|
const emits = defineEmits(['submit'])
|
|
const funSubmit = async () => {
|
|
const funSubmit = async () => {
|
|
@@ -51,24 +81,31 @@ const funSubmit = async () => {
|
|
const endDate = new Date(queryForm.et).setHours(0,0,0,0)
|
|
const endDate = new Date(queryForm.et).setHours(0,0,0,0)
|
|
const query = {
|
|
const query = {
|
|
station: queryForm.station,
|
|
station: queryForm.station,
|
|
- wtIds: queryForm.wtIds.join(),
|
|
|
|
|
|
+ line: queryForm.lineIds.join(),
|
|
|
|
+ project: queryForm.wtIds.join(),
|
|
|
|
+ type: '',
|
|
st: new Date(startDate).getTime(),
|
|
st: new Date(startDate).getTime(),
|
|
et: new Date(endDate).getTime(),
|
|
et: new Date(endDate).getTime(),
|
|
- interval: queryForm.interval
|
|
|
|
- }
|
|
|
|
- switch (queryForm.interval) {
|
|
|
|
- case 2:
|
|
|
|
- query.interval = 60
|
|
|
|
- break;
|
|
|
|
- case 3:
|
|
|
|
- query.interval = 600
|
|
|
|
- break;
|
|
|
|
- case 4:
|
|
|
|
- query.interval = 900
|
|
|
|
- break;
|
|
|
|
}
|
|
}
|
|
emits('submit', query)
|
|
emits('submit', query)
|
|
}
|
|
}
|
|
|
|
+const funType = (type) => {
|
|
|
|
+ const startDate = new Date(queryForm.st).setHours(0,0,0,0)
|
|
|
|
+ const endDate = new Date(queryForm.et).setHours(0,0,0,0)
|
|
|
|
+ queryForm.type = type
|
|
|
|
+ queryForm.station = ''
|
|
|
|
+ queryForm.lineIds = []
|
|
|
|
+ queryForm.wtIds = []
|
|
|
|
+ const query = {
|
|
|
|
+ station: queryForm.station,
|
|
|
|
+ line: queryForm.lineIds.join(),
|
|
|
|
+ project: queryForm.wtIds.join(),
|
|
|
|
+ type: queryForm.type,
|
|
|
|
+ st: new Date(startDate).getTime(),
|
|
|
|
+ et: new Date(endDate).getTime(),
|
|
|
|
+ }
|
|
|
|
+ emits('submit',query)
|
|
|
|
+}
|
|
/**created */
|
|
/**created */
|
|
funGetStation()
|
|
funGetStation()
|
|
</script>
|
|
</script>
|
|
@@ -81,29 +118,32 @@ funGetStation()
|
|
<el-option v-for="item in stationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
<el-option v-for="item in stationList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="风机" class="!mb-0">
|
|
|
|
- <el-select multiple class="w-[150px]" v-model="queryForm.wtIds" @clear="checkAll = false" collapse-tags>
|
|
|
|
|
|
+ <el-form-item label="期次" class="!mb-0">
|
|
|
|
+ <el-select multiple class="w-[150px]" clearable v-model="queryForm.wtIds" @change="funWindChange" @clear="checkAll = false" collapse-tags>
|
|
<el-option label="全选" :class="{'selected': checkAll}" @click="funCheckAll"></el-option>
|
|
<el-option label="全选" :class="{'selected': checkAll}" @click="funCheckAll"></el-option>
|
|
<el-option v-for="item in windList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
<el-option v-for="item in windList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="线路" class="!mb-0">
|
|
|
|
+ <el-select multiple class="w-[150px]" clearable v-model="queryForm.lineIds" @clear="checkLineAll = false" collapse-tags>
|
|
|
|
+ <el-option label="全选" :class="{'selected': checkLineAll}" @click="funCheckLineAll"></el-option>
|
|
|
|
+ <el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id"></el-option>
|
|
|
|
+ </el-select>
|
|
|
|
+ </el-form-item>
|
|
<el-form-item label="开始时间" class="!mb-0">
|
|
<el-form-item label="开始时间" class="!mb-0">
|
|
<el-date-picker type="date" class="!w-[150px]" v-model="queryForm.st"></el-date-picker>
|
|
<el-date-picker type="date" class="!w-[150px]" v-model="queryForm.st"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
<el-form-item label="结束时间" class="!mb-0">
|
|
<el-form-item label="结束时间" class="!mb-0">
|
|
<el-date-picker type="date" class="!w-[150px]" v-model="queryForm.et"></el-date-picker>
|
|
<el-date-picker type="date" class="!w-[150px]" v-model="queryForm.et"></el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
- <el-form-item label="等间隔" class="!mb-0">
|
|
|
|
- <el-radio-group v-model="queryForm.interval">
|
|
|
|
- <el-radio :label="1">一秒钟</el-radio>
|
|
|
|
- <el-radio :label="2">一分钟</el-radio>
|
|
|
|
- <el-radio :label="3">十分钟</el-radio>
|
|
|
|
- <el-radio :label="4">十五分钟</el-radio>
|
|
|
|
- </el-radio-group>
|
|
|
|
- </el-form-item>
|
|
|
|
<el-form-item class="!mb-0">
|
|
<el-form-item class="!mb-0">
|
|
<submit-btn v-prevdbclick:5000="funSubmit" desc="执行"></submit-btn>
|
|
<submit-btn v-prevdbclick:5000="funSubmit" desc="执行"></submit-btn>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item class="!mb-0">
|
|
|
|
+ <submit-btn @click="funType('1')" :type="queryForm.type==='1'? 'primary': 'default'" desc="风场"></submit-btn>
|
|
|
|
+ <submit-btn @click="funType('2')" :type="queryForm.type==='2'? 'primary': 'default'" desc="期次"></submit-btn>
|
|
|
|
+ <submit-btn @click="funType('3')" :type="queryForm.type==='3'? 'primary': 'default'" desc="集电线路"></submit-btn>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|