调整指令复制接口
This commit is contained in:
parent
493a87cf38
commit
9e90adf9e9
@ -113,3 +113,12 @@ export function getCmdList(lineCode, params) {
|
||||
params: params
|
||||
});
|
||||
}
|
||||
|
||||
// 获取指令列表
|
||||
export function postCopyCmd(data) {
|
||||
return request({
|
||||
url: `/api/cmd/copy`,
|
||||
method: 'post',
|
||||
data
|
||||
});
|
||||
}
|
||||
|
@ -9,6 +9,7 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { postCopyCmd } from '@/api/management/dictionary'
|
||||
|
||||
export default {
|
||||
name: 'EditCondition',
|
||||
@ -22,7 +23,7 @@ export default {
|
||||
return {
|
||||
dialogVisible: false,
|
||||
formModel: {
|
||||
fromId: '',
|
||||
fromCode: '',
|
||||
fromName: '',
|
||||
targetIds: '',
|
||||
deviceType: []
|
||||
@ -78,12 +79,12 @@ export default {
|
||||
this.lineCode = lineCode;
|
||||
this.targetList = [];
|
||||
this.taskStatusList.forEach(item => {
|
||||
item.value = item.id;
|
||||
item.value = item.code;
|
||||
item.label = item.name;
|
||||
if (item.code != lineCode) {
|
||||
this.targetList.push(item);
|
||||
} else {
|
||||
this.formModel.fromId = item.id;
|
||||
this.formModel.fromCode = item.code;
|
||||
this.formModel.fromName = item.name;
|
||||
}
|
||||
})
|
||||
@ -92,8 +93,15 @@ export default {
|
||||
doSave() {
|
||||
const self = this;
|
||||
this.$refs.dataform.validateForm(() => {
|
||||
console.log('确定')
|
||||
this.handleClose();
|
||||
const param = {
|
||||
fromLineCode: this.formModel.fromCode,
|
||||
targetLineCodes: this.formModel.targetIds,
|
||||
operateObjects: this.formModel.deviceType
|
||||
}
|
||||
postCopyCmd(param).then(res => {
|
||||
this.handleClose();
|
||||
this.$message.success('复制指令成功!');
|
||||
})
|
||||
});
|
||||
},
|
||||
handleClose() {
|
||||
|
Loading…
Reference in New Issue
Block a user