Browse Source

对接部分接口

master
xzt 3 months ago
parent
commit
c42f56dead
  1. 61
      jwtech-h5-page/api/system/dict/data.js
  2. 76
      jwtech-h5-page/api/system/dict/type.js
  3. 70
      jwtech-h5-page/api/system/project.js
  4. 10
      jwtech-h5-page/api/system/projectStatistics.js
  5. 242
      jwtech-h5-page/components/echarts-uniapp/echarts-uniapp.vue
  6. 26
      jwtech-h5-page/components/echarts-uniapp/echarts.min.js
  7. 105
      jwtech-h5-page/components/echarts-uniapp/wx-canvas.js
  8. 2
      jwtech-h5-page/config.js
  9. 6
      jwtech-h5-page/main.js
  10. 27
      jwtech-h5-page/package-lock.json
  11. 16
      jwtech-h5-page/package.json
  12. 4
      jwtech-h5-page/pages.json
  13. 203
      jwtech-h5-page/pages/capital/check/index.vue
  14. 150
      jwtech-h5-page/pages/capital/list/index.vue
  15. 11
      jwtech-h5-page/pages/index.vue
  16. 4
      jwtech-h5-page/pages/login.vue
  17. 124
      jwtech-h5-page/pages/monitoring/list/index.vue
  18. 362
      jwtech-h5-page/pages/project/edit/index.vue
  19. 80
      jwtech-h5-page/pages/project/edit/项目属性.txt
  20. 446
      jwtech-h5-page/pages/project/list/index.vue
  21. 201
      jwtech-h5-page/pages/statistics/index.vue
  22. 62
      jwtech-h5-page/static/scss/common.scss
  23. 1
      jwtech-h5-page/static/scss/global.scss
  24. 20
      jwtech-h5-page/store/modules/user.js
  25. 22
      jwtech-h5-page/uni_modules/piaoyi-cityPicker/changelog.md
  26. 10661
      jwtech-h5-page/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/cityData.js
  27. 282
      jwtech-h5-page/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker.vue
  28. 17
      jwtech-h5-page/uni_modules/piaoyi-cityPicker/package.json
  29. 106
      jwtech-h5-page/uni_modules/piaoyi-cityPicker/readme.md
  30. 9
      jwtech-h5-page/utils/request.js
  31. 195
      jwtech-h5-page/utils/ruoyi.js

61
jwtech-h5-page/api/system/dict/data.js

@ -0,0 +1,61 @@
import request from '@/utils/request'
// 查询字典数据列表
export function listData(query) {
return request({
url: '/system/dict/data/list',
method: 'post',
data: query
})
}
// 查询字典数据详细
export function getData(dictCode) {
return request({
url: '/system/dict/data/' + dictCode,
method: 'get'
})
}
// 根据字典类型查询字典数据信息
export function getDicts(dictType) {
return request({
url: '/system/dict/data/type/' + dictType,
method: 'get'
})
}
// 新增字典数据
export function addData(data) {
return request({
url: '/system/dict/data',
method: 'post',
data: data
})
}
// 修改字典数据
export function updateData(data) {
return request({
url: '/system/dict/data',
method: 'put',
data: data
})
}
// 删除字典数据
export function delData(dictCode) {
return request({
url: '/system/dict/data/' + dictCode,
method: 'delete'
})
}
// 导出字典数据
export function exportData(query) {
return request({
url: '/system/dict/data/export',
method: 'get',
params: query
})
}

76
jwtech-h5-page/api/system/dict/type.js

@ -0,0 +1,76 @@
import request from '@/utils/request'
// 查询字典类型列表
export function listType(query) {
return request({
url: '/system/dict/type/list',
method: 'post',
data: query
})
}
export function allTypes() {
return request({
url: '/system/dict/type/allList',
method: 'get'
})
}
// 查询字典类型详细
export function getType(id) {
return request({
url: '/system/dict/type/' + id,
method: 'get'
})
}
// 新增字典类型
export function addType(data) {
return request({
url: '/system/dict/type',
method: 'post',
data: data
})
}
// 修改字典类型
export function updateType(data) {
return request({
url: '/system/dict/type',
method: 'put',
data: data
})
}
// 删除字典类型
export function delType(id) {
return request({
url: '/system/dict/type/' + id,
method: 'delete'
})
}
// 清理参数缓存
export function clearCache() {
return request({
url: '/system/dict/type/clearCache',
method: 'delete'
})
}
// 导出字典类型
export function exportType(query) {
return request({
url: '/system/dict/type/export',
method: 'get',
params: query
})
}
// 获取字典选择框列表
export function optionselect() {
return request({
url: '/system/dict/type/optionselect',
method: 'get'
})
}

70
jwtech-h5-page/api/system/project.js

@ -0,0 +1,70 @@
import request from '@/utils/request'
// 获取项目列表
export function getProjectListApi(data) {
return request({
url: '/build/projectInfo/list',
method: 'post',
data,
timeout: 1000 * 60
})
}
// 获取项目申请列表
export function projectApplyListApi(data) {
return request({
url: '/build/proInfoApply/list',
method: 'post',
data,
timeout: 1000 * 60
})
}
// 新增项目
export function projectAddApi(data) {
return request({
url: '/build/projectInfo',
method: 'post',
data,
timeout: 1000 * 60
})
}
// 获取项目详情
export function projectInfoApi(id) {
return request({
url: '/build/projectInfo/' + id,
method: 'get',
timeout: 1000 * 60
})
}
// 获取资金下达列表
export function projectSourceFundsListApi(data) {
return request({
url: '/build/sourceFunds/getSourceFundsList',
method: 'post',
data,
timeout: 1000 * 60
})
}
// 获取资金支付列表
export function projectContractInfoListApi(data) {
return request({
url: '/build/contractInfo/listByNo',
method: 'post',
data,
timeout: 1000 * 60
})
}
// 获取检查列表
export function projectCheckListApi(data) {
return request({
url: '/warn/inspections/list',
method: 'post',
data,
timeout: 1000 * 60
})
}

10
jwtech-h5-page/api/system/projectStatistics.js

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 获取投资统计数据
export function getSourceFundsNumApi(params){
return request({
url:'/statistics/assert/getSourceFundsNum',
method:'get',
params
})
}

242
jwtech-h5-page/components/echarts-uniapp/echarts-uniapp.vue

@ -0,0 +1,242 @@
<template>
<!-- #ifdef MP-WEIXIN || MP-TOUTIAO -->
<canvas type="2d" class="echarts" :canvas-id="canvasId" :id="canvasId" @touchstart="touchStart"
@touchmove="touchMove" @touchend="touchEnd" />
<!-- #endif -->
<!-- #ifndef MP-WEIXIN || MP-TOUTIAO -->
<canvas class="echarts" :canvas-id="canvasId" :id="canvasId" @touchstart="touchStart" @touchmove="touchMove"
@touchend="touchEnd" />
<!-- #endif -->
</template>
<script>
/**
* echartsForUniApp echart兼容uni-app
* @description echart兼容uni-app
* @property {Object} option 图表数据
* @property {String} canvasId 画布id
* @example <echarts ref="echarts" :option="option" canvasId="echarts"></echarts>
*/
import WxCanvas from './wx-canvas.js';
import * as echarts from './echarts.min.js';
var chartList = {}
export default {
props: {
canvasId: {
type: String,
default: 'echarts'
},
option: {
type: Object,
default: () => {
return {}
}
},
},
watch: {
option(newValue, oldValue) {
if(newValue.series){
this.initChart(newValue)
}
}
},
data() {
return {
ctx:null
}
},
mounted() {
// Disable prograssive because drawImage doesn't support DOM as parameter
// See https://developers.weixin.qq.com/miniprogram/dev/api/canvas/CanvasContext.drawImage.html
echarts.registerPreprocessor(option => {
if (option && option.series) {
if (option.series.length > 0) {
option.series.forEach(series => {
series.progressive = 0;
});
} else if (typeof option.series === 'object') {
option.series.progressive = 0;
}
}
});
},
methods: {
getCanvasAttr2d() {
return new Promise((resolve, reject) => {
const query = uni.createSelectorQuery().in(this)
query
.select('#' + this.canvasId)
.fields({
node: true,
size: true
})
.exec(res => {
const canvasNode = res[0].node
this.canvasNode = canvasNode
const canvasDpr = uni.getSystemInfoSync().pixelRatio
const canvasWidth = res[0].width
const canvasHeight = res[0].height
this.ctx = canvasNode.getContext('2d')
const canvas = new WxCanvas(this.ctx, this.canvasId, true, canvasNode)
echarts.setCanvasCreator(() => {
return canvas
})
resolve({
canvas,
canvasWidth,
canvasHeight,
canvasDpr
})
})
});
},
getCanvasAttr() {
return new Promise((resolve, reject) => {
this.ctx = uni.createCanvasContext(this.canvasId, this);
var canvas = new WxCanvas(this.ctx, this.canvasId, false);
echarts.setCanvasCreator(() => {
return canvas;
});
const canvasDpr = 1
var query = uni.createSelectorQuery()
// #ifndef MP-ALIPAY
.in(this)
// #endif
query.select('#' + this.canvasId).boundingClientRect(res => {
const canvasWidth = res.width
const canvasHeight = res.height
resolve({
canvas,
canvasWidth,
canvasHeight,
canvasDpr
})
}).exec();
});
},
// #ifdef H5
//H5
initChart(option) {
this.ctx = uni.createCanvasContext(this.canvasId, this);
chartList[this.canvasId] = echarts.init(document.getElementById(this.canvasId));
chartList[this.canvasId].setOption(option?option:this.option);
},
//H5
canvasToTempFilePath(opt) {
const base64 = chartList[this.canvasId].getDataURL()
opt.success && opt.success({tempFilePath:base64})
},
// #endif
// #ifndef H5
//
async initChart(option) {
// #ifdef MP-WEIXIN || MP-TOUTIAO
const canvasAttr = await this.getCanvasAttr2d();
// #endif
// #ifndef MP-WEIXIN || MP-TOUTIAO
const canvasAttr = await this.getCanvasAttr();
// #endif
const {
canvas,
canvasWidth,
canvasHeight,
canvasDpr
} = canvasAttr
chartList[this.canvasId] = echarts.init(canvas, null, {
width: canvasWidth,
height: canvasHeight,
devicePixelRatio: canvasDpr // new
});
canvas.setChart(chartList[this.canvasId]);
chartList[this.canvasId].setOption(option?option:this.option);
},
//
canvasToTempFilePath(opt) {
// #ifdef MP-WEIXIN || MP-TOUTIAO
var query = uni.createSelectorQuery()
// #ifndef MP-ALIPAY
.in(this)
// #endif
query.select('#' + this.canvasId).fields({ node: true, size: true }).exec(res => {
const canvasNode = res[0].node
opt.canvas = canvasNode
uni.canvasToTempFilePath(opt, this)
})
// #endif
// #ifndef MP-WEIXIN || MP-TOUTIAO
if (!opt.canvasId) {
opt.canvasId = this.canvasId;
}
this.ctx.draw(true, () => {
uni.canvasToTempFilePath(opt, this);
});
// #endif
},
// #endif
touchStart(e) {
if (chartList[this.canvasId] && e.touches.length > 0) {
var touch = e.touches[0];
var handler = chartList[this.canvasId].getZr().handler;
handler.dispatch('mousedown', {
zrX: touch.x,
zrY: touch.y
});
handler.dispatch('mousemove', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'start');
}
},
touchMove(e) {
if (chartList[this.canvasId] && e.touches.length > 0) {
var touch = e.touches[0];
var handler = chartList[this.canvasId].getZr().handler;
handler.dispatch('mousemove', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'change');
}
},
touchEnd(e) {
if (chartList[this.canvasId]) {
const touch = e.changedTouches ? e.changedTouches[0] : {};
var handler = chartList[this.canvasId].getZr().handler;
handler.dispatch('mouseup', {
zrX: touch.x,
zrY: touch.y
});
handler.dispatch('click', {
zrX: touch.x,
zrY: touch.y
});
handler.processGesture(wrapTouch(e), 'end');
}
}
}
}
function wrapTouch(event) {
for (let i = 0; i < event.touches.length; ++i) {
const touch = event.touches[i];
touch.offsetX = touch.x;
touch.offsetY = touch.y;
}
return event;
}
</script>
<style lang="scss" scoped>
.echarts {
width: 100%;
height: 100%;
}
</style>

26
jwtech-h5-page/components/echarts-uniapp/echarts.min.js

File diff suppressed because one or more lines are too long

