From a07f90d6106971923e8f761f253a9b4d30a60752 Mon Sep 17 00:00:00 2001 From: CD配唱片 <CD配唱片> Date: 星期二, 06 五月 2025 15:37:30 +0800 Subject: [PATCH] Merge branch 'feature-i18n' into dev --- src/views/mainPlan/gasPlanning/index.vue | 183 +++++++++++++++++++++++---------------------- 1 files changed, 92 insertions(+), 91 deletions(-) diff --git a/src/views/mainPlan/gasPlanning/index.vue b/src/views/mainPlan/gasPlanning/index.vue index dba85ad..07687c0 100644 --- a/src/views/mainPlan/gasPlanning/index.vue +++ b/src/views/mainPlan/gasPlanning/index.vue @@ -5,17 +5,18 @@ :model="queryParams" ref="queryRef" :inline="true" - label-width="68px" + label-width="100px" + label-position="left" > <el-row type="flex" justify="left"> <el-col :span="6"> - <el-form-item label="閫夋嫨鏈堜唤" prop="description"> + <el-form-item :label="$t('plan.query.selectMonth')" prop="description"> <el-date-picker clearable v-model="queryParams.date" type="month" value-format="YYYY-MM" - placeholder="閫夋嫨鏈堜唤" + :placeholder="$t('plan.query.selectMonth')" > </el-date-picker> </el-form-item> @@ -23,9 +24,9 @@ <el-col :span="18" style="text-align: right"> <el-form-item class="column-with-margin"> <el-button type="primary" icon="Search" @click="handleQuery" - >鏌ヨ</el-button + >{{$t("common.common.query")}}</el-button > - <el-button icon="Refresh" @click="resetQuery">閲嶇疆</el-button> + <el-button icon="Refresh" @click="resetQuery">{{$t("common.common.reset")}}</el-button> </el-form-item> </el-col> </el-row> @@ -33,13 +34,13 @@ <div class="box_container"> <el-row> <el-col :span="!clickedTableRef?22:20"> - <div class="title_text">绠¤矾瑙勫垝浜ц兘</div> + <div class="title_text">{{$t('plan.title.pipePlanCapacity')}}</div> </el-col> <el-col :span="1" v-if="!clickedTableRef"> <el-button class="title_btn" type="default" - @click="editRowEvent" >缂栬緫</el-button> + @click="editRowEvent" >{{$t("common.common.edit")}}</el-button> </el-col> <el-col :span="1.8" v-if="clickedTableRef"> <el-button @@ -48,14 +49,14 @@ @click="saveRowEvent" v-hasPermi="['aps:gasPipelineCapacityPlan:add']" > - 淇濆瓨 + {{$t("common.common.save")}} </el-button> </el-col> <el-col :span="1" v-if="clickedTableRef"> <el-button class="title_btn ml20" type="default" - @click="handleCancleStaus">鍙栨秷</el-button> + @click="handleCancleStaus">{{$t("common.common.cancel")}}</el-button> </el-col> </el-row> @@ -82,16 +83,16 @@ show-overflow :loading="loading" :height="height" - :edit-config="{ trigger: 'click', mode: 'row', showStatus: true }" + :column-config="{ resizable: true, useKey: true }" :data="routePlanList" size="small" > - <vxe-column field="processName" title="鏍囧噯宸ュ簭鍚嶇О" min-width="150" fixed="left"> + <vxe-column field="processName" :width="locale === 'zh' ? '150px' : '200px'" :title="$t('plan.table.satndardProcessName')" fixed="left"> </vxe-column> <vxe-column + :width="locale === 'zh' ? '150px' : '200px'" field="dayProduceType" - title="鏃ヤ骇鍑虹被鍨�" - min-width="160" + :title="$t('plan.table.dayProduceType')" > <!-- <template #edit="{ row }"> <el-select @@ -131,9 +132,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="dayProduceNum" - title="鏃ヤ骇鍑烘暟閲�" - min-width="200" + :title="$t('plan.table.dayProduceNum')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.dayProduceNum" size="mini" /> @@ -148,9 +149,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '150px' : '200px'" field="dayProduceUnit" - title="鏃ヤ骇鍑哄崟浣�" - min-width="200" + :title="$t('plan.table.dayProduceUnit')" > <!-- <template #edit="{ row }"> <el-input v-model="row.dayProduceUnit" /> @@ -165,9 +166,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="personnelNumber" - title="浜哄憳鏁伴噺" - min-width="200" + :title="$t('plan.table.personnelNumber')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.personnelNumber" /> @@ -182,9 +183,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="dayProduceAllNum" - title="鏃ヤ骇鍑烘�绘暟閲�" - min-width="200" + :title="$t('plan.table.dayProduceAllNum')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.dayProduceAllNum" disabled /> @@ -199,9 +200,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="days" - title="澶╂暟" - min-width="200" + :title="$t('plan.table.days')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.days" /> @@ -216,9 +217,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="monthProduceAllNum" - title="鏈堜骇鍑烘暟閲�" - min-width="200" + :title="$t('plan.table.monthProduceAllNum')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.monthProduceAllNum" disabled /> @@ -233,9 +234,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '150px' : '200px'" field="remark" - title="澶囨敞" - min-width="200" + :title="$t('plan.table.remark')" > <!-- :edit-render="{ autoFocus: 'input' }" --> <!-- <template #edit="{ row }"> @@ -277,13 +278,13 @@ <div class="box_container"> <el-row> <el-col :span="!clickedTableRefGas?22:20"> - <div class="title_text">姘旀煖瑙勫垝浜ц兘</div> + <div class="title_text">{{$t("plan.title.gasPlanCapacity")}}</div> </el-col> <el-col :span="1" v-if="!clickedTableRefGas"> <el-button class="title_btn" type="default" - @click="editRowEventGas" >缂栬緫</el-button> + @click="editRowEventGas" >{{$t("common.common.edit")}}</el-button> </el-col> <el-col :span="1.8" v-if="clickedTableRefGas"> <el-button @@ -292,14 +293,14 @@ @click="saveRowEvent1" v-hasPermi="['aps:gasPipelineCapacityPlan:add']" > - 淇濆瓨 + {{$t("common.common.save")}} </el-button> </el-col> <el-col :span="1" v-if="clickedTableRefGas"> <el-button class="title_btn ml20" type="default" - @click="handleCancleStausGas">鍙栨秷</el-button> + @click="handleCancleStausGas">{{$t("common.common.cancel")}}</el-button> </el-col> </el-row> <div class="tabel_container"> @@ -318,15 +319,15 @@ size="small" :loading="loading2" :height="height" - :edit-config="{ mode: 'row', trigger: 'click', showStatus: true }" + :column-config="{ resizable: true, useKey: true }" :data="gasPlanList" > - <vxe-column field="processName" title="鏍囧噯宸ュ簭鍚嶇О" min-width="150" fixed="left"> + <vxe-column :width="locale === 'zh' ? '150px' : '200px'" field="processName" :title="$t('plan.table.satndardProcessName')" fixed="left"> </vxe-column> <vxe-column + :width="locale === 'zh' ? '150px' : '200px'" field="dayProduceType" - title="鏃ヤ骇鍑虹被鍨�" - min-width="160" + :title="$t('plan.table.dayProduceType')" > <!-- <template #edit="{ row }"> <el-select @@ -366,9 +367,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="dayProduceNum" - title="鏃ヤ骇鍑烘暟閲�" - min-width="200" + :title="$t('plan.table.dayProduceNum')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.dayProduceNum" size="mini" /> @@ -383,9 +384,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '150px' : '200px'" field="dayProduceUnit" - title="鏃ヤ骇鍑哄崟浣�" - min-width="200" + :title="$t('plan.table.dayProduceUnit')" > <!-- <template #edit="{ row }"> <el-input v-model="row.dayProduceUnit" /> @@ -400,9 +401,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="personnelNumber" - title="浜哄憳鏁伴噺" - min-width="200" + :title="$t('plan.table.personnelNumber')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.personnelNumber" /> @@ -417,9 +418,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="dayProduceAllNum" - title="鏃ヤ骇鍑烘�绘暟閲�" - min-width="200" + :title="$t('plan.table.dayProduceAllNum')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.dayProduceAllNum" disabled /> @@ -434,9 +435,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="days" - title="澶╂暟" - min-width="200" + :title="$t('plan.table.days')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.days" /> @@ -451,9 +452,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '180px' : '200px'" field="monthProduceAllNum" - title="鏈堜骇鍑烘暟閲�" - min-width="200" + :title="$t('plan.table.monthProduceAllNum')" > <!-- <template #edit="{ row }"> <el-input-number v-model="row.monthProduceAllNum" disabled /> @@ -468,9 +469,9 @@ </template> </vxe-column> <vxe-column + :width="locale === 'zh' ? '150px' : '200px'" field="remark" - title="澶囨敞" - min-width="200" + :title="$t('plan.table.remark')" > <!-- <template #edit="{ row }"> <el-input @@ -517,6 +518,8 @@ import { ElMessage } from "element-plus"; import { listGasPlan, getGasPlanSave } from "@/api/mainPlan/gasPlanning"; const height = ref(document.documentElement.clientHeight - 400 + "px;"); +import { useI18n } from "vue-i18n"; //瑕佸湪js涓娇鐢ㄥ浗闄呭寲 +const { t, locale } = useI18n(); const loading = ref(false); const loading2 = ref(false); const clickedQuery = ref(false); @@ -644,7 +647,7 @@ const $table = tableRef.value; if ($table) { $table.clearEdit().then(() => { - // loading.value = true + loading.value = true // setTimeout(() => { // loading.value = false // VxeUI.modal.message({ content: `淇濆瓨鎴愬姛锛乶ame=${row.name}`, status: 'success' }) @@ -722,12 +725,12 @@ // } // }; async function getRouteList(year, month) { + loading.value = true; const res = await listGasPlan({ major: "绠¤矾", year, month, }); - console.log(res.rows, "getList"); routePlanList.value = res.rows; routePlanList.value = routePlanList.value.map((item, index) => { return { @@ -753,6 +756,7 @@ loading.value = false; } async function getGasList(year, month) { + loading2.value = true; const res = await listGasPlan({ major: "姘旀煖", year, @@ -793,7 +797,6 @@ // row.monthProduceAllNum = row.dayProduceAllNum * row.days; // } function cellClickEvent(e, row) { - console.log(row,"cellClickEvent") if(row.dayProduceType==="1"){ row.dayProduceAllNum = row.dayProduceNum * row.personnelNumber; }else{ @@ -863,47 +866,45 @@ message: "鏁版嵁淇濆瓨鎴愬姛", type: "success", }); + loading.value = false; + loading2.value = false; handleQuery(); } -async function handleSave2(row) { - const year = queryParams.value.date.split("-")[0]; - const month = parseInt(queryParams.value.date.split("-")[1]); - console.log(row, "baocun"); - // gasPlanList.value = gasPlanList.value.map((item) => { - // return { - // ...item, - // major: "姘斾綋", - // year, - // month, - // }; - // }); - // routePlanList.value = routePlanList.value.map((item) => { - // return { - // ...item, - // major: "绠¤矾", - // year, - // month, - // }; - // }); - const res = await getGasPlanSave([ - { - ...row, - major: "姘旀煖", - year, - month, - }, - ]); - ElMessage({ - message: "鏁版嵁淇濆瓨鎴愬姛", - type: "success", - }); - handleQuery(); - console.log(res, "akiwjciwj"); -} -onMounted(() => { - // getRouteList(); - // getGasList(); -}); +// async function handleSave2(row) { +// const year = queryParams.value.date.split("-")[0]; +// const month = parseInt(queryParams.value.date.split("-")[1]); +// console.log(row, "baocun"); +// // gasPlanList.value = gasPlanList.value.map((item) => { +// // return { +// // ...item, +// // major: "姘斾綋", +// // year, +// // month, +// // }; +// // }); +// // routePlanList.value = routePlanList.value.map((item) => { +// // return { +// // ...item, +// // major: "绠¤矾", +// // year, +// // month, +// // }; +// // }); +// const res = await getGasPlanSave([ +// { +// ...row, +// major: "姘旀煖", +// year, +// month, +// }, +// ]); +// ElMessage({ +// message: "鏁版嵁淇濆瓨鎴愬姛", +// type: "success", +// }); +// handleQuery(); +// console.log(res, "akiwjciwj"); +// } </script> <style lang="scss" scoped> .box_container { -- Gitblit v1.9.3