Commit 8726b9b1 by 林家欣

修改应用领域查询接口

parent 91692a77
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
<el-form-item label="栏目:" prop="classid"> <el-form-item label="栏目:" prop="classid">
<el-select <el-select
v-model="dataForm.classid" v-model="dataForm.classid"
@change="getClassList([dataForm.classid])"
style="width: 121px !important"
v-show="!showInfo" v-show="!showInfo"
> >
<el-option <el-option
...@@ -51,19 +49,6 @@ ...@@ -51,19 +49,6 @@
> >
</el-option> </el-option>
</el-select> </el-select>
<el-select
v-model="dataForm.cclassid"
style="width: 121px !important"
v-show="!showInfo"
>
<el-option
v-for="item in cclassidList"
:key="item.id"
:label="item.name"
:value="item.id"
>
</el-option>
</el-select>
<p v-show="showInfo">{{ className + "/" + cclassName }}</p> <p v-show="showInfo">{{ className + "/" + cclassName }}</p>
</el-form-item> </el-form-item>
<el-form-item label="级别:" prop="levels"> <el-form-item label="级别:" prop="levels">
...@@ -117,7 +102,7 @@ ...@@ -117,7 +102,7 @@
></el-input> ></el-input>
<p v-show="showInfo">{{ dataForm.author }}</p> <p v-show="showInfo">{{ dataForm.author }}</p>
</el-form-item> </el-form-item>
<el-form-item label="上传图片:" prop="pic"> <el-form-item label="图片:" prop="pic">
<el-upload <el-upload
v-show="!showInfo" v-show="!showInfo"
class="avatar-uploader" class="avatar-uploader"
...@@ -167,6 +152,7 @@ export default { ...@@ -167,6 +152,7 @@ export default {
components: { components: {
Ueditor, Ueditor,
}, },
props: ['classidList'],
data() { data() {
return { return {
loading: false, loading: false,
...@@ -190,9 +176,7 @@ export default { ...@@ -190,9 +176,7 @@ export default {
content: "", content: "",
showtime: "", showtime: "",
classid: "", classid: "",
cclassid: "",
}, },
cclassidStr: undefined,
dataRule: { dataRule: {
title: [{ required: true, message: "不能为空", trigger: "blur" }], title: [{ required: true, message: "不能为空", trigger: "blur" }],
titleOld: [{ required: true, message: "不能为空", trigger: "blur" }], titleOld: [{ required: true, message: "不能为空", trigger: "blur" }],
...@@ -219,16 +203,12 @@ export default { ...@@ -219,16 +203,12 @@ export default {
piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], piclevelList: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
id: [], id: [],
classidList: [], classidList: [],
cclassidList: [],
title: "", title: "",
className: "", className: "",
cclassName: "", cclassName: "",
}; };
}, },
created() {
this.getClassList([]);
},
mounted() { mounted() {
console.log(this.classidList); console.log(this.classidList);
}, },
...@@ -240,6 +220,7 @@ export default { ...@@ -240,6 +220,7 @@ export default {
return arr[0].name; return arr[0].name;
}, },
init(id, showInfo) { init(id, showInfo) {
console.log(id, 'id');
this.dataForm.id = id || 0; this.dataForm.id = id || 0;
this.visible = true; this.visible = true;
this.showInfo = showInfo; this.showInfo = showInfo;
...@@ -255,7 +236,6 @@ export default { ...@@ -255,7 +236,6 @@ export default {
this.loading = false; this.loading = false;
if (data && data.code === 0) { if (data && data.code === 0) {
this.dataForm = data.news; this.dataForm = data.news;
this.getClassList([this.dataForm.classid]);
this.imgUrlStr = data.news.pic; this.imgUrlStr = data.news.pic;
this.dialogVisible = true; this.dialogVisible = true;
this.ueditor.value = this.dataForm.content; this.ueditor.value = this.dataForm.content;
...@@ -266,9 +246,9 @@ export default { ...@@ -266,9 +246,9 @@ export default {
}, },
// 表单提交 // 表单提交
dataFormSubmit() { dataFormSubmit() {
this.loading = true;
this.$refs["dataForm"].validate((valid) => { this.$refs["dataForm"].validate((valid) => {
if (valid) { if (valid) {
this.loading = true;
this.$http({ this.$http({
url: this.$http.adornUrl( url: this.$http.adornUrl(
`/office/news/${!this.dataForm.id ? "save" : "update"}` `/office/news/${!this.dataForm.id ? "save" : "update"}`
...@@ -287,7 +267,6 @@ export default { ...@@ -287,7 +267,6 @@ export default {
pic: this.dataForm.pic, pic: this.dataForm.pic,
content: this.dataForm.content, content: this.dataForm.content,
classid: this.dataForm.classid, classid: this.dataForm.classid,
cclassid: this.dataForm.cclassid,
showtime: this.dataForm.showtime, showtime: this.dataForm.showtime,
}), }),
}).then(({ data }) => { }).then(({ data }) => {
...@@ -309,25 +288,6 @@ export default { ...@@ -309,25 +288,6 @@ export default {
} }
}); });
}, },
// 获取栏目列表
getClassList(id) {
this.$http({
url: this.$http.adornUrl(`/office/newsclass/getNewsClassList`),
method: "post",
data: id,
}).then(({ data }) => {
if (data && data.code === 0) {
if (id.length === 0) {
this.classidList = data.data;
} else {
this.dataForm.cclassid = "";
this.cclassidList = data.data[0].child;
}
} else {
this.$message.error(data.msg);
}
});
},
// 上传之前校验 // 上传之前校验
beforeAvatarUpload(file) { beforeAvatarUpload(file) {
const isJPG = file.type === "image/jpeg"; const isJPG = file.type === "image/jpeg";
...@@ -365,15 +325,6 @@ export default { ...@@ -365,15 +325,6 @@ export default {
console.log(err); console.log(err);
}); });
}, },
// 选择栏目
handleChange(value) {
if (value.length === 1) {
this.classid = value[0];
} else if (value.length === 2) {
this.dataForm.classid = value[0];
this.dataForm.cclassid = value[1];
}
},
clearInp() { clearInp() {
this.$refs["dataForm"].resetFields(); this.$refs["dataForm"].resetFields();
this.imgUrlStr = ""; this.imgUrlStr = "";
......
...@@ -46,13 +46,11 @@ ...@@ -46,13 +46,11 @@
<el-form-item label='发布日期' prop='releaseDate'> <el-form-item label='发布日期' prop='releaseDate'>
<el-date-picker <el-date-picker
clearable clearable
v-model="releaseDate" v-model="releaseDate"
type="daterange" type="daterange"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd hh:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" >
>
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item label='更新日期' prop='updateDate'> <el-form-item label='更新日期' prop='updateDate'>
...@@ -63,7 +61,7 @@ ...@@ -63,7 +61,7 @@
type="daterange" type="daterange"
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
value-format="yyyy-MM-dd hh:mm:ss" value-format="yyyy-MM-dd HH:mm:ss"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
...@@ -177,7 +175,7 @@ ...@@ -177,7 +175,7 @@
layout="total, sizes, prev, pager, next, jumper"> layout="total, sizes, prev, pager, next, jumper">
</el-pagination> </el-pagination>
<!-- 弹窗, 新增 / 修改 --> <!-- 弹窗, 新增 / 修改 -->
<add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList"></add-or-update> <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" :classidList="columnList"></add-or-update>
</div> </div>
</div> </div>
</template> </template>
...@@ -249,7 +247,8 @@ ...@@ -249,7 +247,8 @@
}, },
// 获取数据列表 // 获取数据列表
getDataList () { getDataList () {
this.dataListLoading = true console.log(this.releaseDate, 'this.releaseDate');
this.dataListLoading = true;
this.$http({ this.$http({
url: this.$http.adornUrl('/office/news/yylyList'), url: this.$http.adornUrl('/office/news/yylyList'),
method: 'post', method: 'post',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment