| | |
| | | <template> |
| | | <el-dialog title="数据点" v-model="visible" :width="'100%'" destroy-on-close @closed="$emit('closed')"> |
| | | <div> |
| | | <el-dialog title="数据点" v-model="visible" :width="'100%'" destroy-on-close @closed="$emit('closed')"> |
| | | <p style="margin-bottom: 14px;display: flex;align-items: center;"> |
| | | <span style="margin-right: 8px;">类型</span> |
| | | <el-select v-model="type" placeholder="类型" size="small" style="width: 240px" @change="changeType"> |
| | | <el-option v-for="item in typeList" :key="item.id" :label="item.name" :value="item.id" /> |
| | | </el-select> |
| | | <el-button type="primary" size="small" @click="importData" style="margin-left: 10px;">导入数据点</el-button> |
| | | <span style="margin-right: 8px;margin-left: auto;">IOT应用ID</span> |
| | | <el-input v-model="appId" placeholder="IOT应用ID" style="width: 240px"></el-input> |
| | | </p> |
| | |
| | | <el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="submit()">保 存</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | <el-dialog title="工位" v-model="visibleWork" :width="'50%'" destroy-on-close> |
| | | <el-table :data="workList" stripe @cell-click="cellClick"> |
| | | <el-table-column label="工位名称" prop="name"></el-table-column> |
| | | <el-table-column label="工位ID" prop="id"></el-table-column> |
| | | </el-table> |
| | | </el-dialog> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | |
| | | }, |
| | | type: '', |
| | | typeList: [], |
| | | appId: '' |
| | | appId: '', |
| | | visibleWork: false, |
| | | workList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | importData () { |
| | | this.visibleWork = true |
| | | this.$API.workstation.getList.get({ |
| | | groupId: 1, |
| | | }).then(res => { |
| | | console.log(res, '>>>>>>>>>>>>>') |
| | | this.workList = res.data.records |
| | | }) |
| | | }, |
| | | cellClick (row) { |
| | | console.log(row) |
| | | this.getList({ |
| | | workstationId: row.id, |
| | | }, 1).then(() => { |
| | | this.visibleWork = false |
| | | }) |
| | | }, |
| | | change(e, row, index, { prop, options }) { |
| | | console.log(e, options) |
| | | if (prop === 'dpCategory' && e !== 'Other') { |
| | |
| | | // ) |
| | | // } |
| | | // }, |
| | | getList(params) { |
| | | this.$HTTP.get(`/api/smis/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => { |
| | | getList(params,isImport) { |
| | | return this.$HTTP.get(`/api/smis/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => { |
| | | try { |
| | | this.cols = JSON.parse(res.data.dpHead) |
| | | this.addOptions(this.cols) |
| | |
| | | this.tabledata = [] |
| | | } |
| | | this.type = res.data.type |
| | | this.appId = res.data.appId |
| | | if (!isImport) { |
| | | this.appId = res.data.appId |
| | | } |
| | | this.setAddTemp() |
| | | // return res |
| | | }) |