diff --git a/src/store/modules/attribute.js b/src/store/modules/attribute.js
index dbef5110..58639a93 100644
--- a/src/store/modules/attribute.js
+++ b/src/store/modules/attribute.js
@@ -177,6 +177,14 @@ const attribute = {
EditEvent({ commit, state }, param) {
commit('UPDATE_EVENT', param)
},
+ // 修改 列表
+ UpdateFunctionList({ commit, state }, param) {
+ commit('SET_FUNCTION_LIST', param)
+ },
+ // 修改 列表
+ UpdateEventList({ commit, state }, param) {
+ commit('SET_EVENT_LIST', param)
+ },
// 删除分组 删除分组 判断分组是否有属性,有属性就不能删除
DeleteGroup({ commit, state }, idx) {
let groupItem = state.groupList[idx];
diff --git a/src/views/iot/device/index.vue b/src/views/iot/device/index.vue
index fbc87974..532f0809 100644
--- a/src/views/iot/device/index.vue
+++ b/src/views/iot/device/index.vue
@@ -877,7 +877,7 @@ export default {
}
],
deviceTag: [
- { required: true, message: "设备标签不能为空", trigger: "change" }
+ // { required: true, message: "设备标签不能为空", trigger: "change" }
]
},
deviceTypeList: {},
diff --git a/src/views/iot/device/profile/functionWrap.vue b/src/views/iot/device/profile/functionWrap.vue
index 02f234a3..4ee554f0 100644
--- a/src/views/iot/device/profile/functionWrap.vue
+++ b/src/views/iot/device/profile/functionWrap.vue
@@ -333,14 +333,12 @@
-
-
-
diff --git a/src/views/profile/attribute/eventView.vue b/src/views/profile/attribute/eventView.vue
index 6b31e2e3..845d48b7 100644
--- a/src/views/profile/attribute/eventView.vue
+++ b/src/views/profile/attribute/eventView.vue
@@ -33,9 +33,23 @@
align="center"
class-name="small-padding fixed-width"
label="操作"
- width="180px"
+ width="200px"
>
+ 上移
+ 下移
-
-
@@ -77,7 +83,6 @@
-
-
-
diff --git a/src/views/profile/attribute/functionView.vue b/src/views/profile/attribute/functionView.vue
index fa2731bb..6c01ea59 100644
--- a/src/views/profile/attribute/functionView.vue
+++ b/src/views/profile/attribute/functionView.vue
@@ -31,9 +31,23 @@
align="center"
class-name="small-padding fixed-width"
label="操作"
- width="180px"
+ width="200px"
>
+ 上移
+ 下移
{
this.$store.dispatch("GetFunctionList").then(res => {
- console.log("功能列表数据", res);
this.functionList = res;
this.$forceUpdate();
this.loading = false;
@@ -186,6 +199,55 @@ export default {
};
this.functionOpen = true;
},
+ /**
+ * 上移功能
+ * @param {Number} index 当前功能索引
+ */
+ handleMoveUp(index) {
+ if (index === 0) return; // 已经是第一个,不能再上移
+
+ // 交换当前项与上一项的位置
+ const temp = this.functionList[index];
+ this.$set(this.functionList, index, this.functionList[index - 1]);
+ this.$set(this.functionList, index - 1, temp);
+
+ // 保存到 store
+ this.$store.dispatch("UpdateFunctionList", this.functionList).then(() => {
+ this.$message({
+ type: 'success',
+ message: '上移成功!'
+ });
+ }).catch(err => {
+ this.$message.error("操作失败:" + err);
+ // 恢复原状
+ this.getList();
+ });
+ },
+
+ /**
+ * 下移功能
+ * @param {Number} index 当前功能索引
+ */
+ handleMoveDown(index) {
+ if (index === this.functionList.length - 1) return; // 已经是最后一个,不能再下移
+
+ // 交换当前项与下一项的位置
+ const temp = this.functionList[index];
+ this.$set(this.functionList, index, this.functionList[index + 1]);
+ this.$set(this.functionList, index + 1, temp);
+
+ // 保存到 store
+ this.$store.dispatch("UpdateFunctionList", this.functionList).then(() => {
+ this.$message({
+ type: 'success',
+ message: '下移成功!'
+ });
+ }).catch(err => {
+ this.$message.error("操作失败:" + err);
+ // 恢复原状
+ this.getList();
+ });
+ },
/** 修改按钮操作 */
handleUpdate(row, idx) {
@@ -318,8 +380,6 @@ export default {
}
}
.params-eldialog {
- .el-dialog__header {
- }
.el-dialog__body {
height: 100%;
max-height: calc(100vh - 200px);
diff --git a/src/views/system/dict/data.vue b/src/views/system/dict/data.vue
index e178e323..b1878c49 100644
--- a/src/views/system/dict/data.vue
+++ b/src/views/system/dict/data.vue
@@ -1,10 +1,11 @@
@@ -20,14 +21,14 @@
-
+
- 搜索
+ 搜索
重置
-
+
新增
导出
@@ -83,43 +84,43 @@
:default-sort="{prop: 'createTime', order: 'descending'}"
@sort-change="sortChange"
>
-
-
-
-
+
+
+
+
-
-
+
+
{{ parseTime(scope.row.createTime) }}
修改
删除
@@ -127,14 +128,14 @@
-
+
-
+
@@ -147,10 +148,10 @@
@@ -163,7 +164,7 @@
-
+