From ebfc739bdbbc0dd0fccd0bf47b7d2d5397c3c511 Mon Sep 17 00:00:00 2001
From: lin <sbla5888@163.com>
Date: Fri, 22 Mar 2024 12:44:21 +0800
Subject: [PATCH] 轮播图片
---
src/views/property/components/propertyEdit.vue | 203 ++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 171 insertions(+), 32 deletions(-)
diff --git a/src/views/property/components/propertyEdit.vue b/src/views/property/components/propertyEdit.vue
index 3c66d15..2ea7080 100644
--- a/src/views/property/components/propertyEdit.vue
+++ b/src/views/property/components/propertyEdit.vue
@@ -1,49 +1,74 @@
<template>
-
- <el-dialog title="" append-to-body :visible.sync="infoVisible" top="10vh" width="70%">
+ <el-dialog title="" append-to-body :visible.sync="infoVisible" top="10vh" width="70%" :before-close="handleClose">
<el-tabs v-model="activeName" @tab-click="handleClick">
- <el-tab-pane label="基础信息" name="first"></el-tab-pane>
- <el-tab-pane label="基础信息" name="second"></el-tab-pane>
- <el-tab-pane label="良好行为信息" name="third"></el-tab-pane>
- <el-tab-pane label="不良行为信息" name="fourth"></el-tab-pane>
+ <!-- <el-tab-pane label="物业信息" name="first"></el-tab-pane> -->
+ <!-- <el-tab-pane label="基础信息" name="info1"></el-tab-pane> -->
+ <!-- <el-tab-pane label="经营信息" name="info2"></el-tab-pane> -->
+ <!-- <el-tab-pane label="纳税信息" name="info3"></el-tab-pane> -->
+ <!-- <el-tab-pane label="党建信息" name="info4"></el-tab-pane> -->
+ <el-tab-pane label="街道社区" name="info8"></el-tab-pane>
+ <!-- <el-tab-pane label="企业良好行为" name="info5"></el-tab-pane> -->
+ <!-- <el-tab-pane label="项目良好行为" name="info6"></el-tab-pane> -->
+ <!-- <el-tab-pane label="违法违规行为惩戒" name="info7"></el-tab-pane> -->
+
</el-tabs>
- <avue-form :option="option" v-model="first" v-if="activeName == 'first'"></avue-form>
+ <!-- <avue-form :option="option" v-model="first" v-if="activeName == 'first'" @submit="rowSave"></avue-form> -->
<!-- <avue-form :option="option" v-model="second" v-if="activeName == 'second'"></avue-form> -->
- <div>
-
- <div v-for="(item, index) in questionBankData" :key="index">
- <div>
- {{ item.subjectName }}
+ <div class="answer" v-show="activeName != 'info0'">
+ <div class="topic-item" v-for="(item, index) in questionBankData" :key="index">
+ <div class="topic-title">
+ {{ index + 1 }} .{{ item.subjectName }}
</div>
- <div v-for="(item1, index1) in item.subjectOptionList" :key="index1">
- <!-- <div>
- {{ item1.optionName }}
- </div> -->
- <el-radio-group>
- <el-radio :label="item1.id">{{item1.optionName}}</el-radio>
- </el-radio-group>
+ <div class="topic-options" v-if="item.choicesType == 0">
+ <el-radio-group v-model="item.chooseId" @input="inputs()">
+ <el-radio :label="item1.id" v-for="(item1, index1) in item.subjectOptionList" :key="index1">{{
+ item1.optionName }}</el-radio>
+ </el-radio-group>
+ </div>
+
+ <div class="topic-options" v-if="item.choicesType == 3">
+ <div class="input-num-item" v-for="(item1, index1) in item.subjectOptionList" :key="index1">
+ <div class="num-name">{{ item1.optionName }}:</div>
+ <el-input-number v-model="item1.numbers" @change="handleChange" :min="0" :max="25"
+ :label="item1.optionName"></el-input-number>
+ </div>
</div>
</div>
</div>
+ <div slot="footer" class="dialog-footer">
+ <el-button @click="infoVisible = false">取 消</el-button>
+ <el-button type="primary" @click="submit">提 交</el-button>
+ </div>
+
</el-dialog>
-
</template>
<script>
import {
getList,
remove
- } from "@/api/subjectChoices/subjectChoices";
+ } from "@/api/subjectChoices/subjectChoices"
+
+ import {
+ save
+ } from "@/api/answerRecord/answerRecord"
+ import {
+ add
+ } from "@/api/property/propertyCompany"
+ import {
+ mapGetters
+ } from "vuex"
export default {
data() {
return {
- activeName: 'first',
+ property: {},
+ activeName: 'info1',
infoVisible: false,
page: {
pageSize: 20,
@@ -168,9 +193,66 @@
},
],
},
- };
+ }
+ },
+ computed: {
+ ...mapGetters(["permission", "userInfo"]),
},
methods: {
+
+ handleClose() {
+ this.infoVisible = false
+ // this.$refs.DisCussFrom && this.$refs.DisCussFrom.resetForm()
+ },
+ inputs(label) {
+ console.table(label)
+ },
+
+ submit() {
+ let isChoose = false
+ this.questionBankData.forEach(item => {
+ if (item.chooseId) {
+ isChoose = true
+ }
+ })
+ if (isChoose == false) return
+ save(this.questionBankData).then(
+ () => {
+ // this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
+ handleChange(value) {
+ console.log(value)
+ },
+
+ rowSave(form, done) {
+ console.log('==========>', JSON.stringify(form))
+ form.userid = this.userInfo.user_id
+ add(form).then(
+ () => {
+ // this.onLoad(this.page)
+ this.$message({
+ type: "success",
+ message: "操作成功!",
+ })
+ done()
+ },
+ (error) => {
+ window.console.log(error)
+ loading()
+ }
+ )
+ },
questionBankOnLoad(page, params = {}) {
// params = {}
@@ -180,27 +262,84 @@
page.pageSize,
Object.assign(params, this.query)
).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.questionBankData = data.records;
- // this.questionBankLoading = false;
- });
+ const data = res.data.data
+ this.page.total = data.total
+ this.questionBankData = data.records
+ this.questionBankData.forEach(item => {
+ item.propertyId = this.property.id
+ })
+ })
},
init(row) {
this.infoVisible = true
+ let param = {
+ subclassName: '街道社区',
+ propertyId: row.id
+ }
+ this.property = row
+ this.questionBankOnLoad(this.page, param)
},
handleClick(tab, event) {
- console.log(tab, event);
+ // this.$confirm("确定将选择数据删除?", {
+ // confirmButtonText: "确定",
+ // cancelButtonText: "取消",
+ // type: "warning",
+ // })
+ // .then(() => {
+ // return remove(row.id)
+ // })
+ // .then(() => {
+ // this.onLoad(this.page)
+ // this.$message({
+ // type: "success",
+ // message: "操作成功!",
+ // })
+ // })
+ // console.log(tab, event);
+ console.log('============>', JSON.stringify(this.questionBankData))
let param = {
- categoryName: tab.label
+ subclassName: tab.label
}
this.questionBankOnLoad(this.page, param)
}
}
- };
+ }
</script>
-<style>
+<style lang="scss" scoped>
+ :deep(.answer) {
+ height: calc(100% - 60px);
+ overflow-y: scroll;
+
+ .topic-item {
+ margin-bottom: 20px;
+
+ .topic-title {
+ margin-bottom: 10px;
+ font-size: 14px;
+ }
+
+ .topic-options {
+ display: flex;
+
+ .el-radio {
+ margin-bottom: 10px;
+ }
+
+ .input-num-item {
+ display: flex;
+ margin-right: 20px;
+
+ .num-name {
+ display: flex;
+ align-items: center;
+ margin-right: 6px;
+ font-size: 14px;
+ }
+ }
+ }
+ }
+ }
</style>
\ No newline at end of file
--
Gitblit v1.9.3