From d16d10d94fddff86bdfd87113e7fd2cebe8b7cd7 Mon Sep 17 00:00:00 2001
From: shuishen <1109946754@qq.com>
Date: Wed, 24 Jan 2024 18:15:06 +0800
Subject: [PATCH] 居民监管样式调整
---
src/views/place/index.vue | 391 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 276 insertions(+), 115 deletions(-)
diff --git a/src/views/place/index.vue b/src/views/place/index.vue
index b0bb210..6116248 100644
--- a/src/views/place/index.vue
+++ b/src/views/place/index.vue
@@ -5,8 +5,30 @@
:before-open="beforeOpen" @search-change="searchChange" @search-reset="searchReset"
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange"
@refresh-change="refreshChange" @on-load="onLoad">
- <template slot-scope="{row}" slot="confirmFlag">
- <el-tag size="small" :type="showConfirmFlag(row.confirmFlag).type">{{ showConfirmFlag(row.confirmFlag).text
+ <template slot-scope="{row}" slot="location">
+ <span v-text="showLocation(row.location)"></span>
+ </template>
+
+ <template slot-scope="{row}" slot="lng">
+ <span v-text="decimalProcessing(row.lng)"></span>
+ </template>
+
+ <template slot-scope="{row}" slot="lat">
+ <span v-text="decimalProcessing(row.lat)"></span>
+ </template>
+
+ <template slot-scope="{row, size}" slot="confirmFlag">
+ <el-tag :size="size" :type="showConfirmFlag(row.confirmFlag).type">{{ showConfirmFlag(row.confirmFlag).text
+ }}</el-tag>
+ </template>
+
+ <template slot-scope="{row, size}" slot="confirmFlag">
+ <el-tag :size="size" :type="showConfirmFlag(row.confirmFlag).type">{{ showConfirmFlag(row.confirmFlag).text
+ }}</el-tag>
+ </template>
+
+ <template slot-scope="{row, size}" slot="source">
+ <el-tag :size="size" :type="showSource(row.source).type">{{ showSource(row.source).text
}}</el-tag>
</template>
@@ -15,20 +37,18 @@
</el-button>
</template>
- <template slot-scope="scope" slot="menu">
- <el-button type="text" :disabled="scope.row.confirmFlag == 2" icon="el-icon-s-check" size="small"
- v-if="permission.place_audit_cur && scope.row.confirmFlag != 4" @click="auditCur(scope.row)">审核
+ <template slot-scope="{row, size}" slot="menu">
+ <el-button :size="size" type="text" icon="el-icon-s-check" v-if="permission.place_audit_cur"
+ @click="auditCur({ ...row, confirmFlag: 1 })">审核
</el-button>
- <el-button type="text" icon="el-icon-edit" size="small" v-if="permission.place_manage_tenants"
- @click="ManageTenants(scope.row)">场所维护
+ <el-button :size="size" type="text" icon="el-icon-edit" v-if="permission.place_manage_tenants"
+ @click="ManageTenants(row)">场所维护
</el-button>
</template>
</avue-crud>
- <el-dialog class="place-info-box" title="场所维护" append-to-body :visible.sync="roleBox" center @close="roleBoxClose">
- <baseAllInfo></baseAllInfo>
- </el-dialog>
+ <baseAllInfo ref="BaseAllInfo"></baseAllInfo>
<el-dialog class="place-info-box audit-info-box" title="审核" append-to-body :visible.sync="auditBasePopup"
width="30%">
@@ -44,7 +64,6 @@
update,
add,
getPlace,
- getPlaceExt,
} from "@/api/place/place"
import {
@@ -58,10 +77,20 @@
export default {
data () {
- return {
- curRow: {},
- roleBox: false,
+ //手机号格式校验
+ let validatorPhone = function (rule, value, callback) {
+ if (value) {
+ if (!/^1[3456789]\d{9}$/.test(value)) {
+ callback(new Error('手机号格式有误!'))
+ } else {
+ callback()
+ }
+ }
+ callback()
+ }
+
+ return {
form: {},
query: {},
loading: true,
@@ -74,13 +103,16 @@
datetime: "",
selectionList: [],
option: {
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 280,
+
height: "auto",
calcHeight: 54,
dialogWidth: 950,
tip: false,
- searchShow: true,
- searchMenuSpan: 3,
- menuWidth: 280,
border: true,
//stripe:true,
index: true,
@@ -88,12 +120,15 @@
editBtn: false,
selection: true,
dialogClickModal: false,
+ menuFixed: 'right',
column: [
{
- span: 12,
+ width: 156,
+ overHidden: true,
label: "场所名称",
+ span: 12,
prop: "placeName",
- searchSpan: 4,
+ searchSpan: 5,
search: true,
rules: [{
required: true,
@@ -103,44 +138,30 @@
},
{
- span: 7,
- label: "场所标签",
- prop: "label",
- type: "cascader",
- dicUrl: "/api/blade-category/category/getCategory?level=2",
- cascader: ["smallLabel"],
- props: {
- label: "categoryName",
- value: "categoryNo"
- },
+ width: 156,
+ overHidden: true,
+ slot: true,
+ label: "地址",
+ prop: "location",
+ type: 'map',
dataType: "string",
- hide: true,
- rules: [{
- required: true,
- message: "请输入场所标签",
- trigger: "blur",
- },],
+ span: 12,
+ value: [117.966460, 28.431002, ""],
+ rules: [
+ {
+ required: true,
+ message: "请选择地址",
+ trigger: "blur",
+ },
+ ],
},
{
- span: 5,
- label: "",
- labelWidth: 20,
- prop: "smallLabel",
- type: "cascader",
- dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
- props: {
- label: "categoryName",
- value: "categoryNo"
- },
- dataType: "string",
- hide: true,
- },
-
- {
- label: "负责人",
+ width: 110,
+ label: "场所负责人",
prop: "principal",
- searchSpan: 4,
+ searchSpan: 5,
+ searchLabelWidth: 110,
search: true,
rules: [{
required: false,
@@ -150,33 +171,41 @@
},
{
- width: 110,
- label: "电话",
+ width: 120,
+ overHidden: true,
+ label: "手机号码",
prop: "principalPhone",
search: true,
- searchSpan: 3,
+ searchSpan: 4,
slot: true,
+ rules: [
+ {
+ validator: validatorPhone,
+ trigger: 'blur'
+ }
+ ],
},
{
+ width: 110,
+ label: "所属街道",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
- width: 96,
- label: "所属街道",
prop: "townStreetName",
search: true,
searchSpan: 4
},
{
+ width: 156,
+ overHidden: true,
+ label: "所属社区",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
- label: "所属社区",
prop: "neiName",
search: true,
searchSpan: 4,
- width: 150,
rules: [
{
required: true,
@@ -198,7 +227,7 @@
label: "name",
value: "id",
},
- cascader: ["gridId"],
+ cascader: ["gridCode"],
rules: [
{
required: true,
@@ -209,12 +238,13 @@
},
{
+ width: 110,
+ overHidden: true,
+ label: "所属网格",
addDisplay: false,
editDisplay: false,
viewDisplay: false,
- label: "所属网格",
prop: "gridName",
- width: 150,
rules: [
{
required: true,
@@ -226,12 +256,12 @@
{
hide: true,
label: "所属网格",
- prop: "gridId",
+ prop: "gridCode",
type: "tree",
cell: true,
props: {
label: "gridName",
- value: "id",
+ value: "gridCode",
},
dicUrl:
"/api/blade-grid/grid/getGridList?communityCode={{neiCode}}",
@@ -243,10 +273,71 @@
},
],
},
+
+
{
+ span: 7,
+ label: "场所标签",
+ prop: "label",
+ type: "select",
+ dicUrl: "/api/blade-category/category/getCategory?level=2",
+ cascader: ["smallLabel"],
+ props: {
+ label: "categoryName",
+ value: "categoryNo"
+ },
+ dataType: "string",
+ hide: true,
+ rules: [{
+ required: true,
+ message: "请输入场所标签",
+ trigger: "blur",
+ },],
+ },
+
+ {
+ span: 5,
+ label: "",
+ labelWidth: 20,
+ prop: "smallLabel",
+ type: "select",
+ dicUrl: "/api/blade-category/category/getCategory?parentNo={{label}}",
+ props: {
+ label: "categoryName",
+ value: "categoryNo"
+ },
+ dataType: "string",
+ hide: true,
+ },
+
+ {
+ span: 12,
+ label: "标签颜色",
+ prop: "color",
+ type: "select",
+ dicData: [
+ {
+ label: '绿',
+ value: 'green'
+ }, {
+ label: '黄',
+ value: 'yellow'
+ }, {
+ label: '红',
+ value: 'red'
+ }
+ ],
+ props: {
+ label: "label",
+ value: "value"
+ },
+ hide: true,
+ },
+
+ {
+ width: 110,
label: "场所照片",
prop: "imageUrls",
- width: 80,
type: "upload",
listType: "picture-card",
dataType: "string",
@@ -260,18 +351,29 @@
span: 24,
},
+
{
- label: "位置",
- prop: "location",
- submitBtn: "提交",
- hide: true,
- type: 'map',
- dataType: "string",
- span: 24,
- value: [117.966460, 28.431002, ""]
+ width: 96,
+ slot: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ label: "经度",
+ prop: "lng",
},
{
+ width: 96,
+ slot: true,
+ addDisplay: false,
+ editDisplay: false,
+ viewDisplay: false,
+ label: "纬度",
+ prop: "lat",
+ },
+
+ {
+ width: 100,
addDisplay: false,
editDisplay: false,
viewDisplay: false,
@@ -279,32 +381,38 @@
prop: 'confirmFlag',
type: 'radio',
slot: true,
- dicData: [{
- label: '待审核',
- value: 1
- }, {
- label: '已审核',
- value: 2
- }, {
- label: '未通过',
- value: 3
- }]
+ dicData: [
+ {
+ label: '待审核',
+ value: 1
+ }, {
+ label: '已审核',
+ value: 2
+ }, {
+ label: '未通过',
+ value: 3
+ }
+ ]
},
{
+ width: 120,
display: false,
label: '是否有二维码',
searchLabelWidth: 110,
prop: 'source',
type: "select",
search: true,
- searchSpan: 4,
- dicData: [{
- label: '是',
- value: 1
- }, {
- label: '否',
- value: 2
- }]
+ searchSpan: 5,
+ slot: true,
+ dicData: [
+ {
+ label: '是',
+ value: 1
+ }, {
+ label: '否',
+ value: 2
+ }
+ ]
}
],
},
@@ -372,21 +480,71 @@
return tags
}
+ },
+
+ showSource () {
+ return (data) => {
+ let tags = {
+ text: '',
+ type: ''
+ }
+
+ if (data == 1) {
+ tags = {
+ text: '是',
+ type: 'success'
+ }
+ } else if (data == 2) {
+ tags = {
+ text: '否',
+ type: 'info'
+ }
+ }
+
+ return tags
+ }
+ },
+
+ showLocation () {
+ return (data) => {
+ if (data != null && data.indexOf(',') != -1) {
+ data = data.split(',')
+
+ return data[2]
+ } else {
+ return data || ''
+ }
+ }
+ },
+
+ decimalProcessing () {
+ return (data) => {
+ if (data != null) {
+ return Number(data).toFixed(6)
+ } else {
+ return ''
+ }
+ }
}
},
methods: {
+ locationDispose (data) {
+ data = data.split(',')
+
+ return {
+ longitude: data[0],
+ latitude: data[1],
+ location: data[2]
+ }
+ },
+
auditCur (row) {
this.curAuditRow = row
this.auditBasePopup = true
},
- roleBoxClose () {
- this.curRow = {}
- },
-
ManageTenants (item) {
- this.curRow = item
- this.roleBox = true
+ this.$refs.BaseAllInfo.initOpen(item)
},
rowSave (row, done, loading) {
@@ -410,7 +568,8 @@
add({
...row,
- label
+ label,
+ ...this.locationDispose(row.location)
}).then(
() => {
this.onLoad(this.page)
@@ -437,7 +596,20 @@
})
row.imageUrls = urls.join(",")
}
- update(row).then(
+
+ let label = row.label
+
+ if (row.smallLabel != '') {
+ label = label + ',' + row.smallLabel
+ }
+
+ delete row.smallLabel
+
+ update({
+ ...row,
+ label,
+ ...this.locationDispose(row.location)
+ }).then(
() => {
this.onLoad(this.page)
this.$message({
@@ -471,6 +643,7 @@
})
})
},
+
searchReset () {
this.query = {}
this.onLoad(this.page)
@@ -512,10 +685,13 @@
this.$refs.crud.toggleSelection()
})
},
+
beforeOpen (done, type) {
if (["edit", "view"].includes(type)) {
getPlace(this.form.id).then((res) => {
this.form = res.data.data
+
+ this.form.location = [this.form.lng, this.form.lat, this.form.location].join(',')
if (this.form.imageUrls.length) {
this.form.imageUrls = this.form.imageUrls.split(",").filter(item => item != '').map(item => website.minioUrl + item).join(',')
@@ -536,7 +712,6 @@
}
done()
-
})
} else {
done()
@@ -553,23 +728,9 @@
this.onLoad(this.page, this.query)
},
onLoad (page, params = {}) {
- const { dateTime } = this.query
- let values = {
- ...params,
- }
- if (dateTime) {
- values = {
- ...params,
- startTime: dateTime[0],
- endTime: dateTime[1],
- ...this.query,
- }
- values.dateTime = null
- }
-
this.loading = true
- getList(page.currentPage, page.pageSize, values).then((res) => {
+ getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then((res) => {
const data = res.data.data
this.page.total = data.total
--
Gitblit v1.9.3