liyanqi
2022-11-01 e5b58707bae2d4e153560f51ed38859c530e9a66
普查列表页面
3个文件已修改
1646 ■■■■■ 已修改文件
src/views/operate/rectification/surveyList/components/createInterface/index.vue 550 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/rectification/surveyList/components/viewInterface/index.vue 488 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/rectification/surveyList/index.vue 608 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/operate/rectification/surveyList/components/createInterface/index.vue
@@ -1,260 +1,322 @@
<template>
    <div class="createmyInterface">
        <main>
            <div class="mainContent">
                <el-form ref="user" label-width="140px" autoComplete="on" :model="myInterface"
                    :rules="createmyInterfaceRules" label-position="right">
                    <!-- 应用名称 -->
                    <el-form-item label="应用名称:" prop="applicationName">
                        <el-input v-model="myInterface.applicationName" placeholder="填写应用名称"></el-input>
                    </el-form-item>
                    <!-- 应用图标 -->
                    <el-form-item label="应用图标:" prop="applicationIconUrl">
                        <div class="iconBox">
                            <div class="upload">
                                <img src="@/assets/imgs/user/default-avatar.jpg" alt="">
                            </div>
                            <div class="iconView">
                                <span>示意图</span>
                                <img src="@/assets/imgs/user/default-avatar.jpg" alt="">
                            </div>
                            <div class="tip">
                                <span>只允许上传jpg,jpeg,png,svg格式的图片,建议尺寸为105px*105px</span>
                            </div>
                        </div>
                    </el-form-item>
                    <!-- 应用类型 -->
                    <el-form-item label="应用类型:" prop="applicationType">
                        <div class="optionItem">
                            <el-radio-group v-model="myInterface.applicationType">
                                <el-radio :label="1">网页应用</el-radio>
                            </el-radio-group>
                        </div>
                    </el-form-item>
                    <!--网站url  -->
                    <el-form-item label="网站url:" prop="websiteUrl">
                        <el-input v-model="myInterface.websiteUrl"></el-input>
                    </el-form-item>
                    <!-- 应用描述 -->
                    <el-form-item label="应用描述:" prop="description">
                        <el-input v-model="myInterface.description" placeholder="请填写描述"></el-input>
                    </el-form-item>
                    <!-- 按钮 -->
                    <el-form-item>
                        <div class="optionBtn">
                            <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">提交
                            </el-button>
                            <el-button class="btn reset">重置</el-button>
                        </div>
                    </el-form-item>
                </el-form>
  <div class="createmyInterface">
    <main>
      <div class="mainContent">
        <el-form
          ref="survey"
          label-width="140px"
          autoComplete="on"
          :model="myInterface"
          :rules="createSurvey"
          label-position="right"
        >
          <el-form-item class="optionItem" label="问题类型:" prop="type">
            <el-select v-model="myInterface.type" placeholder="请选择问题类型">
              <el-option label="问题类型一" value="shanghai"></el-option>
              <el-option label="问题类型二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item class="optionItem" label="大类:" prop="bigclass">
            <el-select v-model="myInterface.bigclass" placeholder="请选择大类">
              <el-option label="大类一" value="shanghai"></el-option>
              <el-option label="大类二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item class="optionItem" label="小类:" prop="subclass">
            <el-select v-model="myInterface.subclass" placeholder="请选择小类">
              <el-option label="小类一" value="shanghai"></el-option>
              <el-option label="小类二" value="beijing"></el-option>
            </el-select>
          </el-form-item>
          <el-form-item class="optionItem" label="街道:" prop="street">
            <el-input
              v-model="myInterface.street"
              placeholder="请填写街道"
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="社区:" prop="community">
            <el-input
              v-model="myInterface.community"
              placeholder="请填写社区"
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="任务描述:" prop="task">
            <el-input
              v-model="myInterface.task"
              placeholder="请填写任务描述"
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="上报时间:" prop="reportTime">
            <div class="block">
              <el-date-picker
                v-model="myInterface.reportTime"
                type="datetime"
                placeholder="选择日期时间"
              >
              </el-date-picker>
            </div>
        </main>
    </div>
          </el-form-item>
          <el-form-item>
            <div class="optionBtn">
              <el-button class="btn cancel" @click.native.prevent="handleCancel"
                >取消</el-button
              >
              <el-button
                type="primary"
                class="btn submit"
                @click.native.prevent="handleSave"
                >保存
              </el-button>
            </div>
          </el-form-item>
        </el-form>
      </div>
    </main>
  </div>
