首页加载速度优化
This commit is contained in:
@@ -102,7 +102,7 @@
|
||||
</select>
|
||||
|
||||
<select id="countByPlanId" parameterType="Long" resultType="int">
|
||||
select count(1) from mill_production_actual where plan_id = #{planId} and del_flag = '0'
|
||||
select count(1) from mill_production_actual where plan_id = #{_parameter} and del_flag = '0'
|
||||
</select>
|
||||
|
||||
<insert id="insertMillProductionActual" parameterType="MillProductionActual" useGeneratedKeys="true" keyProperty="actualId">
|
||||
|
||||
@@ -105,9 +105,13 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getCode();
|
||||
this.getCookie();
|
||||
},
|
||||
mounted() {
|
||||
requestAnimationFrame(() => {
|
||||
this.getCode();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
getCode() {
|
||||
getCodeImg().then(res => {
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<!-- 上方:轧制队列 -->
|
||||
<div class="queue-section">
|
||||
<div class="section-header"><span>轧制队列</span></div>
|
||||
<el-table :data="planList" border size="mini" class="queue-table"
|
||||
<el-table ref="queueTable" :data="planList" border size="mini" class="queue-table"
|
||||
:row-class-name="queueRowClass"
|
||||
@current-change="handleQueueSelect"
|
||||
highlight-current-row
|
||||
@@ -359,6 +359,7 @@ export default {
|
||||
passList: [],
|
||||
recipeOptions: [],
|
||||
query: { inMatNo: '', dateRange: null, hideFinished: false },
|
||||
suppressQueueSelect: false,
|
||||
|
||||
// 编辑模式
|
||||
passEditMode: false,
|
||||
@@ -439,7 +440,18 @@ export default {
|
||||
params.params.endTime = this.query.dateRange[1]
|
||||
}
|
||||
if (!Object.keys(params.params).length) delete params.params
|
||||
listPlan(params).then(res => { this.planList = res.data || [] })
|
||||
listPlan(params).then(res => {
|
||||
const list = res.data || []
|
||||
this.planList = list
|
||||
if (this.selectedPlan && this.selectedPlan.planId != null) {
|
||||
const stillExists = list.some(p => p.planId === this.selectedPlan.planId)
|
||||
if (!stillExists) {
|
||||
this.selectedPlan = null
|
||||
this.passList = []
|
||||
if (this.$refs.queueTable) this.$refs.queueTable.setCurrentRow()
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
resetQuery() {
|
||||
this.query = { inMatNo: '', dateRange: null, hideFinished: false }
|
||||
@@ -448,9 +460,16 @@ export default {
|
||||
|
||||
// ── 队列行点击 ──
|
||||
handleQueueSelect(row) {
|
||||
if (this.suppressQueueSelect) {
|
||||
this.suppressQueueSelect = false
|
||||
return
|
||||
}
|
||||
if (this.passEditMode) {
|
||||
// 正在编辑时禁止切换行
|
||||
this.$message.warning('请先保存或取消当前编辑')
|
||||
this.suppressQueueSelect = true
|
||||
this.$nextTick(() => {
|
||||
if (this.$refs.queueTable) this.$refs.queueTable.setCurrentRow(this.selectedPlan)
|
||||
})
|
||||
return
|
||||
}
|
||||
this.selectedPlan = row
|
||||
|
||||
Reference in New Issue
Block a user