Browse Source

Merge branch 'dev-fangyi0919' of http://git.elinkit.com.cn:7070/r/epmet-oper-gov into dev-fangyi0919

dev-map-local
jiangyy 3 years ago
parent
commit
1398a0f30a
  1. 19
      src/assets/scss/common.scss
  2. 386
      src/assets/scss/modules/management/detail-main.scss
  3. 2
      src/views/main-sidebar-sub-menu.vue
  4. 2
      src/views/modules/base/epidemic/natFocus/natFocusList.vue
  5. 2
      src/views/modules/base/epidemic/natFocus/natFocusListHistory.vue
  6. 3
      src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue
  7. 11
      src/views/modules/communityParty/regionalParty/activitys.vue
  8. 185
      src/views/modules/communityParty/regionalParty/activitysDetail.vue
  9. 15
      src/views/modules/communityParty/regionalParty/units.vue
  10. 167
      src/views/modules/communityParty/regionalParty/unitsDetail.vue
  11. 18
      src/views/modules/communityParty/regionalParty/unitsForm.vue
  12. 976
      src/views/modules/cpts/base/cpts/detail.vue
  13. 467
      src/views/modules/cpts/base/index.vue
  14. 24
      src/views/modules/shequzhili/csgltc/csgl.vue
  15. 149
      src/views/modules/shequzhili/csgltc/csglDetail.vue
  16. 26
      src/views/modules/shequzhili/ggfwtc/ggfw.vue
  17. 146
      src/views/modules/shequzhili/ggfwtc/ggfwDetail.vue

19
src/assets/scss/common.scss

