|
@@ -94,12 +94,17 @@
|
|
<el-dialog title="关联导航池" :visible.sync="dialogTableVisible" width="50%" :close-on-click-modal="false">
|
|
<el-dialog title="关联导航池" :visible.sync="dialogTableVisible" width="50%" :close-on-click-modal="false">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
|
|
<el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-width="120px" class="demo-ruleForm">
|
|
<div class="dialogText">
|
|
<div class="dialogText">
|
|
- <el-form-item label="关联导航池:" prop="name">
|
|
|
|
|
|
+ <!-- <el-form-item label="关联导航池:" prop="name">
|
|
<el-select v-model="ruleForm.name" placeholder="请选择关联的导航池名称">
|
|
<el-select v-model="ruleForm.name" placeholder="请选择关联的导航池名称">
|
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
|
|
<el-option v-for="item in options" :key="item.id" :label="item.name" :value="item.id">
|
|
</el-option>
|
|
</el-option>
|
|
</el-select>
|
|
</el-select>
|
|
- </el-form-item>
|
|
|
|
|
|
+ </el-form-item> -->
|
|
|
|
+
|
|
|
|
+ <el-form-item label="关联导航池:" :label-width="formLabelWidth" class="custom-align-right">
|
|
|
|
+ <el-cascader :key="parentKey" v-model="ruleForm.name" placeholder="请选择关联的导航池名称"
|
|
|
|
+ :props="parentData" filterable clearable></el-cascader>
|
|
|
|
+ </el-form-item>
|
|
</div>
|
|
</div>
|
|
<div class="dialogBtn">
|
|
<div class="dialogBtn">
|
|
<button class="cancel" @click="cancelForm">取消</button>
|
|
<button class="cancel" @click="cancelForm">取消</button>
|
|
@@ -124,6 +129,7 @@ export default {
|
|
tableTitle,//表格标题
|
|
tableTitle,//表格标题
|
|
},
|
|
},
|
|
data() {
|
|
data() {
|
|
|
|
+ let self = this;
|
|
return {
|
|
return {
|
|
tableDivTitle: "任务规则列表",//表格标题
|
|
tableDivTitle: "任务规则列表",//表格标题
|
|
// searchWebName: "", //搜索网站名称
|
|
// searchWebName: "", //搜索网站名称
|
|
@@ -145,6 +151,9 @@ export default {
|
|
pageSize: 10,
|
|
pageSize: 10,
|
|
total: 20,
|
|
total: 20,
|
|
|
|
|
|
|
|
+ //查询状态
|
|
|
|
+ setTime: '',
|
|
|
|
+ listStatus: false,
|
|
|
|
|
|
navigationPoolBoo: false, //是否关联导航池
|
|
navigationPoolBoo: false, //是否关联导航池
|
|
|
|
|
|
@@ -173,7 +182,35 @@ export default {
|
|
value: '1',
|
|
value: '1',
|
|
label: '已导入'
|
|
label: '已导入'
|
|
},
|
|
},
|
|
- ]
|
|
|
|
|
|
+ ],
|
|
|
|
+ formLabelWidth:'120px',
|
|
|
|
+ parentKey: 0,//获取父级导航
|
|
|
|
+ parentData: {
|
|
|
|
+ checkStrictly: true,
|
|
|
|
+ lazy: true,
|
|
|
|
+ async lazyLoad(node, resolve) {
|
|
|
|
+ const { level, data } = node;
|
|
|
|
+ if (data && data.children && data.children.length !== 0) {
|
|
|
|
+ return resolve(node)
|
|
|
|
+ }
|
|
|
|
+ console.log(level)
|
|
|
|
+ let parentId = level == 0 ? 0 : data.value
|
|
|
|
+ let parames = {
|
|
|
|
+ 'pid': parentId
|
|
|
|
+ }
|
|
|
|
+ self.$store.dispatch('pool/categoryList', parames).then(res => {
|
|
|
|
+ if (res.data) {
|
|
|
|
+ const nodes = res.data.map(item => ({
|
|
|
|
+ value: item.id,
|
|
|
|
+ label: item.name,
|
|
|
|
+ leaf: level >= 3,
|
|
|
|
+ children: []
|
|
|
|
+ }))
|
|
|
|
+ resolve(nodes)
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ }
|
|
|
|
+ },
|
|
}
|
|
}
|
|
},
|
|
},
|
|
mounted() {
|
|
mounted() {
|
|
@@ -198,26 +235,33 @@ export default {
|
|
|
|
|
|
this.total = data.data.count
|
|
this.total = data.data.count
|
|
this.tableData = data.data.rep
|
|
this.tableData = data.data.rep
|
|
-
|
|
|
|
- let status = false;
|
|
|
|
|
|
+
|
|
for (let item of this.tableData) {
|
|
for (let item of this.tableData) {
|
|
if (item.state == 1) {
|
|
if (item.state == 1) {
|
|
item.state = "已导入"
|
|
item.state = "已导入"
|
|
} else {
|
|
} else {
|
|
item.state = "未导入";
|
|
item.state = "未导入";
|
|
- status = true;
|
|
|
|
|
|
+ this.listStatus = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if(status){
|
|
|
|
- this.$message.error("有未导入的资讯!")
|
|
|
|
- }else{
|
|
|
|
|
|
+
|
|
|
|
+ console.log(this.listStatus);
|
|
|
|
+ if (this.listStatus) {
|
|
|
|
+
|
|
|
|
+ } else {
|
|
|
|
+ this.clearTask()
|
|
this.$message.success("导入成功!")
|
|
this.$message.success("导入成功!")
|
|
}
|
|
}
|
|
-
|
|
|
|
})
|
|
})
|
|
},
|
|
},
|
|
- abc(){
|
|
|
|
- this.$message.error("abc!")
|
|
|
|
|
|
+ setTask() {
|
|
|
|
+ let that = this;
|
|
|
|
+ this.setTime = setInterval(() => {
|
|
|
|
+ that.getData();
|
|
|
|
+ }, 5000)
|
|
|
|
+ },
|
|
|
|
+ clearTask() {
|
|
|
|
+ clearInterval(this.setTime)
|
|
},
|
|
},
|
|
//1.2 删除内容
|
|
//1.2 删除内容
|
|
deleteRow(id, val) {
|
|
deleteRow(id, val) {
|
|
@@ -252,6 +296,7 @@ export default {
|
|
},
|
|
},
|
|
//1.3 修改网站状态
|
|
//1.3 修改网站状态
|
|
|
|
|
|
|
|
+
|
|
//1.4 列表内容分页
|
|
//1.4 列表内容分页
|
|
//直接跳转
|
|
//直接跳转
|
|
handleSizeChange(val) {
|
|
handleSizeChange(val) {
|
|
@@ -313,7 +358,7 @@ export default {
|
|
addCatid({
|
|
addCatid({
|
|
rule_id: this.ruleId,
|
|
rule_id: this.ruleId,
|
|
}).then(data => {
|
|
}).then(data => {
|
|
- console.log(data);
|
|
|
|
|
|
+ console.log('关联导航池', data);
|
|
if (data.code == 200) {
|
|
if (data.code == 200) {
|
|
this.dialogTableVisible = true
|
|
this.dialogTableVisible = true
|
|
this.options = data.data
|
|
this.options = data.data
|
|
@@ -336,9 +381,10 @@ export default {
|
|
|
|
|
|
//关联导航池的提交按钮
|
|
//关联导航池的提交按钮
|
|
submitForm() {
|
|
submitForm() {
|
|
|
|
+ //console.log(this.ruleForm.name);
|
|
addCatid({
|
|
addCatid({
|
|
rule_id: this.ruleId,//任务规则id
|
|
rule_id: this.ruleId,//任务规则id
|
|
- catid: this.ruleForm.name,//导航池栏目id
|
|
|
|
|
|
+ catid: this.ruleForm.name,//导航池栏目id
|
|
}).then(data => {
|
|
}).then(data => {
|
|
console.log(this.ruleForm.name);
|
|
console.log(this.ruleForm.name);
|
|
console.log(data);
|
|
console.log(data);
|
|
@@ -365,9 +411,9 @@ export default {
|
|
importMessage() {
|
|
importMessage() {
|
|
for (let item of this.tableData) {
|
|
for (let item of this.tableData) {
|
|
if (!item.category) {
|
|
if (!item.category) {
|
|
- this.navigationPoolBoo=true
|
|
|
|
|
|
+ this.navigationPoolBoo = true
|
|
} else {
|
|
} else {
|
|
- this.navigationPoolBoo=false
|
|
|
|
|
|
+ this.navigationPoolBoo = false
|
|
}
|
|
}
|
|
}
|
|
}
|
|
if (this.navigationPoolBoo) {
|
|
if (this.navigationPoolBoo) {
|
|
@@ -389,7 +435,9 @@ export default {
|
|
message: '导入中',
|
|
message: '导入中',
|
|
type: 'success'
|
|
type: 'success'
|
|
})
|
|
})
|
|
|
|
+
|
|
this.getData()
|
|
this.getData()
|
|
|
|
+ this.setTask()
|
|
}
|
|
}
|
|
if (data.code == 0) {
|
|
if (data.code == 0) {
|
|
this.$message({
|
|
this.$message({
|