|
@@ -346,44 +346,49 @@ export default {
|
|
|
//2.0 导入资讯列表
|
|
|
importMessage() {
|
|
|
for (let item of this.tableData) {
|
|
|
- if (item.category.name == '') {
|
|
|
- this.$message({
|
|
|
- message: '还未关联导航池,请先关联导航池',
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
+ if (!item.category) {
|
|
|
+ this.navigationPoolBoo = true
|
|
|
} else {
|
|
|
- this.$confirm('', '是否确认将所有未导入的信息导入资讯列表?', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- }).then(() => {
|
|
|
- addArt({
|
|
|
- rule_id: this.ruleId
|
|
|
- }).then(data => {
|
|
|
- console.log(data);
|
|
|
- if (data.code == 200) {
|
|
|
- this.$message({
|
|
|
- message: '导入成功',
|
|
|
- type: 'success'
|
|
|
- })
|
|
|
- this.getData()
|
|
|
- }
|
|
|
- if (data.code == 0) {
|
|
|
- this.$message({
|
|
|
- message: data.message,
|
|
|
- type: 'error'
|
|
|
- })
|
|
|
- }
|
|
|
- })
|
|
|
- }).catch(() => {
|
|
|
- this.$message({
|
|
|
- type: 'warning',
|
|
|
- message: '已取消'
|
|
|
- });
|
|
|
- });
|
|
|
+ this.navigationPoolBoo = false
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+ if (this.navigationPoolBoo) {
|
|
|
+ this.$message({
|
|
|
+ message: '还未关联导航池,请先关联导航池',
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.$confirm('', '是否确认将所有未导入的信息导入资讯列表?', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ }).then(() => {
|
|
|
+ addArt({
|
|
|
+ rule_id: this.ruleId
|
|
|
+ }).then(data => {
|
|
|
+ console.log(data);
|
|
|
+ if (data.code == 200) {
|
|
|
+ this.$message({
|
|
|
+ message: '导入中',
|
|
|
+ type: 'success'
|
|
|
+ })
|
|
|
+
|
|
|
+ this.getData()
|
|
|
+ this.setTask()
|
|
|
+ }
|
|
|
+ if (data.code == 0) {
|
|
|
+ this.$message({
|
|
|
+ message: data.message,
|
|
|
+ type: 'error'
|
|
|
+ })
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message({
|
|
|
+ type: 'warning',
|
|
|
+ message: '已取消'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
},
|
|
|
}
|