|
|
|
|
@ -25,38 +25,45 @@ |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>明细</el-button |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
@click="showDetail(row)" |
|
|
|
|
v-if="tabPosition == 'recorder' && detailsPermission" |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>删除</el-button |
|
|
|
|
明细 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)" v-if="currentEditPermission"> |
|
|
|
|
修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
@click="deleteRow(row)" |
|
|
|
|
v-if="tabPosition == 'recorder' && currentDeletePermission" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<!-- <el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
@click="handleAdd" |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>新增</el-button |
|
|
|
|
> --> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="setCycle" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
>打包周期配置</el-button |
|
|
|
|
v-if="tabPosition == 'recorder' && packagingCycleSettingPermission" |
|
|
|
|
> |
|
|
|
|
打包周期配置 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete" |
|
|
|
|
plain |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>删除</el-button |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting' && currentDeletePermission" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
@ -77,34 +84,52 @@ |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@sort-change="sortChange" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
> |
|
|
|
|
<template #menu="{ row, index, size }"> |
|
|
|
|
<el-button type="text" @click="showDetail(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>明细</el-button |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
@click="showDetail(row)" |
|
|
|
|
v-if="tabPosition == 'recorder' && detailsPermission" |
|
|
|
|
> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)">修改</el-button> |
|
|
|
|
<el-button type="text" @click="deleteRow(row)" v-if="tabPosition == 'recorder'" |
|
|
|
|
>删除</el-button |
|
|
|
|
明细 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="text" @click="rowEdit(row, index)" v-if="currentEditPermission"> |
|
|
|
|
修改 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="text" |
|
|
|
|
@click="deleteRow(row)" |
|
|
|
|
v-if="tabPosition == 'recorder' && currentDeletePermission" |
|
|
|
|
> |
|
|
|
|
删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template #menu-left> |
|
|
|
|
<el-button type="primary" @click="handleAdd" v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>新增</el-button |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
@click="handleAdd" |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting' && currentAddPermission" |
|
|
|
|
> |
|
|
|
|
新增 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="primary" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="setCycle" |
|
|
|
|
v-if="tabPosition == 'recorder'" |
|
|
|
|
>打包周期配置</el-button |
|
|
|
|
v-if="tabPosition == 'recorder' && packagingCycleSettingPermission" |
|
|
|
|
> |
|
|
|
|
打包周期配置 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button |
|
|
|
|
type="danger" |
|
|
|
|
@click="handleDelete" |
|
|
|
|
plain |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting'" |
|
|
|
|
>批量删除</el-button |
|
|
|
|
v-if="tabPosition == 'recorderLineSetting' && currentDeletePermission" |
|
|
|
|
> |
|
|
|
|
批量删除 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
|
|
|
|
|
@ -303,6 +328,7 @@ import { |
|
|
|
|
getRecorderHistoryLine, |
|
|
|
|
getRecorderHistoryDetail, |
|
|
|
|
} from '@/api/equiptManagement/recorderList'; |
|
|
|
|
import { mapGetters } from 'vuex'; |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
@ -319,6 +345,7 @@ export default { |
|
|
|
|
loading: false, |
|
|
|
|
data: [], |
|
|
|
|
form: {}, |
|
|
|
|
query: {}, |
|
|
|
|
lineForm: { |
|
|
|
|
settingData: [], |
|
|
|
|
}, |
|
|
|
|
@ -491,6 +518,65 @@ export default { |
|
|
|
|
}, |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
computed: { |
|
|
|
|
...mapGetters(['permission']), |
|
|
|
|
permissionList() { |
|
|
|
|
// 根据当前tab页签返回对应的权限 |
|
|
|
|
if (this.tabPosition === 'recorder') { |
|
|
|
|
// 记录仪权限 |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.recorderList1_add, false), |
|
|
|
|
viewBtn: this.validData(this.permission.recorderList1_view, false), |
|
|
|
|
delBtn: this.validData(this.permission.recorderList1_del, false), |
|
|
|
|
editBtn: this.validData(this.permission.recorderList1_edit, false), |
|
|
|
|
}; |
|
|
|
|
} else if (this.tabPosition === 'recorderLineSetting') { |
|
|
|
|
// 记录仪曲线配置权限 |
|
|
|
|
return { |
|
|
|
|
addBtn: this.validData(this.permission.recorderList2_add, false), |
|
|
|
|
viewBtn: this.validData(this.permission.recorderList2_view, false), |
|
|
|
|
delBtn: this.validData(this.permission.recorderList2_del, false), |
|
|
|
|
editBtn: this.validData(this.permission.recorderList2_edit, false), |
|
|
|
|
}; |
|
|
|
|
} |
|
|
|
|
return {}; |
|
|
|
|
}, |
|
|
|
|
currentDeletePermission() { |
|
|
|
|
// 当前tab页签对应的删除权限 |
|
|
|
|
if (this.tabPosition === 'recorder') { |
|
|
|
|
return this.validData(this.permission.recorderList1_del, false); |
|
|
|
|
} else if (this.tabPosition === 'recorderLineSetting') { |
|
|
|
|
return this.validData(this.permission.recorderList2_del, false); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
currentAddPermission() { |
|
|
|
|
// 当前tab页签对应的新增权限 |
|
|
|
|
if (this.tabPosition === 'recorder') { |
|
|
|
|
return this.validData(this.permission.recorderList1_add, false); |
|
|
|
|
} else if (this.tabPosition === 'recorderLineSetting') { |
|
|
|
|
return this.validData(this.permission.recorderList2_add, false); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
currentEditPermission() { |
|
|
|
|
// 当前tab页签对应的修改权限 |
|
|
|
|
if (this.tabPosition === 'recorder') { |
|
|
|
|
return this.validData(this.permission.recorderList1_edit, false); |
|
|
|
|
} else if (this.tabPosition === 'recorderLineSetting') { |
|
|
|
|
return this.validData(this.permission.recorderList2_edit, false); |
|
|
|
|
} |
|
|
|
|
return false; |
|
|
|
|
}, |
|
|
|
|
detailsPermission() { |
|
|
|
|
// 记录仪明细权限 |
|
|
|
|
return this.validData(this.permission.recorderList1_details, false); |
|
|
|
|
}, |
|
|
|
|
packagingCycleSettingPermission() { |
|
|
|
|
// 打包周期配置权限 |
|
|
|
|
return this.validData(this.permission.recorderList1_packagingCycleSetting, false); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
mounted() { |
|
|
|
|
this.tabPositionChange('recorder'); |
|
|
|
|
// this.option.column = recorderColumnData[this.tabPosition]; |
|
|
|
|
@ -660,6 +746,34 @@ export default { |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
// 排序 |
|
|
|
|
sortChange({ prop, order }) { |
|
|
|
|
if (this.tabPosition === 'recorder') { |
|
|
|
|
this.query.descs = undefined; |
|
|
|
|
this.query.ascs = undefined; |
|
|
|
|
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs'; |
|
|
|
|
this.query[orderByFieldKey] = !prop |
|
|
|
|
? undefined |
|
|
|
|
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
} else if (this.tabPosition === 'recorderLineSetting') { |
|
|
|
|
this.lineQuery.descs = undefined; |
|
|
|
|
this.lineQuery.ascs = undefined; |
|
|
|
|
let orderByFieldKey = order === 'descending' ? 'descs' : 'ascs'; |
|
|
|
|
this.lineQuery[orderByFieldKey] = !prop |
|
|
|
|
? undefined |
|
|
|
|
: prop.replace(/([a-z])([A-Z0-9])/g, '$1_$2').toUpperCase(); |
|
|
|
|
} |
|
|
|
|
// 重新加载数据 |
|
|
|
|
this.refreshChange(); |
|
|
|
|
}, |
|
|
|
|
// 刷新 |
|
|
|
|
refreshChange() { |
|
|
|
|
if (this.tabPosition === 'recorder') { |
|
|
|
|
this.getRecorder(); |
|
|
|
|
} else if (this.tabPosition === 'recorderLineSetting') { |
|
|
|
|
this.getRecorderLine(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
setEchart(data) { |
|
|
|
|
if (data.xData.length == 0 || data.yArray.length == 0) { |
|
|
|
|
return this.$message.warning('暂无数据'); |
|
|
|
|
|