隐患问题处理

main
limingtao 11 months ago
parent 032d11cb83
commit 8dd59c2a1e
  1. 303
      common/globalJs/request.js
  2. 4
      pages/governance/index.vue
  3. 3
      pages/index/index.vue
  4. 16
      pages/investigation/components/investigation-item2.vue
  5. 2
      pages/investigation/index.vue
  6. 36
      pages/investigation/task.vue

@ -1,112 +1,134 @@
/** /**
* 请求封装 * 请求封装
*/ */
import $ from './globalJs' import $ from "./globalJs";
const tokenKey = 'token' const tokenKey = "token";
const tokenKeyValue = '' const tokenKeyValue = "";
class Request { class Request {
constructor(config = {}) { constructor(config = {}) {
this.config = {}; this.config = {};
this.config.baseUrl = config.baseUrl? config.baseUrl: ''; this.config.baseUrl = config.baseUrl ? config.baseUrl : "";
this.config.dataType = config.dataType? config.dataType: 'json'; this.config.dataType = config.dataType ? config.dataType : "json";
this.config.responseType = config.responseType? config.responseType: 'text'; this.config.responseType = config.responseType
this.config.header = config.header? config.header: {}; ? config.responseType
: "text";
this.config.header = config.header ? config.header : {};
this.reqInterceptors = null; this.reqInterceptors = null;
this.resInterceptors = null; this.resInterceptors = null;
this.interceptors = { this.interceptors = {
request: fn => { request: (fn) => {
this.reqInterceptors = fn; this.reqInterceptors = fn;
}, },
response: fn => { response: (fn) => {
this.resInterceptors = fn; this.resInterceptors = fn;
} },
} };
} }
setConfig(config = {}) { setConfig(config = {}) {
this.config = this._deepCopy(this._merge(this.config, config)); this.config = this._deepCopy(this._merge(this.config, config));
} }
// 请求封装 // 请求封装
globalRequest(url,config, method,isForm = '') { globalRequest(url, config, method, isForm = "") {
const _this = this; const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, config)); let newConfig = this._deepCopy(this._merge(this.config, config));
let lastConfig = {}; let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === 'function') { if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig); let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") { if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log('请求被拦截,此消息仅在开发环境显示。') console.log("请求被拦截,此消息仅在开发环境显示。");
return false; return false;
} else if (Object.prototype.toString.call(reqInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors; return reqInterceptors;
} }
lastConfig = this._deepCopy(reqInterceptors); lastConfig = this._deepCopy(reqInterceptors);
} else { } else {
lastConfig = this._deepCopy(newConfig); lastConfig = this._deepCopy(newConfig);
} }
let header = {} let header = {};
let tokenData = $.getData('token') let tokenData = $.getData("token");
if(tokenData){ if (tokenData) {
header[tokenKey] = tokenKeyValue + tokenData header[tokenKey] = tokenKeyValue + tokenData;
} }
if(isForm){ if (isForm) {
header['content-type'] = 'application/x-www-form-urlencoded' header["content-type"] = "application/x-www-form-urlencoded";
} }
let fullUrl = this._formatUrl(lastConfig.baseUrl, url); let fullUrl = this._formatUrl(lastConfig.baseUrl, url);
if(url.indexOf('http') != -1){ if (url.indexOf("http") != -1) {
fullUrl = url fullUrl = url;
} }
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
console.log(fullUrl)
uni.request({ uni.request({
url: fullUrl, url: fullUrl,
method:method, method: method,
data: config, data: config,
header: header, header: header,
async complete(response) { async complete(response) {
let res = response; let res = response;
if (_this.resInterceptors && typeof _this.resInterceptors === 'function') { if (response.statusCode == 404) {
let resInterceptors = _this.resInterceptors(res); $.toast("请求地址不存在");
// console.log('resInterceptors-----------------',resInterceptors) } else if (response.statusCode == 500) {
if(resInterceptors.statusCode == 401 || resInterceptors.data.code == 403){ $.toast("服务器内部错误");
$.toast('登录信息已过期,请重新登录') } else {
$.removeData('token') console.log("response", response.statusCode);
setTimeout(() => { let res = response;
$.openNew('/pages/logIn/logIn') if (
},1500) _this.resInterceptors &&
return typeof _this.resInterceptors === "function"
}else if(resInterceptors.statusCode != 200){ ) {
$.toast(resInterceptors.data.message) let resInterceptors = _this.resInterceptors(res);
} // console.log('resInterceptors-----------------',resInterceptors)
if (!resInterceptors && resInterceptors != '') { if (
reject('返回值已被您拦截!'); resInterceptors.statusCode == 401 ||
return; resInterceptors.data.code == 403
} else if (Object.prototype.toString.call(resInterceptors) === "[object Promise]") { ) {
try { $.toast("登录信息已过期,请重新登录");
let promiseRes = await resInterceptors; $.removeData("token");
resolve(promiseRes) setTimeout(() => {
} catch (error) { $.openNew("/pages/logIn/logIn");
reject(error) }, 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;
} }
} else {
res = resInterceptors;
} }
} }
resolve(res.data); resolve(res.data);
} },
}); });
}) });
} }
addFile(file,success, progress) { addFile(file, success, progress) {
const _this = this; const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {})); let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {}; let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === 'function') { if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig); let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") { if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log('请求被拦截,此消息仅在开发环境显示。') console.log("请求被拦截,此消息仅在开发环境显示。");
return false; return false;
} else if (Object.prototype.toString.call(reqInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors; return reqInterceptors;
} }
lastConfig = this._deepCopy(reqInterceptors); lastConfig = this._deepCopy(reqInterceptors);
@ -116,98 +138,103 @@ class Request {
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
let header = { let header = {
// 'content-Type':'multipart/form-data' // 'content-Type':'multipart/form-data'
} };
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({ const UploadTask = uni.uploadFile({
url : fullUrl, url: fullUrl,
filePath: file[0].path, filePath: file[0].path,
header:header, header: header,
name: $.fileImgKey, name: $.fileImgKey,
formData: {}, formData: {},
async complete(response) { async complete(response) {
let res = response; let res = response;
if (_this.resInterceptors && typeof _this.resInterceptors === 'function') { if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res); let resInterceptors = _this.resInterceptors(res);
if (!resInterceptors && resInterceptors != '') { if (!resInterceptors && resInterceptors != "") {
reject('返回值已被您拦截!'); reject("返回值已被您拦截!");
return; return;
} else if (Object.prototype.toString.call(resInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try { try {
let promiseRes = await resInterceptors; let promiseRes = await resInterceptors;
resolve(promiseRes) resolve(promiseRes);
} catch (error) { } catch (error) {
reject(error) reject(error);
} }
} else { } else {
res = resInterceptors; res = resInterceptors;
} }
} }
success(JSON.parse(res.data)); success(JSON.parse(res.data));
} },
}); });
// 监听上传进度 // 监听上传进度
if (progress) { if (progress) {
UploadTask.onProgressUpdate((res) => { UploadTask.onProgressUpdate((res) => {
progress(res.progress); progress(res.progress);
}) });
} }
}) });
} }
// 上传图片 // 上传图片
addImg(length = 1,success,progress,type = 1) { addImg(length = 1, success, progress, type = 1) {
// 获取本地图片的路径 // 获取本地图片的路径
uni.chooseImage({ uni.chooseImage({
count: length, count: length,
// original原图compressed压缩图 // original原图compressed压缩图
sizeType: ['compressed'], // 可以指定是原图还是压缩图,默认二者都有 sizeType: ["compressed"], // 可以指定是原图还是压缩图,默认二者都有
// camera相机album相册 // camera相机album相册
sourceType: ['album','camera'], // 可以指定来源是相册还是相机,默认二者都有 sourceType: ["album", "camera"], // 可以指定来源是相册还是相机,默认二者都有
success: (res) => { success: (res) => {
// 显示上传动画 // 显示上传动画
$.showLoading('图片上传中...'); $.showLoading("图片上传中...");
var imgs; var imgs;
imgs = res.tempFilePaths imgs = res.tempFilePaths;
// #ifdef H5 // #ifdef H5
// 调用上传图片的函数 // 调用上传图片的函数
// 处理多选 // 处理多选
// if (imgs.length > length) { // if (imgs.length > length) {
// imgs = imgs.slice(0, length); // imgs = imgs.slice(0, length);
// } // }
this.fileImg(imgs, 0, success, progress,type); this.fileImg(imgs, 0, success, progress, type);
// #endif // #endif
// #ifdef APP // #ifdef APP
console.log('imgs',imgs) console.log("imgs", imgs);
// 将新添加的图片添加到imgs_arr中 // 将新添加的图片添加到imgs_arr中
uni.compressImage({ uni.compressImage({
src: imgs[0], src: imgs[0],
quality: 60, // 仅对jpg有效 quality: 60, // 仅对jpg有效
success: ress => { success: (ress) => {
this.fileImg([ress.tempFilePath], 0, success, progress,type); this.fileImg([ress.tempFilePath], 0, success, progress, type);
}, },
fail: err => { fail: (err) => {
$.hideLoading('图片上传中...'); $.hideLoading("图片上传中...");
}, },
complete: (msg) => { complete: (msg) => {},
}
}); });
// #endif // #endif
}, },
complete: (err) => { complete: (err) => {},
}, });
})
} }
fileImg(imgs, index,success, progress,type) { fileImg(imgs, index, success, progress, type) {
const _this = this; const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {})); let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {}; let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === 'function') { if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig); let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") { if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log('请求被拦截,此消息仅在开发环境显示。') console.log("请求被拦截,此消息仅在开发环境显示。");
return false; return false;
} else if (Object.prototype.toString.call(reqInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors; return reqInterceptors;
} }
lastConfig = this._deepCopy(reqInterceptors); lastConfig = this._deepCopy(reqInterceptors);
@ -215,56 +242,61 @@ class Request {
lastConfig = this._deepCopy(newConfig); lastConfig = this._deepCopy(newConfig);
} }
let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl); let fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUrl);
if(type == 2){ if (type == 2) {
fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUserIdUrl) fullUrl = this._formatUrl(lastConfig.baseUrl, $.imgUserIdUrl);
} }
let header = { let header = {
token: $.getData('token') token: $.getData("token"),
} };
// 如果数组长度大于下标,说明没有上传完 // 如果数组长度大于下标,说明没有上传完
if (imgs.length > index) { if (imgs.length > index) {
var src = imgs[index]; var src = imgs[index];
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
const UploadTask = uni.uploadFile({ const UploadTask = uni.uploadFile({
url : fullUrl, url: fullUrl,
filePath: src, filePath: src,
header:header, header: header,
name: $.fileImgKey, name: $.fileImgKey,
formData: {}, formData: {},
async complete(response) { async complete(response) {
let res = response; let res = response;
if (_this.resInterceptors && typeof _this.resInterceptors === 'function') { if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res); let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors',resInterceptors) // console.log('resInterceptors',resInterceptors)
let datasJSON = JSON.parse(resInterceptors.data) let datasJSON = JSON.parse(resInterceptors.data);
if(datasJSON.code == 1101){ if (datasJSON.code == 1101) {
} }
if (!resInterceptors && resInterceptors != '') { if (!resInterceptors && resInterceptors != "") {
reject('返回值已被您拦截!'); reject("返回值已被您拦截!");
return; return;
} else if (Object.prototype.toString.call(resInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try { try {
let promiseRes = await resInterceptors; let promiseRes = await resInterceptors;
resolve(promiseRes) resolve(promiseRes);
} catch (error) { } catch (error) {
reject(error) reject(error);
} }
} else { } else {
res = resInterceptors; res = resInterceptors;
} }
} }
success(JSON.parse(res.data)); success(JSON.parse(res.data));
_this.fileImg(imgs, index+1, progress) _this.fileImg(imgs, index + 1, progress);
} },
}); });
// 监听上传进度 // 监听上传进度
if (progress) { if (progress) {
UploadTask.onProgressUpdate((res) => { UploadTask.onProgressUpdate((res) => {
progress(res.progress); progress(res.progress);
}) });
} }
}) });
// #ifdef H5 // #ifdef H5
// 压缩 // 压缩
// lrz(src, { // lrz(src, {
@ -275,7 +307,6 @@ class Request {
// #endif // #endif
// #ifdef APP-PLUS // #ifdef APP-PLUS
// #endif // #endif
} else { } else {
$.hideLoading(); $.hideLoading();
} }
@ -285,7 +316,7 @@ class Request {
addVideo(url, success, progress) { addVideo(url, success, progress) {
// 获取本地视频的路径 // 获取本地视频的路径
uni.chooseVideo({ uni.chooseVideo({
sourceType: ['album', 'camera'], // 选择方式 sourceType: ["album", "camera"], // 选择方式
success: (res) => { success: (res) => {
if (res.size > $.videoSize) { if (res.size > $.videoSize) {
let size = parseInt($.videoSize / 1024000); let size = parseInt($.videoSize / 1024000);
@ -294,24 +325,26 @@ class Request {
// 显示上传动画 // 显示上传动画
$.showLoading("视频上传中..."); $.showLoading("视频上传中...");
// 调用上传视频的函数 // 调用上传视频的函数
this.fileVideo(res.tempFilePath,url,success,progress); this.fileVideo(res.tempFilePath, url, success, progress);
} }
}, },
fail: (res) => { fail: (res) => {
console.log(JSON.stringify(res)); console.log(JSON.stringify(res));
}, },
}) });
} }
fileVideo(src, url,success, progress) { fileVideo(src, url, success, progress) {
const _this = this; const _this = this;
let newConfig = this._deepCopy(this._merge(this.config, {})); let newConfig = this._deepCopy(this._merge(this.config, {}));
let lastConfig = {}; let lastConfig = {};
if (this.reqInterceptors && typeof this.reqInterceptors === 'function') { if (this.reqInterceptors && typeof this.reqInterceptors === "function") {
let reqInterceptors = this.reqInterceptors(newConfig); let reqInterceptors = this.reqInterceptors(newConfig);
if (!reqInterceptors && process.env.NODE_ENV === "development") { if (!reqInterceptors && process.env.NODE_ENV === "development") {
console.log('请求被拦截,此消息仅在开发环境显示。') console.log("请求被拦截,此消息仅在开发环境显示。");
return false; return false;
} else if (Object.prototype.toString.call(reqInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(reqInterceptors) === "[object Promise]"
) {
return reqInterceptors; return reqInterceptors;
} }
lastConfig = this._deepCopy(reqInterceptors); lastConfig = this._deepCopy(reqInterceptors);
@ -327,18 +360,24 @@ class Request {
name: $.fileVideoKey, name: $.fileVideoKey,
async complete(response) { async complete(response) {
let res = response; let res = response;
if (_this.resInterceptors && typeof _this.resInterceptors === 'function') { if (
_this.resInterceptors &&
typeof _this.resInterceptors === "function"
) {
let resInterceptors = _this.resInterceptors(res); let resInterceptors = _this.resInterceptors(res);
// console.log('resInterceptors',resInterceptors) // console.log('resInterceptors',resInterceptors)
if (!resInterceptors && resInterceptors != '') { if (!resInterceptors && resInterceptors != "") {
reject('返回值已被您拦截!'); reject("返回值已被您拦截!");
return; return;
} else if (Object.prototype.toString.call(resInterceptors) === "[object Promise]") { } else if (
Object.prototype.toString.call(resInterceptors) ===
"[object Promise]"
) {
try { try {
let promiseRes = await resInterceptors; let promiseRes = await resInterceptors;
resolve(promiseRes) resolve(promiseRes);
} catch (error) { } catch (error) {
reject(error) reject(error);
} }
} else { } else {
res = resInterceptors; res = resInterceptors;
@ -356,27 +395,27 @@ class Request {
$.hideLoading(); $.hideLoading();
$.toast("上传超时!"); $.toast("上传超时!");
}, },
}) });
// 监听上传进度 // 监听上传进度
if (progress) { if (progress) {
UploadTask.onProgressUpdate((res) => { UploadTask.onProgressUpdate((res) => {
progress(res.progress); progress(res.progress);
}) });
} }
}) });
} }
_formatUrl(baseUrl, url) { _formatUrl(baseUrl, url) {
if (!baseUrl) return url; if (!baseUrl) return url;
let formatUrl = ''; let formatUrl = "";
const baseUrlEndsWithSlash = baseUrl.endsWith('/'); const baseUrlEndsWithSlash = baseUrl.endsWith("/");
const urlStartsWithSlash = url.startsWith('/'); const urlStartsWithSlash = url.startsWith("/");
if (baseUrlEndsWithSlash && urlStartsWithSlash) { if (baseUrlEndsWithSlash && urlStartsWithSlash) {
formatUrl = baseUrl + url.substring(1); formatUrl = baseUrl + url.substring(1);
} else if (baseUrlEndsWithSlash || urlStartsWithSlash) { } else if (baseUrlEndsWithSlash || urlStartsWithSlash) {
formatUrl = baseUrl + url; formatUrl = baseUrl + url;
} else { } else {
formatUrl = baseUrl + '/' + url; formatUrl = baseUrl + "/" + url;
} }
return formatUrl; return formatUrl;
} }
@ -384,10 +423,12 @@ class Request {
let mergeConfig = this._deepCopy(oldConfig); let mergeConfig = this._deepCopy(oldConfig);
if (!newConfig || !Object.keys(newConfig).length) return mergeConfig; if (!newConfig || !Object.keys(newConfig).length) return mergeConfig;
for (let key in newConfig) { for (let key in newConfig) {
if (key !== 'header') { if (key !== "header") {
mergeConfig[key] = newConfig[key]; mergeConfig[key] = newConfig[key];
} else { } else {
if (Object.prototype.toString.call(newConfig[key]) === '[object Object]') { if (
Object.prototype.toString.call(newConfig[key]) === "[object Object]"
) {
for (let headerKey in newConfig[key]) { for (let headerKey in newConfig[key]) {
mergeConfig[key][headerKey] = newConfig[key][headerKey]; mergeConfig[key][headerKey] = newConfig[key][headerKey];
} }
@ -400,7 +441,7 @@ class Request {
let result = Array.isArray(obj) ? [] : {}; let result = Array.isArray(obj) ? [] : {};
for (let key in obj) { for (let key in obj) {
if (obj.hasOwnProperty(key)) { if (obj.hasOwnProperty(key)) {
if (typeof obj[key] === 'object') { if (typeof obj[key] === "object") {
result[key] = this._deepCopy(obj[key]); result[key] = this._deepCopy(obj[key]);
} else { } else {
result[key] = obj[key]; result[key] = obj[key];

@ -3,10 +3,10 @@
<view class="Width100 Box BorderBox"> <view class="Width100 Box BorderBox">
<view class="Content BorderBox Width100"> <view class="Content BorderBox Width100">
<top-title :is-show-left="false" :title="'治理'" :rightWidth='120' class="custom_bg"> <top-title :is-show-left="false" :title="'治理'" :rightWidth='120' class="custom_bg">
<template slot="right"> <!-- <template slot="right">
<image :src="$.imgSrc + '/mine/search.png'" @click="$.open('/pages/mine/setting')" mode="aspectFit" class="InlineBlock imgIcon"></image> <image :src="$.imgSrc + '/mine/search.png'" @click="$.open('/pages/mine/setting')" mode="aspectFit" class="InlineBlock imgIcon"></image>
<image :src="$.imgSrc + '/mine/plus.png'" mode="aspectFit" @click="$.open('/pages/mine/notice')" class="InlineBlock imgIcon"></image> <image :src="$.imgSrc + '/mine/plus.png'" mode="aspectFit" @click="$.open('/pages/mine/notice')" class="InlineBlock imgIcon"></image>
</template> </template> -->
</top-title> </top-title>
</view> </view>
<view class="tab"> <view class="tab">

@ -168,9 +168,8 @@
}) })
}, },
handleClick(row) { handleClick(row) {
console.log(row)
if(row.pcType == 2) { if(row.pcType == 2) {
this.$.open("/pages/investigation/task" + "?id=" + this.businessId); this.$.open("/pages/investigation/task" + "?id=" + row.businessId);
} else { } else {
this.$.open('/pages/map/index?businessId=' + row.businessId + '&sectionId=' + row.sectionCode + '&deptId=' + row.handleDept + '&taskName=' + row.name + '&pcType' + row.pcType) this.$.open('/pages/map/index?businessId=' + row.businessId + '&sectionId=' + row.sectionCode + '&deptId=' + row.handleDept + '&taskName=' + row.name + '&pcType' + row.pcType)
} }

@ -127,10 +127,13 @@
// item.standar = false // item.standar = false
// break; // break;
case "4": case "4":
item.fileList = [] item.fileList = []
let arr=item.standar.split(',') let arr = item.standar.split(',')
for(let itm of arr){ for (let itm of arr) {
item.fileList.push({url:itm,name:''}) if (itm) {
item.fileList.push({ url: itm, name: '' })
}
} }
// item.fileList = [ // item.fileList = [
// // { // // {
@ -168,7 +171,10 @@
} }
console.log(arr, 4343242342423) console.log(arr, 4343242342423)
for (let item of arr) { for (let item of arr) {
this.fileList.push({ url: item, name: '' }) if (item) {
this.fileList.push({ url: item, name: '' })
}
} }
} else { } else {
this.fileList = []; this.fileList = [];

@ -193,7 +193,7 @@
console.log(row) console.log(row)
if (this.tab === 1) { if (this.tab === 1) {
if(row.pcType == 2) { if(row.pcType == 2) {
this.$.open("/pages/investigation/task" + "?id=" + this.businessId); this.$.open("/pages/investigation/task" + "?id=" + row.businessId);
} else { } else {
this.$.open('/pages/map/index?businessId=' + row.businessId + this.$.open('/pages/map/index?businessId=' + row.businessId +
'&operator=' + row.operator + '&operator=' + row.operator +

@ -3,10 +3,10 @@
<view class="Width100 Box BorderBox"> <view class="Width100 Box BorderBox">
<view class="Content BorderBox Width100"> <view class="Content BorderBox Width100">
<top-title :is-show-left="true" :title="'排查'" :rightWidth="40" class="custom_bg"> <top-title :is-show-left="true" :title="'排查'" :rightWidth="40" class="custom_bg">
<template slot="right"> <!-- <template slot="right">
<image :src="$.imgSrc + '/mine/search.png'" @click="$.open('/pages/mine/setting')" <image :src="$.imgSrc + '/mine/search.png'" @click="$.open('/pages/mine/setting')"
mode="aspectFit" class="InlineBlock imgIcon" style="width: 32rpx"></image> mode="aspectFit" class="InlineBlock imgIcon" style="width: 32rpx"></image>
</template> </template> -->
</top-title> </top-title>
</view> </view>
<view class="stepBox"> <view class="stepBox">
@ -713,11 +713,15 @@
let arr = [] let arr = []
try { try {
arr = v.hdPic.split(',') arr = v.hdPic.split(',')
// arr = arr.filter(it => it !== undefined||it !== '');
} catch (error) { } catch (error) {
console.error(error) console.error(error)
} }
for (let item of arr) { for (let item of arr) {
this.fileList.push({ url: item, name: '' }) if (item) {
this.fileList.push({ url: item, name: '' })
}
} }
} else { } else {
this.fileList = []; this.fileList = [];
@ -1195,6 +1199,7 @@
// describecheckedArr // describecheckedArr
let indexes = []; let indexes = [];
if (describe.length <= 0) { if (describe.length <= 0) {
console.log('来了2222')
checkedArr.map(r => { checkedArr.map(r => {
describe.push({ describe.push({
hdTerm: r.id, hdTerm: r.id,
@ -1210,6 +1215,7 @@
let foundIndex = describe.findIndex(item1 => item1.hdTerm === idToFind); let foundIndex = describe.findIndex(item1 => item1.hdTerm === idToFind);
if (foundIndex === -1) { if (foundIndex === -1) {
console.log('来了')
if (item2.checkedSelect) { if (item2.checkedSelect) {
describe.push({ ...item2.checkedSelect, pcType: 1, hdTerm: item2.id, }); describe.push({ ...item2.checkedSelect, pcType: 1, hdTerm: item2.id, });
} }
@ -1217,6 +1223,7 @@
// console.log(`: ${idToFind} describe`); // console.log(`: ${idToFind} describe`);
} else { } else {
console.log('来3333333')
let obj = { let obj = {
hdTerm: item2.id, hdTerm: item2.id,
hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '', hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '',
@ -1233,28 +1240,7 @@
// console.log(`describe:`, describe); // console.log(`describe:`, describe);
}); });
// describe.forEach((item1, index1) => {
// let found = false;
// checkedArr.forEach((item2, index2) => {
// if (item1.hdTerm === item2.id) {
// found = true;
// let obj = {
// hdTerm: item2.id,
// hdDesc: item2.checkedSelect ? item2.checkedSelect.hdDesc : '',
// hdPic: item2.checkedSelect ? item2.checkedSelect.hdPic : '',
// hdInfo: item2.checkedSelect ? item2.checkedSelect.hdInfo : '',
// pcType: 1
// }
// describe.splice(index1, 1, obj);
// // indexes.push({ describeIndex: index1, checkedArrIndex: index2 });
// }
// if (!found) {
// // pusharr1notFoundIncheckedArr
// describe.push({ ...item2 }); // arr1
// }
// });
// });
} }
console.log("Not found in checkedArr:", notFoundIncheckedArr); console.log("Not found in checkedArr:", notFoundIncheckedArr);

Loading…
Cancel
Save