From 79d9fc857559982b00b68b2d709807bdc4cd286f Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Mon, 11 Apr 2022 10:58:17 +0800
Subject: [PATCH] minio 地址修改
---
src/views/talk/talk.vue | 509 +++++++++++++++++++++++++++++++++-----------------------
1 files changed, 300 insertions(+), 209 deletions(-)
diff --git a/src/views/talk/talk.vue b/src/views/talk/talk.vue
index 5a14376..3624ea2 100644
--- a/src/views/talk/talk.vue
+++ b/src/views/talk/talk.vue
@@ -1,30 +1,56 @@
<template>
- <basic-container>
- <avue-crud :option="option"
- :table-loading="loading"
- :data="data"
- :page.sync="page"
- :permission="permissionList"
- :before-open="beforeOpen"
- v-model="form"
- ref="crud"
- @row-update="rowUpdate"
- @row-save="rowSave"
- @row-del="rowDel"
- @search-change="searchChange"
- @search-reset="searchReset"
- @selection-change="selectionChange"
- @current-change="currentChange"
- @size-change="sizeChange"
- @refresh-change="refreshChange"
- @on-load="onLoad">
+ <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"
+ :page.sync="page"
+ :permission="permissionList"
+ :before-open="beforeOpen"
+ :upload-preview="uploadPreview"
+ :upload-error="uploadError"
+ :upload-exceed="uploadExceed"
+ :upload-delete="uploadDelete"
+ :upload-before="uploadBefore"
+ :upload-after="uploadAfter"
+ v-model="form"
+ ref="crud"
+ @row-update="rowUpdate"
+ @row-save="rowSave"
+ @row-del="rowDel"
+ @search-change="searchChange"
+ @search-reset="searchReset"
+ @selection-change="selectionChange"
+ @current-change="currentChange"
+ @size-change="sizeChange"
+ @refresh-change="refreshChange"
+ @on-load="onLoad"
+ >
+ <!-- <template slot-scope="{ disabled, size }" slot="realNameSearch">
+ <el-input
+ placeholder="姓名"
+ :disabled="disabled"
+ :size="size"
+ style="width: 200px"
+ v-on:input="inputs(findName)"
+ v-model="findName"
+ ></el-input>
+ </template> -->
<template slot="menuLeft">
- <el-button type="danger"
- size="small"
- icon="el-icon-delete"
- plain
- v-if="permission.talk_delete"
- @click="handleDelete">删 除
+ <el-button
+ type="danger"
+ size="small"
+ icon="el-icon-delete"
+ plain
+ v-if="permission.talk_delete"
+ @click="handleDelete"
+ >删 除
</el-button>
</template>
</avue-crud>
@@ -32,235 +58,300 @@
</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() {
- return {
- form: {},
- query: {},
- loading: true,
- page: {
- pageSize: 10,
- currentPage: 1,
- total: 0
- },
- selectionList: [],
- option: {
- height:'auto',
- calcHeight: 30,
- tip: false,
- searchShow: true,
- searchMenuSpan: 6,
- border: true,
- index: true,
- viewBtn: true,
- selection: true,
- dialogClickModal: false,
- column: [
- {
- label: "标题",
- prop: "title",
- search: true,
- rules: [{
+export default {
+ data() {
+ var id = this.$store.getters.userInfo.dept_id;
+ return {
+ findName: "",
+ form: {},
+ query: {},
+ loading: true,
+ page: {
+ pageSize: 10,
+ currentPage: 1,
+ total: 0,
+ ...this.$store.state.control.changePageSize
+ },
+ selectionList: [],
+ option: {
+ height: "auto",
+ calcHeight: 30,
+ tip: false,
+ searchShow: true,
+ searchMenuSpan: 6,
+ border: true,
+ searchShowBtn: false,
+ index: true,
+ viewBtn: true,
+ selection: true,
+ // menu: false,
+ dialogClickModal: false,
+ ...this.$store.state.control.clearOtherBut,
+ column: [
+ {
+ label: "标题",
+ prop: "title",
+ search: true,
+ searchLabelWidth: 45,
+ rules: [
+ {
required: true,
message: "请输入标题",
trigger: "blur"
- }]
- },
- {
- label: "谈话对象",
- search: true,
- prop: "realName",
- type: "tree",
- props: {
- label: "realName",
- value: "id",
- },
- dicUrl: `/api/blade-user/selectInr?deptid=`+this.$store.getters.userInfo.dept_id,
- rules: [{
+ }
+ ]
+ },
+ {
+ label: "谈话对象",
+ prop: "realName",
+ search: true,
+ // type: "tree",
+ // searchslot: true,
+ // dicUrl: `/api/blade-user/selectInr?deptid=` + id,
+ // props: {
+ // label: "realName",
+ // value: "id",
+ // },
+ rules: [
+ {
required: true,
message: "请输入谈话对象",
trigger: "blur"
- }]
- },
- {
- label: "谈话内容",
- prop: "talkcontent",
- rules: [{
+ }
+ ]
+ },
+ {
+ label: "谈话内容",
+ prop: "talkcontent",
+ rules: [
+ {
required: true,
message: "请输入谈话内容",
trigger: "blur"
- }]
- },
- {
- label: "谈话时间",
- prop: "talktime",
- type: "date",
- format: "yyyy-MM-dd hh:mm:ss",
- valueFormat: "yyyy-MM-dd hh:mm:ss",
- rules: [{
+ }
+ ]
+ },
+ {
+ label: "谈话时间",
+ prop: "talktime",
+ type: "date",
+ format: "yyyy-MM-dd hh:mm:ss",
+ valueFormat: "yyyy-MM-dd hh:mm:ss",
+ rules: [
+ {
required: true,
message: "请输入谈话时间",
trigger: "blur"
- }]
- },
- {
- label: "结论",
- prop: "conclusion",
- rules: [{
+ }
+ ]
+ },
+ {
+ label: "结论",
+ prop: "conclusion",
+ rules: [
+ {
required: true,
message: "请输入结论",
trigger: "blur"
- }]
- },
- {
- label: "评价",
- prop: "evaluate",
- rules: [{
+ }
+ ]
+ },
+ {
+ label: "评价",
+ prop: "evaluate",
+ rules: [
+ {
required: true,
message: "请输入评价",
trigger: "blur"
- }]
+ }
+ ]
+ },
+ {
+ label: "图片",
+ prop: "imgurl",
+ // dataType: 'string',
+ type: "upload",
+ propsHttp: {
+ res: "data"
},
- ]
- },
- data: []
+ span: 24,
+ listType: "picture-card",
+ tip: "只能上传jpg/png文件,且不超过500kb",
+ action: "/api/blade-resource/oss/endpoint/put-files-talk?file="
+ }
+ ]
+ },
+ data: []
+ };
+ },
+ computed: {
+ ...mapGetters(["permission", "userInfo"]),
+ permissionList() {
+ return {
+ addBtn: this.vaildData(this.permission.talk_add, false),
+ viewBtn: this.vaildData(this.permission.talk_view, false),
+ delBtn: this.vaildData(this.permission.talk_delete, false),
+ editBtn: this.vaildData(this.permission.talk_edit, false)
};
},
- computed: {
- ...mapGetters(["permission", "userInfo"]),
- permissionList() {
- return {
- addBtn: this.vaildData(this.permission.talk_add, false),
- viewBtn: this.vaildData(this.permission.talk_view, false),
- delBtn: this.vaildData(this.permission.talk_delete, false),
- editBtn: this.vaildData(this.permission.talk_edit, false)
- };
- },
- ids() {
- let ids = [];
- this.selectionList.forEach(ele => {
- ids.push(ele.id);
- });
- return ids.join(",");
- }
+ ids() {
+ let ids = [];
+ this.selectionList.forEach(ele => {
+ ids.push(ele.id);
+ });
+ return ids.join(",");
+ }
+ },
+ mounted() {
+ this.$store.commit("setWindowSizeHeightAdd");
+ },
+ methods: {
+ searchChange(params, done) {
+ // console.log(params);
+ this.onLoad(this.page, params);
+ done();
},
- methods: {
- rowSave(row, done, loading) {
- add(row).then(() => {
- row.deptid=this.$store.getters.userInfo.dept_id
+
+ rowSave(row, done, loading) {
+ var d = [];
+ for (var k in row.imgurl) {
+ d.push(row.imgurl[k].value);
+ }
+ row.imgurl = d.join(",");
+ row.deptid = this.$store.getters.userInfo.dept_id;
+ add(row).then(
+ () => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
- }, error => {
+ },
+ error => {
loading();
window.console.log(error);
- });
- },
- rowUpdate(row, index, done, loading) {
- update(row).then(() => {
+ }
+ );
+ },
+ rowUpdate(row, index, done, loading) {
+ update(row).then(
+ () => {
this.onLoad(this.page);
this.$message({
type: "success",
message: "操作成功!"
});
done();
- }, error => {
+ },
+ error => {
loading();
console.log(error);
+ }
+ );
+ },
+ rowDel(row) {
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(row.id);
+ })
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
+ });
});
- },
- rowDel(row) {
- this.$confirm("确定将选择数据删除?", {
- confirmButtonText: "确定",
- cancelButtonText: "取消",
- type: "warning"
+ },
+ handleDelete() {
+ if (this.selectionList.length === 0) {
+ this.$message.warning("请选择至少一条数据");
+ return;
+ }
+ this.$confirm("确定将选择数据删除?", {
+ confirmButtonText: "确定",
+ cancelButtonText: "取消",
+ type: "warning"
+ })
+ .then(() => {
+ return remove(this.ids);
})
- .then(() => {
- return remove(row.id);
- })
- .then(() => {
- this.onLoad(this.page);
- this.$message({
- type: "success",
- message: "操作成功!"
- });
+ .then(() => {
+ this.onLoad(this.page);
+ this.$message({
+ type: "success",
+ message: "操作成功!"
});
- },
- 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)) {
- getDetail(this.form.id).then(res => {
- this.form = res.data.data;
- });
- }
- done();
- },
- 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();
- },
- currentChange(currentPage){
- this.page.currentPage = currentPage;
- },
- sizeChange(pageSize){
- this.page.pageSize = pageSize;
- },
- refreshChange() {
- this.onLoad(this.page, this.query);
- },
- onLoad(page, params = {}) {
- this.loading = true;
- getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
- const data = res.data.data;
- this.page.total = data.total;
- this.data = data.records;
- this.loading = false;
- this.selectionClear();
+ this.$refs.crud.toggleSelection();
+ });
+ },
+ beforeOpen(done, type) {
+ if (["edit", "view"].includes(type)) {
+ getDetail(this.form.id).then(res => {
+ this.form = res.data.data;
});
}
+ done();
+ },
+ searchReset() {
+ this.query = {};
+ this.onLoad(this.page);
+ },
+ selectionChange(list) {
+ this.selectionList = list;
+ },
+ selectionClear() {
+ this.selectionList = [];
+ this.$refs.crud.toggleSelection();
+ },
+ currentChange(currentPage) {
+ this.page.currentPage = currentPage;
+ },
+ sizeChange(pageSize) {
+ this.page.pageSize = pageSize;
+ },
+ refreshChange() {
+ this.onLoad(this.page, this.query);
+ },
+ onLoad(page, params = {}) {
+ if(this.userInfo.role_name == "公安管理员" || this.userInfo.role_name == "民警" || this.userInfo.role_name == "administrator"){
+ params["jurisdiction"] = this.userInfo.jurisdiction;
+ }else{
+ params["deptid"] = this.userInfo.dept_id;
+ }
+ this.loading = true;
+ getList(
+ page.currentPage,
+ page.pageSize,
+ Object.assign(params, this.query)
+ ).then(res => {
+ const data = res.data.data;
+ this.page.total = data.total;
+ this.data = data.records;
+ console.log(this.data);
+ this.loading = false;
+ this.$store.commit("setWindowSizeHeightAdd");
+ this.selectionClear();
+ });
}
- };
+ }
+};
</script>
-<style>
+<style lang="scss" scoped>
+.avue-form__menu--center .el-button {
+ float: left !important;
+}
+
+.avue-form__menu--center .el-button:nth-child(1) {
+ margin-left: 30px !important;
+}
</style>
--
Gitblit v1.9.3