zhongrj
2024-03-27 cc1c0a396698648256c350f6f0fe2cb2f0b02c7e
src/views/talk/talk.vue
@@ -1,6 +1,12 @@
<template>
  <basic-container>
  <basic-container
    :class="[
      $store.state.control.screenSize == 1366 ? 'smallSize' : 'normalSize',
      $store.state.control.windowWidth >= 1024 ? 'tooRowSearch1' : '',
    ]"
  >
    <avue-crud
      class="tablesss"
      :option="option"
      :table-loading="loading"
      :data="data"
@@ -26,7 +32,7 @@
      @refresh-change="refreshChange"
      @on-load="onLoad"
    >
      <template slot-scope="{ disabled, size }" slot="realNameSearch">
      <!-- <template slot-scope="{ disabled, size }" slot="realNameSearch">
        <el-input
          placeholder="姓名"
          :disabled="disabled"
@@ -35,7 +41,7 @@
          v-on:input="inputs(findName)"
          v-model="findName"
        ></el-input>
      </template>
      </template> -->
      <template slot="menuLeft">
        <el-button
          type="danger"
@@ -44,7 +50,7 @@
          plain
          v-if="permission.talk_delete"
          @click="handleDelete"
        >删 除
          >删 除
        </el-button>
      </template>
    </avue-crud>
@@ -52,8 +58,8 @@
</template>
<script>
import {getList, getDetail, add, update, remove} from "@/api/talk/talk";
import {mapGetters} from "vuex";
import { getList, getDetail, add, update, remove } from "@/api/talk/talk";
import { mapGetters } from "vuex";
export default {
  data() {
@@ -67,6 +73,7 @@
        pageSize: 10,
        currentPage: 1,
        total: 0,
        ...this.$store.state.control.changePageSize,
      },
      selectionList: [],
      option: {
@@ -80,7 +87,10 @@
        index: true,
        viewBtn: true,
        selection: true,
        menu:false,
        dialogClickModal: false,
        ...this.$store.state.control.clearOtherBut,
        menu: false,
        column: [
          {
            label: "标题",
@@ -99,20 +109,21 @@
            label: "谈话对象",
            prop: "realName",
            search: true,
            width: 90,
            // type: "tree",
            searchslot: true,
            // searchslot: true,
            // dicUrl: `/api/blade-user/selectInr?deptid=` + id,
            // props: {
            //   label: "realName",
            //   value: "id",
            // },
            // rules: [
            //   {
            //     required: true,
            //     message: "请输入谈话对象",
            //     trigger: "blur",
            //   },
            // ],
            rules: [
              {
                required: true,
                message: "请输入谈话对象",
                trigger: "blur",
              },
            ],
          },
          {
            label: "谈话内容",
@@ -162,17 +173,17 @@
            ],
          },
          {
            label: '图片',
            prop: 'imgurl',
            label: "图片",
            prop: "imgurl",
            // dataType: 'string',
            type: 'upload',
            type: "upload",
            propsHttp: {
              res: 'data'
              res: "data",
            },
            span: 24,
            listType: 'picture-card',
            tip: '只能上传jpg/png文件,且不超过500kb',
            action: '/api/blade-resource/oss/endpoint/put-files-talk?file='
            listType: "picture-card",
            tip: "只能上传jpg/png文件,且不超过500kb",
            action: "/api/blade-resource/oss/endpoint/put-files-talk?file=",
          },
        ],
      },
@@ -197,19 +208,22 @@
      return ids.join(",");
    },
  },
  mounted() {
    this.$store.commit("setWindowSizeHeightAdd");
  },
  methods: {
    // searchChange(params, done) {
    //   console.log(params);
    //   done();
    // this.$message.success(JSON.stringify(params));
    // },
    searchChange(params, done) {
      // console.log(params);
      this.onLoad(this.page, params);
      done();
    },
    rowSave(row, done, loading) {
      var d = [];
      for (var k in row.imgurl) {
        d.push(row.imgurl[k].value);
      }
      row.imgurl = d.join(',');
      row.imgurl = d.join(",");
      row.deptid = this.$store.getters.userInfo.dept_id;
      add(row).then(
        () => {
@@ -293,16 +307,6 @@
      this.query = {};
      this.onLoad(this.page);
    },
    searchChange(params, done) {
      console.log(params);
      // this.query = params;
      // this.page.currentPage = 1;
      // this.onLoad(this.page, params);
      done();
    },
    inputs(val) {
      console.log(val);
    },
    selectionChange(list) {
      this.selectionList = list;
    },
@@ -330,8 +334,9 @@
        const data = res.data.data;
        this.page.total = data.total;
        this.data = data.records;
        console.log(this.data);
        // console.log(this.data);
        this.loading = false;
        this.$store.commit("setWindowSizeHeightAdd");
        this.selectionClear();
      });
    },