| | |
| | | }, |
| | | "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({ |
| | |
| | | export const getMinTitle = data => { |
| | | return request({ |
| | | method: 'GET', |
| | | url: `/news_category/list/${data}`, |
| | | url: `/news_category/list/${data}` |
| | | }) |
| | | } |
| | | //è·åæ°é»å表 |
| | |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/list', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //è·ååªæä¸ç¯æ°é» |
| | |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/update', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //å 餿°é» |
| | |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/delete', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //æ¨¡ç³æ¥è¯¢ |
| | |
| | | return request({ |
| | | method: 'POST', |
| | | url: '/news/fuzzy', |
| | | params: data, |
| | | params: data |
| | | }) |
| | | } |
| | | //æ·»å æ°é» |
| | |
| | | <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-item label="ç¨æ·å:"> |
| | |
| | | </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-item label="ç¨æ·å:"> |
| | |
| | | this.editDialogVisible = true |
| | | }, |
| | | editClose(){ |
| | | this.editForm.username = ''; |
| | | this.editForm.oldPassword = ''; |
| | | this.editForm.password = ''; |
| | | this.editForm.username = '' |
| | | this.editForm.oldPassword = '' |
| | | this.editForm.password = '' |
| | | }, |
| | | cancel(){ |
| | | this.editForm.username = ''; |
| | | this.editForm.oldPassword = ''; |
| | | this.editForm.password = ''; |
| | | this.editForm.username = '' |
| | | this.editForm.oldPassword = '' |
| | | this.editForm.password = '' |
| | | this.editDialogVisible = false |
| | | }, |
| | | //ç¼è¾ç¡®å®äºä»¶ |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | console.log(res) |
| | | if(res !== 'confirm'){ |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | |
| | | }, |
| | | //注ååæ¶æ¸
空 |
| | | canceladd(){ |
| | | this.addForm.username = ''; |
| | | this.addForm.password = ''; |
| | | this.addForm.username = '' |
| | | this.addForm.password = '' |
| | | this.addDialogVisible = false |
| | | }, |
| | | addClose(){ |
| | | this.addForm.username = ''; |
| | | this.addForm.password = ''; |
| | | this.addForm.username = '' |
| | | this.addForm.password = '' |
| | | }, |
| | | //注åæäº¤ |
| | | addEdit(){ |
| | |
| | | this.$message.error('注å失败') |
| | | } |
| | | }) |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | .add{ |
| | | margin-bottom: 10px; |
| | | } |
| | | |
| | | </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> |
| | | <!-- æ°é»è¡¨æ ¼åºå --> |
| | |
| | | <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-item label="id:"> |
| | |
| | | <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"> |
| | |
| | | fuzzytable:false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | value: [], |
| | | options: [{ |
| | | options: [ |
| | | { |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:42, |
| | | label: 'éç¥å
Œ', |
| | | label: 'éç¥å
Œ' |
| | | }, |
| | | { |
| | | value:43, |
| | | label: 'å·¥ä½å¨æ', |
| | | label: 'å·¥ä½å¨æ' |
| | | }, |
| | | { |
| | | value:44, |
| | | label: 'å¦é¢å¨æ', |
| | | label: 'å¦é¢å¨æ' |
| | | }, |
| | | { |
| | | value:45, |
| | | label: 'è½®æå¾', |
| | | }], |
| | | },{ |
| | | label: 'è½®æå¾' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 22, |
| | | label: 'ç§åæ¦åµ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:27, |
| | | label: 'ç®ä»', |
| | | label: 'ç®ä»' |
| | | }, |
| | | { |
| | | value:28, |
| | | label: 'ç« ç¨', |
| | | label: 'ç« ç¨' |
| | | }, |
| | | { |
| | | value:29, |
| | | label: 'ç»ç»ç»æ', |
| | | label: 'ç»ç»ç»æ' |
| | | }, |
| | | { |
| | | value:30, |
| | | label: 'å·¥ä½èè´£', |
| | | label: 'å·¥ä½èè´£' |
| | | }, |
| | | { |
| | | value:31, |
| | | label: 'ä¸è人å', |
| | | }], |
| | | label: 'ä¸è人å' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 23, |
| | | label: 'æ¿çæ³è§', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶', |
| | | label: 'ä¸å½ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value:36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶', |
| | | label: 'å°æ¹ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value:37, |
| | | label: '社å¢ç®¡çæä»¶', |
| | | }], |
| | | label: '社å¢ç®¡çæä»¶' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 25, |
| | | label: '妿¯äº¤æµ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:38, |
| | | label: '妿¯ä¿¡æ¯', |
| | | label: '妿¯ä¿¡æ¯' |
| | | }, |
| | | { |
| | | value:39, |
| | | label: 'ç§æç«èµ', |
| | | }], |
| | | label: 'ç§æç«èµ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 27, |
| | | label: 'ç§æ®é£é', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨', |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨' |
| | | }, |
| | | { |
| | | value:41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨', |
| | | }], |
| | | }] |
| | | label: '平顶山叿¿åç§æ®æ´»å¨' |
| | | } |
| | | ] |
| | | } |
| | | ] |
| | | } |
| | | }, |
| | | created(){ |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | created() {}, |
| | | mounted() {}, |
| | | methods: { |
| | | //ä¿®æ¹å¯¹è¯æ¡å
³éçæ¹æ³ |
| | | handleClose(done) { |
| | | this.$confirm('确认å
³éï¼') |
| | | .then(_ => { |
| | | done(); |
| | | done() |
| | | }) |
| | | .catch(_ => {}); |
| | | .catch(_ => {}) |
| | | }, |
| | | //跳转æ®é管çå表 |
| | | goAdEdit(){ |
| | |
| | | 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){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:newsCategoryId, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res=>{ |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å±ç¤ºä¿®æ¹å¯¹è¯æ¡ |
| | |
| | | this.editForm = res.data |
| | | } |
| | | }) |
| | | this.editDialogVisible = true; |
| | | this.editDialogVisible = true |
| | | }, |
| | | //ç¡®å®ä¿®æ¹è¡¨åæäº¤ï¼éªè¯åèµ·è¯·æ± |
| | | editNew(){ |
| | |
| | | title:this.editForm.title |
| | | } |
| | | update(data).then(res=>{ |
| | | console.log('dsadasas',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) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | size: this.fuzzyForm.fuzzysize, |
| | | title:title |
| | | } |
| | | fuzzy(data).then(res => { |
| | | fuzzy(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //æ¸
空æ¥è¯¢å表å
容 |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | console.log(res) |
| | | if(res !== 'confirm'){ |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | console.log(id); |
| | | console.log(id) |
| | | const data = { |
| | | id:id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteNew(data).then(res => { |
| | | console.log('>>>'+res); |
| | | console.log('>>>' + res) |
| | | if(res.code == 200){ |
| | | this.$message.success('å 餿°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | this.query(this.newsCategoryId) |
| | | }else{ |
| | | return this.$message.error('å 餿°é»å¤±è´¥ï¼') |
| | | } |
| | |
| | | }, |
| | | 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){ |
| | |
| | | }, |
| | | //å»å¾æ·»å ç¼è¾é¡µé¢ |
| | | goEdit(id){ |
| | | let title = ''; |
| | | console.log(this.value); |
| | | if (this.value.length = 2) { |
| | | let t = this.value[0]; |
| | | let i = this.value[1]; |
| | | 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 (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){ |
| | | } 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); |
| | | 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{ |
| | | this.$message.error('请å
éæ©æ°é»æ é¢') |
| | | } |
| | | |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return { |
| | | } |
| | | return {} |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | methods: { |
| | | logout() { |
| | | //æ¸
空token |
| | | window.sessionStorage.clear() |
| | | //跳转å°ç»å½é¡µ |
| | | this.$router.push('/login') |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | content: '', //æ°é»å
容 |
| | | newsCategoryId:2, |
| | | editorOption: { |
| | | placeholder: "请è¾å
¥æ£æ", |
| | | placeholder: '请è¾å
¥æ£æ', |
| | | // editorOption鿝æ¾å¾çä¸ä¼ é
ç½®åæ°ç¨çï¼ä¾å¦ï¼ |
| | | action: '/api/product/richtext_img_upload.do', // å¿
å¡«åæ° å¾çä¸ä¼ å°å |
| | | methods: 'POST', // å¿
å¡«åæ° å¾çä¸ä¼ æ¹å¼ |
| | |
| | | size: 10000000, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºKb, 1M = 1024Kb |
| | | accept: 'multipart/form-data, image/png, image/gif, image/jpeg, image/bmp, image/x-icon,image/jpg' // å¯é å¯ä¸ä¼ çå¾çæ ¼å¼ |
| | | } , //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList:[], |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | |
| | | releaseTime:this.releaseTime |
| | | } |
| | | add(data).then(res => { |
| | | console.log(res); |
| | | console.log(res) |
| | | if(res.code !== 200){ |
| | | return this.$message.error('å叿°é»å¤±è´¥ï¼è¯·éè¯ï¼') |
| | | }else{ |
| | | this.$message.success('æ°é»å叿åï¼') |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | this.$router.go(-1) |
| | | } |
| | | }) |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-row><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row> |
| | | <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-row> |
| | | </div> |
| | | </template> |
| | | <script> |
| | | import axios from 'axios' |
| | | |
| | | // 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.bubble.css' |
| | | 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 }, |
| | |
| | | photo:'', |
| | | newsCategoryId:2, |
| | | editorOption: { |
| | | placeholder: "请è¾å
¥æ£æ", |
| | | placeholder: '请è¾å
¥æ£æ', |
| | | modules: { |
| | | ImageExtend: { // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | ImageExtend: { |
| | | // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | name: 'file', // å¾çåæ°å |
| | | loading: true, |
| | | size: 10, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºMï¼1M = 1024kb |
| | | action:'http://localhost:7070/uploading', |
| | | response: (res) => { |
| | | console.log(res); |
| | | response: res => { |
| | | console.log(res) |
| | | return 'http://localhost:7070/'+res.data |
| | | }, |
| | | headers: (xhr) => { |
| | | headers: xhr => { |
| | | // axios.defaults.withCredentials = true; |
| | | // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288') |
| | | }, // å¯éåæ° 设置请æ±å¤´é¨ |
| | |
| | | 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': [] }], //坹齿¹å¼ |
| | | [{ 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 () { // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | image: function() { |
| | | // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | QuillWatch.emit(this.quill.id) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | } , //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList:[], |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | | // console.log('>>>>>>>',this.$route.query.id); |
| | | this.newsCategoryId = this.$route.query.id |
| | | }, |
| | | mounted(){ |
| | | }, |
| | | 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(){ |
| | | const data = { |
| | | newsCategoryId:this.newsCategoryId, |
| | |
| | | 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); |
| | | console.log(res) |
| | | if(res.code !== 200){ |
| | | return this.$message.error('å叿°é»å¤±è´¥ï¼è¯·éè¯ï¼') |
| | | }else{ |
| | | this.$message.success('æ°é»å叿åï¼') |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | this.$router.go(-1) |
| | | } |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <template> |
| | | <div class="box"> |
| | | <el-row><h3 style="margin-top: 0px">{{ $route.query.title }}</h3></el-row> |
| | | <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/> |
| | |
| | | content: '', //æ°é»å
容 |
| | | newsCategoryId:45, |
| | | editorOption: { |
| | | placeholder: "请è¾å
¥æ£æ", |
| | | placeholder: '请è¾å
¥æ£æ', |
| | | modules: { |
| | | ImageExtend: { // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | ImageExtend: { |
| | | // 妿ä¸ä½è®¾ç½®ï¼å³{} åä¾ç¶å¼å¯å¤å¶ç²è´´åè½ä¸ä»¥base64æå
¥ |
| | | name: 'file', // å¾çåæ°å |
| | | loading: true, |
| | | size: 10, // å¯éåæ° å¾ç大å°ï¼åä½ä¸ºMï¼1M = 1024kb |
| | | action:'http://localhost:7070/uploading', |
| | | response: (res) => { |
| | | console.log(res); |
| | | response: res => { |
| | | console.log(res) |
| | | return 'http://localhost:7070/'+res.data |
| | | }, |
| | | headers: (xhr) => { |
| | | headers: xhr => { |
| | | // axios.defaults.withCredentials = true; |
| | | // xhr.setRequestHeader('Cookie','NMTID=00OVM6QOJcTDVhqDUtvgSnd-5FBxLcAAAF9nTiDHg; JSESSIONID=5ACC52D29A2434E09450CB975E08C288') |
| | | }, // å¯éåæ° 设置请æ±å¤´é¨ |
| | |
| | | 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': [] }], //坹齿¹å¼ |
| | | [{ 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 () { // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | image: function() { |
| | | // 嫿忥çå¾çç¹å»æé®äºä»¶ |
| | | QuillWatch.emit(this.quill.id) |
| | | } |
| | | } |
| | | }, |
| | | }, |
| | | } |
| | | } |
| | | } , //ç¼è¾å¨æ°é»å¯¹è±¡ |
| | | fileList:[], |
| | | fileList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | |
| | | }, |
| | | 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); |
| | | const fd = new FormData() |
| | | fd.append('pictureFile', this.pictureFile) |
| | | const data = { |
| | | newsCategoryId:this.newsCategoryId, |
| | | content:this.content, |
| | |
| | | } |
| | | // console.log(999) |
| | | add(data,fd).then(res => { |
| | | console.log(res); |
| | | console.log(this.newsCategoryId); |
| | | console.log(res) |
| | | console.log(this.newsCategoryId) |
| | | if (res.code != 200) { |
| | | return this.$message.error('å叿°é»å¤±è´¥ï¼è¯·éè¯ï¼') |
| | | }else{ |
| | | this.$message.success('æ°é»å叿åï¼') |
| | | console.log(this.content); |
| | | console.log(this.content) |
| | | this.$router.go(-1) |
| | | } |
| | | }) |
| | |
| | | <div> |
| | | <!-- 级èéæ©å¨ --> |
| | | <div class="block"> |
| | | <el-cascader |
| | | v-model="value" |
| | | :options="options" |
| | | clearable |
| | | filterable |
| | | @change="handleChange"> |
| | | </el-cascader> |
| | | <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ï¼? |
| | |
| | | <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> |
| | | <!-- æ¨¡ç³æ¥è¯¢çè¡¨æ ¼æ¾ç¤º --> |
| | |
| | | <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-item label="id:"> |
| | |
| | | fuzzytable:false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | value: [], |
| | | options: [{ |
| | | options: [ |
| | | { |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:42, |
| | | label: 'éç¥å
Œ', |
| | | label: 'éç¥å
Œ' |
| | | }, |
| | | { |
| | | value:43, |
| | | label: 'å·¥ä½å¨æ', |
| | | label: 'å·¥ä½å¨æ' |
| | | }, |
| | | { |
| | | value:44, |
| | | label: 'å¦é¢å¨æ', |
| | | }], |
| | | },{ |
| | | label: 'å¦é¢å¨æ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 22, |
| | | label: 'ç§åæ¦åµ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:27, |
| | | label: 'ç®ä»', |
| | | label: 'ç®ä»' |
| | | }, |
| | | { |
| | | value:28, |
| | | label: 'ç« ç¨', |
| | | label: 'ç« ç¨' |
| | | }, |
| | | { |
| | | value:29, |
| | | label: 'ç»ç»ç»æ', |
| | | label: 'ç»ç»ç»æ' |
| | | }, |
| | | { |
| | | value:30, |
| | | label: 'å·¥ä½èè´£', |
| | | label: 'å·¥ä½èè´£' |
| | | }, |
| | | { |
| | | value:31, |
| | | label: 'ä¸è人å', |
| | | }], |
| | | label: 'ä¸è人å' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 23, |
| | | label: 'æ¿çæ³è§', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶', |
| | | label: 'ä¸å½ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value:36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶', |
| | | label: 'å°æ¹ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value:37, |
| | | label: '社å¢ç®¡çæä»¶', |
| | | }], |
| | | label: '社å¢ç®¡çæä»¶' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 25, |
| | | label: '妿¯äº¤æµ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:38, |
| | | label: '妿¯ä¿¡æ¯', |
| | | label: '妿¯ä¿¡æ¯' |
| | | }, |
| | | { |
| | | value:39, |
| | | label: 'ç§æç«èµ', |
| | | }], |
| | | label: 'ç§æç«èµ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 27, |
| | | label: 'ç§æ®é£é', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨', |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨' |
| | | }, |
| | | { |
| | | value:41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨', |
| | | }], |
| | | }] |
| | | 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){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:newsCategoryId, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res=>{ |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å±ç¤ºä¿®æ¹å¯¹è¯æ¡ |
| | |
| | | this.editForm = res.data |
| | | } |
| | | }) |
| | | this.editDialogVisible = true; |
| | | this.editDialogVisible = true |
| | | }, |
| | | //ç¡®å®ä¿®æ¹è¡¨åæäº¤ï¼éªè¯åèµ·è¯·æ± |
| | | editNew(){ |
| | |
| | | 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) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | size: this.fuzzyForm.fuzzysize, |
| | | title:title |
| | | } |
| | | fuzzy(data).then(res => { |
| | | fuzzy(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //æ¸
空æ¥è¯¢å表å
容 |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | console.log(res) |
| | | if(res !== 'confirm'){ |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | console.log(id); |
| | | console.log(id) |
| | | const data = { |
| | | id:id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteNew(data).then(res => { |
| | | console.log('>>>'+res); |
| | | console.log('>>>' + res) |
| | | if(res.code == 200){ |
| | | this.$message.success('å 餿°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | this.query(this.newsCategoryId) |
| | | }else{ |
| | | return this.$message.error('å 餿°é»å¤±è´¥ï¼') |
| | | } |
| | |
| | | }, |
| | | 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){ |
| | |
| | | }, |
| | | //å»å¾æ·»å ç¼è¾é¡µé¢ |
| | | 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) { |
| | | 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){ |
| | | } 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); |
| | | console.log(this.newsCategoryId) |
| | | }else{ |
| | | this.$message.error('请å
éæ©æ°é»æ é¢') |
| | | } |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <!-- 级èéæ©å¨ --> |
| | | <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> |
| | | <!-- æ°é»è¡¨æ ¼åºå --> |
| | |
| | | <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-item label="id:"> |
| | |
| | | <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"> |
| | |
| | | fuzzytable:false, //æ¨¡ç³æ¥è¯¢è¡¨æ ¼çæ¾ç¤º |
| | | fuzzyForm:{ fuzzytitle:'',fuzzytotal:0,fuzzycurrent:1,fuzzysize:6 }, //æ¨¡ç³æ¥è¯¢å表对象 |
| | | value: [], |
| | | options: [{ |
| | | options: [ |
| | | { |
| | | value: 1, |
| | | label: 'é¦é¡µ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:42, |
| | | label: 'éç¥å
Œ', |
| | | label: 'éç¥å
Œ' |
| | | }, |
| | | { |
| | | value:43, |
| | | label: 'å·¥ä½å¨æ', |
| | | label: 'å·¥ä½å¨æ' |
| | | }, |
| | | { |
| | | value:44, |
| | | label: 'å¦é¢å¨æ', |
| | | label: 'å¦é¢å¨æ' |
| | | }, |
| | | { |
| | | value:45, |
| | | label: 'è½®æå¾', |
| | | }], |
| | | },{ |
| | | label: 'è½®æå¾' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 22, |
| | | label: 'ç§åæ¦åµ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:27, |
| | | label: 'ç®ä»', |
| | | label: 'ç®ä»' |
| | | }, |
| | | { |
| | | value:28, |
| | | label: 'ç« ç¨', |
| | | label: 'ç« ç¨' |
| | | }, |
| | | { |
| | | value:29, |
| | | label: 'ç»ç»ç»æ', |
| | | label: 'ç»ç»ç»æ' |
| | | }, |
| | | { |
| | | value:30, |
| | | label: 'å·¥ä½èè´£', |
| | | label: 'å·¥ä½èè´£' |
| | | }, |
| | | { |
| | | value:31, |
| | | label: 'ä¸è人å', |
| | | }], |
| | | label: 'ä¸è人å' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 23, |
| | | label: 'æ¿çæ³è§', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:35, |
| | | label: 'ä¸å½ç§åæ¿çæä»¶', |
| | | label: 'ä¸å½ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value:36, |
| | | label: 'å°æ¹ç§åæ¿çæä»¶', |
| | | label: 'å°æ¹ç§åæ¿çæä»¶' |
| | | }, |
| | | { |
| | | value:37, |
| | | label: '社å¢ç®¡çæä»¶', |
| | | }], |
| | | label: '社å¢ç®¡çæä»¶' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 25, |
| | | label: '妿¯äº¤æµ', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:38, |
| | | label: '妿¯ä¿¡æ¯', |
| | | label: '妿¯ä¿¡æ¯' |
| | | }, |
| | | { |
| | | value:39, |
| | | label: 'ç§æç«èµ', |
| | | }], |
| | | label: 'ç§æç«èµ' |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | value: 27, |
| | | label: 'ç§æ®é£é', |
| | | children: [{ |
| | | children: [ |
| | | { |
| | | value:40, |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨', |
| | | label: '平顶山å¦é¢ç§æ®æ´»å¨' |
| | | }, |
| | | { |
| | | value:41, |
| | | label: '平顶山叿¿åç§æ®æ´»å¨', |
| | | }], |
| | | }] |
| | | 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){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:newsCategoryId, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res=>{ |
| | | } |
| | | getNewsList(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('è·åæ°é»å表失败') |
| | |
| | | this.tableData = res.data.records |
| | | this.total = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å±ç¤ºä¿®æ¹å¯¹è¯æ¡ |
| | |
| | | this.editForm = res.data |
| | | } |
| | | }) |
| | | this.editDialogVisible = true; |
| | | this.editDialogVisible = true |
| | | }, |
| | | //ç¡®å®ä¿®æ¹è¡¨åæäº¤ï¼éªè¯åèµ·è¯·æ± |
| | | editNew(){ |
| | |
| | | title:this.editForm.title |
| | | } |
| | | update(data).then(res=>{ |
| | | console.log('dsadasas',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) |
| | | } |
| | | }) |
| | | }, |
| | |
| | | size: this.fuzzyForm.fuzzysize, |
| | | title:title |
| | | } |
| | | fuzzy(data).then(res => { |
| | | fuzzy(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if (res.code !== 200) { |
| | | return this.$message.error('æ¥è¯¢æ°é»å表失败') |
| | |
| | | this.fuzzytableData = res.data.records |
| | | this.fuzzyForm.fuzzytotal = res.data.total |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //æ¸
空æ¥è¯¢å表å
容 |
| | |
| | | }) |
| | | //å¦æç¨æ·ç¹å»ç¡®å®åè¿åconfirm |
| | | //å¦æç¨æ·ç¹å»åæ¶åè¿åcancel |
| | | console.log(res); |
| | | console.log(res) |
| | | if(res !== 'confirm'){ |
| | | return this.$message.info('已忶å é¤~') |
| | | }else{ |
| | | console.log(id); |
| | | console.log(id) |
| | | const data = { |
| | | id:id |
| | | } |
| | | //åæ°data è¦ä»¥å¯¹è±¡çå½¢å¼ä¼ å
¥ |
| | | deleteNew(data).then(res => { |
| | | console.log('>>>'+res); |
| | | console.log('>>>' + res) |
| | | if(res.code == 200){ |
| | | this.$message.success('å 餿°é»æåï¼') |
| | | this.query(this.newsCategoryId); |
| | | this.query(this.newsCategoryId) |
| | | }else{ |
| | | return this.$message.error('å 餿°é»å¤±è´¥ï¼') |
| | | } |
| | |
| | | }, |
| | | 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){ |
| | |
| | | }, |
| | | //å»å¾æ·»å ç¼è¾é¡µé¢ |
| | | goEdit(id){ |
| | | let title = ''; |
| | | console.log(this.value); |
| | | if (this.value.length = 2) { |
| | | let t = this.value[0]; |
| | | let i = this.value[1]; |
| | | 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 (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){ |
| | | } 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); |
| | | 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{ |
| | | this.$message.error('请å
éæ©æ°é»æ é¢') |
| | | } |
| | | |
| | | } |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | |
| | |
| | | <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> |
| | |
| | | filelist:[], |
| | | delList:[], |
| | | dialogVisible:false, |
| | | dialogImageUrl:'', |
| | | dialogImageUrl: '' |
| | | } |
| | | }, |
| | | 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=>{ |
| | | //ä¸ä¼ æ¥å£ |
| | | console.log(res); |
| | | console.log(res) |
| | | }) |
| | | }, |
| | | // é¢è§å¾ç |
| | | handlePictureCardPreview(file){ |
| | | this.dialogVisible = true |
| | | this.dialogImageUrl=file.url |
| | | console.log(this.dialogImageUrl); |
| | | console.log(this.dialogImageUrl) |
| | | }, |
| | | // å é¤å¾ç |
| | | handleRemove(file){ |
| | |
| | | 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> |
| | |
| | | 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}], |
| | | 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:[] |
| | | } |
| | | }, |
| | |
| | | }, |
| | | mounted() { |
| | | let api3 = 'http://localhost:7070/news_type/all' |
| | | axios.get(api3).then((res)=>{ |
| | | axios |
| | | .get(api3) |
| | | .then(res => { |
| | | // console.log(res); |
| | | this.menuList2 = res.data.data |
| | | }).catch((error)=>{ |
| | | console.log(error); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | watch: {}, |
| | |
| | | loginForm: { |
| | | username: '', |
| | | password: '' |
| | | }, |
| | | } |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | password: this.loginForm.password |
| | | } |
| | | login(data).then(res => { |
| | | console.log(res); |
| | | console.log(res) |
| | | if(res.code !== 200){ |
| | | this.$message.error('ç»å½å¤±è´¥ï¼') |
| | | }else if(res.data.role == 'è¶
级管çå'){ |
| | |
| | | <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> |
| | |
| | | <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"> |
| | |
| | | name:'globalTitle', |
| | | data(){ |
| | | return { |
| | | title:'', |
| | | title: '' |
| | | } |
| | | }, |
| | | created(){ |
| | | }, |
| | | created() {}, |
| | | methods:{ |
| | | getTitle(v){ |
| | | switch(v){ |
| | |
| | | <h2>{{ title }}</h2> |
| | | <p>å叿¥æï¼{{ releaseTime }} ç¹å»éï¼[ {{(hits+1)/2}} ]</p> |
| | | </div> |
| | | <hr> |
| | | <hr /> |
| | | <div v-html="content" class="ql-editor"></div> |
| | | </div> |
| | | </template> |
| | |
| | | }, |
| | | created(){ |
| | | // console.log(">>>>>>>>",this.$route.query.id); |
| | | this.getalone(); |
| | | this.getalone() |
| | | }, |
| | | methods:{ |
| | | getalone(){ |
| | | const data = this.$route.query.id; |
| | | 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> |
| | |
| | | <div> |
| | | <globalTitle /> |
| | | <div> |
| | | <img src="../../assets/keyanlixiangjieti.png" alt=""> |
| | | <img src="../../assets/keyanlixiangjieti.png" alt="" /> |
| | | </div> |
| | | </div> |
| | | </template> |
| | |
| | | import globalTitle from '../globalTitle.vue' |
| | | export default { |
| | | components: { globalTitle}, |
| | | name: 'banShiZhiNan', |
| | | name: 'banShiZhiNan' |
| | | } |
| | | |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | <style lang="less" scoped></style> |
| | |
| | | <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%"> |
| | | <img :src="'http://localhost:7070/' + item.picturePath" alt="" style="width:100%; height:90%" /> |
| | | </div> |
| | | </el-carousel-item> |
| | | </el-carousel> |
| | |
| | | |
| | | <!-- å®ä½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> |
| | |
| | | // { path:require('../../assets/2.jpg'),index: 2}, |
| | | // { path:require('../../assets/3.jpg'),index: 3}, |
| | | // ], |
| | | imgList:[], |
| | | imgList: [] |
| | | } |
| | | }, |
| | | created(){ |
| | |
| | | newsCategoryId:45, |
| | | size:3 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | this.imgList = res.data.records |
| | | } |
| | | }).catch(err => { |
| | | console.log(err); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | gonew(id){ |
| | |
| | | new:{} //æ°é»å¯¹è±¡ |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted() { |
| | | this.getTitle(); |
| | | this.getTitle() |
| | | }, |
| | | watch: { |
| | | menuList(n,o){ |
| | | this.cont = this.menuList[0].name; |
| | | this.getnews(this.menuList[0]); //æ¹å对象ï¼èåæ çä¸è¥¿è¦åå°çå¬å±æ§éè¾¹ |
| | | 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 => { |
| | | 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); |
| | | }) |
| | | .catch(err => { |
| | | console.log(err) |
| | | }) |
| | | }, |
| | | //å°æ é¢èåçç忢 |
| | | changeMenu(val) { |
| | | this.cont = val.name; |
| | | this.cont = val.name |
| | | this.getnews(val) |
| | | }, |
| | | //è·åå°äºæ°é»å表ï¼éè¾¹åªæä¸ä¸ªå¯¹è±¡ |
| | |
| | | current:1, |
| | | newsCategoryId:item.id, |
| | | size:5 |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | } |
| | | 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); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | //è·åæ°é»å
容,å¾å°ä¸ä¸ªæ°é»å¯¹è±¡ |
| | | getalone(id){ |
| | | const data = id; |
| | | getnew(data).then(res => { |
| | | const data = id |
| | | getnew(data) |
| | | .then(res => { |
| | | // console.log(res); |
| | | if(res.code == 200){ |
| | | this.new = res.data; |
| | | console.log(this.new.content); |
| | | this.new = res.data |
| | | console.log(this.new.content) |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | } |
| | | } |
| | |
| | | <!-- æ°é»å
容 --> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <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> |
| | |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | 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]); |
| | | 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); |
| | | 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); |
| | | }) |
| | | .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){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | } |
| | | 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); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | show(item){ |
| | |
| | | <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:'æ '}, |
| | | 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: 'æ ' } |
| | | ] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | methods: { |
| | | |
| | | } |
| | | created() {}, |
| | | methods: {} |
| | | } |
| | | </script> |
| | | |
| | |
| | | <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' }"> |
| | | <!-- :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-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> |
| | |
| | | name: 'telephone', |
| | | data() { |
| | | return { |
| | | tableData:[{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' } |
| | | ] |
| | | } |
| | | } |
| | |
| | | <!-- æ°é»å
容 --> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <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> |
| | |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | 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]); |
| | | 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); |
| | | 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); |
| | | }) |
| | | .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){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | } |
| | | 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); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | // è·³è½¬å°æ°é»å±ç¤ºé¡µé¢ |
| | |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | |
| | | </style> |
| | | <style lang="less" scoped></style> |
| | |
| | | </el-col> |
| | | <el-card class="box-card"> |
| | | <p class="name">{{this.cont}}</p> |
| | | <hr class="namehr"> |
| | | <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> |
| | |
| | | pageSize:6, |
| | | currentPage:1, |
| | | total:0, |
| | | item:{}, |
| | | 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]); |
| | | 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); |
| | | 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); |
| | | }) |
| | | .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){ |
| | | const data = { |
| | | current:this.currentPage, |
| | | newsCategoryId:item.id, |
| | | size:this.pageSize |
| | | }; |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | } |
| | | 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); |
| | | }) |
| | | .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){ |
| | | // console.log(item.id); |
| | | this.$router.push({path:'/home/news',query:{id:item.id}}) |
| | | }, |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | 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 }, |
| | | 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: 'adedit', component: AdEdit } |
| | | ] |
| | | }, |
| | | { |
| | | path: '/home', |
| | |
| | | path:'news', |
| | | name:'News', |
| | | component:News |
| | | }, |
| | | } |
| | | ] |
| | | }, |
| | | { path:'*',component:NotFound } |
| | | ], |
| | | scrollBehavior(to, from, savedPosition) { //页é¢è·³è½¬åèªå¨åå°é¡¶é¨ |
| | | scrollBehavior(to, from, savedPosition) { |
| | | //页é¢è·³è½¬åèªå¨åå°é¡¶é¨ |
| | | if (savedPosition) { |
| | | return savedPosition |
| | | } |
| | |
| | | //对axiosçå°è£
|
| | | import axios from 'axios' |
| | | // eslint-disable-next-line camelcase |
| | | let is_baseURL = 'http://localhost:7070/'//æµè¯ç¯å¢ |
| | | //å建axioså®ä¾ |
| | | const request = axios.create({ |
| | |
| | | </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> |
| | |
| | | </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> |
| | |
| | | pageSize:10, |
| | | totalnotice:0, //éç¥å
¬åæ°é»çæ»æ¡æ° |
| | | totalschool:0, //å¦é¢å¨ææ°é»çæ»æ¡æ° |
| | | totalwork:0, //å·¥ä½å¨ææ°é»çæ»æ¡æ° |
| | | totalwork: 0 //å·¥ä½å¨ææ°é»çæ»æ¡æ° |
| | | } |
| | | }, |
| | | mounted(){ |
| | | this.getnotice(); |
| | | this.getwork(); |
| | | this.getschool(); |
| | | this.getnotice() |
| | | this.getwork() |
| | | this.getschool() |
| | | }, |
| | | methods: { |
| | | //éç¥å
¬åçå页忢 |
| | | handleCurrentChange1(val){ |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPagenotice = val; |
| | | this.getnotice(); |
| | | this.currentPagenotice = val |
| | | this.getnotice() |
| | | }, |
| | | //å¦é¢å¨æçå页忢 |
| | | handleCurrentChange2(val){ |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPageschool = val; |
| | | this.getschool(); |
| | | this.currentPageschool = val |
| | | this.getschool() |
| | | }, |
| | | //å·¥ä½å¨æçå页忢 |
| | | handleCurrentChange3(val){ |
| | | // console.log(`å½å页: ${val}`); |
| | | this.currentPagework = val; |
| | | this.getwork(); |
| | | this.currentPagework = val |
| | | this.getwork() |
| | | }, |
| | | //è·åæ°é»å表 |
| | | getnotice(){ |
| | |
| | | newsCategoryId:42, |
| | | size:this.pageSize |
| | | } |
| | | getNewsList(data).then(res => { |
| | | 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); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | getwork(){ |
| | |
| | | newsCategoryId:43, |
| | | size:this.pageSize |
| | | } |
| | | getNewsList(data).then(res => { |
| | | 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); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | getschool(){ |
| | |
| | | newsCategoryId:44, |
| | | size:this.pageSize |
| | | } |
| | | getNewsList(data).then(res => { |
| | | 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); |
| | | }) |
| | | .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() |
| | |
| | | <!-- éç¥å
¬åå¯¼èªæ¡ --> |
| | | <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;"> |
| | |
| | | name: 'notice', |
| | | data() { |
| | | return { |
| | | noticeList: [], |
| | | noticeList: [] |
| | | } |
| | | }, |
| | | created() { |
| | | }, |
| | | created() {}, |
| | | mounted(){ |
| | | //è·åå°æ é¢ |
| | | // axios.get('http://localhost:8080/news_category/list/1').then(res => { |
| | |
| | | newsCategoryId:42, |
| | | size:6 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | this.noticeList = res.data.records |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | // å»å°æ°é»å±ç¤ºé¡µ |
| | |
| | | this.$router.push({ |
| | | path: '/home/news', |
| | | query: { |
| | | id:id, |
| | | id: id |
| | | } |
| | | }) |
| | | }, |
| | |
| | | .bg2 { |
| | | background: url('../assets/wbbg.png') no-repeat 20px 50px; |
| | | } |
| | | .bg,.bg2 { |
| | | .bg, |
| | | .bg2 { |
| | | position: relative; |
| | | height: 120px; |
| | | } |
| | |
| | | <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> |
| | |
| | | name: 'school', |
| | | data() { |
| | | return { |
| | | schoolList: [], |
| | | schoolList: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | newsCategoryId:44, |
| | | size:6 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | this.schoolList = res.data.records |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | //å徿´å¤ä¿¡æ¯é¡µé¢ |
| | |
| | | this.$router.push({ |
| | | path:'moreMessage', |
| | | query:{ |
| | | type:val, |
| | | type: val |
| | | } |
| | | }) |
| | | }, |
| | |
| | | <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> |
| | |
| | | name:'work', |
| | | data(){ |
| | | return{ |
| | | workList: [], |
| | | workList: [] |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | newsCategoryId:43, |
| | | size:6 |
| | | } |
| | | getNewsList(data).then(res => { |
| | | console.log(res); |
| | | getNewsList(data) |
| | | .then(res => { |
| | | console.log(res) |
| | | if(res.code == 200){ |
| | | this.workList = res.data.records |
| | | } |
| | | }).catch(error => { |
| | | console.log(error); |
| | | }) |
| | | .catch(error => { |
| | | console.log(error) |
| | | }) |
| | | }, |
| | | toWorkMsg(id) { |
| | | this.$router.push({ |
| | | path:'/home/news', |
| | | query: { |
| | | id:id, |
| | | id: id |
| | | } |
| | | }) |
| | | }, |
| | |
| | | this.$router.push({ |
| | | path:'moreMessage', |
| | | query:{ |
| | | type:val, |
| | | type: val |
| | | } |
| | | }) |
| | | } |