| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | /** post è¯·æ± query string parameters |
| | | * @param {string} url æ¥å£å°å |
| | | * @param {object} data 请æ±åæ° |
| | | * @param {object} config åæ° |
| | | */ |
| | | getJ: function (url, params = {}, config = {}) { |
| | | return new Promise((resolve, reject) => { |
| | | axios({ |
| | | method: 'post', |
| | | url: url, |
| | | headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8' }, |
| | | params: params, |
| | | ...config |
| | | }).then((response) => { |
| | | resolve(response.data); |
| | | }).catch((error) => { |
| | | resolve(error.data); |
| | | reject(error); |
| | | }) |
| | | }) |
| | | }, |
| | | /** post è¯·æ± request payload |
| | | * @param {string} url æ¥å£å°å |
| | | * @param {object} data 请æ±åæ° |
| | |
| | | }) |
| | | }) |
| | | }, |
| | | |
| | | /** put è¯·æ± |
| | | * @param {string} url æ¥å£å°å |
| | | * @param {object} data 请æ±åæ° |
| | |
| | | <!-- |
| | | * @Date: 2024-10-02 20:34:08 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-03 10:08:26 |
| | | * @LastEditTime: 2024-10-05 10:07:12 |
| | | * @FilePath: /cps-web/src/views/console/system/collection.vue |
| | | --> |
| | | <template> |
| | |
| | | <el-button type="primary">æ°å¢æ¨¡ç</el-button> |
| | | </el-header> |
| | | <el-main> |
| | | <scTable style="width: 100%;" ref="table" row-key="id" border :params="params" :apiObj="apiObj" |
| | | stripe paginationLayout="total, prev, pager, next" @dataChange="dataChange" |
| | | @row-click="rowClick" highlight-current-row> |
| | | <scTable highlight-current-row @dataChange="dataChange" @row-click="rowClick" ref="table" |
| | | :params="params" :apiObj="apiObj" @selection-change="selectionChange" stripe> |
| | | <el-table-column prop="" label="模çåç§°" width="100px" /> |
| | | <el-table-column prop="" label="ç±»å" /> |
| | | <el-table-column prop="" label="é»è®¤è½®è¯¢" /> |
| | |
| | | let params = { |
| | | |
| | | } |
| | | return await this.$HTTP.get(`/api/blade-cps/check-project/page`, {}, { params }).then(res => { |
| | | return await this.$HTTP.get(`/api/smart-collect/tpl/page`, {}, { params }).then(res => { |
| | | res.data.records = res?.data?.records.map(v => { |
| | | return { |
| | | ...v, |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <!-- |
| | | * @Date: 2024-10-05 09:51:45 |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-05 09:53:47 |
| | | * @FilePath: /cps-web/src/views/console/workstation/Coll.vue |
| | | --> |
| | | <template> |
| | | <div> |
| | | |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | |
| | | </style> |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <el-dialog title="æ°æ®ç¹" v-model="visible" :width="'100%'" destroy-on-close @closed="$emit('closed')"> |
| | | <el-select v-model="type" placeholder="Select" 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> |
| | | <scFormTable v-show="type" ref="table1" v-model="tabledata" stripe hideDelete :hideAdd="!type" |
| | | :addTemplate="addTemplate"> |
| | | <el-table-column v-for="item in cols" :key="item.prop" :prop="item.prop" :label="item.label"> |
| | | <template #default="scope"> |
| | | <el-select v-model="scope.row[item.prop]" placeholder="Select" size="small" |
| | | v-if="scope.row.status && item.type === 'option'"> |
| | | <el-option v-for="item in item.options" :key="item" :label="item" :value="item" /> |
| | | </el-select> |
| | | <el-switch size="small" v-model="scope.row[item.prop]" |
| | | v-else-if="scope.row.status && item.type === 'boolean'" /> |
| | | <el-input size="small" v-model="scope.row[item.prop]" placeholder="" |
| | | v-else-if="scope.row.status"></el-input> |
| | | <span v-else>{{ scope.row[item.prop] }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column label="æä½" prop="state" width="120"> |
| | | <template #default="scope"> |
| | | <el-button-group> |
| | | <el-button text type="primary" size="small">ç¼è¾</el-button> |
| | | <el-button text type="primary">å¤å¶</el-button> |
| | | <el-popconfirm width="220" title="ç¡®å®å°éæ©çæ°æ®å é¤" @confirm="del(scope.row)"> |
| | | <template #reference> |
| | | <el-button text type="primary" size="small">å é¤</el-button> |
| | | </template> |
| | | </el-popconfirm> |
| | | </el-button-group> |
| | | |
| | | </template> |
| | | </el-table-column> |
| | | </scFormTable> |
| | | <template #footer> |
| | | <el-button @click="visible = false">å æ¶</el-button> |
| | | <el-button v-if="mode != 'show'" type="primary" :loading="isSaveing" @click="submit()">ä¿ å</el-button> |
| | | </template> |
| | | </el-dialog> |
| | | </template> |
| | | |
| | | <script> |
| | | import deepmerge from 'deepmerge' |
| | | import http from "@/utils/request" |
| | | export default { |
| | | emits: ['success', 'closed'], |
| | | props: { |
| | | option: { |
| | | type: Object |
| | | } |
| | | }, |
| | | computed: { |
| | | |
| | | }, |
| | | data() { |
| | | return { |
| | | mode: "add", |
| | | visible: false, |
| | | isSaveing: false, |
| | | params: {}, |
| | | tabledata: [], |
| | | apiObj: null, |
| | | addTemplate: { |
| | | name: '', |
| | | describe: '', |
| | | deviceAddress: '', |
| | | status: '2' // ä¸åå¨å·²ä¿å 1: æ£å¨ç¼è¾ 2: æ°å¢ |
| | | }, |
| | | type: '', |
| | | typeList: [] |
| | | |
| | | } |
| | | }, |
| | | created() { |
| | | |
| | | }, |
| | | methods: { |
| | | changeType(val) { |
| | | console.log(val) |
| | | console.log(JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull)) |
| | | try { |
| | | this.cols = JSON.parse(this.typeList.find(v => v.id === val).dpHeadFull) |
| | | } catch (error) { |
| | | |
| | | } |
| | | }, |
| | | //æ¾ç¤º |
| | | open(mode = 'add', params) { |
| | | this.isSaveing = false; |
| | | this.mode = mode; |
| | | this.visible = true; |
| | | this.params = params |
| | | this.getDetailList({ |
| | | workstationId: this.params.id, |
| | | }) |
| | | return this |
| | | }, |
| | | getDetailList(params) { |
| | | |
| | | |
| | | this.$HTTP.get(`/api/smart-collect/tpl/typelist`, {}, { params }).then(res => { |
| | | |
| | | this.typeList = res.data || []; |
| | | // return res |
| | | }).finally(() => { |
| | | this.$HTTP.get(`/api/blade-cps/workstation/listDatapointsByWorkstationId`, {}, { params }).then(res => { |
| | | // res.data.records = res?.data?.records.map(v => { |
| | | // return { |
| | | // ...v, |
| | | // statusName: v.status ? 'å¯ç¨' : 'ç¦ç¨' |
| | | // } |
| | | // }) |
| | | this.type = res.data.type |
| | | this.tabledata = res.data.dpConfig || []; |
| | | // return res |
| | | }) |
| | | }) |
| | | |
| | | }, |
| | | //表åæäº¤æ¹æ³ |
| | | submit() { |
| | | console.log(this.tabledata) |
| | | this.$HTTP.put('/api/blade-cps/workstation/saveDatapoints', { |
| | | dpConfig: JSON.stringify(this.tabledata), |
| | | workstationId: this.params.id, |
| | | type: this.type |
| | | }) |
| | | }, |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .workbranch { |
| | | list-style: none; |
| | | padding-left: 50px; |
| | | |
| | | li { |
| | | margin-top: 8px; |
| | | |
| | | span { |
| | | display: inline-block; |
| | | width: 25px; |
| | | height: 25px; |
| | | line-height: 25px; |
| | | text-align: center; |
| | | border-radius: 50%; |
| | | background: #ccc; |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | |
| | | } |
| | | } |
| | | </style> |
| | |
| | | <scUpload v-model="form.avatar" title="å·¥ä½å¾ç"></scUpload> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col :span="12" v-show="!form.id"> |
| | | <el-form-item label="ç产æ¥å" prop="calendarCode"> |
| | | <el-select v-model="form.calendarCode" style="width: 240px"> |
| | | <el-option v-for="item in options.calendarList" :key="item.id" :label="item.name" |
| | | :value="item.code" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <!-- ä¿®æ¹ç次æ¥çæ --> |
| | | <el-col :span="11" v-show="form.id"> |
| | | <el-form-item label="ç产æ¥å" prop="calendarCode"> |
| | | <el-select v-model="form.calendarCodeWaiting" style="width: 240px"> |
| | | <el-option v-for="item in options.calendarList" :key="item.id" :label="item.name" |
| | | :value="item.code" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | </el-col> |
| | | <el-col :span="1" v-show="form.id"> |
| | | <div style="display: flex;align-items: center;height: 32px;margin-bottom: 18px;"> |
| | | <el-tooltip class="box-item" effect="dark" content="ä¿®æ¹åçæ¥åæ¬¡æ¥çæ" placement="top-start"> |
| | | <el-icon> |
| | | <el-icon-warning-filled style="vertical-align: middle" /> |
| | | </el-icon> |
| | | </el-tooltip> |
| | | </div> |
| | | |
| | | </el-col> |
| | | <el-col :span="24" style="padding:12px 0;" v-if="form.type == 0"> |
| | | æºå¨ä¿¡æ¯ |
| | |
| | | status: '', |
| | | avatar: '', |
| | | calendarCode: '', |
| | | calendarCodeWaiting: '', |
| | | linkWay: '', |
| | | machineId: '', |
| | | machineCode: '', |
| | |
| | | Object.keys(this.form).forEach(key => { |
| | | this.form[key] = params[key] |
| | | }) |
| | | if (this.form.calendarCode) this.form.calendarCodeWaiting = this.form.calendarCodeWaiting || this.form.calendarCode |
| | | this.$HTTP.get(`/api/blade-cps/workstation/get?workstationId=${params.id}`).then(res => { |
| | | this.form = res?.data |
| | | this.$HTTP.get(`/api/blade-cps/workstation-workbench/listWorkbench?workstationId=${params.id}`).then(res => { |
| | |
| | | <el-container> |
| | | <el-header> |
| | | <h2>ééä¿¡æ¯</h2> |
| | | <el-button v-show="list.length > 0" |
| | | <!-- <el-button v-show="list.length > 0" |
| | | @click="() => { editFlag = !editFlag; showTable = !editFlag }" |
| | | style="margin-left: auto;" text type="primary" |
| | | size="small">{{ editFlag ? 'åæ¶' : 'é
置工ä½éé' |
| | | }}</el-button> |
| | | <el-button v-show="editFlag" @click="saveInfo" text |
| | | type="primary" size="small">ä¿å</el-button> |
| | | type="primary" size="small">ä¿å</el-button> --> |
| | | <!-- <el-button text type="primary" size="small" |
| | | @click="editDMP">ä¿®æ¹DMPé
ç½®</el-button> --> |
| | | <el-button @click="editCollection" text type="primary" |
| | | size="small">æ°æ®ç¹ç¼è¾</el-button> |
| | | </el-header> |
| | | <el-main> |
| | | <el-table :data="list" height="200px" |
| | |
| | | </el-tabs> |
| | | </el-card> |
| | | <Dialog ref="dialog" @success="success" :option="{ types, status, group }"></Dialog> |
| | | <CollDialog ref="CollDialog" @success="success" :option="{ previewData }"></CollDialog> |
| | | </el-main> |
| | | </template> |
| | | |
| | | <script> |
| | | import pmsPng from '@/assets/pms.png' |
| | | import Dialog from './Dialog.vue' |
| | | import CollDialog from './CollDialog.vue' |
| | | import machinePng from '@/assets/machine.png' |
| | | export default { |
| | | name: 'system', |
| | | components: { |
| | | Dialog |
| | | Dialog, |
| | | CollDialog |
| | | }, |
| | | data() { |
| | | return { |
| | |
| | | handler(val) { |
| | | this.queryList().then(() => { |
| | | if (val == 1) { |
| | | console.log('>>>>>>>>>>>>>>', this.treeCheckedNode) |
| | | this.apiObj = this.$API.workstation.getList |
| | | this.params = { |
| | | groupId: this.treeCheckedNode.id, |
| | |
| | | this.queryList() |
| | | }, |
| | | methods: { |
| | | // æ°æ®ç¹ç¼è¾ |
| | | editCollection() { |
| | | this.$refs.CollDialog.open('edit', this.previewData) |
| | | }, |
| | | handleSelectionChange(val) { |
| | | console.log(val) |
| | | val.forEach(v => { |
| | | v.bigScreen = true |
| | | v.realTimeData = true |
| | |
| | | }) |
| | | this.list.forEach(v => { |
| | | if (val.filter(item => v.id === item.id).length == 0) { |
| | | console.log(v) |
| | | v.bigScreen = false |
| | | v.realTimeData = false |
| | | v.processParameter = false |
| | |
| | | let data = this.formatData(res.data) |
| | | this.group = data |
| | | this.showGrouploading = false |
| | | console.log('>>>>>>>>>>>>>>>>>>>>>') |
| | | // this.$nextTick(() => { |
| | | if (!flag) { |
| | | debugger |
| | |
| | | groupCategory: this.treeCheckedNode.groupCategory |
| | | }, this.form) |
| | | return this.$API.workstation.saveWorkstationGroup.post(data).then(res => { |
| | | console.log(res) |
| | | this.queryList(true) |
| | | }) |
| | | } |
| | | let data = Object.assign({}, this.treeCheckedNode, this.form) |
| | | this.$API.workstation.saveWorkstationGroup.put(data).then(res => { |
| | | console.log(res) |
| | | this.queryList(true) |
| | | }) |
| | | }, |
| | |
| | | }, |
| | | rowClick(data) { |
| | | this.previewData = data |
| | | console.log(data, '>>>>>>>>>>>') |
| | | if (!data.id) { |
| | | Object.keys(this.basic).forEach(key => { |
| | | this.basic[key] = '-' |
| | |
| | | this.workbenchVOList = [] |
| | | return |
| | | } |
| | | this.$HTTP.get(`/api/blade-cps/workstation/listDmpVariablesByWorkstationId?workstationId=${data.id}`).then(res => { |
| | | console.log(data, '>>>>>>>>>>>') |
| | | this.$HTTP.get(`/api/blade-cps/workstation/listDmpVariablesByMachineId?machineId=${data.machineId}`).then(res => { |
| | | this.list = res?.data?.dmpVariablesVOList |
| | | Object.keys(this.basic).forEach(key => { |
| | | this.basic[key] = res?.data?.[key] || '-' |
| | |
| | | }) |
| | | }, |
| | | groupClick1(data) { |
| | | console.log('-------', data) |
| | | var params = { |
| | | groupId: data.id, |
| | | keyWord: this.keyWord, |
| | |
| | | dataChange(res, data) { |
| | | |
| | | if (data.length > 0) { |
| | | console.log(data[0], '>>>>>>>>') |
| | | this.$refs.table.setCurrentRow(data[0]) |
| | | this.previewData = data[0] |
| | | this.rowClick(data[0]) |
| | |
| | | /* |
| | | * @Date: 2024-03-23 09:49:06 |
| | | * @LastEditors: Sneed |
| | | * @LastEditTime: 2024-04-10 22:11:52 |
| | | * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/vue.config.js |
| | | * @LastEditors: gaoshp |
| | | * @LastEditTime: 2024-10-05 17:23:49 |
| | | * @FilePath: /cps-web/vue.config.js |
| | | */ |
| | | const { defineConfig } = require('@vue/cli-service') |
| | | |
| | |
| | | open: false, //è¿è¡åèªå¨æå¼æµè§å¨ |
| | | port: process.env.VUE_APP_PORT, //æè½½ç«¯å£ |
| | | proxy: { |
| | | '/api/smart-collect': { |
| | | target: 'http://120.46.212.231:4102', |
| | | // ws: true, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/api': '/' |
| | | } |
| | | }, |
| | | '/api/blade-cps/workstation/listDatapointsByWorkstationId': { |
| | | target: 'http://120.46.212.231:4102', |
| | | // ws: true, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/api': '/' |
| | | } |
| | | }, |
| | | '/api/blade-cps/workstation/saveDatapoints': { |
| | | target: 'http://120.46.212.231:4102', |
| | | // ws: true, |
| | | changeOrigin: true, |
| | | pathRewrite: { |
| | | '^/api': '/' |
| | | } |
| | | }, |
| | | '/api': { |
| | | target: process.env.VUE_APP_API_BASEURL, |
| | | ws: true, |
| | |
| | | // '^/api': '/' |
| | | } |
| | | }, |
| | | |
| | | } |
| | | }, |
| | | |