</template>
<script>
export default {
    data() {
        const validateApplicationName = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写用户名称"));
            }
        };
        const validateApplicationIconUrl = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写登录密码"));
            } else {
                const rep = /^\w+$/;
                if (!rep.test(value)) {
                    callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串"));
                }
            }
        };
        const validateApplicationType = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写用户姓名"));
            } else {
                const rep = /^[\u4E00-\u9FA5]{2,4}$/;
                if (!rep.test(value)) {
                    callback("请输入正确的用户姓名");
                }
            }
        };
        const validatePhone = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写手机号码"));
            } else {
                const rep = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/
                if (!rep.test(value)) {
                    callback("请输入正确的手机号码");
                }
            }
        };
        return {
            myInterface: {
            },
            createmyInterfaceRules: {
                applicationName: [
                    { required: true, trigger: "blur", validator: validateApplicationName},
                ],
                applicationIconUrl: [
                    { required: true, trigger: "blur", validator: validateApplicationIconUrl },
                ],
                applicationType: [
                    { required: true, trigger: "blur", validator: validateApplicationType },
                ],
                websiteUrl: [
                    { required: true, trigger: "blur" },
                ],
                description: [
                    { required: false, trigger: "blur" },
                ],
            },
        }
  data() {
    const validateType = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请选择问题类型"));
      }
    };
    const validateBigClass = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请选择大类"));
      }
    };
    const validateSubClass = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请选择小类"));
      }
    };
    const validateStreet = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写街道"));
      }
    };
    const validateCommunity = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写社区"));
      }
    };
    const validateTask = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写任务描述"));
      }
    };
    const validateReportTime = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请选择任务上报时间"));
      }
    };
    return {
      myInterface: {
        num: "",
        type: "",
        bigclass: "",
        subclass: "",
        street: "",
        community: "",
        task: "",
        reportTime: "",
      },
      createSurvey: {
        type: [
          {
            required: true,
            trigger: "blur",
            validator: validateType,
          },
        ],
        bigclass: [
          {
            required: true,
            trigger: "blur",
            validator: validateBigClass,
          },
        ],
        subclass: [
          {
            required: true,
            trigger: "blur",
            validator: validateSubClass,
          },
        ],
        street: [
          { required: true, trigger: "blur", validator: validateStreet },
        ],
        community: [
          { required: true, trigger: "blur", validator: validateCommunity },
        ],
        task: [{ required: true, trigger: "blur", validator: validateTask }],
        reportTime: [
          { required: true, trigger: "blur", validator: validateReportTime },
        ],
      },
    };
  },
  created() {
    const that = this;
  },
  methods: {
    // 关闭弹窗
    handleCancel() {
        console.log(1);
      this.$emit("closeDialog", { flag: false, index: 0 });
    },
    created() {
        const that = this;
    //保存
    handleSave() {
      const { myInterface } = this;
        this.$refs.survey.validate((flag)=>{
            console.log(flag)
            if(flag){
            }else{
                return false
            }
        })
    //   this.$axios
    //     .post("sccg/system/portal/thirdApp/add", {
    //       websiteUrl: myInterface.websiteUrl,
    //       applicationIconUrl: myInterface.applicationIconUrl,
    //       applicationType: 0,
    //       description: myInterface.description,
    //       applicationName: myInterface.applicationName,
    //     })
    //     .then((res) => {
    //       console.log(res);
    //       // if (res.code === 200) {
    //       //     this.refresh();
    //       // }
    //     });
    },
    methods: {
        handleUser() {
            const { myInterface } = this;
            this.$axios.post('sccg/system/portal/thirdApp/add', {
                websiteUrl:myInterface.websiteUrl,
                applicationIconUrl:myInterface.applicationIconUrl,
                applicationType:0,
                description:myInterface.description,
                applicationName:myInterface.applicationName
            }).then(res => {
                console.log(res);
                // if (res.code === 200) {
                //     this.refresh();
                // }
            })
        },
    },
    props: ['refresh']
}
  },
  props: ['refresh','closeDialog'],
};
</script>
<style lang="scss" scoped>
.createmyInterface {
    border-radius: 1px;
  border-radius: 1px;
  background-color: #09152f;
  main {
    text-align: left;
    padding: 0 55px;
    background-color: #09152f;
    padding-bottom: 50px;
    .mainContent {
      display: flex;
      justify-content: center;
      padding-top: 50px;
    main {
        text-align: left;
        padding: 0 55px;
        background-color: #09152f;
        padding-bottom: 50px;
        .mainContent {
            display: flex;
            justify-content: center;
            padding-top: 50px;
            .iconBox {
                display: flex;
                .upload {
                    display: flex;
                    align-items: flex-end;
                    img {
                        width: 120px;
                        height: 120px;
                        border-radius: 4px;
                    }
                }
                .iconView {
                    display: flex;
                    flex-direction: column;
                    margin-left: 30px;
                    justify-content: flex-end;
                    img {
                        width: 70px;
                        height: 70px;
                        border-radius: 4px;
                    }
                }
                .tip {
                    display: flex;
                    align-items: flex-end;
                    margin-left: 30px;
                    font-size: 12px;
                    span {
                        line-height: 20px;
                    }
                }
            }
            .optionBtn{
                margin-top: 30px;
                &::v-deep .el-button{
                    padding: 12px 40px;
                }
                .reset{
                    border: 1px solid #0079fe;
                    color: #0079fe;
                }
            }
            &::v-deep .el-form-item__label {
                color: #4b9bb7;
            }
            &::v-deep .el-input__inner {
                background-color: #09152f;
                border: 1px solid #17324c;
            }
            .addPerson {
                display: flex;
                list-style: none;
                padding: 0;
                li {
                    background-color: #cccccc;
                    width: 36px;
                    height: 36px;
                    border-radius: 50%;
                    color: #fff;
                    text-align: center;
                    font-size: 30px;
                    margin-left: 10px;
                }
            }
            .el-form-item__content {
                width: 400px;
                .el-select {
                    width: 100%;
                }
            }
            .optionHandleSp {
                display: flex;
                .areaNumber,
                .moreNumber {
                    flex: 1;
                }
                .telNumber {
                    flex: 2;
                }
            }
        }
    }
    footer {
        border-top: 1px solid #fff;
        height: 80px;
      .iconBox {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 20px;
        .upload {
          display: flex;
          align-items: flex-end;
          img {
            width: 120px;
            height: 120px;
            border-radius: 4px;
          }
        }
        .iconView {
          display: flex;
          flex-direction: column;
          margin-left: 30px;
          justify-content: flex-end;
          img {
            width: 70px;
            height: 70px;
            border-radius: 4px;
          }
        }
        .tip {
          display: flex;
          align-items: flex-end;
          margin-left: 30px;
          font-size: 12px;
          span {
            line-height: 20px;
          }
        }
      }
      .optionBtn {
        margin-top: 30px;
        &::v-deep .el-button {
          padding: 12px 40px;
        }
        .reset {
          border: 1px solid #0079fe;
          color: #0079fe;
        }
      }
      &::v-deep .el-form-item__label {
        color: #4b9bb7;
      }
      &::v-deep .el-input__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
      }
      .addPerson {
        display: flex;
        list-style: none;
        padding: 0;
        li {
          background-color: #cccccc;
          width: 36px;
          height: 36px;
          border-radius: 50%;
          color: #fff;
          text-align: center;
          font-size: 30px;
          margin-left: 10px;
        }
      }
      .el-form-item__content {
        width: 400px;
        .el-select {
          width: 100%;
        }
      }
      .optionHandleSp {
        display: flex;
        .areaNumber,
        .moreNumber {
          flex: 1;
        }
        .telNumber {
          flex: 2;
        }
      }
    }
  }
  footer {
    border-top: 1px solid #fff;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
  }
}
</style>
src/views/operate/rectification/surveyList/components/viewInterface/index.vue
@@ -1,246 +1,272 @@
<template>
    <div class="createmyInterface">
        <main>
            <div class="mainContent">
                <el-form ref="user" label-width="140px" autoComplete="on" :model="myInterface"
                    :rules="createmyInterfaceRules" label-position="right">
                    <!-- 应用名称 -->
                    <el-form-item label="应用名称:" prop="applicationName">
                        <el-input v-model="myInterface.applicationName" placeholder="填写应用名称"></el-input>
                    </el-form-item>
                    <!-- 应用图标 -->
                    <el-form-item label="应用图标:" prop="applicationIconUrl">
                        <div class="iconBox">
                            <div class="upload">
                                <img src="@/assets/imgs/user/default-avatar.jpg" alt="">
                            </div>
                            <div class="iconView">
                                <span>示意图</span>
                                <img src="@/assets/imgs/user/default-avatar.jpg" alt="">
                            </div>
                            <div class="tip">
                                <span>只允许上传jpg,jpeg,png,svg格式的图片,建议尺寸为105px*105px</span>
                            </div>
                        </div>
                    </el-form-item>
                    <!-- 应用类型 -->
                    <el-form-item label="应用类型:" prop="applicationType">
                        <div class="optionItem">
                            <el-radio-group v-model="myInterface.applicationType">
                                <el-radio :label="1">网页应用</el-radio>
                            </el-radio-group>
                        </div>
                    </el-form-item>
                    <!--网站url  -->
                    <el-form-item label="网站url:" prop="websiteUrl">
                        <el-input v-model="myInterface.websiteUrl"></el-input>
                    </el-form-item>
                    <!-- 应用描述 -->
                    <el-form-item label="应用描述:" prop="description">
                        <el-input v-model="myInterface.description" placeholder="请填写描述"></el-input>
                    </el-form-item>
                    <!-- 按钮 -->
                    <!-- <el-form-item>
                        <div class="optionBtn">
                            <el-button type="primary" class="btn submit" @click.native.prevent="handleUser">提交
                            </el-button>
                            <el-button class="btn reset">重置</el-button>
                        </div>
                    </el-form-item> -->
                </el-form>
            </div>
        </main>
    </div>
  <div class="createmyInterface">
    <main>
      <div class="mainContent">
        <el-form
          ref="user"
          label-width="140px"
          autoComplete="on"
          :model="myInterface"
          :rules="createUserRules"
          label-position="right"
        >
          <el-form-item class="optionItem" label="任务编号:" prop="num">
            <el-input
              v-model="myInterface.num"
              placeholder="请填写任务编号"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="问题类型:" prop="type">
            <el-input
              v-model="myInterface.type"
              placeholder="请选择问题类型"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="大类:" prop="bigclass">
            <el-input
              v-model="myInterface.bigclass"
              placeholder="请选择大类"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="小类:" prop="subclass">
            <el-input
              v-model="myInterface.subclass"
              placeholder="请选择小类"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="街道:" prop="street">
            <el-input
              v-model="myInterface.street"
              placeholder="请填写街道"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="社区:" prop="community">
            <el-input
              v-model="myInterface.community"
              placeholder="请填写社区"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="任务描述:" prop="task">
            <el-input
              v-model="myInterface.task"
              placeholder="请填写任务描述"
              disabled
            ></el-input>
          </el-form-item>
          <el-form-item class="optionItem" label="上报时间:" prop="reportTime">
            <el-input
              v-model="myInterface.reportTime"
              placeholder="请选择上报时间"
              disabled
            ></el-input>
          </el-form-item>
        </el-form>
      </div>
    </main>
  </div>
