Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
aixianling
2021-12-10 18:03:22 +08:00
8 changed files with 310 additions and 41 deletions

View File

@@ -4,17 +4,20 @@
<u-navbar title="走访慰问" back-icon-color="#fff" title-color="#fff" title-width="300" title-size="36" :border-bottom="false" :background="backgroundNavbar"> </u-navbar>
<div class="header-top">
<u-tabs :list="tabList" :is-scroll="false" :current="current" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
<u-tabs :list="tabList" :is-scroll="false" :current="currentTabs" height="96" bg-color="#3975C6" inactive-color="#fff" active-color="#fff" @change="change"></u-tabs>
</div>
<div class="header-middle">
<div class="currentLeft" v-if="current == 0">
<div class="currentLeft" v-if="currentTabs == 0">
<div class="currentLeft-top">
<div class="left">
<u-icon name="map"></u-icon>
<div class="btns" style="display: inline-block" @click="show = true">
<img src="./components/images/icon2.png" alt="" />
<ai-area-picker v-model="areaId" ref="areaIds" :areaId="areaId" @select="areaSelect" style="color: #fff"> </ai-area-picker>
<!-- <div class="btns" style="display: inline-block" @click="show = true">
<u-icon name="arrow-down"></u-icon>
</div>
</div> -->
</div>
<u-search v-model="keyword" :clearabled="true" placeholder="请输入标题" :show-action="false" bg-color="#1F5CAF" search-icon-color="#E2E8F1" color="#E2E8F1" height="58" @search="handerSearch" @clear="handerClear"></u-search>
@@ -22,7 +25,6 @@
<u-select v-model="show" :list="areaList"></u-select>
</div>
<!-- v-if="data.length > 0" -->
<div @click.stop="btnHide" class="datas" v-if="data.length > 0">
<div class="cards" @click.stop="toDetail" v-for="(item, i) in 4" :key="i">
<div class="cards-top">
@@ -62,7 +64,7 @@
</div>
</div>
<div class="currentRight" v-if="current == 1">1</div>
<div class="currentRight" v-if="currentTabs == 1">1</div>
</div>
<u-modal v-model="deletShow" content="您确认要删除该条信息吗?" :show-cancel-button="true" :mask-close-able="true" :show-title="false" @confirm="delet"></u-modal>
@@ -75,14 +77,16 @@
</template>
<script>
import { mapState } from 'vuex'
import AiEmpty from '../../components/AiEmpty.vue'
import add from './components/add.vue'
import detail from './components/detail.vue'
import AiAreaPicker from '../../components/AiAreaPicker.vue'
export default {
name: 'AppWalkask',
appName: '走访慰问',
components: { AiEmpty, add, detail },
components: { AiEmpty, add, detail, AiAreaPicker },
props: {},
data() {
return {
@@ -98,7 +102,7 @@ export default {
name: '我的走访',
},
],
current: 0,
currentTabs: 0,
show: false,
areaList: [
{
@@ -117,14 +121,44 @@ export default {
isList: true,
comp: '',
params: null,
current: 1,
areaId: '',
}
},
computed: {},
onLoad() {},
onShow() {},
computed: { ...mapState(['user']) },
created() {
console.log(this.user)
this.areaId = this.user.areaId
this.getList()
},
mounted() {},
methods: {
getList() {
this.$http
.post('/app/appvisitvondolence/list', null, {
params: {
size: 6,
current: this.current,
areaId: this.areaId,
},
})
.then((res) => {
if (res.code == 0) {
this.data = res.data.records
}
})
},
areaSelect(e) {
if (e.type == 5) {
this.areaId = e.id
} else {
return this.$u.toast('请选择到村')
}
},
change(index) {
this.current = index
this.currentTabs = index
},
toAdd(item) {
@@ -191,7 +225,13 @@ export default {
background: #3975c6;
padding: 24px 30px;
.left {
width: 50%;
width: 40%;
display: flex;
align-items: center;
img {
width: 48px;
height: 48px;
}
}
}

View File

@@ -6,11 +6,7 @@
<div class="header-content">
<u-form :model="forms" ref="uForm" label-width="auto">
<u-form-item label="区域选择" prop="areaId" required style="position: relative">
<u-input v-model="forms.areaId" disabled placeholder="请选择区域" @click="showAreaId = true" />
<u-select v-model="showAreaId" :list="areaIdlist" @confirm="changeAreaId"></u-select>
<u-icon name="arrow-right" color="#CCCCCC" style="position: absolute; top: 25px; right: 30px"></u-icon>
<ai-area-picker v-model="forms.areaId" ref="areaIds" :areaId="areaIdProps" @select="areaSelect" style="color: #333"> </ai-area-picker>
</u-form-item>
<u-form-item label="走访对象" prop="object" style="position: relative">
@@ -22,10 +18,11 @@
<u-icon name="arrow-right" color="#CCCCCC" style="position: absolute; top: 25px; right: 30px"></u-icon>
</u-form-item>
<u-form-item label="现实状态" prop="nowStstus" required style="position: relative">
<u-input v-model="forms.nowStstus" disabled placeholder="请选择走访对象" @click="showStstus = true" />
<u-form-item label="现实状态" prop="reality" required style="position: relative">
<u-input v-model="forms.reality" disabled placeholder="请选择走访对象" @click="showStstus = true" />
<u-select v-model="showStstus" :list="Objectlist" @confirm="changeStstus"></u-select>
<!-- :disabled="!forms.object" -->
<u-select v-model="showStstus" :list="$dict.getDict('realityStatus')" value-name="dictValue" label-name="dictName" @confirm="changeStstus"></u-select>
<u-icon name="arrow-right" color="#CCCCCC" style="position: absolute; top: 25px; right: 30px"></u-icon>
</u-form-item>
@@ -56,23 +53,27 @@
</template>
<script>
import { mapState } from 'vuex'
import AiUploader from '../../../components/AiUploader.vue'
import AiBack from '../../../components/AiBack.vue'
import walkObject from './walkObject.vue'
import AiAreaPicker from '../../../components/AiAreaPicker'
export default {
name: 'add',
components: { AiUploader, AiBack, walkObject },
components: { AiUploader, AiBack, walkObject, AiAreaPicker },
props: {},
data() {
return {
backgroundNavbar: {
backgroundColor: '#3975C6',
},
forms: {
areaId: '',
object: '',
nowStstus: '',
reality: '',
realitylabel: '',
things: '',
content: '',
avatar: [],
@@ -102,18 +103,22 @@ export default {
showStstus: false,
flag: false,
addList: true,
areaIdProps: '',
}
},
computed: {},
onLoad() {},
onShow() {},
computed: { ...mapState(['user']) },
created() {
this.areaIdProps = this.user.areaId
this.$dict.load('realityStatus').then(() => {})
},
mounted() {},
methods: {
submit() {
if (this.flag) return
this.$refs.uForm.validate((valid) => {
if (valid) {
if (!this.form.areaId) {
if (!this.areaId) {
return this.$u.toast('请选择走访对象')
}
if (!this.form.things) {
@@ -125,7 +130,7 @@ export default {
.post(`/appjobresume/addOrUpdate`, {
areaId: this.forms.areaId,
object: this.forms.object,
nowStstus: this.forms.nowStstus,
reality: this.forms.reality == Number ? this.forms.reality : this.forms.realitylabel,
things: this.forms.things,
content: this.forms.content,
avatar: this.forms.avatar[0],
@@ -145,10 +150,12 @@ export default {
})
},
changeAreaId(e) {
console.log(e)
this.forms.areaId = e[0].value
this.forms.areaIdValue = e[0].label
areaSelect(e) {
if (e.type == 5) {
this.forms.areaId = e.id
} else {
return this.$u.toast('请选择到村')
}
},
changeObject(e) {
@@ -159,8 +166,8 @@ export default {
changeStstus(e) {
console.log(e)
this.forms.nowStstus = e[0].value
this.forms.nowStstuslabel = e[0].label
this.forms.reality = e[0].value
this.forms.realitylabel = e[0].label
},
toWalkObject() {

View File

@@ -56,8 +56,8 @@ export default {
}
},
computed: {},
onLoad() {},
onShow() {},
created() {},
mounted() {},
methods: {},
}
</script>

Binary file not shown.

After

Width:  |  Height:  |  Size: 396 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 766 B

View File

@@ -61,8 +61,8 @@ export default {
}
},
computed: {},
onLoad() {},
onShow() {},
created() {},
mounted() {},
methods: {
checkboxGroupChange(e) {
console.log(1, e)

View File

@@ -0,0 +1,222 @@
<template>
<section class="AiAreaPicker">
<ai-search-popup mode="bottom" ref="areaSelector">
<div slot="btn" @tap="handleInit">
<slot v-if="$slots.default" />
<div v-else class="areaSelector">
<image :src="icon" class="location" />
<div v-text="currentArea.name" />
</div>
</div>
<div class="areaSelector">
<div class="fixedTop">
<span v-for="(area, i) in fullArea" :key="area.id" v-text="area.name" :class="{ current: area.id == index }" @click="selectNode(area, i)" />
</div>
<span v-text="currentArea.name" />
</div>
<div class="pendingItem flexRow" flex v-for="op in list" :key="op.id">
<div class="fill" :class="{ self: index == op.id }" v-html="op.name" @tap="handleSelect(op)" />
<u-icon v-if="index != op.id" name="arrow-right" color="#ddd" @click="getChild(op)" />
</div>
</ai-search-popup>
</section>
</template>
<script>
import AiSearchPopup from './AiSearchPopup'
import AiCell from './AiCell.vue'
import { mapState } from 'vuex'
export default {
name: 'AiAreaPicker',
components: { AiCell, AiSearchPopup },
props: {
areaId: { default: '' },
name: { default: '' },
all: Boolean,
},
computed: {
...mapState(['user']),
dataRange() {
let rules = [10, 8, 6, 3, 0],
level = 0
if (this.all) return (level = 0)
rules.some((e, i) => {
let reg = new RegExp(`0{${e}}`, 'g')
if (reg.test(this.areaId || this.user.areaId || this.$areaId)) {
return (level = i)
}
})
return level
},
currentArea() {
return this.fullArea?.slice(-1)?.[0] || {}
},
icon() {
return this.$cdn + '/img/location.svg'
},
},
data() {
return {
fullArea: [{ name: '全国', id: 0 }],
index: '',
list: [],
}
},
watch: {
areaId(v) {
v && this.getFullArea()
},
},
methods: {
getFullArea() {
let areaId = this.areaId || (this.all ? '' : this.$areaId)
areaId &&
this.$http
.post('/admin/area/getAllParentAreaId', null, {
withoutToken: true,
params: { areaId },
})
.then((res) => {
if (res?.data) {
if (res.data.length > 1) {
this.fullArea = res.data.reverse().slice(this.dataRange)
} else {
this.fullArea = res.data
}
this.fullArea.unshift({ name: '全国', id: 0 })
}
})
},
getChildAreas(id) {
id &&
this.$http
.post('/admin/area/queryAreaByParentId', null, {
withoutToken: true,
params: { id },
})
.then((res) => {
if (res?.data) {
this.list = res.data
let self = this.fullArea.find((e) => e.id == this.index)
this.list.unshift(self)
}
})
},
getProvinces() {
this.$http.post('/admin/area/queryProvinceList', null, { withoutToken: true }).then((res) => {
if (res?.data) {
this.list = res.data
}
})
},
handleSelect(op) {
if (op.id != this.index) {
this.fullArea.push(op)
this.index = op.id
}
this.$emit('select', op)
this.$emit('update:name', this.currentArea.name)
this.$refs.areaSelector?.handleSelect()
},
getChild(op) {
this.fullArea.push(op)
this.index = op.id
this.getChildAreas(op.id)
},
selectNode(area, i) {
this.fullArea.splice(i + 1, this.fullArea.length - i)
if (this.all && !area.id) {
this.index = ''
this.getProvinces()
} else {
this.index = area.id
this.getChildAreas(area.id)
}
},
handleInit() {
this.index = this.currentArea.id
if (this.all && !this.currentArea.id) this.getProvinces()
else this.getChildAreas(this.currentArea.id)
},
},
created() {
this.index = this.areaId
this.getFullArea()
},
}
</script>
<style lang="scss" scoped>
.AiAreaPicker {
::v-deep .areaSelector {
display: flex;
align-items: center;
span {
cursor: pointer;
color: #333;
&:first-of-type:before {
content: '';
padding: 0;
}
&:before {
color: #333;
content: '/';
padding: 0 16px;
}
}
.current {
color: #3f8df5;
}
.fixedTop {
position: fixed;
top: 0;
width: 100%;
left: 0;
background: #fff;
border-bottom: 4px solid #f5f5f5;
z-index: 1;
text-align: start;
padding: 0 16px;
}
}
::v-deep.u-drawer-content {
position: fixed;
.areaSelector {
padding: 0 16px;
box-sizing: border-box;
border-bottom: 16px solid #f5f5f5;
span {
line-height: 100px;
}
}
}
::v-deep.pendingItem {
color: #333;
margin-left: 32px;
padding-right: 32px;
height: 104px;
border-bottom: 1px solid #ddd;
text-align: start;
.self {
font-weight: bold;
}
}
.location {
width: 28px;
height: 80px;
margin-right: 12px;
}
}
</style>

View File

@@ -28,7 +28,7 @@
"port": "10323",
"proxy": {
"/lan": {
"target": "http://192.168.1.34:19898",
"target": "http://192.168.1.87:9000",
"changeOrigin": true,
"pathRewrite": {
"^/lan": "/"
@@ -43,4 +43,4 @@
}
}
}
}
}