From ca3903e09980b98a1a46af0c339e9ca00fa04ccd Mon Sep 17 00:00:00 2001
From: gaoshp <291585735@qq.com>
Date: 星期三, 17 四月 2024 23:36:31 +0800
Subject: [PATCH] 应用设置
---
src/views/mdc/configComp/Board.vue | 6
src/views/mdc/configComp/Status.vue | 232 +++++++++++++++
src/views/mdc/configComp/Efficiency.vue | 227 +++++++++++++++
src/views/mdc/configuration.vue | 77 ++++
src/views/setting/task/logs.vue | 114 +++---
src/components/scFormTable/index.vue | 198 +++++++-----
6 files changed, 708 insertions(+), 146 deletions(-)
diff --git a/src/components/scFormTable/index.vue b/src/components/scFormTable/index.vue
index cb44888..9e7649c 100644
--- a/src/components/scFormTable/index.vue
+++ b/src/components/scFormTable/index.vue
@@ -3,8 +3,8 @@
* @version: 1.3
* @Author: sakuya
* @Date: 2023骞�2鏈�9鏃�12:32:26
- * @LastEditors: sakuya
- * @LastEditTime: 2023骞�2鏈�17鏃�10:41:47
+ * @LastEditors: Sneed
+ * @LastEditTime: 2024-04-17 22:09:27
-->
<template>
@@ -12,112 +12,146 @@
<el-table :data="data" ref="table" border stripe>
<el-table-column type="index" width="50" fixed="left">
<template #header>
- <el-button v-if="!hideAdd" type="primary" icon="el-icon-plus" size="small" circle @click="rowAdd"></el-button>
+ <el-button v-if="!hideAdd" type="primary" icon="el-icon-plus" size="small" circle
+ @click="rowAdd"></el-button>
</template>
<template #default="scope">
- <div :class="['sc-form-table-handle', {'sc-form-table-handle-delete':!hideDelete}]">
- <span>{{scope.$index + 1}}</span>
- <el-button v-if="!hideDelete" type="danger" icon="el-icon-delete" size="small" plain circle @click="rowDel(scope.row, scope.$index)"></el-button>
+ <div :class="['sc-form-table-handle', { 'sc-form-table-handle-delete': !hideDelete }]">
+ <span>{{ scope.$index + 1 }}</span>
+ <el-popconfirm v-if="!scope.row.isSet" title="纭畾鍒犻櫎鍚楋紵"
+ @confirm="rowDel(scope.row, scope.$index)">
+ <template #reference>
+ <el-button v-if="!hideDelete" type="danger" icon="el-icon-delete" size="small" plain
+ circle></el-button>
+ <!-- <el-button text type="primary" size="small">鍒犻櫎</el-button> -->
+ </template>
+ </el-popconfirm>
+
</div>
</template>
</el-table-column>
<el-table-column label="" width="50" v-if="dragSort">
<template #default>
- <div class="move" style="cursor: move;"><el-icon-d-caret style="width: 1em; height: 1em;"/></div>
+ <div class="move" style="cursor: move;"><el-icon-d-caret style="width: 1em; height: 1em;" /></div>
</template>
</el-table-column>
<slot></slot>
<template #empty>
- {{placeholder}}
+ {{ placeholder }}
</template>
</el-table>
</div>
</template>
<script>
- import Sortable from 'sortablejs'
+import Sortable from 'sortablejs'
- export default {
- props: {
- modelValue: { type: Array, default: () => [] },
- addTemplate: { type: Object, default: () => {} },
- placeholder: { type: String, default: "鏆傛棤鏁版嵁" },
- dragSort: { type: Boolean, default: false },
- hideAdd: { type: Boolean, default: false },
- hideDelete: { type: Boolean, default: false }
- },
- data(){
- return {
- data: []
- }
- },
- mounted(){
+export default {
+ props: {
+ modelValue: { type: Array, default: () => [] },
+ addTemplate: { type: Object, default: () => { } },
+ placeholder: { type: String, default: "鏆傛棤鏁版嵁" },
+ dragSort: { type: Boolean, default: false },
+ hideAdd: { type: Boolean, default: false },
+ hideDelete: { type: Boolean, default: false }
+ },
+ data() {
+ return {
+ data: []
+ }
+ },
+ mounted() {
+ this.data = this.modelValue
+ if (this.dragSort) {
+ this.rowDrop()
+ }
+ },
+ watch: {
+ modelValue() {
this.data = this.modelValue
- if(this.dragSort){
- this.rowDrop()
- }
},
- watch:{
- modelValue(){
- this.data = this.modelValue
+ data: {
+ handler() {
+ this.$emit('update:modelValue', this.data);
},
- data: {
- handler(){
- this.$emit('update:modelValue', this.data);
- },
- deep: true
- }
- },
- methods: {
- rowDrop(){
- const _this = this
- const tbody = this.$refs.table.$el.querySelector('.el-table__body-wrapper tbody')
- Sortable.create(tbody, {
- handle: ".move",
- animation: 300,
- ghostClass: "ghost",
- onEnd({ newIndex, oldIndex }) {
- _this.data.splice(newIndex, 0, _this.data.splice(oldIndex, 1)[0])
- const newArray = _this.data.slice(0)
- const tmpHeight = _this.$refs.scFormTable.offsetHeight
- _this.$refs.scFormTable.style.setProperty('height', tmpHeight + 'px')
- _this.data = []
- _this.$nextTick(() => {
- _this.data = newArray
- _this.$nextTick(() => {
- _this.$refs.scFormTable.style.removeProperty('height')
- })
+ deep: true
+ }
+ },
+ methods: {
+ rowDrop() {
+ const _this = this
+ const tbody = this.$refs.table.$el.querySelector('.el-table__body-wrapper tbody')
+ Sortable.create(tbody, {
+ handle: ".move",
+ animation: 300,
+ ghostClass: "ghost",
+ onEnd({ newIndex, oldIndex }) {
+ _this.data.splice(newIndex, 0, _this.data.splice(oldIndex, 1)[0])
+ const newArray = _this.data.slice(0)
+ const tmpHeight = _this.$refs.scFormTable.offsetHeight
+ _this.$refs.scFormTable.style.setProperty('height', tmpHeight + 'px')
+ _this.data = []
+ _this.$nextTick(() => {
+ _this.data = newArray
+ _this.$nextTick(() => {
+ _this.$emit('rowDrop', newArray)
+ _this.$refs.scFormTable.style.removeProperty('height')
})
- }
- })
- },
- rowAdd(){
- const temp = JSON.parse(JSON.stringify(this.addTemplate))
- this.data.push(temp)
- },
- rowDel(row, index){
- this.data.splice(index, 1)
- },
- //鎻掑叆琛�
- pushRow(row){
- const temp = row || JSON.parse(JSON.stringify(this.addTemplate))
- this.data.push(temp)
- },
- //鏍规嵁index鍒犻櫎
- deleteRow(index){
- this.data.splice(index, 1)
- }
+
+ })
+ }
+ })
+ },
+ rowAdd() {
+ const temp = JSON.parse(JSON.stringify(this.addTemplate))
+ this.data.push(temp)
+ },
+ rowDel(row, index) {
+ this.$emit('delRow', row)
+ this.data.splice(index, 1)
+ },
+ //鎻掑叆琛�
+ pushRow(row) {
+ const temp = row || JSON.parse(JSON.stringify(this.addTemplate))
+ this.data.push(temp)
+ },
+ //鏍规嵁index鍒犻櫎
+ deleteRow(index) {
+ this.data.splice(index, 1)
}
}
+}
</script>
<style scoped>
- .sc-form-table {width: 100%;}
- .sc-form-table .sc-form-table-handle {text-align: center;}
- .sc-form-table .sc-form-table-handle span {display: inline-block;}
- .sc-form-table .sc-form-table-handle button {display: none;}
- .sc-form-table .hover-row .sc-form-table-handle-delete span {display: none;}
- .sc-form-table .hover-row .sc-form-table-handle-delete button {display: inline-block;}
- .sc-form-table .move {text-align: center;font-size: 14px;margin-top: 3px;}
+.sc-form-table {
+ width: 100%;
+}
+
+.sc-form-table .sc-form-table-handle {
+ text-align: center;
+}
+
+.sc-form-table .sc-form-table-handle span {
+ display: inline-block;
+}
+
+.sc-form-table .sc-form-table-handle button {
+ display: none;
+}
+
+.sc-form-table .hover-row .sc-form-table-handle-delete span {
+ display: none;
+}
+
+.sc-form-table .hover-row .sc-form-table-handle-delete button {
+ display: inline-block;
+}
+
+.sc-form-table .move {
+ text-align: center;
+ font-size: 14px;
+ margin-top: 3px;
+}
</style>
diff --git a/src/views/mdc/configComp/Board.vue b/src/views/mdc/configComp/Board.vue
index 90c49ba..7b1189d 100644
--- a/src/views/mdc/configComp/Board.vue
+++ b/src/views/mdc/configComp/Board.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-15 23:58:36
* @LastEditors: Sneed
- * @LastEditTime: 2024-04-17 00:38:24
+ * @LastEditTime: 2024-04-17 00:45:20
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Board.vue
-->
<template>
@@ -111,7 +111,6 @@
},
methods: {
init() {
- console.log('>>>>>>normalId')
this.$HTTP.get('/api/blade-system/param-biz/detail?paramKey=mdc_chosen_groups').then(re => {
this.id = re.data.id
let chosen = []
@@ -119,12 +118,12 @@
try {
chosen = JSON.parse(re.data.paramValue).map(v => v.groupId)
normalId = JSON.parse(re.data.paramValue).find(v => v.isDefault).groupId
- console.log('>>>>>>normalId', normalId)
} catch (error) {
}
Promise.all([
this.$HTTP.get('/api/blade-system/dict/dictionary?code=group_tag').then(res => {
+ this.dicts = []
this.dicts.push(...res.data.map(({ dictKey, dictValue }) => ({
dictKey, dictValue
})))
@@ -203,6 +202,7 @@
item?.children.forEach(v => {
if (groupId == v.groupId) {
v.isDefault = true
+ v.isSelect = true
} else {
v.isDefault = 0
}
diff --git a/src/views/mdc/configComp/Efficiency.vue b/src/views/mdc/configComp/Efficiency.vue
new file mode 100644
index 0000000..ad091cc
--- /dev/null
+++ b/src/views/mdc/configComp/Efficiency.vue
@@ -0,0 +1,227 @@
+<!--
+ * @Date: 2024-04-17 22:17:37
+ * @LastEditors: Sneed
+ * @LastEditTime: 2024-04-17 23:06:48
+ * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Efficiency.vue
+-->
+<template>
+ <el-main>
+ <el-row>
+ <el-col>
+ <el-card style="max-width: 480px">
+ <template #header>
+ <div class="card-header">
+ 鐢ㄦ椂鍒嗘瀽锛堢敤鏃跺垎甯冿級
+ </div>
+ </template>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝鍐呬紤鎭椂闂�
+ </el-col>
+ <el-col :span="4">
+ <el-switch @change="save" :active-value="1" :inactive-value="0"
+ v-model="mdc_open_type.TIME_USED_ANALYSIS" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝瀵瑰鏃堕棿锛堝寘鎷彮娆″唴鏈畾涔夋椂闂达級
+ </el-col>
+ <el-col :span="4">
+ <el-switch @change="save(true)" :active-value="1" :inactive-value="0"
+ v-model="mdc_open_shift.TIME_USED_ANALYSIS" />
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-card style="max-width: 480px">
+ <template #header>
+ <div class="card-header">
+ 鏁堢巼鍒嗘瀽
+ </div>
+ </template>
+ <el-row>
+ <el-col style="font-weight: blod;font-size: 14px">杩愯鐜�</el-col>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝鍐呬紤鎭椂闂�
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_type.RUNNING" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝瀵瑰鏃堕棿锛堝寘鎷彮娆″唴鏈畾涔夋椂闂达級
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_shift.RUNNING" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col style="font-weight: blod;font-size: 14px">鎶ヨ鐜�</el-col>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝鍐呬紤鎭椂闂�
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_type.ALARM" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝瀵瑰鏃堕棿锛堝寘鎷彮娆″唴鏈畾涔夋椂闂达級
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_shift.ALARM" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col style="font-weight: blod;font-size: 14px">绋煎姩鐜�</el-col>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝鍐呬紤鎭椂闂�
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_type.OEE" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝瀵瑰鏃堕棿锛堝寘鎷彮娆″唴鏈畾涔夋椂闂达級
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_shift.OEE" />
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-card style="max-width: 480px">
+ <template #header>
+ <div class="card-header">
+ 浜ч噺缁熻
+ </div>
+ </template>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝鍐呬紤鎭椂闂�
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_type.OUT_PUT" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝瀵瑰鏃堕棿锛堝寘鎷彮娆″唴鏈畾涔夋椂闂达級
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_shift.OUT_PUT" />
+ </el-col>
+ </el-row>
+ </el-card>
+ <el-card style="max-width: 480px">
+ <template #header>
+ <div class="card-header">
+ 鎶ヨ缁熻
+ </div>
+ </template>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝鍐呬紤鎭椂闂�
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_type.ALARM_ANALYSIS" />
+ </el-col>
+ </el-row>
+ <el-row>
+ <el-col :span="18" style="display: flex;align-items: center">
+ 鎺掗櫎鐝瀵瑰鏃堕棿锛堝寘鎷彮娆″唴鏈畾涔夋椂闂达級
+ </el-col>
+ <el-col :span="4">
+ <el-switch :active-value="1" :inactive-value="0" v-model="mdc_open_shift.ALARM_ANALYSIS" />
+ </el-col>
+ </el-row>
+ </el-card>
+ </el-col>
+ </el-row>
+ </el-main>
+</template>
+
+<script>
+export default {
+ data() {
+ return {
+ mdc_open_typeId: '',
+ mdc_open_type: {
+ TIME_USED_ANALYSIS: 0,
+ RUNNING: 0,
+ ALARM: 0,
+ OEE: 0,
+ OUT_PUT: 0,
+ ALARM_ANALYSIS: 0,
+ },
+ mdc_open_shiftId: '',
+ mdc_open_shift: {
+ TIME_USED_ANALYSIS: 0,
+ RUNNING: 0,
+ ALARM: 0,
+ OEE: 0,
+ OUT_PUT: 0,
+ ALARM_ANALYSIS: 0,
+ }
+ }
+ },
+ created() {
+ this.init()
+ },
+ methods: {
+ init() {
+ this.$HTTP.get('/api/blade-system/param/detail?paramKey=mdc_open_shift').then(res => {
+ if (res.code === 200) {
+ this.mdc_open_shiftId = res.data.id
+ JSON.parse(res.data.paramValue).forEach(v => {
+ this.mdc_open_shift[v.type] = v.open
+ })
+ }
+ })
+ this.$HTTP.get('/api/blade-system/param/detail?paramKey=mdc_open_type').then(res => {
+ if (res.code === 200) {
+ this.mdc_open_typeId = res.data.id
+ JSON.parse(res.data.paramValue).forEach(v => {
+ this.mdc_open_type[v.type] = v.open
+ })
+ }
+ })
+ },
+ save(flag) {
+ let data = {
+
+ }
+ if (flag) {
+ data.paramKey = 'mdc_open_shift'
+ data.id = this.mdc_open_shiftId
+ let paramValue = Object.keys(this.mdc_open_shift).map(v => {
+ return {
+ type: v,
+ open: this.mdc_open_shift[v]
+ }
+ })
+ data.paramValue = JSON.stringify(paramValue)
+ } else {
+ data.paramKey = 'mdc_open_type'
+ data.id = this.mdc_open_typeId
+ let paramValue = Object.keys(this.mdc_open_type).map(v => {
+ return {
+ type: v,
+ open: this.mdc_open_type[v]
+ }
+ })
+ data.paramValue = JSON.stringify(paramValue)
+ }
+ this.$HTTP.post('/api/blade-system/param/submit', data).then(res => {
+ if (res.code == 200) {
+ this.$message.success(`鎿嶄綔鎴愬姛`)
+ this.init()
+ }
+ })
+ },
+ }
+}
+</script>
+
+<style lang="scss" scoped></style>
\ No newline at end of file
diff --git a/src/views/mdc/configComp/Status.vue b/src/views/mdc/configComp/Status.vue
new file mode 100644
index 0000000..cd86e31
--- /dev/null
+++ b/src/views/mdc/configComp/Status.vue
@@ -0,0 +1,232 @@
+<!--
+ * @Date: 2024-04-17 18:53:45
+ * @LastEditors: Sneed
+ * @LastEditTime: 2024-04-17 22:14:18
+ * @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configComp/Status.vue
+-->
+<template>
+ <el-main>
+ <el-row>
+ <scFormTable ref="table" size="small" v-model="data" stripe hideAdd hideDelete dragSort @rowDrop="save">
+ <el-table-column label="宸ヤ綅/鏈哄櫒鐘舵��" prop="name"></el-table-column>
+ <el-table-column label="缂栧彿" prop="code"></el-table-column>
+ <el-table-column label="棰滆壊" prop="color"></el-table-column>
+ <el-table-column label="棰滆壊" prop="color">
+ <template #default="scope">
+ <el-color-picker v-model="scope.row.color" @change="update(scope.row)" />
+ </template>
+ </el-table-column>
+ <el-table-column label="缁╂晥鏃堕棿" prop="rps">
+ <template #default="scope">
+ <el-select v-model="scope.row.rps" style="width: 100%;" @change="update(scope.row)">
+ <el-option v-for="(item, index) in options.rps" :key="index" :label="item.label"
+ :value="item.value"></el-option>
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="璁″垝鍐呭" prop="isPlan">
+ <template #default="scope">
+ <el-select v-model="scope.row.isPlan" style="width: 100%;" @change="update(scope.row)">
+ <el-option v-for="(item, index) in options.isPlan" :key="index" :label="item.label"
+ :value="item.value"></el-option>
+ </el-select>
+ </template>
+ </el-table-column>
+ </scFormTable>
+ </el-row>
+ <el-row style="margin-top: 20px;">
+ <scFormTable ref="table1" v-model="Tabledata" stripe @delRow="remove" :addTemplate="addTemplate" dragSort>
+ <el-table-column label="浜哄伐鍙嶉鐘舵��" prop="name">
+ <template #default="scope">
+ <el-input v-model="scope.row.name"></el-input>
+ </template>
+ </el-table-column>
+ <el-table-column label="缂栧彿" prop="code">
+ <template #default="scope">
+ <el-input v-show="!scope.row.code" v-model="scope.row.code"></el-input>
+ <span>{{ scope.row.code }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="棰滆壊" prop="color"></el-table-column>
+ <el-table-column label="棰滆壊" prop="color">
+ <template #default="scope">
+ <el-color-picker v-model="scope.row.color" />
+ </template>
+ </el-table-column>
+ <el-table-column label="璁″垝鍐呭" prop="state">
+ <template #default="scope">
+ <el-select v-model="scope.row.isPlan" style="width: 200px;">
+ <el-option v-for="(item, index) in options.isPlan" :key="index" :label="item.label"
+ :value="item.value"></el-option>
+ </el-select>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" prop="state">
+ <template #default="scope">
+ <el-button v-show="scope.row.isNew" @click="add(scope.row)">淇濆瓨</el-button>
+ </template>
+ </el-table-column>
+ </scFormTable>
+ </el-row>
+ <el-row style="margin-top: 20px;">
+ <el-col :span="12">
+ <el-card>
+ <template #header>
+ <div class="card-header">
+ <span>鏁堢巼璁$畻鍏紡璇存槑</span>
+ </div>
+ </template>
+ <p>绋煎姩鐜囷細璁″垝鍐呯姸鎬佹椂闀�/閲囬泦鐘舵�佹�绘椂闀�</p>
+ <p>鏍规嵁閲囬泦鐨勬暟鎹姸鎬佸垝鍒嗗埌鐩稿簲鐨勭哗鏁堟椂闂达紝閫氳繃缁╂晥鏃堕棿鐨勬寔缁椂闀匡紝骞朵緷鐓у涓嬪叕寮忚繘琛屾晥鐜囪绠�:</p>
+
+ <p>杩愯鐜囷細T1 /锛圱1+T2+T3+T4+T5+T6锛�</p>
+ <p>鎶ヨ鐜囷細T4 /锛圱1+T2+T3+T4+T5+T6锛�</p>
+ </el-card>
+ </el-col>
+ <el-col :span="12">
+ <el-card>
+ <template #header>
+ <div class="card-header">
+ <span>缁╂晥鏃堕棿涓庡搴旇壊鍊艰鏄�</span>
+ </div>
+ </template>
+ <p><img style="width: 100%;" src="./configuration.23a90729.png" alt="" srcset=""></p>
+ </el-card>
+ </el-col>
+ </el-row>
+
+
+ </el-main>
+</template>
+
+<script>
+export default {
+ data() {
+ return {
+ options: {
+ rps: [
+ {
+ label: 'T1',
+ value: 1
+ },
+ {
+ label: 'T2',
+ value: 2
+ },
+ {
+ label: 'T3',
+ value: 3
+ },
+ {
+ label: 'T4',
+ value: 4
+ },
+ {
+ label: 'T5',
+ value: 5
+ },
+ {
+ label: 'T6',
+ value: 6
+ }
+ ],
+ isPlan: [
+ {
+ label: '璁″垝鍐�',
+ value: 0
+ },
+ {
+ label: '璁″垝澶�',
+ value: 1
+ },
+ ]
+ },
+ data: [],
+ Tabledata: [],
+ addTemplate: {
+ name: '浜哄伐鐘舵��',
+ code: '',
+ color: '#FFFFFF',
+ rps: 1,
+ isPlan: 0,
+ type: 4,
+ isNew: true
+ }
+ }
+ },
+ watch: {
+ data: {
+ handler() {
+
+ },
+ deep: true
+ }
+ },
+ created() {
+ this.getList()
+ },
+ methods: {
+ getList() {
+ this.$HTTP.get('/api/blade-cps/global_wcs/wcs-achievements').then(res => {
+ if (res.code === 200) {
+ this.data = res.data.filter(v => v.type === 1)
+ this.Tabledata = res.data.filter(v => v.type === 4)
+ }
+ })
+ },
+ save() {
+ this.$HTTP.post('/api/blade-cps/global_wcs/update-wcs-seq', this.data.map(v => v.code)).then(res => {
+ if (res.code == 200) {
+ this.$message.success(`鎿嶄綔鎴愬姛`)
+ this.getList()
+ }
+ })
+ },
+ update(row) {
+ console.log(row)
+ let data = {
+ code: row.code,
+ color: row.color,
+ isPlan: row.isPlan,
+ name: row.name,
+ rps: row.rps
+ }
+ this.$HTTP.post('/api/blade-cps/global_wcs/update-wcs-achievements', data).then(res => {
+ if (res.code == 200) {
+ this.$message.success(`鎿嶄綔鎴愬姛`)
+ this.getList()
+ }
+ })
+ },
+ add(row) {
+ if (!row.code || !row.color || !row.name) {
+ return this.$message.warning('鐘舵�佸悕绉般�佺紪鍙枫�侀鑹插繀濉�'); (`鎿嶄綔鎴愬姛`)
+ }
+ let data = {
+ code: row.code,
+ color: row.color,
+ isPlan: row.isPlan,
+ name: row.name,
+ rps: row.rps,
+ type: 4,
+ }
+ this.$HTTP.post('/api/blade-cps/global_wcs/add-wcs-achievements', data).then(res => {
+ if (res.code == 200) {
+ this.$message.success(`鎿嶄綔鎴愬姛`)
+ this.getList()
+ }
+ })
+ },
+ remove(row) {
+ this.$HTTP.delete(`/api/blade-cps/global_wcs/delete-wcs-achievements/${row.code}`).then(res => {
+ if (res.code == 200) {
+ this.$message.success(`鎿嶄綔鎴愬姛`)
+ this.getList()
+ }
+ })
+ }
+ }
+}
+</script>
+
+<style lang="scss" scoped></style>
\ No newline at end of file
diff --git a/src/views/mdc/configuration.vue b/src/views/mdc/configuration.vue
index 6f343dc..b00cf3a 100644
--- a/src/views/mdc/configuration.vue
+++ b/src/views/mdc/configuration.vue
@@ -1,7 +1,7 @@
<!--
* @Date: 2024-04-09 22:11:21
* @LastEditors: Sneed
- * @LastEditTime: 2024-04-16 00:00:46
+ * @LastEditTime: 2024-04-17 23:35:22
* @FilePath: /belleson-frontend/Users/mache/Documents/demo/cps-web/src/views/mdc/configuration.vue
* 搴旂敤璁剧疆
-->
@@ -13,13 +13,43 @@
<Board />
</el-tab-pane>
<el-tab-pane label="鐘舵�佸拰缁╂晥鏃堕棿璁剧疆">
-
+ <Status />
</el-tab-pane>
<el-tab-pane label="鏁堢巼缁熻璁剧疆">
-
+ <Efficiency />
</el-tab-pane>
<el-tab-pane label="閲囬泦鏁版嵁鏍囩璁剧疆">
-
+ <scFormTable ref="table1" v-model="Tabledata" stripe hideDelete :addTemplate="addTemplate">
+ <el-table-column label="鏁版嵁鏍囩" prop="usageName">
+ <template #default="scope">
+ <el-input v-if="scope.row.isEdit" v-model="scope.row.usageName"></el-input>
+ <span v-else>{{ scope.row.usageName }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鏁版嵁鏍囩鏍囪瘑" prop="usageCode">
+ <template #default="scope">
+ <el-input v-if="scope.row.isEdit" v-model="scope.row.usageCode"></el-input>
+ <span v-else>{{ scope.row.usageCode }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="璁$畻鏂规硶" prop="dataTypeDesc">
+ <template #default="scope">
+ <el-select v-if="scope.row.isEdit" v-model="scope.row.collectType" style="width: 100%;"
+ @change="update(scope.row)">
+ <el-option v-for="(item, index) in options.rps" :key="index" :label="item.label"
+ :value="item.value"></el-option>
+ </el-select>
+ <span v-else>{{ scope.row.dataTypeDesc }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column label="鎿嶄綔" prop="state">
+ <template #default="scope">
+ <el-button v-show="!scope.row.id || !scope.row.isEdit"
+ @click="add(scope.row)">淇濆瓨</el-button>
+ <el-button v-show="!scope.row.isEdit" @click="edit(scope.row)">缂栬緫</el-button>
+ </template>
+ </el-table-column>
+ </scFormTable>
</el-tab-pane>
</el-tabs>
</el-card>
@@ -28,15 +58,52 @@
<script>
import Board from './configComp/Board.vue'
+import Status from './configComp/Status.vue'
+import Efficiency from './configComp/Efficiency.vue'
export default {
components: {
Board,
+ Status,
+ Efficiency
},
data() {
return {
- radio: ''
+ Tabledata: [],
+ addTemplate: {
+ collectType: '',
+ dataTypeDesc: '',
+ id: null,
+ parameter: {
+ value: 0
+ },
+ usageCode: '',
+ usageName: '',
+ isEdit: false,
+ }
}
},
+ created() {
+ this.getList()
+ },
+ methods: {
+ getList() {
+ this.$HTTP.get('/api/blade-cps/workstation-wcs-usage/list').then(res => {
+ if (res.code === 200) {
+ this.Tabledata = res.data
+ }
+ })
+ },
+ edit(row) {
+ row.isEdit = true
+ },
+ add(row) {
+ // /api/blade-cps/workstation-wcs-usage
+ // collectType
+ // usageCode
+ // usageName
+
+ }
+ }
}
</script>
diff --git a/src/views/setting/task/logs.vue b/src/views/setting/task/logs.vue
index 2697983..c94b8da 100644
--- a/src/views/setting/task/logs.vue
+++ b/src/views/setting/task/logs.vue
@@ -9,12 +9,13 @@
<template>
<el-container>
- <el-main style="padding:0 20px;">
+ <el-main style="padding:0 20px;">
<scTable ref="table" :data="data" stripe>
<el-table-column label="鎵ц鏃堕棿" prop="time" width="200"></el-table-column>
<el-table-column label="鎵ц缁撴灉" prop="state" width="100">
<template #default="scope">
- <span v-if="scope.row.state==200" style="color: #67C23A;"><el-icon><el-icon-success-filled /></el-icon></span>
+ <span v-if="scope.row.state == 200"
+ style="color: #67C23A;"><el-icon><el-icon-success-filled /></el-icon></span>
<span v-else style="color: #F56C6C;"><el-icon><el-icon-circle-close-filled /></el-icon></span>
</template>
</el-table-column>
@@ -28,18 +29,20 @@
</el-container>
<el-drawer title="鏃ュ織" v-model="logsVisible" :size="500" direction="rtl" destroy-on-close>
- <el-main style="padding:0 20px 20px 20px;">
- <pre style="font-size: 12px;color: #999;padding:20px;background: #333;font-family: consolas;line-height: 1.5;overflow: auto;">{{demoLog}}</pre>
+ <el-main style="padding:0 20px 20px 20px;">
+ <pre
+ style="font-size: 12px;color: #999;padding:20px;background: #333;font-family: consolas;line-height: 1.5;overflow: auto;">
+ {{ demoLog }}</pre>
</el-main>
</el-drawer>
</template>
<script>
- export default {
- data() {
- return {
- logsVisible: false,
- demoLog: `2021-07-07 12:35:00 [com.xxl.job.core.thread.JobThread#run]-[124]-[Thread-308]
+export default {
+ data() {
+ return {
+ logsVisible: false,
+ demoLog: `2021-07-07 12:35:00 [com.xxl.job.core.thread.JobThread#run]-[124]-[Thread-308]
----------- xxl-job job execute start -----------
----------- Param:
2021-07-07 12:35:00 [com.heronshn.reservation.jobhandler.AqshMasterDataSendHandler#execute]-[31]-[Thread-308] aqshMasterDataSendHandler start
@@ -54,55 +57,54 @@
----------- xxl-job job callback finish.
[Load Log Finish]`,
- data: [
- {
- time: "2021-07-07 00:00:00",
- state: "500",
- logs: ""
- },
- {
- time: "2021-07-06 00:00:00",
- state: "200",
- logs: ""
- },
- {
- time: "2021-07-05 00:00:00",
- state: "200",
- logs: ""
- },
- {
- time: "2021-07-04 00:00:00",
- state: "200",
- logs: ""
- },
- {
- time: "2021-07-03 00:00:00",
- state: "200",
- logs: ""
- },
- {
- time: "2021-07-02 00:00:00",
- state: "200",
- logs: ""
- },
- {
- time: "2021-07-01 00:00:00",
- state: "200",
- logs: ""
- }
- ]
- }
- },
- mounted() {
+ data: [
+ {
+ time: "2021-07-07 00:00:00",
+ state: "500",
+ logs: ""
+ },
+ {
+ time: "2021-07-06 00:00:00",
+ state: "200",
+ logs: ""
+ },
+ {
+ time: "2021-07-05 00:00:00",
+ state: "200",
+ logs: ""
+ },
+ {
+ time: "2021-07-04 00:00:00",
+ state: "200",
+ logs: ""
+ },
+ {
+ time: "2021-07-03 00:00:00",
+ state: "200",
+ logs: ""
+ },
+ {
+ time: "2021-07-02 00:00:00",
+ state: "200",
+ logs: ""
+ },
+ {
+ time: "2021-07-01 00:00:00",
+ state: "200",
+ logs: ""
+ }
+ ]
+ }
+ },
+ mounted() {
- },
- methods: {
- show(){
- this.logsVisible = true;
- }
+ },
+ methods: {
+ show() {
+ this.logsVisible = true;
}
}
+}
</script>
-<style>
-</style>
+<style></style>
--
Gitblit v1.9.3