</template>
<script>
export default {
    data() {
        const validateApplicationName = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写用户名称"));
            }
        };
        const validateApplicationIconUrl = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写登录密码"));
            } else {
                const rep = /^\w+$/;
                if (!rep.test(value)) {
                    callback(new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串"));
                }
            }
        };
        const validateApplicationType = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写用户姓名"));
            } else {
                const rep = /^[\u4E00-\u9FA5]{2,4}$/;
                if (!rep.test(value)) {
                    callback("请输入正确的用户姓名");
                }
            }
        };
        const validatePhone = (rule, value, callback) => {
            if (!value) {
                callback(new Error("请填写手机号码"));
            } else {
                const rep = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/
                if (!rep.test(value)) {
                    callback("请输入正确的手机号码");
                }
            }
        };
        return {
            myInterface: {
            },
            createmyInterfaceRules: {
                applicationName: [
                    { required: true, trigger: "blur", validator: validateApplicationName},
                ],
                applicationIconUrl: [
                    { required: true, trigger: "blur", validator: validateApplicationIconUrl },
                ],
                applicationType: [
                    { required: true, trigger: "blur", validator: validateApplicationType },
                ],
                websiteUrl: [
                    { required: true, trigger: "blur" },
                ],
                description: [
                    { required: false, trigger: "blur" },
                ],
            },
  data() {
    const validateApplicationName = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写用户名称"));
      }
    };
    const validateApplicationIconUrl = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写登录密码"));
      } else {
        const rep = /^\w+$/;
        if (!rep.test(value)) {
          callback(
            new Error("密码只能是以数字、26个英文字母或者下划线组成的字符串")
          );
        }
    },
    created() {
        const that = this;
        const {userInfo} = this;
        this.myInterface = JSON.parse(JSON.stringify(userInfo));
    },
    methods: {
    },
    props: ['updateFlag','userInfo']
}
      }
    };
    const validateApplicationType = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写用户姓名"));
      } else {
        const rep = /^[\u4E00-\u9FA5]{2,4}$/;
        if (!rep.test(value)) {
          callback("请输入正确的用户姓名");
        }
      }
    };
    const validatePhone = (rule, value, callback) => {
      if (!value) {
        callback(new Error("请填写手机号码"));
      } else {
        const rep = /(^1[3|4|5|7|8|9]\d{9}$)|(^09\d{8}$)/;
        if (!rep.test(value)) {
          callback("请输入正确的手机号码");
        }
      }
    };
    return {
      myInterface: {},
      createmyInterfaceRules: {
        applicationName: [
          {
            required: true,
            trigger: "blur",
            validator: validateApplicationName,
          },
        ],
        applicationIconUrl: [
          {
            required: true,
            trigger: "blur",
            validator: validateApplicationIconUrl,
          },
        ],
        applicationType: [
          {
            required: true,
            trigger: "blur",
            validator: validateApplicationType,
          },
        ],
        websiteUrl: [{ required: true, trigger: "blur" }],
        description: [{ required: false, trigger: "blur" }],
      },
    };
  },
  created() {
    const that = this;
    const { userInfo } = this;
    this.myInterface = JSON.parse(JSON.stringify(userInfo));
  },
  methods: {},
  props: ["updateFlag", "userInfo"],
};
</script>
<style lang="scss" scoped>
.createmyInterface {
    border-radius: 1px;
  border-radius: 1px;
  background-color: #09152f;
  main {
    text-align: left;
    padding: 0 55px;
    background-color: #09152f;
    main {
        text-align: left;
        padding: 0 55px;
        background-color: #09152f;
    .mainContent {
      display: flex;
      justify-content: center;
      padding-top: 50px;
        .mainContent {
            display: flex;
            justify-content: center;
            padding-top: 50px;
            .iconBox {
                display: flex;
                .upload {
                    display: flex;
                    align-items: flex-end;
                    img {
                        width: 120px;
                        height: 120px;
                        border-radius: 4px;
                    }
                }
                .iconView {
                    display: flex;
                    flex-direction: column;
                    margin-left: 30px;
                    justify-content: flex-end;
                    img {
                        width: 70px;
                        height: 70px;
                        border-radius: 4px;
                    }
                }
                .tip {
                    display: flex;
                    align-items: flex-end;
                    margin-left: 30px;
                    font-size: 12px;
                    span {
                        line-height: 20px;
                    }
                }
            }
            .optionBtn{
                &::v-deep .el-button{
                    padding: 12px 40px;
                }
                .reset{
                    border: 1px solid #0079fe;
                    color: #0079fe;
                }
            }
            &::v-deep .el-form-item__label {
                color: #4b9bb7;
            }
            &::v-deep .el-input__inner {
                background-color: #09152f;
                border: 1px solid #17324c;
            }
            .addPerson {
                display: flex;
                list-style: none;
                padding: 0;
                li {
                    background-color: #cccccc;
                    width: 36px;
                    height: 36px;
                    border-radius: 50%;
                    color: #fff;
                    text-align: center;
                    font-size: 30px;
                    margin-left: 10px;
                }
            }
            .el-form-item__content {
                width: 400px;
                .el-select {
                    width: 100%;
                }
            }
            .optionHandleSp {
                display: flex;
                .areaNumber,
                .moreNumber {
                    flex: 1;
                }
                .telNumber {
                    flex: 2;
                }
            }
        }
    }
    footer {
        border-top: 1px solid #fff;
        height: 80px;
      .iconBox {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        padding-right: 20px;
        .upload {
          display: flex;
          align-items: flex-end;
          img {
            width: 120px;
            height: 120px;
            border-radius: 4px;
          }
        }
        .iconView {
          display: flex;
          flex-direction: column;
          margin-left: 30px;
          justify-content: flex-end;
          img {
            width: 70px;
            height: 70px;
            border-radius: 4px;
          }
        }
        .tip {
          display: flex;
          align-items: flex-end;
          margin-left: 30px;
          font-size: 12px;
          span {
            line-height: 20px;
          }
        }
      }
      .optionBtn {
        &::v-deep .el-button {
          padding: 12px 40px;
        }
        .reset {
          border: 1px solid #0079fe;
          color: #0079fe;
        }
      }
      &::v-deep .el-form-item__label {
        color: #4b9bb7;
      }
      &::v-deep .el-input__inner {
        background-color: #09152f;
        border: 1px solid #17324c;
      }
      .addPerson {
        display: flex;
        list-style: none;
        padding: 0;
        li {
          background-color: #cccccc;
          width: 36px;
          height: 36px;
          border-radius: 50%;
          color: #fff;
          text-align: center;
          font-size: 30px;
          margin-left: 10px;
        }
      }
      .el-form-item__content {
        width: 400px;
        .el-select {
          width: 100%;
        }
      }
      .optionHandleSp {
        display: flex;
        .areaNumber,
        .moreNumber {
          flex: 1;
        }
        .telNumber {
          flex: 2;
        }
      }
    }
  }
  footer {
    border-top: 1px solid #fff;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-right: 20px;
  }
}
</style>
src/views/operate/rectification/surveyList/index.vue
@@ -1,290 +1,372 @@
<template>
    <div class="otherInterface">
        <header>
            <div class="headerTitle">运营管理 >> 专项整治 > 普查列表</div>
        </header>
        <main>
            <div class="mainHeader">
                <div class="add">
                    <el-button type="primary" icon="el-icon-plus">新增任务</el-button>
                </div>
                <div class="date-search">
                    <span>按天查询:</span>
                    <div class="mydate">
                        <el-input placeholder="请输入开始时间"></el-input>
                        <div class="line">
                            ——— ———
                        </div>
                        <el-input placeholder="请输入结束时间"></el-input>
                    </div>
                </div>
                <div class="search">
                    <el-input placeholder="请输入标题或者任务编号"></el-input>
                </div>
                <div class="btn">
                    <el-button icon="el-icon-plus" type="primary">搜索</el-button>
                    <el-button icon="el-icon-delete">重置</el-button>
                </div>
            </div>
            <div class="mainContent">
                <!-- @selection-change="handleSelectionChange" -->
                <!-- 数据渲染 -->
                <el-table ref="multipleTable" :data="tableData" tooltip-effect="dark" style="width: 100%"
                    :header-cell-style="{background:'#06122c','font-size':'12px',color:'#4b9bb7','font-weight':'650','line-height':'45px'}"
                    :row-class-name="tableRowClassName">
                    <el-table-column type="selection" width="55">
                    </el-table-column>
                    <el-table-column label="任务编号" prop="applicationName" min-width="10">
                    </el-table-column>
                    <el-table-column prop="applicationType" label="问题类型" min-width="10">
                    </el-table-column>
                    <el-table-column prop="websiteUrl" label="大类" min-width="10">
                    </el-table-column>
                    <el-table-column prop="applicationType" label="小类" min-width="10">
                    </el-table-column>
                    <el-table-column prop="applicationType" label="街道" min-width="10">
                    </el-table-column>
                    <el-table-column prop="applicationType" label="社区" min-width="10">
                    </el-table-column>
                    <el-table-column prop="applicationType" label="任务描述" min-width="10">
                    </el-table-column>
                    <el-table-column prop="applicationType" label="上报时间" min-width="10">
                    </el-table-column>
                    <el-table-column label="操作" min-width="10">
                        <template slot-scope="scope">
                            <span @click="handleDelete(scope.row)">查看</span>
                        </template>
                    </el-table-column>
                </el-table>
                <!-- 分页 -->
                <!-- <div class="pagination">
  <div class="otherInterface">
    <header>
      <div class="headerTitle">运营管理 >> 专项整治 > 普查列表</div>
    </header>
    <main>
      <div class="mainHeader">
        <div class="add">
          <el-button type="primary" icon="el-icon-plus" @click="handleAdd()"
            >新增任务</el-button
          >
        </div>
        <div class="date-search">
          <span>按天查询:</span>
          <div class="block">
            <el-date-picker
              v-model="beginTime"
              type="date"
              placeholder="请选择开始日期"
            >
            </el-date-picker>
          </div>
          <span>——— ———</span>
          <div class="block">
            <el-date-picker
              v-model="endTime"
              type="date"
              placeholder="请选择结束日期"
            >
            </el-date-picker>
          </div>
          <!-- <div class="mydate">
            <el-input placeholder="请输入开始时间"></el-input>
            <div class="line">——— ———</div>
            <el-input placeholder="请输入结束时间"></el-input>
          </div> -->
        </div>
        <div class="search">
          <el-input placeholder="请输入标题或者任务编号"></el-input>
        </div>
        <div class="btn">
          <el-button icon="el-icon-plus" type="primary">搜索</el-button>
          <el-button icon="el-icon-delete">重置</el-button>
        </div>
      </div>
      <div class="mainContent">
        <!-- @selection-change="handleSelectionChange" -->
        <!-- 数据渲染 -->
        <el-table
          ref="multipleTable"
          :data="tableData"
          tooltip-effect="dark"
          style="width: 100%"
          :header-cell-style="{
            background: '#06122c',
            'font-size': '12px',
            color: '#4b9bb7',
            'font-weight': '650',
            'line-height': '45px',
          }"
          :row-class-name="tableRowClassName"
        >
          <!-- <el-table-column type="selection" width="55">
                    </el-table-column> -->
          <el-table-column label="任务编号" prop="num" min-width="10">
          </el-table-column>
          <el-table-column prop="type" label="问题类型" min-width="10">
          </el-table-column>
          <el-table-column prop="bigclass" label="大类" min-width="10">
          </el-table-column>
          <el-table-column prop="subclass" label="小类" min-width="10">
          </el-table-column>
          <el-table-column prop="street" label="街道" min-width="10">
          </el-table-column>
          <el-table-column prop="community" label="社区" min-width="10">
          </el-table-column>
          <el-table-column prop="task" label="任务描述" min-width="10">
          </el-table-column>
          <el-table-column prop="reportTime" label="上报时间" min-width="10">
          </el-table-column>
          <el-table-column label="操作" min-width="10">
            <template slot-scope="scope">
              <span @click="handleView(scope.row)" style="cursor: pointer"
                >查看</span
              >
            </template>
          </el-table-column>
        </el-table>
        <!-- 分页 -->
        <!-- <div class="pagination">
                    <el-pagination background :current-page="currentPage" layout="prev, pager, next" :total="totalNum"
                        :page-size="pageSize" @current-change="changeCurrentPage" @prev-click="handlePrev"
                        @next-click="handleNext">
                    </el-pagination>
                </div> -->
            </div>
        </main>
        <footer>
            <!-- 创建弹窗 -->
            <el-dialog :visible.sync="dialogCreate" title="新增第三方接口" width="45%" v-if="dialogCreate"
                :before-close="handleClose">
                <createInterface />
            </el-dialog>
            <!-- 查看弹窗 -->
            <el-dialog :visible.sync="dialogUpdate" :title="updateFlag ?'修改第三方接口':'查看第三方接口'" width="45%"
                v-if="dialogUpdate" :before-close="handleClose">
                <viewInterface :updateFlag="updateFlag" :userInfo=userInfo />
            </el-dialog>
        </footer>
    </div>
      </div>
    </main>
    <footer>
      <!-- 创建弹窗 -->
      <el-dialog
        :visible.sync="dialogCreate"
        title="新增"
        width="45%"
        v-if="dialogCreate"
        :before-close="handleClose"
      >
        <createInterface @closeDialog="closeDialog" />
      </el-dialog>
      <!-- 查看弹窗 -->
      <el-dialog
        :visible.sync="dialogUpdate"
        :title="updateFlag ? '编辑' : '详情'"
        width="45%"
        v-if="dialogUpdate"
        :before-close="handleClose"
      >
        <viewInterface :updateFlag="updateFlag" :userInfo="userInfo" />
      </el-dialog>
    </footer>
  </div>
