提交: 优化配置管理更改后 刷新页面生效改为实时生效。优化 场景管理页中一些问题, 添加开启/停止,场景 操作
This commit is contained in:
parent
df2929ba2e
commit
af48e107ee
|
@ -206,3 +206,12 @@ export function projectSceneDelete(siteId) {
|
|||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
||||
// 查询 场景控制 修改状态
|
||||
export function projectSceneChangeStatus(data) {
|
||||
return request({
|
||||
url: '/iot/scene/changeStatus',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@
|
|||
:total="queryOption.page.total"
|
||||
:page.sync="queryOption.page.pageNum"
|
||||
:limit.sync="queryOption.page.pageSize"
|
||||
@pagination="handleQuery2"
|
||||
@pagination="handleQuery"
|
||||
/>
|
||||
</el-row>
|
||||
</div>
|
||||
|
@ -219,7 +219,7 @@ export default {
|
|||
},
|
||||
updated() {
|
||||
if (this.optionTrue && this.tableList.length <= 0) {
|
||||
this.handleQuery2();
|
||||
this.handleQuery();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
@ -239,13 +239,8 @@ export default {
|
|||
this.optionTrue = false
|
||||
this.getList(this.queryOption.page, this.queryOption.params);
|
||||
},
|
||||
handleQuery2() {
|
||||
this.optionTrue = false
|
||||
this.getList(this.queryOption.page, this.queryOption.params);
|
||||
},
|
||||
/** 重置按钮操作 */
|
||||
resetQuery() {
|
||||
this.dataList = [];
|
||||
this.resetForm("queryForm");
|
||||
this.queryOption.page.pageNum = 1;
|
||||
this.handleQuery();
|
||||
|
@ -275,12 +270,16 @@ export default {
|
|||
},
|
||||
created() {
|
||||
this.params = this.queryOption.params;
|
||||
this.handleQuery2();
|
||||
this.handleQuery();
|
||||
},
|
||||
watch: {
|
||||
tableList(value) {
|
||||
this.dataList = value;
|
||||
tableList: {
|
||||
handler(val) {
|
||||
console.log('tableList--updata', val);
|
||||
this.dataList = [...val];
|
||||
this.tableOption.loading = false;
|
||||
},
|
||||
deep: true,
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
@ -19,9 +19,9 @@ const permission = {
|
|||
SET_SIDEBAR_ROUTERS: (state, routers) => {
|
||||
state.sidebarRouters = constantRoutes.concat(routers)
|
||||
},
|
||||
SET_ATTRIBUTE: (state, size) => {
|
||||
state.attribute = size
|
||||
}
|
||||
SET_ATTRIBUTE: (state, atribute) => {
|
||||
state.attribute = atribute
|
||||
},
|
||||
},
|
||||
actions: {
|
||||
// 生成路由
|
||||
|
@ -34,6 +34,14 @@ const permission = {
|
|||
})
|
||||
})
|
||||
},
|
||||
// 根据对象 属性更新
|
||||
SetAttributeByKey({ commit, state }, params) {
|
||||
return new Promise(resolve => {
|
||||
// 向后端请求路由数据
|
||||
console.log('請求--GetAttribute')
|
||||
commit('SET_ATTRIBUTE', Object.assign(state.attribute, params))
|
||||
})
|
||||
},
|
||||
// 生成路由
|
||||
GenerateRoutes({ commit }) {
|
||||
return new Promise(resolve => {
|
||||
|
|
|
@ -217,26 +217,30 @@ export default {
|
|||
width: 20px;
|
||||
height: 20px;
|
||||
display: flex;
|
||||
-webkit-box-align: center;
|
||||
-ms-flex-align: center;
|
||||
align-items: center;
|
||||
justify-content: left;
|
||||
-webkit-box-pack: left;
|
||||
-ms-flex-pack: left;
|
||||
border: 1px solid #e9e9e9;
|
||||
border-radius: 0 50% 50% 0;
|
||||
border-radius: 50%;
|
||||
position: relative;
|
||||
left: 40px;
|
||||
font-size: 15px;
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
border-left: 0;
|
||||
top: -14px;
|
||||
top: -10px;
|
||||
justify-content: center;
|
||||
background: #ffffff;
|
||||
}
|
||||
.e-shrink:hover {
|
||||
border-color: #4395ff;
|
||||
color: #4395ff;
|
||||
}
|
||||
.is-shrink-true {
|
||||
left: 40px;
|
||||
left: 30px;
|
||||
}
|
||||
.is-shrink-false {
|
||||
left: 100%;
|
||||
left: calc(100% - 10px);
|
||||
}
|
||||
.nav-menu-item {
|
||||
width: 100%;
|
||||
|
|
|
@ -11,5 +11,7 @@ export const defaultConfig = {
|
|||
|
||||
export const notifierType = {
|
||||
SMS: '短信',
|
||||
WEEXIN: '微信'
|
||||
WECHAT: '微信',
|
||||
EMAIL: '邮件',
|
||||
VOICE: '语音'
|
||||
}
|
||||
|
|
|
@ -70,7 +70,7 @@
|
|||
>
|
||||
<el-option
|
||||
v-for="(keys, valus) in strtoJson(paramsItem.funObj)"
|
||||
:key="getGuid()"
|
||||
:key="valus + getGuid()"
|
||||
:label="keys"
|
||||
:value="valus"
|
||||
></el-option>
|
||||
|
@ -115,7 +115,7 @@
|
|||
</el-row>
|
||||
|
||||
<el-dialog
|
||||
title="选择"
|
||||
title="选择设备"
|
||||
:visible.sync="selectTableShow"
|
||||
width="75%"
|
||||
top="10vh"
|
||||
|
@ -127,7 +127,7 @@
|
|||
v-if="selectTableShow"
|
||||
:tableOption="tableSelectOption.tableOpt"
|
||||
:queryOption="tableSelectOption.queryOpt"
|
||||
:tableList="tableSelectOption.tableList"
|
||||
:tableList="tableList"
|
||||
@parentGetList="childGetList($event)"
|
||||
:otherOption="tableSelectOption.otherOption"
|
||||
@returnEvent="returnEvent($event)"
|
||||
|
@ -161,7 +161,7 @@ export default {
|
|||
components: {
|
||||
SelectTableWrap,
|
||||
},
|
||||
props: ["paramsDevcie", "tempIndex", "deleteButtonD", "disabled"],
|
||||
props: ["paramsDevcie", "tempIndex", "deleteButtonD", "disabled", 'sourceId'],
|
||||
data() {
|
||||
return {
|
||||
tableSelectOption: {},
|
||||
|
@ -171,6 +171,7 @@ export default {
|
|||
comdlistOption: [],
|
||||
cmdKey: "",
|
||||
ctlJson: {},
|
||||
tableList: [],
|
||||
farstInput: true,
|
||||
form: {
|
||||
deviceName: "",
|
||||
|
@ -289,6 +290,7 @@ export default {
|
|||
labelWidth: "68px",
|
||||
params: {
|
||||
deviceName: "",
|
||||
projectId: this.sourceId
|
||||
},
|
||||
page: {
|
||||
pageSize: 10,
|
||||
|
@ -403,6 +405,7 @@ export default {
|
|||
deviceChildList(data) {
|
||||
getDeviceList(Object.assign(data.page, data.param)).then((res) => {
|
||||
this.tableSelectOption.tableList = res.rows;
|
||||
this.tableList = res.rows;
|
||||
this.tableSelectOption.queryOpt.page.total = Number(res.total);
|
||||
this.$forceUpdate();
|
||||
});
|
||||
|
@ -412,8 +415,8 @@ export default {
|
|||
</script>
|
||||
<style lang="scss">
|
||||
.e-scene-param {
|
||||
padding: 10px 5px;
|
||||
background-color: #e4e3e3;
|
||||
padding: 0 5px 10px 5px;
|
||||
// background-color: #e4e3e3;
|
||||
margin-top: 5px;
|
||||
.param-wrap {
|
||||
height: 100%;
|
||||
|
|
|
@ -14,7 +14,11 @@ export default {
|
|||
inputWidth: {
|
||||
type: String,
|
||||
default: '200'
|
||||
}
|
||||
},
|
||||
sourceId: {
|
||||
type: [Number, String],
|
||||
require: true,
|
||||
},
|
||||
},
|
||||
components: { ESelect, EDeviceParam },
|
||||
data() {
|
||||
|
@ -132,7 +136,7 @@ export default {
|
|||
},
|
||||
},
|
||||
render() {
|
||||
const { dataItem, inputWidth } = this;
|
||||
const { dataItem, inputWidth, sourceId } = this;
|
||||
return (
|
||||
<div class="e-scene-action">
|
||||
{
|
||||
|
@ -166,6 +170,7 @@ export default {
|
|||
<e-device-param
|
||||
ref="paramsWrap"
|
||||
disabled={false}
|
||||
sourceId={sourceId}
|
||||
deleteButtonD={false}
|
||||
paramsDevcie={dataItem.sceneActionDevices[0] || {}}
|
||||
onChange={this.handleParamsChange}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<template>
|
||||
<div>
|
||||
<easy-cron
|
||||
:hideSecond="false"
|
||||
:disabled="false"
|
||||
style="width: 100%;"
|
||||
v-model="stateValue"
|
||||
:exeStartTime="exeStartTime"
|
||||
></easy-cron>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import EasyCron from "@/components/EasyCron";
|
||||
import CronValidator from "@/components/EasyCron/validator";
|
||||
export default {
|
||||
name: 'ECronForm',
|
||||
components: {
|
||||
EasyCron,
|
||||
CronValidator
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
exeStartTime: {
|
||||
type: [Number, String, Date],
|
||||
default: () => {
|
||||
this.parseTime(new Date(), "{y}-{m}-{d} {h}:{i}:{s}")
|
||||
}
|
||||
},
|
||||
},
|
||||
watch: {
|
||||
value() {
|
||||
this.stateValue = this.value || '* * * * * ? *';
|
||||
},
|
||||
stateValue() {
|
||||
this.$emit('change', this.stateValue);
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
stateValue: ''
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
</script>
|
|
@ -2,7 +2,7 @@
|
|||
<div>
|
||||
<div :style="`width: ${pwidth};`" @click="openTableSelectDialog">
|
||||
<el-input
|
||||
placeholder="点击选择站点"
|
||||
placeholder="点击选择设备"
|
||||
v-model="form['deviceName']"
|
||||
:clearable="pclearable"
|
||||
:size="psize"
|
||||
|
@ -12,7 +12,7 @@
|
|||
</el-input>
|
||||
</div>
|
||||
<el-dialog
|
||||
title="选择站点"
|
||||
title="选择设备"
|
||||
:visible.sync="selectTableShow"
|
||||
width="75%"
|
||||
top="10vh"
|
||||
|
@ -70,6 +70,11 @@ export default {
|
|||
type: Object,
|
||||
default: {},
|
||||
},
|
||||
param: {
|
||||
type: Object,
|
||||
require: false,
|
||||
default: {}
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
|
|
@ -3,8 +3,7 @@ import { triggerMethod, defaultConfig } from "../config"
|
|||
import selectMethod from './ESelect'
|
||||
import ESelectDevice from './ESelectDevice'
|
||||
import EConditionTemp from './EConditionTemp'
|
||||
import EasyCron from "@/components/EasyCron";
|
||||
import CronValidator from "@/components/EasyCron/validator";
|
||||
import ECronForm from './ECronForm'
|
||||
|
||||
|
||||
export default {
|
||||
|
@ -16,13 +15,18 @@ export default {
|
|||
inputWidth: {
|
||||
type: String,
|
||||
default: '200'
|
||||
}
|
||||
},
|
||||
components: { selectMethod, ESelectDevice, EConditionTemp, EasyCron },
|
||||
sourceId: {
|
||||
type: [Number, String],
|
||||
require: true,
|
||||
},
|
||||
},
|
||||
components: { selectMethod, ESelectDevice, EConditionTemp, ECronForm },
|
||||
data() {
|
||||
return {
|
||||
method: 'DEVICE',
|
||||
exeStartTime: "",
|
||||
open: false
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
|
@ -68,9 +72,15 @@ export default {
|
|||
handleDelTrigger() {
|
||||
this.$emit('handleDel')
|
||||
},
|
||||
handleCronSubmit() {
|
||||
if (!this.dataItem['execScript']) {
|
||||
this.dataItem['execScript'] = '* * * * * ? *';
|
||||
}
|
||||
this.open = false
|
||||
}
|
||||
},
|
||||
render() {
|
||||
const { dataItem, inputWidth } = this;
|
||||
const { dataItem, inputWidth, sourceId } = this;
|
||||
return (
|
||||
<div class="e-scene-trigger">
|
||||
{
|
||||
|
@ -95,6 +105,7 @@ export default {
|
|||
<div class="b-select-device">
|
||||
<e-select-device
|
||||
form={dataItem.sceneTriggerDevices[0] || {}}
|
||||
param={{projectId: sourceId}}
|
||||
onInput={this.handleDeviceChange}
|
||||
pwidth={inputWidth}/>
|
||||
</div>
|
||||
|
@ -115,15 +126,35 @@ export default {
|
|||
{
|
||||
dataItem.method === 'TIMER' ?
|
||||
<div>
|
||||
<easy-cron
|
||||
hideSecond={false}
|
||||
disabled={false}
|
||||
style="width: 100%;"
|
||||
v-model={dataItem['execScript']}
|
||||
exeStartTime={this.exeStartTime}
|
||||
></easy-cron>
|
||||
<el-input placeholder="请输入内容" v-model={dataItem['execScript']}>
|
||||
<el-button slot="append" onClick={() => { this.open = true}} icon="el-icon-connection"></el-button>
|
||||
</el-input>
|
||||
</div> : null
|
||||
}
|
||||
<el-dialog
|
||||
title="cron-表达式"
|
||||
visible={this.open}
|
||||
onClose={() => {this.open = false}}
|
||||
class="eldialog-wrap"
|
||||
width="880px"
|
||||
append-to-body
|
||||
close-on-click-modal={true}
|
||||
>
|
||||
<e-cron-form
|
||||
ref="eCronForm"
|
||||
style="margin: 20px;"
|
||||
value={dataItem['execScript']}
|
||||
onChange={(e) => {
|
||||
dataItem['execScript'] = e;
|
||||
}}
|
||||
exeStartTime={this.exeStartTime}
|
||||
/>
|
||||
|
||||
<div slot="footer" class="dialog-footer" style="padding-right: 10px;">
|
||||
<el-button type="primary" size="mini" onClick={this.handleCronSubmit} >确 定</el-button>
|
||||
</div>
|
||||
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
: null
|
||||
|
|
|
@ -40,6 +40,18 @@
|
|||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="场景编码"
|
||||
align="left"
|
||||
width="200"
|
||||
prop="sceneCode"
|
||||
>
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea" :title="scope.row.sceneCode">
|
||||
{{ scope.row.sceneCode }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="场景模式"
|
||||
align="left"
|
||||
|
@ -55,7 +67,6 @@
|
|||
|
||||
<el-table-column
|
||||
label="状态"
|
||||
width="150px"
|
||||
align="center"
|
||||
prop="runStatus"
|
||||
>
|
||||
|
@ -66,13 +77,21 @@
|
|||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="执行设备" align="left" prop="triggerDevices">
|
||||
<el-table-column label="创建时间" align="center" width="160px" prop="createTime">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea" :title="scope.row.createTime">
|
||||
{{ scope.row.createTime }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<!-- <el-table-column label="执行设备" align="left" prop="triggerDevices">
|
||||
<template slot-scope="scope">
|
||||
<span class="lay-table-textarea" :title="scope.row.triggerDevices">
|
||||
{{ scope.row.triggerDevices }}
|
||||
</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table-column> -->
|
||||
<el-table-column
|
||||
label="操作"
|
||||
align="center"
|
||||
|
@ -88,6 +107,14 @@
|
|||
>编辑</el-button
|
||||
>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
:icon="scope.row.runStatus ? 'el-icon-video-pause' : 'el-icon-video-play'"
|
||||
@click="handleChangeStatus(scope.row)"
|
||||
>{{ scope.row.runStatus ? '停止' : '启用' }}</el-button
|
||||
>
|
||||
|
||||
<el-button
|
||||
size="mini"
|
||||
type="text"
|
||||
|
@ -122,7 +149,13 @@
|
|||
append-to-body
|
||||
:close-on-click-modal="false"
|
||||
>
|
||||
<el-form ref="form" :model="form" style="padding-right: 20px;" :rules="rules" label-width="100px">
|
||||
<el-form
|
||||
ref="form"
|
||||
:model="form"
|
||||
style="padding-right: 20px"
|
||||
:rules="rules"
|
||||
label-width="100px"
|
||||
>
|
||||
<el-row :gutter="10">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="场景名称:" prop="sceneName">
|
||||
|
@ -173,6 +206,7 @@
|
|||
<e-scene-triggers
|
||||
slot="body"
|
||||
:dataItem="item"
|
||||
:sourceId="sourceId"
|
||||
@change="
|
||||
(v) => {
|
||||
form.triggers[idx] = v;
|
||||
|
@ -219,6 +253,7 @@
|
|||
<e-scene-action
|
||||
slot="body"
|
||||
:dataItem="item"
|
||||
:sourceId="sourceId"
|
||||
@change="
|
||||
(v) => {
|
||||
form.actions[idx] = v;
|
||||
|
@ -242,7 +277,9 @@
|
|||
</el-row>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="primary" size="mini" @click="submitForm">确 定</el-button>
|
||||
<el-button type="primary" size="mini" @click="submitForm"
|
||||
>确 定</el-button
|
||||
>
|
||||
<el-button @click="cancel" size="mini">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
@ -255,7 +292,8 @@ import {
|
|||
projectSceneAdd,
|
||||
projectSceneUpdate,
|
||||
projectSceneDetail,
|
||||
projectSceneDelete
|
||||
projectSceneDelete,
|
||||
projectSceneChangeStatus
|
||||
} from "@/api/iot/project_new";
|
||||
import DialogTemplate from "@/components/DialogTemplate";
|
||||
import ESceneTriggers from "./ESceneTriggers/index";
|
||||
|
@ -297,6 +335,8 @@ export default {
|
|||
page: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
orderByColumn: "createTime",
|
||||
isAsc: "desc"
|
||||
},
|
||||
title: "新增场景",
|
||||
total: 0,
|
||||
|
@ -311,7 +351,11 @@ export default {
|
|||
{ required: true, message: "场景名称不能为空", trigger: "change" },
|
||||
],
|
||||
sceneCode: [
|
||||
{ required: true, validator: this.chenking_sceneCode, trigger: "change" },
|
||||
{
|
||||
required: true,
|
||||
validator: this.chenking_sceneCode,
|
||||
trigger: "change",
|
||||
},
|
||||
],
|
||||
},
|
||||
};
|
||||
|
@ -369,10 +413,10 @@ export default {
|
|||
orderBy: triggersPop ? triggersPop.orderBy + 1 : 1,
|
||||
method: "",
|
||||
conditions: [],
|
||||
intervalVal: '',
|
||||
intervalVal: "",
|
||||
intervalUnit: "SECONDS",
|
||||
sceneTriggerDevices: [],
|
||||
execScript: ''
|
||||
execScript: "",
|
||||
};
|
||||
this.form.triggers.push(obj);
|
||||
},
|
||||
|
@ -383,16 +427,19 @@ export default {
|
|||
return false;
|
||||
}
|
||||
var isTrue = true;
|
||||
this.form.triggers.forEach(e => {
|
||||
this.form.triggers.forEach((e) => {
|
||||
if (!e.method) {
|
||||
this.msgError("设备触发__至少选择一种类型!");
|
||||
isTrue = false;
|
||||
}
|
||||
if (e.method === 'DEVICE' && (!e.conditions || e.conditions.length <= 0 )) {
|
||||
if (
|
||||
e.method === "DEVICE" &&
|
||||
(!e.conditions || e.conditions.length <= 0)
|
||||
) {
|
||||
this.msgError("设备触发__至少选择一条设备以及触发条件!");
|
||||
isTrue = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
return isTrue && this.validateAction();
|
||||
},
|
||||
// 验证 执行条件
|
||||
|
@ -402,19 +449,25 @@ export default {
|
|||
return false;
|
||||
}
|
||||
var isTrue = true;
|
||||
this.form.actions.forEach(e => {
|
||||
if (e.actionType === 'DEVOUTPUT' && (
|
||||
e.sceneActionDevices[0] && (!e.sceneActionDevices[0]['cmdKey'] || !e.sceneActionDevices[0]['deviceKey'] )
|
||||
)) {
|
||||
this.form.actions.forEach((e) => {
|
||||
if (
|
||||
e.actionType === "DEVOUTPUT" &&
|
||||
e.sceneActionDevices[0] &&
|
||||
(!e.sceneActionDevices[0]["cmdKey"] ||
|
||||
!e.sceneActionDevices[0]["deviceKey"])
|
||||
) {
|
||||
this.msgError("执行条件中有条件未选择设备或者分组!");
|
||||
isTrue = false;
|
||||
}
|
||||
if (e.actionType === 'NOTIFIER' &&
|
||||
(!e.sceneActionNotifierContacts[0] || !e.sceneActionNotifierContacts[0]['contactsRelList'])) {
|
||||
if (
|
||||
e.actionType === "NOTIFIER" &&
|
||||
(!e.sceneActionNotifierContacts[0] ||
|
||||
!e.sceneActionNotifierContacts[0]["contactsRelList"])
|
||||
) {
|
||||
this.msgError("执行条件中有条件未选择联系人!");
|
||||
isTrue = false;
|
||||
}
|
||||
})
|
||||
});
|
||||
return isTrue;
|
||||
},
|
||||
submitForm() {
|
||||
|
@ -422,13 +475,21 @@ export default {
|
|||
this.$refs["form"].validate((valid) => {
|
||||
if (valid && this.validateTrigger()) {
|
||||
if (this.form.recordId != null) {
|
||||
projectSceneUpdate(this.form).then((response) => {
|
||||
projectSceneUpdate(
|
||||
Object.assign(this.form, {
|
||||
projectId: this.sourceId,
|
||||
})
|
||||
).then((response) => {
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
this.handleQuery();
|
||||
});
|
||||
} else {
|
||||
projectSceneAdd(this.form).then((response) => {
|
||||
projectSceneAdd(
|
||||
Object.assign(this.form, {
|
||||
projectId: this.sourceId,
|
||||
})
|
||||
).then((response) => {
|
||||
this.msgSuccess("新增成功");
|
||||
this.open = false;
|
||||
this.handleQuery();
|
||||
|
@ -454,12 +515,29 @@ export default {
|
|||
this.title = "编辑场景";
|
||||
});
|
||||
},
|
||||
handleChangeStatus(row) {
|
||||
this.$confirm(row.runStatus ? '是否停止场景?' : '是否开启场景?', "提示", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return projectSceneChangeStatus({
|
||||
recordId: row.recordId,
|
||||
runStatus: row.runStatus ? false : true
|
||||
});
|
||||
})
|
||||
.then(() => {
|
||||
this.handleQuery();
|
||||
this.msgSuccess("成功");
|
||||
});
|
||||
},
|
||||
handleDelete(row) {
|
||||
const projectIds = row.recordId;
|
||||
this.$confirm("是否删除该选项?", "警告", {
|
||||
confirmButtonText: "确定",
|
||||
cancelButtonText: "取消",
|
||||
type: "warning"
|
||||
type: "warning",
|
||||
})
|
||||
.then(function () {
|
||||
return projectSceneDelete(projectIds);
|
||||
|
@ -510,7 +588,7 @@ export default {
|
|||
this.tableLoading = false;
|
||||
this.total = res.total;
|
||||
});
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
|
|
@ -296,17 +296,27 @@ export default {
|
|||
if (valid) {
|
||||
if (this.form.recordId != null) {
|
||||
updateAttribute(this.form).then((response) => {
|
||||
this.$router.go(0);
|
||||
if (response.msg === '操作成功') {
|
||||
this.$store.dispatch("SetAttributeByKey", {
|
||||
[this.form.enterpriseAttribute]: this.form.attributeValue
|
||||
})
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
// this.getList();
|
||||
} else {
|
||||
this.msgError(response.msg);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
addAttribute(this.form).then((response) => {
|
||||
this.$router.go(0);
|
||||
this.msgSuccess("新增成功");
|
||||
if (response.msg === '操作成功') {
|
||||
this.$store.dispatch("SetAttributeByKey", {
|
||||
[this.form.enterpriseAttribute]: this.form.attributeValue
|
||||
})
|
||||
this.msgSuccess("修改成功");
|
||||
this.open = false;
|
||||
// this.getList();
|
||||
} else {
|
||||
this.msgError(response.msg);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue