From 1a5c9d89d7a1347046692ce5086a1391027c8593 Mon Sep 17 00:00:00 2001
From: linwe <872216996@qq.com>
Date: Thu, 08 Aug 2024 09:59:42 +0800
Subject: [PATCH] 代码优化
---
src/views/cGovernance/gridWorkLog.vue | 1093 +++++++++++++++++++++++++++++----------------------------
1 files changed, 560 insertions(+), 533 deletions(-)
diff --git a/src/views/cGovernance/gridWorkLog.vue b/src/views/cGovernance/gridWorkLog.vue
index 52bafe8..ced0bde 100644
--- a/src/views/cGovernance/gridWorkLog.vue
+++ b/src/views/cGovernance/gridWorkLog.vue
@@ -1,571 +1,598 @@
<!-- 走访日志 -->
<template>
- <basic-container>
- <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
- v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave"
- :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="householdIdType" slot-scope="{item,value,label}">
- <span>{{ showNamePhone(item) }}</span>
- </template>
+ <basic-container>
+ <avue-crud :option="option" :table-loading="loading" :data="data" :page.sync="page" ref="crud" @row-del="rowDel"
+ v-model="form" :permission="permissionList" @row-update="rowUpdate" @row-save="rowSave" :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="householdIdType" slot-scope="{item,value,label}">
+ <span>{{ showNamePhone(item) }}</span>
+ </template>
- <template slot="menuLeft">
- <el-button size="small" icon="el-icon-delete" plain v-if="permission.gridWorkLog_delete"
- @click="handleDelete">删 除
- </el-button>
- </template>
+ <template slot="menuLeft">
+ <el-button size="small" icon="el-icon-delete" plain v-if="permission.gridWorkLog_delete" @click="handleDelete">删
+ 除
+ </el-button>
+ </template>
- <template slot-scope="{row, size}" slot="phone">
- <el-button :size="size" type="text" @click="showStringDispose(row, 'phoneflag')"
- v-text="textDispose(row, 'phoneflag', 'phone')">
- </el-button>
- </template>
- </avue-crud>
- </basic-container>
+ <template slot-scope="{row, size}" slot="phone">
+ <el-button :size="size" type="text" @click="showStringDispose(row, 'phoneflag')"
+ v-text="textDispose(row, 'phoneflag', 'phone')">
+ </el-button>
+ </template>
+ </avue-crud>
+ </basic-container>
</template>
<script>
-import { getPersonPublicSelect } from "@/api/public"
-import { getDetatils as householdDetail } from "@/api/userHouse/list/houseHold"
-import { getList, remove, update, add, getGridWorkLog } from "@/api/grid/gridWorkLog"
-import { getList as getHouseholdList, getDetatils as getHouseholdDetail } from "@/api/userHouse/list/houseHold"
-import { mapGetters } from "vuex"
-import website from '@/config/website'
+ import {
+ getPersonPublicSelect
+ } from "@/api/public"
+ import {
+ getDetatils as householdDetail
+ } from "@/api/userHouse/list/houseHold"
+ import {
+ getList,
+ remove,
+ update,
+ add,
+ getGridWorkLog
+ } from "@/api/grid/gridWorkLog"
+ import {
+ getList as getHouseholdList,
+ getDetatils as getHouseholdDetail
+ } from "@/api/userHouse/list/houseHold"
+ import {
+ mapGetters
+ } from "vuex"
+ import website from '@/config/website'
-export default {
- data () {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0,
+ export default {
+ data() {
+ return {
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ },
+ datetime: "",
+ selectionList: [],
+ option: {
+ labelWidth: 120,
+ searchLabelWidth: 96,
+ searchShow: true,
+ searchMenuSpan: 3,
+ menuWidth: 210,
+
+ height: "auto",
+ calcHeight: 54,
+ dialogWidth: 950,
+ tip: false,
+ border: true,
+ //stripe:true,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ excelBtn: true,
+ dialogClickModal: false,
+ column: [{
+ width: 120,
+ label: "走访类型",
+ prop: "type",
+ span: 12,
+ searchSpan: 4,
+ search: true,
+ searchLabelWidth: 80,
+ type: "select",
+ dicUrl: "/api/blade-system/dict-biz/dictionary?code=haveType",
+ dataType: "number",
+ props: {
+ label: "dictValue",
+ value: "dictKey",
+ },
+ rules: [{
+ required: true,
+ message: "请选择走访类型",
+ trigger: "blur",
+ }, ],
},
- datetime: "",
- selectionList: [],
- option: {
- labelWidth: 120,
- searchLabelWidth: 96,
- searchShow: true,
- searchMenuSpan: 3,
- menuWidth: 210,
- height: "auto",
- calcHeight: 54,
- dialogWidth: 950,
- tip: false,
- border: true,
- //stripe:true,
- index: true,
- viewBtn: true,
- selection: true,
- excelBtn: true,
- dialogClickModal: false,
- column: [
- {
- width: 120,
- label: "走访类型",
- prop: "type",
- span: 12,
- searchSpan: 4,
- search: true,
- searchLabelWidth: 76,
- type: "select",
- dicUrl: "/api/blade-system/dict-biz/dictionary?code=haveType",
- dataType: "number",
- props: {
- label: "dictValue",
- value: "dictKey",
- },
- rules: [
- {
- required: true,
- message: "请选择走访类型",
- trigger: "blur",
- },
- ],
- },
-
- {
- overHidden: true,
- label: "重点人群",
- prop: "personType",
- span: 12,
- type: "tree",
- dicUrl: "/api/blade-label/label/getLabelList?parentId=100",
- props: {
- label: "name",
- value: "id"
- },
- searchSpan: 4,
- search: true,
- change: ({ value, column, item, dic }) => {
- this.getUserList(value)
- },
- rules: [
- {
- required: true,
- message: "请选择重点人群",
- trigger: "blur",
- },
- ],
- },
-
- {
- width: 110,
- display: false,
- label: "被访人姓名",
- prop: "name",
- searchLabelWidth: 120,
- searchSpan: 5,
- search: true,
- },
-
- {
- disabled: true,
- label: "被访人姓名",
- prop: "householdId",
- type: 'select',
- remote: true,
- hide: true,
- dicUrl: "",
- props: {
- label: 'name',
- value: 'id',
- },
- dicData: [],
- rules: [
- {
- required: true,
- message: '请输入姓名',
- trigger: 'blur'
- }
- ],
- },
-
- {
- width: 120,
- label: "联系方式",
- prop: "phone",
- span: 12,
- disabled: true,
- searchSpan: 4,
- search: true,
- slot: true
- },
-
- {
- width: 156,
- overHidden: true,
- label: "走访地址",
- prop: "address",
- span: 24,
- disabled: true,
- },
-
- {
- width: 110,
- label: "所属街道",
- display: false,
- prop: "townName",
- },
-
- {
- width: 156,
- overHidden: true,
- label: "所属社区",
- display: false,
- prop: "neiName",
- search: true,
- searchSpan: 4
- },
-
- {
- width: 110,
- overHidden: true,
- label: "所属网格",
- display: false,
- prop: "gridName",
- },
- {
- width: 144,
- label: "走访时间",
- prop: "workTime",
- searchLabelWidth: 120,
- type: "date",
- row: true,
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [
- {
- required: true,
- message: "请输入走访时间",
- trigger: "blur",
- },
- ],
- },
-
- {
- overHidden: true,
- label: "走访内容",
- prop: "context",
- type: "textarea",
- span: 24,
- rules: [
- {
- required: true,
- message: "请输入走访内容",
- trigger: "blur",
- },
- ],
- },
-
- {
- width: 110,
- label: "走访取证",
- prop: "url",
- type: "upload",
- listType: "picture-card",
- dataType: "string",
- multiple: true,
- action: "/api/blade-resource/oss/endpoint/put-file",
- propsHttp: {
- res: "data",
- name: 'name',
- url: "link",
- },
- span: 24,
- },
-
- {
- width: 110,
- label: "录入人",
- display: false,
- prop: "createUserName",
- },
-
-
-
- {
- display: false,
- width: 144,
- label: "上报时间",
- prop: "createTime",
- searchLabelWidth: 120,
- type: "date",
- format: "yyyy-MM-dd HH:mm:ss",
- valueFormat: "yyyy-MM-dd HH:mm:ss",
- rules: [
- {
- required: true,
- message: "请输入上报时间",
- trigger: "blur",
- },
- ],
- },
- ],
+ {
+ overHidden: true,
+ label: "重点人群",
+ prop: "personType",
+ span: 12,
+ type: "tree",
+ dicUrl: "/api/blade-label/label/getLabelList?parentId=1000",
+ props: {
+ label: "name",
+ value: "id"
+ },
+ searchSpan: 4,
+ search: true,
+ change: ({
+ value,
+ column,
+ item,
+ dic
+ }) => {
+ this.getUserList(value)
+ },
+ rules: [{
+ required: true,
+ message: "请选择重点人群",
+ trigger: "blur",
+ }, ],
},
- data: [],
- }
+
+ {
+ width: 110,
+ display: false,
+ label: "被访人姓名",
+ prop: "name",
+ searchLabelWidth: 120,
+ searchSpan: 5,
+ search: true,
+ },
+
+ {
+ disabled: true,
+ label: "被访人姓名",
+ prop: "householdId",
+ type: 'select',
+ remote: true,
+ hide: true,
+ dicUrl: "",
+ props: {
+ label: 'name',
+ value: 'id',
+ },
+ dicData: [],
+ rules: [{
+ required: true,
+ message: '请输入姓名',
+ trigger: 'blur'
+ }],
+ },
+
+ {
+ width: 100,
+ label: "联系方式",
+ prop: "phone",
+ span: 12,
+ disabled: true,
+ searchSpan: 4,
+ search: true,
+ slot: true
+ },
+
+ {
+ width: 156,
+ overHidden: true,
+ label: "走访地址",
+ prop: "address",
+ span: 24,
+ disabled: true,
+ },
+
+ {
+ width: 110,
+ label: "所属街道",
+ display: false,
+ prop: "townName",
+ },
+
+ {
+ width: 156,
+ overHidden: true,
+ label: "所属社区",
+ display: false,
+ prop: "neiName",
+ search: true,
+ searchSpan: 4
+ },
+
+ {
+ width: 110,
+ overHidden: true,
+ label: "所属网格",
+ display: false,
+ prop: "gridName",
+ },
+ {
+ width: 110,
+ searchLabelWidth: 80,
+ overHidden: true,
+ label: "状态",
+ display: false,
+ prop: "status",
+ type: 'select',
+ search: true,
+ searchSpan: 4,
+ dicData: [{
+ label: "未走访",
+ value: "1",
+ },
+ {
+ label: "已走访",
+ value: "2",
+ }
+ ],
+ },
+ {
+ width: 140,
+ label: "走访时间",
+ prop: "workTime",
+ searchLabelWidth: 120,
+ type: "date",
+ row: true,
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ rules: [{
+ required: true,
+ message: "请输入走访时间",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ width: 140,
+ overHidden: true,
+ label: "走访内容",
+ prop: "context",
+ type: "textarea",
+ span: 24,
+ rules: [{
+ required: true,
+ message: "请输入走访内容",
+ trigger: "blur",
+ }, ],
+ },
+ {
+ width: 110,
+ label: "走访取证",
+ prop: "url",
+ type: "upload",
+ listType: "picture-card",
+ dataType: "string",
+ multiple: true,
+ action: "/api/blade-resource/oss/endpoint/put-file",
+ propsHttp: {
+ res: "data",
+ name: 'name',
+ url: "link",
+ },
+ span: 24,
+ },
+
+ {
+ width: 110,
+ label: "录入人",
+ display: false,
+ prop: "createUserName",
+ },
+
+
+
+ {
+ display: false,
+ width: 144,
+ label: "上报时间",
+ prop: "createTime",
+ searchLabelWidth: 120,
+ type: "date",
+ format: "yyyy-MM-dd HH:mm:ss",
+ valueFormat: "yyyy-MM-dd HH:mm:ss",
+ rules: [{
+ required: true,
+ message: "请输入上报时间",
+ trigger: "blur",
+ }, ],
+ },
+ ],
+ },
+ data: [],
+ }
},
watch: {
- "form.householdId": {
- handler (val) {
- if (val) {
+ "form.householdId": {
+ handler(val) {
+ if (val) {
- householdDetail(val).then(res => {
- let data = res.data.data
+ householdDetail(val).then(res => {
+ let data = res.data.data
- this.form.phone = data.phoneNumber
- this.form.address = data.currentAddress
- })
+ this.form.phone = data.phoneNumber
+ this.form.address = data.currentAddress
+ })
- }
- }
+ }
+ }
+ },
+
+ 'form.personType': {
+ handler(newData) {
+ let householdIdColumn = this.findObject(
+ this.option.column,
+ 'householdId'
+ )
+
+ if (newData) {
+ householdIdColumn.disabled = false
+ } else {
+ householdIdColumn.disabled = true
+ }
},
+ },
- 'form.personType': {
- handler (newData) {
- let householdIdColumn = this.findObject(
- this.option.column,
- 'householdId'
- )
+ 'form.type': {
+ handler(newData) {
+ let householdIdColumn = this.findObject(
+ this.option.column,
+ 'householdId'
+ )
- if (newData) {
- householdIdColumn.disabled = false
- } else {
- householdIdColumn.disabled = true
- }
- },
+ let personTypeColumn = this.findObject(
+ this.option.column,
+ 'personType'
+ )
+
+ if (newData == 1) {
+ householdIdColumn.disabled = false
+ personTypeColumn.display = false
+ } else {
+ householdIdColumn.disabled = true
+ personTypeColumn.display = true
+ }
},
-
- 'form.type': {
- handler (newData) {
- let householdIdColumn = this.findObject(
- this.option.column,
- 'householdId'
- )
-
- let personTypeColumn = this.findObject(
- this.option.column,
- 'personType'
- )
-
- if (newData == 1) {
- householdIdColumn.disabled = false
- personTypeColumn.display = false
- } else {
- householdIdColumn.disabled = true
- personTypeColumn.display = true
- }
- },
- },
+ },
},
computed: {
- ...mapGetters(["permission", "userInfo"]),
- permissionList () {
- return {
- addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
- viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
- delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
- editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
- }
- },
- ids () {
- let ids = []
- this.selectionList.forEach((ele) => {
- ids.push(ele.id)
- })
- return ids.join(",")
- },
-
- showNamePhone () {
- return (data) => {
- if (data.phoneNumber && data.phoneNumber.trim() != '') {
- return `${data.name}(${data.phoneNumber})`
- }
-
- return data.name
- }
- },
-
- textDispose () {
- return (row, flag, type) => {
- if (row[flag] || row[type] == null) {
- return row[type]
- } else {
- if (type == 'principalIdCard') {
- return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
- } else {
- return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
- }
- }
- }
+ ...mapGetters(["permission", "userInfo"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.gridWorkLog_add, true),
+ viewBtn: this.vaildData(this.permission.gridWorkLog_view, true),
+ delBtn: this.vaildData(this.permission.gridWorkLog_delete, true),
+ editBtn: this.vaildData(this.permission.gridWorkLog_edit, true),
}
+ },
+ ids() {
+ let ids = []
+ this.selectionList.forEach((ele) => {
+ ids.push(ele.id)
+ })
+ return ids.join(",")
+ },
+
+ showNamePhone() {
+ return (data) => {
+ if (data.phoneNumber && data.phoneNumber.trim() != '') {
+ return `${data.name}(${data.phoneNumber})`
+ }
+
+ return data.name
+ }
+ },
+
+ textDispose() {
+ return (row, flag, type) => {
+ if (row[flag] || row[type] == null) {
+ return row[type]
+ } else {
+ if (type == 'principalIdCard') {
+ return row[type].replace(/^(.{6})(?:\d+)(.{4})$/, "$1******$2")
+ } else {
+ return row[type].replace(/^(.{3})(?:\d+)(.{4})$/, "$1****$2")
+ }
+ }
+ }
+ }
},
- created () {
- this.getUserList()
+ created() {
+ this.getUserList()
},
methods: {
- showStringDispose (row, type) {
- row[type] = !row[type]
- },
+ showStringDispose(row, type) {
+ row[type] = !row[type]
+ },
- getUserList (param = '') {
- let dicUrl = `/api/blade-household/household/selectHouseholdList?labelId=${param}&searchKey={{key}}&limit=20`
- const column = this.findObject(this.option.column, "householdId")
- column.dicUrl = dicUrl
- },
+ getUserList(param = '') {
+ let dicUrl = `/api/blade-household/household/selectHouseholdList?labelId=${param}&searchKey={{key}}&limit=20`
+ const column = this.findObject(this.option.column, "householdId")
+ column.dicUrl = dicUrl
+ },
- rowSave (row, done, loading) {
- if (row.url.length > 0) {
- var urls = []
- var split = row.url.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.url = urls.join(",")
- }
- add(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowUpdate (row, index, done, loading) {
- if (row.url.length > 0) {
- var urls = []
- var split = row.url.split(",")
- split.forEach(url => {
- var names = url.split("jczz/")
- urls.push(names[1])
- })
- row.url = urls.join(",")
- }
- update(row).then(
- () => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- done()
- },
- (error) => {
- window.console.log(error)
- loading()
- }
- )
- },
- rowDel (row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(row.id)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- })
- },
- searchReset () {
- this.query = {}
- this.onLoad(this.page)
- },
- searchChange (params, done) {
- this.query = params
- this.page.currentPage = 1
- this.onLoad(this.page, params)
- done()
- },
- selectionChange (list) {
- this.selectionList = list
- },
- selectionClear () {
- this.selectionList = []
- this.$refs.crud.toggleSelection()
- },
- handleDelete () {
- if (this.selectionList.length === 0) {
- this.$message.warning("请选择至少一条数据")
- return
- }
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning",
- })
- .then(() => {
- return remove(this.ids)
- })
- .then(() => {
- this.onLoad(this.page)
- this.$message({
- type: "success",
- message: "操作成功!",
- })
- this.$refs.crud.toggleSelection()
- })
- },
- beforeOpen (done, type) {
- if (["edit", "view"].includes(type)) {
- getGridWorkLog(this.form.id).then((res) => {
- this.form = res.data.data
- if (this.form.url) {
- if (this.form.url.length > 0) {
- var urls = []
- var names = this.form.url.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
- })
- this.form.url = urls.join(",")
- }
- }
- getPersonPublicSelect({
- id: this.form.householdId
- }).then(res => {
- const column = this.findObject(this.option.column, "householdId")
- column.dicData = res.data.data
- })
- })
- }
- // con
- done()
- },
- currentChange (currentPage) {
- this.page.currentPage = currentPage
- },
- sizeChange (pageSize) {
- this.page.pageSize = pageSize
- },
- refreshChange () {
- 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) => {
- const data = res.data.data
- this.page.total = data.total
- this.data = data.records
- this.data.forEach(item => {
- this.$set(item, 'phoneflag', false)
- if (item.url) {
- if (item.url.length > 0) {
- var urls = []
- var names = item.url.split(",")
- names.forEach(name => {
- urls.push(website.minioUrl + name)
- })
- item.url = urls.join(",")
- }
- }
- })
- this.loading = false
- this.selectionClear()
- })
+ rowSave(row, done, loading) {
+ if (row.url.length > 0) {
+ var urls = []
+ var split = row.url.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.url = urls.join(",")
}
+ add(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowUpdate(row, index, done, loading) {
+ if (row.url.length > 0) {
+ var urls = []
+ var split = row.url.split(",")
+ split.forEach(url => {
+ var names = url.split("jczz/")
+ urls.push(names[1])
+ })
+ row.url = urls.join(",")
+ }
+ update(row).then(
+ () => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(row.id)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ })
+ },
+ searchReset() {
+ this.query = {}
+ this.onLoad(this.page)
+ },
+ searchChange(params, done) {
+ this.query = params
+ this.page.currentPage = 1
+ this.onLoad(this.page, params)
+ done()
+ },
+ selectionChange(list) {
+ this.selectionList = list
+ },
+ selectionClear() {
+ this.selectionList = []
+ this.$refs.crud.toggleSelection()
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据")
+ return
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning",
+ })
+ .then(() => {
+ return remove(this.ids)
+ })
+ .then(() => {
+ this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ this.$refs.crud.toggleSelection()
+ })
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getGridWorkLog(this.form.id).then((res) => {
+ this.form = res.data.data
+ if (this.form.url) {
+ if (this.form.url.length > 0) {
+ var urls = []
+ var names = this.form.url.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ this.form.url = urls.join(",")
+ }
+ }
+ getPersonPublicSelect({
+ id: this.form.householdId
+ }).then(res => {
+ const column = this.findObject(this.option.column, "householdId")
+ column.dicData = res.data.data
+ })
+ })
+ }
+ // con
+ done()
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize
+ },
+ refreshChange() {
+ 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) => {
+ const data = res.data.data
+ this.page.total = data.total
+ this.data = data.records
+ this.data.forEach(item => {
+ this.$set(item, 'phoneflag', false)
+ if (item.url) {
+ if (item.url.length > 0) {
+ var urls = []
+ var names = item.url.split(",")
+ names.forEach(name => {
+ urls.push(website.minioUrl + name)
+ })
+ item.url = urls.join(",")
+ }
+ }
+ })
+ this.loading = false
+ this.selectionClear()
+ })
+ }
},
-}
+ }
</script>
<style>
-.avue-upload__icon {
+ .avue-upload__icon {
line-height: 6;
-}
-</style>
+ }
+</style>
\ No newline at end of file
--
Gitblit v1.9.3