From 21fcd260e5e58829c3425a5c316ee3c2767af21d Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 08:52:56 +0800 Subject: [PATCH 01/13] 1 --- manifest.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifest.json b/manifest.json index 2d21d1f..98c10e0 100644 --- a/manifest.json +++ b/manifest.json @@ -135,8 +135,8 @@ "https" : false, "proxy" : { "/HiatmpPro" : { - // "target" : "http://49.235.207.167:8800", - "target" : "http://219.147.31.25:30001/tht-app-api", + "target" : "http://49.235.207.167:8800", + // "target" : "http://219.147.31.25:30001/tht-app-api", "changeOrigin" : true, "secure" : false, "pathRewrite" : { From cd9e99ecb364d179d93a9a0141c41162058c2aba Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 10:47:17 +0800 Subject: [PATCH 02/13] 1 --- components/mp-html/parser.js | 3 +- .../zeroMarkdownView/zeroMarkdownView.vue | 392 ++++++++++-------- 2 files changed, 215 insertions(+), 180 deletions(-) diff --git a/components/mp-html/parser.js b/components/mp-html/parser.js index e2e7a87..66c9bc5 100644 --- a/components/mp-html/parser.js +++ b/components/mp-html/parser.js @@ -979,7 +979,8 @@ Parser.prototype.popNode = function () { const table = Object.assign({}, node) node.name = 'div' node.attrs = { - style: 'overflow:auto' + style: 'overflow:auto', + class: 'scrollbar-container' } node.children = [table] attrs = table.attrs diff --git a/components/zeroMarkdownView/zeroMarkdownView.vue b/components/zeroMarkdownView/zeroMarkdownView.vue index 9e77cad..5873618 100644 --- a/components/zeroMarkdownView/zeroMarkdownView.vue +++ b/components/zeroMarkdownView/zeroMarkdownView.vue @@ -1,180 +1,214 @@ - - - - - \ No newline at end of file From 5e02cb516a8e4f9680448bc9d5885c3e4b9a50b4 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 13:44:21 +0800 Subject: [PATCH 03/13] =?UTF-8?q?=E7=9F=A5=E8=AF=86=E5=BA=93=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/zeroMarkdownView/zeroMarkdownView.vue | 13 +++++-------- pages/knowledge/index.vue | 8 +++++--- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/components/zeroMarkdownView/zeroMarkdownView.vue b/components/zeroMarkdownView/zeroMarkdownView.vue index 5873618..93fc706 100644 --- a/components/zeroMarkdownView/zeroMarkdownView.vue +++ b/components/zeroMarkdownView/zeroMarkdownView.vue @@ -186,27 +186,24 @@ // } /* 设置滚动条的宽度和背景色 */ /deep/ .scrollbar-container::-webkit-scrollbar { + display: block!important; width: 3px!important; /* 滚动条宽度 */ height: 3px!important; /* 对于垂直滚动条,设置高度 */ - background-color: #f9f9f9!important; /* 滚动条背景色 */ + background-color: #ffffff!important; /* 滚动条背景色 */ } /* 设置滚动条滑块的样式 */ /deep/ .scrollbar-container::-webkit-scrollbar-thumb { border-radius: 10px; /* 滑块圆角 */ - background-color: #c1c1c1; /* 滑块颜色 */ + background-color: #cccccc; /* 滑块颜色 */ } - /* 设置滚动条滑块hover样式 */ - /deep/ .scrollbar-container::-webkit-scrollbar-thumb:hover { - background-color: #a8a8a8; /* 滑块hover颜色 */ - } /* 设置滚动条轨道的样式 */ /deep/ .scrollbar-container::-webkit-scrollbar-track { border-radius: 10px; /* 轨道圆角 */ - box-shadow: inset 0 0 5px grey; /* 轨道阴影 */ - background-color: #f0f0f0; /* 轨道颜色 */ + box-shadow: inset 0 0 0px grey; /* 轨道阴影 */ + background-color: rgba(255,255,255,0); /* 轨道颜色 */ } /deep/ .md-table { margin-bottom: 10rpx!important; diff --git a/pages/knowledge/index.vue b/pages/knowledge/index.vue index 13ca5a5..b355dcd 100644 --- a/pages/knowledge/index.vue +++ b/pages/knowledge/index.vue @@ -50,7 +50,7 @@ - + @@ -279,8 +279,10 @@ } }, - handlePlus() { - this.isExpanded = !this.isExpanded; + handlePlus() { + this.$.toast("此功能暂不开放"); + + // this.isExpanded = !this.isExpanded; }, clickContent() { if (this.isExpanded) { From 5f03690545c9ee17fdb964e87a6f9d62809a4d65 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 13:52:58 +0800 Subject: [PATCH 04/13] 1 --- components/zeroMarkdownView/zeroMarkdownView.vue | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/components/zeroMarkdownView/zeroMarkdownView.vue b/components/zeroMarkdownView/zeroMarkdownView.vue index 93fc706..3599da4 100644 --- a/components/zeroMarkdownView/zeroMarkdownView.vue +++ b/components/zeroMarkdownView/zeroMarkdownView.vue @@ -208,4 +208,13 @@ /deep/ .md-table { margin-bottom: 10rpx!important; } + /deep/ .md-td { + white-space: nowrap; + text-align: center; + } + /deep/ .md-th { + white-space: nowrap; + text-align: center; + } + \ No newline at end of file From 8a4c86fe3196914dc67ed9c9a269328f16d87c91 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 14:59:46 +0800 Subject: [PATCH 05/13] 1 --- pages/knowledge/index.vue | 1984 +++++++++++++++++++------------------ 1 file changed, 1040 insertions(+), 944 deletions(-) diff --git a/pages/knowledge/index.vue b/pages/knowledge/index.vue index b355dcd..9900e95 100644 --- a/pages/knowledge/index.vue +++ b/pages/knowledge/index.vue @@ -1,946 +1,1042 @@ - - - - - + + // this.isExpanded = !this.isExpanded; + }, + clickContent() { + if (this.isExpanded) { + this.isExpanded = !this.isExpanded; + } + }, + goToKnowledge() { + uni.navigateTo({ + url: `/pages/home/detail?params=${encodeURIComponent( + JSON.stringify(item) + )}`, + }); + }, + + // 选择图片 + chooseImage() { + uni.chooseImage({ + count: 6, //默认9 + sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 + sourceType: ["album"], //从相册选择 + success: async (res) => { + console.log(res); + if (res.tempFilePaths && res.tempFilePaths.length) { + let str = ""; + let jsonArr = []; + for (let i = 0; i < res.tempFilePaths.length; i++) { + const result = await this.uploadFilePromise(res.tempFilePaths[i]); + let json = JSON.parse(result); + str += `![图${i + 1}](${json.result})`; + jsonArr.push(json.result); + } + + console.log(str); + if (this.id == 12121212) { + this.changeMsgList("0", str); + this.queryChat(jsonArr); + } else { + // this.addQuestion(str, "0"); + // this.SSE(jsonArr, "0"); + this.changeMsgList("0", str); + let j = jsonArr.join(',') + this.queryChat(j); + } + } + }, + }); + }, + uploadFilePromise(url) { + return new Promise((resolve, reject) => { + let a = uni.uploadFile({ + url: this.$.baseUrl + "/hiddenDanger/ftp/uploadFileToFtp", // 仅为示例,非真实的接口地址 + filePath: url, + name: "file", + success: (res) => { + resolve(res.data); + }, + }); + }); + }, + }, + // methods: { + // // 建立SSE长连接 + // SSE(voiceText, answerId) { + // const ctrl = new AbortController(); + // console.log(ctrl.signal); + // fetchEventSource($.chatUrl + "/chat", { + // method: "POST", + // headers: { + // "Content-Type": "application/json", + // Accept: ["text/event-stream", "application/json"], + // }, + // body: JSON.stringify({ + // voiceText, + // deptId: "3702000000", + // id: "37020017407", + // multiType: "", + // sceneFlag: "", + // stream: true, + // type: "0", + // userId: "admin1", + // }), + // signal: ctrl.signal, + // openWhenHidden: true, + // onopen: () => {}, + // onmessage: (ev) => { + // console.log(ev); + // this.loading = true; + // const res = JSON.parse(ev.data); + // if (res?.code == 200 && res.result) { + // console.log(res.result.data.tabkey); + // console.log(res.result.data); + // this.tabkey = res.result.data.tabkey; + // if (this.tabkey - 1 != this.active) { + // this.active = this.tabkey - 1 > 0 ? this.tabkey - 1 : 0; + // } + // if (this.msgList.length == 0) { + // this.msgList = [ + // { + // answerId, + // data: res.result.data.content, + // }, + // ]; + // } else { + // // debugger + // //回答 + // if (this.msgList[this.msgList.length - 1].answerId == "1") { + // //最后一个是回答 + // this.msgList[this.msgList.length - 1].data += + // res.result.data.content; + // } else { + // //最后一个是问题 + // this.msgList = [ + // ...this.msgList, + // { + // answerId: "1", + // data: res.result.data.content, + // }, + // ]; + // } + // } + + // // debugger + + // this.scrollBottom(); + // } + // }, + // onclose: () => { + // console.log(1111); + // this.loading = false; + + // if (this.isExpanded) { + // this.isExpanded = !this.isExpanded; + // } + // }, + // onerror(error) { + // console.log("error", error); + // throw error; + // }, + // }); + // }, + + // async queryChat(voiceText) { + + // // console.log(voiceText,"voiceText"); + // this.loading = true; + // const [err, res] = await uni.request({ + // // url: 'http://10.16.3.159:8777/api/local_doc_qa/local_doc_chat', + // url: $.chatUrl + "/chat", + // dataType: "json", + // method: "POST", + // // responseType: 'arraybuffer', + // headers: { + // // 'Accept': 'text/event-stream', + // "content-type": "application/json", + // }, + // data: { + // voiceText, + // sceneFlag: "", + // sessionId: this.sessionId, + // id: this.id, + // multiType: "", + // userId: "admin1", + // deptId: "3702000000", + // type: '0', + // stream: false, + // // "user_id": "zzp", + // // "kb_ids": ["KBa80ea15e786241eca70a20f136f4e34c"], + // // "question": "隐患排查流程是什么", + // // "streaming": true, + // // "history": [] + // }, + // }); + // if (res && res.data && res.data.code == 200) { + // // console.log('request success', res.data) + // const { result = {} } = res.data; + // const { data = {} } = result; + // if (data.tabkey - 1 != this.active) { + // this.active = data.tabkey - 1 > 0 ? data.tabkey - 1 : 0; + // } + // if (data.content) { + // this.changeMsgList( + // data.answerId || "1", + // data.content, + // data.answerOptions + // ); + // } + // this.loading = false; + // if (this.isExpanded) { + // this.isExpanded = !this.isExpanded; + // } + // } else { + // if (err) { + // console.log("request fail", err.errMsg); + // } + // uni.showToast({ + // title: "查询失败", + // icon: "error", + // duration: 2000, + // }); + // } + // }, + // // 输入框 + // onKeyInput(event) { + // this.inputValue = event.detail.value; + // }, + // addQuestion(q, answerId) { + // const newQuestion = { + // answerId, + // data: q, + // }; + // this.msgList.push(newQuestion); // 将问题添加到消息列表 + // // this.$store.commit('setMSg_List', this.msgList); + // this.scrollBottom(); + // }, + // scrollBottom() { + // this.$nextTick(() => { + // // const height = + // // this.$refs.scrollView && + // // this.$refs.scrollView.$refs && + // // this.$refs.scrollView.$refs.content + // // ? this.$refs.scrollView.$refs.content.scrollHeight + // // : 0; + // this.scrollTop = this.scrollTop + 1; + // }); + // }, + // // 发送 + // handleSend(text) { + // if (!this.inputValue & !text) { + // uni.showToast({ + // title: "请输入内容", + // icon: "closeempty", + // duration: 2000, + // }); + // } + // if (text || this.inputValue) { + // // if (this.params.id == 12121212) { + // this.changeMsgList("0", this.inputValue || text); + // this.queryChat(this.inputValue || text); + // this.scrollBottom(); + // // } else { + // // this.addQuestion(this.inputValue || text, "0"); + // // this.SSE(this.inputValue || text, "0"); + // // } + // this.inputValue = ""; + // } + // }, + // // 更新列表信息 + // changeMsgList(answerId, data, answerOptions) { + // let id = 1; + // if (this.msgList.length > 0) { + // id = this.msgList[this.msgList.length - 1].id + 1; + // } + // if (answerId == "1") { + // // 后台返回来的消息 + // let newdata = ""; + // let index = 0; + // const timer = setInterval(() => { + // newdata = newdata += data[index]; + // if (this.msgList?.filter((item) => item.id == id).length == 0) { + // this.msgList = [ + // ...this.msgList, + // { + // id, + // answerId, + // data: newdata, + // // options: answerOptions // ['东南西北','东北','东南北','东南西北'] answerOptions + // }, + // ]; + // } else { + // this.msgList[this.msgList.length - 1].data = newdata; + // } + // index += 1; + // this.scrollBottom(); + // if (newdata == data) { + // this.msgList[this.msgList.length - 1].options = answerOptions; + // clearInterval(timer); + // } + // }, 50); + // } else { + // this.msgList = [ + // ...this.msgList, + // { + // id, + // answerId, + // data, + // }, + // ]; + // this.scrollBottom(); + // } + // }, + + // handlePlus() { + // this.isExpanded = !this.isExpanded; + // }, + // // 快捷回复 + // handleBtn(text) { + // this.handleSend(text); + // }, + // clickContent() { + // if (this.isExpanded) { + // this.isExpanded = !this.isExpanded; + // } + // }, + // goToKnowledge() { + // uni.navigateTo({ + // url: "/pages/home/knowledge", + // // url: `/pages/home/knowledge?params=${encodeURIComponent(JSON.stringify(this.$route.query.params))}` + // }); + // }, + // // 选择图片 + // chooseImage() { + // uni.chooseImage({ + // count: 6, //默认9 + // sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有 + // sourceType: ["album"], //从相册选择 + // success: async (res) => { + // console.log(res) + // if (res.tempFilePaths && res.tempFilePaths.length) { + // let str = ""; + // let jsonArr = [] + // for (let i = 0; i < res.tempFilePaths.length; i++) { + // const result = await this.uploadFilePromise(res.tempFilePaths[i]); + // let json = JSON.parse(result) + // str += `![图${i + 1}](${json.result})`; + // jsonArr.push(json.result) + // } + + // console.log(str) + // if (this.id == 12121212) { + // this.changeMsgList("0", str); + // this.queryChat(jsonArr); + // } else { + // // this.addQuestion(str, "0"); + // // this.SSE(jsonArr, "0"); + // this.changeMsgList("0", str); + // this.queryChat(jsonArr); + // } + // } + // }, + // }); + // }, + // uploadFilePromise(url) { + // return new Promise((resolve, reject) => { + // let a = uni.uploadFile({ + // url: this.$.baseUrl + '/hiddenDanger/ftp/uploadFileToFtp', // 仅为示例,非真实的接口地址 + // filePath: url, + // name: 'file', + // success: (res) => { + // resolve(res.data) + // } + // }); + // }) + // }, + // }, + }; + + + \ No newline at end of file From 57b10998483a27e00cc15cd4458b651e17348d3b Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 16:39:23 +0800 Subject: [PATCH 06/13] 1 --- pages/investigation/index.vue | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/pages/investigation/index.vue b/pages/investigation/index.vue index 3fc9733..6d919b4 100644 --- a/pages/investigation/index.vue +++ b/pages/investigation/index.vue @@ -32,17 +32,17 @@ - + 全部 - + 人工上报 - + - + 系统下发 - + @@ -149,6 +149,13 @@ }, // 方法 methods: { + queryTypeChange(e) { + this.queryType = e + this.page = 1; + this.list = []; + this.isMore = true + this.getList() + }, handleTabClick(tab) { this.tab = tab; this.page = 1; @@ -157,11 +164,13 @@ switch (tab) { case 1: this.status = '10'; + this.queryType = null break; // case 2: // this.status = '20'; // break; case 3: + this.queryType = '1' this.status = '20'; break; } @@ -195,7 +204,7 @@ } this.loadmorestatus = 'loading' this.$request.globalRequest( - `/hiddenDanger/highDanger/getHigDangerDealt?pageNum=${this.page}&pageSize=${10}&search=${this.search}`, + `/hiddenDanger/highDanger/getHigDangerDealt?pageNum=${this.page}&pageSize=${10}&search=${this.search}&classificatio=${this.queryType}`, datas, 'POST') .then(res => { this.loadmorestatus = 'loadmore' @@ -394,7 +403,8 @@ width: calc(100% - 100rpx); padding: 0 50rpx; height: 108rpx; - .type-item{ + + .type-item { width: 28%; border-radius: 200rpx; height: 50rpx; @@ -404,9 +414,10 @@ border: #999999 solid 1rpx; margin-top: 15rpx; } - .type-active{ + + .type-active { border: #3c6dc3 solid 1rpx; - color:#3c6dc3; + color: #3c6dc3; } } } From b4664a626f17d6aed07aae96e99b53024ea438c7 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Mon, 5 Aug 2024 16:47:45 +0800 Subject: [PATCH 07/13] =?UTF-8?q?=E5=B7=B2=E5=AE=8C=E6=88=90=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/complete.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/pages/investigation/complete.vue b/pages/investigation/complete.vue index 01c4a99..654a858 100644 --- a/pages/investigation/complete.vue +++ b/pages/investigation/complete.vue @@ -2,7 +2,7 @@ - + @@ -310,6 +310,11 @@ // this.getList() }, + skipPage(){ + this.$.setData('pageStatus', 3) + this.$.setData('pageType', '3') + this.$.openTab('/pages/investigation/index') + }, initTroubleshootingData(id, index) { this.troubleshootingData[index].extraConfigs = [] this.$request From 21d60ea748c22e443a7a7e4ce38dbe7252404f0f Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 6 Aug 2024 09:45:56 +0800 Subject: [PATCH 08/13] 1 --- components/top-title.vue | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/components/top-title.vue b/components/top-title.vue index 267428d..9fea94d 100644 --- a/components/top-title.vue +++ b/components/top-title.vue @@ -36,7 +36,12 @@ export default { isShowLeft: { type: Boolean, default: true, - }, + }, + // 是否自定义方法 + isCuMethod: { + type: Boolean, + default: false, + }, // 标题 title: { type: String, @@ -85,9 +90,14 @@ export default { return curPage }, // 返回 - backPage(){ + backPage(){ + if(this.isCuMethod){ + this.$emit('skipPage') + }else{ + this.$.back() + } // this.$emit('backPage') - this.$.back() + }, // 跳转页面 skipPage(item) { From 63fcdd2a696e462dae7cc7a2ea09145b01d0e081 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 6 Aug 2024 14:09:26 +0800 Subject: [PATCH 09/13] 1 --- common/globalJs/request.js | 923 +++++++++++++++++----------------- components/no-data.vue | 4 +- pages/index/detail.vue | 2 +- pages/index/index.vue | 6 +- pages/investigation/index.vue | 17 +- pages/logIn/logIn.vue | 644 +++++++++++++----------- pages/mine/index.vue | 24 +- pages/mine/password.vue | 355 +++++++------ 8 files changed, 1031 insertions(+), 944 deletions(-) diff --git a/common/globalJs/request.js b/common/globalJs/request.js index f631c22..de684b1 100644 --- a/common/globalJs/request.js +++ b/common/globalJs/request.js @@ -1,459 +1,464 @@ -/** - * 请求封装 - */ -import $ from "./globalJs"; -const tokenKey = "token"; -const tokenKeyValue = ""; - -class Request { - constructor(config = {}) { - this.config = {}; - this.config.baseUrl = config.baseUrl ? config.baseUrl : ""; - this.config.dataType = config.dataType ? config.dataType : "json"; - this.config.responseType = config.responseType - ? config.responseType - : "text"; - this.config.header = config.header ? config.header : {}; - this.reqInterceptors = null; - this.resInterceptors = null; - this.interceptors = { - request: (fn) => { - this.reqInterceptors = fn; - }, - response: (fn) => { - this.resInterceptors = fn; - }, - }; - } - setConfig(config = {}) { - this.config = this._deepCopy(this._merge(this.config, config)); - } - // 请求封装 - globalRequest(url, config, method, isForm = "") { - const _this = this; - let newConfig = this._deepCopy(this._merge(this.config, config)); - let lastConfig = {}; - if (this.reqInterceptors && typeof this.reqInterceptors === "function") { - let reqInterceptors = this.reqInterceptors(newConfig); - if (!reqInterceptors && process.env.NODE_ENV === "development") { - console.log("请求被拦截,此消息仅在开发环境显示。"); - return false; - } else if ( - Object.prototype.toString.call(reqInterceptors) === "[object Promise]" - ) { - return reqInterceptors; - } - lastConfig = this._deepCopy(reqInterceptors); - } else { - lastConfig = this._deepCopy(newConfig); - } - let header = {}; - let tokenData = $.getData("token"); - if (tokenData) { - header[tokenKey] = tokenKeyValue + tokenData; - } - if (isForm) { - header["content-type"] = "application/x-www-form-urlencoded"; - } - let fullUrl = this._formatUrl(lastConfig.baseUrl, url); - if (url.indexOf("http") != -1) { - fullUrl = url; - } - return new Promise((resolve, reject) => { - uni.request({ - url: fullUrl, - method: method, - data: config, - header: header, - async complete(response) { - let res = response; - if (response.statusCode == 404) { - $.toast("请求地址不存在"); - } else if (response.statusCode == 500) { - $.toast("服务器内部错误"); - } else { - console.log("response", response.statusCode); - let res = response; - if ( - _this.resInterceptors && - typeof _this.resInterceptors === "function" - ) { - let resInterceptors = _this.resInterceptors(res); - // console.log('resInterceptors-----------------',resInterceptors) - if ( - resInterceptors.statusCode == 401 || - resInterceptors.data.code == 403 - ) { - $.toast("登录信息已过期,请重新登录"); - $.removeData("token"); - setTimeout(() => { - $.openNew("/pages/logIn/logIn"); - }, 1500); - return; - } else if (resInterceptors.statusCode != 200) { - $.toast(resInterceptors.data.message); - } - if (!resInterceptors && resInterceptors != "") { - reject("返回值已被您拦截!"); - return; - } else if ( - Object.prototype.toString.call(resInterceptors) === - "[object Promise]" - ) { - try { - let promiseRes = await resInterceptors; - resolve(promiseRes); - } catch (error) { - reject(error); - } - } else { - res = resInterceptors; - } - } - } - resolve(res.data); - }, - }); - }); - } - - addFile(file, success, progress) { - const _this = this; - let newConfig = this._deepCopy(this._merge(this.config, {})); - let lastConfig = {}; - if (this.reqInterceptors && typeof this.reqInterceptors === "function") { - let reqInterceptors = this.reqInterceptors(newConfig); - if (!reqInterceptors && process.env.NODE_ENV === "development") { - console.log("请求被拦截,此消息仅在开发环境显示。"); - return false; - } else if ( - Object.prototype.toString.call(reqInterceptors) === "[object Promise]" - ) { - return reqInterceptors; - } - lastConfig = this._deepCopy(reqInterceptors); - } else { - lastConfig = this._deepCopy(newConfig); - } - let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); - let header = { - // 'content-Type':'multipart/form-data' - }; - return new Promise((resolve, reject) => { - const UploadTask = uni.uploadFile({ - url: fullUrl, - filePath: file[0].path, - header: header, - name: $.fileImgKey, - formData: {}, - async complete(response) { - let res = response; - if ( - _this.resInterceptors && - typeof _this.resInterceptors === "function" - ) { - let resInterceptors = _this.resInterceptors(res); - if (!resInterceptors && resInterceptors != "") { - reject("返回值已被您拦截!"); - return; - } else if ( - Object.prototype.toString.call(resInterceptors) === - "[object Promise]" - ) { - try { - let promiseRes = await resInterceptors; - resolve(promiseRes); - } catch (error) { - reject(error); - } - } else { - res = resInterceptors; - } - } - success(JSON.parse(res.data)); - }, - }); - // 监听上传进度 - if (progress) { - UploadTask.onProgressUpdate((res) => { - progress(res.progress); - }); - } - }); - } - - // 上传图片 - addImg(length = 1, success, progress, type = 1) { - // 获取本地图片的路径 - uni.chooseImage({ - count: length, - // original原图compressed压缩图 - sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有 - // camera相机album相册 - sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有 - success: (res) => { - // 显示上传动画 - $.showLoading("图片上传中..."); - var imgs; - imgs = res.tempFilePaths; - // #ifdef H5 - // 调用上传图片的函数 - // 处理多选 - // if (imgs.length > length) { - // imgs = imgs.slice(0, length); - // } - this.fileImg(imgs, 0, success, progress, type); - // #endif - // #ifdef APP - console.log("imgs", imgs); - // 将新添加的图片添加到imgs_arr中 - uni.compressImage({ - src: imgs[0], - quality: 60, // 仅对jpg有效 - success: (ress) => { - this.fileImg([ress.tempFilePath], 0, success, progress, type); - }, - fail: (err) => { - $.hideLoading("图片上传中..."); - }, - complete: (msg) => {}, - }); - // #endif - }, - complete: (err) => {}, - }); - } - fileImg(imgs, index, success, progress, type) { - const _this = this; - let newConfig = this._deepCopy(this._merge(this.config, {})); - let lastConfig = {}; - if (this.reqInterceptors && typeof this.reqInterceptors === "function") { - let reqInterceptors = this.reqInterceptors(newConfig); - if (!reqInterceptors && process.env.NODE_ENV === "development") { - console.log("请求被拦截,此消息仅在开发环境显示。"); - return false; - } else if ( - Object.prototype.toString.call(reqInterceptors) === "[object Promise]" - ) { - return reqInterceptors; - } - lastConfig = this._deepCopy(reqInterceptors); - } else { - lastConfig = this._deepCopy(newConfig); - } - let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); - if (type == 2) { - fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUserIdUrl); - } - let header = { - token: $.getData("token"), - }; - // 如果数组长度大于下标,说明没有上传完 - if (imgs.length > index) { - var src = imgs[index]; - return new Promise((resolve, reject) => { - const UploadTask = uni.uploadFile({ - url: fullUrl, - filePath: src, - header: header, - name: $.fileImgKey, - formData: {}, - async complete(response) { - let res = response; - if ( - _this.resInterceptors && - typeof _this.resInterceptors === "function" - ) { - let resInterceptors = _this.resInterceptors(res); - // console.log('resInterceptors',resInterceptors) - let datasJSON = JSON.parse(resInterceptors.data); - if (datasJSON.code == 1101) { - } - if (!resInterceptors && resInterceptors != "") { - reject("返回值已被您拦截!"); - return; - } else if ( - Object.prototype.toString.call(resInterceptors) === - "[object Promise]" - ) { - try { - let promiseRes = await resInterceptors; - resolve(promiseRes); - } catch (error) { - reject(error); - } - } else { - res = resInterceptors; - } - } - success(JSON.parse(res.data)); - _this.fileImg(imgs, index + 1, progress); - }, - }); - // 监听上传进度 - if (progress) { - UploadTask.onProgressUpdate((res) => { - progress(res.progress); - }); - } - }); - // #ifdef H5 - // 压缩 - // lrz(src, { - // quality: 0.7, - // }).then((rst) => { // fieldName 为 formData 中多媒体的字段名 - - // }) - // #endif - // #ifdef APP-PLUS - // #endif - } else { - $.hideLoading(); - } - } - - // 上传视频 - addVideo(url, success, progress) { - // 获取本地视频的路径 - uni.chooseVideo({ - sourceType: ["album", "camera"], // 选择方式 - success: (res) => { - if (res.size > $.videoSize) { - let size = parseInt($.videoSize / 1024000); - $.toast("上传视频过大,大小请不要超过" + size + "M"); - } else { - // 显示上传动画 - $.showLoading("视频上传中..."); - // 调用上传视频的函数 - this.fileVideo(res.tempFilePath, url, success, progress); - } - }, - fail: (res) => { - console.log(JSON.stringify(res)); - }, - }); - } - fileVideo(src, url, success, progress) { - const _this = this; - let newConfig = this._deepCopy(this._merge(this.config, {})); - let lastConfig = {}; - if (this.reqInterceptors && typeof this.reqInterceptors === "function") { - let reqInterceptors = this.reqInterceptors(newConfig); - if (!reqInterceptors && process.env.NODE_ENV === "development") { - console.log("请求被拦截,此消息仅在开发环境显示。"); - return false; - } else if ( - Object.prototype.toString.call(reqInterceptors) === "[object Promise]" - ) { - return reqInterceptors; - } - lastConfig = this._deepCopy(reqInterceptors); - } else { - lastConfig = this._deepCopy(newConfig); - } - let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); - //上传视频 - return new Promise((resolve, reject) => { - const UploadTask = uni.uploadFile({ - url: fullUrl, - filePath: src, - name: $.fileVideoKey, - async complete(response) { - let res = response; - if ( - _this.resInterceptors && - typeof _this.resInterceptors === "function" - ) { - let resInterceptors = _this.resInterceptors(res); - // console.log('resInterceptors',resInterceptors) - if (!resInterceptors && resInterceptors != "") { - reject("返回值已被您拦截!"); - return; - } else if ( - Object.prototype.toString.call(resInterceptors) === - "[object Promise]" - ) { - try { - let promiseRes = await resInterceptors; - resolve(promiseRes); - } catch (error) { - reject(error); - } - } else { - res = resInterceptors; - } - } - success(JSON.parse(res.data)); - $.hideLoading(); - }, - success: (res) => { - success(JSON.parse(res.data)); - // 关闭上传动画 - }, - fail: (e) => { - // 关闭上传动画 - $.hideLoading(); - $.toast("上传超时!"); - }, - }); - // 监听上传进度 - if (progress) { - UploadTask.onProgressUpdate((res) => { - progress(res.progress); - }); - } - }); - } - - _formatUrl(baseUrl, url) { - if (!baseUrl) return url; - let formatUrl = ""; - const baseUrlEndsWithSlash = baseUrl.endsWith("/"); - const urlStartsWithSlash = url.startsWith("/"); - if (baseUrlEndsWithSlash && urlStartsWithSlash) { - formatUrl = baseUrl + url.substring(1); - } else if (baseUrlEndsWithSlash || urlStartsWithSlash) { - formatUrl = baseUrl + url; - } else { - formatUrl = baseUrl + "/" + url; - } - return formatUrl; - } - _merge(oldConfig, newConfig) { - let mergeConfig = this._deepCopy(oldConfig); - if (!newConfig || !Object.keys(newConfig).length) return mergeConfig; - for (let key in newConfig) { - if (key !== "header") { - mergeConfig[key] = newConfig[key]; - } else { - if ( - Object.prototype.toString.call(newConfig[key]) === "[object Object]" - ) { - for (let headerKey in newConfig[key]) { - mergeConfig[key][headerKey] = newConfig[key][headerKey]; - } - } - } - } - return mergeConfig; - } - _deepCopy(obj) { - let result = Array.isArray(obj) ? [] : {}; - for (let key in obj) { - if (obj.hasOwnProperty(key)) { - if (typeof obj[key] === "object") { - result[key] = this._deepCopy(obj[key]); - } else { - result[key] = obj[key]; - } - } - } - return result; - } -} - -if (!global.$request) { - global.$request = new Request(); -} - -export default global.$request; +/** + * 请求封装 + */ +import $ from "./globalJs"; +const tokenKey = "token"; +const tokenKeyValue = ""; + +class Request { + constructor(config = {}) { + this.config = {}; + this.config.baseUrl = config.baseUrl ? config.baseUrl : ""; + this.config.dataType = config.dataType ? config.dataType : "json"; + this.config.responseType = config.responseType ? + config.responseType : + "text"; + this.config.header = config.header ? config.header : {}; + this.reqInterceptors = null; + this.resInterceptors = null; + this.interceptors = { + request: (fn) => { + this.reqInterceptors = fn; + }, + response: (fn) => { + this.resInterceptors = fn; + }, + }; + } + setConfig(config = {}) { + this.config = this._deepCopy(this._merge(this.config, config)); + } + // 请求封装 + globalRequest(url, config, method, isForm = "") { + const _this = this; + let newConfig = this._deepCopy(this._merge(this.config, config)); + let lastConfig = {}; + if (this.reqInterceptors && typeof this.reqInterceptors === "function") { + let reqInterceptors = this.reqInterceptors(newConfig); + if (!reqInterceptors && process.env.NODE_ENV === "development") { + console.log("请求被拦截,此消息仅在开发环境显示。"); + return false; + } else if ( + Object.prototype.toString.call(reqInterceptors) === "[object Promise]" + ) { + return reqInterceptors; + } + lastConfig = this._deepCopy(reqInterceptors); + } else { + lastConfig = this._deepCopy(newConfig); + } + let header = {}; + let tokenData = $.getData("token"); + if (tokenData) { + header[tokenKey] = tokenKeyValue + tokenData; + } + if (isForm) { + header["content-type"] = "application/x-www-form-urlencoded"; + } + let fullUrl = this._formatUrl(lastConfig.baseUrl, url); + if (url.indexOf("http") != -1) { + fullUrl = url; + } + return new Promise((resolve, reject) => { + uni.request({ + url: fullUrl, + method: method, + data: config, + header: header, + async complete(response) { + let res = response; + if ((response.errMsg == 'request:ok')) { + + if (response.statusCode == 404) { + $.toast("请求地址不存在"); + } else if (response.statusCode == 500) { + $.toast("服务器内部错误"); + } else { + // console.log("response", response.statusCode); + let res = response; + if ( + _this.resInterceptors && + typeof _this.resInterceptors === "function" + ) { + let resInterceptors = _this.resInterceptors(res); + // console.log('resInterceptors-----------------',resInterceptors) + if ( + resInterceptors.statusCode == 401 || + resInterceptors.data.code == 403 + ) { + $.toast("登录信息已过期,请重新登录"); + $.removeData("token"); + setTimeout(() => { + $.openNew("/pages/logIn/logIn"); + }, 1500); + return; + } else if (resInterceptors.statusCode != 200) { + $.toast(resInterceptors.data.message); + } + if (!resInterceptors && resInterceptors != "") { + reject("返回值已被您拦截!"); + return; + } else if ( + Object.prototype.toString.call(resInterceptors) === + "[object Promise]" + ) { + try { + let promiseRes = await resInterceptors; + resolve(promiseRes); + } catch (error) { + reject(error); + } + } else { + res = resInterceptors; + } + } + } + resolve(res.data); + }else{ + reject() + } + + }, + }); + }); + } + + addFile(file, success, progress) { + const _this = this; + let newConfig = this._deepCopy(this._merge(this.config, {})); + let lastConfig = {}; + if (this.reqInterceptors && typeof this.reqInterceptors === "function") { + let reqInterceptors = this.reqInterceptors(newConfig); + if (!reqInterceptors && process.env.NODE_ENV === "development") { + console.log("请求被拦截,此消息仅在开发环境显示。"); + return false; + } else if ( + Object.prototype.toString.call(reqInterceptors) === "[object Promise]" + ) { + return reqInterceptors; + } + lastConfig = this._deepCopy(reqInterceptors); + } else { + lastConfig = this._deepCopy(newConfig); + } + let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); + let header = { + // 'content-Type':'multipart/form-data' + }; + return new Promise((resolve, reject) => { + const UploadTask = uni.uploadFile({ + url: fullUrl, + filePath: file[0].path, + header: header, + name: $.fileImgKey, + formData: {}, + async complete(response) { + let res = response; + if ( + _this.resInterceptors && + typeof _this.resInterceptors === "function" + ) { + let resInterceptors = _this.resInterceptors(res); + if (!resInterceptors && resInterceptors != "") { + reject("返回值已被您拦截!"); + return; + } else if ( + Object.prototype.toString.call(resInterceptors) === + "[object Promise]" + ) { + try { + let promiseRes = await resInterceptors; + resolve(promiseRes); + } catch (error) { + reject(error); + } + } else { + res = resInterceptors; + } + } + success(JSON.parse(res.data)); + }, + }); + // 监听上传进度 + if (progress) { + UploadTask.onProgressUpdate((res) => { + progress(res.progress); + }); + } + }); + } + + // 上传图片 + addImg(length = 1, success, progress, type = 1) { + // 获取本地图片的路径 + uni.chooseImage({ + count: length, + // original原图compressed压缩图 + sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有 + // camera相机album相册 + sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有 + success: (res) => { + // 显示上传动画 + $.showLoading("图片上传中..."); + var imgs; + imgs = res.tempFilePaths; + // #ifdef H5 + // 调用上传图片的函数 + // 处理多选 + // if (imgs.length > length) { + // imgs = imgs.slice(0, length); + // } + this.fileImg(imgs, 0, success, progress, type); + // #endif + // #ifdef APP + console.log("imgs", imgs); + // 将新添加的图片添加到imgs_arr中 + uni.compressImage({ + src: imgs[0], + quality: 60, // 仅对jpg有效 + success: (ress) => { + this.fileImg([ress.tempFilePath], 0, success, progress, type); + }, + fail: (err) => { + $.hideLoading("图片上传中..."); + }, + complete: (msg) => {}, + }); + // #endif + }, + complete: (err) => {}, + }); + } + fileImg(imgs, index, success, progress, type) { + const _this = this; + let newConfig = this._deepCopy(this._merge(this.config, {})); + let lastConfig = {}; + if (this.reqInterceptors && typeof this.reqInterceptors === "function") { + let reqInterceptors = this.reqInterceptors(newConfig); + if (!reqInterceptors && process.env.NODE_ENV === "development") { + console.log("请求被拦截,此消息仅在开发环境显示。"); + return false; + } else if ( + Object.prototype.toString.call(reqInterceptors) === "[object Promise]" + ) { + return reqInterceptors; + } + lastConfig = this._deepCopy(reqInterceptors); + } else { + lastConfig = this._deepCopy(newConfig); + } + let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); + if (type == 2) { + fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUserIdUrl); + } + let header = { + token: $.getData("token"), + }; + // 如果数组长度大于下标,说明没有上传完 + if (imgs.length > index) { + var src = imgs[index]; + return new Promise((resolve, reject) => { + const UploadTask = uni.uploadFile({ + url: fullUrl, + filePath: src, + header: header, + name: $.fileImgKey, + formData: {}, + async complete(response) { + let res = response; + if ( + _this.resInterceptors && + typeof _this.resInterceptors === "function" + ) { + let resInterceptors = _this.resInterceptors(res); + // console.log('resInterceptors',resInterceptors) + let datasJSON = JSON.parse(resInterceptors.data); + if (datasJSON.code == 1101) {} + if (!resInterceptors && resInterceptors != "") { + reject("返回值已被您拦截!"); + return; + } else if ( + Object.prototype.toString.call(resInterceptors) === + "[object Promise]" + ) { + try { + let promiseRes = await resInterceptors; + resolve(promiseRes); + } catch (error) { + reject(error); + } + } else { + res = resInterceptors; + } + } + success(JSON.parse(res.data)); + _this.fileImg(imgs, index + 1, progress); + }, + }); + // 监听上传进度 + if (progress) { + UploadTask.onProgressUpdate((res) => { + progress(res.progress); + }); + } + }); + // #ifdef H5 + // 压缩 + // lrz(src, { + // quality: 0.7, + // }).then((rst) => { // fieldName 为 formData 中多媒体的字段名 + + // }) + // #endif + // #ifdef APP-PLUS + // #endif + } else { + $.hideLoading(); + } + } + + // 上传视频 + addVideo(url, success, progress) { + // 获取本地视频的路径 + uni.chooseVideo({ + sourceType: ["album", "camera"], // 选择方式 + success: (res) => { + if (res.size > $.videoSize) { + let size = parseInt($.videoSize / 1024000); + $.toast("上传视频过大,大小请不要超过" + size + "M"); + } else { + // 显示上传动画 + $.showLoading("视频上传中..."); + // 调用上传视频的函数 + this.fileVideo(res.tempFilePath, url, success, progress); + } + }, + fail: (res) => { + console.log(JSON.stringify(res)); + }, + }); + } + fileVideo(src, url, success, progress) { + const _this = this; + let newConfig = this._deepCopy(this._merge(this.config, {})); + let lastConfig = {}; + if (this.reqInterceptors && typeof this.reqInterceptors === "function") { + let reqInterceptors = this.reqInterceptors(newConfig); + if (!reqInterceptors && process.env.NODE_ENV === "development") { + console.log("请求被拦截,此消息仅在开发环境显示。"); + return false; + } else if ( + Object.prototype.toString.call(reqInterceptors) === "[object Promise]" + ) { + return reqInterceptors; + } + lastConfig = this._deepCopy(reqInterceptors); + } else { + lastConfig = this._deepCopy(newConfig); + } + let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); + //上传视频 + return new Promise((resolve, reject) => { + const UploadTask = uni.uploadFile({ + url: fullUrl, + filePath: src, + name: $.fileVideoKey, + async complete(response) { + let res = response; + if ( + _this.resInterceptors && + typeof _this.resInterceptors === "function" + ) { + let resInterceptors = _this.resInterceptors(res); + // console.log('resInterceptors',resInterceptors) + if (!resInterceptors && resInterceptors != "") { + reject("返回值已被您拦截!"); + return; + } else if ( + Object.prototype.toString.call(resInterceptors) === + "[object Promise]" + ) { + try { + let promiseRes = await resInterceptors; + resolve(promiseRes); + } catch (error) { + reject(error); + } + } else { + res = resInterceptors; + } + } + success(JSON.parse(res.data)); + $.hideLoading(); + }, + success: (res) => { + success(JSON.parse(res.data)); + // 关闭上传动画 + }, + fail: (e) => { + // 关闭上传动画 + $.hideLoading(); + $.toast("上传超时!"); + }, + }); + // 监听上传进度 + if (progress) { + UploadTask.onProgressUpdate((res) => { + progress(res.progress); + }); + } + }); + } + + _formatUrl(baseUrl, url) { + if (!baseUrl) return url; + let formatUrl = ""; + const baseUrlEndsWithSlash = baseUrl.endsWith("/"); + const urlStartsWithSlash = url.startsWith("/"); + if (baseUrlEndsWithSlash && urlStartsWithSlash) { + formatUrl = baseUrl + url.substring(1); + } else if (baseUrlEndsWithSlash || urlStartsWithSlash) { + formatUrl = baseUrl + url; + } else { + formatUrl = baseUrl + "/" + url; + } + return formatUrl; + } + _merge(oldConfig, newConfig) { + let mergeConfig = this._deepCopy(oldConfig); + if (!newConfig || !Object.keys(newConfig).length) return mergeConfig; + for (let key in newConfig) { + if (key !== "header") { + mergeConfig[key] = newConfig[key]; + } else { + if ( + Object.prototype.toString.call(newConfig[key]) === "[object Object]" + ) { + for (let headerKey in newConfig[key]) { + mergeConfig[key][headerKey] = newConfig[key][headerKey]; + } + } + } + } + return mergeConfig; + } + _deepCopy(obj) { + let result = Array.isArray(obj) ? [] : {}; + for (let key in obj) { + if (obj.hasOwnProperty(key)) { + if (typeof obj[key] === "object") { + result[key] = this._deepCopy(obj[key]); + } else { + result[key] = obj[key]; + } + } + } + return result; + } +} + +if (!global.$request) { + global.$request = new Request(); +} + +export default global.$request; \ No newline at end of file diff --git a/components/no-data.vue b/components/no-data.vue index b3cc468..a50668b 100644 --- a/components/no-data.vue +++ b/components/no-data.vue @@ -51,8 +51,8 @@ export default { - + + + + + + \ No newline at end of file diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 2d61da3..44c65f0 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -6,7 +6,7 @@ - {{ userInfo.realName || userInfo.username || '请登录'}} + {{ dataInfo.cusername || userInfo.username || '请登录'}} - - - + + + + @@ -59,9 +60,9 @@ - - - + \ No newline at end of file From f838d8bbb1d9cd10bf301d78d6cc5d4ce9470147 Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 6 Aug 2024 14:31:53 +0800 Subject: [PATCH 10/13] =?UTF-8?q?=E6=8E=92=E6=9F=A5=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/task.vue | 1 - pages/map/index.vue | 2187 +++++++++++++++++----------------- pages/mine/index.vue | 6 +- 3 files changed, 1097 insertions(+), 1097 deletions(-) diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index 1b9636a..f690c89 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -500,7 +500,6 @@ this.sectionCode = e.sectionCode this.name = e.taskName this.sectionName = e.sectionName - console.log(e) this.type = e.type; this.getBaseData(e.id); diff --git a/pages/map/index.vue b/pages/map/index.vue index f00b91a..7441b29 100644 --- a/pages/map/index.vue +++ b/pages/map/index.vue @@ -1,1095 +1,1094 @@ - - - - \ No newline at end of file diff --git a/pages/mine/index.vue b/pages/mine/index.vue index 44c65f0..c02a5ae 100644 --- a/pages/mine/index.vue +++ b/pages/mine/index.vue @@ -80,7 +80,7 @@ const base64Avatar ='data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYA timer: null, num: 0, dataInfo: {}, - tabbarShow: true + tabbarShow: true, // funcList: [ // { id:1,name:'个人信息',url:'/pages/logIn/userInfo',icon:'/mine/userinfo.png' }, // { id:2,name:'劳务保险',url:'/pages/mine/insurance',icon:'/mine/insurance.png' }, @@ -89,6 +89,7 @@ const base64Avatar ='data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYA // { id:5,name:'找活记录',url:'/pages/mine/jobfind',icon:'/mine/jobfind.png' }, // { id:6,name:'人员管理',url:'/pages/mine/worker',icon:'/mine/jobfind.png' }, // ] + } }, computed: { @@ -131,7 +132,8 @@ const base64Avatar ='data:image/jpeg;base64,iVBORw0KGgoAAAANSUhEUgAAACYAAAAmCAYA onHide() { // this.timer && clearInterval(this.timer) }, - onLoad() { + onLoad(e) { + }, methods: { From 1394352f6cf7547fb7f6422c7e95a44e5ecd0cdd Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 6 Aug 2024 16:12:31 +0800 Subject: [PATCH 11/13] =?UTF-8?q?=E9=87=8D=E7=82=B9=E6=8E=92=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/investigation/task.vue | 4 ++-- uni_modules/uview-ui/components/u-checkbox/props.js | 4 ++++ uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue | 7 +++++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pages/investigation/task.vue b/pages/investigation/task.vue index f690c89..038974e 100644 --- a/pages/investigation/task.vue +++ b/pages/investigation/task.vue @@ -270,7 +270,7 @@ {{ indexData + 1 }}. {{ itemData.length > 0 ? itemData[0].nname : '' }} - @@ -324,7 +324,7 @@ - diff --git a/uni_modules/uview-ui/components/u-checkbox/props.js b/uni_modules/uview-ui/components/u-checkbox/props.js index be1d842..7d21f68 100644 --- a/uni_modules/uview-ui/components/u-checkbox/props.js +++ b/uni_modules/uview-ui/components/u-checkbox/props.js @@ -4,6 +4,10 @@ export default { name: { type: [String, Number, Boolean], default: uni.$u.props.checkbox.name, + }, + isSel: { + type: [Boolean], + default:true, }, // item obj: { diff --git a/uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue b/uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue index b9f3d6b..920903c 100644 --- a/uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue +++ b/uni_modules/uview-ui/components/u-checkbox/u-checkbox.vue @@ -213,8 +213,11 @@ labelClickHandler(e) { this.preventEvent(e) // 如果按钮整体被禁用或者label被禁用,则不允许点击文字修改状态 - if (!this.elLabelDisabled && !this.elDisabled) { - this.setRadioCheckedStatus() + if (!this.elLabelDisabled && !this.elDisabled) { + if(this.isSel){ + this.setRadioCheckedStatus() + } + this.$emit('click', this.obj) } }, From 2893cfa8d36dfb693bb5152e04f1825abc11d0fb Mon Sep 17 00:00:00 2001 From: limingtao <@ming_tao_li> Date: Tue, 6 Aug 2024 19:25:37 +0800 Subject: [PATCH 12/13] 1 --- pages/investigation/index.vue | 25 +- pages/mine/password.vue | 30 +- uni_modules/uni-easyinput/changelog.md | 115 +++ .../components/uni-easyinput/common.js | 54 ++ .../uni-easyinput/uni-easyinput.vue | 676 ++++++++++++++++++ uni_modules/uni-easyinput/package.json | 88 +++ uni_modules/uni-easyinput/readme.md | 11 + .../components/uni-icons/uni-icons.uvue | 180 ++--- .../components/uni-icons/uni-icons.vue | 218 +++--- .../components/uni-icons/uniicons_file.ts | 36 +- .../components/uni-icons/uniicons_file_vue.js | 6 +- 11 files changed, 1194 insertions(+), 245 deletions(-) create mode 100644 uni_modules/uni-easyinput/changelog.md create mode 100644 uni_modules/uni-easyinput/components/uni-easyinput/common.js create mode 100644 uni_modules/uni-easyinput/components/uni-easyinput/uni-easyinput.vue create mode 100644 uni_modules/uni-easyinput/package.json create mode 100644 uni_modules/uni-easyinput/readme.md diff --git a/pages/investigation/index.vue b/pages/investigation/index.vue index 9009af4..35395e5 100644 --- a/pages/investigation/index.vue +++ b/pages/investigation/index.vue @@ -26,7 +26,7 @@ 正在办理 {{ totalData.InGovernance }} --> - + 已完成 {{ totalData.InGovernance }} @@ -125,8 +125,10 @@ // tabFun.tabbar() this.getData() let pageStatus = this.$.getData('pageStatus') - this.pageStatus = pageStatus this.queryType = this.$.getData('pageType') + this.pageStatus = pageStatus + console.log(this.$.getData('pageType')) + if (pageStatus == 1) { this.handleTabClick(1) this.$.setData('pageStatus', '0') @@ -157,7 +159,7 @@ this.isMore = true this.getList() }, - handleTabClick(tab) { + handleTabClick(tab, falg = false) { this.tab = tab; this.page = 1; this.list = []; @@ -171,7 +173,10 @@ // this.status = '20'; // break; case 3: - this.queryType = '1' + if (falg) { + this.queryType = '1' + } + this.status = '20'; break; } @@ -224,11 +229,11 @@ } else { this.$.toast(res.message) } - if(this.status==10){ - this.$set(this.totalData,'UnderInvestigation',res.result.total) + if (this.status == 10) { + this.$set(this.totalData, 'UnderInvestigation', res.result.total) } - if(this.status==20){ - this.$set(this.totalData,'InGovernance',res.result.total) + if (this.status == 20) { + this.$set(this.totalData, 'InGovernance', res.result.total) } }).catch((err) => { this.loadmorestatus = 'nomore' @@ -250,7 +255,7 @@ '&deptId=' + row.handleDept + '&pcType=' + row.pcType + '&type=' + (this.tab == 1 ? 'edit' : 'view') + '§ionName=' + row.sectionName + - '§ionCode=' + row.sectionCode) + '§ionCode=' + row.sectionCode + '&taskName=' + row.name) // this.$.open('/pages/map/index?businessId=' + row.businessId) } @@ -438,7 +443,7 @@ } .Unit { - padding:20rpx 12rpx; + padding: 20rpx 12rpx; display: flex; justify-content: space-between; align-items: center; diff --git a/pages/mine/password.vue b/pages/mine/password.vue index a958b2f..249efeb 100644 --- a/pages/mine/password.vue +++ b/pages/mine/password.vue @@ -1,25 +1,25 @@