Browse Source

移治风采代码提交

master
juwei001 1 year ago
parent
commit
7374095330
  1. 13
      src/views/modules/communityParty/culture/dialogForm.vue
  2. 8
      src/views/modules/communityParty/culture/index.vue
  3. 136
      src/views/modules/communityParty/govern/dialogDetail.vue
  4. 349
      src/views/modules/communityParty/govern/dialogForm.vue
  5. 522
      src/views/modules/communityParty/govern/index.vue
  6. 36
      src/views/modules/communityParty/keyEnterprises/dialogForm.vue
  7. 2
      src/views/modules/communityParty/regionalParty/activitys.vue
  8. 12
      src/views/modules/communityParty/regionalParty/activitysForm.vue

13
src/views/modules/communityParty/culture/dialogForm.vue

@ -35,6 +35,19 @@
placeholder="在这里输入文字"
/>
</el-form-item>
<el-form-item
label="排序"
prop="sort"
label-width="150px"
style="display: block"
>
<el-input-number
class="item_width_1"
placeholder="请输入"
v-model="formData.sort"
>
</el-input-number>
</el-form-item>
<el-form-item label="封面" prop="cover" label-width="150px">
<div class="imsg-list">

8
src/views/modules/communityParty/culture/index.vue

@ -71,6 +71,14 @@
label="内容"
>
</el-table-column>
<el-table-column
prop="sort"
header-align="left"
align="left"
width="90px"
label="排序"
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"

136
src/views/modules/communityParty/govern/dialogDetail.vue