105
jwtech-h5-page/components/echarts-uniapp/wx-canvas.js

@ -0,0 +1,105 @@
export default class WxCanvas {
constructor(ctx, canvasId, isNew, canvasNode) {
this.ctx = ctx;
this.canvasId = canvasId;
this.chart = null;
this.isNew = isNew
if (isNew) {
this.canvasNode = canvasNode;
}
else {
this._initStyle(ctx);
}
// this._initCanvas(zrender, ctx);
this._initEvent();
}
getContext(contextType) {
if (contextType === '2d') {
return this.ctx;
}
}
// canvasToTempFilePath(opt) {
// if (!opt.canvasId) {
// opt.canvasId = this.canvasId;
// }
// return wx.canvasToTempFilePath(opt, this);
// }
setChart(chart) {
this.chart = chart;
}
attachEvent() {
// noop
}
detachEvent() {
// noop
}
_initCanvas(zrender, ctx) {
zrender.util.getContext = function () {
return ctx;
};
zrender.util.$override('measureText', function (text, font) {
ctx.font = font || '12px sans-serif';
return ctx.measureText(text);
});
}
_initStyle(ctx) {
ctx.createRadialGradient = () => {
return ctx.createCircularGradient(arguments);
};
}
_initEvent() {
this.event = {};
const eventNames = [{
wxName: 'touchStart',
ecName: 'mousedown'
}, {
wxName: 'touchMove',
ecName: 'mousemove'
}, {
wxName: 'touchEnd',
ecName: 'mouseup'
}, {
wxName: 'touchEnd',
ecName: 'click'
}];
eventNames.forEach(name => {
this.event[name.wxName] = e => {
const touch = e.touches[0];
this.chart.getZr().handler.dispatch(name.ecName, {
zrX: name.wxName === 'tap' ? touch.clientX : touch.x,
zrY: name.wxName === 'tap' ? touch.clientY : touch.y
});
};
});
}
set width(w) {
if (this.canvasNode) this.canvasNode.width = w
}
set height(h) {
if (this.canvasNode) this.canvasNode.height = h
}
get width() {
if (this.canvasNode)
return this.canvasNode.width
return 0
}
get height() {
if (this.canvasNode)
return this.canvasNode.height
return 0
}
}

2
jwtech-h5-page/config.js

