diff --git a/kcui/src/App.vue b/kcui/src/App.vue index c430a8d..347d028 100644 --- a/kcui/src/App.vue +++ b/kcui/src/App.vue @@ -31,4 +31,32 @@ html{ padding: 0; height: 100%; } +.el-pager li { + padding: 0 !important; + background: transparent !important; + font-size: 12px; + min-width: 35.5px; + height: 28px; + line-height: 28px; + -webkit-box-sizing: border-box; + box-sizing: border-box; + text-align: center; + margin: 0px 0px !important; + border-radius: 0px !important; + border: 1px solid #018ffd; + color: #FFFFFF !important; +} +.el-pagination.is-background .btn-next, .el-pagination.is-background .btn-prev{ + background-color: transparent !important; + color: #FFFFFF !important; + border: 1px solid #018ffd; + margin: 0 1vw !important; +} +.el-pagination.is-background .el-pager li:not(.disabled):hover { + color: #1fe5ff !important;; +} + +.el-pagination.is-background .el-pager li:not(.disabled).active { + background-color: #018ffd !important; +} diff --git a/kcui/src/components/Pagination/index.vue b/kcui/src/components/Pagination/index.vue new file mode 100644 index 0000000..ced8e5f --- /dev/null +++ b/kcui/src/components/Pagination/index.vue @@ -0,0 +1,114 @@ + + + + + diff --git a/kcui/src/main.js b/kcui/src/main.js index ea78db1..cbe5d15 100644 --- a/kcui/src/main.js +++ b/kcui/src/main.js @@ -5,8 +5,8 @@ import ElementUI from 'element-ui'; import 'element-ui/lib/theme-chalk/index.css'; import router from '../src/router/router.js' - - +import pageInfo from "@/components/Pagination"; +Vue.component('pageInfo', pageInfo) Vue.config.productionTip = false Vue.use(ElementUI); diff --git a/kcui/src/utils/scroll-to.js b/kcui/src/utils/scroll-to.js new file mode 100644 index 0000000..c5d8e04 --- /dev/null +++ b/kcui/src/utils/scroll-to.js @@ -0,0 +1,58 @@ +Math.easeInOutQuad = function(t, b, c, d) { + t /= d / 2 + if (t < 1) { + return c / 2 * t * t + b + } + t-- + return -c / 2 * (t * (t - 2) - 1) + b +} + +// requestAnimationFrame for Smart Animating http://goo.gl/sx5sts +var requestAnimFrame = (function() { + return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || function(callback) { window.setTimeout(callback, 1000 / 60) } +})() + +/** + * Because it's so fucking difficult to detect the scrolling element, just move them all + * @param {number} amount + */ +function move(amount) { + document.documentElement.scrollTop = amount + document.body.parentNode.scrollTop = amount + document.body.scrollTop = amount +} + +function position() { + return document.documentElement.scrollTop || document.body.parentNode.scrollTop || document.body.scrollTop +} + +/** + * @param {number} to + * @param {number} duration + * @param {Function} callback + */ +export function scrollTo(to, duration, callback) { + const start = position() + const change = to - start + const increment = 20 + let currentTime = 0 + duration = (typeof (duration) === 'undefined') ? 500 : duration + var animateScroll = function() { + // increment the time + currentTime += increment + // find the value with the quadratic in-out easing function + var val = Math.easeInOutQuad(currentTime, start, change, duration) + // move the document.body + move(val) + // do the animation unless its over + if (currentTime < duration) { + requestAnimFrame(animateScroll) + } else { + if (callback && typeof (callback) === 'function') { + // the animation is done so lets callback + callback() + } + } + } + animateScroll() +} diff --git a/kcui/src/view/DhInfo.vue b/kcui/src/view/DhInfo.vue index 68aeaef..585bcfe 100644 --- a/kcui/src/view/DhInfo.vue +++ b/kcui/src/view/DhInfo.vue @@ -62,7 +62,7 @@ -
+
{{ item }}
@@ -75,8 +75,8 @@
序号
-
标题
-
详情
+
标题
+
详情
操作
@@ -86,8 +86,8 @@
序号
-
标题
-
详情
+
标题
+
详情
@@ -95,37 +95,35 @@
-
{{ item.id }}
-
{{ item.name }}
-
+
{{ item.id }}
+
{{ item.name }}
+
点击查看详情
-
{{ item.id }}
-
{{ item.name }}
-
+
{{ item.id }}
+
{{ item.name }}
+
点击查看详情
-
修改
-
删除
+ style="width: 10%;text-decoration: underline;font-style: italic;display: flex;justify-content: space-around;"> +
修改
-
...
-
- -
- {{ item }} -
-
-
...
+
@@ -138,26 +136,48 @@ - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + + @@ -176,13 +196,11 @@ import headInfo from '@/components/Head.vue'; import Foot from "@/components/Foot.vue"; import {editInfo, getDhList, getInfo} from "@/api/kcInfo"; -import Editor from "@/components/Editor.vue"; export default { // eslint-disable-next-line vue/multi-word-component-names name: 'DhInfo', components: { - Editor, Foot, headInfo }, data() { @@ -213,13 +231,17 @@ export default { form: { - name: "", - contentInfo: "", + dwType:"", + dhParam: { + fjlx:"", + rwlx:"", + zhlx:"", + fs:"", + njd:"", + sd:"", + }, }, - TxtValue: "", id: 0, - fileList: [], // 已上传文件列表 - isUpload:0, } }, @@ -237,16 +259,10 @@ export default { } this.getContentList(); }, - choosePage(item) { - console.log(item); - this.pageNum = item; - this.getContentList(); - }, getContentList() { - console.log("djaksjdklajsdk") var data = { name: this.selectName, - dhType: this.dhType, + dwType: this.dhType, pageNum: this.pageNum, pageSize: this.pageSize } @@ -257,46 +273,12 @@ export default { this.contentList = res.data.list; this.total = res.data.total; this.totalPage = res.data.totalPages; - - var aaa = 0; - this.onePagesList = []; - this.pagesList = []; - if (this.totalPage > 3) { - if (this.pageNum < this.totalPage - 3) { - - for (let i = this.pageNum; i <= this.totalPage; i++) { - this.pagesList.push(i); - this.onePagesList.push(i); - aaa = aaa + 1; - console.log(aaa); - if (aaa == 4) { - break; - } - } - } - } else { - for (let i = 1; i <= this.totalPage; i++) { - - this.pagesList.push(i); - this.onePagesList.push(i); - aaa = aaa + 1; - console.log(aaa); - if (aaa == 3) { - break; - } - } - } } }else { if(res.msg=="token无效") localStorage.clear(); this.$router.push('/') } - - - - - }) }, goXq(id) { @@ -308,104 +290,36 @@ export default { }) }, - - //管理员操作 - deleteTw() { - console.log("这是删除操作") - }, - editTw(id) { + editDh(id) { //展示出一个修改的弹窗 var data = { id: id } getInfo(data).then((res) => { - + var dhParam = JSON.parse(res.data.data.dwUrl) this.openInfo = true; - this.form.contentInfo = res.data.data.contentInfo - this.form.name = res.data.data.name - this.TxtValue = res.data.data.contentInfo; + this.form.name = res.data.data.name; + this.form.dwType = res.data.data.dwType; + this.form.dhParam.fjlx = dhParam.fjlx; + this.form.dhParam.rwlx = dhParam.rwlx; + this.form.dhParam.zhlx = dhParam.zhlx; + this.form.dhParam.fs = dhParam.fs; + this.form.dhParam.njd = dhParam.njd; + this.form.dhParam.sd = dhParam.sd; this.id = id; - var imgs = res.data.data.imgList; - console.log(imgs) - - for (let j = 0; j < imgs.length; j++) { - var ii = { - uuid:imgs[j].imgId, - url:imgs[j].imgUrl - } - this.fileList.push(ii) - } - - console.log(res); - }) }, - - //照片墙 - // 处理图片移除 - handleRemove(file, fileList) { - console.log('File removed:', file); - console.log('Current fileList:', fileList); - }, - // 当超过限制时触发 - handleExceed(files, fileList) { - this.$message.warning(`当前限制选择 9 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); - }, - // 在上传前进行校验 - beforeUpload(file) { - const isJPGorPNG = file.type === 'image/jpeg' || file.type === 'image/png'; - const isLt2M = file.size / 1024 / 1024 < 10; // 限制大小不超过2MB - - if (!isJPGorPNG) { - this.$message.error('上传图片只能是 JPG/PNG 格式!'); - } - if (!isLt2M) { - this.$message.error('上传图片大小不能超过 2MB!'); - } - return isJPGorPNG && isLt2M; - }, - // 上传成功后的回调 - handleSuccess(response, file, fileList) { - - console.log('Upload success:', response); - // 更新 fileList,确保新上传的文件被正确添加到列表中 - console.log(fileList) - this.fileList = fileList; - this.isUpload = 1; - }, - // 上传失败后的回调 - // eslint-disable-next-line no-unused-vars - handleError(err, file, fileList) { - console.log('Upload error:', err); - this.$message.error('上传失败,请重试!'); - }, submitInfo() { - console.log(this.fileList); - var urlStr = ""; - for (let f = 0; f < this.fileList.length; f++) { - if (f == 0) { - if(this.fileList[f].response!=null){ - urlStr = this.fileList[f].response.data.url - }else { - urlStr = this.fileList[f].url - } - - } else { - if(this.fileList[f].response!=null){ - urlStr = urlStr + "," + this.fileList[f].response.data.url - }else { - urlStr = urlStr + "," + this.fileList[f].url - } - - } - } + var dhParamInfo = JSON.stringify(this.form.dhParam); var data = { name: this.form.name, - contentInfo: this.TxtValue, - imgs: urlStr, - id: this.id + id: this.id, + type: 3, + dwType: this.form.dwType, + dwUrl:dhParamInfo, + } editInfo(data).then((res) => { console.log(res); @@ -540,16 +454,15 @@ export default { } .pageList { - height: 1.5vw; - width: 20%; - //background-color: pink; - margin: 1% 40%; + height: 2vw; + width: 100%; position: absolute; z-index: 2; - bottom: -0.5%; + bottom: 0.2vw; display: flex; flex-direction: row; - color: #ffffff; + justify-content: center; + } .password-input-container { diff --git a/kcui/src/view/Graph.vue b/kcui/src/view/Graph.vue index fbbd4bf..a425723 100644 --- a/kcui/src/view/Graph.vue +++ b/kcui/src/view/Graph.vue @@ -300,6 +300,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -342,6 +377,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -502,7 +568,7 @@