</template>
<script>
import createInterface from './components/createInterface';
import viewInterface from './components/viewInterface'
import createInterface from "./components/createInterface";
import viewInterface from "./components/viewInterface";
export default {
    components: {
        createInterface, viewInterface
    },
    data() {
        return {
            tableData: [],
            search: "",
            dialogCreate: false,
            dialogUpdate: false,
            updateFlag: false,
            userInfo: '',
            date:'',
            // totalNum: 200,
            // pageSize: 10,
            // currentPage: 1,
  components: {
    createInterface,
    viewInterface,
  },
  data() {
    return {
      tableData: [
        {
          num: 1234,
          type: "城管类事件",
          bigclass: "其他",
          subclass: "其他",
          street: "街道",
          community: "社区",
          task: "任务描述",
          reportTime: "2022-10-31 13:20",
        },
        {
          num: 1234,
          type: "城管类事件",
          bigclass: "其他",
          subclass: "其他",
          street: "街道",
          community: "社区",
          task: "任务描述",
          reportTime: "2022-10-31 13:20",
        },
        {
          num: 1234,
          type: "城管类事件",
          bigclass: "其他",
          subclass: "其他",
          street: "街道",
          community: "社区",
          task: "任务描述",
          reportTime: "2022-10-31 13:20",
        },
      ],
      search: "",
      dialogCreate: false,
      dialogUpdate: false,
      updateFlag: false,
      userInfo: "",
      date: "",
      beginTime: "",
      endTime: "",
      // totalNum: 200,
      // pageSize: 10,
      // currentPage: 1,
    };
  },
  created() {
    this.getUserList();
  },
  methods: {
    // 获取接口列表
    getUserList() {
      const that = this;
      // const { currentPage, pageSize, search } = this;
      this.dialogCreate = false;
      this.$axios.get("sccg/system/portal/thirdApp/search").then((res) => {
        const { code, data } = res;
        if (code == 200) {
          this.tableData = data;
        }
      });
    },
    created() {
        this.getUserList();
    // 设置表格斑马纹
    tableRowClassName({ row, rowIndex }) {
      if ((rowIndex + 1) % 2 == 0) {
        return "warning-row";
      } else {
        return "success-row";
      }
      return "";
    },
    methods: {
        // 获取接口列表
        getUserList() {
            const that = this;
            // const { currentPage, pageSize, search } = this;
            this.dialogCreate = false;
            this.$axios.get("sccg/system/portal/thirdApp/search").then(res => {
                const { code, data } = res;
                if (code == 200) {
                    this.tableData = data;
                }
            })
        },
        // 设置表格斑马纹
        tableRowClassName({ row, rowIndex }) {
            if ((rowIndex + 1) % 2 == 0) {
                return 'warning-row';
            } else {
                return 'success-row';
            }
            return '';
        },
        // 打开新增界面
        handleAdd() {
            this.dialogCreate = true;
        },
        // 创建弹窗关闭
        handleClose(done) {
            const that = this;
            this.$confirm('确认关闭?')
                .then(_ => {
                    that.dialogCreate = false;
                    done();
                })
                .catch(_ => { });
        },
        // 创建查看弹窗
        handleView(rowData) {
            this.userInfo = rowData;
            this.dialogUpdate = true;
        },
        // 删除第三方接口
        handleDelete({ id }) {
            console.log(id);
            this.$axios.delete('sccg/system/portal/thirdApp/delete', {
                params: {
                    id
                }
            }).then(res => {
                console.log(res);
            })
        }
        // // 当前页改变触发事件
        // changeCurrentPage(page) {
        //     this.currentPage = page;
        //     this.getUserList();
        // },
        // // 上一页点击事件
        // handlePrev(page) {
        //     this.currentPage = page;
        //     this.getUserList();
        // },
        // // 下一页点击事件
        // handleNext(page) {
        //     this.currentPage = page;
        //     this.getUserList();
        // },
    }
}
    // 打开新增界面
    handleAdd() {
      this.dialogCreate = true;
    },
    // 创建弹窗关闭
    handleClose(done) {
      const that = this;
      this.$confirm("确认关闭?")
        .then((_) => {
          that.dialogCreate = false;
          done();
        })
        .catch((_) => {});
    },
    closeDialog({ flag, index }) {
      console.log(flag);
      index === 1 ? "" : "";
      this.dialogCreate = flag;
    },
    // 创建查看弹窗
    handleView(rowData) {
      console.log(rowData);
      this.userInfo = rowData;
      this.dialogUpdate = true;
    },
    // 删除第三方接口
    handleDelete({ id }) {
      console.log(id);
      this.$axios
        .delete("sccg/system/portal/thirdApp/delete", {
          params: {
            id,
          },
        })
        .then((res) => {
          console.log(res);
        });
    },
    // // 当前页改变触发事件
    // changeCurrentPage(page) {
    //     this.currentPage = page;
    //     this.getUserList();
    // },
    // // 上一页点击事件
    // handlePrev(page) {
    //     this.currentPage = page;
    //     this.getUserList();
    // },
    // // 下一页点击事件
    // handleNext(page) {
    //     this.currentPage = page;
    //     this.getUserList();
    // },
  },
};
</script>
<!-- sccg/system/portal/thirdApp/search -->
<style lang="scss" scoped>
.otherInterface {
    header {
  header {
    display: flex;
    line-height: 60px;
    justify-content: space-between;
    padding: 0 20px;
    color: #4b9bb7;
    &::v-deep .el-button {
      background-color: #eb5d01;
      border: none;
      color: #fff;
      border-radius: 20px;
    }
  }
  main {
    padding: 10px 20px;
    .mainHeader {
      padding-left: 20px;
      display: flex;
      line-height: 60px;
      color: #4b9bb7;
      background-color: #09152f;
      display: flex;
      .add,
      .search,
      .btn {
        flex: 1;
      }
      .date-search {
        flex: 3;
        display: flex;
        line-height: 60px;
        justify-content: space-between;
        padding: 0 20px;
        .mydate {
          display: flex;
          .line {
            margin: 0 10px 0 20px;
          }
        }
      }
      .el-input {
        width: 180px;
        height: 35px;
        margin-left: 10px;
        &::v-deep .el-input__inner {
          background-color: #09152f;
          border: 1px solid #17324c;
          font-size: 12px;
        }
      }
    }
    .mainContent {
      margin-top: 20px;
      .el-table {
        color: #4b9bb7;
        &::v-deep .el-button {
            background-color: #eb5d01;
            border: none;
            color: #fff;
            border-radius: 20px;
        &::v-deep .el-table__empty-block {
          background-color: #06122c;
        }
        &::v-deep .el-table__empty-text {
          color: #4b9bb7;
        }
        &::v-deep .warning-row {
          background-color: #06122c;
        }
        &::v-deep .success-row {
          background-color: #071f39;
        }
      }
      .line {
        padding: 0 5px;
        // margin-top: -10px;
      }
    }
  }
  footer {
    &::v-deep .el-dialog__header,
    &::v-deep .el-dialog__body {
      background-color: #06122c;
    }
    main {
        padding: 10px 20px;
        .mainHeader {
            padding-left: 20px;
            display: flex;
            line-height: 60px;
            color: #4b9bb7;
            background-color: #09152f;
            display: flex;
            .add,.search,.btn{
                flex:1;
            }
            .date-search{
                flex: 3;
                display: flex;
                .mydate{
                    display: flex;
                    .line{
                        margin:0 10px 0 20px;
                    }
                }
            }
            .el-input {
                width: 180px;
                height: 35px;
                margin-left: 10px;
                &::v-deep .el-input__inner {
                    background-color: #09152f;
                    border: 1px solid #17324c;
                    font-size: 12px;
                }
            }
        }
        .mainContent {
            margin-top: 20px;
            .el-table {
                color: #4b9bb7;
                &::v-deep .el-table__empty-block {
                    background-color: #06122c;
                }
                &::v-deep .el-table__empty-text {
                    color: #4b9bb7;
                }
                &::v-deep .warning-row {
                    background-color: #06122c;
                }
                &::v-deep .success-row {
                    background-color: #071f39;
                }
            }
            .line {
                padding: 0 5px;
                // margin-top: -10px;
            }
        }
    &::v-deep .el-dialog__header {
      display: flex;
      align-items: center;
      background-color: #fff;
      padding: 20px;
      line-height: 60px;
    }
    footer {
        &::v-deep .el-dialog__header,
        &::v-deep .el-dialog__body {
            background-color: #06122c;
        }
        &::v-deep .el-dialog__header {
            display: flex;
            align-items: center;
            background-color: #fff;
            padding: 20px;
            line-height: 60px;
        }
        &::v-deep .el-dialog__title {
            color: #4b9bb7;
        }
        &::v-deep .el-dialog__close {
            width: 20px;
            height: 20px;
            // color: #fff;
        }
        &::v-deep .el-dialog__body {
            padding: 0;
        }
    &::v-deep .el-dialog__title {
      color: #4b9bb7;
    }
    &::v-deep .el-dialog__close {
      width: 20px;
      height: 20px;
      // color: #fff;
    }
    &::v-deep .el-dialog__body {
      padding: 0;
    }
  }
}
</style>