@ -1,6 +1,6 @@
// 应用全局配置
module.exports = {
baseUrl: 'https://shuili.com/prod-api',
baseUrl: 'http://175.178.86.109:18082/tianhui-admin-web',
// 应用信息
appInfo: {
// 应用名称

6
jwtech-h5-page/main.js

@ -3,6 +3,12 @@ import App from './App'
import store from './store' // store
import plugins from './plugins' // plugins
import './permission' // permission
import { selectDictLabel } from "@/utils/ruoyi";
import { getDicts, resetForm } from "@/api/system/dict/data";
Vue.prototype.getDicts = getDicts
Vue.prototype.selectDictLabel = selectDictLabel
Vue.prototype.resetForm = resetForm
Vue.use(plugins)
Vue.config.productionTip = false

27
jwtech-h5-page/package-lock.json

@ -1,28 +1,3 @@
{
"requires": true,
"lockfileVersion": 1,
"dependencies": {
"echarts": {
"version": "5.5.1",
"resolved": "https://registry.npmmirror.com/echarts/-/echarts-5.5.1.tgz",
"integrity": "sha512-Fce8upazaAXUVUVsjgV6mBnGuqgO+JNDlcgF79Dksy4+wgGpQB2lmYoO4TSweFg/mZITdpGHomw/cNBJZj1icA==",
"requires": {
"tslib": "2.3.0",
"zrender": "5.6.0"
}
},
"tslib": {
"version": "2.3.0",
"resolved": "https://registry.npmmirror.com/tslib/-/tslib-2.3.0.tgz",
"integrity": "sha512-N82ooyxVNm6h1riLCoyS9e3fuJ3AMG2zIZs2Gd1ATcSFjSA23Q0fzjjZeh0jbJvWVDZ0cJT8yaNNaaXHzueNjg=="
},
"zrender": {
"version": "5.6.0",
"resolved": "https://registry.npmmirror.com/zrender/-/zrender-5.6.0.tgz",
"integrity": "sha512-uzgraf4njmmHAbEUxMJ8Oxg+P3fT04O+9p7gY+wJRVxo8Ge+KmYv0WJev945EH4wFuc4OY2NLXz46FZrWS9xJg==",
"requires": {
"tslib": "2.3.0"
}
}
}
"lockfileVersion": 1
}

16
jwtech-h5-page/package.json

@ -0,0 +1,16 @@
{
"id": "echarts-uniapp",
"name": "echarts for uniapp",
"version": "0.0.1",
"description": "echarts适配uni-app",
"keywords": [
"echarts",
"图表"
],
"dcloudext": {
"category": [
"前端组件",
"通用组件"
]
}
}

4
jwtech-h5-page/pages.json

@ -1,4 +1,8 @@
{
"easycom": {
"echarts": "@/components/echarts-uniapp/echarts-uniapp.vue",
"cityPicker": "@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker"
},
"pages": [{
"path": "pages/login",
"style": {

203
jwtech-h5-page/pages/capital/check/index.vue

@ -27,182 +27,222 @@
<view class="form-item">
<text class="form-label">行政区划</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择行政区划" disabled/>
<input v-model="form.adcd" class="form-input" placeholder="请选择行政区划" disabled/>
<view style="position: relative;">
<view class="form-select" @click="handleOpenSelect">
选择
</view>
</view>
</view>
</view>
<view class="form-item">
<text class="form-label">项目编码</text>
<view class="form-content">
<input v-model="form.projectCode" class="form-input" placeholder="请输入项目编码" />
<input v-model="form.proCode" class="form-input" placeholder="请输入项目编码" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目种类</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择项目种类" disabled/>
<input v-model="form.projectKinds" class="form-input" placeholder="请选择项目种类" disabled/>
<picker mode="selector" :range="projectKindsOptions" @change="onProjectCategoryPickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
<view class="form-item">
<text class="form-label">项目法人单位</text>
<view class="form-content">
<input v-model="form.legalEntity" class="form-input" placeholder="请输入项目法人单位" />
<input v-model="form.projectLegalPerson" class="form-input" placeholder="请输入项目法人单位" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目负责人</text>
<view class="form-content">
<input v-model="form.projectLeader" class="form-input" placeholder="请输入项目负责人" />
<input v-model="form.projectSuperintendent" class="form-input" placeholder="请输入项目负责人" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目负责人电话</text>
<view class="form-content">
<input v-model="form.leaderPhone" class="form-input" placeholder="请输入项目负责人电话" type="number" />
<input v-model="form.projectLegalPhone" class="form-input" placeholder="请输入项目负责人电话" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">单位法定代表人</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入单位法定代表人" />
<input v-model="form.projectUnitLegal" class="form-input" placeholder="请输入单位法定代表人" />
</view>
</view>
<view class="form-item">
<text class="form-label">单位法定代表人电话</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入单位法定代表人电话" />
<input v-model="form.projectUnitLegalPhone" class="form-input" placeholder="请输入单位法定代表人电话" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目类型</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择项目类型" disabled/>
<input v-model="form.projectType" class="form-input" placeholder="请选择项目种类" disabled/>
<picker mode="selector" :range="projectTypes" @change="onProjectTypePickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
<view class="form-item">
<text class="form-label">工程等别</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择工程等别" disabled/>
<input v-model="form.engineeringGrade" class="form-input" placeholder="请选择工程等别" disabled/>
<picker mode="selector" :range="engineeringGradeOptions" @change="onProjectLevelPickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
<view class="form-item">
<text class="form-label">工程用途</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择工程用途" disabled/>
<input v-model="form.engineeringPurposes" class="form-input" placeholder="请选择工程用途" disabled/>
<picker mode="selector" :range="engineeringPurposesOptions" @change="onProjectPurposesPickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
<view class="form-item">
<text class="form-label">项目建设地址</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入项目建设地址" />
<input v-model="form.constructionAddress" class="form-input" placeholder="请输入项目建设地址" />
</view>
</view>
<view class="form-item">
<text class="form-label">建设模式</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择建设模式" disabled/>
<input v-model="form.constructionMode" class="form-input" placeholder="请选择建设模式" disabled/>
<picker mode="selector" :range="constructionModeOptions" @change="onProjectModesPickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
<view class="form-item">
<text class="form-label">建设性质</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择建设性质" disabled/>
<input v-model="form.constructionNature" class="form-input" placeholder="请选择建设性质" disabled/>
<picker mode="selector" :range="constructionNatureOptions" @change="onProjectBuildTypesPickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
<view class="form-item">
<text class="form-label">建设内容</text>
<view class="form-content">
<textarea v-model="form.legalRep" class="form-input" placeholder="请输入建设内容" rows="3"></textarea>
<textarea v-model="form.constructionContent" class="form-input" placeholder="请输入建设内容" :rows="3"></textarea>
</view>
</view>
<view class="form-item">
<text class="form-label">中央资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入中央资金(万元)" />
<input v-model="form.centralArrangedFunds" class="form-input" placeholder="请输入中央资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">中央资金资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入中央资金资金比例(%)" />
<input v-model="form.centralArrangedFundsRate" class="form-input" placeholder="请输入中央资金资金比例(%)" type="number"/>
</view>
</view>
<view class="form-item">
<text class="form-label">省级资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入省级资金(万元)" />
<input v-model="form.provincialFunding" class="form-input" placeholder="请输入省级资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">省级资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入省级资金比例(%)" />
<input v-model="form.provincialFundingRate" class="form-input" placeholder="请输入省级资金比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">地市资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入地市资金(万元)" />
<input v-model="form.cityLevelFunds" class="form-input" placeholder="请输入地市资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">地市资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入地市资金比例(%)" />
<input v-model="form.cityLevelFundsRate" class="form-input" placeholder="请输入地市资金比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">区县资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入区县资金(万元)" />
<input v-model="form.countyLevelFunds" class="form-input" placeholder="请输入区县资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">区县资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入区县资金比例(%)" />
<input v-model="form.cityLevelFundsRate" class="form-input" placeholder="请输入区县资金比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">乡镇及群众自筹和其他投资万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资(万元)" />
<input v-model="form.townshipInvestments" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">乡镇及群众自筹和其他投资比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资比例(%)" />
<input v-model="form.townshipInvestmentsRate" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">是否省重大水利工程项目</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择是否省重大水利工程项目" disabled/>
<input v-model="form.isMajorProject" class="form-input" placeholder="请选择是否省重大水利工程项目" disabled/>
<picker mode="selector" :range="isMajorProjectOptions" @change="onImportProjectPickerChange">
<view class="form-select">
选择
</view>
</picker>
</view>
</view>
</view>
@ -227,7 +267,7 @@
</view>
<!-- 项目列表 -->
<view class="cc-project-list project-list">
<view v-for="(project, index) in filteredProjects" :key="index" class="project-card">
<view v-for="(project, index) in sourceFundsList" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.name }}</view>
<view class="attr-item">
<view class="attr-title">项目编号</view>
@ -290,7 +330,7 @@
</view>
<!-- 项目列表 -->
<view class="cc-project-list project-list">
<view v-for="(project, index) in filteredProjects" :key="index" class="project-card">
<view v-for="(project, index) in contractInfoList" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.name }}</view>
<view class="attr-item">
<view class="attr-title">合同名称</view>
@ -336,15 +376,27 @@
</template>
<script>
import { projectInfoApi, projectSourceFundsListApi, projectContractInfoListApi } from '@/api/system/project'
export default {
data() {
return {
// ID
id: this.$route.query.id,
activeTab: 0, // Tab
searchQuery: '', //
selectedDistrict: 0, //
selectedProjectType: 0, //
districts: ['请选择', '北京市', '上海市', '广州市'], //
projectTypes: ['请选择', '建筑', 'IT', '教育'], //
projectKindsOptions: [],
engineeringGradeOptions: [],
//
engineeringPurposesOptions: [],
//
constructionModeOptions: [],
//
constructionNatureOptions: [],
isMajorProjectOptions: [],
projects: [ //
{ name: '项目1', code: 'P001', district: '北京市', type: '建筑', status: 1, isExpand: false },
{ name: '项目2', code: 'P002', district: '上海市', type: 'IT', status: 0, isExpand: false},
@ -361,19 +413,40 @@ export default {
leaderPhone: '',
legalRep: ''
},
operateType: ''
operateType: '',
queryParams: {
pageNum: 1,
pageSize: 10,
params: {orderBy: "create_time", sortBy: "desc"},
data: {}
},
sourceFundsList: [],
payQueryParams: {
pageNum: 1,
pageSize: 10,
params: {orderBy: "create_time", sortBy: "desc"},
data: {
proNo: "42448d4b-3be9-41a2-bcb4-546e75056097"
},
ids: null
},
contractInfoList: []
};
},
computed: {
filteredProjects() {
return this.projects.filter(project => {
//
const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
return matchesSearch && matchesDistrict && matchesType;
});
}
// filteredProjects() {
// return this.projects.filter(project => {
// //
// const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
// const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
// const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
// return matchesSearch && matchesDistrict && matchesType;
// });
// }
},
created() {
this.getProjectInfo()
},
mounted() {
//
@ -381,9 +454,61 @@ export default {
console.log(this.activeTab)
},
methods: {
getProjectInfo() {
projectInfoApi(this.id).then(res => {
this.form = res.data
})
},
changeTab(index) {
this.activeTab = index;
this.activeTab = index
this.judgeGetList()
},
//
judgeGetList() {
if (this.activeTab === 0) {
} else if (this.activeTab === 1) {
this.getSourceFundsList()
} else {
this.getContractInfoList()
}
},
//
getSourceFundsList() {
uni.showLoading({
title: '加载中...',
mask: true
})
projectSourceFundsListApi(this.queryParams).then(res => {
this.projects = [...this.projects, ...res.records]
this.pages = res.pages
// this.projects.forEach(projectItem => {
// projectItem.adcdName = this.formatAdcd(projectItem)
// projectItem.projectTypeName = this.projectTypeFormat(projectItem)
// })
uni.hideLoading()
})
},
//
getContractInfoList() {
uni.showLoading({
title: '加载中...',
mask: true
})
projectContractInfoListApi(this.payQueryParams).then(res => {
this.contractInfoList = [...this.projects, ...res.records]
this.pages = res.pages
// this.projects.forEach(projectItem => {
// projectItem.adcdName = this.formatAdcd(projectItem)
// projectItem.projectTypeName = this.projectTypeFormat(projectItem)
// })
uni.hideLoading()
})
},
handleAddProject() {
//
this.$tab.navigateTo(`/pages/project/edit/index`);

150
jwtech-h5-page/pages/capital/list/index.vue

@ -20,19 +20,19 @@
<!-- 项目列表 -->
<view class="project-list">
<view v-for="(project, index) in filteredProjects" :key="index" class="project-card">
<view v-for="(project, index) in projects" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.name }}</view>
<view class="attr-item">
<view class="attr-title">项目编号</view>
<view class="attr-value">{{ project.code }}</view>
<view class="attr-value">{{ project.proCode }}</view>
</view>
<view class="attr-item">
<view class="attr-title">行政区划</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-value">{{ project.adcdName }}</view>
</view>
<view class="attr-item">
<view class="attr-title">项目类型</view>
<view class="attr-value">{{ project.type }}</view>
<view class="attr-value">{{ project.projectTypeName }}</view>
</view>
<view class="operate-buttons">
<view class="buttons-group">
@ -54,37 +54,141 @@
</template>
<script>
import { getProjectListApi } from '@/api/system/project'
import { addressList } from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/cityData.js'
export default {
data() {
return {
activeTab: 0, // Tab
searchQuery: '', //
selectedDistrict: 0, //
selectedProjectType: 0, //
districts: ['请选择', '北京市', '上海市', '广州市'], //
projectTypes: ['请选择', '建筑', 'IT', '教育'], //
projects: [ //
{ name: '项目1', code: 'P001', district: '北京市', type: '建筑', status: 1 },
{ name: '项目2', code: 'P002', district: '上海市', type: 'IT', status: 0},
{ name: '项目3', code: 'P003', district: '广州市', type: '教育', status: 1},
{ name: '项目4', code: 'P004', district: '北京市', type: '建筑', status: 1}
]
projects: [],
queryParams: {
pageNum: 1,
pageSize: 10,
params: {orderBy: "create_time", sortBy: "desc"},
data: {}
},
//
addressTreeList: addressList,
addressList: [],
//
zd_projectTypeOptions: [],
//
ms_projectTypeOptions: [],
};
},
computed: {
filteredProjects() {
return this.projects.filter(project => {
//
const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
return matchesSearch && matchesDistrict && matchesType;
});
// filteredProjects() {
// return this.projects.filter(project => {
// //
// const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
// const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
// const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
// return matchesSearch && matchesDistrict && matchesType;
// });
// }
},
created () {
this.handleAddressTreeData()
this.getProjectList()
this.getDicts("major_project").then((response) => {
this.zd_projectTypeOptions = response.data
})
this.getDicts("general_project").then((response) => {
this.ms_projectTypeOptions = response.data
})
},
onReachBottom() {
if (this.queryParams.pageNum < this.pages) {
this.queryParams.pageNum++; // 1
this.getProjectList()
}
},
methods: {
changeTab(index) {
this.activeTab = index;
// ,
handleAddressTreeData() {
let result = [];
function traverse(node) {
result.push({ code: node.code, name: node.name, dictLabel: node.name, dictValue: node.code}); //
if (node.children) {
node.children.forEach(child => traverse(child)); //
}
}
this.addressTreeList.forEach(node => traverse(node)); //
this.addressList = result
this.addressList.forEach(item => {
if (item.code.length===2) {
item.code = item.dictValue = item.code + '0000'
}
if (item.code.length===4) {
item.code = item.dictValue = item.code + '00'
}
})
},
//
formatAdcd(row) {
if (row.adcd) {
let provinceCode = row.adcd.slice(0, 2)+"0000";
let cityCode = row.adcd.slice(0, 4)+"00";
let areaCode = row.adcd;
let s="";
if (areaCode.length > 2) {
s=this.areaCodeFormat(provinceCode)
if (cityCode!=provinceCode){
s+="-"+this.areaCodeFormat(cityCode)
}
if (areaCode!=cityCode){
s+="-" + this.areaCodeFormat(areaCode)
}
}
return s
}
},
//
areaCodeFormat(adcd, column) {
return this.selectDictLabel(
this.addressList,
adcd
);
},
//
projectTypeFormat(row, column) {
if (row.isMajor == "zd") {
return this.selectDictLabel(
this.zd_projectTypeOptions,
row.projectType
);
} else if (row.isMajor == "ms") {
return this.selectDictLabel(
this.ms_projectTypeOptions,
row.projectType
);
}else if (row.isMajor !=null){
return '其他'
}
},
//
getProjectList() {
uni.showLoading({
title: '加载中...',
mask: true
})
getProjectListApi(this.queryParams).then(res => {
this.projects = [...this.projects, ...res.records]
this.pages = res.pages
this.projects.forEach(projectItem => {
projectItem.adcdName = this.formatAdcd(projectItem)
projectItem.projectTypeName = this.projectTypeFormat(projectItem)
})
uni.hideLoading()
})
},
handleCapitalPass() {
//
@ -98,10 +202,10 @@ export default {
url: '/pages/capital/check/index?operateType=2&id=123'
})
},
handleSeeProject() {
handleSeeProject(projectItem) {
//
uni.navigateTo({
url: '/pages/capital/check/index?operateType=0&id=123'
url: '/pages/capital/check/index?operateType=0&id='+projectItem.id
})
},
}

11
jwtech-h5-page/pages/index.vue

@ -2,9 +2,9 @@
<view class="home">
<view class="home-header">
<view class="home-header-title">
<!-- <uni-icons type="person-filled" size="18"></uni-icons> -->
<!-- <text>水工程建设管理</text> -->
<!-- <uni-icons type="person-filled" size="18"></uni-icons> -->
<!-- <uni-icons type="person-filled" size="18"></uni-icons>
<text>水工程建设管理</text>
<uni-icons type="person-filled" size="18"></uni-icons> -->
</view>
<view class="home-header-content">
<view class="home-header-conten-logo">
@ -116,7 +116,7 @@
}
.home-header-conten-bg {
position: absolute;
bottom: 0;
bottom: -2px;
right: 0;
image {
width: 240px;
@ -127,9 +127,10 @@
}
.home-content {
margin: 20px;
padding: 20px;
padding: 16px 20px;
background: #fff;
border-radius: 8px;
box-shadow: 0px 2px 8px 0px #0000000F;
.home-content-title {
font-size: 20px;
padding-bottom: 15px;

4
jwtech-h5-page/pages/login.vue

@ -51,7 +51,7 @@
globalConfig: getApp().globalData.config,
loginForm: {
username: "admin",
password: "admin123",
password: "Sgcjs@2023",
code: "",
uuid: ''
}
@ -104,7 +104,7 @@
this.$tab.reLaunch('/pages/index')
}).catch(() => {
if (this.captchaEnabled) {
this.getCode()
// this.getCode()
}
})
},

124
jwtech-h5-page/pages/monitoring/list/index.vue

@ -27,31 +27,31 @@
<!-- 项目列表 -->
<view class="project-list">
<view v-for="(project, index) in filteredProjects" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.name }}</view>
<view v-for="(project, index) in projectCheckList" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.projectName }}</view>
<view class="attr-item">
<view class="attr-title">项目编号</view>
<view class="attr-value">{{ project.code }}</view>
<view class="attr-value">{{ project.proCode }}</view>
</view>
<view class="attr-item">
<view class="attr-title">行政区划</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-value">{{ project.adcdName }}</view>
</view>
<view v-if="activeTab===0" class="attr-item">
<view class="attr-title">检查次数</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-value">{{ project.checkNum }}</view>
</view>
<view v-if="activeTab===0" class="attr-item">
<view class="attr-title">发现问题数</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-value">{{ project.problemTotal }}</view>
</view>
<view v-if="activeTab===0" class="attr-item">
<view class="attr-title">未更改总数</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-value">{{ project.notRectifiedNum }}</view>
</view>
<view v-if="activeTab===0" class="attr-item">
<view class="attr-title">设计责任单位数</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-title">涉及责任单位数</view>
<view class="attr-value">{{ project.liabilityUnitsNum }}</view>
</view>
<view v-if="activeTab===1" class="attr-item">
<view class="attr-title">检查类型</view>
@ -77,6 +77,8 @@
</template>
<script>
import { projectCheckListApi } from '@/api/system/project'
import { addressList } from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/cityData.js'
export default {
data() {
return {
@ -86,29 +88,115 @@ export default {
selectedProjectType: 0, //
districts: ['请选择', '北京市', '上海市', '广州市'], //
projectTypes: ['请选择', '建筑', 'IT', '教育'], //
//
addressTreeList: addressList,
addressList: [],
projects: [ //
{ name: '项目1', code: 'P001', district: '北京市', type: '建筑', status: 1 },
{ name: '项目2', code: 'P002', district: '上海市', type: 'IT', status: 0},
{ name: '项目3', code: 'P003', district: '广州市', type: '教育', status: 1},
{ name: '项目4', code: 'P004', district: '北京市', type: '建筑', status: 1}
]
],
queryParams: {
pageNum: 1,
pageSize: 10,
params: {orderBy: "create_time", sortBy: "desc"},
data: {}
},
projectCheckList: []
};
},
computed: {
filteredProjects() {
return this.projects.filter(project => {
//
const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
return matchesSearch && matchesDistrict && matchesType;
});
// filteredProjects() {
// return this.projects.filter(project => {
// //
// const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
// const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
// const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
// return matchesSearch && matchesDistrict && matchesType;
// });
// }
},
created() {
this.handleAddressTreeData()
this.getProjectCheckList()
},
onReachBottom() {
if (this.queryParams.pageNum < this.pages) {
this.queryParams.pageNum++; // 1
this.getProjectCheckList()
}
},
methods: {
changeTab(index) {
this.activeTab = index;
},
//
getProjectCheckList() {
uni.showLoading({
title: '加载中...',
mask: true
})
projectCheckListApi(this.queryParams).then(res => {
this.projectCheckList = [...this.projectCheckList, ...res.records]
this.pages = res.pages
this.projectCheckList.forEach(projectItem => {
projectItem.adcdName = this.formatAdcd(projectItem)
})
uni.hideLoading()
})
},
// ,
handleAddressTreeData() {
let result = [];
function traverse(node) {
result.push({ code: node.code, name: node.name, dictLabel: node.name, dictValue: node.code}); //
if (node.children) {
node.children.forEach(child => traverse(child)); //
}
}
this.addressTreeList.forEach(node => traverse(node)); //
this.addressList = result
this.addressList.forEach(item => {
if (item.code.length===2) {
item.code = item.dictValue = item.code + '0000'
}
if (item.code.length===4) {
item.code = item.dictValue = item.code + '00'
}
})
},
//
formatAdcd(row) {
if (row.adcd) {
let provinceCode = row.adcd.slice(0, 2)+"0000";
let cityCode = row.adcd.slice(0, 4)+"00";
let areaCode = row.adcd;
let s="";
if (areaCode.length > 2) {
s=this.areaCodeFormat(provinceCode)
if (cityCode!=provinceCode){
s+="-"+this.areaCodeFormat(cityCode)
}
if (areaCode!=cityCode){
s+="-" + this.areaCodeFormat(areaCode)
}
}
return s
}
},
//
areaCodeFormat(adcd, column) {
return this.selectDictLabel(
this.addressList,
adcd
);
},
handleAddCheck() {
//
this.$tab.navigateTo(`/pages/monitoring/edit/index`);

362
jwtech-h5-page/pages/project/edit/index.vue

@ -1,7 +1,7 @@
<template>
<view class="project-add">
<view class="project-add cc-page-wrap">
<!-- 项目新增表单卡片 -->
<view class="form-card">
<view class="cc-card form-card" ref="form">
<view class="form-title">基本信息</view>
<view class="form-item">
<text class="form-label">项目名称</text>
@ -12,27 +12,27 @@
<view class="form-item">
<text class="form-label">行政区划</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择行政区划" disabled/>
<picker mode="region" v-model="form.region" @change="onRegionChange">
<view class="form-select">
<input v-model="form.adcd" class="form-input" placeholder="请选择行政区划" disabled/>
<view style="position: relative;">
<view class="form-select" @click="handleOpenSelect">
选择
</view>
</picker>
</view>
</view>
</view>
<view class="form-item">
<text class="form-label">项目编码</text>
<view class="form-content">
<input v-model="form.projectCode" class="form-input" placeholder="请输入项目编码" />
<input v-model="form.proCode" class="form-input" placeholder="请输入项目编码" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目种类</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择项目种类" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.projectKinds" class="form-input" placeholder="请选择项目种类" disabled/>
<picker mode="selector" :range="projectKindsOptions" @change="onProjectCategoryPickerChange">
<view class="form-select">
选择
</view>
@ -43,43 +43,43 @@
<view class="form-item">
<text class="form-label">项目法人单位</text>
<view class="form-content">
<input v-model="form.legalEntity" class="form-input" placeholder="请输入项目法人单位" />
<input v-model="form.projectLegalPerson" class="form-input" placeholder="请输入项目法人单位" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目负责人</text>
<view class="form-content">
<input v-model="form.projectLeader" class="form-input" placeholder="请输入项目负责人" />
<input v-model="form.projectSuperintendent" class="form-input" placeholder="请输入项目负责人" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目负责人电话</text>
<view class="form-content">
<input v-model="form.leaderPhone" class="form-input" placeholder="请输入项目负责人电话" type="number" />
<input v-model="form.projectLegalPhone" class="form-input" placeholder="请输入项目负责人电话" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">单位法定代表人</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入单位法定代表人" />
<input v-model="form.projectUnitLegal" class="form-input" placeholder="请输入单位法定代表人" />
</view>
</view>
<view class="form-item">
<text class="form-label">单位法定代表人电话</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入单位法定代表人电话" />
<input v-model="form.projectUnitLegalPhone" class="form-input" placeholder="请输入单位法定代表人电话" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">项目类型</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择项目类" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.projectType" class="form-input" placeholder="请选择项目类" disabled/>
<picker mode="selector" :range="projectTypes" @change="onProjectTypePickerChange">
<view class="form-select">
选择
</view>
@ -90,8 +90,8 @@
<view class="form-item">
<text class="form-label">工程等别</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择工程等别" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.engineeringGrade" class="form-input" placeholder="请选择工程等别" disabled/>
<picker mode="selector" :range="engineeringGradeOptions" @change="onProjectLevelPickerChange">
<view class="form-select">
选择
</view>
@ -102,8 +102,8 @@
<view class="form-item">
<text class="form-label">工程用途</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择工程用途" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.engineeringPurposes" class="form-input" placeholder="请选择工程用途" disabled/>
<picker mode="selector" :range="engineeringPurposesOptions" @change="onProjectPurposesPickerChange">
<view class="form-select">
选择
</view>
@ -114,15 +114,15 @@
<view class="form-item">
<text class="form-label">项目建设地址</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入项目建设地址" />
<input v-model="form.constructionAddress" class="form-input" placeholder="请输入项目建设地址" />
</view>
</view>
<view class="form-item">
<text class="form-label">建设模式</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择建设模式" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.constructionMode" class="form-input" placeholder="请选择建设模式" disabled/>
<picker mode="selector" :range="constructionModeOptions" @change="onProjectModesPickerChange">
<view class="form-select">
选择
</view>
@ -133,8 +133,8 @@
<view class="form-item">
<text class="form-label">建设性质</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择建设性质" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.constructionNature" class="form-input" placeholder="请选择建设性质" disabled/>
<picker mode="selector" :range="constructionNatureOptions" @change="onProjectBuildTypesPickerChange">
<view class="form-select">
选择
</view>
@ -145,85 +145,85 @@
<view class="form-item">
<text class="form-label">建设内容</text>
<view class="form-content">
<textarea v-model="form.legalRep" class="form-input" placeholder="请输入建设内容" rows="3"></textarea>
<textarea v-model="form.constructionContent" class="form-input" placeholder="请输入建设内容" :rows="3"></textarea>
</view>
</view>
<view class="form-item">
<text class="form-label">中央资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入中央资金(万元)" />
<input v-model="form.centralArrangedFunds" class="form-input" placeholder="请输入中央资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">中央资金资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入中央资金资金比例(%)" />
<input v-model="form.centralArrangedFundsRate" class="form-input" placeholder="请输入中央资金资金比例(%)" type="number"/>
</view>
</view>
<view class="form-item">
<text class="form-label">省级资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入省级资金(万元)" />
<input v-model="form.provincialFunding" class="form-input" placeholder="请输入省级资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">省级资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入省级资金比例(%)" />
<input v-model="form.provincialFundingRate" class="form-input" placeholder="请输入省级资金比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">地市资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入地市资金(万元)" />
<input v-model="form.cityLevelFunds" class="form-input" placeholder="请输入地市资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">地市资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入地市资金比例(%)" />
<input v-model="form.cityLevelFundsRate" class="form-input" placeholder="请输入地市资金比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">区县资金万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入区县资金(万元)" />
<input v-model="form.countyLevelFunds" class="form-input" placeholder="请输入区县资金(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">区县资金比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入区县资金比例(%)" />
<input v-model="form.cityLevelFundsRate" class="form-input" placeholder="请输入区县资金比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">乡镇及群众自筹和其他投资万元</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资(万元)" />
<input v-model="form.townshipInvestments" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资(万元)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">乡镇及群众自筹和其他投资比例%</text>
<view class="form-content">
<input v-model="form.legalRep" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资比例(%)" />
<input v-model="form.townshipInvestmentsRate" class="form-input" placeholder="请输入乡镇及群众自筹和其他投资比例(%)" type="number" />
</view>
</view>
<view class="form-item">
<text class="form-label">是否省重大水利工程项目</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请选择是否省重大水利工程项目" disabled/>
<picker mode="selector" :range="projectTypes" v-model="form.projectType">
<input v-model="form.isMajorProject" class="form-input" placeholder="请选择是否省重大水利工程项目" disabled/>
<picker mode="selector" :range="isMajorProjectOptions" @change="onImportProjectPickerChange">
<view class="form-select">
选择
</view>
@ -232,62 +232,154 @@
</view>
</view>
<view v-if="operateType==='examine'||operateType==='examineSee'" class="form-card" style="margin-top: 16px;">
<view v-if="operateType==='examine'||operateType==='examineSee'" class="cc-card form-card" style="margin-top: 16px;">
<view class="form-title">审核信息</view>
<view class="form-item">
<text class="form-label">审批人</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请输入审批人" />
<input v-model="checkForm.checkPerson" class="form-input" placeholder="请输入审批人" />
</view>
</view>
<view class="form-item">
<text class="form-label">审批时间</text>
<view class="form-content">
<input v-model="form.projectName" class="form-input" placeholder="请输入审批时间" />
<input v-model="checkForm.checkTime" class="form-input" placeholder="请输入审批时间" />
</view>
</view>
<view class="form-item">
<text class="form-label">审批意见</text>
<view class="form-content">
<textarea v-model="form.legalRep" class="form-input" placeholder="请输入审批意见" rows="3"></textarea>
<textarea v-model="checkForm.checkOpinion" class="form-input" placeholder="请输入审批意见" rows="3"></textarea>
</view>
</view>
</view>
<view v-if="operateType!=='see' && operateType!=='examineSee'" class="cc-operation-row operation-row">
<view v-if="operateType==='edit'" class="buttons-group">
<view class="button default-button">保存</view>
<view class="button default-button" @click="handleSaveProject()">保存</view>
</view>
<view v-else-if="operateType==='add'" class="buttons-group">
<view class="button primary-button">上报</view>
<view class="button default-button">暂存</view>
<view class="button primary-button" @click="handleSaveProject()">上报</view>
<view class="button default-button" @click="handleSaveProjectDraft()">暂存</view>
</view>
<view v-else-if="operateType==='examine'" class="buttons-group">
<view class="button primary-button">确定</view>
<view class="button default-button">取消</view>
<view class="button primary-button" @click="handleSubmitCheck()">确定</view>
<view class="button default-button" @click="handleCancelCheck()">取消</view>
</view>
</view>
<!-- 省市区选项 -->
<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble" @confirm="confirm" @cancel="cancel" :visible="visible"/>
</view>
</template>
<script>
import { projectAddApi } from '@/api/system/project'
export default {
data() {
return {
form: {
id: null,
isKeyProject: null,
isPierceProject: null,
isMajor: null,
projectName: '',
region: [],
projectCode: '',
projectType: 0,
legalEntity: '',
projectLeader: '',
leaderPhone: '',
legalRep: ''
unitLeader: null,
projectLegalPerson: '',
projectLegalUnit: null,
projectLegalPhone: '',
projectSuperintendent: '',
projectSuperintendentPhone: null,
projectUnitLegal: '',
projectUnitLegalPhone: '',
engineeringGrade: '',
engineeringPurposes: '',
workCategory: null,
constructionAddress: '',
constructionMode: '',
constructionNature: null,
constructionContent: '',
adcd: '',
basin: null,
projectType: '',
// fundingSource: null,
centralArrangedFunds: '',
centralArrangedFundsRate: '',
provincialFunding: '',
provincialFundingRate: '',
cityLevelFunds: '',
cityLevelFundsRate: '',
countyLevelFunds: '',
countyLevelFundsRate: '',
townshipInvestments: '',
townshipInvestmentsRate: '',
isMajorProject: '',
investmentSubject: null,
constructionPhase: null,
fundingNumber: null,
proCode: '',
proNo: null,
createUid: null,
createTime: null,
updateUid: null,
updateTime: null,
owerDept: null,
pointLatitudeLongitudeList: null,
lineLatitudeLongitudeList: null,
allLatitudeLongitudeList: null,
projectKinds: '',
},
projectTypes: ['建筑', 'IT', '教育', '制造业'], //
projectKindsOptions: [],
engineeringGradeOptions: [],
//
engineeringPurposesOptions: [],
//
constructionModeOptions: [],
//
constructionNatureOptions: [],
isMajorProjectOptions: [],
operateType: '',
checkForm: {
checkPerson: '',
checkTime: '',
checkOpinion: ''
},
projectTypes: ['请选择', '建筑', 'IT', '教育', '制造业'], //
operateType: ''
//
visible: false,
maskCloseAble: true,
str: '',
defaultValue: '420103',
column: 3,
};
},
created () {
this.getDicts("type_of_project").then((response) => {
this.projectKindsOptions = response.data;
})
this.getDicts("engineering_grade").then((response) => {
this.engineeringGradeOptions = response.data;
})
this.getDicts("project_purposes").then((response) => {
this.engineeringPurposesOptions = response.data;
})
this.getDicts("Construction_mode").then((response) => {
this.constructionModeOptions = response.data;
})
this.getDicts("CONSTRUCTION_NATURE").then((response) => {
this.constructionNatureOptions = response.data;
})
this.getDicts("whether").then((response) => {
this.isMajorProjectOptions = response.data;
})
},
methods: {
//
onRegionChange(e) {
@ -298,6 +390,89 @@ export default {
//
console.log("提交的表单数据:", this.form);
//
},
//
handleOpenSelect() {
this.visible = true
},
cancel () {
this.visible = false
},
confirm (val) {
console.log(val)
this.str = JSON.stringify(val)
this.form.area = val.name
this.visible = false
},
//
onProjectTypePickerChange(event) {
this.form.projectType = this.projectTypes[event.detail.value]
},
onProjectCategoryPickerChange(event) {
this.form.projectKinds = this.projectKindsOptions[event.detail.value]
},
onProjectLevelPickerChange(event) {
this.form.engineeringGrade = this.engineeringGradeOptions[event.detail.value]
},
onProjectPurposesPickerChange(event) {
this.form.engineeringPurposes = this.engineeringPurposesOptions[event.detail.value]
},
onProjectModesPickerChange(event) {
this.form.constructionMode = this.constructionModeOptions[event.detail.value]
},
onProjectBuildTypesPickerChange(event) {
this.form.constructionNature = this.constructionNatureOptions[event.detail.value]
},
onImportProjectPickerChange(event) {
this.form.isMajorProject = this.isMajorProjectOptions[event.detail.value]
},
//
judgeAttrWrite() {
// const requiredFields = ['projectName', 'adcd', 'proCode', 'projectKinds', 'projectLegalPerson', 'projectSuperintendent', 'projectLegalPhone', 'projectUnitLegal', 'projectUnitLegalPhone', 'projectType', 'engineeringGrade', 'engineeringPurposes', 'constructionAddress', 'constructionMode', 'constructionContent', 'centralArrangedFunds', 'centralArrangedFundsRate', 'provincialFunding', 'provincialFundingRate', 'cityLevelFunds', 'cityLevelFundsRate', 'countyLevelFunds', 'cityLevelFundsRate', 'townshipInvestments', 'townshipInvestmentsRate', 'isMajorProject'];
// const isValid = requiredFields.every(field => Boolean(this.myObject[field]));
// if (!isValid) {
// return false
// } else {
// return true
// }
},
//
handleSaveProject() {
if (!this.judgeAttrWrite()) {
return
}
uni.showLoading({
title: '加载中...',
mask: true
})
projectAddApi(this.form).then(res => {
uni.showToast({
title: `操作成功`,
icon: 'none'
})
uni.navigateTo({
url: `/pages/project/list`
});
})
},
handleSaveProjectDraft() {
uni.showToast({
title: `新增项目草稿成功`,
icon: 'none'
});
console.log(this.form)
},
handleSubmitCheck() {
uni.showToast({
title: `提交审核成功`,
icon: 'none'
});
},
handleCancelCheck() {
uni.navigateBack()
}
},
mounted() {
@ -309,44 +484,47 @@ export default {
<style lang="scss" scoped>
.project-add {
padding: 20px 20px 100px 20px;
padding: 16px 20px 96px 20px;
.form-card {
background-color: white;
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
.form-title {
font-size: 18px;
padding-bottom: 16px;
}
.form-item {
.form-label {
font-size: 14px;
color: #595959;
margin-bottom: 6px;
display: block;
}
margin-bottom: 20px;
.form-content {
position: relative;
padding-bottom: 16px;
border-bottom: 1px solid #f0f0f0;
.form-input {
width: 100%;
height: 30px;
border-radius: 5px;
font-size: 14px;
color: #333;
}
.form-select {
position: absolute;
bottom: 4px;
right: 0;
color: #00B39D;
}
}
}
margin-bottom: 0;
}
// .form-card {
// background-color: white;
// padding: 20px;
// border-radius: 10px;
// box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
// .form-title {
// font-size: 18px;
// padding-bottom: 16px;
// }
// .form-item {
// .form-label {
// font-size: 14px;
// color: #595959;
// margin-bottom: 6px;
// display: block;
// }
// margin-bottom: 20px;
// .form-content {
// position: relative;
// padding-bottom: 16px;
// border-bottom: 1px solid #f0f0f0;
// .form-input {
// width: 100%;
// height: 30px;
// border-radius: 5px;
// font-size: 14px;
// color: #333;
// }
// .form-select {
// position: absolute;
// bottom: 4px;
// right: 0;
// color: #00B39D;
// }
// }
// }
// }
}

80
jwtech-h5-page/pages/project/edit/项目属性.txt

@ -0,0 +1,80 @@
项目名称
projectName
行政区号
adcd
项目编码
proCode
项目种类
projectKinds
项目法人单位
projectLegalPerson
项目负责人
projectSuperintendent
单位负责人电话
projectLegalPhone
单位法定代表人
projectUnitLegal
单位法定代表人电话
projectUnitLegalPhone
项目类型
projectType
工程等别
engineeringGrade
工程用途
engineeringPurposes
项目建设地址
constructionAddress
建设模式
constructionMode
建设性质
constructionNature
建设内容
constructionContent
中央资金
centralArrangedFunds
中央资金比例
centralArrangedFundsRate
省级资金
provincialFunding
省级资金比例
provincialFundingRate
地市资金
cityLevelFunds
地市资金比例
cityLevelFundsRate
区县资金
countyLevelFunds
区县资金比例
cityLevelFundsRate
乡镇及群众自筹和其他投资
townshipInvestments
乡镇及群众自筹和其他投资比例
townshipInvestmentsRate
是否省重大水利工程项目
isMajorProject

446
jwtech-h5-page/pages/project/list/index.vue

@ -1,7 +1,7 @@
<template>
<view class="project">
<!-- Tabs栏 -->
<view class="tabs">
<view class="cc-tabs tabs">
<view class="tab" :class="{'active': activeTab === 0}" @click="changeTab(0)">
<view class="tab-text">项目管理</view>
</view>
@ -23,39 +23,42 @@
<!-- 行政区划和项目类型下拉框 -->
<view class="cc-query-dropdowns dropdowns">
<picker mode="selector" :range="districts" v-model="selectedDistrict">
<view class="dropdown">行政区划<image src="/static/images/icon/down.png" /></view>
</picker>
<picker mode="selector" :range="projectTypes" v-model="selectedProjectType">
<view class="dropdown">项目类型<image src="/static/images/icon/down.png" /></view>
<view class="uni-picker" @click="handleOpenSelect">
<view class="dropdown">
<view class="d-text">{{cityName}}</view>
<image src="/static/images/icon/down.png" />
</view>
</view>
<picker mode="selector" :range="projectTypes" @change="onProjectTypePickerChange">
<view class="dropdown">{{projectType}}<image src="/static/images/icon/down.png" /></view>
</picker>
<picker v-if="activeTab===2" mode="selector" :range="projectTypes" v-model="selectedProjectType">
<view class="dropdown">审批状态<image src="/static/images/icon/down.png" /></view>
<picker v-if="activeTab===2" mode="selector" :range="checkStatusOption" @change="onCheckStatusPickerChange">
<view class="dropdown">{{checkStatus}}<image src="/static/images/icon/down.png" /></view>
</picker>
</view>
<!-- 项目列表 -->
<view class="project-list">
<view v-for="(project, index) in filteredProjects" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.name }}</view>
<view class="cc-project-list project-list" :class="{'no-bottom':activeTab!==0}">
<view v-for="(project, index) in projects" :key="index" class="project-card">
<view class="attr-item project-title">{{ project.projectName }}</view>
<view class="attr-item">
<view class="attr-title">项目编号</view>
<view class="attr-value">{{ project.code }}</view>
<view class="attr-value">{{ project.proCode }}</view>
</view>
<view class="attr-item">
<view class="attr-title">行政区划</view>
<view class="attr-value">{{ project.district }}</view>
<view class="attr-value">{{ project.adcdName }}</view>
</view>
<view class="attr-item">
<view class="attr-title">项目类型</view>
<view class="attr-value">{{ project.type }}</view>
<view class="attr-value">{{ project.projectTypeName }}</view>
</view>
<view v-if="activeTab===2" class="attr-item">
<view class="attr-title">审核状态</view>
<view
class="attr-value"
:class="project.status==1? 'success' : 'no-done'"
>{{ project.status==1? '已审核' : '未审核' }}</view>
:class="project.applicationStatus==0 || project.applicationStatus==2? 'no-done' : 'success'"
>{{ project.checkStatusName }}</view>
</view>
<view class="operate-buttons">
<view class="buttons-group">
@ -72,15 +75,19 @@
</view>
<!-- 操作按钮 -->
<view v-if="activeTab===0" class="operation-buttons">
<view v-if="activeTab===0" class="cc-operation-buttons operation-buttons">
<view class="buttons-group">
<view class="primary-button button" @click="handleAddProject()">新增</view>
</view>
</view>
<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble" @confirm="confirm" @cancel="cancel" :visible="visible"/>
</view>
</template>
<script>
import { getProjectListApi, projectApplyListApi } from '@/api/system/project'
import { addressList } from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/cityData.js'
export default {
data() {
return {
@ -89,29 +96,248 @@ export default {
selectedDistrict: 0, //
selectedProjectType: 0, //
districts: ['请选择', '北京市', '上海市', '广州市'], //
projectTypes: ['请选择', '建筑', 'IT', '教育'], //
projectTypes: ['建筑', 'IT', '教育'], //
checkStatusOption: ['审核', '未审核'],
projects: [ //
{ name: '项目1', code: 'P001', district: '北京市', type: '建筑', status: 1 },
{ name: '项目2', code: 'P002', district: '上海市', type: 'IT', status: 0},
{ name: '项目3', code: 'P003', district: '广州市', type: '教育', status: 1},
{ name: '项目4', code: 'P004', district: '北京市', type: '建筑', status: 1}
]
// { name: '1', code: '010101', district: '', type: '', status: 1 },
// { name: '2', code: '010102', district: '', type: 'IT', status: 0},
// { name: '3', code: '010103', district: '广', type: '', status: 1},
// { name: '4', code: '010104', district: '', type: '', status: 1},
// { name: '5', code: '010105', district: '', type: '', status: 1}
],
//
visible: false,
maskCloseAble: true,
str: '',
defaultValue: '420103',
column: 3,
cityName: '行政区划',
projectType: '项目类型',
checkStatus: '审核状态',
queryParams: {
pageNum: 1,
pageSize: 10,
params: {orderBy: "create_time", sortBy: "desc"},
data: {}
},
pages: 0,
//
addressTreeList: addressList,
addressList: [],
//
zd_projectTypeOptions: [],
//
ms_projectTypeOptions: [],
reviewStatus:[],
};
},
computed: {
filteredProjects() {
return this.projects.filter(project => {
//
const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
return matchesSearch && matchesDistrict && matchesType;
});
// filteredProjects() {
// return this.projects.filter(project => {
// //
// const matchesSearch = project.name.toLowerCase().includes(this.searchQuery.toLowerCase());
// const matchesDistrict = this.selectedDistrict === 0 || project.district === this.districts[this.selectedDistrict];
// const matchesType = this.selectedProjectType === 0 || project.type === this.projectTypes[this.selectedProjectType];
// return matchesSearch && matchesDistrict && matchesType;
// });
// }
},
created() {
this.handleAddressTreeData()
this.getProjectList()
this.getDicts("major_project").then((response) => {
this.zd_projectTypeOptions = response.data
})
this.getDicts("general_project").then((response) => {
this.ms_projectTypeOptions = response.data
})
this.getDicts("review_status").then((response)=>{
this.reviewStatus = response.data
})
},
onReachBottom() {
if (this.queryParams.pageNum < this.pages) {
this.queryParams.pageNum++; // 1
this.judgeGetList()
}
},
methods: {
// tab
changeTab(index) {
this.activeTab = index;
this.activeTab = index
this.resetQuery()
this.projects = []
this.judgeGetList()
},
//
resetQuery() {
this.queryParams = {
pageNum: 1,
pageSize: 10,
params: { orderBy: "create_time", sortBy: "desc" },
data: {}
}
},
//
judgeGetList() {
if (this.activeTab === 0) {
this.getProjectList()
} else if (this.activeTab === 1) {
this.getProjectDraftList()
} else {
this.getProjectApplyList()
}
},
//
getProjectList() {
uni.showLoading({
title: '加载中...',
mask: true
})
getProjectListApi(this.queryParams).then(res => {
this.projects = [...this.projects, ...res.records]
this.pages = res.pages
this.projects.forEach(projectItem => {
projectItem.adcdName = this.formatAdcd(projectItem)
projectItem.projectTypeName = this.projectTypeFormat(projectItem)
})
uni.hideLoading()
})
},
// 稿
getProjectDraftList() {
uni.showLoading({
title: '加载中...',
mask: true
})
getProjectListApi(this.queryParams).then(res => {
this.projects = [...this.projects, ...res.records]
this.pages = res.pages
this.projects.forEach(projectItem => {
projectItem.adcdName = this.formatAdcd(projectItem)
projectItem.projectTypeName = this.projectTypeFormat(projectItem)
})
uni.hideLoading()
})
},
// 稿
getProjectApplyList() {
uni.showLoading({
title: '加载中...',
mask: true
})
projectApplyListApi(this.queryParams).then(res => {
this.projects = [...this.projects, ...res.records]
this.pages = res.pages
this.projects.forEach(projectItem => {
projectItem.adcdName = this.formatAdcd(projectItem)
projectItem.projectTypeName = this.projectTypeFormat(projectItem)
projectItem.checkStatusName = this.reviewFormat(projectItem)
})
uni.hideLoading()
})
},
// ,
handleAddressTreeData() {
let result = [];
function traverse(node) {
result.push({ code: node.code, name: node.name, dictLabel: node.name, dictValue: node.code}); //
if (node.children) {
node.children.forEach(child => traverse(child)); //
}
}
this.addressTreeList.forEach(node => traverse(node)); //
this.addressList = result
this.addressList.forEach(item => {
if (item.code.length===2) {
item.code = item.dictValue = item.code + '0000'
}
if (item.code.length===4) {
item.code = item.dictValue = item.code + '00'
}
})
},
//
formatAdcd(row) {
if (row.adcd) {
let provinceCode = row.adcd.slice(0, 2)+"0000";
let cityCode = row.adcd.slice(0, 4)+"00";
let areaCode = row.adcd;
let s="";
if (areaCode.length > 2) {
s=this.areaCodeFormat(provinceCode)
if (cityCode!=provinceCode){
s+="-"+this.areaCodeFormat(cityCode)
}
if (areaCode!=cityCode){
s+="-" + this.areaCodeFormat(areaCode)
}
}
return s
}
},
//
areaCodeFormat(adcd, column) {
return this.selectDictLabel(
this.addressList,
adcd
);
},
//
projectTypeFormat(row, column) {
if (row.isMajor == "zd") {
return this.selectDictLabel(
this.zd_projectTypeOptions,
row.projectType
);
} else if (row.isMajor == "ms") {
return this.selectDictLabel(
this.ms_projectTypeOptions,
row.projectType
);
}else if (row.isMajor !=null){
return '其他'
}
},
//
reviewFormat(row, column){
return this.selectDictLabel(
this.reviewStatus,
row.applicationStatus,
);
},
//
handleOpenSelect() {
this.visible = true
},
cancel () {
this.visible = false
},
confirm (val) {
console.log(val)
this.str = JSON.stringify(val)
this.cityName = val.name
this.visible = false
},
//
onProjectTypePickerChange(event) {
this.projectType = this.projectTypes[event.detail.value]
},
//
onCheckStatusPickerChange(event) {
this.checkStatus = this.checkStatusOption[event.detail.value]
},
handleAddProject() {
//
@ -155,161 +381,5 @@ export default {
<style lang="scss" scoped>
.project {
// padding: 20px;
.tabs {
height: 48px;
display: flex;
justify-content: space-around;
background-color: #fff;
.tab {
flex: 1;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
color: #595959;
cursor: pointer;
&.active {
color: #00B39D;
.tab-text {
position: relative;
height: 100%;
display: flex;
align-items: center;
&::after {
content: '';
position: absolute;
bottom: 0;
left: 0;
width: 100%;
height: 3px;
background: #00B39D;
}
}
}
}
}
// .search-bar {
// padding: 12px 25px;
// background: #fff;
// border-top: 1px solid #f0f0f0;
// border-bottom: 1px solid #f0f0f0;
// .search-box {
// padding: 8px 20px;
// background: #f7f8fa;
// border-radius: 8px;
// }
// input {
// width: 100%;
// border: none;
// border-radius: 5px;
// }
// }
.dropdowns {
height: 48px;
background: #fff;
display: flex;
justify-content: space-between;
uni-picker {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.dropdown {
flex: 1;
}
}
.project-list {
padding: 0 20px 95px;
.project-card {
background-color: #fff;
padding: 20px 0 0 0;
margin-top: 10px;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0,0,0,0.1);
margin-top: 15px;
.attr-item {
display: flex;
justify-content: space-between;
color: #262626;
padding: 0 20px 20px 20px;
padding-bottom: 15px;
.attr-title {
font-size: 16px;
color: #595959;
}
.attr-value {
&.no-done {
color: #FF0000;
}
}
}
.operate-buttons {
border-top: 1px solid #f0f0f0;
display: flex;
height: 48px;
box-sizing: border-box;
.buttons-group {
width: 100%;
height: 100%;
display: flex;
&:nth-child(1) {
.button {
border-right: 1px solid #f0f0f0;
&:nth-last-child(1) {
border-right: 0;
}
}
}
}
.button {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
&.primary-button__text {
color: #00B39D;
}
&.error-button__text {
color: #E04040;
}
}
}
}
.project-title {
font-size: 18px;
}
}
.operation-buttons {
position: fixed;
bottom: 0;
left: 0;
width: 100%;
height: 80px;
padding: 16px 20px;
background: #fff;
border-top: 1px solid #f0f0f0;
.buttons-group {
height: 100%;
display: flex;
align-items: center;
justify-content: space-around;
.button {
cursor: pointer;
}
.primary-button {
flex: 1;
height: 100%;
display: flex;
align-items: center;
justify-content: center;
color: #fff;
background-color: #00B39D;
border-radius: 8px;
}
}
}
}
</style>

201
jwtech-h5-page/pages/statistics/index.vue

@ -11,45 +11,52 @@
</view>
<view class="chart-list">
<!-- <view class="chart-list">
<view class="cc-card card">
<view class="card-header">项目投资统计</view>
<echarts ref="echarts" :option="option" canvasId="echarts"></echarts>
</view> -->
<!-- 项目投资统计柱形图卡片 -->
<view class="cc-card card">
<view class="card-header">项目投资统计</view>
<canvas id="investmentChart"></canvas>
<echarts ref="investmentChart" :option="investmentChartOption" canvasId="investmentChart"></echarts>
<!-- <canvas id="investmentChart"></canvas> -->
</view>
<!-- 项目分类统计柱形图卡片 -->
<view class="cc-card card">
<view class="card-header">项目分类统计</view>
<!-- <ec-canvas id="categoryChart" :ec="categoryChartOption"></ec-canvas> -->
<canvas id="categoryChart"></canvas>
<echarts ref="categoryChart" :option="categoryChartOption" canvasId="categoryChart"></echarts>
<!-- <canvas id="categoryChart"></canvas> -->
</view>
<!-- 项目类型统计饼图卡片 -->
<view class="cc-card card">
<view class="card-header">项目类型统计</view>
<!-- <ec-canvas id="typeChart" :ec="typeChartOption"></ec-canvas> -->
<canvas id="typeChart"></canvas>
<echarts ref="typeChart" :option="typeChartOption" canvasId="typeChart"></echarts>
<!-- <canvas id="typeChart"></canvas> -->
</view>
<!-- 项目状态统计饼图卡片 -->
<view class="cc-card card">
<view class="card-header">项目状态统计</view>
<!-- <ec-canvas id="statusChart" :ec="statusChartOption"></ec-canvas> -->
<canvas id="statusChart"></canvas>
<echarts ref="statusChart" :option="statusChartOption" canvasId="statusChart"></echarts>
<!-- <canvas id="statusChart"></canvas> -->
</view>
<!-- 项目行政区划分布统计饼图卡片 -->
<view class="cc-card card">
<view class="card-header">项目行政区划分布统计</view>
<!-- <ec-canvas id="districtChart" :ec="districtChartOption"></ec-canvas> -->
<canvas id="districtChart"></canvas>
<echarts ref="districtChart" :option="districtChartOption" canvasId="districtChart"></echarts>
<!-- <canvas id="districtChart"></canvas> -->
</view>
<!-- 项目预警统计饼图卡片 -->
<view class="cc-card card">
<view class="card-header">项目预警统计</view>
<!-- <ec-canvas id="warningChart" :ec="warningChartOption"></ec-canvas> -->
<canvas id="warningChart"></canvas>
<echarts ref="warningChart" :option="warningChartOption" canvasId="warningChart"></echarts>
<!-- <canvas id="warningChart"></canvas> -->
</view>
</view>
@ -63,9 +70,10 @@
</template>
<script>
import * as echarts from 'echarts'; // echarts
import { ref, onMounted } from 'vue'; // 使 Vue 3 API
// import * as echarts from 'echarts'; // echarts
// import * as echarts from '../../components/echarts-uniapp/echarts.min.js';
import { getSourceFundsNumApi } from '@/api/system/projectStatistics'
export default {
data() {
return {
@ -80,16 +88,73 @@ export default {
statusChartOption: null,
districtChartOption: null,
warningChartOption: null,
option: {},
//
projectInvestInfo: [],
sourceFound: {},
adcd: []
};
},
onReady() {
this.option = {
}
},
mounted() {
console.log(123)
this.getProjectInvestData()
},
methods: {
getProjectInvestData() {
getSourceFundsNumApi({ year: '2024' }).then(res => {
this.sourceFound = res.data
this.adcd = Object.keys(this.sourceFound)
this.barInit()
})
},
onDistrictChange(e) {
console.log('选择的行政区划:', this.districts[e.detail.value]);
},
//
initInvestmentChart() {
const chart = echarts.init(document.getElementById('investmentChart'));
barInit() {
const progressPlanValues = Object.values(this.sourceFound).map(obj => obj.progressPlan);
const actualValues = Object.values(this.sourceFound).map(obj => obj.actual);
const maxProgressPlan = Math.max(...progressPlanValues);
const maxActual = Math.max(...actualValues);
// undefined
const validIndices = this.adcd
.map((item, index) => codeToText[item] ? index : null)
.filter(index => index !== null);
// xAxis
const filteredData = this.adcd
.filter((item, index) => validIndices.includes(index))
.map(item => codeToText[item]);
// series
const filteredSourceFound = Object.values(this.sourceFound)
.filter((_, index) => validIndices.includes(index));
const indexedSourceFound = filteredSourceFound.map((obj, index) => ({ ...obj, index }));
const indexedActuals = indexedSourceFound.map(obj => obj.actual);
// actuals
const sortedByActuals = indexedSourceFound
.map(obj => ({ ...obj, actual: indexedActuals[obj.index] }))
.sort((a, b) => b.actual - a.actual);
//
const sortedIndices = sortedByActuals.map(obj => obj.index);
// filteredData filteredSourceFound
const sortedFilteredData = sortedIndices.map(index => filteredData[index]);
const sortedFilteredSourceFound = sortedIndices.map(index => filteredSourceFound[index]);
const progressPlans = sortedFilteredSourceFound.map(obj => obj.progressPlan);
const actuals = sortedFilteredSourceFound.map(obj => obj.actual);
const option = {
tooltip: {
trigger: 'axis',
@ -115,7 +180,7 @@ export default {
},
xAxis: {
type: 'category',
data: ['北京市', '上海市', '广东省', '浙江省', '江苏省', '山东省', '河北省', '河南省', '湖北省', '湖南省'],
data: sortedFilteredData,
axisLabel: {
interval: 0, // X
rotate: 45, // X
@ -156,7 +221,7 @@ export default {
{
name: '年度计划',
type: 'bar',
data: [120, 200, 150, 80, 70, 110, 95, 130, 115, 100],
data: progressPlans,
barWidth: '35%', //
itemStyle: {
color: '#00b39d', //
@ -165,20 +230,26 @@ export default {
{
name: '实际完成',
type: 'bar',
data: [100, 180, 130, 60, 50, 90, 80, 120, 110, 90],
data: actuals,
barWidth: '35%',
itemStyle: {
color: '#00a7ee', //
},
},
],
};
chart.setOption(option);
}
this.investmentChartOption = option;
},
//
initInvestmentChart() {
// const chart = echarts.init(document.getElementById('investmentChart'));
},
//
initCategoryChart() {
const chart = echarts.init(document.getElementById('categoryChart'));
// const chart = echarts.init(document.getElementById('categoryChart'));
const option = {
tooltip: {
trigger: 'axis',
@ -263,12 +334,12 @@ export default {
],
};
this.categoryChartOption = option;
chart.setOption(option);
// chart.setOption(option);
},
//
initTypeChart() {
const chart = echarts.init(document.getElementById('typeChart'));
// const chart = echarts.init(document.getElementById('typeChart'));
const data = [
{
value: 2088,
@ -348,7 +419,7 @@ export default {
type: 'pie',
center: ['32%', '50%'], //
radius: ['80%', '60%'], //
avoidLabelOverlap: false,
// avoidLabelOverlap: false,
itemStyle: {
borderRadius: 0,
borderColor: '#fff',
@ -374,50 +445,50 @@ export default {
},
}
],
graphic: [
{
type: 'text',
top: '40%',
left: '28%',
style: {
text: '合计', //
font: '16px Microsoft YaHei', //
fill: '#333' //
},
// 使
// textAlign: 'center',
// textVerticalAlign: 'middle'
},
{
type: 'text',
top: '53%',
left: '24%',
style: {
text: total, //
font: 'bold 24px Microsoft YaHei', //
fill: '#262626' //
},
// 使
// textAlign: 'center',
// textVerticalAlign: 'middle'
// 使
// silent: true,
// top: 'center', // 使
// graphic: [
// {
// type: 'text',
// top: '40%',
// left: '28%',
// style: {
// textAlign: 'center',
// textVerticalAlign: 'middle',
// text: '', //
// font: '16px Microsoft YaHei', //
// fill: '#333' //
// },
// // 使
// // textAlign: 'center',
// // textVerticalAlign: 'middle'
// },
// {
// type: 'text',
// top: '53%',
// left: '24%',
// style: {
// text: total, //
// font: 'bold 24px Microsoft YaHei', //
// fill: '#262626' //
// },
// // 使
// // textAlign: 'center',
// // textVerticalAlign: 'middle'
// // 使
// // silent: true,
// // top: 'center', // 使
// // style: {
// // textAlign: 'center',
// // textVerticalAlign: 'middle',
// // }
// }
}
]
// ]
};
this.typeChartOption = option;
chart.setOption(option);
// chart.setOption(option);
},
//
initStatusChart() {
const chart = echarts.init(document.getElementById('statusChart'));
// const chart = echarts.init(document.getElementById('statusChart'));
const data = [
{
value: 2088,
@ -515,12 +586,12 @@ export default {
]
};
this.statusChartOption = option;
chart.setOption(option);
// chart.setOption(option);
},
//
initDistrictChart() {
const chart = echarts.init(document.getElementById('districtChart'));
// const chart = echarts.init(document.getElementById('districtChart'));
const data = [
{
value: 2088,
@ -663,12 +734,12 @@ export default {
]
};
this.districtChartOption = option;
chart.setOption(option);
// chart.setOption(option);
},
//
initWarningChart() {
const chart = echarts.init(document.getElementById('warningChart'));
// const chart = echarts.init(document.getElementById('warningChart'));
const data = [
{
value: 2088,
@ -811,7 +882,7 @@ export default {
]
};
this.warningChartOption = option;
chart.setOption(option);
// chart.setOption(option);
},
//

62
jwtech-h5-page/static/scss/common.scss

@ -1,6 +1,11 @@
.cc-page-wrap {
padding: 16px 20px 100px 20px;
}
// 查询类型行
.cc-query-dropdowns {
height: 48px;
// padding: 0 20px;
background: #fff;
display: flex;
justify-content: space-between;
@ -10,17 +15,32 @@
align-items: center;
justify-content: center;
}
.uni-picker {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
}
.dropdown {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
font-size: 16px;
color: #595959;
image {
flex-shrink: 0;
width: 12px;
height: 12px;
margin-left: 8px;
margin-top: 4px;
}
.d-text {
max-width: 100px;
white-space:nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
@ -61,6 +81,7 @@
align-items: center;
text-align: center;
justify-content: center;
font-size: 16px;
color: #595959;
cursor: pointer;
&.active {
@ -93,7 +114,8 @@
padding: 16px 20px;
background-color: white;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
// box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
box-shadow: 0px 2px 8px 0px #0000000F;
margin-bottom: 16px;
&:nth-last-child(1) {
margin-bottom: 0;
@ -104,6 +126,41 @@
color: #262626;
padding-bottom: 16px;
}
// background-color: white;
// padding: 20px;
// border-radius: 10px;
// box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
.form-title {
font-size: 18px;
padding-bottom: 16px;
}
.form-item {
.form-label {
font-size: 14px;
color: #595959;
margin-bottom: 6px;
display: block;
}
margin-bottom: 20px;
.form-content {
position: relative;
padding-bottom: 16px;
border-bottom: 1px solid #f0f0f0;
.form-input {
width: 100%;
height: 30px;
border-radius: 5px;
font-size: 16px;
color: #262626;
}
.form-select {
position: absolute;
bottom: 4px;
right: 0;
color: #00B39D;
}
}
}
}
// 底部按钮
@ -183,6 +240,9 @@
.cc-project-list {
padding: 0 20px 95px;
&.no-bottom {
padding-bottom: 15px;
}
.project-card {
background-color: #fff;
padding: 20px 0 0 0;

1
jwtech-h5-page/static/scss/global.scss

@ -1,4 +1,5 @@
html {
font-size: 16px;
color: #262626;
}

20
jwtech-h5-page/store/modules/user.js

@ -46,19 +46,19 @@ const user = {
const uuid = userInfo.uuid
return new Promise((resolve, reject) => {
// 这个是测试用的
const res = {
token: 'admin-token'
}
setToken(res.token)
commit('SET_TOKEN', res.token)
resolve()
// login(username, password, code, uuid).then(res => {
// const res = {
// token: 'admin-token'
// }
// setToken(res.token)
// commit('SET_TOKEN', res.token)
// resolve()
// }).catch(error => {
// reject(error)
// })
login(username, password, code, uuid).then(res => {
setToken(res.token)
commit('SET_TOKEN', res.token)
resolve()
}).catch(error => {
reject(error)
})
})
},

22
jwtech-h5-page/uni_modules/piaoyi-cityPicker/changelog.md

@ -0,0 +1,22 @@
## 1.1.7(2024-10-29)
修复底部露出部分组件bug
## 1.1.6(2024-08-20)
更新本地数据源为最新数据源
## 1.1.5(2024-06-12)
使用说明文档优化
## 1.1.4(2024-06-12)
增加问题反馈描述
## 1.1.3(2024-02-29)
更新使用文档
## 1.1.2(2024-01-16)
解决Vue3项目导入导出报错问题
## 1.1.1(2023-12-06)
defaultValue可以传入defaultValue:['河北省','唐山市','丰南区']数组类型以及defaultValue: '420103'地区编码字符串类型
## 1.1.0(2023-12-05)
即默认值传入地区编码,也支持传入中文省市区数组
## 1.0.9(2023-12-04)
优化
## 1.0.8(2023-10-24)
修复东菀市和中山市下各镇的行政编码错误问题
## 1.0.4(2023-09-15)
改为uni_modules规范

10661
jwtech-h5-page/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/cityData.js

File diff suppressed because it is too large

282
jwtech-h5-page/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker.vue

@ -0,0 +1,282 @@
<template>
<view class="pupop">
<view class="popup-box" :animation="animationData">
<view class="pupop-btn">
<view @tap="cancel" style="font-size: 17px;color: #888;">取消</view>
<view @tap="confirm" style="font-size: 17px;color: #007aff;">完成</view>
</view>
<picker-view :value="value" :indicator-style="indicatorStyle" @change="bindChange" class="picker-view">
<picker-view-column>
<view class="item" v-for="(item,index) in provinceList" :key="index">{{item.name}}</view>
</picker-view-column>
<picker-view-column>
<view class="item" v-for="(item,index) in cityList" :key="index">{{item.name}}</view>
</picker-view-column>
<picker-view-column v-if="column == 3">
<view class="item" v-for="(item,index) in areaList" :key="index">{{item.name}}</view>
</picker-view-column>
</picker-view>
</view>
<view @tap="close" @touchmove.stop.prevent :class="visible ? 'pupop-model' : 'pupop-models'"></view>
</view>
</template>
<script>
import {
addressList
} from './cityData.js'
export default {
data() {
return {
value: [],
addressList,
provinceList: [],
cityList: [],
areaList: [],
indicatorStyle: `height: 50px;`,
provinceIndex: 0,
cityIndex: 0,
areaIndex: 0,
animationData: {}
}
},
props: {
column: {
type: Number,
default: 3
},
defaultValue: {
default: () => ''
},
visible: {
type: Boolean,
default: () => false
},
maskCloseAble: {
type: Boolean,
default: () => true
},
},
watch: {
visible (val) {
this.changeActive()
},
defaultValue() {
this.init()
}
},
created() {
this.init()
},
methods: {
init () {
var provinceList = []
addressList.filter(item => {
provinceList.push({
code: item.code,
name: item.name
})
})
this.provinceList = [...provinceList]
if (!this.defaultValue) {
this.cityList = addressList[0].children
this.areaList = addressList[0].children[0].children
} else {
var city = {11:"北京",12:"天津",13:"河北",14:"山西",15:"内蒙古",21:"辽宁",22:"吉林",23:"黑龙江 ",31:"上海",32:"江苏",33:"浙江",34:"安徽",35:"福建",36:"江西",37:"山东",41:"河南",42:"湖北 ",43:"湖南",44:"广东",45:"广西",46:"海南",50:"重庆",51:"四川",52:"贵州",53:"云南",54:"西藏 ",61:"陕西",62:"甘肃",63:"青海",64:"宁夏",65:"新疆",71:"台湾",81:"香港",82:"澳门",91:"国外 "}
if (Array.isArray(this.defaultValue) && this.defaultValue.length >= 2) {
console.log(this.defaultValue)
var province = this.defaultValue[0]
var city = this.defaultValue[1]
this.provinceIndex = 0
this.cityIndex = 0
this.areaIndex = 0
this.provinceIndex = addressList.findIndex(obj => {
return obj.name == province
})
this.provinceIndex = this.provinceIndex >= 0 ? this.provinceIndex : 0
this.cityList = addressList[this.provinceIndex].children
this.cityIndex = this.cityList.findIndex(obj => {
return obj.name == city
})
this.cityIndex = this.cityIndex >= 0 ? this.cityIndex : 0
this.areaList = this.cityList[this.cityIndex].children
if (this.defaultValue.length > 2) {
this.areaIndex = this.areaList.findIndex(obj => {
return obj.name == this.defaultValue[2]
})
}
this.areaIndex = this.areaIndex >= 0 ? this.areaIndex : 0
this.$nextTick(() => {
if (this.column == 3) {
this.value = JSON.parse(JSON.stringify([this.provinceIndex, this.cityIndex, this.areaIndex]))
} else if (this.column == 2) {
this.value = JSON.parse(JSON.stringify([this.provinceIndex, this.cityIndex]))
}
})
} else if (/^\d{6}$/.test(this.defaultValue)) {
var province = this.defaultValue.substr(0, 2)
var city = this.defaultValue.substr(0, 4)
this.provinceIndex = 0
this.cityIndex = 0
this.areaIndex = 0
this.provinceIndex = addressList.findIndex(obj => {
return obj.code == province
})
this.provinceIndex = this.provinceIndex >= 0 ? this.provinceIndex : 0
this.cityList = addressList[this.provinceIndex].children
this.cityIndex = this.cityList.findIndex(obj => {
return obj.code == city
})
this.cityIndex = this.cityIndex >= 0 ? this.cityIndex : 0
this.areaList = this.cityList[this.cityIndex].children
this.areaIndex = this.areaList.findIndex(obj => {
return obj.code == this.defaultValue
})
this.areaIndex = this.areaIndex >= 0 ? this.areaIndex : 0
this.$nextTick(() => {
if (this.column == 3) {
this.value = JSON.parse(JSON.stringify([this.provinceIndex, this.cityIndex, this.areaIndex]))
} else if (this.column == 2) {
this.value = JSON.parse(JSON.stringify([this.provinceIndex, this.cityIndex]))
}
})
} else {
uni.showToast({
title: '地区编码格式不正确',
icon: 'none'
})
console.log('地区编码格式不正确')
}
}
this.changeActive()
},
confirm () {
if (this.column == 3) {
this.$emit('confirm', {
code: addressList[this.provinceIndex].children[this.cityIndex].children[this.areaIndex].code,
name: addressList[this.provinceIndex].name + addressList[this.provinceIndex].children[this.cityIndex].name + addressList[this.provinceIndex].children[this.cityIndex].children[this.areaIndex].name,
provinceName: addressList[this.provinceIndex].name,
cityName: addressList[this.provinceIndex].children[this.cityIndex].name,
areaName: addressList[this.provinceIndex].children[this.cityIndex].children[this.areaIndex].name
})
} else if (this.column == 2) {
this.$emit('confirm', {
code: addressList[this.provinceIndex].children[this.cityIndex].children[this.areaIndex].code.substring(0, 4) + '00',
name: addressList[this.provinceIndex].name + addressList[this.provinceIndex].children[this.cityIndex].name,
provinceName: addressList[this.provinceIndex].name,
cityName: addressList[this.provinceIndex].children[this.cityIndex].name
})
} else {
uni.showToast({
title: '目前column只能传2和3',
icon: 'none'
})
}
},
cancel () {
this.$emit('cancel')
},
//
changeActive () {
var active = '-415px'
if (this.visible) {
active = 0
}
var animation = uni.createAnimation({
duration: 400,
timingFunction: 'linear'
})
animation.bottom(active).step()
this.animationData = animation.export()
},
bindChange(e) {
e.detail.value[0] = e.detail.value[0] || 0
e.detail.value[1] = e.detail.value[1] || 0
e.detail.value[2] = e.detail.value[2] || 0
if (e.detail.value[0] != this.provinceIndex) {
// console.log('')
this.provinceChange(e.detail.value[0])
} else if (e.detail.value[1] != this.cityIndex) {
// console.log('')
this.cityChange(e.detail.value[1])
} else if (e.detail.value[2] != this.areaIndex) {
// console.log('')
this.areaChange(e.detail.value[2])
}
},
//
provinceChange (e) {
this.provinceIndex = e
this.cityIndex = 0
this.areaIndex = 0
this.value = [...[e, 0, 0]]
this.cityList = addressList[e].children
this.areaList = addressList[e].children[0].children
},
//
cityChange (e) {
this.cityIndex = e
this.areaIndex = 0
// console.log(this.cityIndex, this.areaIndex)
this.value = [...[this.provinceIndex, e, 0]]
this.cityList = addressList[this.provinceIndex].children
this.areaList = addressList[this.provinceIndex].children[e].children
},
//
areaChange (e) {
this.areaIndex = e
},
//
close () {
if (this.maskCloseAble) {
this.cancel()
}
}
}
}
</script>
<style scoped lang="scss">
.pupop {
.popup-box {
position: fixed;
left: 0;
bottom: -315px;
z-index: 99999;
background: #fff;
padding-bottom: 50px;
.pupop-btn{
height: 45px;
display: flex;
align-items: center;
padding: 0 30upx;
justify-content: space-between;
border-bottom: 1px solid #f5f5f5;
}
}
.pupop-model {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
z-index: 9999;
background: rgba(0, 0, 0, .5);
}
.pupop-models{
display: none;
}
.picker-view {
width: 750rpx;
height: 225px;
margin-top: 20rpx;
}
.item {
height: 50px;
align-items: center;
justify-content: center;
text-align: center;
line-height: 50px;
}
}
</style>

17
jwtech-h5-page/uni_modules/piaoyi-cityPicker/package.json

@ -0,0 +1,17 @@
{
"id": "piaoyi-cityPicker",
"name": " data-cityPicker省市区地址选择器",
"displayName": " data-cityPicker省市区地址选择器(兼容vue3)",
"version": "1.1.7",
"description": "常用省市区选择器,可反选,自定义模态框、兼容vue3",
"keywords": [
"省市区",
"选择器",
"可反选",
"自定义模态框和弹框",
"兼容vue3"
],
"dcloudext": {
"type": "component-vue"
}
}

106
jwtech-h5-page/uni_modules/piaoyi-cityPicker/readme.md

@ -0,0 +1,106 @@
## 1.0.7(2023-09-15)
改为uni_modules规范
### cityPicker 省市区选择器(兼容vue3)
**使用方法:**
```
<template>
<view>
<button @tap="open">打开</button>
<cityPicker :column="column" :default-value="defaultValue" :mask-close-able="maskCloseAble" @confirm="confirm" @cancel="cancel" :visible="visible"/>
<view>{{str}}</view>
</view>
</template>
<script>
import cityPicker from '@/uni_modules/piaoyi-cityPicker/components/piaoyi-cityPicker/piaoyi-cityPicker'
export default {
data() {
return {
visible: false,
maskCloseAble: true,
str: '',
defaultValue: '420103',
// defaultValue: ['河北省','唐山市','丰南区'],
column: 3
}
},
components: {
cityPicker
},
methods: {
open () {
this.visible = true
},
confirm (val) {
console.log(val)
this.str = JSON.stringify(val)
this.visible = false
},
cancel () {
this.visible = false
}
},
onShareAppMessage(res) {
if (res.from === 'button') { // 来自页面内分享按钮
console.log(res.target)
}
return {
title: 'data-cityPicker省市区地址选择器!',
path: '/pages/cityPicker/cityPicker'
}
},
onShareTimeline(res) {
if (res.from === 'button') { // 来自页面内分享按钮
console.log(res.target)
}
return {
title: 'data-cityPicker省市区地址选择器!'
}
}
}
</script>
<style lang="scss">
</style>
```
### 注:近期收到使用用户反馈,存在以下一个问题(如有好的建议,期待私信,谢谢)
1、之前只支持默认值传入地区编码,已更新可以支持传入中文省市区数组
defaultValue可以传入defaultValue:['河北省','唐山市','丰南区']数组类型以及defaultValue: '420103'地区编码字符串类型
可以使用const reg =/([\u4e00-\u9fa5]+省|自治区|[\u4e00-\u9fa5]+市|[\u4e00-\u9fa5]+区)/g;将自己的省市区数据进行处理为数组再传入
2、有些用户反馈vue3下watch监听有问题
我自己创建一个vue项目,导入插件后,按照示例原封不动进行测试,没有发现问题; 发现有问题的朋友可以提供一下可以复现的demo给我,我这边看看具体什么情况
3、有些用户返回无法关闭弹框
不要把插件放到scroll-view里面,请务必放到最外层进行使用
#### 事件说明
| 事件名 | 返回值 | 描述 |
| :---------: | :----: | :------------: |
| @confirm | 对象(code,完整地区名称) | 点击确定的回调 |
| @cancel | 无 | 点击取消的回调 |
#### Prop
| 参数名称 | 描述 |
| -------- | ------------------------------ |
| visible | 控制选择器显示和隐藏 |
| column | 可选值2和3,2是省市两列选择;3是省市区三列选择 |
| maskCloseAble | 点击模态框是否关闭弹框 |
| defaultValue | 初始地区编码(例:420102或者['河北省','唐山市','丰南区']) |
### 数据来源:[点击查看省市区数据来源](https://github.com/modood/Administrative-divisions-of-China/blob/master/dist/pca-code.json)
### 可接定制化组件开发
### 右侧有本人代表作小程序二维码,可以扫码体验
### 如使用过程中有问题或有一些好的建议,欢迎加QQ群互相学习交流:120594820

9
jwtech-h5-page/utils/request.js

@ -12,7 +12,7 @@ const request = config => {
const isToken = (config.headers || {}).isToken === false
config.header = config.header || {}
if (getToken() && !isToken) {
config.header['Authorization'] = 'Bearer ' + getToken()
config.header['jianwei'] = 'jwtech ' + getToken()
}
// get请求映射params参数
if (config.params) {
@ -37,12 +37,13 @@ const request = config => {
}
const code = res.data.code || 200
const msg = errorCode[code] || res.data.msg || errorCode['default']
if (code === 401) {
if (code === 401 || code === 403) {
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
if (res.confirm) {
store.dispatch('LogOut').then(res => {
uni.reLaunch({ url: '/pages/login' })
})
// store.dispatch('LogOut').then(res => {
// uni.reLaunch({ url: '/pages/login' })
// })
}
})
reject('无效的会话,或者会话已过期,请重新登录。')

195
jwtech-h5-page/utils/ruoyi.js

@ -0,0 +1,195 @@
import request from '@/utils/request'
/**
* 通用js方法封装处理
* Copyright (c) 2019 ruoyi
*/
const baseURL = process.env.VUE_APP_BASE_API
// 日期格式化
export function parseTime(time, pattern) {
if (arguments.length === 0 || !time) {
return null
}
const format = pattern || '{y}-{m}-{d} {h}:{i}:{s}'
let date
if (typeof time === 'object') {
date = time
} else {
if ((typeof time === 'string') && (/^[0-9]+$/.test(time))) {
time = parseInt(time)
} else if (typeof time === 'string') {
time = time.replace(new RegExp(/-/gm), '/');
}
if ((typeof time === 'number') && (time.toString().length === 10)) {
time = time * 1000
}
date = new Date(time)
}
const formatObj = {
y: date.getFullYear(),
m: date.getMonth() + 1,
d: date.getDate(),
h: date.getHours(),
i: date.getMinutes(),
s: date.getSeconds(),
a: date.getDay()
}
const time_str = format.replace(/{(y|m|d|h|i|s|a)+}/g, (result, key) => {
let value = formatObj[key]
// Note: getDay() returns 0 on Sunday
if (key === 'a') { return ['日', '一', '二', '三', '四', '五', '六'][value] }
if (result.length > 0 && value < 10) {
value = '0' + value
}
return value || 0
})
return time_str
}
// 表单重置
export function resetForm(refName) {
if (this.$refs[refName]) {
this.$refs[refName].resetFields();
}
}
// 添加日期范围
export function addDateRange(params, dateRange) {
var search = params;
search.beginTime = "";
search.endTime = "";
if (null != dateRange && '' != dateRange) {
search.beginTime = this.dateRange[0];
search.endTime = this.dateRange[1];
}
return search;
}
// 回显数据字典
export function selectDictLabel(datas, value) {
var actions = [];
// console.log(datas);
// console.log(value);
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + value)) {
actions.push(datas[key].dictLabel);
return true;
}
})
// console.log(actions);
return actions.join('');
}
export function selectDictLabelBak(datas, value) {
var actions = [];
Object.keys(datas).some((key) => {
if (datas[key].value == ('' + value)) {
actions.push(datas[key].label);
return true;
}
})
console.log(actions);
return actions.join('');
}
// 回显数据字典(字符串数组)
export function selectDictLabels(datas, value, separator) {
var actions = [];
var currentSeparator = undefined === separator ? "," : separator;
var temp = value.split(currentSeparator);
Object.keys(value.split(currentSeparator)).some((val) => {
Object.keys(datas).some((key) => {
if (datas[key].dictValue == ('' + temp[val])) {
actions.push(datas[key].dictLabel + currentSeparator);
}
})
})
return actions.join('').substring(0, actions.join('').length - 1);
}
// 通用下载方法
export function download(fileName) {
console.log("下载!");
console.log(baseURL);
return request({
url: "common/download?fileName=" + encodeURI(fileName) + "&delete=" + true,
method: 'get'
});
//window.location.href = baseURL + "common/download?fileName=" + encodeURI(fileName) + "&delete=" + true;
}
// 字符串格式化(%s )
export function sprintf(str) {
var args = arguments, flag = true, i = 1;
str = str.replace(/%s/g, function () {
var arg = args[i++];
if (typeof arg === 'undefined') {
flag = false;
return '';
}
return arg;
});
return flag ? str : '';
}
// 转换字符串,undefined,null等转化为""
export function praseStrEmpty(str) {
if (!str || str == "undefined" || str == "null") {
return "";
}
return str;
}
/**
* 构造树型结构数据
* @param {*} data 数据源
* @param {*} id id字段 默认 'id'
* @param {*} parentId 父节点字段 默认 'parentId'
* @param {*} children 孩子节点字段 默认 'children'
* @param {*} rootId 根Id 默认 0
*/
export function handleTree(data, id, parentId, children, rootId) {
id = id || 'id'
parentId = parentId || 'parentId'
children = children || 'children'
rootId = rootId || Math.min.apply(Math, data.map(item => { return item[parentId] })) || 0
//对源数据深度克隆
const cloneData = JSON.parse(JSON.stringify(data))
//循环所有项
const treeData = cloneData.filter(father => {
let branchArr = cloneData.filter(child => {
//返回每一项的子级数组
return father[id] === child[parentId]
});
branchArr.length > 0 ? father.children = branchArr : [];
//返回第一层
return father[parentId] === rootId;
});
return treeData !== '' ? treeData : data;
}
// 数据合并
export function mergeRecursive(source, target) {
for (var p in target) {
try {
if (target[p].constructor == Object) {
source[p] = mergeRecursive(source[p], target[p]);
} else {
source[p] = target[p];
}
} catch (e) {
source[p] = target[p];
}
}
return source;
};
/**
* 去除所有的标签
* @param str
* @returns {*}
*/
export function delHtmlTag(str){
return str.replace(/<[^>]+>/g,"");
}
Loading…
Cancel
Save