@jx3box/jx3box-common-ui 7.7.0 → 7.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/bread/ListAdmin.vue +26 -3
package/package.json
CHANGED
package/src/bread/ListAdmin.vue
CHANGED
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
<el-tag size="medium" :type="item.status ? '' : 'info'">{{ item.name }}</el-tag>
|
|
25
25
|
<div class="m-bucket-op">
|
|
26
26
|
<el-button :type="item.status ? 'warning' : 'success'" plain size="mini" class="u-op-btn" :icon="item.status ? 'el-icon-download' : 'el-icon-upload2'" @click="update(item.id, item.status)">{{ item.status ? '下架' : '上架' }}</el-button>
|
|
27
|
+
<el-button @click="edit(item)" plain size="mini" icon="el-icon-edit">修改</el-button>
|
|
27
28
|
<el-button type="info" plain size="mini" class="u-op-btn" icon="el-icon-delete" @click="del(item.id)">删除</el-button>
|
|
28
29
|
</div>
|
|
29
30
|
</div>
|
|
@@ -31,8 +32,8 @@
|
|
|
31
32
|
<el-empty v-else description="暂无主题"></el-empty>
|
|
32
33
|
|
|
33
34
|
<div class="c-admin-buttons">
|
|
34
|
-
|
|
35
|
-
<el-button type="plain" @click="close">关闭</el-button>
|
|
35
|
+
<el-button type="success" @click="add" icon="el-icon-plus">新增</el-button>
|
|
36
|
+
<!-- <el-button type="plain" @click="close" icon="el-icon-close">关闭</el-button> -->
|
|
36
37
|
</div>
|
|
37
38
|
</div>
|
|
38
39
|
</el-drawer>
|
|
@@ -119,7 +120,7 @@ export default {
|
|
|
119
120
|
});
|
|
120
121
|
},
|
|
121
122
|
add() {
|
|
122
|
-
this.$prompt("请输入主题名称", "
|
|
123
|
+
this.$prompt("请输入主题名称", "新增主题", {
|
|
123
124
|
confirmButtonText: "确定",
|
|
124
125
|
cancelButtonText: "取消",
|
|
125
126
|
inputPattern: /\S+/,
|
|
@@ -140,6 +141,28 @@ export default {
|
|
|
140
141
|
})
|
|
141
142
|
.catch(() => {});
|
|
142
143
|
},
|
|
144
|
+
edit(item) {
|
|
145
|
+
this.$prompt("请输入主题名称", "修改主题", {
|
|
146
|
+
confirmButtonText: "确定",
|
|
147
|
+
cancelButtonText: "取消",
|
|
148
|
+
inputPattern: /\S+/,
|
|
149
|
+
inputErrorMessage: "主题名称不能为空",
|
|
150
|
+
inputValue: item.name,
|
|
151
|
+
})
|
|
152
|
+
.then(({ value }) => {
|
|
153
|
+
const data = {
|
|
154
|
+
name: value,
|
|
155
|
+
};
|
|
156
|
+
updateTopicBucket(item.id, data).then((res) => {
|
|
157
|
+
this.$message({
|
|
158
|
+
type: "success",
|
|
159
|
+
message: "修改成功!",
|
|
160
|
+
});
|
|
161
|
+
this.loadData();
|
|
162
|
+
});
|
|
163
|
+
})
|
|
164
|
+
.catch(() => {})
|
|
165
|
+
}
|
|
143
166
|
},
|
|
144
167
|
};
|
|
145
168
|
</script>
|