@ -831,6 +831,23 @@ input[type="number"] {
}
// 默认输入框placeholder样式
html .el-input.is-disabled .el-input__inner {
html .el-input.is-disabled .el-input__inner,
html .el-textarea.is-disabled textarea.el-textarea__inner {
color: #333;
background-color: rgba(#000, 0.01);
border-color: rgba(#000, 0.02);
resize: none;
&::placeholder {
// color: rgba(#fff, 0);
}
}
html .el-checkbox.is-disabled.is-checked .el-checkbox__label {
color: #333;
}
html .el-form-item__label {
&::after {
content: " :";
display: inline;
color: #333;
}
}

386
src/assets/scss/modules/management/detail-main.scss

@ -0,0 +1,386 @@
@import "@/assets/scss/c/config.scss";
@import "@/assets/scss/c/function.scss";
.cell-width-area{
width: 450px
}
.div_searchmap {
z-index: 1000;
position: absolute;
top: 5px;
left: 5px;
}
.div-btn{
margin-top:50px;
// margin-bottom:20px;
display: flex;
justify-content: center;
.item_btn {
font-size: 14px;
padding: 8px 16px;
cursor: pointer;
color:#fff;
border: 1px dashed #0c81fe;
border-radius: 6px;
background-color: #0c81fe;
}
.mgl {
margin-left: 20px;
}
}
.cell-width-1{
width: 250px
}
.cell-width-long{
width: 450px
}
.cell-width-2{
width: 350px
}
.cell-width-map {
width: 200px;
}
.item_width_3 {
margin-left: 10px;
width: 150px;
}
.process-form{
margin-top:20px;
.process-title {
margin-bottom: 25px;
margin-left: -5px;
font-size: 16px;
font-family: PingFang SC;
font-weight: bold;
color: #333;
line-height: 18px;
}
.process-title-vis{
color: #fff;
}
}
.m-card {
overflow-x: auto;
}
.m-btns {
display: flex;
justify-content: center;
}
.m-info {
padding-left: 30px;
font-size: 15px;
font-family: PingFang SC;
font-weight: 400;
color: #333;
line-height: 24px;
// width: 500px;
.info-title {
margin-top: 30px;
font-size: 20px;
font-family: PingFang SC;
font-weight: bold;
color: #333;
line-height: 30px;
}
.info-content {
margin: 20px 0;
}
.info-pics {
display: flex;
margin: 20px 0;
img {
display: block;
width: 32%;
height: 90px;
margin-right: 9px;
object-fit: cover;
}
}
.info-prop {
position: relative;
margin: 10px 0;
display: flex;
padding-left: 15px;
padding-top:10px;
// border-bottom: 1px solid #d8d8d8;
.line{
text-decoration:underline;
color: #3e8ef7;
}
.line:hover{
cursor:pointer
}
.info-title-2 {
flex: 0 0 100px;
font-size: 15px;
}
> span,
> div {
display: block;
// max-width: 300px;
}
&::before {
content: "";
display: block;
position: absolute;
top: 19px;
left: 0;
width: 7px;
height: 7px;
background: #0c81fe;
border-radius: 3px;
margin-right: 10px;
}
.div_map {
width:500px;
padding-top:10px
}
}
.info-prop-vis{
color:#fff;
}
}
.m-case {
height: 600px;
padding: 20px 0 20px 0;
overflow-y: auto;
}
.m-row {
// display: flex;
justify-content: space-between;
width:100%;
padding-left:50px;
}
.m-hint {
position: relative;
height: 300px;
// 暂无数据
img {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
margin: auto;
}
}
.m-line {
min-width: 400px;
.stat {
margin: 20px 0 10px;
display: flex;
.stat-item {
width: 33%;
text-align: center;
div {
font-size: 17px;
font-family: Source Han Serif SC;
font-weight: 500;
color: rgba(#000, 0.5);
line-height: 24px;
&.z-weak {
font-size: 12px;
font-family: Source Han Serif SC;
font-weight: 500;
color: rgba(#000, 0.5);
line-height: 24px;
}
}
}
}
}
.m-process {
margin-top: 30px;
margin-left: 15px;
width: 400px;
.process-title {
margin-bottom: 25px;
margin-left: -5px;
font-size: 16px;
font-family: PingFang SC;
font-weight: bold;
color: #333;
line-height: 18px;
}
.process-title-vis{
color: #fff;
}
.list {
position: relative;
box-sizing: border-box;
margin-top: 30px/2;
margin-left: 50px/2;
padding: 0 0 0 30px/2;
width: 680px/2;
border-left: 3px solid #0c81fe;
padding-right: 10px;
&::before {
content: "";
position: absolute;
z-index: 1;
display: block;
top: -2px/2;
left: -2px/2;
width: 5px/2;
height: 20px/2;
background-color: #333;
}
.item {
position: relative;
z-index: 2;
margin-bottom: 8px;
padding-bottom: 8px;
font-size: 16px;
font-family: PingFang SC;
font-weight: 400;
color: #333;
line-height: 24px;
padding-left: 20px;
padding-top: 1px;
&::before {
content: "";
display: block;
position: absolute;
top: -5px;
left: -11px;
width: 18px;
height: 18px;
background: #0c81fe;
border: 4px solid lighten(#0c81fe, 15);
border-radius: 100%;
}
&.z-on {
&::before {
background: #e08400;
border-color: lighten(#e08400, 15);
}
}
&:last-child {
margin-bottom: 0;
padding-bottom: 0;
border-bottom: none;
}
.item-row {
margin-top: -10px;
margin-bottom: 10px;
display: flex;
}
.name {
position: relative;
padding: 0 10px;
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
color: #fff;
line-height: 22px;
height: 22px;
border-radius: 10px 0 10px 0;
background-color: #0c81fe;
// background-color: #e08400;
}
.date {
margin-left: 10px;
font-size: 12px;
font-family: PingFang SC;
font-weight: 500;
color: #7ca1d2;
line-height: 25px;
}
.detail {
@include cs;
font-size: 14px;
line-height: 20px;
margin-bottom: 5px;
display: flex;
.detail-field {
flex:0 0 100px;
text-align: justify;
text-align-last: justify;
}
.detail-value {
// width: 78%;
.detail-link {
display: inline;
}
}
}
.attachement-list {
padding-left: 80px;
a {
display: block;
cursor: pointer;
color: #4df0ff;
font-size: 14px;
i {
color: #333;
}
}
}
}
.item-vis{
color:#fff
}
}
}
.m-top {
display: flex;
}
.m-chart {
min-height: 200px;
}

2
src/views/main-sidebar-sub-menu.vue

@ -48,7 +48,7 @@ export default {
)[0];
if (route) {
console.log(route);
if (route.meta.iframeURL.endsWith("【blank】")) {
if (route.meta.iframeURL.endsWith("【跳转新页面】")) {
window.open(route.meta.iframeURL.slice(0, -7));
} else {
this.$router.push({ name: route.name })

2
src/views/modules/base/epidemic/natFocus/natFocusList.vue

@ -601,6 +601,8 @@ export default {
this.natNumList.push(obj);
}
this.getValiheList();
await this.getFmOptions("isolatedState", "/sys/dict/data/dictlist", {
dictType: "isolatedState",
});

2
src/views/modules/base/epidemic/natFocus/natFocusListHistory.vue

@ -539,6 +539,8 @@ export default {
this.natNumList.push(obj);
}
this.getValiheList();
await this.getFmOptions("isolatedState", "/sys/dict/data/dictlist", {
dictType: "isolatedState",
});

3
src/views/modules/communityParty/orgActivity/activivityList/yearplanList.vue

@ -346,7 +346,7 @@ export default {
},
async handleDetail (row) {
this.icPartyActId = row.icPartyActId
this.addDiaTitle = '查看活动计划'
this.editDiaTitle = '查看规则'
this.formType = 'detail'
this.showEdit = true
@ -354,6 +354,7 @@ export default {
async handleEdit (row) {
this.icPartyActId = row.icPartyActId
this.editDiaTitle = '修改规则'
this.formType = 'edit'
this.showEdit = true

11
src/views/modules/communityParty/regionalParty/activitys.vue

@ -434,16 +434,19 @@ export default {
},
detailClosed () {
console.log(this.$refs.ref_detail)
this.$refs.ref_detail.diaDestroy()
this.detailShow = false
},
handleDetail (row) {
// this.detailShow = true
this.detailShow = true
this.formTitle = '详情'
this.formShow = true
this.$nextTick(() => {
// this.$refs.ref_detail.initForm(row)
this.$refs.ref_form.initForm('detail', row.id)
this.$refs.ref_detail.initForm(row)
// this.$refs.ref_form.initForm('detail', row.id)
})
},

185
src/views/modules/communityParty/regionalParty/activitysDetail.vue

@ -2,119 +2,67 @@
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="所属网格"
label-width="150px"
prop="gridId">
<el-select class="item_width_1"
v-model="formData.gridId"
placeholder="请选择"
clearable>
<el-option v-for="item in gridList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="服务事项"
label-width="150px"
prop="serviceMatterShow">
<span class="detail_span">{{formData.serviceMatterShow}}</span>
</el-form-item>
<el-form-item label="单位名称"
prop="unitId"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.unitName}}</span>
</el-form-item>
<el-form-item label="活动标题"
prop="title"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.title}}</span>
</el-form-item>
<el-form-item label="活动目标"
prop="target"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.target}}</span>
</el-form-item>
<el-form-item label="活动内容"
prop="target"
label-width="150px"
style="display: block">
<p class="text_p"
v-html="formData.content"></p>
</el-form-item>
<el-form-item label="服务人数"
style="display: block"
prop="peopleCount"
label-width="150px">
<span class="detail_span">{{formData.peopleCount}}</span>
</el-form-item>
<el-form-item label="活动时间"
style="display: block"
prop="activityTime"
label-width="150px">
<span class="detail_span">{{formData.activityTime}}</span>
</el-form-item>
<el-form-item label="活动地址"
prop="address"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.address}}</span>
</el-form-item>
<el-form-item label="活动坐标"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div id="app">
</div>
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">所属网格</span>
<span>{{ formData.gridName }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务事项</span>
<span>{{ formData.serviceMatterShow }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">活动标题</span>
<span>{{ formData.title }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">活动目标</span>
<span>{{ formData.target }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">活动内容</span>
<p class="text_p"
v-html="formData.content"></p>
</div>
<div class="info-prop">
<span class="info-title-2">服务人数</span>
<span>{{ formData.peopleCount }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">活动时间</span>
<span>{{ formData.activityTime }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">活动地址</span>
<span>{{ formData.address }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">活动地图</span>
<div class="div_map">
</el-form-item>
<div id="app_act_detail"></div>
<el-form-item label="活动成果"
prop="result"
label-width="150px"
style="display: block">
</div>
</div>
<div class="info-prop">
<span class="info-title-2">活动成果</span>
<p class="text_p"
v-html="formData.result"></p>
<p class="text_p"
v-html="formData.result"></p>
</div>
</div>
</div>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<!-- <div class="div-btn">
<el-button size="small"
@click="handleCancle"> </el-button>
@click="handleCancle"> </el-button>
</div>
</div> -->
</div>
</template>
@ -134,6 +82,7 @@ export default {
data () {
return {
formData: {},
initLoading: false
}
},
components: {},
@ -142,11 +91,19 @@ export default {
},
methods: {
handleCancle () {
handleCancle () {
this.diaDestroy()
this.$emit('diaClose')
},
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row) {
this.startLoading()
@ -160,8 +117,11 @@ export default {
}
this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.initLoading = true
this.$nextTick(() => {
this.initMap()
})
this.endLoading()
@ -170,9 +130,9 @@ export default {
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
map = new window.TMap.Map(document.getElementById('app_act_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
@ -308,17 +268,10 @@ export default {
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
<style lang="scss" scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.text_p {
margin: 0 0;
border: 3px;

15
src/views/modules/communityParty/regionalParty/units.vue

@ -285,9 +285,9 @@
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
@closed="diaDetailClose">
<units-detail ref="ref_detail"
@diaClose="diaClose"></units-detail>
@diaDetailClose="diaDetailClose"></units-detail>
</el-dialog>
<!-- 完成情况 -->
@ -475,12 +475,17 @@ export default {
this.finishDiaShow = false
this.scoreDiaShow = false
},
diaDetailClose () {
console.log(this.$refs.ref_detail)
this.$refs.ref_detail.diaDestroy()
this.detailShow = false
},
handleDetail (row) {
this.formTitle = '详情'
this.formShow = true
// this.formTitle = ''
this.detailShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.id)
this.$refs.ref_detail.initForm(row)
})
},

167
src/views/modules/communityParty/regionalParty/unitsDetail.vue

@ -2,94 +2,70 @@
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="单位名称:"
prop="unitName"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.unitName}}</span>
</el-form-item>
<el-form-item label="分类:"
prop="type"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.type}}</span>
</el-form-item>
<el-form-item label="服务事项:"
prop="serviceMatterList"
label-width="150px"
style="display: block">
<p class="detail_span"
v-for="(item,index) in formData.serviceMatterList"
:key="index">{{item}}</p>
</el-form-item>
<el-form-item label="联系人:"
prop="contact"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.contact}}</span>
</el-form-item>
<el-form-item label="联系电话:"
prop="contactMobile"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.contactMobile}}</span>
</el-form-item>
<el-form-item label="在职党员:"
style="display: block"
prop="memberCount"
label-width="150px">
<span class="detail_span">{{formData.memberCount}}</span>
</el-form-item>
<el-form-item label="备注:"
prop="remark"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.remark?formData.remark:'无'}}</span>
</el-form-item>
<el-form-item label="地理位置:"
prop="address"
label-width="150px"
style="display: block">
<span class="detail_span">{{formData.address}}</span>
</el-form-item>
<el-form-item label="位置坐标:"
prop="longitude"
label-width="150px"
style="display: block">
<div style="width:500px">
<div id="app">
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">单位名称</span>
<span>{{ formData.unitName }}</span>
</div>
</div>
<div class="info-prop">
<span class="info-title-2">分类</span>
<span>{{ formData.type }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">服务事项</span>
<span>{{ formData.serviceMatterList.join(',') }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系人</span>
<span>{{ formData.contact }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系电话</span>
<span>{{ formData.contactMobile }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">在职党员</span>
<span>{{ formData.memberCount }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">备注</span>
<span>{{ formData.remark?formData.remark:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地理位置</span>
<span>{{ formData.address }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div>
</el-form-item>
</el-form>
</div>
</div>
</div>
<div class="div_btn">
<!-- <div class="div-btn">
<el-button size="small"
@click="handleCancle"> </el-button>
@click="handleCancle"> </el-button>
</div>
</div> -->
</div>
</template>
<script>
import { Loading } from 'element-ui' // Loading
import nextTick from 'dai-js/tools/nextTick'
var map
var search
@ -102,27 +78,40 @@ export default {
data () {
return {
formData: {},
initLoading: false,
}
},
components: {},
created () {
this.initMap()
},
methods: {
handleCancle () {
this.diaDestroy()
this.$emit('diaDetailClose')
this.$emit('diaClose')
},
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row) {
this.startLoading()
this.formData = { ...row }
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.initLoading = true
console.log(this.formData)
// await nextTick(200)
this.$nextTick(() => {
this.initMap()
})
// map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.endLoading()
@ -131,9 +120,9 @@ export default {
// init
initMap () {
//
var center = new window.TMap.LatLng(36.0722275, 120.38945519)
var center = new window.TMap.LatLng(this.formData.latitude, this.formData.longitude)
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
@ -262,21 +251,9 @@ export default {
}
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
<style scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.form {
margin-top: 30px;
}
</style>

18
src/views/modules/communityParty/regionalParty/unitsForm.vue

@ -204,7 +204,7 @@ export default {
components: {},
mounted () {
this.initMap()
// this.initMap()
},
methods: {
@ -234,8 +234,13 @@ export default {
}
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
this.$nextTick(() => {
this.initMap()
this.setMarker(this.formData.latitude, this.formData.longitude)
})
this.endLoading()
@ -283,8 +288,6 @@ export default {
}
},
async handleComfirm () {
this.btnDisable = true
@ -328,6 +331,7 @@ export default {
message: '操作成功'
})
this.resetData()
this.$emit('dialogOk')
this.btnDisable = false
} else {
@ -456,6 +460,10 @@ export default {
resetData () {
if (map) {
console.log(map)
map.destroy()
}
this.unitId = ''
this.keyWords = ''
this.formData = {

976
src/views/modules/cpts/base/cpts/detail.vue

@ -0,0 +1,976 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form
v-if="iniLoaded"
ref="ref_form"
:model="fmData"
:inline="true"
:disabled="formType === 'watch'"
class="m-fm"
:class="editParamsDiv ? 'z-div' : ''"
>
<div class="list">
<el-form-item
v-for="item in editParams"
class="item"
label-width="140px"
style="display: block"
:key="'edit' + item.keyName"
:label="item.field"
:prop="item.keyName"
:rules="item.rules || []"
>
<template v-if="item.type == 'switch'">
<el-switch
v-model="fmData[item.keyName]"
size="small"
:active-text="item.activeText || ''"
:inactive-text="item.inactiveText || ''"
:active-value="item.activeValue || true"
:inactive-value="item.inactiveValue || false"
>
</el-switch>
</template>
<template v-if="item.type == 'input'">
<el-input
v-if="
formType == 'add' || (formType == 'edit' && !item.editDisable)
"
v-model="fmData[item.keyName]"
class="item-input"
size="small"
clearable
show-word-limit
:maxlength="item.maxlength || ''"
:placeholder="item.placeholder || '请输入'"
>
</el-input>
<div class="item-show" v-else>
{{ fmData[item.keyName] || "--" }}
</div>
</template>
<template v-if="item.type == 'textarea'">
<el-input
v-if="
formType == 'add' || (formType == 'edit' && !item.editDisable)
"
v-model="fmData[item.keyName]"
type="textarea"
class="item-input"
size="small"
clearable
show-word-limit
:rows="3"
:maxlength="item.maxlength || ''"
:placeholder="item.placeholder || '请输入'"
>
</el-input>
<div class="item-show" v-else>
{{ fmData[item.keyName] || "--" }}
</div>
</template>
<template v-if="item.type == 'date'">
<el-date-picker
v-if="
formType == 'add' || (formType == 'edit' && !item.editDisable)
"
v-model="fmData[item.keyName]"
:picker-options="item.pickerOptions"
class="item-input"
size="small"
clearable
show-word-limit
:value-format="item.format || 'yyyy-MM-dd'"
:placeholder="item.placeholder || '请输入'"
>
</el-date-picker>
<div class="item-show" v-else>
{{ fmData[item.keyName] || "--" }}
</div>
</template>
<template v-if="item.type == 'number'">
<el-input-number
v-model="fmData[item.keyName]"
class="item-number"
size="small"
clearable
:precision="item.precision || 0"
:step="item.step || 1"
:min="item.min || 0"
:max="item.max || 999999999999"
:placeholder="item.placeholder || '请输入'"
>
</el-input-number>
<span v-if="item.unitName">{{ item.unitName }}</span>
</template>
<template v-else-if="item.type == 'select'">
<el-select
v-model="fmData[item.keyName]"
:placeholder="item.placeholder || '请选择'"
size="small"
clearable
class="item-select"
:multiple="item.multiple || false"
:filterable="item.filterable || false"
:allowCreate="item.allowCreate || false"
:collapse-tags="item.collapseTags || false"
default-first-option
@change="(e) => handleChangeSelect(e, item)"
>
<template v-if="item.optionType == 'group'">
<el-option-group
v-for="group in item.optionList"
:key="group.label"
:label="group.label"
>
<el-option
v-for="subItem in group.optionList"
:key="subItem.value"
:label="subItem.label"
:value="subItem.value"
>
</el-option>
</el-option-group>
</template>
<template v-else>
<el-option
v-for="(subItem, subIndex) in item.optionList"
:key="subItem.value + subIndex"
:label="subItem.label"
:value="subItem.value"
>
</el-option>
</template>
</el-select>
</template>
<template v-else-if="item.type == 'rich-text'">
<div
v-if="
formType == 'add' || (formType == 'edit' && !item.editDisable)
"
class="item-rich-text"
>
<Tinymce
:ref="'richText' + item.keyName"
v-model="fmData[item.keyName]"
:customerId="customerId"
:placeholder="item.placeholder || '请输入'"
:height="500"
/>
</div>
<div
v-else
class="item-rich-text z-show"
@click="handleClickHtmlNode"
>
<div v-html="fmData[item.keyName]"></div>
</div>
</template>
<template v-else-if="item.type == 'cascader'">
<el-cascader
v-model="fmData[item.keyName]"
:placeholder="item.placeholder || '请选择'"
:options="item.optionList"
:props="item.optionProps || {}"
:show-all-levels="false"
:collapse-tags="item.collapseTags || false"
size="small"
clearable
class="item-select"
@change="(e) => handleChangeCascader(e, item)"
>
</el-cascader>
</template>
<template v-else-if="item.type == 'upload'">
<el-upload
v-if="
formType == 'add' || (formType == 'edit' && !item.editDisable)
"
ref="upload"
class="avatar-uploader"
:class="{ 'z-full': fmData[item.keyName].length >= item.limit }"
:action="item.uploadUrl || uploadUrl"
:data="{ customerId: customerId }"
:show-file-list="true"
:list-type="item.listType || 'picture'"
:limit="item.limit || 100"
:file-list="fmData[item.keyName]"
:on-success="(res, file) => handleImgSuccess(res, file, item)"
:on-error="(res, file) => handleImgError(res, file, item)"
:on-remove="(res) => handleImgRemove(res, item)"
:on-exceed="(res) => handleImgExceed(res, item)"
:before-upload="(file) => beforeImgUpload(file, item)"
>
<a><i class="el-icon-plus"></i> 点击上传</a>
</el-upload>
<el-image
v-else-if="fmData[item.keyName].length > 0"
style="width: 100px; height: 100px"
:src="fmData[item.keyName][0].url"
fit="cover"
:preview-src-list="fmData[item.keyName].map((item) => item.url)"
></el-image>
<span v-else>--</span>
</template>
<template v-else-if="item.type == 'address'">
<div class="address-item">
<el-input
class="address-item-input"
:placeholder="item.placeholder || '请输入所在地址'"
v-model="fmData[item.keyName]"
:maxlength="item.maxlength || ''"
show-word-limit
size="small"
>
</el-input>
<el-button
style="margin-left: 10px"
type="default"
size="small"
ref="mapSearch"
@click="handleSearchMap(item)"
>查询</el-button
>
<div id="app" class="div_map"></div>
<div style="margin-top: 10px" v-show="false">
<span>经度</span>
<el-input
class="address-item-input2"
maxlength="50"
placeholder="请输入经度"
v-model="fmData[item.supKeys[0]]"
>
</el-input>
<span style="margin-left: 20px">纬度</span>
<el-input
class="address-item-input2"
maxlength="50"
placeholder="请输入纬度"
v-model="fmData[item.supKeys[1]]"
>
</el-input>
</div>
</div>
</template>
</el-form-item>
</div>
</el-form>
<div class="div_btn resi-btns" v-if="!formBtnFixed">
<el-button size="small" @click="handleCancle">{{
editConfig.cancelBtnName || "取消"
}}</el-button>
<el-button
v-if="formType != 'watch'"
type="primary"
size="small"
:disabled="btnDisable"
@click="handleComfirm"
>{{ editConfig.confirmBtnName || "确定" }}</el-button
>
<slot
name="operateSup"
v-bind:id="formId"
v-bind:info="fmData"
v-bind:formType="formType"
></slot>
</div>
<slot
name="bottomSup"
v-bind:id="formId"
v-bind:info="fmData"
v-bind:formType="formType"
></slot>
</div>
<div class="div_btn resi-btns" v-if="formBtnFixed">
<el-button size="small" @click="handleCancle">{{
editConfig.cancelBtnName || "取消"
}}</el-button>
<el-button
v-if="formType != 'watch'"
type="primary"
size="small"
:disabled="btnDisable"
@click="handleComfirm"
>{{ editConfig.confirmBtnName || "确定" }}</el-button
>
<slot
name="operateSup"
v-bind:id="formId"
v-bind:info="fmData"
v-bind:formType="formType"
></slot>
</div>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import nextTick from "dai-js/tools/nextTick";
import Schema from "async-validator";
import Tinymce from "@c/tinymce2/index.vue";
var map;
var search;
var markers;
var infoWindowList;
var geocoder; //
export default {
components: { Tinymce },
props: {
formId: {
type: String,
default: "",
},
formType: {
type: String,
default: "info",
},
formBtnFixed: {
type: Boolean,
default: true,
},
idName: {
type: String,
default: "",
},
addUrl: {
type: String,
default: "",
},
editUrl: {
type: String,
default: "",
},
delUrl: {
type: String,
default: "",
},
infoUrl: {
type: String,
default: "",
},
editParams: {
type: Array,
default: () => [],
},
editFixedParams: {
type: Object,
default: () => ({}),
},
editParamsDiv: {
type: Number,
default: 0,
},
editElseRules: {
type: Object,
default: () => ({}),
},
editConfig: {
type: Object,
default: () => ({}),
},
},
data() {
return {
iniLoaded: false,
btnDisable: false,
fmData: {},
editParams1: [],
editParams2: [],
uploadUrl: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2",
customerId: localStorage.getItem("customerId"),
};
},
computed: {},
watch: {
editParams: {
handler() {
this.computeFmData();
},
deep: true,
},
},
async mounted() {
this.initForm();
},
methods: {
async initForm() {
this.iniFmData();
if (this.formId && this.formType != "add") {
this.getInfo();
}
},
computeFmData() {
console.log(this.fmData);
},
iniFmData() {
const { editParams, fmData, editParamsDiv } = this;
editParams.forEach((item, index) => {
if (typeof item.value == "function") {
fmData[item.keyName] = item.value();
} else if (
typeof item.value == "string" ||
typeof item.value == "number" ||
typeof item.value == "boolean"
) {
fmData[item.keyName] = item.value;
} else if (typeof item.value == "undefined") {
fmData[item.keyName] = "";
} else {
fmData[item.keyName] = item.value || "";
console.error(
"不应该直接传入数组或对象的值,这样会导致传入的值被子组件修改。editParams-------------cpts/base/cpts/edit.vue",
item
);
}
if (item.supValues) {
item.supValues.forEach((value, index) => {
if (typeof value == "function") {
fmData[item.supKeys[index]] = value();
} else if (
typeof value == "string" ||
typeof value == "number" ||
typeof value == "boolean"
) {
fmData[item.supKeys[index]] = value;
} else if (typeof value == "undefined") {
fmData[item.supKeys[index]] = "";
} else {
fmData[item.supKeys[index]] = value;
console.error(
"不应该直接传入数组或对象的值,这样会导致传入的值被子组件修改。editParams-------------cpts/base/cpts/edit.vue",
item
);
}
});
}
if (item.type == "select" || item.type == "cascader") {
if (item.optionUrl) {
this.getFmOptions(
index,
item.optionUrl,
item.optionUrlParams || {},
item.optionCook || null
);
}
} else if (item.type == "address") {
this.$nextTick(async () => {
await nextTick(300);
this.initMap(item);
});
}
});
this.fmData = { ...fmData };
if (editParamsDiv) {
this.editParams1 = editParams.slice(0, editParamsDiv);
this.editParams2 = editParams.slice(editParamsDiv);
} else {
this.editParams1 = editParams;
}
console.log("------------------------------------", this.fmData);
this.iniLoaded = true;
},
handleClickHtmlNode(e) {
//
if (e.target.localName.toLowerCase() === "a") {
//
let url = e.target.getAttribute("src"); //adata-ididclickaclick
window.open(url);
}
},
async getFmOptions(index, url, params, cookFn) {
const { data, code, msg } = await requestPost(url, {
...params,
});
if (code === 0) {
this.editParams[index].optionList =
typeof cookFn == "function" ? cookFn(data) : data || [];
} else {
this.$message.error("请求检索基础数据失败!");
}
},
handleChangeCascader(vals, item) {
this.fmData[item["keyName"]] = vals;
if (typeof item.handleChangeFn == "function") {
item.handleChangeFn(vals, item, this);
}
},
handleChangeSelect(vals, item) {
console.log(vals, item);
this.fmData[item["keyName"]] = vals;
if (typeof item.handleChangeFn == "function") {
item.handleChangeFn(vals, item, this);
}
},
beforeImgUpload(file, item) {
if (typeof item.beforeImgUpload == "function") {
if (!item.beforeImgUpload(file, item, this)) return false;
}
return true;
},
handleImgRemove(file, item) {
console.log("handleImgRemove", file);
let url = file.response ? file.response.data.url : file.url;
if (url) {
let { fmData } = this;
this.fmData[item.keyName] = fmData[item.keyName].filter(
(item) => item.url !== url
);
if (item.supKeys && Array.isArray(item.supKeys)) {
if (item.supKeys.length > 0) {
this.fmData[item.supKeys[0]] = fmData[item.keyName].map(
(item) => item.url
);
}
if (item.supKeys.length > 1) {
this.fmData[item.supKeys[1]] =
this.fmData[item.supKeys[0]][0] || "";
}
}
}
},
handleImgExceed(res, item) {
console.log(res);
// this.$message({
// type: "warning",
// message: "",
// });
},
handleImgSuccess(res, file, item) {
console.log("handleImgSuccess", res);
if (res.code === 0 && res.msg === "success") {
let { fmData } = this;
// let picItem = {
// url: res.data.url,
// name: file.name,
// size: file.size,
// type: file.type,
// format: file.name.split(".").pop(),
// };
let picItem = file;
picItem.url = res.data.url;
picItem.format = file.name.split(".").pop();
if (Array.isArray(this.fmData[item.keyName])) {
this.fmData[item.keyName].push(picItem);
} else {
this.fmData[item.keyName] = [picItem];
}
if (item.supKeys && Array.isArray(item.supKeys)) {
if (item.supKeys.length > 0) {
this.fmData[item.supKeys[0]] = fmData[item.keyName].map(
(item) => item.url
);
}
if (item.supKeys.length > 1) {
this.fmData[item.supKeys[1]] =
this.fmData[item.supKeys[0]][0] || "";
}
}
} else {
this.$message.error(res.msg);
}
},
handleImgError(res, file, item) {
console.log(res);
},
// init
initMap(item) {
let { latitude, longitude } = this.$store.state.user;
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
}
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById("app"), {
center: center, //
zoom: 13, //
pitch: 43.5, //
rotation: 45, //
});
search = new window.TMap.service.Search({ pageSize: 10 });
//
markers = new TMap.MultiMarker({
map: map,
geometries: [],
});
infoWindowList = Array(10);
geocoder = new TMap.service.Geocoder(); //
//
map.on("panend", (e) => {
this.handleMoveCenter(item, e);
});
// this.handleMoveCenter(item);
},
setMarker(lat, lng) {
markers.setGeometries([]);
markers.add([
{
id: "4",
styleId: "marker",
position: new TMap.LatLng(lat, lng),
properties: {
title: "marker4",
},
},
]);
},
handleSearchMap(item) {
infoWindowList.forEach((infoWindow) => {
infoWindow.close();
});
infoWindowList.length = 0;
markers.setGeometries([]);
//
search
.searchRectangle({
keyword: this.fmData[item.keyName],
bounds: map.getBounds(),
})
.then((result) => {
let { data } = result;
if (Array.isArray(data) && data.length > 0) {
const {
location: { lat, lng },
} = data[0];
map.setCenter(new TMap.LatLng(lat, lng));
this.setMarker(lat, lng);
// item.supValues[0] = lng;
// item.supValues[1] = lat;
this.fmData[item.supKeys[0]] = lng;
this.fmData[item.supKeys[1]] = lat;
} else {
this.$message.error("未检索到相关位置坐标");
}
});
},
handleMoveCenter(item, e) {
console.log(e);
//
const center = map.getCenter();
const lat = center.getLat();
const lng = center.getLng();
// item.supValues[0] = lng;
// item.supValues[1] = lat;
this.fmData[item.supKeys[0]] = lng;
this.fmData[item.supKeys[1]] = lat;
this.setMarker(lat, lng);
if (e && e.originalEvent) {
geocoder
.getAddress({ location: new TMap.LatLng(lat, lng) }) //
.then((result) => {
this.fmData[item.keyName] = result.result.address;
});
}
},
async getInfo() {
let url = this.infoUrl;
if (!url) return;
const { idName, formId } = this;
if (url.endsWith("/")) {
url += formId;
}
const params = {
[idName]: formId,
};
let { data, code, msg } = await requestPost(url, params);
if (code === 0) {
const { editConfig } = this;
console.log("xxxxxxxxxxxxxxxxxxxxxx", editConfig);
if (editConfig && typeof editConfig.cookInfoFn == "function") {
data = editConfig.cookInfoFn(data);
}
this.fmData = {
...this.fmData,
...data,
};
await nextTick(600);
if (map) {
if (data.latitude) {
map.setCenter(new TMap.LatLng(data.latitude, data.longitude));
} else {
if (this.formType == "edit" && this.$refs && this.$refs.mapSearch) {
this.$refs.mapSearch[0].handleClick();
}
}
}
} else {
this.$message.error(msg);
}
},
watchImg(src) {
window.open(src);
},
//
dormatHtml(content) {
if (
content.startsWith(
"<!DOCTYPE html>\n<html>\n<head>\n</head>\n<body>\n"
) &&
content.endsWith("\n</body>\n</html>")
) {
content = content.slice(45, -16);
}
return content;
},
cookBeforeSubmit(data) {
Object.keys(data).forEach((k) => {
if (typeof data[k] == "string") {
data[k] = this.dormatHtml(data[k]);
}
});
return data;
},
async handleComfirm() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 5000);
console.log(this.$refs["ref_form"]);
this.$refs["ref_form"].validate((valid, messageObj) => {
console.log(valid, messageObj);
if (!valid) {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
if (this.editElseRules) {
const validator = new Schema(this.editElseRules);
validator
.validate(this.fmData)
.then(() => {
this.submit();
})
.catch(({ err, fields }) => {
console.log("--------------", err, fields);
app.util.validateRule(fields);
});
} else {
this.submit();
}
}
});
},
async submit() {
const { editConfig, fmData, formType, editFixedParams } = this;
if (
typeof editConfig.beforeSubmit == "function" &&
!editConfig.beforeSubmit(formType, fmData, this)
) {
return;
}
let url = "";
let params = {
...fmData,
...editFixedParams,
// serviceType: this.fmData.serviceTypeArr.join(","),
};
params = this.cookBeforeSubmit(params);
if (this.formType === "add") {
url = this.addUrl;
} else {
url = this.editUrl;
}
const { data, code, msg } = await requestPost(url, params);
if (code === 0) {
this.$message({
type: "success",
message: "操作成功",
});
this.handleCancle();
this.$emit("afterEdit");
this.btnDisable = false;
} else {
this.btnDisable = false;
this.$message.error(msg);
}
},
handleCancle() {
this.$emit("close");
},
},
};
</script>
<style lang="scss" scoped>
.m-fm {
margin-top: 30px;
&.z-div {
.list {
display: flex;
flex-wrap: wrap;
.item {
min-width: 45%;
.item-rich-text {
width: 817px;
max-height: 500px;
overflow: auto;
img {
max-width: 100%;
}
&.z-show {
box-sizing: border-box;
padding: 15px;
border: 1px solid #eee;
height: auto;
}
}
}
}
.item-show {
width: 324px;
}
.item-input {
width: 324px;
}
.item-select {
width: 324px;
}
.item-number {
width: 180px;
}
.address-item {
width: 350px;
.address-item-input {
width: 74%;
}
.address-item-input2 {
margin-left: 5px;
width: 40%;
}
}
}
.avatar-uploader {
&.z-full {
/deep/ .el-upload.el-upload--picture-card {
display: none !important;
}
}
a {
display: flex;
align-items: center;
justify-content: center;
color: #65a5f9;
i {
margin-right: 4px;
color: #65a5f9;
font-size: 18px;
}
&:hover {
text-decoration: none;
}
}
}
.item-rich-text {
width: 600px;
height: 500px;
img {
max-width: 100%;
}
.item-show {
width: 100%;
}
}
.item-select,
.item-show,
.item-input {
width: 450px;
}
.item-number {
width: 225px;
}
.address-item {
width: 450px;
.address-item-input {
width: 85%;
}
.address-item-input2 {
margin-left: 5px;
width: 40%;
}
}
.div_map {
margin-top: 10px;
}
}
</style>

467
src/views/modules/cpts/base/index.vue

@ -1,293 +1,236 @@
<template>
<div class="div_main">
<div v-show="true">
<div class="div_search" ref="ref_search">
<el-form :inline="true" ref="ref_searchform" label-width="100px">
<div class="div_search"
ref="ref_search">
<el-form :inline="true"
ref="ref_searchform"
label-width="100px">
<div>
<el-form-item
v-for="item in searchParams"
:key="'serach' + item.keyName"
:label="item.field"
:prop="item.keyName"
>
<el-form-item v-for="item in searchParams"
:key="'serach' + item.keyName"
:label="item.field"
:prop="item.keyName">
<template v-if="item.type == 'input'">
<el-input
v-model="item.value"
style="width: 240px"
size="small"
clearable
:placeholder="item.placeholder || '请输入'"
>
<el-input v-model="item.value"
style="width: 240px"
size="small"
clearable
:placeholder="item.placeholder || '请输入'">
</el-input>
</template>
<template v-else-if="item.type == 'select'">
<el-select
v-model="item.value"
:placeholder="item.placeholder || '请选择'"
size="small"
clearable
style="width: 240px"
:multiple="item.multiple || false"
>
<el-option
v-for="item in item.optionList"
:key="'serach' + item.keyName + item.value"
:label="item.label"
:value="item.value"
>
<el-select v-model="item.value"
:placeholder="item.placeholder || '请选择'"
size="small"
clearable
style="width: 240px"
:multiple="item.multiple || false">
<el-option v-for="item in item.optionList"
:key="'serach' + item.keyName + item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</template>
<template v-else-if="item.type == 'cascader'">
<el-cascader
v-model="item.value"
:placeholder="item.placeholder || '请选择'"
:options="item.optionList"
:props="item.optionProps"
:show-all-levels="false"
size="small"
clearable
style="width: 240px"
@change="(e) => handleChangeCascader(e, item)"
>
<el-cascader v-model="item.value"
:placeholder="item.placeholder || '请选择'"
:options="item.optionList"
:props="item.optionProps"
:show-all-levels="false"
size="small"
clearable
style="width: 240px"
@change="(e) => handleChangeCascader(e, item)">
</el-cascader>
</template>
<template v-if="item.type == 'date-range'">
<el-date-picker
v-model="item.supValues[0]"
type="date"
placeholder="开始时间"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
>
<el-date-picker v-model="item.supValues[0]"
type="date"
placeholder="开始时间"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable>
</el-date-picker>
<span style="display: inline-block; margin: 0 10px"></span>
<el-date-picker
v-model="item.supValues[1]"
type="date"
placeholder="结束时间"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable
>
<el-date-picker v-model="item.supValues[1]"
type="date"
placeholder="结束时间"
style="width: 150px"
value-format="yyyy-MM-dd"
clearable>
</el-date-picker>
</template>
</el-form-item>
<el-button
style="margin-left: 30px; margin-bottom: 20px"
size="small"
class="diy-button--search"
@click="handleSearch"
>查询</el-button
>
<el-button
style="margin-left: 10px; margin-bottom: 20px"
size="small"
class="diy-button--reset"
@click="resetSearch"
>重置</el-button
>
<el-button style="margin-left: 30px; margin-bottom: 20px"
size="small"
class="diy-button--search"
@click="handleSearch">查询</el-button>
<el-button style="margin-left: 10px; margin-bottom: 20px"
size="small"
class="diy-button--reset"
@click="resetSearch">重置</el-button>
</div>
</el-form>
</div>
<div class="div_table" :style="{ height: maxTableHeight + 130 + 'px' }">
<div class="div_table"
:style="{ height: maxTableHeight + 130 + 'px' }">
<div class="div_btn">
<el-button
class="diy-button--add"
v-if="addUrl"
size="small"
@click="handleAdd"
>新增</el-button
>
<el-button
v-if="mubanUrl"
class="btn_upload diy-button--export"
size="small"
@click="handleExportModule('room')"
>下载模板</el-button
>
<el-upload
v-if="importUrl"
ref="upload"
class="upload-btn"
action="uploadUlr"
:limit="1"
:accept="'.xls,.xlsx'"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest"
>
<el-button size="small" class="btn_upload diy-button--delete"
>导入</el-button
>
<el-button class="diy-button--add"
v-if="addUrl"
size="small"
@click="handleAdd">新增</el-button>
<el-button v-if="mubanUrl"
class="btn_upload diy-button--export"
size="small"
@click="handleExportModule('room')">下载模板</el-button>
<el-upload v-if="importUrl"
ref="upload"
class="upload-btn"
action="uploadUlr"
:limit="1"
:accept="'.xls,.xlsx'"
:with-credentials="true"
:show-file-list="false"
:auto-upload="true"
:before-upload="beforeExcelUpload"
:http-request="uploadHttpRequest">
<el-button size="small"
class="btn_upload diy-button--delete">导入</el-button>
</el-upload>
<el-button
v-if="exportUrl"
@click="handleExport"
class="btn_upload diy-button--reset"
size="small"
>导出</el-button
>
<el-button v-if="exportUrl"
@click="handleExport"
class="btn_upload diy-button--reset"
size="small">导出</el-button>
</div>
<el-table
ref="ref_table"
:data="tableData"
border
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
class="table"
style="width: 100%"
:height="maxTableHeight"
>
<template v-for="item in tableParams" :prop="item.keyName">
<el-table-column
v-if="item.type == 'no'"
:key="'table-no' + item.keyName"
:label="item.field"
fixed="left"
type="index"
align="center"
width="50"
/>
<el-table-column
v-else-if="item.type == 'text'"
:key="'table' + item.keyName"
:prop="item.keyName"
:label="item.field"
align="center"
:width="item.width || ''"
:show-overflow-tooltip="true"
>
<el-table ref="ref_table"
:data="tableData"
border
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
class="table"
style="width: 100%"
:height="maxTableHeight">
<template v-for="item in tableParams"
:prop="item.keyName">
<el-table-column v-if="item.type == 'no'"
:key="'table-no' + item.keyName"
:label="item.field"
fixed="left"
type="index"
align="center"
width="50" />
<el-table-column v-else-if="item.type == 'text'"
:key="'table' + item.keyName"
:prop="item.keyName"
:label="item.field"
align="center"
:width="item.width || ''"
:show-overflow-tooltip="true">
</el-table-column>
<el-table-column
v-else-if="item.type == 'array'"
:key="'table-array' + item.keyName"
:prop="item.keyName"
:label="item.field"
align="center"
:width="item.width || ''"
:show-overflow-tooltip="true"
>
<el-table-column v-else-if="item.type == 'array'"
:key="'table-array' + item.keyName"
:prop="item.keyName"
:label="item.field"
align="center"
:width="item.width || ''"
:show-overflow-tooltip="true">
<template slot-scope="scope">
{{ scope.row[item.keyName].join(item.arrayDiv || ",") }}
</template>
</el-table-column>
</template>
<el-table-column
fixed="right"
label="操作"
align="center"
width="200"
>
<el-table-column fixed="right"
label="操作"
align="center"
width="200">
<template slot-scope="scope">
<el-button
v-if="infoUrl && infoAuth(scope.row)"
@click="handleWatch(scope.row)"
type="text"
size="small"
class=".div-table-button--detail"
>查看</el-button
>
<el-button
v-if="editUrl && editAuth(scope.row)"
@click="handleEdit(scope.row)"
type="text"
size="small"
class="div-table-button--edit"
>{{ editBtnName(scope.row) }}</el-button
>
<el-popconfirm
v-if="delUrl && delAuth(scope.row)"
title="删除之后无法回复,确认删除?"
@onConfirm="handleDelete(scope.row, scope.$index)"
@confirm="handleDelete(scope.row, scope.$index)"
>
<el-button
slot="reference"
type="text"
size="small"
style="margin-left: 10px"
class="div-table-button--delete"
>删除</el-button
>
<el-button v-if="infoUrl && infoAuth(scope.row)"
@click="handleWatch(scope.row)"
type="text"
size="small"
class=".div-table-button--detail">查看</el-button>
<el-button v-if="editUrl && editAuth(scope.row)"
@click="handleEdit(scope.row)"
type="text"
size="small"
class="div-table-button--edit">{{ editBtnName(scope.row) }}</el-button>
<el-popconfirm v-if="delUrl && delAuth(scope.row)"
title="删除之后无法回复,确认删除?"
@onConfirm="handleDelete(scope.row, scope.$index)"
@confirm="handleDelete(scope.row, scope.$index)">
<el-button slot="reference"
type="text"
size="small"
style="margin-left: 10px"
class="div-table-button--delete">删除</el-button>
</el-popconfirm>
<slot name="listBtnSup" v-bind:item="scope.row"></slot>
<slot name="listBtnSup"
v-bind:item="scope.row"></slot>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total"
>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[20, 50, 100, 200]"
:page-size="parseInt(pageSize)"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog
v-if="formShow"
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
:width="editParamsDiv ? '1100px' : '850px'"
top="5vh"
class="dialog-h"
@closed="handleClose"
>
<edit-form
v-if="formShow"
ref="editForm"
:idName="idName"
:formId="formId"
:formType="formType"
:infoUrl="infoUrl"
:addUrl="addUrl"
:editUrl="editUrl"
:editParams="editParams"
:editParamsDiv="editParamsDiv"
:editElseRules="editElseRules"
:editFixedParams="editFixedParams"
:formBtnFixed="formBtnFixed"
:editConfig="editConfig"
@close="handleClose"
@afterEdit="handleEditSuccess"
>
<el-dialog v-if="formShow"
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
:width="editParamsDiv ? '1100px' : '850px'"
top="5vh"
class="dialog-h"
@closed="handleClose">
<edit-form v-if="formShow"
ref="editForm"
:idName="idName"
:formId="formId"
:formType="formType"
:infoUrl="infoUrl"
:addUrl="addUrl"
:editUrl="editUrl"
:editParams="editParams"
:editParamsDiv="editParamsDiv"
:editElseRules="editElseRules"
:editFixedParams="editFixedParams"
:formBtnFixed="formBtnFixed"
:editConfig="editConfig"
@close="handleClose"
@afterEdit="handleEditSuccess">
<template v-slot:bottomSup="{ id, formType, info }">
<slot
name="editBottomSup"
v-bind:id="id"
v-bind:formType="formType"
v-bind:info="info"
></slot>
<slot name="editBottomSup"
v-bind:id="id"
v-bind:formType="formType"
v-bind:info="info"></slot>
</template>
<template v-slot:operateSup="{ id, formType, info }">
<slot
name="editOperateSup"
v-bind:id="id"
v-bind:formType="formType"
v-bind:info="info"
></slot>
<slot name="editOperateSup"
v-bind:id="id"
v-bind:formType="formType"
v-bind:info="info"></slot>
</template>
</edit-form>
</el-dialog>
@ -402,7 +345,7 @@ export default {
},
},
data() {
data () {
return {
tableData: [],
@ -420,7 +363,7 @@ export default {
},
computed: {
maxTableHeight() {
maxTableHeight () {
const { ref_search_height } = this;
return this.$store.state.inIframe
? this.clientHeight - ref_search_height - 265 + this.iframeHeight
@ -431,7 +374,7 @@ export default {
watch: {},
async mounted() {
async mounted () {
console.log(this.$store.state);
this.user = this.$store.state.user;
@ -445,19 +388,19 @@ export default {
this.computeSearchHeight();
},
activated() {
activated () {
console.log("-------------activated");
this.$refs["ref_table"].doLayout();
},
methods: {
computeSearchHeight() {
computeSearchHeight () {
this.ref_search_height = this.$refs["ref_search"].clientHeight;
console.log(this.$refs["ref_search"]);
console.log(this.ref_search_height);
},
iniSearchData() {
iniSearchData () {
const { searchParams } = this;
searchParams.forEach((item, index) => {
if (item.type == "select" || item.type == "cascader") {
@ -473,7 +416,7 @@ export default {
});
},
async getFmOptions(index, url, params, cookFn) {
async getFmOptions (index, url, params, cookFn) {
const { data, code, msg } = await requestPost(url, {
...params,
});
@ -486,19 +429,19 @@ export default {
}
},
handleChangeCascader(vals, item) {
handleChangeCascader (vals, item) {
if (typeof item.handleChangeFn == "function") {
item.handleChangeFn(vals, item);
}
},
handleSearch(val) {
handleSearch (val) {
this.pageNo = 1;
this.getTableData();
},
beforeExcelUpload(file) {
beforeExcelUpload (file) {
console.log("file", file);
const isType = file.type === "application/vnd.ms-excel";
const isTypeComputer =
@ -516,7 +459,7 @@ export default {
return fileType && isLt1M;
},
async uploadHttpRequest(file) {
async uploadHttpRequest (file) {
let { importUrl: url } = this;
if (!url) return;
@ -545,7 +488,7 @@ export default {
});
},
async handleExportModule() {
async handleExportModule () {
let { mubanUrl: url } = this;
if (!url) return;
@ -582,7 +525,7 @@ export default {
});
},
async handleExport() {
async handleExport () {
const { exportUrl: url } = this;
if (!url) return;
@ -620,13 +563,13 @@ export default {
});
},
handleAdd() {
handleAdd () {
this.formType = "add";
this.formTitle = "新增";
this.formShow = true;
},
handleWatch(row) {
handleWatch (row) {
const { idName } = this;
this.formType = "watch";
this.formId = row[idName];
@ -634,7 +577,7 @@ export default {
this.formShow = true;
},
handleEdit(row) {
handleEdit (row) {
const { idName } = this;
this.formType = "edit";
this.formId = row[idName];
@ -642,17 +585,17 @@ export default {
this.formShow = true;
},
handleClose() {
handleClose () {
this.formShow = false;
this.getTableData();
},
handleEditSuccess() {
handleEditSuccess () {
this.handleClose();
// this.getTableData();
},
async handleDelete(rowData, rowIndex) {
async handleDelete (rowData, rowIndex) {
console.log(rowData, rowIndex);
let { delUrl: url } = this;
if (!url) return;
@ -675,7 +618,7 @@ export default {
}
},
computeFmData() {
computeFmData () {
let fmData = {};
this.searchParams.forEach((item) => {
fmData[item.keyName] = item.value;
@ -688,11 +631,11 @@ export default {
return fmData;
},
refresh() {
refresh () {
this.getTableData();
},
async getTableData() {
async getTableData () {
const { tableUrl: url } = this;
if (!url) return;
@ -707,25 +650,25 @@ export default {
this.total = data.total || 0;
this.tableData = data.list
? data.list.map((item) => {
return item;
})
return item;
})
: [];
} else {
this.$message.error(msg);
}
},
handleSizeChange(val) {
handleSizeChange (val) {
this.pageSize = val;
window.localStorage.setItem("pageSize", val);
this.getTableData();
},
handleCurrentChange(val) {
handleCurrentChange (val) {
this.pageNo = val;
this.getTableData();
},
resetSearch() {
resetSearch () {
console.log("----------------resetSearch", this.searchParams);
this.searchParams.forEach((item) => {
if (typeof item.value == "string") {

24
src/views/modules/shequzhili/csgltc/csgl.vue

@ -205,9 +205,9 @@
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
@closed="diaDetailClose">
<csgl-detail ref="ref_detail"
@diaClose="diaClose"></csgl-detail>
@diaDetailClose="diaDetailClose"></csgl-detail>
</el-dialog>
</div>
@ -360,22 +360,22 @@ export default {
this.$refs.ref_form.resetData()
this.formShow = false
},
diaClose () {
diaDetailClose () {
this.$refs.ref_detail.diaDestroy()
this.detailShow = false
this.finishDiaShow = false
this.scoreDiaShow = false
},
handleDetail (row) {
// this.detailShow = true
// this.$nextTick(() => {
// this.$refs.ref_detail.initForm(row)
// })
this.formTitle = '详情'
this.formShow = true
this.detailShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.icCityManagementId)
this.$refs.ref_detail.initForm(row)
})
// this.formTitle = ''
// this.formShow = true
// this.$nextTick(() => {
// this.$refs.ref_form.initForm('detail', row.icCityManagementId)
// })
},
handleAdd () {

149
src/views/modules/shequzhili/csgltc/csglDetail.vue

@ -1,72 +1,60 @@
<template>
<div>
<div style="padding-bottom:20px">
<div class="dialog-h-content scroll-h">
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">场所名称</span>
<span>{{ formData.name }}</span>
</div>
<el-form ref="ref_form"
:inline="true"
:model="formData"
:disabled="formType==='detail'"
class="form">
<el-form-item label="场所名称:"
prop="name"
label-width="150px"
style="display: block">
<span>{{formData.name}}</span>
</el-form-item>
<el-form-item label="场所类别:"
prop="categoryName"
label-width="150px"
style="display: block">
<span>{{formData.categoryName}}</span>
</el-form-item>
<el-form-item label="占地面积:"
prop="areaCovered"
label-width="150px"
style="display: block">
<span>{{formData.areaCovered+' '}}</span>平方公里
</el-form-item>
<el-form-item label="容纳人数:"
prop="capacity"
label-width="150px"
style="display: block">
<span>{{formData.capacity+' '}}</span>
</el-form-item>
<el-form-item label="负责人:"
prop="principal"
label-width="150px"
style="display: block">
<span>{{formData.principal?formData.principal:'无'}}</span>
</el-form-item>
<el-form-item label="联系电话:"
prop="mobile"
label-width="150px"
style="display: block">
<span>{{formData.mobile?formData.mobile:'无'}}</span>
</el-form-item>
<el-form-item label="地址:"
style="display: block"
prop="address"
label-width="150px">
<div class="item_width_1">
<span>{{formData.address}}</span>
<div id="app"
class="div_map"></div>
<div class="info-prop">
<span class="info-title-2">场所类别</span>
<span>{{ formData.categoryName }}</span>
</div>
</el-form-item>
</el-form>
<div class="info-prop">
<span class="info-title-2">占地面积</span>
<span>{{ formData.areaCovered+'平方公里'}}</span>
</div>
</div>
<div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
<div class="info-prop">
<span class="info-title-2">容纳人数</span>
<span>{{ formData.capacity +'人'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">负责人</span>
<span>{{ formData.principal?formData.principal:'--'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系电话</span>
<span>{{formData.mobile?formData.mobile:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地理位置</span>
<span>{{ formData.address }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div>
</div>
</div>
<!-- <div class="div-btn">
<el-button size="small"
@click="handleCancle"> </el-button>
</div> -->
</div>
</div>
</template>
@ -85,6 +73,7 @@ export default {
data () {
return {
formData: {},
initLoading: false,
}
},
@ -96,31 +85,38 @@ export default {
methods: {
handleCancle () {
this.diaDestroy()
this.$emit('diaDetailClose')
this.$emit('diaClose')
},
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row) {
this.startLoading()
this.formData = { ...row }
console.log(map)
if (!map) {
this.initLoading = true
this.$nextTick(() => {
this.initMap()
}
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
})
this.endLoading()
},
// init
initMap () {
console.log('initMap')
//
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
@ -128,7 +124,7 @@ export default {
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
@ -258,20 +254,9 @@ export default {
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
<style scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.form {
margin-top: 30px;
}
</style>

26
src/views/modules/shequzhili/ggfwtc/ggfw.vue

@ -201,9 +201,9 @@
width="950px"
top="5vh"
class="dialog-h"
@closed="diaClose">
@closed="diaDetailClose">
<ggfw-detail ref="ref_detail"
@diaClose="diaClose"></ggfw-detail>
@diaDetailClose="diaDetailClose"></ggfw-detail>
</el-dialog>
</div>
@ -380,23 +380,23 @@ export default {
this.$refs.ref_form.resetData()
this.formShow = false
},
diaClose () {
diaDetailClose () {
this.$refs.ref_detail.diaDestroy()
this.detailShow = false
this.finishDiaShow = false
this.scoreDiaShow = false
},
handleDetail (row) {
// this.detailShow = true
// this.$nextTick(() => {
// this.$refs.ref_detail.initForm(row)
// })
this.formTitle = '详情'
this.formShow = true
this.detailShow = true
this.$nextTick(() => {
this.$refs.ref_form.initForm('detail', row.icPublicServiceId)
this.$refs.ref_detail.initForm(row)
})
// this.formTitle = ''
// this.formShow = true
// this.$nextTick(() => {
// this.$refs.ref_form.initForm('detail', row.icPublicServiceId)
// })
},
//

146
src/views/modules/shequzhili/ggfwtc/ggfwDetail.vue

@ -2,69 +2,60 @@
<div>
<div class="dialog-h-content scroll-h">
<el-form ref="ref_form"
:inline="true"
:model="formData"
class="form">
<el-form-item label="场所名称:"
prop="name"
label-width="150px"
style="display: block">
<span>{{formData.name}}</span>
</el-form-item>
<el-form-item label="场所类别:"
prop="categoryName"
label-width="150px"
style="display: block">
<span>{{formData.categoryName}}</span>
</el-form-item>
<el-form-item label="占地面积:"
prop="areaCovered"
label-width="150px"
style="display: block">
<span>{{formData.areaCovered}}</span>
</el-form-item>
<el-form-item label="容纳人数:"
prop="capacity"
label-width="150px"
style="display: block">
<span>{{formData.capacity}}</span>
</el-form-item>
<el-form-item label="负责人:"
prop="principal"
label-width="150px"
style="display: block">
<span>{{formData.principal}}</span>
</el-form-item>
<el-form-item label="联系电话:"
prop="mobile"
label-width="150px"
style="display: block">
<span>{{formData.mobile}}</span>
</el-form-item>
<el-form-item label="地址:"
style="display: block"
prop="address"
label-width="150px">
<div class="item_width_1">
<span>{{formData.address}}</span>
<div id="app"
class="div_map"></div>
<div v-if="initLoading"
class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">场所名称</span>
<span>{{ formData.name }}</span>
</div>
</el-form-item>
</el-form>
<div class="info-prop">
<span class="info-title-2">场所类别</span>
<span>{{ formData.categoryName }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">占地面积</span>
<span>{{ formData.areaCovered+'平方公里'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">容纳人数</span>
<span>{{ formData.capacity +'人'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">负责人</span>
<span>{{ formData.principal?formData.principal:'--'}}</span>
</div>
<div class="info-prop">
<span class="info-title-2">联系电话</span>
<span>{{formData.mobile?formData.mobile:'--' }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地理位置</span>
<span>{{ formData.address }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">地图位置</span>
<div class="div_map">
<div id="app_detail"></div>
</div>
</div>
</div>
</div>
</div>
<div class="div_btn">
<!-- <div class="div_btn">
<el-button size="small"
@click="handleCancle"> </el-button>
</div>
</div> -->
</div>
</template>
@ -83,34 +74,36 @@ export default {
data () {
return {
formData: {},
initLoading: false,
}
},
components: {},
mounted () {
if (!map) {
this.initMap()
}
},
methods: {
handleCancle () {
this.diaDestroy()
this.$emit('diaDetailClose')
this.$emit('diaClose')
},
diaDestroy () {
if (map) {
map.destroy()
}
},
async initForm (row) {
this.startLoading()
this.formData = { ...row }
debugger
if (!map) {
this.initLoading = true
this.$nextTick(() => {
this.initMap()
}
map.setCenter(new TMap.LatLng(this.formData.latitude, this.formData.longitude))
this.setMarker(this.formData.latitude, this.formData.longitude)
})
this.endLoading()
},
@ -119,6 +112,10 @@ export default {
initMap () {
let { latitude, longitude } = this.$store.state.user;
console.log('lat' + latitude + ',lon' + longitude)
if (this.formData.latitude && this.formData.longitude) {
latitude = this.formData.latitude
longitude = this.formData.longitude
}
if (!latitude || latitude == "" || latitude == "0") {
latitude = 39.9088810666821;
longitude = 116.39743841556731;
@ -126,7 +123,7 @@ export default {
//
var center = new window.TMap.LatLng(latitude, longitude);
// map TMap.Map()
map = new window.TMap.Map(document.getElementById('app'), {
map = new window.TMap.Map(document.getElementById('app_detail'), {
center: center, //
zoom: 17.2, //
pitch: 43.5, //
@ -257,20 +254,9 @@ export default {
}
</script>
<style lang="scss" scoped >
@import "@/assets/scss/modules/visual/communityManageForm.scss";
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
<style scoped>
.detail_span {
width: 500px;
font-weight: bold;
text-align: left;
margin: 0 0;
font-size: 16px;
}
.form {
margin-top: 30px;
}
</style>

Loading…
Cancel
Save