@ -0,0 +1,136 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<div class="m-row">
<div class="m-info">
<div class="info-prop">
<span class="info-title-2">类型</span>
<span>{{ getTypeLable(formData.type) }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">姓名</span>
<span>{{ formData.name }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">介绍</span>
<span>{{ formData.introduction }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">排序</span>
<span>{{ formData.sort }}</span>
</div>
<div class="info-prop">
<span class="info-title-2">封面</span>
<img width="450px" :src="formData.cover" />
</div>
</div>
</div>
</div>
<div class="div-btn">
<el-button size="small" @click="handleCancle"> </el-button>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import daiMap from "@/utils/dai-map";
var map;
let loading; //
export default {
data() {
return {
formData: {},
initLoading: false,
types: [
{
label: '高端科技人才',
value: '1'
},
{
label: '土秀才田专家',
value: '2'
},
],
};
},
components: {},
mounted() {},
methods: {
handleCancle() {
this.diaDestroy();
this.$emit("diaDetailClose");
},
diaDestroy() {
if (map) {
// map.destroy()
}
},
getTypeLable(type) {
if (type) {
const lable =
this.unitList.filter((item) => item.value == type)[0].label;
return lable;
}
return "";
},
async initForm(row) {
this.startLoading();
this.formData = row;
this.endLoading();
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {},
props: {
serviceList: {
type: Array,
default: [],
},
gridList: {
type: Array,
default: [],
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/management/detail-main.scss";
</style>
<style lang="scss" scoped>
/deep/ .text_p {
margin: 0 0;
border: 3px;
> p {
margin: 0 0;
}
img {
max-width: 100%;
height: auto;
}
}
</style>

349
src/views/modules/communityParty/govern/dialogForm.vue

@ -0,0 +1,349 @@
<template>
<div>
<div class="dialog-h-content scroll-h">
<el-form
ref="ref_form"
:inline="true"
:model="formData"
:rules="dataRule"
class="form"
>
<el-form-item
label="姓名"
prop="name"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
placeholder="请输入"
v-model="formData.name"
>
</el-input>
</el-form-item>
<el-form-item
label="性别"
prop="gender"
label-width="150px"
style="display: block"
>
<el-select
class="item_width_1"
v-model="formData.gender"
placeholder="请选择性别"
clearable
>
<el-option
v-for="item in types"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item>
<el-form-item
label="手机号"
prop="mobile"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
placeholder="请输入"
v-model="formData.mobile"
>
</el-input>
</el-form-item>
<el-form-item
label="身份证号"
prop="idCard"
label-width="150px"
style="display: block"
>
<el-input
class="item_width_1"
placeholder="请输入"
v-model="formData.idCard"
>
</el-input>
</el-form-item>
<el-form-item
label="介绍"
prop="introduce"
label-width="150px"
style="display: block"
>
<el-input
type="textarea"
:rows="2"
class="item_width_1"
placeholder="请输入介绍"
v-model="formData.introduce"
>
</el-input>
</el-form-item>
<el-form-item label="照片" prop="headPhoto" label-width="150px">
<div class="imsg-list">
<div class="imgs-item" v-if="formData.headPhoto">
<el-image
style="width: 100px; height: 100px"
:src="formData.headPhoto"
fit="fill"
></el-image>
<i class="el-icon-delete" @click="formData.headPhoto=null"></i>
</div>
<el-upload
:headers="$getElUploadHeaders()"
class="avatar-uploader"
:action="uploadUlr"
:data="{ customerId: customerId }"
:show-file-list="false"
:on-progress="handleProgress"
:on-success="handleImgSuccess"
:before-upload="beforeImgUpload"
>
<el-progress
v-if="uploading"
:width="100"
type="circle"
:percentage="unloadPencent"
></el-progress>
<i v-else class="el-icon-plus avatar-uploader-icon"></i>
</el-upload>
</div>
</el-form-item>
</el-form>
</div>
<div class="div_btn">
<el-button size="small" @click="handleCancle"> </el-button>
<el-button
size="small"
type="primary"
:disabled="btnDisable"
@click="handleComfirm"
> </el-button
>
</div>
</div>
</template>
<script>
import { Loading } from "element-ui"; // Loading
import { requestPost, requestGet } from "@/js/dai/request";
import Tinymce from "@c/tinymce2/index.vue";
let loading; //
export default {
data() {
return {
formType: "add", // addeditdetail
loading: false,
formData: {
name: null,
content: null,
headPhoto: "",
},
types: [
{
label: "男",
value: "1",
},
{
label: "女",
value: "0",
},
],
unloadPencent: 0,
customerId: "",
uploading: false,
uploadUlr: window.SITE_CONFIG["apiURL"] + "/oss/file/uploadqrcodeV2",
};
},
components: { Tinymce },
mounted() {
// this.initMap()
},
created() {
this.customerId = localStorage.getItem("customerId");
},
methods: {
async initForm(type, id) {
this.startLoading();
this.formType = type;
this.resetData();
if (id) {
const { data, code, msg } = await requestGet(
`/resi/partymember/icgovernuser/${id}`
);
if (code === 0) {
this.formData = data;
} else {
this.$message.error(msg);
}
}
//
this.endLoading();
},
async handleComfirm() {
this.btnDisable = true;
setTimeout(() => {
this.btnDisable = false;
}, 10000);
this.$refs["ref_form"].validate((valid, messageObj) => {
if (!valid) {
app.util.validateRule(messageObj);
this.btnDisable = false;
} else {
this.addActivity();
}
});
},
async addActivity() {
let url = "/resi/partymember/icgovernuser";
const { data, code, msg } = await requestPost(url, this.formData);
if (code === 0) {
this.$message({
type: "success",
message: "操作成功",
});
this.resetData();
this.$emit("dialogOk");
this.btnDisable = false;
} else {
this.btnDisable = false;
this.$message.error(msg);
}
},
handleCancle() {
this.resetData();
this.$emit("dialogCancle");
},
beforeImgUpload(file) {
const isPNG = file.type === "image/png" || file.type === "image/jpeg";
const isLt1M = file.size / 1024 / 1024 < 10;
if (!isPNG) {
this.$message.error("上传图片只能是 PNG 或 JPEG 格式!");
}
if (!isLt1M) {
this.$message.error("上传图片大小不能超过 10MB!");
}
return isPNG && isLt1M;
},
handleImgSuccess(res, file) {
if (res.code === 0 && res.msg === "success") {
this.uploading = false;
this.unloadPencent = 0;
this.formData.headPhoto = res.data.url;
} else {
this.$message.error(res.msg);
}
},
handleProgress(event, file, fileList) {
this.uploading = true;
this.unloadPencent = Number(file.percentage.toFixed(0));
},
resetData() {
this.formData = {
name: null,
};
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
loading.close();
},
},
computed: {
dataRule() {
return {
name: [{ required: true, message: "姓名不能为空", trigger: "blur" }],
type: [{ required: true, message: "类型不能为空", trigger: "blur" }],
description: [
{ required: true, message: "内容不能为空", trigger: "blur" },
],
};
},
},
props: {
unitList: {
type: Array,
default: [],
},
},
};
</script>
<style lang="scss" scoped>
@import "@/assets/scss/modules/visual/communityManageForm.scss";
</style>
<style lang="scss" scoped>
.item_width_1 {
width: 560px;
/deep/.tox .tox-dialog {
z-index: 20000;
}
}
.tinymce_view {
::v-deep .tox .tox-dialog {
z-index: 2000000000;
}
}
.imsg-list {
display: flex;
align-items: center;
.imgs-item {
position: relative;
margin-right: 10px;
.el-icon-delete {
position: absolute;
top: 0;
right: 0;
font-size: 18px;
color: red;
z-index: 3;
cursor: pointer;
}
}
}
.div_map {
position: relative;
}
.div_searchmap {
z-index: 5000;
position: absolute;
top: 5px;
left: 5px;
}
.tinymce_view {
height: 400px;
overflow: auto;
}
.text_p {
margin: 0;
padding: 0 10px;
border: 1px solid #d9d9d9;
border-radius: 5px;
> p {
margin: 0;
}
}
</style>

522
src/views/modules/communityParty/govern/index.vue

@ -0,0 +1,522 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form
:inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'"
>
<div>
<!-- <el-form-item label="类型" prop="type">
<el-select
class="item_width_1"
v-model="formData.type"
placeholder="请选择类型"
clearable
>
<el-option
v-for="item in types"
:key="item.value"
:label="item.label"
:value="item.value"
>
</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="姓名" prop="name">
<el-input
v-model="formData.name"
size="small"
class="item_width_1"
clearable
placeholder="请输入内容"
>
</el-input>
</el-form-item>
<el-button
style="margin-left: 10px"
class="diy-button--search"
size="small"
@click="handleSearch"
>查询</el-button
>
<el-button
style="margin-left: 10px"
class="diy-button--reset"
size="small"
@click="resetSearch"
>重置</el-button
>
</div>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button
style=""
class="diy-button--add"
size="small"
@click="handleAdd"
>新增</el-button
>
</div>
<el-table
class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{ background: '#2195FE', color: '#FFFFFF' }"
style="width: 100%"
>
<el-table-column
prop="name"
header-align="center"
width="140px"
align="center"
label="姓名"
>
</el-table-column>
<el-table-column
prop="mobile"
header-align="center"
width="140px"
align="center"
label="手机号"
>
</el-table-column>
<el-table-column
prop="idCard"
header-align="center"
width="240px"
align="center"
label="身份证号"
>
</el-table-column>
<el-table-column
prop="gender"
header-align="center"
width="140px"
align="center"
label="性别"
>
<template slot-scope="scope">
<span>{{ getTypeLable(scope.row.gender) }}</span>
</template>
</el-table-column>
<el-table-column
prop="introduce"
header-align="center"
align="center"
label="介绍"
>
</el-table-column>
<el-table-column
label="操作"
fixed="right"
width="140"
header-align="center"
align="center"
class="operate"
>
<template slot-scope="scope">
<el-button
type="text"
style="color: #1c6afd; text-decoration: underline"
size="small"
@click="handleDetail(scope.row)"
>查看</el-button
>
<el-button
type="text"
style="color: #00a7a9; text-decoration: underline"
size="small"
@click="handleEdit(scope.row)"
>修改</el-button
>
<el-button
type="text"
style="color: #d51010; text-decoration: underline"
size="small"
@click="handleDelete(scope.row)"
>删除</el-button
>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total"
>
</el-pagination>
</div>
</div>
<!-- 修改弹出框 -->
<el-dialog
:visible.sync="formShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="formTitle"
width="800px"
top="5vh"
class="dialog-h"
@closed="diaClose"
>
<dialog-form
ref="ref_form"
@dialogCancle="addFormCancle"
@dialogOk="addFormOk"
></dialog-form>
</el-dialog>
<el-dialog
:visible.sync="detailShow"
:close-on-click-modal="false"
:close-on-press-escape="false"
:title="'详情'"
width="800px"
top="5vh"
class="dialog-h"
@closed="detailClosed"
>
<dialog-detail
ref="ref_detail"
@diaDetailClose="detailClosed"
></dialog-detail>
</el-dialog>
</div>
</template>
<script>
import dialogForm from "./dialogForm";
import dialogDetail from "./dialogDetail";
import util from "@js/util.js";
import { requestPost, requestGet } from "@/js/dai/request";
import { mapGetters } from "vuex";
import { Loading } from "element-ui"; // Loading
let loading; //
export default {
data() {
return {
loading: false,
total: 0,
pageSize: 10,
pageNo: 0,
tableLoading: false,
formData: {
type: null,
name: null,
},
types: [
{
label: "男",
value: "1",
},
{
label: "女",
value: "0",
},
],
tableData: [],
//form
formShow: false,
formTitle: "新增",
detailShow: false,
};
},
components: {
dialogForm,
dialogDetail,
},
async created() {},
async mounted() {
this.loadTable();
},
methods: {
handleSearch() {
this.loadTable();
},
async loadTable() {
this.tableLoading = true;
const url = "/resi/partymember/icgovernuser/page";
let params = {
limit: this.pageSize,
page: this.pageNo,
...this.formData,
};
const { data, code, msg } = await requestGet(url, params);
if (code === 0) {
this.total = data.total;
this.tableData = data.list;
} else {
this.$message.error(msg);
}
this.tableLoading = false;
},
diaClose() {
this.$refs.ref_form.resetData();
this.formShow = false;
},
getTypeLable(type) {
if (type) {
const lable = this.types.filter((item) => item.value == type)[0].label;
return lable;
}
return "";
},
detailClosed() {
console.log(this.$refs.ref_detail);
this.$refs.ref_detail.diaDestroy();
this.detailShow = false;
},
handleDetail(row) {
this.detailShow = true;
this.formTitle = "详情";
this.$nextTick(() => {
this.$refs.ref_detail.initForm(row);
});
},
handleAdd() {
this.formTitle = "新增";
this.formShow = true;
this.$nextTick(() => {
this.$refs.ref_form.initForm("add", null);
});
},
handleEdit(row) {
this.formTitle = "修改";
this.formShow = true;
this.$nextTick(() => {
this.$refs.ref_form.initForm("edit", row.id);
});
},
addFormCancle() {
this.formShow = false;
},
addFormOk() {
this.formShow = false;
this.loadTable();
},
async handleDelete(row) {
this.$confirm("确认删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
})
.then(() => {
this.deleteActivity(row);
})
.catch((err) => {
if (err == "cancel") {
}
});
},
async deleteActivity(row) {
this.$http
.delete("/resi/partymember/icgovernuser", { data: [row.id] })
.then((res) => {
this.$message({
type: "success",
message: "删除成功",
});
this.loadTable();
})
.catch((res) => {
this.$message.error(res.msg || "删除失败!");
});
},
//
resetSearch() {
this.formData = {
type: null,
name: null,
};
this.pageSize = 10;
this.pageNo = 0;
this.loadTable();
},
//
beforeUpload(file) {
this.files = file;
const isText = file.type === "application/vnd.ms-excel";
const isTextComputer =
file.type ===
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";
if (!isText && !isTextComputer) {
this.$message.error("请选择正确格式的文件");
return false;
} else {
this.fileName = file.name;
return true;
}
},
//
handleExceed(files, fileList) {
this.$message.warning(`当前限制选择 1 个文件,请删除后继续上传`);
},
async uploadFile() {
this.loading = true;
if (this.fileName == "") {
this.$message.warning("请选择要上传的文件!");
return false;
}
//
this.$refs["upload"].clearFiles();
var url = "/heart/icpartyactivity/import";
let fileFormData = new FormData();
fileFormData.append("file", this.files); //filenamefiletest.zip
const { data, code, msg } = await requestPost(url, fileFormData);
if (code === 0) {
this.$message({
type: "success",
message: "导入成功",
});
this.loadTable();
} else {
this.$message.error(msg);
}
},
handleTimeChange(time) {
if (time) {
const startTimeArray = util.dateFormatter(time[0], "date").split("-");
const endTimeArray = util.dateFormatter(time[1], "date").split("-");
this.formData.startTime =
startTimeArray[0] +
"-" +
startTimeArray[1] +
"-" +
startTimeArray[2] +
" 00:00:00";
this.formData.endTime =
endTimeArray[0] +
"-" +
endTimeArray[1] +
"-" +
endTimeArray[2] +
" 23:59:59";
// this.startTimeShow = startTimeArray[0] + '' + startTimeArray[1] + '' + startTimeArray[2] + ''
// this.endTimeShow = endTimeArray[0] + '' + endTimeArray[1] + '' + endTimeArray[2] + ''
} else {
this.formData.startTime = "";
this.formData.endTime = "";
// this.startTimeShow = ''
// this.endTimeShow = ''
}
},
handleSizeChange(val) {
this.pageSize = val;
this.pageNo = 1;
this.loadTable();
},
handleCurrentChange(val) {
this.pageNo = val;
this.loadTable();
},
//
startLoading() {
loading = Loading.service({
lock: true, //
text: "正在加载……", //
background: "rgba(0,0,0,.7)", //
});
},
//
endLoading() {
// clearTimeout(timer);
if (loading) {
loading.close();
}
},
},
computed: {
tableHeight() {
return this.$store.state.inIframe
? this.clientHeight - 430 + this.iframeHeight
: this.clientHeight - 430;
},
...mapGetters(["clientHeight", "iframeHeight"]),
},
watch: {},
props: {},
};
</script>
<style lang="scss" scoped>
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 495px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.div_btn {
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>

36
src/views/modules/communityParty/keyEnterprises/dialogForm.vue

@ -132,7 +132,10 @@
:src="item"
fit="fill"
></el-image>
<i class="el-icon-delete" @click="deleteImgs(item, 'display')"></i>
<i
class="el-icon-delete"
@click="deleteImgs(item, 'display')"
></i>
</div>
<el-upload
:headers="$getElUploadHeaders()"
@ -265,6 +268,9 @@ export default {
name: null,
content: null,
cover: "",
monitor: [],
display: [],
honor: [],
},
types: [
{
@ -301,14 +307,10 @@ export default {
if (code === 0) {
this.formData = {
...data,
// monitor: [],
// display: [],
// honor: [],
monitor: JSON.parse(data.monitor),
display: JSON.parse(data.display),
honor: JSON.parse(data.honor),
monitor: data.monitor ? JSON.parse(data.monitor) : [],
display: data.display ? JSON.parse(data.display) : [],
honor: data.honor ? JSON.parse(data.honor) : [],
};
console.log("this.formData::", this.formData);
} else {
this.$message.error(msg);
}
@ -385,7 +387,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
this.uploading = false;
this.unloadPencent = 0;
this.formData.honor = [...this.formData.honor, res.data.url];
if (this.formData.honor) {
this.formData.honor = [...this.formData.honor, res.data.url];
} else {
this.formData.honor = [res.data.url];
}
} else {
this.$message.error(res.msg);
}
@ -394,7 +400,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
this.uploading = false;
this.unloadPencent = 0;
this.formData.display = [...this.formData.display, res.data.url];
if (this.formData.display) {
this.formData.display = [...this.formData.display, res.data.url];
} else {
this.formData.display = [res.data.url];
}
} else {
this.$message.error(res.msg);
}
@ -403,7 +413,11 @@ export default {
if (res.code === 0 && res.msg === "success") {
this.uploading = false;
this.unloadPencent = 0;
this.formData.monitor = [...this.formData.monitor, res.data.url];
if (this.formData.monitor) {
this.formData.monitor = [...this.formData.monitor, res.data.url];
} else {
this.formData.monitor = [res.data.url];
}
} else {
this.$message.error(res.msg);
}

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

@ -472,7 +472,7 @@ export default {
},
detailClosed() {
console.log(this.$refs.ref_detail);
// console.log(this.$refs.ref_detail);
this.$refs.ref_detail.diaDestroy();
this.detailShow = false;
},

12
src/views/modules/communityParty/regionalParty/activitysForm.vue

@ -297,7 +297,11 @@ export default {
mounted() {
// this.initMap()
},
watch: {
// searchValue(val){
// console.log(val)
// }
},
methods: {
async initForm(type, activityId) {
this.startLoading();
@ -373,14 +377,14 @@ export default {
if (code === 0) {
this.formData = data;
console.log(this.formData.content);
// console.log(this.formData.content);
let style_img = "style='width:50px;height:40px;' ";
if (this.formData.content) {
// this.formData.content = this.formData.content.replace(/<img/g, "<img style='width:200px;height:120px;'")
// let array=this.formData.content.split('<img')
}
console.log(this.formData.content);
// console.log(this.formData.content);
} else {
this.$message.error(msg);
}
@ -441,7 +445,6 @@ export default {
map.on("dragend", (e) => {
this.handleMoveCenter(e);
});
map.setCenter(latitude, longitude);
map.setMarker(latitude, longitude);
},
@ -495,6 +498,7 @@ export default {
handleClickKey(index) {
let selPosition = this.resultList[index];
let lonlat = selPosition.lonlat.split(" ");
console.log('latitude, longitude::', lonlat[1], lonlat[0])
map.setCenter(lonlat[1], lonlat[0]);
map.setMarker(lonlat[1], lonlat[0]);
this.formData.latitude = lonlat[1];

Loading…
Cancel
Save