From 32fb9980dfcbd8e2ff68fc0c8089b92ff2c674a5 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期五, 05 九月 2025 17:17:31 +0800 Subject: [PATCH] 样式居中 --- src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue | 357 +++++++++++++++++++++++++++++++--------------------------- 1 files changed, 191 insertions(+), 166 deletions(-) diff --git a/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue b/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue index ddcaee3..5da0af0 100644 --- a/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue +++ b/src/views/eam/base/modules/EamMaintenanceStandardDetailList.vue @@ -4,178 +4,203 @@ </template> <script> - import { JeecgListMixin } from '@/mixins/JeecgListMixin' - import { getAction } from '@api/manage' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import { getAction } from '@api/manage' - export default { - name: 'EamMaintenanceStandardDetailList', - mixins: [JeecgListMixin], - props: { - standardId: { - type: String, - required: true, - default: '-1' - }, - pageSelectionRow: { - type: Object, - default: () => { - } - }, - filterKey: { - type: String, - default: '' +export default { + name: 'EamMaintenanceStandardDetailList', + mixins: [JeecgListMixin], + props: { + standardId: { + type: String, + required: true, + default: '-1' + }, + pageSelectionRow: { + type: Object, + default: () => { } }, - data() { - return { - description: '淇濆吇鏍囧噯鏄庣粏绠$悊椤甸潰', - // 琛ㄥご - columns: [], - inspectionColumns: [ - { - title: '搴忓彿', - align: 'center', - dataIndex: 'itemCode', - width: 60 - }, - { - title: '淇濆吇椤瑰垎绫�', - align: 'center', - dataIndex: 'itemCategory_dictText', - width: 150 - }, - { - title: '淇濆吇椤圭洰', - align: 'center', - dataIndex: 'itemName', - ellipsis: true - }, - { - title: '淇濆吇瑙勮寖鎴栬姹�', - align: 'center', - dataIndex: 'itemDemand', - ellipsis: true - } - ], - secondMaintenanceColumns: [ - { - title: '搴忓彿', - align: 'center', - dataIndex: 'itemCode', - width: 60 - }, - { - title: '淇濆吇椤瑰垎绫�', - align: 'center', - dataIndex: 'itemCategory_dictText', - width: 150 - }, - { - title: '淇濆吇椤圭洰', - align: 'center', - dataIndex: 'itemName', - ellipsis: true - } - ], - thirdMaintenanceColumns: [ - { - title: '搴忓彿', - align: 'center', - dataIndex: 'itemCode', - width: 60 - }, - { - title: '淇濆吇閮ㄤ綅', - align: 'center', - dataIndex: 'itemPart', - ellipsis: true - }, - { - title: '淇濆吇鍐呭', - align: 'center', - dataIndex: 'itemName', - ellipsis: true - }, - { - title: '楠屾敹鏍囧噯', - align: 'center', - dataIndex: 'itemDemand', - ellipsis: true - } - ], - disableMixinCreated: true, - url: { - list: '/eam/eamMaintenanceStandardDetail/list' + filterKey: { + type: String, + default: '' + } + }, + data() { + return { + description: '淇濆吇鏍囧噯鏄庣粏绠$悊椤甸潰', + // 琛ㄥご + columns: [], + inspectionColumns: [ + { + title: '搴忓彿', + align: 'center', + dataIndex: 'itemCode', + width: 60 + }, + { + title: '淇濆吇椤瑰垎绫�', + align: 'center', + dataIndex: 'itemCategory_dictText', + width: 150 + }, + { + title: '淇濆吇椤圭洰', + headerAlign: 'center', + align: 'left', + dataIndex: 'itemName', + ellipsis: true + }, + { + title: '淇濆吇瑙勮寖鎴栬姹�', + headerAlign: 'center', + align: 'left', + dataIndex: 'itemDemand', + ellipsis: true } - } - }, - watch: { - standardId: { - immediate: true, - handler(val) { - if (val) { - this.loadData(1) - } else { - this.clearList() - } + ], + secondMaintenanceColumns: [ + { + title: '搴忓彿', + align: 'center', + dataIndex: 'itemCode', + width: 60 + }, + { + title: '淇濆吇椤瑰垎绫�', + align: 'center', + dataIndex: 'itemCategory_dictText', + width: 150 + }, + { + title: '淇濆吇椤圭洰', + headerAlign: 'center', + align: 'left', + dataIndex: 'itemName', + ellipsis: true } - }, - pageSelectionRow: { - immediate: true, - handler(val) { - switch (val.maintenanceCategory) { - case 'POINT_INSPECTION': - this.columns = this.inspectionColumns - break - case 'SECOND_MAINTENANCE': - this.columns = this.secondMaintenanceColumns - break - case 'THIRD_MAINTENANCE': - this.columns = this.thirdMaintenanceColumns - break - } + ], + thirdMaintenanceColumns: [ + { + title: '搴忓彿', + align: 'center', + dataIndex: 'itemCode', + width: 60 + }, + { + title: '淇濆吇閮ㄤ綅', + align: 'center', + dataIndex: 'itemPart', + ellipsis: true + }, + { + title: '淇濆吇鍐呭', + headerAlign: 'center', + align: 'left', + dataIndex: 'itemName', + ellipsis: true + }, + { + title: '楠屾敹鏍囧噯', + headerAlign: 'center', + align: 'left', + dataIndex: 'itemDemand', + ellipsis: true } - } - }, - methods: { - loadData(arg) { - //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 - if (arg === 1) { - this.ipagination.current = 1 - } - let params = this.getQueryParams()//鏌ヨ鏉′欢 - if (!params) { - return false - } - this.dataSource = [] - params.standardId = this.standardId - params.itemCategory = this.filterKey - this.loading = true - console.log('----------------------', this.filterKey) - getAction(this.url.list, params) - .then((res) => { - if (res.success) { - this.dataSource = res.result.records - if (res.result.total) { - this.ipagination.total = res.result.total - } else { - this.ipagination.total = 0 - } - } else { - this.$notification.warning({ - message: '娑堟伅', - description: res.message - }) - } - }) - .finally(() => { - this.loading = false - }) - }, - clearList() { - this.dataSource = [] - this.clearSelected() + ], + disableMixinCreated: true, + url: { + list: '/eam/eamMaintenanceStandardDetail/list' } } + }, + watch: { + standardId: { + immediate: true, + handler(val) { + if (val) { + this.loadData(1) + } else { + this.clearList() + } + } + }, + pageSelectionRow: { + immediate: true, + handler(val) { + switch (val.maintenanceCategory) { + case 'POINT_INSPECTION': + this.columns = this.inspectionColumns + break + case 'SECOND_MAINTENANCE': + this.columns = this.secondMaintenanceColumns + break + case 'THIRD_MAINTENANCE': + this.columns = this.thirdMaintenanceColumns + break + } + } + } + }, + methods: { + loadData(arg) { + //鍔犺浇鏁版嵁 鑻ヤ紶鍏ュ弬鏁�1鍒欏姞杞界涓�椤电殑鍐呭 + if (arg === 1) { + this.ipagination.current = 1 + } + let params = this.getQueryParams()//鏌ヨ鏉′欢 + if (!params) { + return false + } + this.dataSource = [] + params.standardId = this.standardId + params.itemCategory = this.filterKey + this.loading = true + console.log('----------------------', this.filterKey) + getAction(this.url.list, params) + .then((res) => { + if (res.success) { + this.dataSource = res.result.records + if (res.result.total) { + this.ipagination.total = res.result.total + } else { + this.ipagination.total = 0 + } + } else { + this.$notification.warning({ + message: '娑堟伅', + description: res.message + }) + } + }) + .finally(() => { + this.loading = false + }) + }, + clearList() { + this.dataSource = [] + this.clearSelected() + } } -</script> \ No newline at end of file +} +</script> + +<style scoped lang="less"> +/* 琛ㄥご鍏ㄩ儴灞呬腑 */ +::v-deep .ant-table-thead > tr > th { + text-align: center !important; +} + +/* 琛ㄤ綋锛氬簭鍙枫�佷繚鍏婚」鍒嗙被銆佷繚鍏婚儴浣嶇殑鍐呭灞呬腑 */ +::v-deep .ant-table-tbody > tr > td[data-col="itemCode"], +::v-deep .ant-table-tbody > tr > td[data-col="itemCategory_dictText"], +::v-deep .ant-table-tbody > tr > td[data-col="itemPart"] { + text-align: center !important; +} + +/* 琛ㄤ綋锛氫繚鍏婚」鐩�佷繚鍏诲唴瀹广�侀獙鏀舵爣鍑嗙殑鍐呭宸﹀榻� */ +::v-deep .ant-table-tbody > tr > td[data-col="itemName"], +::v-deep .ant-table-tbody > tr > td[data-col="itemDemand"] { + text-align: left !important; +} +</style> \ No newline at end of file -- Gitblit v1.9.3