| | |
| | | keyWord: '', |
| | | status: 1, |
| | | }, |
| | | exportUrlTpl: '/api/blade-cps/device-types/export/template', |
| | | uploadUrl: '/api/blade-cps/device-types/excel/import', |
| | | exportUrlTpl: '/api/smis/device-types/export/template', |
| | | uploadUrl: '/api/smis/device-types/excel/import', |
| | | visible: false, |
| | | config: { |
| | | labelWidth: 120, |
| | |
| | | ...data, |
| | | ...this.params |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/device-types/page`, {}, { params }).then(res => { |
| | | return await this.$HTTP.get(`/api/smis/device-types/page`, {}, { params }).then(res => { |
| | | res.data.records = res?.data?.records.map(v => { |
| | | return { |
| | | ...v, |
| | |
| | | }, |
| | | methods: { |
| | | init() { |
| | | this.$HTTP.get(`/api/blade-cps/check-project/page?key=¤t=1&size=-1`).then(res => { |
| | | this.$HTTP.get(`/api/smis/check-project/page?key=¤t=1&size=-1`).then(res => { |
| | | this.options = res.data.records |
| | | }) |
| | | this.$HTTP.get(`/api/blade-cps/maintain-item/list?keyWord=`).then(res => { |
| | | this.$HTTP.get(`/api/smis/maintain-item/list?keyWord=`).then(res => { |
| | | this.options1 = res.data |
| | | }) |
| | | }, |
| | |
| | | this.visible = true |
| | | }, |
| | | exportData() { |
| | | this.$HTTP.post(`/api/blade-cps/device-types/excel/export`, {}, { params: this.params }).then(res => { |
| | | this.$HTTP.post(`/api/smis/device-types/excel/export`, {}, { params: this.params }).then(res => { |
| | | if (res.success) { |
| | | window.open(res.data.link) |
| | | } |
| | |
| | | this.$refs.table.reload() |
| | | }, |
| | | table_del(selection, type) { |
| | | this.$HTTP.delete(`/api/blade-cps/device-types?type=${type}`, {}, { |
| | | this.$HTTP.delete(`/api/smis/device-types?type=${type}`, {}, { |
| | | data: { |
| | | idList: selection.map(v => v.id), |
| | | } |
| | |
| | | }, |
| | | submit() { |
| | | if (!this.form.id) { |
| | | this.$HTTP.post(`/api/blade-cps/device-types`, this.form).then(res => { |
| | | this.$HTTP.post(`/api/smis/device-types`, this.form).then(res => { |
| | | if (res.success) { |
| | | this.visible = false |
| | | this.search() |
| | | } |
| | | }) |
| | | } else { |
| | | this.$HTTP.put(`/api/blade-cps/device-types`, this.form).then(res => { |
| | | this.$HTTP.put(`/api/smis/device-types`, this.form).then(res => { |
| | | if (res.success) { |
| | | this.visible = false |
| | | this.search() |
| | |
| | | }, |
| | | getCheckList() { |
| | | let row = this.selectRow |
| | | return this.$HTTP.get(`/api/blade-cps/device-type-check-projects/page?id=${row.id}`).then(res => { |
| | | return this.$HTTP.get(`/api/smis/device-type-check-projects/page?id=${row.id}`).then(res => { |
| | | if (res.success) { |
| | | this.tabledata = res.data |
| | | this.getCheckListChild(this.tabledata[0]) |
| | |
| | | }, |
| | | getCheckListChild(row) { |
| | | if (!row?.checkProjectId) return this.tableDataList = [] |
| | | this.$HTTP.get(`/api/blade-cps/check-item/list?projectId=${row.checkProjectId}`).then(res => { |
| | | this.$HTTP.get(`/api/smis/check-item/list?projectId=${row.checkProjectId}`).then(res => { |
| | | if (res.success) { |
| | | this.tableDataList = res.data |
| | | } else { |
| | |
| | | this.tabledata.splice(index, 1) |
| | | }, |
| | | delCheck(row) { |
| | | this.$HTTP.delete(`/api/blade-cps/device-type-check-projects`, {}, { |
| | | this.$HTTP.delete(`/api/smis/device-type-check-projects`, {}, { |
| | | data: { |
| | | ids: [row.id] |
| | | } |
| | |
| | | }) |
| | | }, |
| | | addCheck(row) { |
| | | this.$HTTP.post(`/api/blade-cps/device-type-check-projects`, { |
| | | this.$HTTP.post(`/api/smis/device-type-check-projects`, { |
| | | deviceTypeId: this.selectRow.id, |
| | | checkProjectId: [row.checkProjectId], |
| | | intervalTime: row.intervalTime |
| | |
| | | }) |
| | | }, |
| | | getMList() { |
| | | return this.$HTTP.get(`/api/blade-cps/maintain-project/list?deviceTypeId=${this.selectRow.id}`).then(res => { |
| | | return this.$HTTP.get(`/api/smis/maintain-project/list?deviceTypeId=${this.selectRow.id}`).then(res => { |
| | | if (res.success) { |
| | | this.talbeDataM = res.data |
| | | this.getMlistChild(this.talbeDataM?.[0]) |
| | |
| | | getMlistChild(row) { |
| | | this.selectMRow = row |
| | | if (!row?.id) return this.talbeDataMChild = [] |
| | | this.$HTTP.get(`/api/blade-cps/maintain-project-item/item-list?projectId=${row.id}`).then(res => { |
| | | this.$HTTP.get(`/api/smis/maintain-project-item/item-list?projectId=${row.id}`).then(res => { |
| | | if (res) { |
| | | this.talbeDataMChild = res |
| | | } else { |
| | |
| | | }, |
| | | // |
| | | addM(row) { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-project/create-maintain-project`, { |
| | | this.$HTTP.post(`/api/smis/maintain-project/create-maintain-project`, { |
| | | code: row.code, |
| | | deviceTypeId: this.selectRow.id, |
| | | deviceTypeName: row.deviceTypeName, |
| | |
| | | }) |
| | | }, |
| | | delM(row) { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-project/delete-maintain-project`, {}, { |
| | | this.$HTTP.post(`/api/smis/maintain-project/delete-maintain-project`, {}, { |
| | | params: { |
| | | id: row.id |
| | | } |
| | |
| | | }, |
| | | |
| | | delMChild(row) { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-project-item/delete-maintain-project-item?id=${row.id}`).then(res => { |
| | | this.$HTTP.post(`/api/smis/maintain-project-item/delete-maintain-project-item?id=${row.id}`).then(res => { |
| | | if (res.success) { |
| | | this.getMlistChild(this.selectMRow) |
| | | } else { |
| | |
| | | this.visibleAdd = true |
| | | }, |
| | | saveAdd() { |
| | | this.$HTTP.post(`/api/blade-cps/maintain-project-item/create-maintain-project-item`, { |
| | | this.$HTTP.post(`/api/smis/maintain-project-item/create-maintain-project-item`, { |
| | | itemId: this.itemId, |
| | | projectId: this.selectMRow.id |
| | | }).then(res => { |