| | |
| | | }, |
| | | "devDependencies": { |
| | | "@vue/cli-plugin-babel": "^3.4.0", |
| | | "@vue/cli-plugin-eslint": "^3.4.0", |
| | | "@vue/cli-service": "^3.4.0", |
| | | "@vue/eslint-config-standard": "^4.0.0", |
| | | "babel-eslint": "^10.0.1", |
| | | "babel-plugin-component": "^1.1.1", |
| | | "eslint": "^5.8.0", |
| | | "eslint-plugin-vue": "^5.0.0", |
| | | "less": "^3.9.0", |
| | | "less-loader": "^4.1.0", |
| | | "quill-image-extend-module": "^1.1.2", |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style> |
| | | </style> |
| | | <style></style> |
| | |
| | | //ç¨äºåæ¥å£ |
| | | // ç¨äºåæ¥å£ |
| | | |
| | | import request from "../utils/request"; |
| | | import request from '../utils/request' |
| | | // // å¯¼èªæ å表 |
| | | // export const getNavList = data => { |
| | | // return request({ |
| | |
| | | // params:data, |
| | | // }) |
| | | // } |
| | | //è·åå°æ é¢ |
| | | // è·åå°æ é¢ |
| | | export const getMinTitle = data => { |
| | | return request({ |
| | | method: 'GET', |
| | | url: `/news_category/list/${data}`, |
| | | url: `/news_category/list/${data}` |
| | | }) |
| | | } |
| | | //è·åæ°é»å表 |
| | | // è·åæ°é»å表 |
| | | export const getNewsList = data => { |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/list', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //è·ååªæä¸ç¯æ°é» |
| | | // è·ååªæä¸ç¯æ°é» |
| | | export const getnew = data => { |
| | | return request({ |
| | | method: 'GET', |
| | | url: `/news/main/${data}` |
| | | }) |
| | | } |
| | | //ä¿®æ¹æ°é» |
| | | // ä¿®æ¹æ°é» |
| | | export const update = data => { |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/update', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //å 餿°é» |
| | | // å 餿°é» |
| | | export const deleteNew = data => { |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/delete', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //æ¨¡ç³æ¥è¯¢ |
| | | // æ¨¡ç³æ¥è¯¢ |
| | | export const fuzzy = data => { |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/fuzzy', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //æ·»å æ°é» |
| | | // æ·»å æ°é» |
| | | export const add = (data, fd) => { |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | data: fd |
| | | }) |
| | | } |
| | | //ç»å½ |
| | | // ç»å½ |
| | | export const login = data => { |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | //è·åæ®é管çåå表 |
| | | // è·åæ®é管çåå表 |
| | | export const getmain = () => { |
| | | return request({ |
| | | method: 'GET', |
| | | url: '/admin/list' |
| | | }) |
| | | } |
| | | //è¶
ç®¡ä¿®æ¹æ®ç®¡è´¦å·å¯ç |
| | | // è¶
ç®¡ä¿®æ¹æ®ç®¡è´¦å·å¯ç |
| | | export const editAccount = data => { |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | //å 餿®é管çå |
| | | // å 餿®é管çå |
| | | export const deleteAd = data => { |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | //æ³¨åæ®é管çå |
| | | // æ³¨åæ®é管çå |
| | | export const addAd = data => { |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | params: data |
| | | }) |
| | | } |
| | | //æä»¶ä¸ä¼ |
| | | // æä»¶ä¸ä¼ |
| | | export const fileUpload = fd => { |
| | | return request({ |
| | | method: 'POST', |
| | |
| | | <template> |
| | | <div> |
| | | <el-card class="box-card"> |
| | | <el-button type="primary" @click="add()" icon="el-icon-circle-plus" class='add'>æ³¨åæ°ç管çåè´¦å·</el-button> |
| | | <el-button type="primary" @click="add()" icon="el-icon-circle-plus" class="add">æ³¨åæ°ç管çåè´¦å·</el-button> |
| | | <!-- æ°é»è¡¨æ ¼åºå --> |
| | | <el-table |
| | | :data="tableData" |
| | | border |
| | | style="width: 100%" |
| | | :header-cell-style="{textAlign: 'center'}" |
| | | :cell-style="{ textAlign: 'center' }" |
| | | > |
| | | <el-table :data="tableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> |
| | | <el-table-column type="index" label="åºå·" width="50"> |
| | | <!-- <template slot-scope="scope"> |
| | | <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span> |
| | | </template> --> |
| | | </el-table-column> |
| | | <el-table-column prop="username" label="æ®é管çåè´¦å·" width="" > |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="username" label="æ®é管çåè´¦å·" width=""> </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> </el-table-column> |
| | | <el-table-column label="æä½" width=""> |
| | | <template slot-scope="scope"> |
| | | <!-- {{ scope.row.id }} --> |
| | |
| | | <el-button type="danger" @click="deleteAds(scope.row.id)" icon="el-icon-delete"></el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | <!-- ä¿®æ¹è´¦æ·çå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | title="ä¿®æ¹æ®é管çåå¯ç " |
| | | :visible.sync="editDialogVisible" |
| | | width="50%" |
| | | @close="editClose"> |
| | | <el-dialog title="ä¿®æ¹æ®é管çåå¯ç " :visible.sync="editDialogVisible" width="50%" @close="editClose"> |
| | | <!-- rules表åéªè¯è§åï¼refå½å表åçéªè¯å¯¹è±¡ --> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form-item label="ç¨æ·å:"> |
| | | <el-input v-model="editForm.username" prefix-icon="iconfont icon-user" placeholder="请è¾å
¥è´¦å·" clearable=""></el-input> |
| | | </el-form-item> |
| | |
| | | </span> |
| | | </el-dialog> |
| | | <!-- æ·»å 管çåå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | title="æ·»å æ®é管çå" |
| | | :visible.sync="addDialogVisible" |
| | | width="50%" |
| | | @close="addClose"> |
| | | <el-dialog title="æ·»å æ®é管çå" :visible.sync="addDialogVisible" width="50%" @close="addClose"> |
| | | <!-- rules表åéªè¯è§åï¼refå½å表åçéªè¯å¯¹è±¡ --> |
| | | <el-form ref="addFormRef" :model="addForm" label-width="80px" status-icon> |
| | | <el-form ref="addFormRef" :model="addForm" label-width="80px" status-icon> |
| | | <el-form-item label="ç¨æ·å:"> |
| | | <el-input v-model="addForm.username" prefix-icon="iconfont icon-user" placeholder="请è¾å
¥è´¦å·" clearable=""></el-input> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getmain,editAccount,deleteAd,addAd } from '../../api/api' |
| | | import { getmain, editAccount, deleteAd, addAd } from '../../api/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | | tableData:[], //æ®é管çåå表 |
| | | editDialogVisible:false, |
| | | addDialogVisible:false, |
| | | editForm:{ username:'',oldPassword:'',password:'' }, //ä¿®æ¹è¡¨å对象 |
| | | addForm:{ username:'',password:'' } //æ·»å 管ç对象 |
| | | tableData: [], //æ®é管çåå表 |
| | | editDialogVisible: false, |
| | | addDialogVisible: false, |
| | | editForm: { username: '', oldPassword: '', password: '' }, //ä¿®æ¹è¡¨å对象 |
| | | addForm: { username: '', password: '' } //æ·»å 管ç对象 |
| | | } |
| | | }, |
| | | created(){ |
| | | created() { |
| | | this.ready() |
| | | }, |
| | | methods:{ |
| | | methods: { |
| | | //è·åéºç®¡å表 |
| | | ready(){ |
| | | ready() { |
| | | getmain().then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | if (res.code == 200) { |
| | | this.tableData = res.data |
| | | } |
| | | }) |
| | | }, |
| | | //å±ç¤ºç¼è¾å¯¹è¯æ¡ |
| | | showEditDialog(){ |
| | | showEditDialog() { |
| | | this.editDialogVisible = true |
| | | }, |
| | | editClose(){ |
| | | this.editForm.username = ''; |
| | | this.editForm.oldPassword = ''; |
| | | this.editForm.password = ''; |
| | | editClose() { |
| | | this.editForm.username = '' |
| | | this.editForm.oldPassword = '' |
| | | this.editForm.password = '' |
| | | }, |
| | | cancel(){ |
| | | this.editForm.username = ''; |
| | | this.editForm.oldPassword = ''; |
| | | this.editForm.password = ''; |
| | | cancel() { |
| | | this.editForm.username = '' |
| | | this.editForm.oldPassword = '' |
| | | this.editForm.password = '' |
| | | this.editDialogVisible = false |
| | | }, |
| | | //ç¼è¾ç¡®å®äºä»¶ |
| | | subEdit(){ |
| | | subEdit() { |
| | | const data = { |
| | | username:this.editForm.username, |
| | | oldPassword:this.editForm.oldPassword, |
| | | password:this.editForm.password |
| | | username: this.editForm.username, |
| | | oldPassword: this.editForm.oldPassword, |
| | | password: this.editForm.password |
| | | } |
| | | editAccount(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | if (res.code == 200) { |
| | | this.$message.success('è´¦æ·ä¿®æ¹æå') |
| | | this.editDialogVisible = false |
| | | this.ready() |
| | | }else{ |
| | | } else { |
| | | this.$message.error('è´¦æ·ä¿®æ¹å¤±è´¥') |
| | | } |
| | | }) |
| | | }, |
| | | //å 餿®é管çå |
| | | async deleteAds(id){ |
| | | async deleteAds(id) { |
| | | // console.log(id); |
| | | const res = await this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥ç®¡çè´¦å·, æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | if(res !== 'confirm'){ |
| | | console.log(res) |
| | | if (res !== 'confirm') { |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | } else { |
| | | // console.log(id); |
| | | const data = { |
| | | id:id |
| | | id: id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteAd(data).then(res => { |
| | | // console.log('>>>'+res); |
| | | if(res.code == 200){ |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿åï¼') |
| | | this.ready() |
| | | }else{ |
| | | } else { |
| | | return this.$message.error('å é¤å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | add(){ |
| | | add() { |
| | | this.addDialogVisible = true |
| | | }, |
| | | //注ååæ¶æ¸
空 |
| | | canceladd(){ |
| | | this.addForm.username = ''; |
| | | this.addForm.password = ''; |
| | | canceladd() { |
| | | this.addForm.username = '' |
| | | this.addForm.password = '' |
| | | this.addDialogVisible = false |
| | | }, |
| | | addClose(){ |
| | | this.addForm.username = ''; |
| | | this.addForm.password = ''; |
| | | addClose() { |
| | | this.addForm.username = '' |
| | | this.addForm.password = '' |
| | | }, |
| | | //注åæäº¤ |
| | | addEdit(){ |
| | | addEdit() { |
| | | const data = { |
| | | username:this.addForm.username, |
| | | password:this.addForm.password |
| | | username: this.addForm.username, |
| | | password: this.addForm.password |
| | | } |
| | | addAd(data).then(res => { |
| | | if(res.code == 200){ |
| | | if (res.code == 200) { |
| | | this.$message.success('注åæå') |
| | | this.addDialogVisible = false |
| | | this.ready() |
| | | }else{ |
| | | } else { |
| | | this.$message.error('注å失败') |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .add{ |
| | | .add { |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | </style> |
| | | </style> |
| | |
| | | <!-- 级èéæ©å¨ --> |
| | | <el-row class="block"> |
| | | <el-col :span="4"> |
| | | <el-cascader |
| | | v-model="value" |
| | | :options="options" |
| | | clearable |
| | | filterable |
| | | :getCheckedNodes="true" |
| | | @change="handleChange"> |
| | | </el-cascader> |
| | | <el-cascader v-model="value" :options="options" clearable filterable :getCheckedNodes="true" @change="handleChange"> </el-cascader> |
| | | </el-col> |
| | | <el-col :span="5"> |
| | | <el-button type="primary" icon="el-icon-edit" @click="goAdEdit()">ç¹å»å¯¹æ®é管çåè¿è¡ç®¡ç</el-button> |
| | |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <!-- æ°é»æç´¢ --> |
| | | <el-input clearable placeholder="请è¾å
¥æè¦æ¥è¯¢çæ°é»æ é¢" v-model="search" class="input-with-select"> |
| | | </el-input> |
| | | <el-input clearable placeholder="请è¾å
¥æè¦æ¥è¯¢çæ°é»æ é¢" v-model="search" class="input-with-select"> </el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- æ°é»è¡¨æ ¼åºå --> |
| | | <el-table |
| | | <el-table |
| | | :data="tableData.filter(data => !search || data.title.toLowerCase().includes(search.toLowerCase()))" |
| | | border |
| | | style="width: 100%" |
| | | :header-cell-style="{textAlign: 'center'}" |
| | | border |
| | | style="width: 100%" |
| | | :header-cell-style="{ textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }" |
| | | > |
| | | <el-table-column type="index" label="åºå·" width="50"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span> |
| | | <span>{{ (currentPage - 1) * pageSize + scope.$index + 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width="" > |
| | | </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width=""> </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> </el-table-column> |
| | | <el-table-column label="æä½" width=""> |
| | | <template slot-scope="scope"> |
| | | <!-- {{ scope.row.id }} --> |
| | |
| | | <el-button type="info" @click="deleteNews(scope.row.id)">å é¤</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- å页 --> |
| | |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[6,12, 18,]" |
| | | :page-sizes="[6, 12, 18]" |
| | | :page-size="100" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"> |
| | | :total="total" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | <!-- ä¿®æ¹æ°é»çå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | title="ä¿®æ¹æ°é»" |
| | | :visible.sync="editDialogVisible" |
| | | width="50%" |
| | | :before-close="handleClose"> |
| | | <el-dialog title="ä¿®æ¹æ°é»" :visible.sync="editDialogVisible" width="50%" :before-close="handleClose"> |
| | | <!-- rules表åéªè¯è§åï¼refå½å表åçéªè¯å¯¹è±¡ --> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form-item label="id:"> |
| | | <el-input v-model="editForm.id" disabled></el-input> |
| | | </el-form-item> |
| | |
| | | <el-input v-model="editForm.title"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å叿¥æ:"> |
| | | <el-date-picker |
| | | v-model="editForm.releaseTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©å叿¥æ" |
| | | format="yyyy å¹´ MM æ dd æ¥" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | <el-date-picker v-model="editForm.releaseTime" type="date" placeholder="è¯·éæ©å叿¥æ" format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd"></el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getNewsList,getnew,update,deleteNew,fuzzy } from '../../api/api' |
| | | import { getNewsList, getnew, update, deleteNew, fuzzy } from '../../api/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | | search:'', |
| | | getShow:true, //è·ååé¡µçæ¾ç¤º(å¸å°å¼) |
| | | gettable:true, //è·åè¡¨æ ¼çæ¾ç¤º |
| | | search: '', |
| | | getShow: true, //è·ååé¡µçæ¾ç¤º(å¸å°å¼) |
| | | gettable: true, //è·åè¡¨æ ¼çæ¾ç¤º |
| | | visible: false, |
| | | editDialogVisible:false, //æ§å¶ä¿®æ¹å¯¹è¯æ¡çå¸å°å¼ |
| | | AdDialogVisible:false, //è¶
管ç»å½å¯¹è¯æ¡ |
| | | Ad:{ username:'',password:'' }, //è¶
管对象 |
| | | editForm:{}, //æ¥è¯¢å°çæ°é»å¯¹è±¡ï¼ç®åä»
ä¾ä¿®æ¹ä½¿ç¨ |
| | | newsCategoryId:1, //å
åä¸ä¸ªå°æ é¢id |
| | | tableData:[], //æ°é»å表对象 |
| | | fuzzytableData:[], //æ¨¡ç³æ¥è¯¢å表对象 |
| | | pageSize:6, //æ¯é¡µæ¡æ° |
| | | currentPage:1, //å½å页 |
| | | total:0, //æ°é»æ»æ¡æ° |
| | | fuzzyShow:false, //æ¨¡ç³æ¥è¯¢åé¡µçæ¾ç¤º(å¸å°å¼) |
| | | fuzzytable:false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | editDialogVisible: false, //æ§å¶ä¿®æ¹å¯¹è¯æ¡çå¸å°å¼ |
| | | AdDialogVisible: false, //è¶
管ç»å½å¯¹è¯æ¡ |
| | | Ad: { username: '', password: '' }, //è¶
管对象 |
| | | editForm: {}, //æ¥è¯¢å°çæ°é»å¯¹è±¡ï¼ç®åä»
ä¾ä¿®æ¹ä½¿ç¨ |
| | | newsCategoryId: 1, //å
åä¸ä¸ªå°æ é¢id |
| | | tableData: [], //æ°é»å表对象 |
| | | fuzzytableData: [], //æ¨¡ç³æ¥è¯¢å表对象 |
| | | pageSize: 6, //æ¯é¡µæ¡æ° |
| | | currentPage: 1, //å½å页 |
| | | total: 0, //æ°é»æ»æ¡æ° |
| | | fuzzyShow: false, //æ¨¡ç³æ¥è¯¢åé¡µçæ¾ç¤º(å¸å°å¼) |
| | | fuzzytable: false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm: { fuzzytitle: '', fuzzytotal: 0, fuzzycurrent: 1, fuzzysize: 6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | value: [], |
| | | options: [{ |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [{ |
| | | value:42, |
| | | label: 'éç¥å
Œ', |
| | | }, |
| | | options: [ |
| | | { |
| | | value:43, |
| | | label: 'å·¥ä½å¨æ', |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [ |
| | | { |
| | | value: 42, |
| | | label: 'éç¥å
Œ' |
| | | }, |
| | | { |
| | | value: 43, |
| | | label: 'å·¥ä½å¨æ' |
| | | }, |
| | | { |
| | | value: 44, |
| | | label: 'å¦é¢å¨æ' |
| | | }, |
| | | { |
| | | value: 45, |
| | | label: 'è½®æå¾' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value:44, |
| | | label: 'å¦é¢å¨æ', |
| | | }, |
| | | { |
| | | value:45, |
| | | label: 'è½®æå¾', |
| | | }], |
| | | },{ |
| | | value: 22, |
| | | label: 'ç§åæ¦åµ', |
| | | children: [{ |
| | | value:27, |
| | | label: 'ç®ä»', |
| | | }, |
| | | { |
| | | value:28, |
| | | label: 'ç« ç¨', |
| | | }, |
| | | { |
| | | value:29, |
| | | label: 'ç»ç»ç»æ', |
| | | }, |
| | | { |
| | | value:30, |
| | | label: 'å·¥ä½èè´£', |
| | | }, |
| | | { |
| | | value:31, |
| | | label: 'ä¸è人å', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 27, |
| | | label: 'ç®ä»' |
| | | }, |
| | | { |
| | | value: 28, |
| | | label: 'ç« ç¨' |
| | | }, |
| | | { |
| | | value: 29, |
| | | label: 'ç»ç»ç»æ' |
| | | }, |
| | | { |
| | | value: 30, |
| | | label: 'å·¥ä½èè´£' |
| | | }, |
| | | { |
| | | value: 31, |
| | | label: 'ä¸è人å' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 23, |
| | | label: 'æ¿çæ³è§', |
| | | children: [{ |
| | | value:35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶', |
| | | }, |
| | | { |
| | | value:36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶', |
| | | }, |
| | | { |
| | | value:37, |
| | | label: '社å¢ç®¡çæä»¶', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value: 36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value: 37, |
| | | label: '社å¢ç®¡çæä»¶' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 25, |
| | | label: '妿¯äº¤æµ', |
| | | children: [{ |
| | | value:38, |
| | | label: '妿¯ä¿¡æ¯', |
| | | }, |
| | | { |
| | | value:39, |
| | | label: 'ç§æç«èµ', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 38, |
| | | label: '妿¯ä¿¡æ¯' |
| | | }, |
| | | { |
| | | value: 39, |
| | | label: 'ç§æç«èµ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 27, |
| | | label: 'ç§æ®é£é', |
| | | children: [{ |
| | | value:40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨', |
| | | }, |
| | | { |
| | | value:41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨', |
| | | }], |
| | | }] |
| | | children: [ |
| | | { |
| | | value: 40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨' |
| | | }, |
| | | { |
| | | value: 41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | created(){ |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | methods: { |
| | | //ä¿®æ¹å¯¹è¯æ¡å
³éçæ¹æ³ |
| | | handleClose(done) { |
| | | this.$confirm('确认å
³éï¼') |
| | | .then(_ => { |
| | | done(); |
| | | done() |
| | | }) |
| | | .catch(_ => {}); |
| | | .catch(_ => {}) |
| | | }, |
| | | //跳转æ®é管çå表 |
| | | goAdEdit(){ |
| | | this.$router.push({path:'adedit'}) |
| | | goAdEdit() { |
| | | this.$router.push({ path: 'adedit' }) |
| | | }, |
| | | //级èéæ©å¨çæ¹æ³ |
| | | handleChange(value) { |
| | | // console.log(value); |
| | | // console.log(value[1]); |
| | | this.currentPage = 1; |
| | | this.newsCategoryId = value[1]; //å°å¾å°çå°æ é¢idåæ¾èµ·æ¥ |
| | | this.query(this.newsCategoryId); |
| | | this.currentPage = 1 |
| | | this.newsCategoryId = value[1] //å°å¾å°çå°æ é¢idåæ¾èµ·æ¥ |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | query(newsCategoryId){ |
| | | query(newsCategoryId) { |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:newsCategoryId, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res=>{ |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | | }else{ |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | current: this.currentPage, |
| | | newsCategoryId: newsCategoryId, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | | } else { |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å±ç¤ºä¿®æ¹å¯¹è¯æ¡ |
| | | showEditDialog(id){ |
| | | showEditDialog(id) { |
| | | getnew(id).then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.editForm = res.data |
| | | } |
| | | } |
| | | }) |
| | | this.editDialogVisible = true; |
| | | this.editDialogVisible = true |
| | | }, |
| | | //ç¡®å®ä¿®æ¹è¡¨åæäº¤ï¼éªè¯åèµ·è¯·æ± |
| | | editNew(){ |
| | | editNew() { |
| | | const data = { |
| | | id: this.editForm.id, |
| | | releaseTime: this.editForm.releaseTime, |
| | | title:this.editForm.title |
| | | title: this.editForm.title |
| | | } |
| | | update(data).then(res=>{ |
| | | console.log('dsadasas',res); |
| | | update(data).then(res => { |
| | | console.log('dsadasas', res) |
| | | if (res.code == 200) { |
| | | this.editDialogVisible =false; |
| | | this.editDialogVisible = false |
| | | this.$message.success('ä¿®æ¹æ°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | this.query(this.newsCategoryId) |
| | | } |
| | | }) |
| | | }, |
| | | //æ¨¡ç³æ¥è¯¢ |
| | | fuzzyList(title){ |
| | | fuzzyList(title) { |
| | | // console.log(title); |
| | | if(title == ''){ |
| | | return this.$message.error('请å
è¾å
¥æ¥è¯¢æ°é»æ é¢ï¼') |
| | | if (title == '') { |
| | | return this.$message.error('请å
è¾å
¥æ¥è¯¢æ°é»æ é¢ï¼') |
| | | } |
| | | this.fuzzyShow = true //模ç³å页æ¾ç¤º |
| | | this.getShow = false //è·åå页éè |
| | | this.getShow = false //è·åå页éè |
| | | this.gettable = false |
| | | this.fuzzytable = true |
| | | const data = { |
| | | current: this.fuzzyForm.fuzzycurrent, |
| | | size: this.fuzzyForm.fuzzysize, |
| | | title:title |
| | | title: title |
| | | } |
| | | fuzzy(data).then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | | }else{ |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | fuzzy(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | | } else { |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //æ¸
空æ¥è¯¢å表å
容 |
| | | qingKong(){ |
| | | qingKong() { |
| | | this.tableData = [] |
| | | this.fuzzytableData = [] |
| | | this.fuzzyForm.fuzzytotal = 0 |
| | |
| | | this.gettable = true |
| | | }, |
| | | //æ ¹æ®idå 餿°é» |
| | | async deleteNews(id){ |
| | | async deleteNews(id) { |
| | | // console.log(id); |
| | | const res = await this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ¡æ°é», æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | if(res !== 'confirm'){ |
| | | console.log(res) |
| | | if (res !== 'confirm') { |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | console.log(id); |
| | | } else { |
| | | console.log(id) |
| | | const data = { |
| | | id:id |
| | | id: id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteNew(data).then(res => { |
| | | console.log('>>>'+res); |
| | | if(res.code == 200){ |
| | | console.log('>>>' + res) |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | }else{ |
| | | this.query(this.newsCategoryId) |
| | | } else { |
| | | return this.$message.error('å 餿°é»å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | //æ¥ç |
| | | look(id){ |
| | | this.$router.push({path:'news',query:{id:id}}) |
| | | look(id) { |
| | | this.$router.push({ path: 'news', query: { id: id } }) |
| | | }, |
| | | //è¶
管ç»å½å¯¹è¯æ¡ |
| | | showAdDialog(){ |
| | | showAdDialog() { |
| | | this.AdDialogVisible = true |
| | | }, |
| | | handleCurrentChange(val) { |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPage = val; |
| | | this.currentPage = val |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | handleSizeChange(val) { |
| | | // console.log(`æ¯é¡µ ${val} æ¡`); |
| | | this.pageSize = val; |
| | | this.pageSize = val |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | handleCurrentChangefuzzy(val){ |
| | | handleCurrentChangefuzzy(val) { |
| | | this.fuzzyForm.fuzzycurrent = val |
| | | this.fuzzyList(this.fuzzyForm.fuzzytitle) //æ¨¡ç³æ¥è¯¢ |
| | | }, |
| | | handleSizeChangefuzzy(val){ |
| | | handleSizeChangefuzzy(val) { |
| | | this.fuzzyForm.fuzzysize = val |
| | | this.fuzzyList(this.fuzzyForm.fuzzytitle) //æ¨¡ç³æ¥è¯¢ |
| | | }, |
| | | //å»å¾æ·»å ç¼è¾é¡µé¢ |
| | | goEdit(id){ |
| | | let title = ''; |
| | | console.log(this.value); |
| | | if (this.value.length = 2) { |
| | | let t = this.value[0]; |
| | | let i = this.value[1]; |
| | | this.options.forEach( item => { |
| | | if(item.value == t){ |
| | | title += item.label+'/' |
| | | item.children.forEach( e => { |
| | | if(e.value == i) title += e.label; |
| | | goEdit(id) { |
| | | let title = '' |
| | | console.log(this.value) |
| | | if ((this.value.length = 2)) { |
| | | let t = this.value[0] |
| | | let i = this.value[1] |
| | | this.options.forEach(item => { |
| | | if (item.value == t) { |
| | | title += item.label + '/' |
| | | item.children.forEach(e => { |
| | | if (e.value == i) title += e.label |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (this.newsCategoryId==27&&this.total==1||this.newsCategoryId==28&&this.total==1||this.newsCategoryId==29&&this.total==1|| |
| | | this.newsCategoryId==30&&this.total==1||this.newsCategoryId==31&&this.total==1) { |
| | | if ( |
| | | (this.newsCategoryId == 27 && this.total == 1) || |
| | | (this.newsCategoryId == 28 && this.total == 1) || |
| | | (this.newsCategoryId == 29 && this.total == 1) || |
| | | (this.newsCategoryId == 30 && this.total == 1) || |
| | | (this.newsCategoryId == 31 && this.total == 1) |
| | | ) { |
| | | this.$message.error('该æ°é»æ é¢ä¸åªè½åå¨ä¸ç¯æ°é»') |
| | | }else if(this.newsCategoryId==27||this.newsCategoryId==28||this.newsCategoryId==29||this.newsCategoryId==30|| |
| | | this.newsCategoryId==31||this.newsCategoryId == 35||this.newsCategoryId==36||this.newsCategoryId==37|| |
| | | this.newsCategoryId==38||this.newsCategoryId==39||this.newsCategoryId==40|| |
| | | this.newsCategoryId==41||this.newsCategoryId==42||this.newsCategoryId==43|| |
| | | this.newsCategoryId==44){ |
| | | this.$router.push({path:'/administrator/edit',query:{id:id,title:title}}) |
| | | console.log(this.newsCategoryId); |
| | | }else if(this.newsCategoryId==45){ |
| | | this.$router.push({path:'/administrator/editlunbo',query:{id:id,title:title}}) |
| | | } else if ( |
| | | this.newsCategoryId == 27 || |
| | | this.newsCategoryId == 28 || |
| | | this.newsCategoryId == 29 || |
| | | this.newsCategoryId == 30 || |
| | | this.newsCategoryId == 31 || |
| | | this.newsCategoryId == 35 || |
| | | this.newsCategoryId == 36 || |
| | | this.newsCategoryId == 37 || |
| | | this.newsCategoryId == 38 || |
| | | this.newsCategoryId == 39 || |
| | | this.newsCategoryId == 40 || |
| | | this.newsCategoryId == 41 || |
| | | this.newsCategoryId == 42 || |
| | | this.newsCategoryId == 43 || |
| | | this.newsCategoryId == 44 |
| | | ) { |
| | | this.$router.push({ path: '/administrator/edit', query: { id: id, title: title } }) |
| | | console.log(this.newsCategoryId) |
| | | } else if (this.newsCategoryId == 45) { |
| | | this.$router.push({ path: '/administrator/editlunbo', query: { id: id, title: title } }) |
| | | // console.log(this.newsCategoryId); |
| | | }else{ |
| | | } else { |
| | | this.$message.error('请å
éæ©æ°é»æ é¢') |
| | | } |
| | | |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .add{ |
| | | .add { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | .block{ |
| | | .block { |
| | | margin-bottom: 10px; |
| | | } |
| | | .el-pagination{ |
| | | .el-pagination { |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | } |
| | | return {} |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | logout() { |
| | | //æ¸
空token |
| | | window.sessionStorage.clear() |
| | | //跳转å°ç»å½é¡µ |
| | | this.$router.push('/login') |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-row>{{ $route.query.title }}</el-row> |
| | | æ°é»æ é¢ï¼<el-input v-model="title" placeholder="请è¾å
¥æ°é»æ é¢"></el-input><br/><br/> |
| | | å叿¥æï¼<el-date-picker format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="è¯·éæ©æ°é»å叿¥æ"></el-date-picker><br/><br/> |
| | | æ°é»æ é¢ï¼<el-input v-model="title" placeholder="请è¾å
¥æ°é»æ é¢"></el-input><br /><br /> |
| | | å叿¥æï¼<el-date-picker format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="è¯·éæ©æ°é»å叿¥æ"></el-date-picker><br /><br /> |
| | | æ°é»å
容ï¼<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" /> |
| | | <el-row style="margin-top:50px;"> |
| | | <el-button type="success" @click="submit">åå¸</el-button> |
| | | <el-button type="success" @click="submit">åå¸</el-button> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | |
| | | import 'quill/dist/quill.snow.css' |
| | | import 'quill/dist/quill.bubble.css' |
| | | export default { |
| | | components:{ quillEditor }, |
| | | data(){ |
| | | components: { quillEditor }, |
| | | data() { |
| | | return { |
| | | title:'', //æ é¢å
容 |
| | | releaseTime:'', //å叿¥æ |
| | | content: '', //æ°é»å
容 |
| | | newsCategoryId:2, |
| | | title: '', //æ é¢å
容 |
| | | releaseTime: '', //å叿¥æ |
| | | content: '', //æ°é»å
容 |
| | | newsCategoryId: 2, |
| | | editorOption: { |
| | | placeholder: "请è¾å
¥æ£æ", |
| | | placeholder: '请è¾å
¥æ£æ', |
| | | // editorOption鿝æ¾å¾çä¸ä¼ é
ç½®åæ°ç¨çï¼ä¾å¦ï¼ |
| | | action: '/api/product/richtext_img_upload.do', // å¿
å¡«åæ° å¾çä¸ä¼ å°å |
| | | methods: 'POST', // å¿
å¡«åæ° å¾çä¸ä¼ æ¹å¼ |
| | | token: '', // å¯éåæ° 妿éè¦tokenéªè¯ï¼åè®¾ä½ çtokenæåæ¾å¨sessionStorage |
| | | name: 'upload_file', // å¿
å¡«åæ° æä»¶çåæ°å |
| | | size: 10000000, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºKb, 1M = 1024Kb |
| | | accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' // å¯é å¯ä¸ä¼ çå¾çæ ¼å¼ |
| | | } , //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList:[], |
| | | action: '/api/product/richtext_img_upload.do', // å¿
å¡«åæ° å¾çä¸ä¼ å°å |
| | | methods: 'POST', // å¿
å¡«åæ° å¾çä¸ä¼ æ¹å¼ |
| | | token: '', // å¯éåæ° 妿éè¦tokenéªè¯ï¼åè®¾ä½ çtokenæåæ¾å¨sessionStorage |
| | | name: 'upload_file', // å¿
å¡«åæ° æä»¶çåæ°å |
| | | size: 10000000, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºKb, 1M = 1024Kb |
| | | accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' // å¯é å¯ä¸ä¼ çå¾çæ ¼å¼ |
| | | }, //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | | created() { |
| | | // console.log('>>>>>>>',this.$route.query.id); |
| | | this.newsCategoryId = this.$route.query.id |
| | | }, |
| | | methods:{ |
| | | submit(){ |
| | | methods: { |
| | | submit() { |
| | | const data = { |
| | | newsCategoryId:this.newsCategoryId, |
| | | content:this.content, |
| | | title:this.title, |
| | | releaseTime:this.releaseTime |
| | | newsCategoryId: this.newsCategoryId, |
| | | content: this.content, |
| | | title: this.title, |
| | | releaseTime: this.releaseTime |
| | | } |
| | | add(data).then(res => { |
| | | console.log(res); |
| | | if(res.code !== 200){ |
| | | console.log(res) |
| | | if (res.code !== 200) { |
| | | return this.$message.error('å叿°é»å¤±è´¥ï¼è¯·éè¯ï¼') |
| | | }else{ |
| | | } else { |
| | | this.$message.success('æ°é»å叿åï¼') |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | this.$router.go(-1) |
| | | } |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .box{ |
| | | .box { |
| | | width: 1200px; |
| | | margin: 0 auto; |
| | | } |
| | | .myQuillEditor{ |
| | | .myQuillEditor { |
| | | height: 350px; |
| | | } |
| | | .btn{ |
| | | .btn { |
| | | position: absolute; |
| | | bottom: 20px; |
| | | left: 168px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-row><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row> |
| | | æ°é»æ é¢ï¼<el-input v-model="title" placeholder="请è¾å
¥æ°é»æ é¢"></el-input><br/><br/> |
| | | å叿¥æï¼<el-date-picker format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="è¯·éæ©æ°é»å叿¥æ"></el-date-picker><br/><br/> |
| | | <el-row |
| | | ><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row |
| | | > |
| | | æ°é»æ é¢ï¼<el-input v-model="title" placeholder="请è¾å
¥æ°é»æ é¢"></el-input><br /><br /> |
| | | å叿¥æï¼<el-date-picker format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="è¯·éæ©æ°é»å叿¥æ"></el-date-picker><br /><br /> |
| | | æ°é»å
容ï¼<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" /> |
| | | <el-row style="margin-top:50px;"> |
| | | <el-button type="success" @click="submit">åå¸</el-button> |
| | | <!-- <input type="file" @change="chooseFile"/><br/><br/> |
| | | <el-button type="success" @click="tijiao">æäº¤</el-button><br/><br/> |
| | | <img :src="'http://localhost:7070/'+this.photo" style="width: 400px"> --> |
| | | <el-button type="success" @click="submit">åå¸</el-button> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import axios from 'axios' |
| | | |
| | | import { add,fileUpload, login } from '../../api/api' |
| | | import {quillEditor,Quill} from 'vue-quill-editor' |
| | | // import axios from 'axios' |
| | | import { add, fileUpload, login } from '../../api/api' |
| | | import { quillEditor, Quill } from 'vue-quill-editor' |
| | | import 'quill/dist/quill.core.css' |
| | | import 'quill/dist/quill.snow.css' |
| | | import 'quill/dist/quill.bubble.css' |
| | | import { container, ImageExtend,QuillWatch } from 'quill-image-extend-module' |
| | | import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module' |
| | | Quill.register('modules/ImageExtend', ImageExtend) |
| | | axios.defaults.withCredentials = true; |
| | | // axios.defaults.withCredentials = true |
| | | |
| | | export default { |
| | | components:{ quillEditor }, |
| | | data(){ |
| | | components: { quillEditor }, |
| | | data() { |
| | | return { |
| | | title:'', //æ é¢å
容 |
| | | releaseTime:'', //å叿¥æ |
| | | content: '', //æ°é»å
容 |
| | | picture:null, |
| | | photo:'', |
| | | newsCategoryId:2, |
| | | title: '', // æ é¢å
容 |
| | | releaseTime: '', // å叿¥æ |
| | | content: '', // æ°é»å
容 |
| | | picture: null, |
| | | photo: '', |
| | | newsCategoryId: 2, |
| | | editorOption: { |
| | | placeholder: "请è¾å
¥æ£æ", |
| | | placeholder: '请è¾å
¥æ£æ', |
| | | modules: { |
| | | ImageExtend: { // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | name: 'file', // å¾çåæ°å |
| | | loading: true, |
| | | size: 10, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºMï¼1M = 1024kb |
| | | action:'http://localhost:7070/uploading', |
| | | response: (res) => { |
| | | console.log(res); |
| | | return 'http://localhost:7070/'+res.data |
| | | }, |
| | | headers: (xhr) => { |
| | | // axios.defaults.withCredentials = true; |
| | | // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288') |
| | | }, // å¯éåæ° 设置请æ±å¤´é¨ |
| | | sizeError: () => {}, // å¾çè¶
è¿å¤§å°çåè° |
| | | start: () => {}, // å¯éåæ° èªå®ä¹å¼å§ä¸ä¼ 触åäºä»¶ |
| | | end: () => {}, // å¯éåæ° èªå®ä¹ä¸ä¼ ç»æè§¦åçäºä»¶ï¼æ 论æåæè
失败 |
| | | error: () => {}, // å¯éåæ° ä¸ä¼ 失败触åçäºä»¶ |
| | | success: () => {}, // å¯éåæ° ä¸ä¼ æå触åçäºä»¶ |
| | | change: (xhr, formData) => { |
| | | // formData.append('token', 'myToken') |
| | | } // å¯éåæ° æ¯æ¬¡éæ©å¾ç触åï¼ä¹å¯ç¨æ¥è®¾ç½®å¤´é¨ï¼ä½æ¯headerså¤äºä¸ä¸ªåæ°ï¼å¯è®¾ç½®formData |
| | | ImageExtend: { |
| | | // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | name: 'file', // å¾çåæ°å |
| | | loading: true, |
| | | size: 10, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºMï¼1M = 1024kb |
| | | action: 'http://localhost:7070/uploading', |
| | | response: res => { |
| | | console.log(res) |
| | | return 'http://localhost:7070/' + res.data |
| | | }, |
| | | toolbar:{ |
| | | container:[ |
| | | ['bold', 'italic', 'underline', 'strike'], //å ç²ï¼æä½ï¼ä¸å线ï¼å é¤çº¿ |
| | | ['blockquote', 'code-block'], //å¼ç¨ï¼ä»£ç å |
| | | [{ 'header': 1 }, { 'header': 2 }], // æ é¢ï¼é®å¼å¯¹çå½¢å¼ï¼1ã2表示åä½å¤§å° |
| | | [{ 'list': 'ordered'}, { 'list': 'bullet' }], //å表 |
| | | [{ 'script': 'sub'}, { 'script': 'super' }], // ä¸ä¸æ |
| | | [{ 'indent': '-1'}, { 'indent': '+1' }], // ç¼©è¿ |
| | | [{ 'direction': 'rtl' }], // ææ¬æ¹å |
| | | [{ 'size': ['small', false, 'large', 'huge'] }], // åä½å¤§å° |
| | | [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //å 级æ é¢ |
| | | [{ 'color': [] }, { 'background': [] }], // åä½é¢è²ï¼åä½èæ¯é¢è² |
| | | [{ 'font': [] }], //åä½ |
| | | [{ 'align': [] }], //坹齿¹å¼ |
| | | ['clean'], //æ¸
é¤å使 ·å¼ |
| | | ['image'] //ä¸ä¼ å¾çãä¸ä¼ è§é¢ |
| | | ], |
| | | handlers: { |
| | | 'image': function () { // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | QuillWatch.emit(this.quill.id) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | } , //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList:[], |
| | | headers: xhr => { |
| | | // axios.defaults.withCredentials = true; |
| | | // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288') |
| | | }, // å¯éåæ° 设置请æ±å¤´é¨ |
| | | sizeError: () => {}, // å¾çè¶
è¿å¤§å°çåè° |
| | | start: () => {}, // å¯éåæ° èªå®ä¹å¼å§ä¸ä¼ 触åäºä»¶ |
| | | end: () => {}, // å¯éåæ° èªå®ä¹ä¸ä¼ ç»æè§¦åçäºä»¶ï¼æ 论æåæè
失败 |
| | | error: () => {}, // å¯éåæ° ä¸ä¼ 失败触åçäºä»¶ |
| | | success: () => {}, // å¯éåæ° ä¸ä¼ æå触åçäºä»¶ |
| | | change: (xhr, formData) => { |
| | | // formData.append('token', 'myToken') |
| | | } // å¯éåæ° æ¯æ¬¡éæ©å¾ç触åï¼ä¹å¯ç¨æ¥è®¾ç½®å¤´é¨ï¼ä½æ¯headerså¤äºä¸ä¸ªåæ°ï¼å¯è®¾ç½®formData |
| | | }, |
| | | toolbar: { |
| | | container: [ |
| | | ['bold', 'italic', 'underline', 'strike'], // å ç²ï¼æä½ï¼ä¸å线ï¼å é¤çº¿ |
| | | ['blockquote', 'code-block'], // å¼ç¨ï¼ä»£ç å |
| | | [{ header: 1 }, { header: 2 }], // æ é¢ï¼é®å¼å¯¹çå½¢å¼ï¼1ã2表示åä½å¤§å° |
| | | [{ list: 'ordered' }, { list: 'bullet' }], // å表 |
| | | [{ script: 'sub' }, { script: 'super' }], // ä¸ä¸æ |
| | | [{ indent: '-1' }, { indent: '+1' }], // ç¼©è¿ |
| | | [{ direction: 'rtl' }], // ææ¬æ¹å |
| | | [{ size: ['small', false, 'large', 'huge'] }], // åä½å¤§å° |
| | | [{ header: [1, 2, 3, 4, 5, 6, false] }], // å 级æ é¢ |
| | | [{ color: [] }, { background: [] }], // åä½é¢è²ï¼åä½èæ¯é¢è² |
| | | [{ font: [] }], // åä½ |
| | | [{ align: [] }], // 坹齿¹å¼ |
| | | ['clean'], // æ¸
é¤å使 ·å¼ |
| | | ['image'] // ä¸ä¼ å¾çãä¸ä¼ è§é¢ |
| | | ], |
| | | handlers: { |
| | | image: function() { |
| | | // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | QuillWatch.emit(this.quill.id) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, // ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | | created() { |
| | | // console.log('>>>>>>>',this.$route.query.id); |
| | | this.newsCategoryId = this.$route.query.id |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | methods:{ |
| | | // chooseFile(file){ |
| | | // this.picture = file.target.files[0]; |
| | | // console.log(this.picture) |
| | | // return false; |
| | | // }, |
| | | // tijiao(){ |
| | | // const fd = new FormData() |
| | | // fd.append('file',this.picture) |
| | | // fileUpload(fd).then(res => { |
| | | // console.log(res) |
| | | // if(res.code == 200){ |
| | | // this.photo = res.data |
| | | // console.log(this.photo); |
| | | // } |
| | | // }) |
| | | // }, |
| | | submit(){ |
| | | mounted() {}, |
| | | methods: { |
| | | submit() { |
| | | const data = { |
| | | newsCategoryId:this.newsCategoryId, |
| | | content:this.content, |
| | | title:this.title, |
| | | releaseTime:this.releaseTime |
| | | newsCategoryId: this.newsCategoryId, |
| | | content: this.content, |
| | | title: this.title, |
| | | releaseTime: this.releaseTime |
| | | } |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | // console.log(this.newsCategoryId); |
| | | add(data).then(res => { |
| | | console.log(res); |
| | | if(res.code !== 200){ |
| | | console.log(res) |
| | | if (res.code !== 200) { |
| | | return this.$message.error('å叿°é»å¤±è´¥ï¼è¯·éè¯ï¼') |
| | | }else{ |
| | | } else { |
| | | this.$message.success('æ°é»å叿åï¼') |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | this.$router.go(-1) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .box{ |
| | | .box { |
| | | width: 1200px; |
| | | margin: 0 auto; |
| | | } |
| | | .myQuillEditor{ |
| | | .myQuillEditor { |
| | | height: 350px; |
| | | } |
| | | .btn{ |
| | | .btn { |
| | | position: absolute; |
| | | bottom: 20px; |
| | | left: 168px; |
| | | } |
| | | .ql-editor img{ |
| | | .ql-editor img { |
| | | width: 100px !important; |
| | | height: 100px !important; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-row><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row> |
| | | æ°é»æ é¢ï¼<el-input v-model="title" placeholder="请è¾å
¥æ°é»æ é¢"></el-input><br/><br/> |
| | | å叿¥æï¼<el-date-picker format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="è¯·éæ©æ°é»å叿¥æ"></el-date-picker><br/><br/> |
| | | <input type="file" @change="chooseFile"/><br/><br/> |
| | | <el-row |
| | | ><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row |
| | | > |
| | | æ°é»æ é¢ï¼<el-input v-model="title" placeholder="请è¾å
¥æ°é»æ é¢"></el-input><br /><br /> |
| | | å叿¥æï¼<el-date-picker format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd" v-model="releaseTime" placeholder="è¯·éæ©æ°é»å叿¥æ"></el-date-picker><br /><br /> |
| | | <input type="file" @change="chooseFile" /><br /><br /> |
| | | æ°é»å
容ï¼<quill-editor ref="text" v-model="content" class="myQuillEditor" :options="editorOption" /> |
| | | <el-row style="margin-top:50px;"> |
| | | <el-button type="success" @click="submit">åå¸</el-button> |
| | | <el-button type="success" @click="submit">åå¸</el-button> |
| | | </el-row> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import { add,fileUpload, login } from '../../api/api' |
| | | import {quillEditor,Quill} from 'vue-quill-editor' |
| | | import { add, fileUpload, login } from '../../api/api' |
| | | import { quillEditor, Quill } from 'vue-quill-editor' |
| | | import 'quill/dist/quill.core.css' |
| | | import 'quill/dist/quill.snow.css' |
| | | import 'quill/dist/quill.bubble.css' |
| | | import { container, ImageExtend,QuillWatch } from 'quill-image-extend-module' |
| | | import { container, ImageExtend, QuillWatch } from 'quill-image-extend-module' |
| | | Quill.register('modules/ImageExtend', ImageExtend) |
| | | // axios.defaults.withCredentials = true; |
| | | |
| | | export default { |
| | | components:{ quillEditor }, |
| | | data(){ |
| | | components: { quillEditor }, |
| | | data() { |
| | | return { |
| | | title:'', //æ é¢å
容 |
| | | releaseTime:'', //å叿¥æ |
| | | content: '', //æ°é»å
容 |
| | | newsCategoryId:45, |
| | | title: '', //æ é¢å
容 |
| | | releaseTime: '', //å叿¥æ |
| | | content: '', //æ°é»å
容 |
| | | newsCategoryId: 45, |
| | | editorOption: { |
| | | placeholder: "请è¾å
¥æ£æ", |
| | | placeholder: '请è¾å
¥æ£æ', |
| | | modules: { |
| | | ImageExtend: { // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | name: 'file', // å¾çåæ°å |
| | | loading: true, |
| | | size: 10, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºMï¼1M = 1024kb |
| | | action:'http://localhost:7070/uploading', |
| | | response: (res) => { |
| | | console.log(res); |
| | | return 'http://localhost:7070/'+res.data |
| | | }, |
| | | headers: (xhr) => { |
| | | // axios.defaults.withCredentials = true; |
| | | // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288') |
| | | }, // å¯éåæ° 设置请æ±å¤´é¨ |
| | | sizeError: () => {}, // å¾çè¶
è¿å¤§å°çåè° |
| | | start: () => {}, // å¯éåæ° èªå®ä¹å¼å§ä¸ä¼ 触åäºä»¶ |
| | | end: () => {}, // å¯éåæ° èªå®ä¹ä¸ä¼ ç»æè§¦åçäºä»¶ï¼æ 论æåæè
失败 |
| | | error: () => {}, // å¯éåæ° ä¸ä¼ 失败触åçäºä»¶ |
| | | success: () => {}, // å¯éåæ° ä¸ä¼ æå触åçäºä»¶ |
| | | change: (xhr, formData) => { |
| | | // formData.append('token', 'myToken') |
| | | } // å¯éåæ° æ¯æ¬¡éæ©å¾ç触åï¼ä¹å¯ç¨æ¥è®¾ç½®å¤´é¨ï¼ä½æ¯headerså¤äºä¸ä¸ªåæ°ï¼å¯è®¾ç½®formData |
| | | ImageExtend: { |
| | | // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | name: 'file', // å¾çåæ°å |
| | | loading: true, |
| | | size: 10, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºMï¼1M = 1024kb |
| | | action: 'http://localhost:7070/uploading', |
| | | response: res => { |
| | | console.log(res) |
| | | return 'http://localhost:7070/' + res.data |
| | | }, |
| | | toolbar:{ |
| | | container:[ |
| | | ['bold', 'italic', 'underline', 'strike'], //å ç²ï¼æä½ï¼ä¸å线ï¼å é¤çº¿ |
| | | ['blockquote', 'code-block'], //å¼ç¨ï¼ä»£ç å |
| | | [{ 'header': 1 }, { 'header': 2 }], // æ é¢ï¼é®å¼å¯¹çå½¢å¼ï¼1ã2表示åä½å¤§å° |
| | | [{ 'list': 'ordered'}, { 'list': 'bullet' }], //å表 |
| | | [{ 'script': 'sub'}, { 'script': 'super' }], // ä¸ä¸æ |
| | | [{ 'indent': '-1'}, { 'indent': '+1' }], // ç¼©è¿ |
| | | [{ 'direction': 'rtl' }], // ææ¬æ¹å |
| | | [{ 'size': ['small', false, 'large', 'huge'] }], // åä½å¤§å° |
| | | [{ 'header': [1, 2, 3, 4, 5, 6, false] }], //å 级æ é¢ |
| | | [{ 'color': [] }, { 'background': [] }], // åä½é¢è²ï¼åä½èæ¯é¢è² |
| | | [{ 'font': [] }], //åä½ |
| | | [{ 'align': [] }], //坹齿¹å¼ |
| | | ['clean'], //æ¸
é¤å使 ·å¼ |
| | | ['image'] //ä¸ä¼ å¾çãä¸ä¼ è§é¢ |
| | | ], |
| | | handlers: { |
| | | 'image': function () { // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | QuillWatch.emit(this.quill.id) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | } , //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList:[], |
| | | headers: xhr => { |
| | | // axios.defaults.withCredentials = true; |
| | | // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288') |
| | | }, // å¯éåæ° 设置请æ±å¤´é¨ |
| | | sizeError: () => {}, // å¾çè¶
è¿å¤§å°çåè° |
| | | start: () => {}, // å¯éåæ° èªå®ä¹å¼å§ä¸ä¼ 触åäºä»¶ |
| | | end: () => {}, // å¯éåæ° èªå®ä¹ä¸ä¼ ç»æè§¦åçäºä»¶ï¼æ 论æåæè
失败 |
| | | error: () => {}, // å¯éåæ° ä¸ä¼ 失败触åçäºä»¶ |
| | | success: () => {}, // å¯éåæ° ä¸ä¼ æå触åçäºä»¶ |
| | | change: (xhr, formData) => { |
| | | // formData.append('token', 'myToken') |
| | | } // å¯éåæ° æ¯æ¬¡éæ©å¾ç触åï¼ä¹å¯ç¨æ¥è®¾ç½®å¤´é¨ï¼ä½æ¯headerså¤äºä¸ä¸ªåæ°ï¼å¯è®¾ç½®formData |
| | | }, |
| | | toolbar: { |
| | | container: [ |
| | | ['bold', 'italic', 'underline', 'strike'], //å ç²ï¼æä½ï¼ä¸å线ï¼å é¤çº¿ |
| | | ['blockquote', 'code-block'], //å¼ç¨ï¼ä»£ç å |
| | | [{ header: 1 }, { header: 2 }], // æ é¢ï¼é®å¼å¯¹çå½¢å¼ï¼1ã2表示åä½å¤§å° |
| | | [{ list: 'ordered' }, { list: 'bullet' }], //å表 |
| | | [{ script: 'sub' }, { script: 'super' }], // ä¸ä¸æ |
| | | [{ indent: '-1' }, { indent: '+1' }], // ç¼©è¿ |
| | | [{ direction: 'rtl' }], // ææ¬æ¹å |
| | | [{ size: ['small', false, 'large', 'huge'] }], // åä½å¤§å° |
| | | [{ header: [1, 2, 3, 4, 5, 6, false] }], //å 级æ é¢ |
| | | [{ color: [] }, { background: [] }], // åä½é¢è²ï¼åä½èæ¯é¢è² |
| | | [{ font: [] }], //åä½ |
| | | [{ align: [] }], //坹齿¹å¼ |
| | | ['clean'], //æ¸
é¤å使 ·å¼ |
| | | ['image'] //ä¸ä¼ å¾çãä¸ä¼ è§é¢ |
| | | ], |
| | | handlers: { |
| | | image: function() { |
| | | // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | QuillWatch.emit(this.quill.id) |
| | | } |
| | | } |
| | | } |
| | | } |
| | | }, //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | | created() { |
| | | // console.log('>>>>>>>',this.$route.query.id); |
| | | this.newsCategoryId = this.$route.query.id |
| | | }, |
| | | methods:{ |
| | | methods: { |
| | | chooseFile(file) { |
| | | this.pictureFile = file.target.files[0]; |
| | | this.pictureFile = file.target.files[0] |
| | | console.log(this.pictureFile) |
| | | console.log(file); |
| | | return false; |
| | | console.log(file) |
| | | return false |
| | | }, |
| | | submit(){ |
| | | const fd = new FormData(); |
| | | fd.append('pictureFile',this.pictureFile); |
| | | submit() { |
| | | const fd = new FormData() |
| | | fd.append('pictureFile', this.pictureFile) |
| | | const data = { |
| | | newsCategoryId:this.newsCategoryId, |
| | | content:this.content, |
| | | releaseTime:this.releaseTime, |
| | | title:this.title |
| | | newsCategoryId: this.newsCategoryId, |
| | | content: this.content, |
| | | releaseTime: this.releaseTime, |
| | | title: this.title |
| | | } |
| | | // console.log(999) |
| | | add(data,fd).then(res => { |
| | | console.log(res); |
| | | console.log(this.newsCategoryId); |
| | | add(data, fd).then(res => { |
| | | console.log(res) |
| | | console.log(this.newsCategoryId) |
| | | if (res.code != 200) { |
| | | return this.$message.error('å叿°é»å¤±è´¥ï¼è¯·éè¯ï¼') |
| | | }else{ |
| | | } else { |
| | | this.$message.success('æ°é»å叿åï¼') |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | this.$router.go(-1) |
| | | } |
| | | }) |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .box{ |
| | | .box { |
| | | width: 1200px; |
| | | margin: 0 auto; |
| | | } |
| | | .myQuillEditor{ |
| | | .myQuillEditor { |
| | | height: 350px; |
| | | } |
| | | .btn{ |
| | | .btn { |
| | | position: absolute; |
| | | bottom: 20px; |
| | | left: 168px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <!-- 级èéæ©å¨ --> |
| | | <div class="block"> |
| | | <el-cascader |
| | | v-model="value" |
| | | :options="options" |
| | | clearable |
| | | filterable |
| | | @change="handleChange"> |
| | | </el-cascader> |
| | | <div class="block"> |
| | | <el-cascader v-model="value" :options="options" clearable filterable @change="handleChange"> </el-cascader> |
| | | </div> |
| | | <div> |
| | | <el-card class="box-card"> |
| | |
| | | </el-col> |
| | | </el-row> |
| | | <!-- æ°é»è¡¨æ ¼åºå --> |
| | | <el-table v-show="gettable" :data="tableData" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }" |
| | | > |
| | | <el-table v-show="gettable" :data="tableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> |
| | | <!-- :header-cell-style="{textAlign: 'center'}"设置头é¨å±
ä¸ï¼ --> |
| | | <!-- :cell-style="{ textAlign: 'center' }"设置æ´ä¸ªè¡¨æ ¼å
容水平å±
ä¸ï¼ --> |
| | | <!-- é®é¢ï¼æä¹è·åæ°ç»ä¸æ¯ä¸ªå¯¹è±¡çkeyå¼ï¼æ¯æ¡æ°é»çidï¼? |
| | | è§£å³ï¼éè¿ä½ç¨åææ§½ slot-scope è·åæ¯ä¸ªå¯¹è±¡ --> |
| | | <el-table-column type="index"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span> |
| | | <span>{{ (currentPage - 1) * pageSize + scope.$index + 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width="" > |
| | | </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width=""> </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> </el-table-column> |
| | | <el-table-column label="æä½" width=""> |
| | | <template slot-scope="scope"> |
| | | <!-- {{ scope.row.id }} --> |
| | |
| | | <el-button type="info" @click="deleteNews(scope.row.id)">å é¤</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- æ¨¡ç³æ¥è¯¢çè¡¨æ ¼æ¾ç¤º --> |
| | | <el-table v-show="fuzzytable" :data="fuzzytableData" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }"> |
| | | <el-table v-show="fuzzytable" :data="fuzzytableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> |
| | | <el-table-column type="index"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ (fuzzyForm.fuzzycurrent-1)*fuzzyForm.fuzzysize+scope.$index+1 }}</span> |
| | | <span>{{ (fuzzyForm.fuzzycurrent - 1) * fuzzyForm.fuzzysize + scope.$index + 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width="" > |
| | | </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width=""> </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> </el-table-column> |
| | | <el-table-column label="æä½" width=""> |
| | | <template slot-scope="scope"> |
| | | <div> |
| | |
| | | <el-button type="info" @click="deleteNews(scope.row.id)">å é¤</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- å页 --> |
| | |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[6,12, 18,]" |
| | | :page-sizes="[6, 12, 18]" |
| | | :page-size="100" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"> |
| | | :total="total" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | <!-- æ¨¡ç³æ°é»å表å页 --> |
| | |
| | | @size-change="handleSizeChangefuzzy" |
| | | @current-change="handleCurrentChangefuzzy" |
| | | :current-page="fuzzyForm.fuzzycurrent" |
| | | :page-sizes="[6,10, 18,]" |
| | | :page-sizes="[6, 10, 18]" |
| | | :page-size="100" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="fuzzyForm.fuzzytotal"> |
| | | :total="fuzzyForm.fuzzytotal" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | <!-- ä¿®æ¹æ°é»çå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | title="ä¿®æ¹æ°é»" |
| | | :visible.sync="editDialogVisible" |
| | | width="50%" |
| | | :before-close="handleClose"> |
| | | <el-dialog title="ä¿®æ¹æ°é»" :visible.sync="editDialogVisible" width="50%" :before-close="handleClose"> |
| | | <!-- rules表åéªè¯è§åï¼refå½å表åçéªè¯å¯¹è±¡ --> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form-item label="id:"> |
| | | <el-input v-model="editForm.id" disabled></el-input> |
| | | </el-form-item> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getNewsList,getnew,update,deleteNew,fuzzy } from '../../api/api' |
| | | import { getNewsList, getnew, update, deleteNew, fuzzy } from '../../api/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | | getShow:true, //è·ååé¡µçæ¾ç¤º(å¸å°å¼) |
| | | gettable:true, //è·åè¡¨æ ¼çæ¾ç¤º |
| | | getShow: true, //è·ååé¡µçæ¾ç¤º(å¸å°å¼) |
| | | gettable: true, //è·åè¡¨æ ¼çæ¾ç¤º |
| | | visible: false, |
| | | editDialogVisible:false, //æ§å¶ä¿®æ¹å¯¹è¯æ¡çå¸å°å¼ |
| | | editForm:{}, //æ¥è¯¢å°çæ°é»å¯¹è±¡ï¼ç®åä»
ä¾ä¿®æ¹ä½¿ç¨ |
| | | newsCategoryId:1, //å
åä¸ä¸ªå°æ é¢id |
| | | tableData:[], //æ°é»å表对象 |
| | | fuzzytableData:[], //æ¨¡ç³æ¥è¯¢å表对象 |
| | | pageSize:6, //æ¯é¡µæ¡æ° |
| | | currentPage:1, //å½å页 |
| | | total:0, //æ°é»æ»æ¡æ° |
| | | fuzzyShow:false, //æ¨¡ç³æ¥è¯¢åé¡µçæ¾ç¤º(å¸å°å¼) |
| | | fuzzytable:false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | editDialogVisible: false, //æ§å¶ä¿®æ¹å¯¹è¯æ¡çå¸å°å¼ |
| | | editForm: {}, //æ¥è¯¢å°çæ°é»å¯¹è±¡ï¼ç®åä»
ä¾ä¿®æ¹ä½¿ç¨ |
| | | newsCategoryId: 1, //å
åä¸ä¸ªå°æ é¢id |
| | | tableData: [], //æ°é»å表对象 |
| | | fuzzytableData: [], //æ¨¡ç³æ¥è¯¢å表对象 |
| | | pageSize: 6, //æ¯é¡µæ¡æ° |
| | | currentPage: 1, //å½å页 |
| | | total: 0, //æ°é»æ»æ¡æ° |
| | | fuzzyShow: false, //æ¨¡ç³æ¥è¯¢åé¡µçæ¾ç¤º(å¸å°å¼) |
| | | fuzzytable: false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm: { fuzzytitle: '', fuzzytotal: 0, fuzzycurrent: 1, fuzzysize: 6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | value: [], |
| | | options: [{ |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [{ |
| | | value:42, |
| | | label: 'éç¥å
Œ', |
| | | }, |
| | | options: [ |
| | | { |
| | | value:43, |
| | | label: 'å·¥ä½å¨æ', |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [ |
| | | { |
| | | value: 42, |
| | | label: 'éç¥å
Œ' |
| | | }, |
| | | { |
| | | value: 43, |
| | | label: 'å·¥ä½å¨æ' |
| | | }, |
| | | { |
| | | value: 44, |
| | | label: 'å¦é¢å¨æ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value:44, |
| | | label: 'å¦é¢å¨æ', |
| | | }], |
| | | },{ |
| | | value: 22, |
| | | label: 'ç§åæ¦åµ', |
| | | children: [{ |
| | | value:27, |
| | | label: 'ç®ä»', |
| | | }, |
| | | { |
| | | value:28, |
| | | label: 'ç« ç¨', |
| | | }, |
| | | { |
| | | value:29, |
| | | label: 'ç»ç»ç»æ', |
| | | }, |
| | | { |
| | | value:30, |
| | | label: 'å·¥ä½èè´£', |
| | | }, |
| | | { |
| | | value:31, |
| | | label: 'ä¸è人å', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 27, |
| | | label: 'ç®ä»' |
| | | }, |
| | | { |
| | | value: 28, |
| | | label: 'ç« ç¨' |
| | | }, |
| | | { |
| | | value: 29, |
| | | label: 'ç»ç»ç»æ' |
| | | }, |
| | | { |
| | | value: 30, |
| | | label: 'å·¥ä½èè´£' |
| | | }, |
| | | { |
| | | value: 31, |
| | | label: 'ä¸è人å' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 23, |
| | | label: 'æ¿çæ³è§', |
| | | children: [{ |
| | | value:35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶', |
| | | }, |
| | | { |
| | | value:36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶', |
| | | }, |
| | | { |
| | | value:37, |
| | | label: '社å¢ç®¡çæä»¶', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value: 36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value: 37, |
| | | label: '社å¢ç®¡çæä»¶' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 25, |
| | | label: '妿¯äº¤æµ', |
| | | children: [{ |
| | | value:38, |
| | | label: '妿¯ä¿¡æ¯', |
| | | }, |
| | | { |
| | | value:39, |
| | | label: 'ç§æç«èµ', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 38, |
| | | label: '妿¯ä¿¡æ¯' |
| | | }, |
| | | { |
| | | value: 39, |
| | | label: 'ç§æç«èµ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 27, |
| | | label: 'ç§æ®é£é', |
| | | children: [{ |
| | | value:40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨', |
| | | }, |
| | | { |
| | | value:41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨', |
| | | }], |
| | | }] |
| | | children: [ |
| | | { |
| | | value: 40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨' |
| | | }, |
| | | { |
| | | value: 41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | created(){ |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | methods: { |
| | | //ä¿®æ¹å¯¹è¯æ¡å
³éçæ¹æ³ |
| | | handleClose(done) { |
| | | this.$confirm('确认å
³éï¼') |
| | | .then(_ => { |
| | | done(); |
| | | done() |
| | | }) |
| | | .catch(_ => {}); |
| | | .catch(_ => {}) |
| | | }, |
| | | //级èéæ©å¨çæ¹æ³ |
| | | handleChange(value) { |
| | | // console.log(value); |
| | | // console.log(value[1]); |
| | | this.newsCategoryId = value[1]; //å°å¾å°çå°æ é¢idåæ¾èµ·æ¥ |
| | | this.query(this.newsCategoryId); |
| | | this.newsCategoryId = value[1] //å°å¾å°çå°æ é¢idåæ¾èµ·æ¥ |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | query(newsCategoryId){ |
| | | query(newsCategoryId) { |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:newsCategoryId, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res=>{ |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | | }else{ |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | current: this.currentPage, |
| | | newsCategoryId: newsCategoryId, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | | } else { |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å±ç¤ºä¿®æ¹å¯¹è¯æ¡ |
| | | showEditDialog(id){ |
| | | showEditDialog(id) { |
| | | getnew(id).then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.editForm = res.data |
| | | } |
| | | } |
| | | }) |
| | | this.editDialogVisible = true; |
| | | this.editDialogVisible = true |
| | | }, |
| | | //ç¡®å®ä¿®æ¹è¡¨åæäº¤ï¼éªè¯åèµ·è¯·æ± |
| | | editNew(){ |
| | | editNew() { |
| | | const data = { |
| | | id: this.editForm.id, |
| | | releaseTime: this.editForm.releaseTime, |
| | | title:this.editForm.title |
| | | title: this.editForm.title |
| | | } |
| | | update(data).then(res=>{ |
| | | update(data).then(res => { |
| | | // console.log('dsadasas',res); |
| | | if (res.code == 200) { |
| | | this.editDialogVisible =false; |
| | | this.editDialogVisible = false |
| | | this.$message.success('ä¿®æ¹æ°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | this.query(this.newsCategoryId) |
| | | } |
| | | }) |
| | | }, |
| | | //æ¨¡ç³æ¥è¯¢ |
| | | fuzzyList(title){ |
| | | fuzzyList(title) { |
| | | // console.log(title); |
| | | if(title == ''){ |
| | | return this.$message.error('请å
è¾å
¥æ¥è¯¢æ°é»æ é¢ï¼') |
| | | if (title == '') { |
| | | return this.$message.error('请å
è¾å
¥æ¥è¯¢æ°é»æ é¢ï¼') |
| | | } |
| | | this.fuzzyShow = true //模ç³å页æ¾ç¤º |
| | | this.getShow = false //è·åå页éè |
| | | this.getShow = false //è·åå页éè |
| | | this.gettable = false |
| | | this.fuzzytable = true |
| | | const data = { |
| | | current: this.fuzzyForm.fuzzycurrent, |
| | | size: this.fuzzyForm.fuzzysize, |
| | | title:title |
| | | title: title |
| | | } |
| | | fuzzy(data).then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | | }else{ |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | fuzzy(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | | } else { |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //æ¸
空æ¥è¯¢å表å
容 |
| | | qingKong(){ |
| | | qingKong() { |
| | | this.tableData = [] |
| | | this.fuzzytableData = [] |
| | | this.fuzzyForm.fuzzytotal = 0 |
| | |
| | | this.gettable = true |
| | | }, |
| | | //æ ¹æ®idå 餿°é» |
| | | async deleteNews(id){ |
| | | async deleteNews(id) { |
| | | // console.log(id); |
| | | const res = await this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ¡æ°é», æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | if(res !== 'confirm'){ |
| | | console.log(res) |
| | | if (res !== 'confirm') { |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | console.log(id); |
| | | } else { |
| | | console.log(id) |
| | | const data = { |
| | | id:id |
| | | id: id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteNew(data).then(res => { |
| | | console.log('>>>'+res); |
| | | if(res.code == 200){ |
| | | console.log('>>>' + res) |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | }else{ |
| | | this.query(this.newsCategoryId) |
| | | } else { |
| | | return this.$message.error('å 餿°é»å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | //æ¥ç |
| | | look(id){ |
| | | this.$router.push({path:'news',query:{id:id}}) |
| | | look(id) { |
| | | this.$router.push({ path: 'news', query: { id: id } }) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPage = val; |
| | | this.currentPage = val |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | handleSizeChange(val) { |
| | | // console.log(`æ¯é¡µ ${val} æ¡`); |
| | | this.pageSize = val; |
| | | this.pageSize = val |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | handleCurrentChangefuzzy(val){ |
| | | handleCurrentChangefuzzy(val) { |
| | | this.fuzzyForm.fuzzycurrent = val |
| | | this.fuzzyList(this.fuzzyForm.fuzzytitle) //æ¨¡ç³æ¥è¯¢ |
| | | }, |
| | | handleSizeChangefuzzy(val){ |
| | | handleSizeChangefuzzy(val) { |
| | | this.fuzzyForm.fuzzysize = val |
| | | this.fuzzyList(this.fuzzyForm.fuzzytitle) //æ¨¡ç³æ¥è¯¢ |
| | | }, |
| | | //å»å¾æ·»å ç¼è¾é¡µé¢ |
| | | goEdit(id){ |
| | | if (this.newsCategoryId==27&&this.total==1||this.newsCategoryId==28&&this.total==1||this.newsCategoryId==29&&this.total==1|| |
| | | this.newsCategoryId==30&&this.total==1||this.newsCategoryId==31&&this.total==1) { |
| | | goEdit(id) { |
| | | if ( |
| | | (this.newsCategoryId == 27 && this.total == 1) || |
| | | (this.newsCategoryId == 28 && this.total == 1) || |
| | | (this.newsCategoryId == 29 && this.total == 1) || |
| | | (this.newsCategoryId == 30 && this.total == 1) || |
| | | (this.newsCategoryId == 31 && this.total == 1) |
| | | ) { |
| | | this.$message.error('该æ°é»æ é¢ä¸åªè½åå¨ä¸ç¯æ°é»') |
| | | }else if(this.newsCategoryId==27||this.newsCategoryId==28||this.newsCategoryId==29||this.newsCategoryId==30|| |
| | | this.newsCategoryId==31||this.newsCategoryId == 35||this.newsCategoryId==36||this.newsCategoryId==37|| |
| | | this.newsCategoryId==38||this.newsCategoryId==39||this.newsCategoryId==40|| |
| | | this.newsCategoryId==41||this.newsCategoryId==42||this.newsCategoryId==43|| |
| | | this.newsCategoryId==44){ |
| | | this.$router.push({path:'/administrator/edit',query:{id:id}}) |
| | | console.log(this.newsCategoryId); |
| | | }else{ |
| | | } else if ( |
| | | this.newsCategoryId == 27 || |
| | | this.newsCategoryId == 28 || |
| | | this.newsCategoryId == 29 || |
| | | this.newsCategoryId == 30 || |
| | | this.newsCategoryId == 31 || |
| | | this.newsCategoryId == 35 || |
| | | this.newsCategoryId == 36 || |
| | | this.newsCategoryId == 37 || |
| | | this.newsCategoryId == 38 || |
| | | this.newsCategoryId == 39 || |
| | | this.newsCategoryId == 40 || |
| | | this.newsCategoryId == 41 || |
| | | this.newsCategoryId == 42 || |
| | | this.newsCategoryId == 43 || |
| | | this.newsCategoryId == 44 |
| | | ) { |
| | | this.$router.push({ path: '/administrator/edit', query: { id: id } }) |
| | | console.log(this.newsCategoryId) |
| | | } else { |
| | | this.$message.error('请å
éæ©æ°é»æ é¢') |
| | | } |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .add{ |
| | | .add { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | .block{ |
| | | .block { |
| | | margin-bottom: 10px; |
| | | } |
| | | .el-pagination{ |
| | | .el-pagination { |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <!-- 级èéæ©å¨ --> |
| | | <el-row class="block"> |
| | | <el-col :span="4"> |
| | | <el-cascader |
| | | v-model="value" |
| | | :options="options" |
| | | clearable |
| | | filterable |
| | | :getCheckedNodes="true" |
| | | @change="handleChange"> |
| | | </el-cascader> |
| | | <el-cascader v-model="value" :options="options" clearable filterable :getCheckedNodes="true" @change="handleChange"> </el-cascader> |
| | | </el-col> |
| | | </el-row> |
| | | <div> |
| | |
| | | </el-col> |
| | | <el-col :span="10"> |
| | | <!-- æ°é»æç´¢ --> |
| | | <el-input clearable placeholder="请è¾å
¥æè¦æ¥è¯¢çæ°é»æ é¢" v-model="search" class="input-with-select"> |
| | | </el-input> |
| | | <el-input clearable placeholder="请è¾å
¥æè¦æ¥è¯¢çæ°é»æ é¢" v-model="search" class="input-with-select"> </el-input> |
| | | </el-col> |
| | | </el-row> |
| | | <!-- æ°é»è¡¨æ ¼åºå --> |
| | | <el-table |
| | | <el-table |
| | | :data="tableData.filter(data => !search || data.title.toLowerCase().includes(search.toLowerCase()))" |
| | | border |
| | | style="width: 100%" |
| | | :header-cell-style="{textAlign: 'center'}" |
| | | border |
| | | style="width: 100%" |
| | | :header-cell-style="{ textAlign: 'center' }" |
| | | :cell-style="{ textAlign: 'center' }" |
| | | > |
| | | <el-table-column type="index" label="åºå·" width="50"> |
| | | <template slot-scope="scope"> |
| | | <span>{{ (currentPage-1)*pageSize+scope.$index+1 }}</span> |
| | | <span>{{ (currentPage - 1) * pageSize + scope.$index + 1 }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width="" > |
| | | </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="releaseTime" label="æ¥æ" width=""> </el-table-column> |
| | | <el-table-column prop="title" label="æ°é»æ é¢" width=""> </el-table-column> |
| | | <el-table-column prop="id" label="id" width=""> </el-table-column> |
| | | <el-table-column label="æä½" width=""> |
| | | <template slot-scope="scope"> |
| | | <!-- {{ scope.row.id }} --> |
| | |
| | | <el-button type="info" @click="deleteNews(scope.row.id)">å é¤</el-button> |
| | | </div> |
| | | </template> |
| | | |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- å页 --> |
| | |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="currentPage" |
| | | :page-sizes="[6,12, 18,]" |
| | | :page-sizes="[6, 12, 18]" |
| | | :page-size="100" |
| | | layout="total, sizes, prev, pager, next, jumper" |
| | | :total="total"> |
| | | :total="total" |
| | | > |
| | | </el-pagination> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | | <!-- ä¿®æ¹æ°é»çå¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | title="ä¿®æ¹æ°é»" |
| | | :visible.sync="editDialogVisible" |
| | | width="50%" |
| | | :before-close="handleClose"> |
| | | <el-dialog title="ä¿®æ¹æ°é»" :visible.sync="editDialogVisible" width="50%" :before-close="handleClose"> |
| | | <!-- rules表åéªè¯è§åï¼refå½å表åçéªè¯å¯¹è±¡ --> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form ref="editFormRef" :model="editForm" label-width="80px" status-icon> |
| | | <el-form-item label="id:"> |
| | | <el-input v-model="editForm.id" disabled></el-input> |
| | | </el-form-item> |
| | |
| | | <el-input v-model="editForm.title"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="å叿¥æ:"> |
| | | <el-date-picker |
| | | v-model="editForm.releaseTime" |
| | | type="date" |
| | | placeholder="è¯·éæ©å叿¥æ" |
| | | format="yyyy å¹´ MM æ dd æ¥" |
| | | value-format="yyyy-MM-dd" |
| | | ></el-date-picker> |
| | | <el-date-picker v-model="editForm.releaseTime" type="date" placeholder="è¯·éæ©å叿¥æ" format="yyyy å¹´ MM æ dd æ¥" value-format="yyyy-MM-dd"></el-date-picker> |
| | | </el-form-item> |
| | | </el-form> |
| | | <span slot="footer" class="dialog-footer"> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { getNewsList,getnew,update,deleteNew,fuzzy } from '../../api/api' |
| | | import { getNewsList, getnew, update, deleteNew, fuzzy } from '../../api/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | | search:'', |
| | | getShow:true, //è·ååé¡µçæ¾ç¤º(å¸å°å¼) |
| | | gettable:true, //è·åè¡¨æ ¼çæ¾ç¤º |
| | | search: '', |
| | | getShow: true, //è·ååé¡µçæ¾ç¤º(å¸å°å¼) |
| | | gettable: true, //è·åè¡¨æ ¼çæ¾ç¤º |
| | | visible: false, |
| | | editDialogVisible:false, //æ§å¶ä¿®æ¹å¯¹è¯æ¡çå¸å°å¼ |
| | | AdDialogVisible:false, //è¶
管ç»å½å¯¹è¯æ¡ |
| | | Ad:{ username:'',password:'' }, //è¶
管对象 |
| | | editForm:{}, //æ¥è¯¢å°çæ°é»å¯¹è±¡ï¼ç®åä»
ä¾ä¿®æ¹ä½¿ç¨ |
| | | newsCategoryId:1, //å
åä¸ä¸ªå°æ é¢id |
| | | tableData:[], //æ°é»å表对象 |
| | | fuzzytableData:[], //æ¨¡ç³æ¥è¯¢å表对象 |
| | | pageSize:6, //æ¯é¡µæ¡æ° |
| | | currentPage:1, //å½å页 |
| | | total:0, //æ°é»æ»æ¡æ° |
| | | fuzzyShow:false, //æ¨¡ç³æ¥è¯¢åé¡µçæ¾ç¤º(å¸å°å¼) |
| | | fuzzytable:false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | editDialogVisible: false, //æ§å¶ä¿®æ¹å¯¹è¯æ¡çå¸å°å¼ |
| | | AdDialogVisible: false, //è¶
管ç»å½å¯¹è¯æ¡ |
| | | Ad: { username: '', password: '' }, //è¶
管对象 |
| | | editForm: {}, //æ¥è¯¢å°çæ°é»å¯¹è±¡ï¼ç®åä»
ä¾ä¿®æ¹ä½¿ç¨ |
| | | newsCategoryId: 1, //å
åä¸ä¸ªå°æ é¢id |
| | | tableData: [], //æ°é»å表对象 |
| | | fuzzytableData: [], //æ¨¡ç³æ¥è¯¢å表对象 |
| | | pageSize: 6, //æ¯é¡µæ¡æ° |
| | | currentPage: 1, //å½å页 |
| | | total: 0, //æ°é»æ»æ¡æ° |
| | | fuzzyShow: false, //æ¨¡ç³æ¥è¯¢åé¡µçæ¾ç¤º(å¸å°å¼) |
| | | fuzzytable: false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm: { fuzzytitle: '', fuzzytotal: 0, fuzzycurrent: 1, fuzzysize: 6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | value: [], |
| | | options: [{ |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [{ |
| | | value:42, |
| | | label: 'éç¥å
Œ', |
| | | }, |
| | | options: [ |
| | | { |
| | | value:43, |
| | | label: 'å·¥ä½å¨æ', |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [ |
| | | { |
| | | value: 42, |
| | | label: 'éç¥å
Œ' |
| | | }, |
| | | { |
| | | value: 43, |
| | | label: 'å·¥ä½å¨æ' |
| | | }, |
| | | { |
| | | value: 44, |
| | | label: 'å¦é¢å¨æ' |
| | | }, |
| | | { |
| | | value: 45, |
| | | label: 'è½®æå¾' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value:44, |
| | | label: 'å¦é¢å¨æ', |
| | | }, |
| | | { |
| | | value:45, |
| | | label: 'è½®æå¾', |
| | | }], |
| | | },{ |
| | | value: 22, |
| | | label: 'ç§åæ¦åµ', |
| | | children: [{ |
| | | value:27, |
| | | label: 'ç®ä»', |
| | | }, |
| | | { |
| | | value:28, |
| | | label: 'ç« ç¨', |
| | | }, |
| | | { |
| | | value:29, |
| | | label: 'ç»ç»ç»æ', |
| | | }, |
| | | { |
| | | value:30, |
| | | label: 'å·¥ä½èè´£', |
| | | }, |
| | | { |
| | | value:31, |
| | | label: 'ä¸è人å', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 27, |
| | | label: 'ç®ä»' |
| | | }, |
| | | { |
| | | value: 28, |
| | | label: 'ç« ç¨' |
| | | }, |
| | | { |
| | | value: 29, |
| | | label: 'ç»ç»ç»æ' |
| | | }, |
| | | { |
| | | value: 30, |
| | | label: 'å·¥ä½èè´£' |
| | | }, |
| | | { |
| | | value: 31, |
| | | label: 'ä¸è人å' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 23, |
| | | label: 'æ¿çæ³è§', |
| | | children: [{ |
| | | value:35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶', |
| | | }, |
| | | { |
| | | value:36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶', |
| | | }, |
| | | { |
| | | value:37, |
| | | label: '社å¢ç®¡çæä»¶', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value: 36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value: 37, |
| | | label: '社å¢ç®¡çæä»¶' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 25, |
| | | label: '妿¯äº¤æµ', |
| | | children: [{ |
| | | value:38, |
| | | label: '妿¯ä¿¡æ¯', |
| | | }, |
| | | { |
| | | value:39, |
| | | label: 'ç§æç«èµ', |
| | | }], |
| | | children: [ |
| | | { |
| | | value: 38, |
| | | label: '妿¯ä¿¡æ¯' |
| | | }, |
| | | { |
| | | value: 39, |
| | | label: 'ç§æç«èµ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 27, |
| | | label: 'ç§æ®é£é', |
| | | children: [{ |
| | | value:40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨', |
| | | }, |
| | | { |
| | | value:41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨', |
| | | }], |
| | | }] |
| | | children: [ |
| | | { |
| | | value: 40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨' |
| | | }, |
| | | { |
| | | value: 41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | created(){ |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | methods: { |
| | | //ä¿®æ¹å¯¹è¯æ¡å
³éçæ¹æ³ |
| | | handleClose(done) { |
| | | this.$confirm('确认å
³éï¼') |
| | | .then(_ => { |
| | | done(); |
| | | done() |
| | | }) |
| | | .catch(_ => {}); |
| | | .catch(_ => {}) |
| | | }, |
| | | //级èéæ©å¨çæ¹æ³ |
| | | handleChange(value) { |
| | | // console.log(value); |
| | | // console.log(value[1]); |
| | | this.currentPage = 1; |
| | | this.newsCategoryId = value[1]; //å°å¾å°çå°æ é¢idåæ¾èµ·æ¥ |
| | | this.query(this.newsCategoryId); |
| | | this.currentPage = 1 |
| | | this.newsCategoryId = value[1] //å°å¾å°çå°æ é¢idåæ¾èµ·æ¥ |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | query(newsCategoryId){ |
| | | query(newsCategoryId) { |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:newsCategoryId, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res=>{ |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | | }else{ |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | current: this.currentPage, |
| | | newsCategoryId: newsCategoryId, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | | } else { |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å±ç¤ºä¿®æ¹å¯¹è¯æ¡ |
| | | showEditDialog(id){ |
| | | showEditDialog(id) { |
| | | getnew(id).then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.editForm = res.data |
| | | } |
| | | } |
| | | }) |
| | | this.editDialogVisible = true; |
| | | this.editDialogVisible = true |
| | | }, |
| | | //ç¡®å®ä¿®æ¹è¡¨åæäº¤ï¼éªè¯åèµ·è¯·æ± |
| | | editNew(){ |
| | | editNew() { |
| | | const data = { |
| | | id: this.editForm.id, |
| | | releaseTime: this.editForm.releaseTime, |
| | | title:this.editForm.title |
| | | title: this.editForm.title |
| | | } |
| | | update(data).then(res=>{ |
| | | console.log('dsadasas',res); |
| | | update(data).then(res => { |
| | | console.log('dsadasas', res) |
| | | if (res.code == 200) { |
| | | this.editDialogVisible =false; |
| | | this.editDialogVisible = false |
| | | this.$message.success('ä¿®æ¹æ°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | this.query(this.newsCategoryId) |
| | | } |
| | | }) |
| | | }, |
| | | //æ¨¡ç³æ¥è¯¢ |
| | | fuzzyList(title){ |
| | | fuzzyList(title) { |
| | | // console.log(title); |
| | | if(title == ''){ |
| | | return this.$message.error('请å
è¾å
¥æ¥è¯¢æ°é»æ é¢ï¼') |
| | | if (title == '') { |
| | | return this.$message.error('请å
è¾å
¥æ¥è¯¢æ°é»æ é¢ï¼') |
| | | } |
| | | this.fuzzyShow = true //模ç³å页æ¾ç¤º |
| | | this.getShow = false //è·åå页éè |
| | | this.getShow = false //è·åå页éè |
| | | this.gettable = false |
| | | this.fuzzytable = true |
| | | const data = { |
| | | current: this.fuzzyForm.fuzzycurrent, |
| | | size: this.fuzzyForm.fuzzysize, |
| | | title:title |
| | | title: title |
| | | } |
| | | fuzzy(data).then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | | }else{ |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | fuzzy(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | | } else { |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //æ¸
空æ¥è¯¢å表å
容 |
| | | qingKong(){ |
| | | qingKong() { |
| | | this.tableData = [] |
| | | this.fuzzytableData = [] |
| | | this.fuzzyForm.fuzzytotal = 0 |
| | |
| | | this.gettable = true |
| | | }, |
| | | //æ ¹æ®idå 餿°é» |
| | | async deleteNews(id){ |
| | | async deleteNews(id) { |
| | | // console.log(id); |
| | | const res = await this.$confirm('æ¤æä½å°æ°¸ä¹
å é¤è¯¥æ¡æ°é», æ¯å¦ç»§ç»?', 'æç¤º', { |
| | | confirmButtonText: 'ç¡®å®', |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | if(res !== 'confirm'){ |
| | | console.log(res) |
| | | if (res !== 'confirm') { |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | console.log(id); |
| | | } else { |
| | | console.log(id) |
| | | const data = { |
| | | id:id |
| | | id: id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteNew(data).then(res => { |
| | | console.log('>>>'+res); |
| | | if(res.code == 200){ |
| | | console.log('>>>' + res) |
| | | if (res.code == 200) { |
| | | this.$message.success('å 餿°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | }else{ |
| | | this.query(this.newsCategoryId) |
| | | } else { |
| | | return this.$message.error('å 餿°é»å¤±è´¥ï¼') |
| | | } |
| | | }) |
| | | } |
| | | }, |
| | | //æ¥ç |
| | | look(id){ |
| | | this.$router.push({path:'news',query:{id:id}}) |
| | | look(id) { |
| | | this.$router.push({ path: 'news', query: { id: id } }) |
| | | }, |
| | | //è¶
管ç»å½å¯¹è¯æ¡ |
| | | showAdDialog(){ |
| | | showAdDialog() { |
| | | this.AdDialogVisible = true |
| | | }, |
| | | handleCurrentChange(val) { |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPage = val; |
| | | this.currentPage = val |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | handleSizeChange(val) { |
| | | // console.log(`æ¯é¡µ ${val} æ¡`); |
| | | this.pageSize = val; |
| | | this.pageSize = val |
| | | this.query(this.newsCategoryId) |
| | | }, |
| | | handleCurrentChangefuzzy(val){ |
| | | handleCurrentChangefuzzy(val) { |
| | | this.fuzzyForm.fuzzycurrent = val |
| | | this.fuzzyList(this.fuzzyForm.fuzzytitle) //æ¨¡ç³æ¥è¯¢ |
| | | }, |
| | | handleSizeChangefuzzy(val){ |
| | | handleSizeChangefuzzy(val) { |
| | | this.fuzzyForm.fuzzysize = val |
| | | this.fuzzyList(this.fuzzyForm.fuzzytitle) //æ¨¡ç³æ¥è¯¢ |
| | | }, |
| | | //å»å¾æ·»å ç¼è¾é¡µé¢ |
| | | goEdit(id){ |
| | | let title = ''; |
| | | console.log(this.value); |
| | | if (this.value.length = 2) { |
| | | let t = this.value[0]; |
| | | let i = this.value[1]; |
| | | this.options.forEach( item => { |
| | | if(item.value == t){ |
| | | title += item.label+'/' |
| | | item.children.forEach( e => { |
| | | if(e.value == i) title += e.label; |
| | | goEdit(id) { |
| | | let title = '' |
| | | console.log(this.value) |
| | | if ((this.value.length = 2)) { |
| | | let t = this.value[0] |
| | | let i = this.value[1] |
| | | this.options.forEach(item => { |
| | | if (item.value == t) { |
| | | title += item.label + '/' |
| | | item.children.forEach(e => { |
| | | if (e.value == i) title += e.label |
| | | }) |
| | | } |
| | | }) |
| | | } |
| | | if (this.newsCategoryId==27&&this.total==1||this.newsCategoryId==28&&this.total==1||this.newsCategoryId==29&&this.total==1|| |
| | | this.newsCategoryId==30&&this.total==1||this.newsCategoryId==31&&this.total==1) { |
| | | if ( |
| | | (this.newsCategoryId == 27 && this.total == 1) || |
| | | (this.newsCategoryId == 28 && this.total == 1) || |
| | | (this.newsCategoryId == 29 && this.total == 1) || |
| | | (this.newsCategoryId == 30 && this.total == 1) || |
| | | (this.newsCategoryId == 31 && this.total == 1) |
| | | ) { |
| | | this.$message.error('该æ°é»æ é¢ä¸åªè½åå¨ä¸ç¯æ°é»') |
| | | }else if(this.newsCategoryId==27||this.newsCategoryId==28||this.newsCategoryId==29||this.newsCategoryId==30|| |
| | | this.newsCategoryId==31||this.newsCategoryId == 35||this.newsCategoryId==36||this.newsCategoryId==37|| |
| | | this.newsCategoryId==38||this.newsCategoryId==39||this.newsCategoryId==40|| |
| | | this.newsCategoryId==41||this.newsCategoryId==42||this.newsCategoryId==43|| |
| | | this.newsCategoryId==44){ |
| | | this.$router.push({path:'/administrator/edit',query:{id:id,title:title}}) |
| | | console.log(this.newsCategoryId); |
| | | }else if(this.newsCategoryId==45){ |
| | | this.$router.push({path:'/administrator/editlunbo',query:{id:id,title:title}}) |
| | | } else if ( |
| | | this.newsCategoryId == 27 || |
| | | this.newsCategoryId == 28 || |
| | | this.newsCategoryId == 29 || |
| | | this.newsCategoryId == 30 || |
| | | this.newsCategoryId == 31 || |
| | | this.newsCategoryId == 35 || |
| | | this.newsCategoryId == 36 || |
| | | this.newsCategoryId == 37 || |
| | | this.newsCategoryId == 38 || |
| | | this.newsCategoryId == 39 || |
| | | this.newsCategoryId == 40 || |
| | | this.newsCategoryId == 41 || |
| | | this.newsCategoryId == 42 || |
| | | this.newsCategoryId == 43 || |
| | | this.newsCategoryId == 44 |
| | | ) { |
| | | this.$router.push({ path: '/administrator/edit', query: { id: id, title: title } }) |
| | | console.log(this.newsCategoryId) |
| | | } else if (this.newsCategoryId == 45) { |
| | | this.$router.push({ path: '/administrator/editlunbo', query: { id: id, title: title } }) |
| | | // console.log(this.newsCategoryId); |
| | | }else{ |
| | | } else { |
| | | this.$message.error('请å
éæ©æ°é»æ é¢') |
| | | } |
| | | |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less"> |
| | | .add{ |
| | | .add { |
| | | margin-bottom: 10px !important; |
| | | } |
| | | .block{ |
| | | .block { |
| | | margin-bottom: 10px; |
| | | } |
| | | .el-pagination{ |
| | | .el-pagination { |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <div> |
| | | <h2>欢è¿è¿å
¥åå°ç®¡çç³»ç»</h2> |
| | | |
| | | <el-upload |
| | | ref="upload" |
| | | action |
| | | accept="image/*" |
| | | :limit= 3 |
| | | :file-list='filelist' |
| | | list-type="picture-card" |
| | | :on-preview="handlePictureCardPreview" |
| | | :on-remove="handleRemove" |
| | | :http-request='upload'> |
| | | <el-upload ref="upload" action accept="image/*" :limit="3" :file-list="filelist" list-type="picture-card" :on-preview="handlePictureCardPreview" :on-remove="handleRemove" :http-request="upload"> |
| | | <i class="el-icon-plus"></i> |
| | | </el-upload> |
| | | <el-dialog :visible.sync="dialogVisible"> |
| | | <img width="100%" :src="dialogImageUrl" alt=""> |
| | | <img width="100%" :src="dialogImageUrl" alt="" /> |
| | | </el-dialog> |
| | | <el-button @click="save">ä¿å</el-button> |
| | | </div> |
| | | |
| | | </template> |
| | | |
| | | <script> |
| | | import {fileUpload, update} from '../../api/api' |
| | | import { fileUpload, update } from '../../api/api' |
| | | export default { |
| | | data() { |
| | | return { |
| | | // fileList: [] |
| | | imageUrl:'', |
| | | filelist:[], |
| | | delList:[], |
| | | dialogVisible:false, |
| | | dialogImageUrl:'', |
| | | imageUrl: '', |
| | | filelist: [], |
| | | delList: [], |
| | | dialogVisible: false, |
| | | dialogImageUrl: '' |
| | | } |
| | | }, |
| | | methods:{ |
| | | save(){ |
| | | methods: { |
| | | save() { |
| | | //åå°å¾çéå |
| | | let uploadImglist = this.$refs.upload.uploadFiles |
| | | console.log(uploadImglist); |
| | | let formData = new FormData(); |
| | | console.log(uploadImglist) |
| | | let formData = new FormData() |
| | | uploadImglist.forEach(item => { |
| | | //readyç¶æçæ¯æªä¸ä¼ ç successæ¯å·²ç»ä¸ä¼ æåçï¼åªéè¦æ·»å æªä¸ä¼ çå³å¯ |
| | | if(item.status == "ready"){ |
| | | formData.append('file', item.raw); |
| | | if (item.status == 'ready') { |
| | | formData.append('file', item.raw) |
| | | } |
| | | }); |
| | | }) |
| | | formData.get('file') |
| | | fileUpload(formData).then(res=>{ |
| | | fileUpload(formData).then(res => { |
| | | //ä¸ä¼ æ¥å£ |
| | | console.log(res); |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | // é¢è§å¾ç |
| | | handlePictureCardPreview(file){ |
| | | handlePictureCardPreview(file) { |
| | | this.dialogVisible = true |
| | | this.dialogImageUrl=file.url |
| | | console.log(this.dialogImageUrl); |
| | | this.dialogImageUrl = file.url |
| | | console.log(this.dialogImageUrl) |
| | | }, |
| | | // å é¤å¾ç |
| | | handleRemove(file){ |
| | | handleRemove(file) { |
| | | //å¤æç¶æï¼å¦ææ¯ä¸ä¼ æåç éè¦æidå å°å é¤idéåéé¢ |
| | | if(file.status == 'success'){ |
| | | if (file.status == 'success') { |
| | | this.delList.push(file.id) |
| | | } |
| | | }, |
| | | upload(){ |
| | | } |
| | | upload() {} |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | <style lang="less" scoped></style> |
| | |
| | | <img src="../assets/xiaohui4.png" alt="" /> |
| | | </div> |
| | | <div> |
| | | <img src="../assets/bg.png" alt=""> |
| | | <img src="../assets/bg.png" alt="" /> |
| | | </div> |
| | | </el-header> |
| | | <!-- ä¸»é¡µå¯¼èªæ --> |
| | | <el-row> |
| | | <el-menu mode="horizontal" background-color="rgb(64, 112, 186)" text-color="white" class="menu" active-text-color="#000000" :default-active="activeIndex" @select="handleSelect"> |
| | | <el-menu-item :key="index" v-for="(item, index) in menuList" :index="(item.id).toString()"> |
| | | <el-menu-item :key="index" v-for="(item, index) in menuList" :index="item.id.toString()"> |
| | | {{ item.name }} |
| | | </el-menu-item> |
| | | </el-menu> |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import {getNavList} from '../api/api' |
| | | import { getNavList } from '../api/api' |
| | | import axios from 'axios' |
| | | export default { |
| | | name: '', |
| | | data() { |
| | | return { |
| | | activeIndex: '1', |
| | | menuList: [{name: 'é¦é¡µ',id: 1},{name: 'ç§åæ¦åµ',id: 22},{name: 'æ¿çæ³è§',id: 23},{name: 'ç§å项ç®',id: 24}, |
| | | {name: '妿¯äº¤æµ',id: 25},{name: 'åäºæå',id: 26},{name: 'ç§æ®é£é',id: 27},{name: '妿 ¡é¦é¡µ',id: 28}, |
| | | {name: 'èç³»æä»¬',id: 29}], |
| | | menuList2:[] |
| | | menuList: [ |
| | | { name: 'é¦é¡µ', id: 1 }, |
| | | { name: 'ç§åæ¦åµ', id: 22 }, |
| | | { name: 'æ¿çæ³è§', id: 23 }, |
| | | { name: 'ç§å项ç®', id: 24 }, |
| | | { name: '妿¯äº¤æµ', id: 25 }, |
| | | { name: 'åäºæå', id: 26 }, |
| | | { name: 'ç§æ®é£é', id: 27 }, |
| | | { name: '妿 ¡é¦é¡µ', id: 28 }, |
| | | { name: 'èç³»æä»¬', id: 29 } |
| | | ], |
| | | menuList2: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }, |
| | | mounted() { |
| | | let api3 = 'http://localhost:7070/news_type/all' |
| | | axios.get(api3).then((res)=>{ |
| | | // console.log(res); |
| | | this.menuList2 = res.data.data |
| | | }).catch((error)=>{ |
| | | console.log(error); |
| | | }) |
| | | axios |
| | | .get(api3) |
| | | .then(res => { |
| | | // console.log(res); |
| | | this.menuList2 = res.data.data |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | watch: {}, |
| | | methods: { |
| | |
| | | // console.log('err', err) |
| | | // }) |
| | | // }, |
| | | |
| | | formatterTitle(t){ |
| | | switch(t){ |
| | | |
| | | formatterTitle(t) { |
| | | switch (t) { |
| | | case '1': |
| | | return 'index' |
| | | case '22': |
| | |
| | | path: '/home/' + this.formatterTitle(key), |
| | | query: { |
| | | title: this.formatterTitle(key), |
| | | id:key |
| | | id: key |
| | | } |
| | | }) |
| | | } |
| | |
| | | width: 1200px; |
| | | margin: 0 auto; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | loginForm: { |
| | | username: '', |
| | | password: '' |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | password: this.loginForm.password |
| | | } |
| | | login(data).then(res => { |
| | | console.log(res); |
| | | if(res.code !== 200){ |
| | | console.log(res) |
| | | if (res.code !== 200) { |
| | | this.$message.error('ç»å½å¤±è´¥ï¼') |
| | | }else if(res.data.role == 'è¶
级管çå'){ |
| | | } else if (res.data.role == 'è¶
级管çå') { |
| | | this.$message.success('è¶
管ç»å½æåï¼') |
| | | window.sessionStorage.setItem('token',res.cookie) |
| | | window.sessionStorage.setItem('token', res.cookie) |
| | | this.$router.push('/administrator/admain') |
| | | }else{ |
| | | } else { |
| | | this.$message.success('ç»å½æåï¼') |
| | | window.sessionStorage.setItem('token',res.cookie) |
| | | window.sessionStorage.setItem('token', res.cookie) |
| | | this.$router.push('/administrator/main') |
| | | } |
| | | }) |
| | |
| | | <template> |
| | | <div class="center"> |
| | | <img src="../assets/404.gif" alt=""> |
| | | <img src="../assets/404.gif" alt="" /> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | }; |
| | | export default {} |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .center{ |
| | | .center { |
| | | position: fixed; |
| | | left: 50%; |
| | | top: 50%; |
| | | transform: translate(-50%,-50%); |
| | | transform: translate(-50%, -50%); |
| | | } |
| | | img{ |
| | | img { |
| | | width: 300px; |
| | | } |
| | | </style> |
| | |
| | | <div> |
| | | <el-row> |
| | | <div class="fl"> |
| | | <span><b>{{ getTitle(this.$route.query.title) }}</b></span> |
| | | <span |
| | | ><b>{{ getTitle(this.$route.query.title) }}</b></span |
| | | > |
| | | </div> |
| | | <div class="fr"> |
| | | <el-breadcrumb separator-class="el-icon-arrow-right"> |
| | |
| | | </template> |
| | | <script> |
| | | export default { |
| | | name:'globalTitle', |
| | | data(){ |
| | | name: 'globalTitle', |
| | | data() { |
| | | return { |
| | | title:'', |
| | | title: '' |
| | | } |
| | | }, |
| | | created(){ |
| | | }, |
| | | methods:{ |
| | | getTitle(v){ |
| | | switch(v){ |
| | | created() {}, |
| | | methods: { |
| | | getTitle(v) { |
| | | switch (v) { |
| | | case 'introduce': |
| | | return 'ç§åæ¦åµ' |
| | | case 'zhengce': |
| | |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .el-row { |
| | | /* background-color: rgb(83, 168, 125); */ |
| | | border-bottom: 1px solid #0f99e9; |
| | | } |
| | | </style> |
| | | .el-row { |
| | | /* background-color: rgb(83, 168, 125); */ |
| | | border-bottom: 1px solid #0f99e9; |
| | | } |
| | | </style> |
| | |
| | | <!-- <p>{{ this.$route.query.id }}</p> --> |
| | | <div class="header"> |
| | | <h2>{{ title }}</h2> |
| | | <p>å叿¥æï¼{{ releaseTime }} ç¹å»éï¼[ {{(hits+1)/2}} ]</p> |
| | | <p>å叿¥æï¼{{ releaseTime }} ç¹å»éï¼[ {{ (hits + 1) / 2 }} ]</p> |
| | | </div> |
| | | <hr> |
| | | <hr /> |
| | | <div v-html="content" class="ql-editor"></div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {getnew} from '../../api/api' |
| | | import { getnew } from '../../api/api' |
| | | export default { |
| | | name:'noticeMessage', |
| | | data(){ |
| | | name: 'noticeMessage', |
| | | data() { |
| | | return { |
| | | content:'', |
| | | hits:'', |
| | | releaseTime:'', |
| | | title:'' |
| | | content: '', |
| | | hits: '', |
| | | releaseTime: '', |
| | | title: '' |
| | | } |
| | | }, |
| | | created(){ |
| | | created() { |
| | | // console.log(">>>>>>>>",this.$route.query.id); |
| | | this.getalone(); |
| | | this.getalone() |
| | | }, |
| | | methods:{ |
| | | getalone(){ |
| | | const data = this.$route.query.id; |
| | | methods: { |
| | | getalone() { |
| | | const data = this.$route.query.id |
| | | getnew(data).then(res => { |
| | | console.log(res); |
| | | this.content = res.data.content; |
| | | this.hits = res.data.hits; |
| | | this.releaseTime = res.data.releaseTime; |
| | | this.title = res.data.title; |
| | | console.log(res) |
| | | this.content = res.data.content |
| | | this.hits = res.data.hits |
| | | this.releaseTime = res.data.releaseTime |
| | | this.title = res.data.title |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | | <style> |
| | |
| | | width: 1200px; |
| | | margin: 0 auto; |
| | | } |
| | | .header h2{ |
| | | .header h2 { |
| | | color: rgb(3, 73, 144); |
| | | text-align: center; |
| | | } |
| | | .header p{ |
| | | .header p { |
| | | background-color: rgb(246, 246, 246); |
| | | text-align: center; |
| | | height: 35px; |
| | | line-height: 35px; |
| | | } |
| | | .ql-editor{ |
| | | .ql-editor { |
| | | padding: 12px 0px !important; |
| | | } |
| | | .ql-editor p{ |
| | | .ql-editor p { |
| | | letter-spacing: 1px; |
| | | line-height: 25px; |
| | | } |
| | | .ql-editor img{ |
| | | .ql-editor img { |
| | | width: 600px; |
| | | height: 400px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <div> |
| | | <globalTitle /> |
| | | <div> |
| | | <img src="../../assets/keyanlixiangjieti.png" alt=""> |
| | | <img src="../../assets/keyanlixiangjieti.png" alt="" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | <script> |
| | | import globalTitle from '../globalTitle.vue' |
| | | export default { |
| | | components: { globalTitle}, |
| | | name: 'banShiZhiNan', |
| | | components: { globalTitle }, |
| | | name: 'banShiZhiNan' |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | <style lang="less" scoped></style> |
| | |
| | | <div calss="box"> |
| | | <!-- é¦é¡µä¸åé¨å --> |
| | | <el-row type="flex" class="row-bg" justify="space-between"> |
| | | <div class="block marr10"> |
| | | <el-carousel height="450px" arrow="always" :interval="3000"> |
| | | <el-carousel-item v-for="(item,index) in imgList" :key="index"> |
| | | <div @click="gonew(item.id)" class="cursor" style="width:590px; height:450px"> |
| | | <img :src="'http://localhost:7070/'+item.picturePath" alt="" style="width:100%; height:90%"> |
| | | </div> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | </div> |
| | | <div class="block marr10"> |
| | | <el-carousel height="450px" arrow="always" :interval="3000"> |
| | | <el-carousel-item v-for="(item, index) in imgList" :key="index"> |
| | | <div @click="gonew(item.id)" class="cursor" style="width:590px; height:450px"> |
| | | <img :src="'http://localhost:7070/' + item.picturePath" alt="" style="width:100%; height:90%" /> |
| | | </div> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | | </div> |
| | | <notice class="notice" /> |
| | | </el-row> |
| | | <!-- é¦é¡µä¸åé¨å --> |
| | | <el-row type="flex" class="row-bg" justify="space-between"> |
| | | <work class="work"/> |
| | | <school class="school"/> |
| | | <other class="other"/> |
| | | <work class="work" /> |
| | | <school class="school" /> |
| | | <other class="other" /> |
| | | </el-row> |
| | | |
| | | <!-- å®ä½fixed --> |
| | | <div class="fixed1"> |
| | | <a href="#"><img src="../../assets/gzh.jpg" alt=""></a> |
| | | <a href="#"><img src="../../assets/gzh.jpg" alt=""/></a> |
| | | </div> |
| | | <div class="fixed2"> |
| | | <a href="#"><img src="../../assets/wb.jpg" alt=""></a> |
| | | <a href="#"><img src="../../assets/wb.jpg" alt=""/></a> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import school from '../../views/school.vue' |
| | | import other from '../../views/other.vue' |
| | | |
| | | import {getNewsList} from '../../api/api' |
| | | import { getNewsList } from '../../api/api' |
| | | |
| | | export default { |
| | | components: { notice, work, school, other }, |
| | | name: 'index', |
| | | data(){ |
| | | return{ |
| | | data() { |
| | | return { |
| | | // imgList:[ |
| | | // { path:require('../../assets/1.jpg'),index: 1}, |
| | | // { path:require('../../assets/2.jpg'),index: 2}, |
| | | // { path:require('../../assets/3.jpg'),index: 3}, |
| | | // ], |
| | | imgList:[], |
| | | imgList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | | created() { |
| | | this.getnews() |
| | | }, |
| | | methods:{ |
| | | getnews(){ |
| | | const data ={ |
| | | current:1, |
| | | newsCategoryId:45, |
| | | size:3 |
| | | methods: { |
| | | getnews() { |
| | | const data = { |
| | | current: 1, |
| | | newsCategoryId: 45, |
| | | size: 3 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.imgList = res.data.records |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.imgList = res.data.records |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | gonew(id){ |
| | | this.$router.push({path:'/home/news',query:{id:id}}) |
| | | gonew(id) { |
| | | this.$router.push({ path: '/home/news', query: { id: id } }) |
| | | } |
| | | } |
| | | } |
| | |
| | | // object-fit:cover; |
| | | } |
| | | } |
| | | .notice{ |
| | | .notice { |
| | | width: 50%; |
| | | } |
| | | .work { |
| | |
| | | } |
| | | .fixed1 { |
| | | position: fixed; |
| | | top:270px; |
| | | top: 270px; |
| | | right: 2px; |
| | | } |
| | | .fixed2 { |
| | | position: fixed; |
| | | top:340px; |
| | | top: 340px; |
| | | right: 2px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <el-col :span="4" class="marr10"> |
| | | <ul> |
| | | <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)"> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b> |
| | | </li> |
| | | </ul> |
| | | </el-col> |
| | | <!-- æ°é»å
容 --> |
| | | <!-- æ°é»å
容 --> |
| | | <el-card class="box-card"> |
| | | <el-col> |
| | | <div v-html="this.new.content" class="ql-editor"></div> |
| | |
| | | |
| | | <script> |
| | | import globalTitle from '../globalTitle.vue' |
| | | import {getMinTitle,getNewsList,getnew} from '../../api/api' |
| | | import { getMinTitle, getNewsList, getnew } from '../../api/api' |
| | | export default { |
| | | name: 'introduce', |
| | | components: { |
| | |
| | | return { |
| | | cont: '', |
| | | menuList: [], |
| | | newsList:[], |
| | | new:{} //æ°é»å¯¹è±¡ |
| | | newsList: [], |
| | | new: {} //æ°é»å¯¹è±¡ |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | this.getTitle(); |
| | | this.getTitle() |
| | | }, |
| | | watch: { |
| | | menuList(n,o){ |
| | | this.cont = this.menuList[0].name; |
| | | this.getnews(this.menuList[0]); //æ¹å对象ï¼èåæ çä¸è¥¿è¦åå°çå¬å±æ§éè¾¹ |
| | | menuList(n, o) { |
| | | this.cont = this.menuList[0].name |
| | | this.getnews(this.menuList[0]) //æ¹å对象ï¼èåæ çä¸è¥¿è¦åå°çå¬å±æ§éè¾¹ |
| | | } |
| | | }, |
| | | methods: { |
| | | //è·åå°æ é¢çid |
| | | getTitle(){ |
| | | const data = Number(this.$route.query.id); |
| | | getMinTitle(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.menuList = res.data |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | getTitle() { |
| | | const data = Number(this.$route.query.id) |
| | | getMinTitle(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.menuList = res.data |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å°æ é¢èåçç忢 |
| | | changeMenu(val) { |
| | | this.cont = val.name; |
| | | this.cont = val.name |
| | | this.getnews(val) |
| | | }, |
| | | //è·åå°äºæ°é»å表ï¼éè¾¹åªæä¸ä¸ªå¯¹è±¡ |
| | | getnews(item){ |
| | | getnews(item) { |
| | | const data = { |
| | | current:1, |
| | | newsCategoryId:item.id, |
| | | size:5 |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.newsList = res.data.records |
| | | this.getalone(this.newsList[0].id) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | current: 1, |
| | | newsCategoryId: item.id, |
| | | size: 5 |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.newsList = res.data.records |
| | | this.getalone(this.newsList[0].id) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | //è·åæ°é»å
容,å¾å°ä¸ä¸ªæ°é»å¯¹è±¡ |
| | | getalone(id){ |
| | | const data = id; |
| | | getnew(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.new = res.data; |
| | | console.log(this.new.content); |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getalone(id) { |
| | | const data = id |
| | | getnew(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.new = res.data |
| | | console.log(this.new.content) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | } |
| | | } |
| | |
| | | .ft-black { |
| | | color: #000; |
| | | } |
| | | .ql-editor{ |
| | | .ql-editor { |
| | | padding: 12px 0px !important; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <el-col :span="4" class="marr10"> |
| | | <ul> |
| | | <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)"> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b> |
| | | </li> |
| | | </ul> |
| | | </el-col> |
| | | <!-- æ°é»å
容 --> |
| | | <!-- æ°é»å
容 --> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <p class="name">{{ this.cont }}</p> |
| | | <hr class="namehr" /> |
| | | <el-col :span="24"> |
| | | <div> |
| | | <el-row class="marb10" :key="index" v-for="(item, index) in newsList"> |
| | |
| | | </div> |
| | | <!-- å页 --> |
| | | <div class="fenye"> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange" |
| | | :current-page.sync="currentPage" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="total"> |
| | | </el-pagination> |
| | | <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination> |
| | | </div> |
| | | </el-col> |
| | | </el-card> |
| | |
| | | return { |
| | | cont: '', |
| | | menuList: [], |
| | | newsList:[], |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | newsList: [], |
| | | pageSize: 6, |
| | | currentPage: 1, |
| | | total: 0, |
| | | item: {} |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | this.getTitle(); |
| | | this.getTitle() |
| | | }, |
| | | watch: { |
| | | menuList(n,o){ |
| | | this.cont = this.menuList[0].name |
| | | this.item = this.menuList[0]; |
| | | this.getnews(this.menuList[0]); |
| | | menuList(n, o) { |
| | | this.cont = this.menuList[0].name |
| | | this.item = this.menuList[0] |
| | | this.getnews(this.menuList[0]) |
| | | } |
| | | }, |
| | | methods: { |
| | | handleCurrentChange(val) { |
| | | console.log(`å½å页: ${val}`); |
| | | this.getnews(this.item); |
| | | console.log(`å½å页: ${val}`) |
| | | this.getnews(this.item) |
| | | }, |
| | | getTitle(){ |
| | | const data = Number(this.$route.query.id); |
| | | getMinTitle(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.menuList = res.data |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | getTitle() { |
| | | const data = Number(this.$route.query.id) |
| | | getMinTitle(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.menuList = res.data |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | changeMenu(val) { |
| | | this.cont = val.name |
| | | this.item = val |
| | | this.currentPage = 1 |
| | | this.getnews(val); |
| | | this.getnews(val) |
| | | }, |
| | | getnews(item){ |
| | | getnews(item) { |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | current: this.currentPage, |
| | | newsCategoryId: item.id, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | show(item){ |
| | | show(item) { |
| | | // console.log(item.id); |
| | | this.$router.push({path:'/home/news',query:{id:item.id}}) |
| | | this.$router.push({ path: '/home/news', query: { id: item.id } }) |
| | | } |
| | | } |
| | | } |
| | |
| | | .ft-black { |
| | | color: #000; |
| | | } |
| | | .box-card{ |
| | | .box-card { |
| | | height: 500px; |
| | | position: relative; |
| | | .fenye{ |
| | | .fenye { |
| | | position: absolute; |
| | | bottom: 10px; |
| | | } |
| | | } |
| | | </style> |
| | | } |
| | | </style> |
| | |
| | | <template> |
| | | <div> |
| | | <globalTitle/> |
| | | <globalTitle /> |
| | | <div> |
| | | <el-card class="mart10"> |
| | | <h4>平顶山å¦é¢2021年度河åçç§åç«é¡¹å表</h4> |
| | | <el-table :data="tableData" border style="width: 100%" :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }"> |
| | | <el-table :data="tableData" border style="width: 100%" :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> |
| | | <!-- :header-cell-style="{textAlign: 'center'}"设置头é¨å±
ä¸ï¼ --> |
| | | <!-- :cell-style="{ textAlign: 'center' }"设置æ´ä¸ªè¡¨æ ¼å
容水平å±
ä¸ï¼ --> |
| | | <el-table-column prop="id" label="åºå·" width="" > |
| | | </el-table-column> |
| | | <el-table-column prop="bianhao" label="ç«é¡¹ç¼å·" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="项ç®åç§°"> |
| | | </el-table-column> |
| | | <el-table-column prop="xingshi" label="项ç®å½¢å¼"> |
| | | </el-table-column> |
| | | <el-table-column prop="fuzeren" label="项ç®è´è´£äºº"> |
| | | </el-table-column> |
| | | <el-table-column prop="time" label="ç»é¡¹æ¶é´"> |
| | | </el-table-column> |
| | | <el-table-column prop="beizhu" label="夿³¨"> |
| | | </el-table-column> |
| | | <el-table-column prop="id" label="åºå·" width=""> </el-table-column> |
| | | <el-table-column prop="bianhao" label="ç«é¡¹ç¼å·" width=""> </el-table-column> |
| | | <el-table-column prop="name" label="项ç®åç§°"> </el-table-column> |
| | | <el-table-column prop="xingshi" label="项ç®å½¢å¼"> </el-table-column> |
| | | <el-table-column prop="fuzeren" label="项ç®è´è´£äºº"> </el-table-column> |
| | | <el-table-column prop="time" label="ç»é¡¹æ¶é´"> </el-table-column> |
| | | <el-table-column prop="beizhu" label="夿³¨"> </el-table-column> |
| | | </el-table> |
| | | </el-card> |
| | | </div> |
| | |
| | | name: 'keXieXiangMu', |
| | | data() { |
| | | return { |
| | | tableData:[{id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | {id:1,bianhao:'001',name:'è¹æ',xingshi:'çº¿ä¸æä½',fuzeren:'èæ¨',time:'2022-1-8',beizhu:'æ '}, |
| | | tableData: [ |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' }, |
| | | { id: 1, bianhao: '001', name: 'è¹æ', xingshi: 'çº¿ä¸æä½', fuzeren: 'èæ¨', time: '2022-1-8', beizhu: 'æ ' } |
| | | ] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | created() {}, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | h4{ |
| | | h4 { |
| | | text-align: center; |
| | | margin-top: 0; |
| | | } |
| | | .mart10{ |
| | | .mart10 { |
| | | margin-top: 10px; |
| | | } |
| | | </style> |
| | |
| | | <div class="left"> |
| | | <el-card style="" class="img"> |
| | | <p>微信å
¬ä¼å·</p> |
| | | <img src="../../assets/gongZhongHao.jpg" alt=""> |
| | | <img src="../../assets/gongZhongHao.jpg" alt="" /> |
| | | </el-card> |
| | | <el-card style="" class="img"> |
| | | <p>æ°æµªå¾®å</p> |
| | | <img src="../../assets/weiBo.jpg" alt=""> |
| | | <img src="../../assets/weiBo.jpg" alt="" /> |
| | | </el-card> |
| | | </div> |
| | | <div class="right"> |
| | | <el-table :data="tableData" border :header-cell-style="{textAlign: 'center'}" :cell-style="{ textAlign: 'center' }"> |
| | | <el-table :data="tableData" border :header-cell-style="{ textAlign: 'center' }" :cell-style="{ textAlign: 'center' }"> |
| | | <!-- :header-cell-style="{textAlign: 'center'}"设置头é¨å±
ä¸ï¼ --> |
| | | <!-- :cell-style="{ textAlign: 'center' }"设置æ´ä¸ªè¡¨æ ¼å
容水平å±
ä¸ï¼ --> |
| | | <el-table-column prop="id" label="åºå·" width="60" > |
| | | </el-table-column> |
| | | <el-table-column prop="zhize" label="èè´£" width=""> |
| | | </el-table-column> |
| | | <el-table-column prop="name" label="å§å"> |
| | | </el-table-column> |
| | | <el-table-column prop="tel" label="èç³»çµè¯"> |
| | | </el-table-column> |
| | | <el-table-column prop="mail" label="é®ç®±" width="200"> |
| | | </el-table-column> |
| | | </el-table> |
| | | <el-table-column prop="id" label="åºå·" width="60"> </el-table-column> |
| | | <el-table-column prop="zhize" label="èè´£" width=""> </el-table-column> |
| | | <el-table-column prop="name" label="å§å"> </el-table-column> |
| | | <el-table-column prop="tel" label="èç³»çµè¯"> </el-table-column> |
| | | <el-table-column prop="mail" label="é®ç®±" width="200"> </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | </div> |
| | | </el-card> |
| | |
| | | name: 'telephone', |
| | | data() { |
| | | return { |
| | | tableData:[{id:1,zhize:'æ ¡é¿',name:'æ¨é¸£',tel:'12345678910',mail:'12312312@qq.com'}, |
| | | {id:1,zhize:'æ ¡é¿',name:'æ¨é¸£',tel:'12345678910',mail:'12312312@qq.com'}, |
| | | {id:1,zhize:'æ ¡é¿',name:'æ¨é¸£',tel:'12345678910',mail:'12312312@qq.com'}, |
| | | {id:1,zhize:'æ ¡é¿',name:'æ¨é¸£',tel:'12345678910',mail:'12312312@qq.com'}, |
| | | {id:1,zhize:'æ ¡é¿',name:'æ¨é¸£',tel:'12345678910',mail:'12312312@qq.com'}, |
| | | {id:1,zhize:'æ ¡é¿',name:'æ¨é¸£',tel:'12345678910',mail:'12312312@qq.com'}, |
| | | tableData: [ |
| | | { id: 1, zhize: 'æ ¡é¿', name: 'æ¨é¸£', tel: '12345678910', mail: '12312312@qq.com' }, |
| | | { id: 1, zhize: 'æ ¡é¿', name: 'æ¨é¸£', tel: '12345678910', mail: '12312312@qq.com' }, |
| | | { id: 1, zhize: 'æ ¡é¿', name: 'æ¨é¸£', tel: '12345678910', mail: '12312312@qq.com' }, |
| | | { id: 1, zhize: 'æ ¡é¿', name: 'æ¨é¸£', tel: '12345678910', mail: '12312312@qq.com' }, |
| | | { id: 1, zhize: 'æ ¡é¿', name: 'æ¨é¸£', tel: '12345678910', mail: '12312312@qq.com' }, |
| | | { id: 1, zhize: 'æ ¡é¿', name: 'æ¨é¸£', tel: '12345678910', mail: '12312312@qq.com' } |
| | | ] |
| | | } |
| | | } |
| | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | .card{ |
| | | .card { |
| | | margin-top: 10px; |
| | | } |
| | | .max{ |
| | | .max { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | } |
| | | p{ |
| | | p { |
| | | text-align: center; |
| | | } |
| | | .right{ |
| | | .right { |
| | | width: 800px; |
| | | } |
| | | .left{ |
| | | .left { |
| | | width: 200px; |
| | | } |
| | | .img{ |
| | | .img { |
| | | display: flex; |
| | | flex-direction: column; |
| | | align-items: center; |
| | | justify-content: center; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <el-col :span="4" class="marr10"> |
| | | <ul> |
| | | <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)"> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b> |
| | | </li> |
| | | </ul> |
| | | </el-col> |
| | | <!-- æ°é»å
容 --> |
| | | <!-- æ°é»å
容 --> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <p class="name">{{ this.cont }}</p> |
| | | <hr class="namehr" /> |
| | | <el-col :span="24"> |
| | | <div> |
| | | <el-row class="marb10" :key="index" v-for="(item, index) in newsList"> |
| | |
| | | </div> |
| | | <!-- å页 --> |
| | | <div class="fenye"> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange" |
| | | :current-page.sync="currentPage" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="total"> |
| | | </el-pagination> |
| | | <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination> |
| | | </div> |
| | | </el-col> |
| | | </el-card> |
| | |
| | | return { |
| | | cont: '', |
| | | menuList: [], |
| | | newsList:[], |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | newsList: [], |
| | | pageSize: 6, |
| | | currentPage: 1, |
| | | total: 0, |
| | | item: {} |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | this.getTitle(); |
| | | this.getTitle() |
| | | }, |
| | | watch: { |
| | | menuList(n,o){ |
| | | this.cont = this.menuList[0].name |
| | | this.item = this.menuList[0]; |
| | | this.getnews(this.menuList[0]); |
| | | menuList(n, o) { |
| | | this.cont = this.menuList[0].name |
| | | this.item = this.menuList[0] |
| | | this.getnews(this.menuList[0]) |
| | | } |
| | | }, |
| | | methods: { |
| | | handleCurrentChange(val) { |
| | | console.log(`å½å页: ${val}`); |
| | | this.getnews(this.item); |
| | | console.log(`å½å页: ${val}`) |
| | | this.getnews(this.item) |
| | | }, |
| | | getTitle(){ |
| | | const data = Number(this.$route.query.id); |
| | | getMinTitle(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.menuList = res.data |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | getTitle() { |
| | | const data = Number(this.$route.query.id) |
| | | getMinTitle(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.menuList = res.data |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | changeMenu(val) { |
| | | this.cont = val.name |
| | | this.item = val |
| | | this.currentPage = 1 |
| | | this.getnews(val); |
| | | this.getnews(val) |
| | | }, |
| | | getnews(item){ |
| | | getnews(item) { |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | current: this.currentPage, |
| | | newsCategoryId: item.id, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | // è·³è½¬å°æ°é»å±ç¤ºé¡µé¢ |
| | | show(item){ |
| | | show(item) { |
| | | // console.log(item.id); |
| | | this.$router.push({path:'/home/news',query:{id:item.id}}) |
| | | this.$router.push({ path: '/home/news', query: { id: item.id } }) |
| | | } |
| | | } |
| | | } |
| | |
| | | .ft-black { |
| | | color: #000; |
| | | } |
| | | .box-card{ |
| | | .box-card { |
| | | height: 500px; |
| | | position: relative; |
| | | .fenye{ |
| | | .fenye { |
| | | position: absolute; |
| | | bottom: 10px; |
| | | } |
| | | } |
| | | </style> |
| | | } |
| | | </style> |
| | |
| | | <script> |
| | | import globalTitle from '../globalTitle.vue' |
| | | export default { |
| | | components: { globalTitle}, |
| | | components: { globalTitle }, |
| | | name: 'xueXiaoShouYe' |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | <style lang="less" scoped></style> |
| | |
| | | <el-col :span="4" class="marr10"> |
| | | <ul> |
| | | <li v-for="(item, index) in menuList" :key="index" class="liStylenone liPointer marb10" @click="changeMenu(item)"> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{item.name}}</b> |
| | | <b :class="cont == item.name ? 'ft-blue' : 'ft-black'">{{ item.name }}</b> |
| | | </li> |
| | | </ul> |
| | | </el-col> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <p class="name">{{ this.cont }}</p> |
| | | <hr class="namehr" /> |
| | | <el-col :span="24"> |
| | | <div> |
| | | <el-row class="marb10" :key="index" v-for="(item, index) in newsList"> |
| | |
| | | </div> |
| | | <!-- å页 --> |
| | | <div class="fenye"> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange" |
| | | :current-page.sync="currentPage" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="total"> |
| | | </el-pagination> |
| | | <el-pagination background @current-change="handleCurrentChange" :current-page.sync="currentPage" :page-size="pageSize" layout="prev, pager, next,total" :total="total"> </el-pagination> |
| | | </div> |
| | | </el-col> |
| | | </el-card> |
| | |
| | | return { |
| | | cont: '', //å°æ é¢åè² |
| | | menuList: [], |
| | | newsList:[], |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | newsList: [], |
| | | pageSize: 6, |
| | | currentPage: 1, |
| | | total: 0, |
| | | item: {} |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | this.getTitle(); |
| | | this.getTitle() |
| | | }, |
| | | watch: { |
| | | menuList(n,o){ |
| | | this.cont = this.menuList[0].name; |
| | | this.item = this.menuList[0]; |
| | | this.getnews(this.menuList[0]); |
| | | menuList(n, o) { |
| | | this.cont = this.menuList[0].name |
| | | this.item = this.menuList[0] |
| | | this.getnews(this.menuList[0]) |
| | | } |
| | | }, |
| | | methods: { |
| | | getTitle(){ |
| | | const data = Number(this.$route.query.id); |
| | | getMinTitle(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.menuList = res.data |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | getTitle() { |
| | | const data = Number(this.$route.query.id) |
| | | getMinTitle(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.menuList = res.data |
| | | } |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | changeMenu(val) { |
| | | this.cont = val.name |
| | | this.item = val |
| | | this.currentPage = 1 |
| | | this.getnews(val); |
| | | this.getnews(val) |
| | | }, |
| | | getnews(item){ |
| | | getnews(item) { |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | current: this.currentPage, |
| | | newsCategoryId: item.id, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.newsList = res.data.records |
| | | this.total = Number(res.data.total) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | handleCurrentChange(val) { |
| | | console.log(`å½å页: ${val}`); |
| | | console.log(`å½å页: ${val}`) |
| | | // this.currentPage = val |
| | | this.getnews(this.item); |
| | | this.getnews(this.item) |
| | | }, |
| | | // è·³è½¬å°æ°é»å±ç¤ºé¡µé¢ |
| | | show(item){ |
| | | show(item) { |
| | | // console.log(item.id); |
| | | this.$router.push({path:'/home/news',query:{id:item.id}}) |
| | | }, |
| | | this.$router.push({ path: '/home/news', query: { id: item.id } }) |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | text-align: center; |
| | | } |
| | | } |
| | | .ft-blue{ |
| | | color:rgb(9, 143, 252); |
| | | .ft-blue { |
| | | color: rgb(9, 143, 252); |
| | | } |
| | | .ft-black{ |
| | | .ft-black { |
| | | color: #000; |
| | | } |
| | | .box-card{ |
| | | .box-card { |
| | | height: 500px; |
| | | position: relative; |
| | | .fenye{ |
| | | .fenye { |
| | | position: absolute; |
| | | bottom: 10px; |
| | | } |
| | | } |
| | | </style> |
| | | } |
| | | </style> |
| | |
| | | import './assets/css/global.css' |
| | | import './assets/css/my_style.css' |
| | | |
| | | |
| | | import axios from 'axios' |
| | | // é
置请æ±çè·è·¯å¾ |
| | | // axios.defaults.baseURL = 'http://8.140.68.52:8181' |
| | | // axios.defaults.baseURL = 'http://127.0.0.1:8888/api/private/v1' |
| | | axios.defaults.baseURL = 'http://localhost:7070/' |
| | | axios.defaults.withCredentials = true; |
| | | axios.defaults.withCredentials = true |
| | | axios.interceptors.request.use(config => { |
| | | // console.log(config) |
| | | config.headers.Authorization = window.sessionStorage.getItem('token') |
| | |
| | | import AdMain from './components/Administrator/AdMain.vue' |
| | | import AdEdit from './components/Administrator/AdEdit.vue' |
| | | |
| | | |
| | | Vue.use(Router) |
| | | |
| | | const router = new Router({ |
| | | routes: [ |
| | | { path: '/', redirect: '/home' }, |
| | | { path: '/login', component: Login }, |
| | | { path:'/administrator', |
| | | { |
| | | path: '/administrator', |
| | | component: Administrator, |
| | | children: [{ path:'welcome',component:Welcome }, |
| | | { path:'main',component:Main }, |
| | | { path:'edit',component:Edit }, |
| | | { path:'news',component:News }, |
| | | { path:'editlunbo',component:EditLunBo }, |
| | | { path:'admain',component:AdMain }, |
| | | { path:'adedit',component:AdEdit }] |
| | | }, |
| | | { |
| | | path: '/home', |
| | | component: Home , |
| | | children:[ |
| | | { |
| | | path:'/home', |
| | | redirect:'index' |
| | | }, |
| | | { |
| | | path:'index', |
| | | component:index |
| | | }, |
| | | { |
| | | path:'introduce', |
| | | name:'introduce', |
| | | component:introduce |
| | | }, |
| | | { |
| | | path:'zhengce', |
| | | name:'zhengce', |
| | | component:zhengce |
| | | }, |
| | | { |
| | | path:'keXieXiangMu', |
| | | name:'keXieXiangMu', |
| | | component:keXieXiangMu |
| | | }, |
| | | { |
| | | path:'xueShuJiaoLiu', |
| | | name:'xueShuJiaoLiu', |
| | | component:xueShuJiaoLiu |
| | | }, |
| | | { |
| | | path:'banShiZhiNan', |
| | | name:'banShiZhiNan', |
| | | component:banShiZhiNan |
| | | }, |
| | | { |
| | | path:'kePuFengCai', |
| | | name:'kePuFengCai', |
| | | component:kePuFengCai |
| | | }, |
| | | { |
| | | path:'xueXiaoShouYe', |
| | | name:'xueXiaoShouYe', |
| | | component:xueXiaoShouYe |
| | | }, |
| | | { |
| | | path:'telephone', |
| | | name:'telephone', |
| | | component:telephone |
| | | }, |
| | | { |
| | | path:'moreMessage', |
| | | name:'moreMessage', |
| | | component:moreMessage |
| | | }, |
| | | { |
| | | path:'news', |
| | | name:'News', |
| | | component:News |
| | | }, |
| | | children: [ |
| | | { path: 'welcome', component: Welcome }, |
| | | { path: 'main', component: Main }, |
| | | { path: 'edit', component: Edit }, |
| | | { path: 'news', component: News }, |
| | | { path: 'editlunbo', component: EditLunBo }, |
| | | { path: 'admain', component: AdMain }, |
| | | { path: 'adedit', component: AdEdit } |
| | | ] |
| | | }, |
| | | { path:'*',component:NotFound } |
| | | { |
| | | path: '/home', |
| | | component: Home, |
| | | children: [ |
| | | { |
| | | path: '/home', |
| | | redirect: 'index' |
| | | }, |
| | | { |
| | | path: 'index', |
| | | component: index |
| | | }, |
| | | { |
| | | path: 'introduce', |
| | | name: 'introduce', |
| | | component: introduce |
| | | }, |
| | | { |
| | | path: 'zhengce', |
| | | name: 'zhengce', |
| | | component: zhengce |
| | | }, |
| | | { |
| | | path: 'keXieXiangMu', |
| | | name: 'keXieXiangMu', |
| | | component: keXieXiangMu |
| | | }, |
| | | { |
| | | path: 'xueShuJiaoLiu', |
| | | name: 'xueShuJiaoLiu', |
| | | component: xueShuJiaoLiu |
| | | }, |
| | | { |
| | | path: 'banShiZhiNan', |
| | | name: 'banShiZhiNan', |
| | | component: banShiZhiNan |
| | | }, |
| | | { |
| | | path: 'kePuFengCai', |
| | | name: 'kePuFengCai', |
| | | component: kePuFengCai |
| | | }, |
| | | { |
| | | path: 'xueXiaoShouYe', |
| | | name: 'xueXiaoShouYe', |
| | | component: xueXiaoShouYe |
| | | }, |
| | | { |
| | | path: 'telephone', |
| | | name: 'telephone', |
| | | component: telephone |
| | | }, |
| | | { |
| | | path: 'moreMessage', |
| | | name: 'moreMessage', |
| | | component: moreMessage |
| | | }, |
| | | { |
| | | path: 'news', |
| | | name: 'News', |
| | | component: News |
| | | } |
| | | ] |
| | | }, |
| | | { path: '*', component: NotFound } |
| | | ], |
| | | scrollBehavior(to, from, savedPosition) { //页é¢è·³è½¬åèªå¨åå°é¡¶é¨ |
| | | scrollBehavior(to, from, savedPosition) { |
| | | //页é¢è·³è½¬åèªå¨åå°é¡¶é¨ |
| | | if (savedPosition) { |
| | | return savedPosition |
| | | return savedPosition |
| | | } |
| | | return {x: 0, y: 0} |
| | | return { x: 0, y: 0 } |
| | | } |
| | | }) |
| | | |
| | |
| | | //对axiosçå°è£
|
| | | // 对axiosçå°è£
|
| | | import axios from 'axios' |
| | | let is_baseURL = 'http://localhost:7070/'//æµè¯ç¯å¢ |
| | | //å建axioså®ä¾ |
| | | // eslint-disable-next-line camelcase |
| | | let is_baseURL = 'http://localhost:7070/' // æµè¯ç¯å¢ |
| | | // å建axioså®ä¾ |
| | | const request = axios.create({ |
| | | baseURL: is_baseURL, |
| | | headers:{'Content-Type':'application/x-www-form-urlencoded'} |
| | | headers: { 'Content-Type': 'application/x-www-form-urlencoded' } |
| | | }) |
| | | //responseæå¡å¨ååºæ¦æªå¨ |
| | | // responseæå¡å¨ååºæ¦æªå¨ |
| | | request.interceptors.response.use( |
| | | response => { |
| | | const res = response.data |
| | | return res |
| | | }, |
| | | error => { |
| | | console.log('err',error) |
| | | console.log('err', error) |
| | | } |
| | | ) |
| | | |
| | |
| | | </ul> |
| | | <!-- å页 --> |
| | | <div> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange1" |
| | | :current-page="currentPagenotice" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="totalnotice"> |
| | | <el-pagination background @current-change="handleCurrentChange1" :current-page="currentPagenotice" :page-size="pageSize" layout="prev, pager, next,total" :total="totalnotice"> |
| | | </el-pagination> |
| | | </div> |
| | | </el-card> |
| | |
| | | </ul> |
| | | <!-- å页 --> |
| | | <div> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange2" |
| | | :current-page.sync="currentPageschool" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="totalschool"> |
| | | <el-pagination background @current-change="handleCurrentChange2" :current-page.sync="currentPageschool" :page-size="pageSize" layout="prev, pager, next,total" :total="totalschool"> |
| | | </el-pagination> |
| | | </div> |
| | | </el-card> |
| | | </el-card> |
| | | </ul> |
| | | </div> |
| | | <div v-if="this.$route.query.type == 'å·¥ä½ç¶æ'"> |
| | | <ul> |
| | | <el-card> |
| | | <ul> |
| | | <el-card> |
| | | <ul class="ul"> |
| | | <li class="lieBiao liPointer flex-v flex-between" :key="index" v-for="(item, index) in workList"> |
| | | <div class="time"> |
| | |
| | | </ul> |
| | | <!-- å页 --> |
| | | <div> |
| | | <el-pagination |
| | | background |
| | | @current-change="handleCurrentChange3" |
| | | :current-page.sync="currentPagework" |
| | | :page-size="pageSize" |
| | | layout="prev, pager, next,total" |
| | | :total="totalwork"> |
| | | <el-pagination background @current-change="handleCurrentChange3" :current-page.sync="currentPagework" :page-size="pageSize" layout="prev, pager, next,total" :total="totalwork"> |
| | | </el-pagination> |
| | | </div> |
| | | </el-card> |
| | | </el-card> |
| | | </ul> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {getNewsList} from '../../api/api' |
| | | import { getNewsList } from '../../api/api' |
| | | export default { |
| | | name: 'moreMessage', |
| | | data() { |
| | |
| | | noticeList: [], |
| | | schoolList: [], |
| | | workList: [], |
| | | currentPagenotice:1, //éç¥å
¬åçå½å页 |
| | | currentPageschool:1, //å¦é¢å¨æçå½å页 |
| | | currentPagework:1, //å·¥ä½å¨æçå½å页 |
| | | pageSize:10, |
| | | totalnotice:0, //éç¥å
¬åæ°é»çæ»æ¡æ° |
| | | totalschool:0, //å¦é¢å¨ææ°é»çæ»æ¡æ° |
| | | totalwork:0, //å·¥ä½å¨ææ°é»çæ»æ¡æ° |
| | | currentPagenotice: 1, //éç¥å
¬åçå½å页 |
| | | currentPageschool: 1, //å¦é¢å¨æçå½å页 |
| | | currentPagework: 1, //å·¥ä½å¨æçå½å页 |
| | | pageSize: 10, |
| | | totalnotice: 0, //éç¥å
¬åæ°é»çæ»æ¡æ° |
| | | totalschool: 0, //å¦é¢å¨ææ°é»çæ»æ¡æ° |
| | | totalwork: 0 //å·¥ä½å¨ææ°é»çæ»æ¡æ° |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.getnotice(); |
| | | this.getwork(); |
| | | this.getschool(); |
| | | mounted() { |
| | | this.getnotice() |
| | | this.getwork() |
| | | this.getschool() |
| | | }, |
| | | methods: { |
| | | //éç¥å
¬åçå页忢 |
| | | handleCurrentChange1(val){ |
| | | handleCurrentChange1(val) { |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPagenotice = val; |
| | | this.getnotice(); |
| | | this.currentPagenotice = val |
| | | this.getnotice() |
| | | }, |
| | | //å¦é¢å¨æçå页忢 |
| | | handleCurrentChange2(val){ |
| | | handleCurrentChange2(val) { |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPageschool = val; |
| | | this.getschool(); |
| | | this.currentPageschool = val |
| | | this.getschool() |
| | | }, |
| | | //å·¥ä½å¨æçå页忢 |
| | | handleCurrentChange3(val){ |
| | | handleCurrentChange3(val) { |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPagework = val; |
| | | this.getwork(); |
| | | this.currentPagework = val |
| | | this.getwork() |
| | | }, |
| | | //è·åæ°é»å表 |
| | | getnotice(){ |
| | | getnotice() { |
| | | const data = { |
| | | current:this.currentPagenotice, |
| | | newsCategoryId:42, |
| | | size:this.pageSize |
| | | current: this.currentPagenotice, |
| | | newsCategoryId: 42, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.noticeList = res.data.records |
| | | this.totalnotice = res.data.total |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.noticeList = res.data.records |
| | | this.totalnotice = res.data.total |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | getwork(){ |
| | | getwork() { |
| | | const data = { |
| | | current:this.currentPagework, |
| | | newsCategoryId:43, |
| | | size:this.pageSize |
| | | current: this.currentPagework, |
| | | newsCategoryId: 43, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.workList = res.data.records |
| | | this.totalwork = Number(res.data.total) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.workList = res.data.records |
| | | this.totalwork = Number(res.data.total) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | getschool(){ |
| | | getschool() { |
| | | const data = { |
| | | current:this.currentPageschool, |
| | | newsCategoryId:44, |
| | | size:this.pageSize |
| | | current: this.currentPageschool, |
| | | newsCategoryId: 44, |
| | | size: this.pageSize |
| | | } |
| | | getNewsList(data).then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.schoolList = res.data.records |
| | | this.totalschool = Number(res.data.total) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code == 200) { |
| | | this.schoolList = res.data.records |
| | | this.totalschool = Number(res.data.total) |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | toNoticeMsg(id) { |
| | | this.$router.push({ |
| | | path: '/home/news', |
| | | query: { |
| | | id: id, |
| | | id: id |
| | | } |
| | | }) |
| | | window.location.reload() |
| | |
| | | this.$router.push({ |
| | | path: '/home/news', |
| | | query: { |
| | | id: id, |
| | | id: id |
| | | } |
| | | }) |
| | | window.location.reload() |
| | |
| | | this.$router.push({ |
| | | path: '/home/news', |
| | | query: { |
| | | id: id, |
| | | id: id |
| | | } |
| | | }) |
| | | window.location.reload() |
| | |
| | | } |
| | | } |
| | | </script> |
| | | <style > |
| | | <style> |
| | | .underline { |
| | | border-bottom: 1px solid #0f99e9; |
| | | } |
| | |
| | | /* // background-color: rgb(179, 19, 19); */ |
| | | padding: 0 0 0 10px; |
| | | } |
| | | .ul{ |
| | | .ul { |
| | | width: 1100px; |
| | | margin: 0; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <!-- éç¥å
¬åå¯¼èªæ¡ --> |
| | | <el-row type="flex" class="row-bg underline marb10" justify="space-between"> |
| | | <span class="color"><b>éç¥å
Œ</b></span> |
| | | <span @click="goMore('éç¥å
Œ')" class="liPointer"> |
| | | æ´å¤<i class="el-icon-d-arrow-right"></i> |
| | | </span> |
| | | <span @click="goMore('éç¥å
¬å')" class="liPointer"> æ´å¤<i class="el-icon-d-arrow-right"></i> </span> |
| | | </el-row> |
| | | <!-- éç¥å
¬åæ°é»å表 --> |
| | | <div style="max-height:382px;overflow:hidden;"> |
| | |
| | | </template> |
| | | <script> |
| | | import axios from 'axios' |
| | | import {getMinTitle,getNewsList} from '../api/api' |
| | | import { getMinTitle, getNewsList } from '../api/api' |
| | | export default { |
| | | name: 'notice', |
| | | data() { |
| | | return { |
| | | noticeList: [], |
| | | noticeList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | mounted(){ |
| | | created() {}, |
| | | mounted() { |
| | | //è·åå°æ é¢ |
| | | // axios.get('http://localhost:8080/news_category/list/1').then(res => { |
| | | // console.log(res); |
| | |
| | | }, |
| | | methods: { |
| | | //è·åæ°é»å表 |
| | | getnews(){ |
| | | getnews() { |
| | | const data = { |
| | | current:1, |
| | | newsCategoryId:42, |
| | | size:6 |
| | | current: 1, |
| | | newsCategoryId: 42, |
| | | size: 6 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.noticeList = res.data.records |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.noticeList = res.data.records |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | // å»å°æ°é»å±ç¤ºé¡µ |
| | | toNoticeMsg(id) { |
| | | this.$router.push({ |
| | | path: '/home/news', |
| | | query: { |
| | | id:id, |
| | | id: id |
| | | } |
| | | }) |
| | | }, |
| | |
| | | // background-color: rgb(179, 19, 19); |
| | | padding: 0 0 0 10px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | .bg2 { |
| | | background: url('../assets/wbbg.png') no-repeat 20px 50px; |
| | | } |
| | | .bg,.bg2 { |
| | | .bg, |
| | | .bg2 { |
| | | position: relative; |
| | | height: 120px; |
| | | } |
| | |
| | | top: 20px; |
| | | left: 25px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <div> |
| | | <el-row type="flex" justify="space-between" class="underline"> |
| | | <span class="color"><b>å¦é¢å¨æ</b></span> |
| | | <span @click="goMore('å¦é¢å¨æ')" class="liPointer" |
| | | >æ´å¤<i class="el-icon-d-arrow-right"></i> |
| | | </span> |
| | | <span @click="goMore('å¦é¢å¨æ')" class="liPointer">æ´å¤<i class="el-icon-d-arrow-right"></i> </span> |
| | | </el-row> |
| | | <div style="max-height:420px;overflow:hidden;"> |
| | | <ul> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {getNewsList} from '../api/api' |
| | | import { getNewsList } from '../api/api' |
| | | export default { |
| | | name: 'school', |
| | | data() { |
| | | return { |
| | | schoolList: [], |
| | | schoolList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getnews() |
| | | }, |
| | | methods:{ |
| | | getnews(){ |
| | | methods: { |
| | | getnews() { |
| | | const data = { |
| | | current:1, |
| | | newsCategoryId:44, |
| | | size:6 |
| | | current: 1, |
| | | newsCategoryId: 44, |
| | | size: 6 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.schoolList = res.data.records |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.schoolList = res.data.records |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | //å徿´å¤ä¿¡æ¯é¡µé¢ |
| | | goMore(val){ |
| | | goMore(val) { |
| | | this.$router.push({ |
| | | path:'moreMessage', |
| | | query:{ |
| | | type:val, |
| | | path: 'moreMessage', |
| | | query: { |
| | | type: val |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.$router.push({ |
| | | path: '/home/news', |
| | | query: { |
| | | id:id |
| | | id: id |
| | | } |
| | | }) |
| | | } |
| | |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | </style> |
| | | </style> |
| | |
| | | <div> |
| | | <el-row type="flex" justify="space-between" class="underline row-bg"> |
| | | <span class="color"><b>å·¥ä½å¨æ</b></span> |
| | | <span @click="goMore('å·¥ä½ç¶æ')" class="liPointer" |
| | | >æ´å¤<i class="el-icon-d-arrow-right"></i> |
| | | </span> |
| | | <span @click="goMore('å·¥ä½ç¶æ')" class="liPointer">æ´å¤<i class="el-icon-d-arrow-right"></i> </span> |
| | | </el-row> |
| | | <div style="max-height:420px;overflow:hidden;"> |
| | | <ul> |
| | |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import {getNewsList} from '../api/api' |
| | | import { getNewsList } from '../api/api' |
| | | export default { |
| | | name:'work', |
| | | data(){ |
| | | return{ |
| | | workList: [], |
| | | name: 'work', |
| | | data() { |
| | | return { |
| | | workList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | this.getnews() |
| | | }, |
| | | methods:{ |
| | | methods: { |
| | | //è·åæ°é»å表 |
| | | getnews(){ |
| | | getnews() { |
| | | const data = { |
| | | current:1, |
| | | newsCategoryId:43, |
| | | size:6 |
| | | current: 1, |
| | | newsCategoryId: 43, |
| | | size: 6 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | if(res.code == 200){ |
| | | this.workList = res.data.records |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if (res.code == 200) { |
| | | this.workList = res.data.records |
| | | } |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | toWorkMsg(id) { |
| | | this.$router.push({ |
| | | path:'/home/news', |
| | | path: '/home/news', |
| | | query: { |
| | | id:id, |
| | | id: id |
| | | } |
| | | }) |
| | | }, |
| | | goMore(val) { |
| | | this.$router.push({ |
| | | path:'moreMessage', |
| | | query:{ |
| | | type:val, |
| | | path: 'moreMessage', |
| | | query: { |
| | | type: val |
| | | } |
| | | }) |
| | | } |
| | |
| | | height: 55px; |
| | | line-height: 55px; |
| | | } |
| | | </style> |
| | | </style> |