1.页面修改

dev
862857010@qq.com 2 years ago
parent 8e265a9a80
commit fb40e57dac
  1. 203
      ruoyi-ui/src/views/system/management/marketing-data/info/index.vue

@ -62,41 +62,41 @@
>新增
</el-button>
</el-col>
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['marketingdata:info:edit']"-->
<!-- :disabled="single"-->
<!-- icon="el-icon-edit"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="success"-->
<!-- @click="handleUpdate"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['marketingdata:info:remove']"-->
<!-- :disabled="multiple"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="handleDelete"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['marketingdata:info:export']"-->
<!-- icon="el-icon-download"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="warning"-->
<!-- @click="handleExport"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['marketingdata:info:edit']"-->
<!-- :disabled="single"-->
<!-- icon="el-icon-edit"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="success"-->
<!-- @click="handleUpdate"-->
<!-- >修改-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['marketingdata:info:remove']"-->
<!-- :disabled="multiple"-->
<!-- icon="el-icon-delete"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="danger"-->
<!-- @click="handleDelete"-->
<!-- >删除-->
<!-- </el-button>-->
<!-- </el-col>-->
<!-- <el-col :span="1.5">-->
<!-- <el-button-->
<!-- v-hasPermi="['marketingdata:info:export']"-->
<!-- icon="el-icon-download"-->
<!-- plain-->
<!-- size="mini"-->
<!-- type="warning"-->
<!-- @click="handleExport"-->
<!-- >导出-->
<!-- </el-button>-->
<!-- </el-col>-->
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
@ -121,7 +121,7 @@
<el-table-column align="center" label="收藏量" prop="likesNumber"/>
<el-table-column align="center" label="评论数" prop="evaluationNumber"/>
<el-table-column align="center" label="转发数" prop="transpondNumber"/>
<!-- <el-table-column align="center" label="转发打开数" prop="transpondOpenNumber"/>-->
<!-- <el-table-column align="center" label="转发打开数" prop="transpondOpenNumber"/>-->
<el-table-column align="center" label="数据来源" prop="dataSourceName"/>
<el-table-column align="center" label="备注" prop="remark"/>
<el-table-column align="center" class-name="small-padding fixed-width" label="操作">
@ -194,7 +194,7 @@
</el-option>
</el-select>
</el-form-item>
<el-form-item label="数据来源" prop="dataSource" >
<el-form-item label="数据来源" prop="dataSource">
<el-select v-model="form.dataSource" placeholder="请选择" :disabled="isEdit">
<el-option
v-for="dict in dict.type.data_sources"
@ -228,9 +228,9 @@
<el-form-item label="评论数" prop="evaluationNumber">
<el-input v-model="form.evaluationNumber" placeholder="请输入评论数"/>
</el-form-item>
<!-- <el-form-item label="转发打开数量" prop="transpondOpenNumber">-->
<!-- <el-input v-model="form.transpondOpenNumber" placeholder="请输入评论数"/>-->
<!-- </el-form-item>-->
<!-- <el-form-item label="转发打开数量" prop="transpondOpenNumber">-->
<!-- <el-input v-model="form.transpondOpenNumber" placeholder="请输入评论数"/>-->
<!-- </el-form-item>-->
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" placeholder="请输入备注"/>
</el-form-item>
@ -244,15 +244,15 @@
</template>
<script>
import {listInfo, getInfo, delInfo, addInfo, updateInfo} from "@/api/marketingdata/info";
import {getMediaList} from "@/api/marketingdata/complaint";
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from '@/api/marketingdata/info'
import { getMediaList } from '@/api/marketingdata/complaint'
export default {
dicts: ['data_sources'],
name: "Info",
name: 'Info',
data() {
return {
isEdit:undefined,
isEdit: undefined,
//
mediaChannelList: [],
//
@ -273,7 +273,7 @@ export default {
// /
infoList: [],
//
title: "",
title: '',
//
open: false,
//
@ -294,25 +294,25 @@ export default {
transpondOpenNumber: null,
evaluationNumber: null,
organCode: null,
startTime:null,
endTime:null,
resourceName:null,
startTime: null,
endTime: null,
resourceName: null
},
//
form: {},
//
rules: {
type: [
{required: true, message: "数据类型 1 微信 2 微博不能为空", trigger: "change"}
{ required: true, message: '数据类型 1 微信 2 微博不能为空', trigger: 'change' }
],
startTime: [
{required: true, message: "统计时间不能为空", trigger: "blur"}
{ required: true, message: '统计时间不能为空', trigger: 'blur' }
],
mediaId: [
{required: true, message: "媒体渠道不能为空", trigger: "blur"}
],
{ required: true, message: '媒体渠道不能为空', trigger: 'blur' }
]
}
};
}
},
watch: {
'open': {
@ -329,25 +329,25 @@ export default {
},
created() {
this.type = this.$route.query.type
this.getList();
this.getList()
this.getMediaList()
},
methods: {
/** 查询微信/微博数据列表 */
getList() {
let this_ = this
this.loading = true;
this.loading = true
this_.queryParams.type = this_.type
listInfo(this_.queryParams).then(response => {
this.infoList = response.rows;
this.total = response.total;
this.loading = false;
});
this.infoList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false;
this.reset();
this.open = false
this.reset()
},
//
reset() {
@ -373,18 +373,18 @@ export default {
organCode: null,
createBy: null,
updateBy: null
};
this.resetForm("form");
}
this.resetForm('form')
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
this.resetForm('queryForm')
this.handleQuery()
},
//
handleSelectionChange(selection) {
@ -394,58 +394,71 @@ export default {
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.reset()
this.isEdit = false
this.open = true;
this.title = "添加"+(this.type==1?'微信':'微博')+"数据";
this.open = true
if (this.type == 1) {
this.title = '添加微信数据'
} else if (this.type == 2) {
this.title = '添加微博数据'
} else {
this.title = '添加抖音数据'
}
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
this.reset()
this.isEdit = true
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data;
this.form.mediaId = this.form.mediaId-0
if (this.form.likesNumber!=null){
this.form = response.data
this.form.mediaId = this.form.mediaId - 0
if (this.form.likesNumber != null) {
this.form.likesNumber = this.form.likesNumber.toString()
}
this.open = true;
this.title = "修改"+(this.type==1?'微信':'微博')+"数据";
});
this.open = true
if (this.type == 1) {
this.title = '修改微信数据'
} else if (this.type == 2) {
this.title = '修改微博数据'
} else {
this.title = '修改抖音数据'
}
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
this.$refs['form'].validate(valid => {
if (valid) {
if (this.form.id != null) {
this.form.type = this.type
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess('修改成功')
this.open = false
this.getList()
})
} else {
this.form.type = this.type
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
this.$modal.msgSuccess('新增成功')
this.open = false
this.getList()
})
}
}
});
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids;
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function () {
return delInfo(ids);
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids)
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
this.getList()
this.$modal.msgSuccess('删除成功')
}).catch(() => {
});
})
},
/** 导出按钮操作 */
handleExport() {
@ -458,7 +471,7 @@ export default {
getMediaList().then(response => {
this.mediaChannelList = response.data
})
},
}
}
};
}
</script>

Loading…
Cancel
Save