n20-common-lib 3.0.33 → 3.0.34

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n20-common-lib",
3
- "version": "3.0.33",
3
+ "version": "3.0.34",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "serve": "vue-cli-service serve",
@@ -89,7 +89,7 @@
89
89
  :destroy-on-close="true"
90
90
  :close-on-click-modal="false"
91
91
  >
92
- <el-form ref="form" :model="form" label-width="80px" :inline="false" size="normal" label-position="top">
92
+ <el-form ref="stform" :model="form" label-width="80px" :inline="false" size="normal" label-position="top">
93
93
  <el-form-item
94
94
  :label="$lc('视图名称')"
95
95
  prop="viewName"
@@ -226,23 +226,22 @@ export default {
226
226
  methods: {
227
227
  // 保存视图
228
228
  saveSt() {
229
- if (this.form.viewName === '') {
230
- this.$message.warning('请输入视图名称')
231
- }
232
- // 保存筛选视图
233
- const obj = {
234
- viewName: this.form.viewName,
235
- viewType: '0',
236
- bussId: this.bussId,
237
- viewConfig: JSON.stringify(this.model),
238
- keyIds: JSON.stringify(this.checkList)
239
- }
240
- console.log(obj, 'obj')
241
- axios.post(`/bems/query/viewColumn/saveOrUpdateViewInfo`, obj).then((res) => {
242
- if (res.code === 200) {
243
- this.stVisible = false
244
- this.$message.success('保存成功')
245
- this.$emit('refresh')
229
+ this.$refs.stform.validate(async (valid) => {
230
+ if (valid) {
231
+ // 保存筛选视图
232
+ const obj = {
233
+ viewName: this.form.viewName,
234
+ viewType: '0',
235
+ bussId: this.bussId,
236
+ viewConfig: JSON.stringify(this.model),
237
+ keyIds: JSON.stringify(this.checkList)
238
+ }
239
+ const { code } = await axios.post(`/bems/query/viewColumn/saveOrUpdateViewInfo`, obj)
240
+ if (code === 200) {
241
+ this.stVisible = false
242
+ this.$message.success('保存成功')
243
+ this.$emit('refresh')
244
+ }
246
245
  }
247
246
  })
248
247
  },
@@ -403,13 +403,18 @@ export default {
403
403
  })
404
404
  },
405
405
  // 删除
406
- deleteOne() {
406
+ deleteOne(row) {
407
407
  this.$msgboxPor({
408
408
  title: '确认要删除吗?',
409
409
  message: '内容从页面删除,将不可恢复',
410
410
  type: 'error',
411
411
  confirmButtonText: '确定',
412
412
  cancelButtonText: '取消'
413
+ }).then(async () => {
414
+ const { code } = await axios.post('/bems/query/viewColumn/deleteViewInfo', { viewId: row.viewId })
415
+ if (code !== 200) return
416
+ this.$message.success('删除成功')
417
+ this.getFilterList()
413
418
  })
414
419
  },
415
420
  // 选中视图