| | |
| | | "js-beautify": "1.13.0", |
| | | "js-cookie": "3.0.1", |
| | | "jsencrypt": "3.0.0-rc.1", |
| | | "lemon-imui": "^1.7.7", |
| | | "nprogress": "0.2.0", |
| | | "quill": "1.3.7", |
| | | "quill-image-drop-module": "^1.0.3", |
| | | "quill-image-resize": "^3.0.9", |
| | | "quill-image-resize-module": "^3.0.0", |
| | | "sass": "^1.63.6", |
| | | "screenfull": "5.0.2", |
| | | "sortablejs": "1.10.2", |
| | | "style-loader": "^3.3.3", |
| | | "stylus-loader": "^7.1.3", |
| | | "vue": "2.6.12", |
| | | "vue-cli": "^2.9.6", |
| | | "vue-codemirror": "^4.0.6", |
| | |
| | | "eslint": "7.15.0", |
| | | "eslint-plugin-vue": "7.2.0", |
| | | "lint-staged": "10.5.3", |
| | | "node-sass": "^8.0.0", |
| | | "runjs": "4.4.2", |
| | | "sass": "1.32.13", |
| | | "sass-loader": "10.1.1", |
| | | "sass-loader": "^10.4.1", |
| | | "script-ext-html-webpack-plugin": "2.1.5", |
| | | "script-loader": "^0.7.2", |
| | | "stylus": "^0.59.0", |
| | | "svg-sprite-loader": "5.1.1", |
| | | "vue-template-compiler": "2.6.12" |
| | | }, |
| | |
| | | import Vue from 'vue' |
| | | import Vue from "vue"; |
| | | |
| | | import Cookies from 'js-cookie' |
| | | import Cookies from "js-cookie"; |
| | | import * as echarts from "echarts"; |
| | | |
| | | import Element from 'element-ui' |
| | | import './assets/styles/element-variables.scss' |
| | | import Element from "element-ui"; |
| | | import "./assets/styles/element-variables.scss"; |
| | | |
| | | import '@/assets/styles/index.scss' // global css |
| | | import '@/assets/styles/ruoyi.scss' // ruoyi css |
| | | import App from './App' |
| | | import store from './store' |
| | | import router from './router' |
| | | import directive from './directive' // directive |
| | | import plugins from './plugins' // plugins |
| | | import { download } from '@/utils/request' |
| | | //å¼å
¥quill-editorç¼è¾å¨ |
| | | import VueQuillEditor from 'vue-quill-editor' |
| | | // require styles å¼å
¥æ ·å¼ |
| | | import 'quill/dist/quill.core.css' |
| | | import 'quill/dist/quill.snow.css' |
| | | import 'quill/dist/quill.bubble.css' |
| | | Vue.use(VueQuillEditor); |
| | | // å¼å
¥ |
| | | import "@/assets/styles/index.scss"; // global css |
| | | import "@/assets/styles/ruoyi.scss"; // ruoyi css |
| | | import App from "./App"; |
| | | import store from "./store"; |
| | | import router from "./router"; |
| | | import directive from "./directive"; // directive |
| | | import plugins from "./plugins"; // plugins |
| | | import { download } from "@/utils/request"; |
| | | //å¼å
¥quill-editorç¼è¾å¨ |
| | | import VueQuillEditor from "vue-quill-editor"; |
| | | // require styles å¼å
¥æ ·å¼ |
| | | import "quill/dist/quill.core.css"; |
| | | import "quill/dist/quill.snow.css"; |
| | | import "quill/dist/quill.bubble.css"; |
| | | Vue.use(VueQuillEditor); |
| | | // å¼å
¥ |
| | | import { codemirror } from "vue-codemirror"; |
| | | import "@/utils/cm-setting.js"; |
| | | Vue.component("codemirror", codemirror); |
| | |
| | | // import 'vue-codemirror/dist/codemirror.css' |
| | | // Vue.use(VueCodeMirror) |
| | | |
| | | //å®ç°quill-editorç¼è¾å¨ææ½ä¸ä¼ å¾ç |
| | | //å®ç°quill-editorç¼è¾å¨ææ½ä¸ä¼ å¾ç |
| | | // import Quill from 'quill' |
| | | import {Quill} from 'vue-quill-editor' |
| | | window.Quill = Quill; |
| | | import imageResize from 'quill-image-resize' |
| | | // const scriptEl = document.createElement('script'); |
| | | // scriptEl.charset = 'utf-8' |
| | | // scriptEl.src = './image-resize.min.js' |
| | | // const head = document.head || document.getElementsByTagName('head')[0]; |
| | | import { Quill } from "vue-quill-editor"; |
| | | window.Quill = Quill; |
| | | import imageResize from "quill-image-resize"; |
| | | // const scriptEl = document.createElement('script'); |
| | | // scriptEl.charset = 'utf-8' |
| | | // scriptEl.src = './image-resize.min.js' |
| | | // const head = document.head || document.getElementsByTagName('head')[0]; |
| | | // head.appendChild(scriptEl); |
| | | |
| | | import { ImageDrop } from 'quill-image-drop-module' |
| | | import { ImageDrop } from "quill-image-drop-module"; |
| | | // import imageResize from 'quill-image-resize' |
| | | Quill.register('modules/imageDrop', ImageDrop) |
| | | Quill.register("modules/imageDrop", ImageDrop); |
| | | // import imageResize from 'quill-image-resize-module' |
| | | Quill.register('modules/imageResize', imageResize) |
| | | //å®ç°quill-editorç¼è¾å¨è°æ´å¾ç尺寸 |
| | | Quill.register("modules/imageResize", imageResize); |
| | | //å®ç°quill-editorç¼è¾å¨è°æ´å¾ç尺寸 |
| | | // Quill.register('modules/imageResize', ImageResize) |
| | | |
| | | import './assets/icons' // icon |
| | | import './permission' // permission control |
| | | import LemonIMUI from "lemon-imui"; |
| | | import "lemon-imui/dist/index.css"; |
| | | Vue.use(LemonIMUI); |
| | | |
| | | import "./assets/icons"; // icon |
| | | import "./permission"; // permission control |
| | | import { getDicts } from "@/api/system/dict/data"; |
| | | import { getConfigKey } from "@/api/system/config"; |
| | | import { parseTime, resetForm, addDateRange, selectDictLabel, selectDictLabels, handleTree } from "@/utils/ruoyi"; |
| | | import { |
| | | parseTime, |
| | | resetForm, |
| | | addDateRange, |
| | | selectDictLabel, |
| | | selectDictLabels, |
| | | handleTree, |
| | | } from "@/utils/ruoyi"; |
| | | // å页ç»ä»¶ |
| | | import Pagination from "@/components/Pagination"; |
| | | // èªå®ä¹è¡¨æ ¼å·¥å
·ç»ä»¶ |
| | | import RightToolbar from "@/components/RightToolbar" |
| | | import RightToolbar from "@/components/RightToolbar"; |
| | | // 坿æ¬ç»ä»¶ |
| | | import Editor from "@/components/Editor" |
| | | import Editor from "@/components/Editor"; |
| | | // æä»¶ä¸ä¼ ç»ä»¶ |
| | | import FileUpload from "@/components/FileUpload" |
| | | import FileUpload from "@/components/FileUpload"; |
| | | // å¾çä¸ä¼ ç»ä»¶ |
| | | import ImageUpload from "@/components/ImageUpload" |
| | | import ImageUpload from "@/components/ImageUpload"; |
| | | // å¾çé¢è§ç»ä»¶ |
| | | import ImagePreview from "@/components/ImagePreview" |
| | | import ImagePreview from "@/components/ImagePreview"; |
| | | // åå
¸æ ç¾ç»ä»¶ |
| | | import DictTag from '@/components/DictTag' |
| | | import DictTag from "@/components/DictTag"; |
| | | // 头鍿 ç¾ç»ä»¶ |
| | | import VueMeta from 'vue-meta' |
| | | import VueMeta from "vue-meta"; |
| | | // åå
¸æ°æ®ç»ä»¶ |
| | | import DictData from '@/components/DictData' |
| | | import DictData from "@/components/DictData"; |
| | | // ç»ä»¶å°è£
éæ |
| | | import components from './components' |
| | | import components from "./components"; |
| | | // 注åè¿æ»¤å¨ |
| | | // èªå®ä¹æä»¤ |
| | | import * as directives from './directives' |
| | | import * as filters from './filters' |
| | | for(let key in filters){ |
| | | Vue.filter(key, filters[key]) |
| | | import * as directives from "./directives"; |
| | | import * as filters from "./filters"; |
| | | for (let key in filters) { |
| | | Vue.filter(key, filters[key]); |
| | | } |
| | | |
| | | // å
¨å±æ¹æ³æè½½ |
| | | |
| | | Vue.prototype.getDicts = getDicts |
| | | Vue.prototype.getConfigKey = getConfigKey |
| | | Vue.prototype.parseTime = parseTime |
| | | Vue.prototype.resetForm = resetForm |
| | | Vue.prototype.addDateRange = addDateRange |
| | | Vue.prototype.selectDictLabel = selectDictLabel |
| | | Vue.prototype.selectDictLabels = selectDictLabels |
| | | Vue.prototype.download = download |
| | | Vue.prototype.handleTree = handleTree |
| | | Vue.prototype.getDicts = getDicts; |
| | | Vue.prototype.getConfigKey = getConfigKey; |
| | | Vue.prototype.parseTime = parseTime; |
| | | Vue.prototype.resetForm = resetForm; |
| | | Vue.prototype.addDateRange = addDateRange; |
| | | Vue.prototype.selectDictLabel = selectDictLabel; |
| | | Vue.prototype.selectDictLabels = selectDictLabels; |
| | | Vue.prototype.download = download; |
| | | Vue.prototype.handleTree = handleTree; |
| | | // å
¨å±ç»ä»¶æè½½ |
| | | Vue.component('DictTag', DictTag) |
| | | Vue.component('Pagination', Pagination) |
| | | Vue.component('RightToolbar', RightToolbar) |
| | | Vue.component('Editor', Editor) |
| | | Vue.component('FileUpload', FileUpload) |
| | | Vue.component('ImageUpload', ImageUpload) |
| | | Vue.component('ImagePreview', ImagePreview) |
| | | |
| | | Vue.component("DictTag", DictTag); |
| | | Vue.component("Pagination", Pagination); |
| | | Vue.component("RightToolbar", RightToolbar); |
| | | Vue.component("Editor", Editor); |
| | | Vue.component("FileUpload", FileUpload); |
| | | Vue.component("ImageUpload", ImageUpload); |
| | | Vue.component("ImagePreview", ImagePreview); |
| | | |
| | | // å°è£
èªå®ä¹æä»¤ |
| | | for(let key in directives) |
| | | Vue.directive(key, directives[key]) |
| | | Vue.use(directive) |
| | | Vue.use(plugins) |
| | | Vue.use(VueMeta) |
| | | DictData.install() |
| | | Vue.use(components) |
| | | for (let key in directives) Vue.directive(key, directives[key]); |
| | | Vue.use(directive); |
| | | Vue.use(plugins); |
| | | Vue.use(VueMeta); |
| | | DictData.install(); |
| | | Vue.use(components); |
| | | // Vue.use(VueQuillEditor) |
| | | |
| | | |
| | | /** |
| | | * If you don't want to use mock-server |
| | |
| | | */ |
| | | |
| | | Vue.use(Element, { |
| | | size: Cookies.get('size') || 'medium' // set element-ui default size |
| | | }) |
| | | size: Cookies.get("size") || "medium", // set element-ui default size |
| | | }); |
| | | |
| | | Vue.config.productionTip = false |
| | | Vue.config.productionTip = false; |
| | | |
| | | new Vue({ |
| | | el: '#app', |
| | | el: "#app", |
| | | router, |
| | | store, |
| | | render: h => h(App) |
| | | }) |
| | | render: (h) => h(App), |
| | | }); |
| | |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-divider></el-divider> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | listUser, |
| | | getUser, |
| | | delUser, |
| | | addUser, |
| | | updateUser, |
| | | } from "@/api/system/user"; |
| | | import { listUser, delUser, addUser, updateUser } from "@/api/system/user"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-divider></el-divider> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-divider></el-divider> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <!--ç¨æ·æ°æ®--> |
| | | <el-col :span="24" :xs="24"> |
| | | <el-form |
| | | :model="topqueryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="98px" |
| | | > |
| | | <el-form-item label="é¢ç®ææ¬" prop="text"> |
| | | <el-input |
| | | v-model="topqueryParams.text" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å
³èææ " prop="relevance"> |
| | | <el-input |
| | | v-model="topqueryParams.relevance" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> </el-form-item |
| | | ><el-form-item label="ææºå·" prop="phonenumber"> |
| | | <el-input |
| | | v-model="topqueryParams.phonenumber" |
| | | placeholder="请è¾å
¥ææºå·" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <br /> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="medium" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="medium" @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-divider></el-divider> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="medium" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:user:add']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="medium" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:user:edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="medium" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:user:remove']" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="documentf"> |
| | | <div class="document"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="medium" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:user:export']" |
| | | >导åº</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5"> </el-col> --> |
| | | </el-row> |
| | | <!-- <right-toolbar |
| | | :showSearch.sync="showSearch" |
| | | @queryTable="getList" |
| | | :columns="columns" |
| | | ></right-toolbar> --> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="userList" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="50" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | align="center" |
| | | key="userId" |
| | | prop="userId" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="å§å" |
| | | align="center" |
| | | key="userName" |
| | | prop="userName" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="ææºå·" |
| | | align="center" |
| | | key="phonenumber" |
| | | prop="phonenumber" |
| | | /> |
| | | <el-table-column |
| | | label="模çåç§°" |
| | | align="center" |
| | | key="templateName" |
| | | prop="templateName" |
| | | /> |
| | | <el-table-column |
| | | label="é®é¢ææ¬" |
| | | align="center" |
| | | key="problem" |
| | | prop="problem" |
| | | width="180" |
| | | /> |
| | | <el-table-column |
| | | label="é®é¢åå¤" |
| | | align="center" |
| | | key="replyz" |
| | | prop="replyz" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="ææ¾è¯é³" |
| | | align="center" |
| | | key="topicnumber" |
| | | prop="topicnumber" |
| | | width="350" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <my-audio |
| | | :theUrl="scope.row.url" |
| | | :theControlList="scope.row.controlList" |
| | | ></my-audio> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="å¹é
æåè¯å¥" |
| | | align="center" |
| | | key="replya" |
| | | prop="replya" |
| | | /> |
| | | <el-table-column |
| | | label="å
³èææ " |
| | | align="center" |
| | | key="replys" |
| | | prop="replys" |
| | | /> |
| | | <el-table-column |
| | | label="ææ å¼" |
| | | align="center" |
| | | key="replyc" |
| | | prop="replyc" |
| | | /> |
| | | <el-table-column |
| | | label="å夿¶é´" |
| | | align="center" |
| | | prop="createTime" |
| | | width="160" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | width="180" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | class="icon-edit" |
| | | @click="Referencequestion(scope.row)" |
| | | v-hasPermi="['system:user:edit']" |
| | | >ç¼è¾è¯æ¯</el-button |
| | | > |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | icon="el-icon-s-claim" |
| | | class="icon-s-claim" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:user:edit']" |
| | | >æµè¯å¹é
</el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="topqueryParams.pageNum" |
| | | :limit.sync="topqueryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- æ·»å æä¿®æ¹é¢ç®é
ç½®å¯¹è¯æ¡ --> |
| | | <!-- ææ ç¼è¾ --> |
| | | <el-dialog :visible.sync="indicatorVisible" width="700px"> |
| | | <div class="headline"> |
| | | <div class="basics">é®é¢é
ç½®</div> |
| | | <div class="headbottom"> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-circle-plus-outline" |
| | | @click="addzbiao" |
| | | >æ·»å ææ </el-button |
| | | > |
| | | <el-button type="primary" icon="el-icon-s-claim">ä¿å</el-button> |
| | | <el-button type="primary" icon="el-icon-document" |
| | | >æ´æ°ææ è§åè³æ¨¡ç</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | <div class="valuetop" v-for="(item, index) in deployList" :key="item.id"> |
| | | <div class="val-text"> |
| | | <div> |
| | | ææ å¤æ¥ <span>{{ item.name }}</span> |
| | | </div> |
| | | <div class="text-icon" @click="deletei(index)"> |
| | | <i class="el-icon-delete" /> |
| | | </div> |
| | | </div> |
| | | <div class="val-bon"> |
| | | <el-form ref="form" :model="form" label-width="80px"> |
| | | <el-form-item label="ææ ç±»å"> |
| | | <el-radio-group v-model="form.resource"> |
| | | <el-radio label="é项"></el-radio> |
| | | <el-radio label="ææ¬"></el-radio> |
| | | <el-radio label="æ°ç»"></el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="ææ åç§°"> |
| | | <el-input v-model="form.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ææ å¼"> |
| | | <el-input v-model="item.name"></el-input> |
| | | </el-form-item> |
| | | <el-form-item label="ç¹æ®èµæº"> |
| | | <el-radio-group v-model="form.resource"> |
| | | <el-radio label="åºç¡"></el-radio> |
| | | <el-radio label="èªå®ä¹"></el-radio> |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | <el-form-item label="åºç¡è§å"> |
| | | <el-input type="textarea" v-model="item.valuetop"></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | </div> |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="indicatorVisible = false">å
³é</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | listUser, |
| | | delUser, |
| | | addUser, |
| | | updateUser, |
| | | changeUserStatus, |
| | | } from "@/api/system/user"; |
| | | |
| | | import myAudio from "./myAudio.vue"; |
| | | export default { |
| | | name: "User", |
| | | dicts: ["sys_normal_disable", "sys_user_sex"], |
| | | components: { myAudio }, |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // ç¨æ·è¡¨æ ¼æ°æ® |
| | | userList: [ |
| | | { |
| | | userId: 1, |
| | | userName: "çäº", |
| | | phonenumber: "13802963330", |
| | | templateName: "乿", |
| | | problem: "æè¿æä¹æ ·", |
| | | reply: "sas", |
| | | url: "", |
| | | controlList: "onlyOnePlaying", |
| | | }, |
| | | { |
| | | userId: 1, |
| | | userName: "å¼ äº", |
| | | phonenumber: "13802963330", |
| | | templateName: "乿", |
| | | problem: "æè¿æä¹æ ·", |
| | | reply: "sas", |
| | | url: "", |
| | | controlList: "onlyOnePlaying", |
| | | }, |
| | | ], |
| | | deployList: [ |
| | | { |
| | | id: 1, |
| | | name: "æ", |
| | | valuetop: |
| | | "(?!.*å¿|.*ä¸|.*没)^.*(æ¯|æ|对|å|ä½|æ£|æ¥|å¤è¯|好|åå |å¤è¯|å»(è¿|好|äº|å®|å»é¢)|æ¥(è¿|äº|å»é¢))|没é|对å|å¯è½|(å·²ç»|æ©)å»äº|å¼äºè¯|è
°å¸¦|å带|è¦ç|(?<!没)æç|表带,10;è¦,5", |
| | | }, |
| | | { |
| | | id: 2, |
| | | name: "ä¸ç¥é", |
| | | valuetop: |
| | | "(ä¸|没|è°|鬼|æä¹).*(ç
|å¯è½|ç¥é|äºè§£|æ¸
æ¥|æ|æç½|确认|ç¡®å®|æå¾|ç¥æ|认å¾|è¯å¾|å°è±¡|çæ|è®°|ä¼|å
³å¿|å
³æ³¨|注æ|åè¯|éç¥|å¬)", |
| | | }, |
| | | ], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | |
| | | // æ¥æèå´ |
| | | dateRange: [], |
| | | |
| | | inputValue: "", |
| | | indicatorVisible: false, //ææ ç¼è¾å¼¹æ¡ |
| | | radio: "", |
| | | radios: [], |
| | | previewtype: 2, //é¢è§é¢ç®ç±»å |
| | | total: 0, // æ»æ¡æ° |
| | | ImportQuantity: 999, //导é¢ç®æ°é |
| | | //é¢è§é¢ç®ä¿¡æ¯ |
| | | previewvalue: { |
| | | username: "è¿ä¸ªå»çå¯¹ä½ æä¹æ ·", |
| | | }, |
| | | // 表ååæ° |
| | | form: { |
| | | phonenumber: "", |
| | | totagid: "", |
| | | types: "", |
| | | nickName: "", |
| | | qystatus: "", |
| | | btstatus: "", |
| | | }, |
| | | //导å
¥è¿åº¦ |
| | | dractive: 1, |
| | | // 导å
¥å±ç¤ºè¡¨å |
| | | uploadingData: {}, |
| | | // æ¥è¯¢åæ° |
| | | topqueryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | userName: undefined, |
| | | tagid: undefined, |
| | | topic: undefined, |
| | | }, |
| | | propss: { multiple: true }, |
| | | |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | userName: [ |
| | | { required: true, message: "ç¨æ·åç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 20, |
| | | message: "ç¨æ·åç§°é¿åº¦å¿
é¡»ä»äº 2 å 20 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | nickName: [ |
| | | { required: true, message: "ç¨æ·æµç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | password: [ |
| | | { required: true, message: "ç¨æ·å¯ç ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 5, |
| | | max: 20, |
| | | message: "ç¨æ·å¯ç é¿åº¦å¿
é¡»ä»äº 5 å 20 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | email: [ |
| | | { |
| | | type: "email", |
| | | message: "请è¾å
¥æ£ç¡®çé®ç®±å°å", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | phonenumber: [ |
| | | { |
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
| | | message: "请è¾å
¥æ£ç¡®çææºå·ç ", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | IDnumber: [ |
| | | { |
| | | pattern: |
| | | /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/, |
| | | message: "请è¾å
¥æ£ç¡®ç身份è¯å·ç ", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | watch: {}, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢é¢ç®å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listUser(this.addDateRange(this.topqueryParams, this.dateRange)).then( |
| | | (response) => { |
| | | // this.userList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | // ç¼è¾è¯æ¯ææ |
| | | Referencequestion(row) { |
| | | this.indicatorVisible = true; |
| | | }, |
| | | // æ°å¢ææ |
| | | addzbiao() { |
| | | const ids = this.deployList.length + 1; |
| | | console.log(ids); |
| | | this.deployList.push({ |
| | | id: ids, |
| | | name: "", |
| | | valuetop: "", |
| | | }); |
| | | }, |
| | | // å 餿æ |
| | | deletei(index) { |
| | | console.log(index); |
| | | this.deployList.splice(index, 1); |
| | | }, |
| | | |
| | | // é¢ç®ç¶æä¿®æ¹ |
| | | handleStatusChange(row) { |
| | | let text = row.status === "0" ? "å¯ç¨" : "åç¨"; |
| | | this.$modal |
| | | .confirm('确认è¦"' + text + '""' + row.userName + '"ç¨æ·åï¼') |
| | | .then(function () { |
| | | return changeUserStatus(row.userId, row.status); |
| | | }) |
| | | .then(() => { |
| | | this.$modal.msgSuccess(text + "æå"); |
| | | }) |
| | | .catch(function () { |
| | | row.status = row.status === "0" ? "1" : "0"; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | userId: undefined, |
| | | deptId: undefined, |
| | | userName: undefined, |
| | | nickName: undefined, |
| | | password: undefined, |
| | | phonenumber: undefined, |
| | | email: undefined, |
| | | sex: undefined, |
| | | status: "0", |
| | | remark: undefined, |
| | | postIds: [], |
| | | roleIds: [], |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.topqueryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.dateRange = []; |
| | | this.resetForm("queryForm"); |
| | | this.topqueryParams.deptId = undefined; |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map((item) => item.userId); |
| | | this.single = selection.length != 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | //å é¤é项 |
| | | handleClose(tag) { |
| | | this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); |
| | | }, |
| | | |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | }, |
| | | |
| | | /** æäº¤æé® */ |
| | | submitForm: function () { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.form.userId != undefined) { |
| | | updateUser(this.form).then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addUser(this.form).then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const userIds = row.userId || this.ids; |
| | | this.$modal |
| | | .confirm('æ¯å¦ç¡®è®¤å é¤ç¨æ·ç¼å·ä¸º"' + userIds + '"çæ°æ®é¡¹ï¼') |
| | | .then(function () { |
| | | return delUser(userIds); |
| | | }) |
| | | .then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download( |
| | | "system/user/export", |
| | | { |
| | | ...this.topqueryParams, |
| | | }, |
| | | `user_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-button--primary.is-plain { |
| | | color: #ffffff; |
| | | background: #409eff; |
| | | border-color: #4fabe9; |
| | | } |
| | | .document { |
| | | width: 100px; |
| | | height: 50px; |
| | | } |
| | | .documentf { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | .download { |
| | | text-align: center; |
| | | .el-upload__tip { |
| | | font-size: 23px; |
| | | } |
| | | .el-upload__text { |
| | | font-size: 23px; |
| | | } |
| | | } |
| | | .uploading { |
| | | margin-top: 20px; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #ffffff; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | } |
| | | .el-tag + .el-tag { |
| | | margin-left: 10px; |
| | | } |
| | | .button-new-tag { |
| | | margin-left: 10px; |
| | | height: 32px; |
| | | line-height: 30px; |
| | | padding-top: 0; |
| | | padding-bottom: 0; |
| | | } |
| | | .input-new-tag { |
| | | width: 90px; |
| | | margin-left: 10px; |
| | | vertical-align: bottom; |
| | | } |
| | | .drexamine { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 30px; |
| | | background: #daeaf5; |
| | | img { |
| | | width: 100px; |
| | | height: 100px; |
| | | } |
| | | } |
| | | .qrcode-dialo { |
| | | // text-align: center; |
| | | // display: flex; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #edf1f7; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | .topic-dev { |
| | | margin-bottom: 25px; |
| | | font-size: 20px !important; |
| | | .dev-text { |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | .headline { |
| | | display: flex; |
| | | height: 50px; |
| | | margin: 15px; |
| | | margin-bottom: 0; |
| | | padding: 0 20px 20px 20px; |
| | | line-height: 50px; |
| | | background: #92c5f0; |
| | | justify-content: space-between; |
| | | } |
| | | .valuetop { |
| | | .val-text { |
| | | display: flex; |
| | | height: 50px; |
| | | margin: 15px; |
| | | margin-bottom: 0; |
| | | // padding: 0 20px 20px 20px; |
| | | padding: 0 20px; |
| | | align-items: center; |
| | | background: #92c5f0; |
| | | justify-content: space-between; |
| | | .text-icon { |
| | | width: 35px; |
| | | height: 35px; |
| | | line-height: 35px; |
| | | text-align: center; |
| | | background: #fafafa; |
| | | cursor: pointer; |
| | | border-radius: 5px; |
| | | } |
| | | } |
| | | .val-bon { |
| | | margin: 15px; |
| | | margin-top: 0; |
| | | padding: 30px; |
| | | background: #f2f5fc; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | } |
| | | } |
| | | .icon-s-claim { |
| | | color: #409eff; |
| | | } |
| | | .icon-edit { |
| | | color: rgb(5, 212, 212); |
| | | } |
| | | ::v-deep.el-radio-group { |
| | | span { |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | ::v-deep.el-checkbox-group { |
| | | span { |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div |
| | | class="di main-wrap" |
| | | v-loading="audio.waiting" |
| | | element-loading-text="é³è§é¢å è½½ä¸" |
| | | element-loading-spinner="el-icon-loading" |
| | | > |
| | | <!-- è¿é设置äºref屿§åï¼å¨vueç»ä»¶ä¸ï¼å°±å¯ä»¥ç¨this.$refs.audioæ¥è®¿é®è¯¥domå
ç´ --> |
| | | <audio |
| | | ref="audio" |
| | | class="dn" |
| | | :src="url" |
| | | :preload="audio.preload" |
| | | @play="onPlay" |
| | | @error="onError" |
| | | @waiting="onWaiting" |
| | | @pause="onPause" |
| | | @timeupdate="onTimeupdate" |
| | | @loadedmetadata="onLoadedmetadata" |
| | | ></audio> |
| | | <div> |
| | | <!-- ææ¾ --> |
| | | <i |
| | | class="el-icon-microphone" |
| | | v-if="audio.playing == true" |
| | | style="color: rgb(10 243 61); font-size: 18px" |
| | | ></i> |
| | | <i class="el-icon-microphone" v-else style="font-size: 18px"></i> |
| | | <el-button style="margin: 0 10px" type="text" @click="startPlayOrPause">{{ |
| | | audio.playing | transPlayPause |
| | | }}</el-button> |
| | | |
| | | <!-- ææ¾æå¤§æ¶é´ --> |
| | | <span type="info">{{ audio.maxTime | formatSecond }}</span> |
| | | |
| | | <!-- å¿«è¿æé® --> |
| | | <el-button |
| | | v-show="!controlList.noSpeed" |
| | | type="text" |
| | | @click="changeSpeed" |
| | | >{{ audio.speed | transSpeed }}</el-button |
| | | > |
| | | <a |
| | | :href="url" |
| | | v-show="!controlList.noDownload" |
| | | target="_blank" |
| | | class="download" |
| | | download |
| | | >ä¸è½½</a |
| | | > |
| | | <br /> |
| | | |
| | | <!-- ææ¾æ¶é´ --> |
| | | <!-- <el-tag type="info">{{ audio.currentTime | formatSecond }}</el-tag> --> |
| | | |
| | | <!-- ææ¾è¿åº¦æ¡ --> |
| | | <el-slider |
| | | v-show="!controlList.noProcess" |
| | | v-model="sliderTime" |
| | | :format-tooltip="formatProcessToolTip" |
| | | @change="changeCurrentTime" |
| | | class="slider" |
| | | ></el-slider> |
| | | |
| | | <!-- éé³æé® --> |
| | | <!-- <el-button |
| | | v-show="!controlList.noMuted" |
| | | type="text" |
| | | @click="startMutedOrNot" |
| | | >{{ audio.muted | transMutedOrNot }}</el-button |
| | | > --> |
| | | |
| | | <!-- é³éå¤§å° --> |
| | | <el-slider |
| | | v-show="!controlList.noVolume" |
| | | v-model="volume" |
| | | :format-tooltip="formatVolumeToolTip" |
| | | @change="changeVolume" |
| | | class="slider" |
| | | ></el-slider> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | function realFormatSecond(second) { |
| | | var secondType = typeof second; |
| | | if (secondType === "number" || secondType === "string") { |
| | | second = parseInt(second); |
| | | var hours = Math.floor(second / 3600); |
| | | second = second - hours * 3600; |
| | | var mimute = Math.floor(second / 60); |
| | | second = second - mimute * 60; |
| | | return ( |
| | | hours + ":" + ("0" + mimute).slice(-2) + ":" + ("0" + second).slice(-2) |
| | | ); |
| | | } else { |
| | | return "0:00:00"; |
| | | } |
| | | } |
| | | export default { |
| | | // ç¶ä¼ å |
| | | props: { |
| | | theUrl: { |
| | | type: String, |
| | | required: true, |
| | | }, |
| | | theSpeeds: { |
| | | type: Array, |
| | | default() { |
| | | return [1, 1.5, 2]; |
| | | }, |
| | | }, |
| | | theControlList: { |
| | | type: String, |
| | | default: "", |
| | | }, |
| | | }, |
| | | data() { |
| | | return { |
| | | url: this.theUrl, |
| | | audio: { |
| | | currentTime: 0, |
| | | maxTime: 0, // é³é¢æ¶é¿ |
| | | playing: false, // æ¯å¦å¨ææ¾ |
| | | muted: false, |
| | | speed: 1, |
| | | waiting: false, |
| | | preload: "auto", |
| | | }, |
| | | sliderTime: 0, |
| | | volume: 100, |
| | | speeds: this.theSpeeds, |
| | | controlList: { |
| | | // 䏿¾ç¤ºä¸è½½ |
| | | noDownload: false, |
| | | // 䏿¾ç¤ºéé³ |
| | | noMuted: false, |
| | | // 䏿¾ç¤ºé³éæ¡ |
| | | noVolume: false, |
| | | // 䏿¾ç¤ºè¿åº¦æ¡ |
| | | noProcess: false, |
| | | // åªè½ææ¾ä¸ä¸ª |
| | | onlyOnePlaying: false, |
| | | // ä¸è¦å¿«è¿æé® |
| | | noSpeed: false, |
| | | }, |
| | | }; |
| | | }, |
| | | methods: { |
| | | changeSpeed() { |
| | | let index = this.speeds.indexOf(this.audio.speed) + 1; |
| | | this.audio.speed = this.speeds[index % this.speeds.length]; |
| | | this.$refs.audio.playbackRate = this.audio.speed; |
| | | }, |
| | | startMutedOrNot() { |
| | | this.$refs.audio.muted = !this.$refs.audio.muted; |
| | | this.audio.muted = this.$refs.audio.muted; |
| | | }, |
| | | // é³éæ¡toolTip |
| | | formatVolumeToolTip(index) { |
| | | return "é³éæ¡: " + index; |
| | | }, |
| | | // è¿åº¦æ¡toolTip |
| | | formatProcessToolTip(index = 0) { |
| | | index = parseInt((this.audio.maxTime / 100) * index); |
| | | return "è¿åº¦æ¡: " + realFormatSecond(index); |
| | | }, |
| | | // é³éæ¹å |
| | | changeVolume(index = 0) { |
| | | this.$refs.audio.volume = index / 100; |
| | | this.volume = index; |
| | | }, |
| | | // ææ¾è·³è½¬ |
| | | changeCurrentTime(index) { |
| | | this.$refs.audio.currentTime = parseInt( |
| | | (index / 100) * this.audio.maxTime |
| | | ); |
| | | }, |
| | | //æ¾ç¤ºææ¾æè
æå |
| | | startPlayOrPause() { |
| | | return this.audio.playing ? this.pausePlay() : this.startPlay(); |
| | | }, |
| | | // å¼å§ææ¾ |
| | | startPlay() { |
| | | // console.log("ææ¾"); |
| | | this.$refs.audio.play(); |
| | | }, |
| | | // æåææ¾ |
| | | pausePlay() { |
| | | // console.log("æå"); |
| | | this.$refs.audio.pause(); |
| | | }, |
| | | |
| | | // é³é¢æåæ¶è§¦å |
| | | onPause() { |
| | | this.audio.playing = false; |
| | | }, |
| | | // é³é¢é误æ¶è§¦å |
| | | onError() { |
| | | // this.audio.waiting = true; |
| | | }, |
| | | // é³é¢å夿¶è§¦å |
| | | onWaiting(res) { |
| | | console.log("çå¾
", res); |
| | | }, |
| | | // é³é¢ææ¾æ¶è§¦å |
| | | onPlay(res) { |
| | | // console.log("ææ¾", res); |
| | | this.audio.playing = true; |
| | | this.audio.loading = false; |
| | | if (!this.controlList.onlyOnePlaying) { |
| | | return; |
| | | } |
| | | let target = res.target; |
| | | let audios = document.getElementsByTagName("audio"); //è·åææè§é¢æ ç¾ |
| | | [...audios].forEach((item) => { |
| | | if (item !== target) { |
| | | item.pause(); |
| | | } |
| | | }); |
| | | }, |
| | | // ææ¾æ°ééå¶ï¼åæ¶åªè½ææ¾ä¸ä¸ªï¼ |
| | | setControlList() { |
| | | // 注æç¶ç»ä»¶ä¼ ç弿¯å¦æ»¡è¶³è¦æ± |
| | | let controlList = this.theControlList.split(" "); |
| | | controlList.forEach((item) => { |
| | | if (this.controlList[item] !== undefined) { |
| | | this.controlList[item] = true; |
| | | } |
| | | }); |
| | | }, |
| | | |
| | | // å½timeupdateäºä»¶å¤§æ¦æ¯ç§ä¸æ¬¡ï¼ç¨æ¥æ´æ°é³é¢æµçå½åææ¾æ¶é´ |
| | | onTimeupdate(res) { |
| | | this.audio.currentTime = res.target.currentTime; |
| | | this.sliderTime = parseInt( |
| | | (this.audio.currentTime / this.audio.maxTime) * 100 |
| | | ); |
| | | }, |
| | | |
| | | // å½å è½½è¯é³æµå
æ°æ®å®æåï¼ä¼è§¦å该äºä»¶çåè°å½æ° |
| | | onLoadedmetadata(res) { |
| | | // console.log("å è½½", res); |
| | | this.audio.waiting = false; // åæ¶çå¾
ç¶æ |
| | | this.audio.maxTime = parseInt(res.target.duration); |
| | | }, |
| | | }, |
| | | // è¿æ»¤å±æ§ |
| | | filters: { |
| | | formatSecond(second = 0) { |
| | | return realFormatSecond(second); |
| | | }, |
| | | transPlayPause(value) { |
| | | return value ? "æå" : "ææ¾"; |
| | | }, |
| | | transMutedOrNot(value) { |
| | | return value ? "æ¾é³" : "éé³"; |
| | | }, |
| | | transSpeed(value) { |
| | | return "å¿«è¿: x" + value; |
| | | }, |
| | | }, |
| | | created() { |
| | | this.setControlList(); |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style scoped> |
| | | .slider { |
| | | display: inline-block; |
| | | width: 100px; |
| | | position: relative; |
| | | top: 14px; |
| | | margin-left: 15px; |
| | | } |
| | | .di { |
| | | display: inline-block; |
| | | } |
| | | .download { |
| | | color: #409eff; |
| | | margin-left: 15px; |
| | | } |
| | | .dn { |
| | | display: none; |
| | | } |
| | | </style> |
| | |
| | | margin-bottom: 0; |
| | | padding: 0 20px 20px 20px; |
| | | line-height: 50px; |
| | | background: #cdcdce; |
| | | background: #92c5f0; |
| | | } |
| | | .headline { |
| | | display: flex; |
| | |
| | | margin-bottom: 0; |
| | | padding: 0 20px 20px 20px; |
| | | line-height: 50px; |
| | | background: #cdcdce; |
| | | background: #92c5f0; |
| | | justify-content: space-between; |
| | | } |
| | | .valuetop { |
| | |
| | | // padding: 0 20px 20px 20px; |
| | | padding: 0 20px; |
| | | align-items: center; |
| | | background: #cdcdce; |
| | | background: #92c5f0; |
| | | justify-content: space-between; |
| | | .text-icon { |
| | | width: 35px; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export default [ |
| | | { |
| | | id: 1, |
| | | displayName: "忢¦ä¸æ ·èªç±", |
| | | avatar: "https://p.qqan.com/up/2020-2/2020022821001845128.jpg", |
| | | index: "X", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "ä½ å¼å¿å" |
| | | }, |
| | | { |
| | | id: 2, |
| | | displayName: "æ¢¦éæ¶åã", |
| | | avatar: "https://p.qqan.com/up/2021-1/20211301122243621.jpg", |
| | | index: "M", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 3, |
| | | displayName: "åäº", |
| | | avatar: "https://p.qqan.com/up/2021-1/2021129102387841.jpg", |
| | | index: "L", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 4, |
| | | displayName: "å°é", |
| | | avatar: "https://p.qqan.com/up/2021-1/2021122135507881.jpg", |
| | | index: "X", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 5, |
| | | displayName: "æ¨çæ³", |
| | | avatar: "https://p.qqan.com/up/2021-1/20211211131598147.jpg", |
| | | index: "Y", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 6, |
| | | displayName: "森系Style", |
| | | avatar: "https://p.qqan.com/up/2021-1/2021113104111220.jpg", |
| | | index: "S", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 7, |
| | | displayName: "é¸çè±", |
| | | avatar: "https://p.qqan.com/up/2021-1/20211411391666.jpg", |
| | | index: "B", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "ä½ æä¹è¿ä¸ç¡åï¼" |
| | | }, |
| | | { |
| | | id: 8, |
| | | displayName: "æ¾å¹³", |
| | | avatar: "https://p.qqan.com/up/2020-12/202012291044425822.jpg", |
| | | index: "Z", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 9, |
| | | displayName: "æ·¡ç¶", |
| | | avatar: "https://p.qqan.com/up/2020-12/202012141813343503.jpg", |
| | | index: "D", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 10, |
| | | displayName: "å¶åã", |
| | | avatar: "https://p.qqan.com/up/2021-1/20211301122243621.jpg", |
| | | index: "Y", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 11, |
| | | displayName: "åè±", |
| | | avatar: "https://p.qqan.com/up/2020-12/202012111157268739.jpg", |
| | | index: "T", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 12, |
| | | displayName: "æ¸
沫", |
| | | avatar: "https://p.qqan.com/up/2020-12/202012415467996.jpg", |
| | | index: "Q", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | }, |
| | | { |
| | | id: 13, |
| | | displayName: "Lemon-imui交æµç¾¤", |
| | | avatar: "https://p.qqan.com/up/2020-11/20201127157109035.jpg", |
| | | index: "L", |
| | | isGroup: true, |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "è¿ä¸ªåå¤çåï¼" |
| | | }, |
| | | { |
| | | id: 14, |
| | | displayName: "ç³»ç»éç¥", |
| | | avatar: "https://p.qqan.com/up/2020-6/2020061117234279854.jpg", |
| | | index: "[1]系統éç¥", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "å®éè´è¿éè¿äºä½ ç好å请æ±", |
| | | renderContainer() { |
| | | return ( |
| | | <div style="padding:15px;"> |
| | | <div>å®éè´è¿éè¿äºä½ ç好å请æ±</div> |
| | | <div>å®éè´è¿éè¿äºä½ ç好å请æ±</div> |
| | | <div>å®éè´è¿éè¿äºä½ ç好å请æ±</div> |
| | | </div> |
| | | ); |
| | | } |
| | | }, |
| | | { |
| | | id: 15, |
| | | displayName: "å®éè´è¿ã", |
| | | avatar: "https://p.qqan.com/up/2020-6/2020060308522797777.jpg", |
| | | index: "N", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "" |
| | | } |
| | | ]; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export default [ |
| | | { |
| | | label: "表æ
", |
| | | children: [ |
| | | { |
| | | name: "1f600", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f600.png" |
| | | }, |
| | | { |
| | | name: "1f62c", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f62c.png" |
| | | }, |
| | | { |
| | | name: "1f601", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f601.png" |
| | | }, |
| | | { |
| | | name: "1f602", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f602.png" |
| | | }, |
| | | { |
| | | name: "1f923", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f923.png" |
| | | }, |
| | | { |
| | | name: "1f973", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f973.png" |
| | | }, |
| | | { |
| | | name: "1f603", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f603.png" |
| | | }, |
| | | { |
| | | name: "1f604", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f604.png" |
| | | }, |
| | | { |
| | | name: "1f605", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f605.png" |
| | | }, |
| | | { |
| | | name: "1f606", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f606.png" |
| | | }, |
| | | { |
| | | name: "1f607", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f607.png" |
| | | }, |
| | | { |
| | | name: "1f609", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f609.png" |
| | | }, |
| | | { |
| | | name: "1f60a", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f60a.png" |
| | | }, |
| | | { |
| | | name: "1f642", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f642.png" |
| | | }, |
| | | { |
| | | name: "1f643", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f643.png" |
| | | }, |
| | | { |
| | | name: "1263a", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/263a.png" |
| | | }, |
| | | { |
| | | name: "1f60b", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f60b.png" |
| | | }, |
| | | { |
| | | name: "1f60c", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f60c.png" |
| | | }, |
| | | { |
| | | name: "1f60d", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f60d.png" |
| | | }, |
| | | { |
| | | name: "1f970", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f970.png" |
| | | }, |
| | | { |
| | | name: "1f618", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f618.png" |
| | | }, |
| | | { |
| | | name: "1f617", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f617.png" |
| | | }, |
| | | { |
| | | name: "1f619", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f619.png" |
| | | }, |
| | | { |
| | | name: "1f61a", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f61a.png" |
| | | }, |
| | | { |
| | | name: "1f61c", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f61c.png" |
| | | }, |
| | | { |
| | | name: "1f92a", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f92a.png" |
| | | }, |
| | | { |
| | | name: "1f928", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f928.png" |
| | | }, |
| | | { |
| | | name: "1f9d0", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f9d0.png" |
| | | }, |
| | | { |
| | | name: "1f61d", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f61d.png" |
| | | }, |
| | | { |
| | | name: "1f61b", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f61b.png" |
| | | }, |
| | | { |
| | | name: "1f911", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f911.png" |
| | | }, |
| | | { |
| | | name: "1f913", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f913.png" |
| | | }, |
| | | { |
| | | name: "1f60e", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f60e.png" |
| | | }, |
| | | { |
| | | name: "1f929", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f929.png" |
| | | }, |
| | | { |
| | | name: "1f921", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f921.png" |
| | | }, |
| | | { |
| | | name: "1f920", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f920.png" |
| | | }, |
| | | { |
| | | name: "1f917", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f917.png" |
| | | }, |
| | | { |
| | | name: "1f60f", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f60f.png" |
| | | }, |
| | | { |
| | | name: "1f636", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f636.png" |
| | | }, |
| | | { |
| | | name: "1f610", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f610.png" |
| | | }, |
| | | { |
| | | name: "1f611", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f611.png" |
| | | }, |
| | | { |
| | | name: "1f612", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f612.png" |
| | | }, |
| | | { |
| | | name: "1f644", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f644.png" |
| | | }, |
| | | { |
| | | name: "1f914", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f914.png" |
| | | }, |
| | | { |
| | | name: "1f925", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f925.png" |
| | | }, |
| | | { |
| | | name: "1f92d", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f92d.png" |
| | | }, |
| | | { |
| | | name: "1f92b", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f92b.png" |
| | | }, |
| | | { |
| | | name: "1f92c", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f92c.png" |
| | | }, |
| | | { |
| | | name: "1f92f", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f92f.png" |
| | | }, |
| | | { |
| | | name: "1f633", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f633.png" |
| | | }, |
| | | { |
| | | name: "1f61e", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f61e.png" |
| | | }, |
| | | { |
| | | name: "1f61f", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f61f.png" |
| | | }, |
| | | { |
| | | name: "1f620", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f620.png" |
| | | }, |
| | | { |
| | | name: "1f621", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f621.png" |
| | | } |
| | | ] |
| | | }, |
| | | { |
| | | label: "æ¶è", |
| | | children: [ |
| | | { |
| | | name: "1f62c", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f62c.png" |
| | | }, |
| | | { |
| | | name: "1f621", |
| | | title: "å¾®ç¬", |
| | | src: "https://twemoji.maxcdn.com/2/72x72/1f621.png" |
| | | } |
| | | ] |
| | | } |
| | | ]; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import ContactsData from "./contacts"; |
| | | import UserData from "./user"; |
| | | const generateRandId = () => { |
| | | return Math.random().toString(36).substr(-8); |
| | | }; |
| | | const getContact = (id) => { |
| | | const data = ContactsData.find((contact) => contact.id == id); |
| | | return { id: data.id, avatar: data.avatar, displayName: data.displayName }; |
| | | }; |
| | | export default { |
| | | 1: [ |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "é®ä½ ä»¶äº", |
| | | toContactId: 1, |
| | | fromUser: UserData |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "å¥åã", |
| | | toContactId: 1, |
| | | fromUser: getContact(1) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "为ä»ä¹", |
| | | toContactId: 1, |
| | | fromUser: UserData |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "ä½ ç©¿äºé«è·éè¿è¿ä¹ç®", |
| | | toContactId: 1, |
| | | fromUser: UserData |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "å 为æç®åã[!1f600][!1f600][!1f600]", |
| | | toContactId: 1, |
| | | fromUser: getContact(1) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "ä½ å¼å¿å", |
| | | toContactId: 1, |
| | | fromUser: getContact(1) |
| | | } |
| | | ], |
| | | 2: [], |
| | | 3: [], |
| | | 4: [], |
| | | 5: [], |
| | | 6: [], |
| | | 7: [], |
| | | 8: [], |
| | | 9: [], |
| | | 10: [], |
| | | 11: [], |
| | | 12: [], |
| | | 13: [ |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "ææ¯æµè¯æ¶åçå°ç", |
| | | toContactId: 1, |
| | | fromUser: getContact(4) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "䏿°çæ¬äºï¼ç©ç©", |
| | | toContactId: 1, |
| | | fromUser: getContact(4) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "项ç®å
没ææè¿ä¸ª", |
| | | toContactId: 1, |
| | | fromUser: getContact(4) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "@awesome ææ°çï¼ä¸ç¶åªæè¿åè½", |
| | | toContactId: 1, |
| | | fromUser: getContact(5) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "å
¶å®æ¯è·ä½ çé®ç½©å±æå²çª", |
| | | toContactId: 1, |
| | | fromUser: getContact(4) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "èªå·±ä¿®æ¹indexå", |
| | | toContactId: 1, |
| | | fromUser: UserData |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "ä½ ä»¬åçº§å°æè¿çäºåï¼", |
| | | toContactId: 1, |
| | | fromUser: getContact(6) |
| | | }, |
| | | { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "wo ç°å¨ç¨ç142", |
| | | toContactId: 1, |
| | | fromUser: getContact(7) |
| | | } |
| | | ], |
| | | 14: [], |
| | | 15: [] |
| | | }; |
¶Ô±ÈÐÂÎļþ |
| | |
| | | export default { |
| | | id: 1000, |
| | | avatar: "https://p.qqan.com/up/2018-4/15244505348390471.jpg", |
| | | displayName: "éç«ã" |
| | | }; |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div id="app"> |
| | | <div class="scroll-top" @click="scrollToTop">ð</div> |
| | | |
| | | <div class="imui-center"> |
| | | <lemon-imui |
| | | :user="user" |
| | | ref="IMUI" |
| | | :contextmenu="contextmenu" |
| | | :contact-contextmenu="contactContextmenu" |
| | | :theme="theme" |
| | | :hide-menu="hideMenu" |
| | | :hide-menu-avatar="hideMenuAvatar" |
| | | :hide-message-name="hideMessageName" |
| | | :hide-message-time="hideMessageTime" |
| | | @change-menu="handleChangeMenu" |
| | | @change-contact="handleChangeContact" |
| | | @pull-messages="handlePullMessages" |
| | | @message-click="handleMessageClick" |
| | | @menu-avatar-click="handleMenuAvatarClick" |
| | | @send="handleSend" |
| | | > |
| | | <template #cover> |
| | | <div class="cover"> |
| | | <i class="lemon-icon-message"></i> |
| | | <p><b>èªå®ä¹å°é¢ Lemon</b> IMUI</p> |
| | | </div> |
| | | </template> |
| | | <template #message-title="contact"> |
| | | <span>{{ contact.displayName }}</span> |
| | | <small class="more" @click="changeDrawer(contact, $refs.IMUI)" |
| | | >{{ |
| | | ($refs.IMUI ? $refs.IMUI.drawerVisible : false) ? "å
³é" : "æå¼" |
| | | }}æ½å±</small |
| | | > |
| | | <br /> |
| | | </template> |
| | | </lemon-imui> |
| | | <div class="action"> |
| | | <lemon-button @click="appendMessage">åéæ¶æ¯</lemon-button> |
| | | <lemon-button @click="appendEventMessage">åé event æ¶æ¯</lemon-button> |
| | | <lemon-button @click="removeMessage">å 餿è¿ä¸æ¡æ¶æ¯</lemon-button> |
| | | <lemon-button @click="updateMessage">ä¿®æ¹æ¶æ¯</lemon-button> |
| | | <lemon-button @click="appendCustomMessage">åéæ¶æ¯</lemon-button> |
| | | <br /> |
| | | <lemon-button @click="updateContact">ä¿®æ¹è系人信æ¯</lemon-button> |
| | | <lemon-button @click="changeMenuVisible">åæ¢å¯¼èªæ¾ç¤º</lemon-button> |
| | | <lemon-button @click="changeMenuAvatarVisible" |
| | | >åæ¢å¤´åæ¾ç¤º</lemon-button |
| | | > |
| | | <lemon-button @click="changeMessageNameVisible" |
| | | >忢è天çªå£å
ååæ¾ç¤º</lemon-button |
| | | > |
| | | <lemon-button @click="changeMessageTimeVisible" |
| | | >忢è天çªå£å
æ¶é´æ¾ç¤º</lemon-button |
| | | > |
| | | <lemon-button @click="changeTheme" |
| | | >忢䏻é¢ï¼å½å主é¢ï¼{{ this.theme }}</lemon-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import LemonMessageVoice from "./lemon-message-voice"; |
| | | import EmojiData from "./database/emoji"; |
| | | import { sendWebsocket, closeWebsocket } from "@/websocket/websocket.js"; |
| | | // Vue.component(LemonMessageVoice.name, LemonMessageVoice); |
| | | // è·åæ¶é´ |
| | | const getTime = () => { |
| | | return new Date().getTime(); |
| | | }; |
| | | // éæºid |
| | | const generateRandId = () => { |
| | | return Math.random().toString(36).substr(-8); |
| | | }; |
| | | // éæºå符 |
| | | const generateRandWord = () => { |
| | | return Math.random().toString(36).substr(2); |
| | | }; |
| | | // è·åæ¶æ¯ |
| | | const generateMessage = (toContactId = "", fromUser) => { |
| | | if (!fromUser) { |
| | | fromUser = { |
| | | id: "system", |
| | | displayName: "ç³»ç»æµè¯", |
| | | avatar: "http://upload.qqbodys.com/allimg/1710/1035512943-0.jpg", |
| | | }; |
| | | } |
| | | return { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: getTime(), |
| | | content: generateRandWord(), |
| | | //fileSize: 1231, |
| | | //fileName: "asdasd.doc", |
| | | toContactId, |
| | | fromUser, |
| | | }; |
| | | }; |
| | | export default { |
| | | name: "communication", |
| | | data() { |
| | | return { |
| | | theme: "blue", |
| | | // è系人å³é®æä½ |
| | | contactContextmenu: [ |
| | | { |
| | | text: "å é¤è¯¥è天", |
| | | click: (e, instance, hide) => { |
| | | const { IMUI, contact } = instance; |
| | | IMUI.updateContact({ |
| | | id: contact.id, |
| | | lastContent: null, |
| | | }); |
| | | if (IMUI.currentContactId == contact.id) IMUI.changeContact(null); |
| | | hide(); |
| | | }, |
| | | }, |
| | | { |
| | | text: "è®¾ç½®å¤æ³¨åæ ç¾", |
| | | }, |
| | | { |
| | | text: "æè¯", |
| | | }, |
| | | { |
| | | icon: "lemon-icon-message", |
| | | render: (h, instance, hide) => { |
| | | return ( |
| | | <div style="display:flex;justify-content:space-between;align-items:center;width:130px"> |
| | | <span>å å
¥é»åå</span> |
| | | <span> |
| | | <input type="checkbox" id="switch" /> |
| | | <label id="switch-label" for="switch"> |
| | | Toggle |
| | | </label> |
| | | </span> |
| | | </div> |
| | | ); |
| | | }, |
| | | }, |
| | | { |
| | | click(e, instance, hide) { |
| | | const { IMUI, contact } = instance; |
| | | IMUI.removeContact(contact.id); |
| | | if (IMUI.currentContactId == contact.id) IMUI.changeContact(null); |
| | | hide(); |
| | | }, |
| | | color: "red", |
| | | text: "å é¤å¥½å", |
| | | }, |
| | | ], |
| | | // æ¶æ¯å³é®æä½ |
| | | contextmenu: [ |
| | | { |
| | | click: (e, instance, hide) => { |
| | | const { IMUI, message } = instance; |
| | | const data = { |
| | | id: generateRandId(), |
| | | type: "event", |
| | | //ä½¿ç¨ jsx æ¶ clickå¿
须使ç¨ç®å¤´å½æ°ï¼ä½¿ä¸ä¸æåçå¨vueå
ï¼ |
| | | content: ( |
| | | <div> |
| | | <span> |
| | | ä½ æ¤åäºä¸æ¡æ¶æ¯{" "} |
| | | <span |
| | | v-show={message.type == "text"} |
| | | style="color:#333;cursor:pointer" |
| | | content={message.content} |
| | | on-click={(e) => { |
| | | IMUI.setEditorValue(e.target.getAttribute("content")); |
| | | }} |
| | | > |
| | | éæ°ç¼è¾ |
| | | </span> |
| | | </span> |
| | | </div> |
| | | ), |
| | | |
| | | toContactId: message.toContactId, |
| | | sendTime: getTime(), |
| | | }; |
| | | IMUI.removeMessage(message.id); |
| | | IMUI.appendMessage(data, true); |
| | | hide(); |
| | | }, |
| | | visible: (instance) => { |
| | | return instance.message.fromUser.id == this.user.id; |
| | | }, |
| | | text: "æ¤åæ¶æ¯", |
| | | }, |
| | | { |
| | | visible: (instance) => { |
| | | return instance.message.fromUser.id != this.user.id; |
| | | }, |
| | | text: "举æ¥", |
| | | }, |
| | | { |
| | | text: "转å", |
| | | }, |
| | | { |
| | | visible: (instance) => { |
| | | return instance.message.type == "text"; |
| | | }, |
| | | text: "å¤å¶æå", |
| | | }, |
| | | { |
| | | visible: (instance) => { |
| | | return instance.message.type == "image"; |
| | | }, |
| | | text: "ä¸è½½å¾ç", |
| | | }, |
| | | { |
| | | visible: (instance) => { |
| | | return instance.message.type == "file"; |
| | | }, |
| | | text: "ä¸è½½æä»¶", |
| | | }, |
| | | { |
| | | click: (e, instance, hide) => { |
| | | const { IMUI, message } = instance; |
| | | IMUI.removeMessage(message.id); |
| | | hide(); |
| | | }, |
| | | icon: "lemon-icon-folder", |
| | | color: "red", |
| | | text: "å é¤", |
| | | }, |
| | | ], |
| | | packageData: "", |
| | | hideMenuAvatar: false, |
| | | hideMenu: false, |
| | | hideMessageName: false, |
| | | hideMessageTime: true, |
| | | user: { |
| | | id: "1", |
| | | displayName: "June", |
| | | avatar: "", |
| | | }, |
| | | }; |
| | | }, |
| | | |
| | | created() {}, |
| | | mounted() { |
| | | const contactData1 = { |
| | | id: "contact-1", |
| | | displayName: "å·¥ä½åä½ç¾¤", |
| | | avatar: "http://upload.qqbodys.com/img/weixin/20170804/ji5qxg1am5ztm.jpg", |
| | | index: "[1]群ç»", |
| | | unread: 0, |
| | | lastSendTime: 1566047865417, |
| | | lastContent: "2", |
| | | }; |
| | | const contactData2 = { |
| | | id: "contact-2", |
| | | displayName: "èªå®ä¹å
容", |
| | | avatar: "http://upload.qqbodys.com/img/weixin/20170807/jibfvfd00npin.jpg", |
| | | //index: "Z", |
| | | click(next) { |
| | | next(); |
| | | }, |
| | | renderContainer: () => { |
| | | return <h1 style="text-indent:20px">èªå®ä¹é¡µé¢</h1>; |
| | | }, |
| | | lastSendTime: 1345209465000, |
| | | lastContent: "12312", |
| | | unread: 2, |
| | | }; |
| | | const contactData3 = { |
| | | id: "contact-3", |
| | | displayName: "éç", |
| | | avatar: "http://upload.qqbodys.com/img/weixin/20170803/jiq4nzrkrnd0e.jpg", |
| | | index: "T", |
| | | unread: 32, |
| | | lastSendTime: 3, |
| | | lastContent: "ä½ å¥½123", |
| | | }; |
| | | const contactData4 = { |
| | | id: "contact-4", |
| | | displayName: "å¦è±", |
| | | avatar: |
| | | "https://dss2.bdstatic.com/70cFvnSh_Q1YnxGkpoWK1HF6hhy/it/u=4275424924,2201401076&fm=111&gp=0.jpg", |
| | | index: "", |
| | | unread: 1, |
| | | lastSendTime: 3, |
| | | lastContent: "åé¥äºå", |
| | | }; |
| | | |
| | | const { IMUI } = this.$refs; |
| | | setTimeout(() => { |
| | | IMUI.changeContact("contact-1"); |
| | | }, 500); |
| | | |
| | | IMUI.setLastContentRender("event", (message) => { |
| | | return `[èªå®ä¹éç¥å
容]`; |
| | | }); |
| | | |
| | | let contactList = [ |
| | | { ...contactData1 }, |
| | | { ...contactData2 }, |
| | | { ...contactData3 }, |
| | | //...Array(100).fill(contactData1) |
| | | ]; |
| | | |
| | | IMUI.initContacts(contactList); |
| | | IMUI.initMenus([ |
| | | { |
| | | name: "messages", |
| | | }, |
| | | { |
| | | name: "contacts", |
| | | }, |
| | | { |
| | | name: "custom1", |
| | | title: "èªå®ä¹æé®1", |
| | | unread: 0, |
| | | render: (menu) => { |
| | | return <i class="lemon-icon-attah" />; |
| | | }, |
| | | renderContainer: () => { |
| | | return ( |
| | | <div class="article"> |
| | | <ul> |
| | | <li class="article-item"> |
| | | <h2>äººæ°æ¥æ¥è°ç½çº¢å¸¦è´§ï¼äº§åççå¼å¾ä¹°åï¼</h2> |
| | | </li> |
| | | <li class="article-item"> |
| | | çè夿²³å¿åç5.7级å°é ææªæ¥å°äººå伤亡æ¥å |
| | | </li> |
| | | <li class="article-item"> |
| | | åæ¹å¤å°é£åä»å¼ºæ²å°ç¸ä¼´,ä¸åå
èå¤çå°è¿é¨éª |
| | | </li> |
| | | <li class="article-item"> |
| | | è±è´§è½¦æ¡ï¼è¶åè¦æ¹ééçæ»è
å®¶å±DNA使¯å¯¹ |
| | | </li> |
| | | <li class="article-item"> |
| | | ç¥åè¿éåå¡åºçèç³ååºæ´»è« æå
å
å¹å¤ªéæ |
| | | </li> |
| | | </ul> |
| | | <lemon-contact |
| | | props={{ contact: contactData1 }} |
| | | style="margin:20px" |
| | | /> |
| | | <lemon-contact |
| | | props={{ contact: contactData3 }} |
| | | style="margin:20px" |
| | | /> |
| | | </div> |
| | | ); |
| | | }, |
| | | isBottom: true, |
| | | }, |
| | | { |
| | | name: "custom2", |
| | | title: "èªå®ä¹æé®2", |
| | | unread: 0, |
| | | click: () => { |
| | | alert("æ¦æªå¯¼èªç¹å»äºä»¶"); |
| | | }, |
| | | render: (menu) => { |
| | | return <i class="lemon-icon-group" />; |
| | | }, |
| | | isBottom: true, |
| | | }, |
| | | ]); |
| | | |
| | | IMUI.initEditorTools([ |
| | | { |
| | | name: "emoji", |
| | | }, |
| | | { |
| | | name: "uploadFile", |
| | | }, |
| | | { |
| | | name: "uploadImage", |
| | | }, |
| | | { |
| | | name: "test1", |
| | | click: () => { |
| | | IMUI.$refs.editor.selectFile("application/vnd.ms-excel"); |
| | | }, |
| | | render: () => { |
| | | return <span>Excel</span>; |
| | | }, |
| | | }, |
| | | { |
| | | name: "test1", |
| | | click: () => { |
| | | IMUI.initEditorTools([{ name: "uploadFile" }, { name: "emoji" }]); |
| | | }, |
| | | render: () => { |
| | | return <span>éå¶å·¥å
·æ </span>; |
| | | }, |
| | | }, |
| | | { |
| | | name: "test2", |
| | | isRight: true, |
| | | title: "ä¸ä¼ Excel", |
| | | click: () => { |
| | | alert("ç¹å»äº ··· "); |
| | | }, |
| | | render: () => { |
| | | return <b>···</b>; |
| | | }, |
| | | }, |
| | | ]); |
| | | IMUI.initEmoji(EmojiData); |
| | | |
| | | IMUI.setLastContentRender("voice", (message) => { |
| | | return <span>[è¯é³]</span>; |
| | | }); |
| | | |
| | | const { SimpleIMUI } = this.$refs; |
| | | contactData1.id = "11"; |
| | | SimpleIMUI.initContacts([contactData1]); |
| | | SimpleIMUI.initEmoji(EmojiData); |
| | | SimpleIMUI.changeContact(contactData1.id); |
| | | }, |
| | | methods: { |
| | | changeTheme() { |
| | | this.theme = this.theme == "default" ? "blue" : "default"; |
| | | }, |
| | | scrollToTop() { |
| | | document.body.scrollIntoView(); |
| | | }, |
| | | // ç¹å»å·¦ä¾§å¯¼èªå¤´å触å |
| | | handleMenuAvatarClick() { |
| | | console.log("Event:menu-avatar-click"); |
| | | }, |
| | | // ç¹å»æ¶æ¯è§¦å |
| | | handleMessageClick(e, key, message, instance) { |
| | | console.log("ç¹å»äºæ¶æ¯", e, key, message); |
| | | |
| | | if (key == "status") { |
| | | instance.updateMessage({ |
| | | id: message.id, |
| | | status: "going", |
| | | content: "æ£å¨éæ°åéæ¶æ¯...", |
| | | }); |
| | | setTimeout(() => { |
| | | instance.updateMessage({ |
| | | id: message.id, |
| | | status: "succeed", |
| | | content: "åéæå", |
| | | }); |
| | | }, 2000); |
| | | } |
| | | }, |
| | | // éè导èªå¤´å |
| | | changeMenuAvatarVisible() { |
| | | this.hideMenuAvatar = !this.hideMenuAvatar; |
| | | }, |
| | | // éèå·¦ä¾§å¯¼èª |
| | | changeMenuVisible() { |
| | | this.hideMenu = !this.hideMenu; |
| | | }, |
| | | // æ¯å¦éèè天çªå£è系人åå |
| | | changeMessageNameVisible() { |
| | | this.hideMessageName = !this.hideMessageName; |
| | | }, |
| | | // æ¯å¦éèè天çªå£æ¶æ¯æ¶é´ |
| | | changeMessageTimeVisible() { |
| | | this.hideMessageTime = !this.hideMessageTime; |
| | | }, |
| | | removeMessage() { |
| | | const { IMUI } = this.$refs; |
| | | const messages = IMUI.getCurrentMessages(); |
| | | const id = messages[messages.length - 1].id; |
| | | if (messages.length > 0) { |
| | | IMUI.removeMessage(id); |
| | | } |
| | | }, |
| | | updateMessage() { |
| | | const { IMUI } = this.$refs; |
| | | const messages = IMUI.getCurrentMessages(); |
| | | const message = messages[messages.length - 1]; |
| | | if (messages.length > 0) { |
| | | const update = { |
| | | id: message.id, |
| | | status: "succeed", |
| | | type: "file", |
| | | fileName: "è¢«ä¿®æ¹ææä»¶äº.txt", |
| | | fileSize: "4200000", |
| | | }; |
| | | if (message.type == "event") { |
| | | update.fromUser = this.user; |
| | | } |
| | | IMUI.updateMessage(update); |
| | | IMUI.messageViewToBottom(); |
| | | } |
| | | }, |
| | | appendCustomMessage() { |
| | | const { IMUI } = this.$refs; |
| | | const message = { |
| | | id: generateRandId(), |
| | | status: "succeed", |
| | | type: "voice", |
| | | sendTime: getTime(), |
| | | content: "è¯é³æ¶æ¯", |
| | | params1: "1", |
| | | params2: "2", |
| | | toContactId: "contact-1", |
| | | fromUser: this.user, |
| | | }; |
| | | IMUI.appendMessage(message, true); |
| | | }, |
| | | appendMessage() { |
| | | const { IMUI } = this.$refs; |
| | | const contact = IMUI.currentContact; |
| | | const message = generateMessage("contact-3"); |
| | | message.fromUser = { |
| | | ...message.fromUser, |
| | | ...this.user, |
| | | }; |
| | | IMUI.appendMessage(message, true); |
| | | }, |
| | | appendEventMessage() { |
| | | const { IMUI } = this.$refs; |
| | | const message = { |
| | | id: generateRandId(), |
| | | type: "event", |
| | | content: ( |
| | | <span> |
| | | éè¯·ä½ å å
¥ç¾¤è{" "} |
| | | <span |
| | | style="color:#333;cursor:pointer" |
| | | on-click={() => alert("OK")} |
| | | > |
| | | æ¥å |
| | | </span> |
| | | </span> |
| | | ), |
| | | toContactId: "contact-3", |
| | | sendTime: getTime(), |
| | | }; |
| | | IMUI.appendMessage(message, true); |
| | | }, |
| | | updateContact() { |
| | | this.$refs.IMUI.updateContact({ |
| | | id: "contact-3", |
| | | unread: 10, |
| | | displayName: generateRandWord(), |
| | | lastSendTime: getTime(), |
| | | lastContent: "ä¿®æ¹æµç§°ä¸ºéæºåæ¯", |
| | | }); |
| | | }, |
| | | changeDrawer(contact, instance) { |
| | | instance.changeDrawer({ |
| | | //width: 240, |
| | | //height: "90%", |
| | | //offsetX:0 , |
| | | //offsetY: , |
| | | //position: "center", |
| | | // inside: true, |
| | | // offsetX: -280, |
| | | // offsetY: -100, |
| | | render: () => { |
| | | return ( |
| | | <div class="drawer-content"> |
| | | <p> |
| | | <b>èªå®ä¹æ½å±</b> |
| | | </p> |
| | | <p>{contact.displayName}</p> |
| | | </div> |
| | | ); |
| | | }, |
| | | }); |
| | | }, |
| | | // 左侧è系人ç¹å»è§¦å |
| | | handleChangeContact(contact, instance) { |
| | | // 忢æ¶å
³éwsãå 为æå¯è½wsè¿æ¥æ¥æ¶æ°æ®å°æªå®æï¼ç¨æ·å°±è·³è½¬äºé¡µé¢ |
| | | this.requstWs(); |
| | | console.log("Event:change-contact"); |
| | | console.log(contact, instance); |
| | | instance.updateContact({ |
| | | id: contact.id, |
| | | unread: 0, |
| | | }); |
| | | instance.closeDrawer(); |
| | | }, |
| | | // 建ç«è¿æ¥ |
| | | requstWs() { |
| | | console.log("è¿æ¥"); |
| | | // 鲿¢ç¨æ·å¤æ¬¡è¿ç»ç¹å»å起请æ±ï¼æä»¥è¦å
å
³é䏿¬¡çws请æ±ã |
| | | closeWebsocket(); |
| | | // è·å端ååï¼éè¦ä»ä¹åæ°æ°æ®ç»åå° |
| | | const obj = { |
| | | type: "text", |
| | | content: "å¸å¾å£ç¸ç¸æ°åº¦", |
| | | userId: "1", //æ¥æ¶æ°æ®æ¹ |
| | | }; |
| | | // åèµ·wsè¯·æ± |
| | | sendWebsocket( |
| | | "ws://192.168.1.4:8080/chat?userId=2", |
| | | obj, |
| | | this.wsMessage, |
| | | this.wsError |
| | | ); |
| | | }, |
| | | // æ¥æ¶wsè¿åçæ°æ® |
| | | wsMessage(data) { |
| | | const dataJson = data; |
| | | console.log(dataJson); |
| | | const datas = { |
| | | id: "å¯ä¸æ¶æ¯ID", |
| | | status: "succeed", |
| | | type: "text", |
| | | sendTime: 1566047865417, |
| | | content: "马ä¸å°±å¯¹æ¥å®äºï¼", |
| | | toContactId: 2, |
| | | fromUser: { |
| | | //妿 id == this.user.idæ¶æ¯ä¼æ¾ç¤ºå¨å³ä¾§ï¼å¦åå¨å·¦ä¾§ |
| | | id: 2, |
| | | displayName: "丽å®å¨", |
| | | avatar: "", |
| | | }, |
| | | }; |
| | | // IMUI.appendMessage(data); |
| | | }, |
| | | //wsé误åè° |
| | | wsError(data) { |
| | | console.log(data); |
| | | }, |
| | | // åéæ°æ¶æ¯è§¦å |
| | | handleSend(message, next, file) { |
| | | console.log(message, file); |
| | | console.log(next); |
| | | this.requstWs(); |
| | | setTimeout(() => { |
| | | next(); |
| | | }, 1000); |
| | | }, |
| | | // è·åèç³»äººä¿¡æ¯ææ»å¨å°é¡¶é¨è§¦å |
| | | handlePullMessages(contact, next, instance) { |
| | | console.log(contact, "è·åè系人信æ¯A"); |
| | | console.log(instance, "è·åè系人信æ¯B"); |
| | | console.log(next, "è·åè系人信æ¯C"); |
| | | const otheruser = { |
| | | id: contact.id, |
| | | displayName: contact.displayName, |
| | | avatar: contact.avatar, |
| | | }; |
| | | setTimeout(() => { |
| | | const messages = [ |
| | | generateMessage(instance.currentContactId, this.user), |
| | | generateMessage(instance.currentContactId, otheruser), |
| | | generateMessage(instance.currentContactId, this.user), |
| | | generateMessage(instance.currentContactId, otheruser), |
| | | generateMessage(instance.currentContactId, this.user), |
| | | generateMessage(instance.currentContactId, this.user), |
| | | generateMessage(instance.currentContactId, otheruser), |
| | | { |
| | | ...generateMessage(instance.currentContactId, this.user), |
| | | ...{ status: "failed" }, |
| | | }, |
| | | ]; |
| | | let isEnd = false; |
| | | if ( |
| | | instance.getMessages(instance.currentContactId).length + |
| | | messages.length > |
| | | 11 |
| | | ) |
| | | isEnd = true; |
| | | next(messages, isEnd); |
| | | }, 500); |
| | | }, |
| | | // 左侧导èªå¡åæ¢æ¶é´ |
| | | handleChangeMenu() { |
| | | console.log("Event:change-menu"); |
| | | }, |
| | | openCustomContainer() {}, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | scss ::selection { |
| | | background: #000; |
| | | color: #fff; |
| | | } |
| | | body { |
| | | font-family: "Microsoft YaHei"; |
| | | background: #f6f6f6 !important; |
| | | } |
| | | #app { |
| | | width: 90%; |
| | | margin: 0 auto; |
| | | padding-bottom: 100px; |
| | | .scroll-top { |
| | | cursor: pointer; |
| | | position: fixed; |
| | | bottom: 40px; |
| | | left: 50%; |
| | | border-radius: 50%; |
| | | background: #fff; |
| | | font-size: 18px; |
| | | overflow: hidden; |
| | | width: 40px; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | user-select: none; |
| | | text-align: center; |
| | | transform: rotate(-45deg) translateX(-50%); |
| | | box-shadow: 0 0 30px rgba(0, 0, 0, 0.1); |
| | | &:hover { |
| | | font-size: 22px; |
| | | } |
| | | } |
| | | a { |
| | | color: #0c5ed9; |
| | | text-decoration: none; |
| | | font-size: 12px; |
| | | } |
| | | .action { |
| | | margin-top: 20px; |
| | | .lemon-button { |
| | | margin-right: 10px; |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | .link { |
| | | font-size: 14px; |
| | | margin-top: 15px; |
| | | a { |
| | | display: inline-block; |
| | | margin: 0 5px; |
| | | text-decoration: none; |
| | | background: #ffba00; |
| | | border-radius: 4px; |
| | | padding: 5px 10px; |
| | | color: rgba(0, 0, 0, 0.8); |
| | | } |
| | | } |
| | | .logo { |
| | | position: relative; |
| | | display: inline-block; |
| | | margin: 60px auto; |
| | | user-select: none; |
| | | .logo-text { |
| | | font-size: 38px; |
| | | } |
| | | .logo-sub { |
| | | font-size: 18px; |
| | | color: #999; |
| | | font-weight: 300; |
| | | } |
| | | .logo-badge { |
| | | position: absolute; |
| | | top: -10px; |
| | | left: 230px; |
| | | background: #000; |
| | | border-radius: 16px; |
| | | color: #f9f9f9; |
| | | font-size: 12px; |
| | | padding: 4px 8px; |
| | | } |
| | | } |
| | | .title { |
| | | font-size: 24px; |
| | | line-height: 26px; |
| | | border-left: 1px solid #ffba00; |
| | | padding-left: 15px; |
| | | margin-bottom: 15px; |
| | | margin-top: 30px; |
| | | user-select: none; |
| | | } |
| | | .table { |
| | | width: 100%; |
| | | border-radius: 10px; |
| | | background: #fff; |
| | | border-collapse: collapse; |
| | | tr { |
| | | cursor: pointer; |
| | | } |
| | | tr:not(.table-head):hover { |
| | | background: #ffba00 !important; |
| | | } |
| | | tr:nth-of-type(even) { |
| | | background: #f9f9f9; |
| | | } |
| | | th { |
| | | user-select: none; |
| | | color: #999; |
| | | } |
| | | td, |
| | | th { |
| | | text-align: left; |
| | | padding: 10px 15px; |
| | | font-size: 14px; |
| | | font-weight: normal; |
| | | } |
| | | } |
| | | .imui-center { |
| | | margin-bottom: 60px; |
| | | .lemon-wrapper { |
| | | border: 1px solid #ddd; |
| | | } |
| | | .lemon-drawer { |
| | | border: 1px solid #ddd; |
| | | border-left: 0; |
| | | } |
| | | } |
| | | .drawer-content { |
| | | padding: 15px; |
| | | } |
| | | .more { |
| | | font-size: 12px; |
| | | line-height: 24px; |
| | | height: 24px; |
| | | position: absolute; |
| | | top: 14px; |
| | | right: 14px; |
| | | cursor: pointer; |
| | | user-select: none; |
| | | color: #f1f1f1; |
| | | display: inline-block; |
| | | border-radius: 4px; |
| | | background: #111; |
| | | padding: 0 8px; |
| | | &:active { |
| | | background: #999; |
| | | } |
| | | } |
| | | .bar { |
| | | text-align: center; |
| | | line-height: 30px; |
| | | background: #fff; |
| | | margin: 15px; |
| | | color: #666; |
| | | user-select: none; |
| | | font-size: 12px; |
| | | } |
| | | .cover { |
| | | text-align: center; |
| | | user-select: none; |
| | | position: absolute; |
| | | top: 50%; |
| | | left: 50%; |
| | | transform: translate(-50%, -50%); |
| | | i { |
| | | font-size: 84px; |
| | | color: #e6e6e6; |
| | | } |
| | | p { |
| | | font-size: 18px; |
| | | color: #ddd; |
| | | line-height: 50px; |
| | | } |
| | | } |
| | | .article-item { |
| | | line-height: 34px; |
| | | cursor: pointer; |
| | | &:hover { |
| | | text-decoration: underline; |
| | | color: #318efd; |
| | | } |
| | | } |
| | | pre { |
| | | background: #fff; |
| | | border-radius: 8px; |
| | | padding: 15px; |
| | | } |
| | | } |
| | | .lemon-simple .lemon-container { |
| | | z-index: 5; |
| | | } |
| | | .lemon-simple .lemon-drawer { |
| | | z-index: 4; |
| | | } |
| | | input#switch[type="checkbox"] { |
| | | height: 0; |
| | | width: 0; |
| | | display: none; |
| | | } |
| | | label#switch-label { |
| | | cursor: pointer; |
| | | text-indent: -9999px; |
| | | width: 34px; |
| | | height: 20px; |
| | | background: #aaa; |
| | | display: block; |
| | | border-radius: 100px; |
| | | position: relative; |
| | | } |
| | | label#switch-label:after { |
| | | content: ""; |
| | | position: absolute; |
| | | top: 2px; |
| | | left: 2px; |
| | | width: 16px; |
| | | height: 16px; |
| | | background: #fff; |
| | | border-radius: 20px; |
| | | transition: 0.3s; |
| | | } |
| | | input#switch:checked + label { |
| | | background: #0fd547; |
| | | } |
| | | input#switch:checked + label:after { |
| | | left: calc(100% - 2px); |
| | | transform: translateX(-100%); |
| | | } |
| | | label#switch-label:active:after { |
| | | width: 20px; |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <script> |
| | | export default { |
| | | name: "lemonMessageVoice", |
| | | inheritAttrs: false, |
| | | inject: ["IMUI"], |
| | | render() { |
| | | return ( |
| | | <lemon-message-basic |
| | | class="lemon-message-voice" |
| | | props={{ ...this.$attrs }} |
| | | scopedSlots={{ |
| | | content: (props) => { |
| | | return <span>{props.content} ð</span>; |
| | | }, |
| | | }} |
| | | /> |
| | | ); |
| | | }, |
| | | }; |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | .lemon-message.lemon-message-voice { |
| | | user-select: none; |
| | | |
| | | .lemon-message__content { |
| | | border: 2px solid #000; |
| | | font-size: 12px; |
| | | cursor: pointer; |
| | | |
| | | &::before { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div></div> |
| | | </template> |
| | | |
| | | <script> |
| | | export default { |
| | | data() { |
| | | return {}; |
| | | }, |
| | | |
| | | created() {}, |
| | | |
| | | methods: {}, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped></style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="Questionnairemanagement"> |
| | | <!-- 左侧æ --> |
| | | <div class="sidecolumn"> |
| | | <div class="notebuttom"><i class="el-icon-chat-dot-square" />åçä¿¡</div> |
| | | <div class="notestate"> |
| | | <div class="state-text">çä¿¡ç¶æ</div> |
| | | <div class="state-line"> |
| | | <div class="value-left"> |
| | | <i class="el-icon-chat-dot-square" />å
¨é¨ |
| | | </div> |
| | | <div class="quantityq">22</div> |
| | | </div> |
| | | <div class="state-line"> |
| | | <div class="value-left"> |
| | | <i class="el-icon-chat-dot-square" />åéæå |
| | | </div> |
| | | <div class="quantitycg">22</div> |
| | | </div> |
| | | <div class="state-line"> |
| | | <div class="value-left"> |
| | | <i class="el-icon-chat-dot-square" />åé失败 |
| | | </div> |
| | | <div class="quantitysb">22</div> |
| | | </div> |
| | | <div class="state-line"> |
| | | <div class="value-left"> |
| | | <i class="el-icon-chat-dot-square" />å¾
åé |
| | | </div> |
| | | <div class="quantityd">22</div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!-- å³ä¾§æ°æ® --> |
| | | <div class="leftvlue"> |
| | | <div class="leftvlue-top">ç信详æ
</div> |
| | | <div class="leftvlue-bg"> |
| | | <el-row :gutter="20"> |
| | | <!--ç¨æ·æ°æ®--> |
| | | <el-col :span="24" :xs="24"> |
| | | <el-form |
| | | :model="queryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="98px" |
| | | > |
| | | <el-form-item label="ææºå·" prop="userName"> |
| | | <el-input |
| | | v-model="queryParams.userName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="å建æ¶é´"> |
| | | <el-date-picker |
| | | v-model="dateRange" |
| | | style="width: 240px" |
| | | value-format="yyyy-MM-dd" |
| | | type="daterange" |
| | | range-separator="-" |
| | | start-placeholder="å¼å§æ¥æ" |
| | | end-placeholder="ç»ææ¥æ" |
| | | ></el-date-picker> |
| | | </el-form-item> |
| | | <el-form-item label="çä¿¡ç±»å" prop="status"> |
| | | <el-select v-model="queryParams.status" placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="item in languagelist" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="æä½ç¨æ·" prop="status"> |
| | | <el-select v-model="queryParams.statusa" placeholder="è¯·éæ©"> |
| | | <el-option |
| | | v-for="item in qyoptions" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="medium" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button |
| | | icon="el-icon-refresh" |
| | | size="medium" |
| | | @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="medium" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:user:add']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="medium" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:user:remove']" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | |
| | | <!-- <el-col :span="1.5"> </el-col> --> |
| | | </el-row> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="userList" |
| | | :border="true" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="50" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | align="center" |
| | | key="userId" |
| | | prop="userId" |
| | | /> |
| | | <el-table-column |
| | | label="主æ¨" |
| | | align="center" |
| | | key="userName" |
| | | prop="userName" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="é®é¢ææ¬" |
| | | align="center" |
| | | key="nickName" |
| | | prop="nickName" |
| | | width="400" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="é®é¢è¯é³" |
| | | align="center" |
| | | key="aphonenumber" |
| | | prop="aphonenumber" |
| | | width="400" |
| | | /><el-table-column |
| | | label="å
³èææ " |
| | | align="center" |
| | | key="bphonenumber" |
| | | prop="bphonenumber" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | label="ææ é项" |
| | | align="center" |
| | | key="bphonenumber" |
| | | prop="bphonenumber" |
| | | width="120" |
| | | /> |
| | | <el-table-column |
| | | label="è¯è¨" |
| | | align="center" |
| | | key="indicator" |
| | | prop="indicator" |
| | | width="120" |
| | | /> |
| | | <el-table-column label="æ¯å¦å¯ç¨" align="center" key="status"> |
| | | <template slot-scope="scope"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | | active-value="0" |
| | | inactive-value="1" |
| | | @change="handleStatusChange(scope.row)" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | width="200" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:user:edit']" |
| | | ><span class="button-textxg" |
| | | ><i class="el-icon-edit-outline"></i>ä¿®æ¹</span |
| | | ></el-button |
| | | > |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="compileUpdate(scope.row)" |
| | | v-hasPermi="['system:user:edit']" |
| | | ><span class="button-bji" |
| | | ><i class="el-icon-edit"></i>ç¼è¾çä¿¡</span |
| | | ></el-button |
| | | > |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="handleDelete(scope.row)" |
| | | v-hasPermi="['system:user:remove']" |
| | | ><span class="button-textsc" |
| | | ><i class="el-icon-delete-solid"></i>å é¤</span |
| | | ></el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="queryParams.pageNum" |
| | | :limit.sync="queryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- æ·»å æä¿®æ¹çä¿¡é
ç½®å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="indexopen" |
| | | width="900px" |
| | | append-to-body |
| | | > |
| | | <el-form |
| | | ref="form" |
| | | :model="indexform" |
| | | :rules="rules" |
| | | label-width="100px" |
| | | > |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="è¯è¨" prop="deptId"> |
| | | <el-select |
| | | v-model="indexform.language" |
| | | placeholder="è¯·éæ©è¯è¨" |
| | | > |
| | | <el-option |
| | | v-for="index in languagelist" |
| | | :key="index.value" |
| | | :label="index.label" |
| | | :value="index.value" |
| | | ></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="ç信主æ¨" prop="nickName"> |
| | | <el-input |
| | | v-model="indexform.nickName" |
| | | placeholder="请è¾å
¥ç信主æ¨" |
| | | maxlength="80" |
| | | /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <div |
| | | style="display: flex; margin-left: 100px; margin-bottom: 10px" |
| | | > |
| | | <div class="tsgname" @click="tsgnameto()">å»é¢åç§°</div> |
| | | <div class="tsgname" @click="tsgnameto()">å»é¢çµè¯</div> |
| | | <div class="tsgname" @click="tsgnameto()">å»é¢å§å</div> |
| | | <div class="tsgname" @click="tsgnameto()">é访å§å</div> |
| | | <div class="tsgname" @click="tsgnameto()">é访çµè¯</div> |
| | | <div class="tsgname" @click="tsgnameto()">æ§å«</div> |
| | | <div class="tsgname" @click="tsgnameto()">å¹´é¾</div> |
| | | <div class="tsgname" @click="tsgnameto()">å°å</div> |
| | | </div> |
| | | </el-col></el-row |
| | | > |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="çä¿¡ææ¬" prop="verbaltricktext"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="çä¿¡è¯é³" prop="verbaltrickyy"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ å¹é
ææ¬" prop="matchtext"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ å¹é
è¯é³" prop="matchyy"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ å£°ææ¬" prop="silenttext"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ 声è¯é³" prop="silentyy"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éç¨åºææ¬" prop="librarytext"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="éç¨åºè¯é³" prop="libraryy"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å¬ä¸æ¸
ææ¬" prop="vaguetext"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="å¬ä¸æ¸
è¯é³" prop="vagueyy"> |
| | | <el-input v-model="indexform.userName" maxlength="30" /> |
| | | </el-form-item> </el-col |
| | | ></el-row> |
| | | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="çä¿¡è§å" prop="email"> |
| | | <el-input |
| | | v-model="indexform.remark" |
| | | type="textarea" |
| | | placeholder="请è¾å
¥å
容" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="æ¯å¦å¯ç¨"> |
| | | <el-radio-group v-model="indexform.qystatus"> |
| | | <el-radio |
| | | v-for="item in qyoptions" |
| | | :key="item.value" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨"> |
| | | <el-input |
| | | v-model="indexform.remark" |
| | | type="textarea" |
| | | placeholder="请è¾å
¥å
容" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </div> |
| | | <!-- æ·»å ç±»å«å¼¹æ¡ --> |
| | | <el-dialog |
| | | :title="amendtag ? 'ä¿®æ¹ç±»å«' : 'æ°å¢ç±»å«'" |
| | | width="30%" |
| | | :visible.sync="dialogFormVisible" |
| | | > |
| | | <el-form :model="classifyform"> |
| | | <el-form-item |
| | | :label="amendtag ? '请è¾å
¥æ°çç±»å«åç§°' : '请è¾å
¥ç±»å«åç§°'" |
| | | > |
| | | <el-input |
| | | v-model="classifyform.categoryname" |
| | | autocomplete="off" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button @click="dialogFormVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="submitsidecolumn">ç¡® å®</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | <!-- å é¤ç±»å«ç¡®è®¤æ¡ --> |
| | | <el-dialog title="è¦å" :visible.sync="deleteVisible" width="40%"> |
| | | <div style="font-size: 20px; color: rgb(247, 76, 76)"> |
| | | æ¯å¦ç¡®è®¤å é¤åç±»ï¼[<span>{{ deletefenl }}</span |
| | | >]? |
| | | </div> |
| | | <div style="font-size: 20px"> |
| | | æ¤æä½ä¼å°è¯¥ç±»å«ä¸æææ¨¡å转移è³[æªåç±»]ï¼æ¯å¦ç»§ç»å 餿¤åç±»ï¼ |
| | | </div> |
| | | <span slot="footer" class="dialog-footer"> |
| | | <el-button @click="deleteVisible = false">å æ¶</el-button> |
| | | <el-button type="primary" @click="deletefenlei">ç¡® å®</el-button> |
| | | </span> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | listUser, |
| | | getUser, |
| | | delUser, |
| | | addUser, |
| | | updateUser, |
| | | } from "@/api/system/user"; |
| | | import { getToken } from "@/utils/auth"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | export default { |
| | | name: "questionnaire", |
| | | dicts: ["sys_normal_disable", "sys_user_sex"], |
| | | components: { Treeselect }, |
| | | data() { |
| | | return { |
| | | topactiveName: "Local", //é¡¶é¨éæ© |
| | | // é®ç½©å± |
| | | loading: false, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | namequestionnaire: "", |
| | | haoquestionnaire: "", |
| | | idds: "", |
| | | amendtag: false, //æ¯å¦ä¿®æ¹ç±»å« |
| | | dialogFormVisible: false, //ä¿®æ¹æ·»å ç±»å«å¼¹æ¡ |
| | | deleteVisible: false, //åç±»å é¤å¼¹æ¡ |
| | | deletefenl: "é«è¡å", //å é¤é¡¹ |
| | | classifyform: { |
| | | categoryname: "", |
| | | }, //ç±»å«è¡¨å |
| | | // è¡¨æ ¼æ°æ® |
| | | userList: [ |
| | | { |
| | | userid: 1, |
| | | userName: "è¡å¸¸è§ã尿常è§", |
| | | nickName: "è´«è¡", |
| | | aphonenumber: "(?!ä¸.*|没.*|æª.*)^.*([è´«å¹³åè¡]|è´«è¡|è¯å¦|è¯å¦),10", |
| | | bphonenumber: "éæ©", |
| | | cphonenumber: "æ®éè¯", |
| | | status: "0", |
| | | }, |
| | | ], |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºå¼¹åºå± |
| | | open: false, |
| | | // æ¥æèå´ |
| | | dateRange: [], |
| | | // å²ä½é项 |
| | | postOptions: [], |
| | | // è§è²é项 |
| | | roleOptions: [], |
| | | // æ·»å ãä¿®æ¹åæ° |
| | | indexform: {}, |
| | | numberlb: 22, |
| | | numberlbs: 2, |
| | | sidecolumnform: {}, //æ·»å ç±»å«è¡¨å |
| | | dialogFormVisible: false, //æ·»å ç±»å«å¼¹æ¡ |
| | | sidecolumnval: "", //ç±»å«æç´¢ |
| | | indexopen: false, //å¼¹æ¡å±ç¤ºå¦ |
| | | propss: { multiple: true }, |
| | | languagelist: [ |
| | | { |
| | | value: 1, |
| | | label: "å
¨é¨", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "åºé¢ç
æ
é访", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "è¯é³é访åçä¿¡", |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: "å»çé访åçä¿¡", |
| | | }, |
| | | ], //è¯è¨å表 |
| | | qyoptions: [ |
| | | { |
| | | value: 1, |
| | | label: "å¯ç¨", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "å
³é", |
| | | }, |
| | | ], |
| | | //ç±»å«å表 |
| | | editableTabs: [ |
| | | { |
| | | title: "çä¿¡åç±»ä¸", |
| | | number: "1", |
| | | }, |
| | | { |
| | | title: "çä¿¡åç±»äº", |
| | | number: "2", |
| | | }, |
| | | { |
| | | title: "çä¿¡åç±»ä¸", |
| | | number: "2", |
| | | }, |
| | | { |
| | | title: "çä¿¡åç±»å", |
| | | number: "2", |
| | | }, |
| | | { |
| | | title: "çä¿¡åç±»äº", |
| | | number: "2", |
| | | }, |
| | | ], |
| | | // æ¥è¯¢åæ° |
| | | queryParams: { |
| | | pageNum: 1, |
| | | pageSize: 10, |
| | | userName: undefined, |
| | | phonenumber: undefined, |
| | | status: undefined, |
| | | deptId: undefined, |
| | | IDnumber: undefined, |
| | | }, |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | userName: [ |
| | | { required: true, message: "主æ¨ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 20, |
| | | message: "ç¨æ·åç§°é¿åº¦å¿
é¡»ä»äº 2 å 20 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | nickName: [ |
| | | { required: true, message: "ç¨æ·æµç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | password: [ |
| | | { required: true, message: "ç¨æ·å¯ç ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 5, |
| | | max: 20, |
| | | message: "ç¨æ·å¯ç é¿åº¦å¿
é¡»ä»äº 5 å 20 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | email: [ |
| | | { |
| | | type: "email", |
| | | message: "请è¾å
¥æ£ç¡®çé®ç®±å°å", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | phonenumber: [ |
| | | { |
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
| | | message: "请è¾å
¥æ£ç¡®çææºå·ç ", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | IDnumber: [ |
| | | { |
| | | pattern: |
| | | /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/, |
| | | message: "请è¾å
¥æ£ç¡®ç身份è¯å·ç ", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | watch: {}, |
| | | created() { |
| | | this.getList(); |
| | | }, |
| | | |
| | | methods: { |
| | | /** æ¥è¯¢ç¨æ·å表 */ |
| | | getList() { |
| | | // this.loading = true; |
| | | listUser().then((response) => { |
| | | console.log(response); |
| | | console.log(this.userList); |
| | | }); |
| | | }, |
| | | // æ·»å ãä¿®æ¹ç±»å« |
| | | submitsidecolumn() { |
| | | if (this.amendtag) { |
| | | this.classifyform.tagcategoryid = this.idds; |
| | | // toamendtagcategory(this.addDateRange(this.classifyform)).then( |
| | | // (response) => { |
| | | // console.log(response); |
| | | // this.gitclasify(); |
| | | // } |
| | | // ); |
| | | } else { |
| | | // addtagcategory(this.addDateRange(this.classifyform)).then( |
| | | // (response) => { |
| | | // console.log(response); |
| | | // this.gitclasify(); |
| | | // } |
| | | // ); |
| | | } |
| | | this.classifyform = { |
| | | categoryname: "", |
| | | }; |
| | | this.idds = ""; |
| | | this.dialogFormVisible = false; |
| | | }, |
| | | //å é¤åç±» |
| | | deletefenlei(row) { |
| | | if (this.deleteVisible) { |
| | | // deletetagcategory(this.idds).then((response) => { |
| | | // console.log(response); |
| | | // this.gitclasify(); |
| | | // }); |
| | | this.deleteVisible = false; |
| | | this.idds = ""; |
| | | } else { |
| | | this.deleteVisible = true; |
| | | this.idds = row.tagcategoryid; |
| | | this.deletefenl = row.title; |
| | | } |
| | | }, |
| | | compileUpdate(row) { |
| | | this.$router.push({ |
| | | path: "/repositoryai/verbaltrick/particulars/", |
| | | query: { id: "1" }, |
| | | }); |
| | | }, |
| | | // é¢ç®ç¶æä¿®æ¹ |
| | | handleStatusChange(row) { |
| | | let text = row.status === "0" ? "å¯ç¨" : "åç¨"; |
| | | this.$modal |
| | | .confirm('确认è¦"' + text + '""' + row.userName + '"ç¨æ·åï¼') |
| | | .then(function () { |
| | | return changeUserStatus(row.userId, row.status); |
| | | }) |
| | | .then(() => { |
| | | this.$modal.msgSuccess(text + "æå"); |
| | | }) |
| | | .catch(function () { |
| | | row.status = row.status === "0" ? "1" : "0"; |
| | | }); |
| | | }, |
| | | //æç´¢ç±»å« |
| | | sidecolumnss() {}, |
| | | // ä¾¿æ·æ ç¾ |
| | | tsgnameto() {}, |
| | | // 忢å
±äº«/æ¬å° |
| | | tophandleClick() {}, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.indexopen = false; |
| | | this.reset(); |
| | | }, |
| | | |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | userId: undefined, |
| | | deptId: undefined, |
| | | userName: undefined, |
| | | nickName: undefined, |
| | | password: undefined, |
| | | phonenumber: undefined, |
| | | email: undefined, |
| | | sex: undefined, |
| | | status: "0", |
| | | remark: undefined, |
| | | postIds: [], |
| | | roleIds: [], |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.queryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.dateRange = []; |
| | | this.resetForm("queryForm"); |
| | | this.queryParams.deptId = undefined; |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map((item) => item.userId); |
| | | this.single = selection.length != 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.title = "æ°å¢çä¿¡"; |
| | | this.indexopen = true; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | this.title = "ä¿®æ¹çä¿¡"; |
| | | this.indexopen = true; |
| | | }, |
| | | // ä¿®æ¹åç±»å¼¹æ¡ |
| | | popoveramend(tagcategoryid) { |
| | | this.idds = tagcategoryid; |
| | | this.amendtag = true; |
| | | this.dialogFormVisible = true; |
| | | }, |
| | | |
| | | /** æ´æ°/ä¿®æ¹æäº¤æé® */ |
| | | submitForm: function () { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.form.userId != undefined) { |
| | | updateUser(this.form).then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.indexopen = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addUser(this.form).then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.indexopen = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const userIds = row.userId || this.ids; |
| | | this.$modal |
| | | .confirm('æ¯å¦ç¡®è®¤å é¤ç¨æ·ç¼å·ä¸º"' + userIds + '"çæ°æ®é¡¹ï¼') |
| | | .then(function () { |
| | | return delUser(userIds); |
| | | }) |
| | | .then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .Questionnairemanagement { |
| | | display: flex; |
| | | } |
| | | .sidecolumn { |
| | | width: 300px; |
| | | min-height: 100vh; |
| | | text-align: center; |
| | | // display: flex; |
| | | margin-top: 20px; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #edf1f7; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | .sidecolumn-top { |
| | | display: flex; |
| | | justify-content: space-between; |
| | | .top-wj { |
| | | font-size: 20px; |
| | | } |
| | | .top-tj { |
| | | font-size: 18px; |
| | | |
| | | color: rgb(0, 89, 255); |
| | | cursor: pointer; |
| | | } |
| | | } |
| | | .center-ss { |
| | | margin-top: 30px; |
| | | .input-with-select { |
| | | height: 40px !important; |
| | | } |
| | | } |
| | | .bottom-fl { |
| | | margin-top: 30px; |
| | | display: center !important; |
| | | } |
| | | } |
| | | .qrcode-dialo { |
| | | text-align: center; |
| | | // display: flex; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #edf1f7; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | .qrcode-text { |
| | | font-size: 20px; |
| | | span { |
| | | margin-left: 20px; |
| | | } |
| | | } |
| | | .qrcode-img { |
| | | width: 300px; |
| | | height: 400px; |
| | | } |
| | | } |
| | | .tsgname { |
| | | width: 90px; |
| | | margin-right: 10px; |
| | | text-align: center; |
| | | cursor: pointer; |
| | | height: 40px; |
| | | line-height: 40px; |
| | | background: #7799fa; |
| | | color: #ffff; |
| | | font-size: 18px; |
| | | border-radius: 5px; |
| | | } |
| | | .tsgname:hover { |
| | | background: #3366f5; |
| | | } |
| | | ::v-deep.el-tabs--left, |
| | | .el-tabs--right { |
| | | overflow: hidden; |
| | | align-items: center; |
| | | display: flex; |
| | | } |
| | | ::v-deep.el-input--medium .el-input__inner { |
| | | height: 40px !important; |
| | | } |
| | | ::v-deep.el-tabs--right .el-tabs__active-bar.is-right { |
| | | height: 40px; |
| | | width: 5px; |
| | | left: 0; |
| | | } |
| | | ::v-deep.el-tabs--right .el-tabs__item.is-right { |
| | | display: block; |
| | | font-size: 20px; |
| | | } |
| | | .leftvlue { |
| | | // display: flex; |
| | | // flex: 1; |
| | | width: 80%; |
| | | margin-top: 20px; |
| | | // margin: 20px; |
| | | padding: 30px; |
| | | background: #ffff; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | .mulsz { |
| | | font-size: 20px; |
| | | } |
| | | } |
| | | .button-text { |
| | | color: rgb(70, 204, 238); |
| | | } |
| | | .button-bji { |
| | | color: rgb(39, 167, 67); |
| | | } |
| | | .button-textxg { |
| | | color: rgb(35, 81, 233); |
| | | } |
| | | .button-textsc { |
| | | color: rgb(235, 23, 23); |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <el-row :gutter="20"> |
| | | <!--ç¨æ·æ°æ®--> |
| | | <el-col :span="24" :xs="24"> |
| | | <el-form |
| | | :model="topqueryParams" |
| | | ref="queryForm" |
| | | size="small" |
| | | :inline="true" |
| | | v-show="showSearch" |
| | | label-width="98px" |
| | | > |
| | | <el-form-item label="æ ç¾åç§°" prop="userName"> |
| | | <el-input |
| | | v-model="topqueryParams.userName" |
| | | placeholder="请è¾å
¥" |
| | | clearable |
| | | style="width: 200px" |
| | | @keyup.enter.native="handleQuery" |
| | | /> |
| | | </el-form-item> |
| | | |
| | | <el-form-item> |
| | | <el-button |
| | | type="primary" |
| | | icon="el-icon-search" |
| | | size="medium" |
| | | @click="handleQuery" |
| | | >æç´¢</el-button |
| | | > |
| | | <el-button icon="el-icon-refresh" size="medium" @click="resetQuery" |
| | | >éç½®</el-button |
| | | > |
| | | </el-form-item> |
| | | </el-form> |
| | | <el-divider></el-divider> |
| | | <el-row :gutter="10" class="mb8"> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="primary" |
| | | plain |
| | | icon="el-icon-plus" |
| | | size="medium" |
| | | @click="handleAdd" |
| | | v-hasPermi="['system:user:add']" |
| | | >æ°å¢</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="success" |
| | | plain |
| | | icon="el-icon-edit" |
| | | size="medium" |
| | | :disabled="single" |
| | | @click="handleUpdate" |
| | | v-hasPermi="['system:user:edit']" |
| | | >ä¿®æ¹</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="1.5"> |
| | | <el-button |
| | | type="danger" |
| | | plain |
| | | icon="el-icon-delete" |
| | | size="medium" |
| | | :disabled="multiple" |
| | | @click="handleDelete" |
| | | v-hasPermi="['system:user:remove']" |
| | | >å é¤</el-button |
| | | > |
| | | </el-col> |
| | | <el-col :span="19"> |
| | | <div class="documentf"> |
| | | <div class="document"> |
| | | <el-button |
| | | type="warning" |
| | | plain |
| | | icon="el-icon-download" |
| | | size="medium" |
| | | @click="handleExport" |
| | | v-hasPermi="['system:user:export']" |
| | | >导åº</el-button |
| | | > |
| | | </div> |
| | | </div> |
| | | </el-col> |
| | | <!-- <el-col :span="1.5"> </el-col> --> |
| | | </el-row> |
| | | <!-- <right-toolbar |
| | | :showSearch.sync="showSearch" |
| | | @queryTable="getList" |
| | | :columns="columns" |
| | | ></right-toolbar> --> |
| | | <el-table |
| | | v-loading="loading" |
| | | :data="userList" |
| | | @selection-change="handleSelectionChange" |
| | | > |
| | | <el-table-column type="selection" width="50" align="center" /> |
| | | <el-table-column |
| | | label="åºå·" |
| | | align="center" |
| | | key="userId" |
| | | prop="userId" |
| | | /> |
| | | |
| | | <el-table-column |
| | | label="æ ç¾åç§°" |
| | | align="center" |
| | | key="userName" |
| | | prop="userName" |
| | | :show-overflow-tooltip="true" |
| | | /> |
| | | <el-table-column |
| | | label="è´¦å·" |
| | | align="center" |
| | | key="types" |
| | | prop="types" |
| | | /> |
| | | <el-table-column |
| | | label="å¯ç " |
| | | align="center" |
| | | key="nickName" |
| | | prop="nickName" |
| | | /> |
| | | <el-table-column |
| | | label="夿³¨" |
| | | align="center" |
| | | key="phonenumber" |
| | | prop="phonenumber" |
| | | width="120" |
| | | /> |
| | | <el-table-column label="æ¯å¦å¯ç¨" align="center" key="status"> |
| | | <template slot-scope="scope"> |
| | | <el-switch |
| | | v-model="scope.row.status" |
| | | active-value="0" |
| | | inactive-value="1" |
| | | @change="handleStatusChange(scope.row)" |
| | | ></el-switch> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æè¿æ´æ°æ¥æ" |
| | | align="center" |
| | | prop="createTime" |
| | | width="160" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <span>{{ parseTime(scope.row.createTime) }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="æä½" |
| | | align="center" |
| | | width="160" |
| | | class-name="small-padding fixed-width" |
| | | > |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="handleUpdate(scope.row)" |
| | | v-hasPermi="['system:user:edit']" |
| | | >ç¼è¾</el-button |
| | | > |
| | | <el-button |
| | | size="medium" |
| | | type="text" |
| | | @click="handleDelete(scope.row)" |
| | | ><span style="color: rgb(236, 55, 55)" |
| | | ><i class="el-icon-delete-solid"></i>å é¤</span |
| | | ></el-button |
| | | > |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <pagination |
| | | v-show="total > 0" |
| | | :total="total" |
| | | :page.sync="topqueryParams.pageNum" |
| | | :limit.sync="topqueryParams.pageSize" |
| | | @pagination="getList" |
| | | /> |
| | | </el-col> |
| | | </el-row> |
| | | |
| | | <!-- æ·»å æä¿®æ¹æ ç¾é
ç½®å¯¹è¯æ¡ --> |
| | | <el-dialog |
| | | :title="title" |
| | | :visible.sync="addalteropen" |
| | | width="900px" |
| | | append-to-body |
| | | > |
| | | <el-form ref="form" :model="form" :rules="rules" label-width="100px"> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ ç¾åç§°" prop="nickName"> |
| | | <el-input |
| | | v-model="form.nickName" |
| | | placeholder="请è¾å
¥" |
| | | maxlength="30" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="çä¿¡å¹³å°è´¦å·" prop="email"> |
| | | <el-input |
| | | v-model="form.nickName" |
| | | placeholder="请è¾å
¥" |
| | | maxlength="30" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="çä¿¡å¹³å°å¯ç " prop="email"> |
| | | <el-input |
| | | v-model="form.nickName" |
| | | placeholder="请è¾å
¥" |
| | | maxlength="30" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="12"> |
| | | <el-form-item label="æ¯å¦å¯ç¨"> |
| | | <el-radio-group v-model="form.qystatus"> |
| | | <el-radio |
| | | v-for="item in qyoptions" |
| | | :key="item.value" |
| | | :label="item.value" |
| | | >{{ item.label }}</el-radio |
| | | > |
| | | </el-radio-group> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row> |
| | | <el-col :span="24"> |
| | | <el-form-item label="夿³¨"> |
| | | <el-input |
| | | v-model="form.remark" |
| | | type="textarea" |
| | | placeholder="请è¾å
¥å
容" |
| | | ></el-input> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </el-form> |
| | | <div slot="footer" class="dialog-footer"> |
| | | <el-button type="primary" @click="submitForm">ç¡® å®</el-button> |
| | | <el-button @click="cancel">å æ¶</el-button> |
| | | </div> |
| | | </el-dialog> |
| | | </div> |
| | | </template> |
| | | |
| | | <script> |
| | | import { |
| | | listUser, |
| | | getUser, |
| | | delUser, |
| | | addUser, |
| | | updateUser, |
| | | resetUserPwd, |
| | | changeUserStatus, |
| | | } from "@/api/system/user"; |
| | | import Treeselect from "@riophae/vue-treeselect"; |
| | | import "@riophae/vue-treeselect/dist/vue-treeselect.css"; |
| | | |
| | | export default { |
| | | name: "User", |
| | | dicts: ["sys_normal_disable", "sys_user_sex"], |
| | | components: { Treeselect }, |
| | | data() { |
| | | return { |
| | | // é®ç½©å± |
| | | loading: true, |
| | | // é䏿°ç» |
| | | ids: [], |
| | | // éå个ç¦ç¨ |
| | | single: true, |
| | | // éå¤ä¸ªç¦ç¨ |
| | | multiple: true, |
| | | // æ¾ç¤ºæç´¢æ¡ä»¶ |
| | | showSearch: true, |
| | | // æ»æ¡æ° |
| | | total: 0, |
| | | // ç¨æ·è¡¨æ ¼æ°æ® |
| | | userList: null, |
| | | // å¼¹åºå±æ é¢ |
| | | title: "", |
| | | // æ¯å¦æ¾ç¤ºä¿®æ¹ãæ·»å å¼¹åºå± |
| | | addalteropen: false, |
| | | // é¨é¨åç§° |
| | | deptName: undefined, |
| | | // é»è®¤å¯ç |
| | | initPassword: undefined, |
| | | // æ¥æèå´ |
| | | dateRange: [], |
| | | // å²ä½é项 |
| | | postOptions: [], |
| | | // è§è²é项 |
| | | roleOptions: [], |
| | | dynamicTags: ["é项ä¸", "é项äº", "é项ä¸"], //é项 |
| | | inputVisible: false, |
| | | inputValue: "", |
| | | previewVisible: false, //æ ç¾é¢è§å¼¹æ¡ |
| | | radio: "", |
| | | radios: [], |
| | | previewtype: 2, //é¢è§æ ç¾ç±»å |
| | | total: 0, // æ»æ¡æ° |
| | | ImportQuantity: 999, //导æ ç¾æ°é |
| | | //é¢è§æ ç¾ä¿¡æ¯ |
| | | previewvalue: { |
| | | username: "è¿ä¸ªå»çå¯¹ä½ æä¹æ ·", |
| | | }, |
| | | // 表ååæ° |
| | | form: { |
| | | phonenumber: "", |
| | | totagid: "", |
| | | types: "", |
| | | nickName: "", |
| | | qystatus: "", |
| | | btstatus: "", |
| | | }, |
| | | |
| | | // æ¥è¯¢åæ° |
| | | topqueryParams: { |
| | | pageNum: 1, |
| | | }, |
| | | propss: { multiple: true }, |
| | | optionss: [ |
| | | { |
| | | value: 1, |
| | | label: "ä¸å", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "西å", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "仨仨仨", |
| | | }, |
| | | { |
| | | value: 4, |
| | | label: "å
é£é£é£", |
| | | }, |
| | | ], |
| | | qyoptions: [ |
| | | { |
| | | value: 1, |
| | | label: "å¯ç¨", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "å
³é", |
| | | }, |
| | | ], |
| | | btoptions: [ |
| | | { |
| | | value: 1, |
| | | label: "å¿
å¡«", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "éå¿
å¡«", |
| | | }, |
| | | ], |
| | | topicoptions: [ |
| | | { |
| | | value: 1, |
| | | label: "åé", |
| | | }, |
| | | { |
| | | value: 2, |
| | | label: "å¤é", |
| | | }, |
| | | { |
| | | value: 3, |
| | | label: "填空", |
| | | }, |
| | | ], |
| | | // è¡¨åæ ¡éª |
| | | rules: { |
| | | userName: [ |
| | | { required: true, message: "ç¨æ·åç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 2, |
| | | max: 20, |
| | | message: "ç¨æ·åç§°é¿åº¦å¿
é¡»ä»äº 2 å 20 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | nickName: [ |
| | | { required: true, message: "ç¨æ·æµç§°ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | ], |
| | | password: [ |
| | | { required: true, message: "ç¨æ·å¯ç ä¸è½ä¸ºç©º", trigger: "blur" }, |
| | | { |
| | | min: 5, |
| | | max: 20, |
| | | message: "ç¨æ·å¯ç é¿åº¦å¿
é¡»ä»äº 5 å 20 ä¹é´", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | email: [ |
| | | { |
| | | type: "email", |
| | | message: "请è¾å
¥æ£ç¡®çé®ç®±å°å", |
| | | trigger: ["blur", "change"], |
| | | }, |
| | | ], |
| | | phonenumber: [ |
| | | { |
| | | pattern: /^1[3|4|5|6|7|8|9][0-9]\d{8}$/, |
| | | message: "请è¾å
¥æ£ç¡®çææºå·ç ", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | IDnumber: [ |
| | | { |
| | | pattern: |
| | | /^\d{6}((((((19|20)\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|(((19|20)\d{2})(0[13578]|1[02])31)|((19|20)\d{2})02(0[1-9]|1\d|2[0-8])|((((19|20)([13579][26]|[2468][048]|0[48]))|(2000))0229))\d{3})|((((\d{2})(0[13-9]|1[012])(0[1-9]|[12]\d|30))|((\d{2})(0[13578]|1[02])31)|((\d{2})02(0[1-9]|1\d|2[0-8]))|(([13579][26]|[2468][048]|0[048])0229))\d{2}))(\d|X|x)$/, |
| | | message: "请è¾å
¥æ£ç¡®ç身份è¯å·ç ", |
| | | trigger: "blur", |
| | | }, |
| | | ], |
| | | }, |
| | | }; |
| | | }, |
| | | watch: {}, |
| | | created() { |
| | | this.getList(); |
| | | this.getConfigKey("sys.user.initPassword").then((response) => { |
| | | this.initPassword = response.msg; |
| | | }); |
| | | }, |
| | | methods: { |
| | | /** æ¥è¯¢æ ç¾å表 */ |
| | | getList() { |
| | | this.loading = true; |
| | | listUser(this.addDateRange(this.topqueryParams, this.dateRange)).then( |
| | | (response) => { |
| | | this.userList = response.rows; |
| | | this.total = response.total; |
| | | this.loading = false; |
| | | } |
| | | ); |
| | | }, |
| | | |
| | | // æ ç¾ç¶æä¿®æ¹ |
| | | handleStatusChange(row) { |
| | | let text = row.status === "0" ? "å¯ç¨" : "åç¨"; |
| | | this.$modal |
| | | .confirm('确认è¦"' + text + '""' + row.userName + '"ç¨æ·åï¼') |
| | | .then(function () { |
| | | return changeUserStatus(row.userId, row.status); |
| | | }) |
| | | .then(() => { |
| | | this.$modal.msgSuccess(text + "æå"); |
| | | }) |
| | | .catch(function () { |
| | | row.status = row.status === "0" ? "1" : "0"; |
| | | }); |
| | | }, |
| | | // åæ¶æé® |
| | | cancel() { |
| | | this.addalteropen = false; |
| | | this.reset(); |
| | | }, |
| | | // 表åéç½® |
| | | reset() { |
| | | this.form = { |
| | | userId: undefined, |
| | | deptId: undefined, |
| | | userName: undefined, |
| | | nickName: undefined, |
| | | password: undefined, |
| | | phonenumber: undefined, |
| | | email: undefined, |
| | | sex: undefined, |
| | | status: "0", |
| | | remark: undefined, |
| | | postIds: [], |
| | | roleIds: [], |
| | | }; |
| | | this.resetForm("form"); |
| | | }, |
| | | /** æç´¢æé®æä½ */ |
| | | handleQuery() { |
| | | this.topqueryParams.pageNum = 1; |
| | | this.getList(); |
| | | }, |
| | | /** éç½®æé®æä½ */ |
| | | resetQuery() { |
| | | this.dateRange = []; |
| | | this.resetForm("queryForm"); |
| | | this.topqueryParams.deptId = undefined; |
| | | this.$refs.tree.setCurrentKey(null); |
| | | this.handleQuery(); |
| | | }, |
| | | // å¤éæ¡é䏿°æ® |
| | | handleSelectionChange(selection) { |
| | | this.ids = selection.map((item) => item.userId); |
| | | this.single = selection.length != 1; |
| | | this.multiple = !selection.length; |
| | | }, |
| | | //å é¤é项 |
| | | handleClose(tag) { |
| | | this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1); |
| | | }, |
| | | //è§¦åæ°å¢è¾å
¥ |
| | | showInput() { |
| | | this.inputVisible = true; |
| | | this.$nextTick((_) => { |
| | | this.$refs.saveTagInput.$refs.input.focus(); |
| | | }); |
| | | }, |
| | | //è·å失å»ç¦ç¹è§¦å |
| | | handleInputConfirm() { |
| | | let inputValue = this.inputValue; |
| | | if (inputValue) { |
| | | this.dynamicTags.push(inputValue); |
| | | } |
| | | this.inputVisible = false; |
| | | this.inputValue = ""; |
| | | }, |
| | | /** æ°å¢æé®æä½ */ |
| | | handleAdd() { |
| | | this.reset(); |
| | | this.title = "æ°å¢æ ç¾"; |
| | | this.addalteropen = true; |
| | | }, |
| | | /** ä¿®æ¹æé®æä½ */ |
| | | handleUpdate(row) { |
| | | this.reset(); |
| | | this.title = "ä¿®æ¹æ ç¾"; |
| | | this.addalteropen = true; |
| | | // const userId = row.userId || this.ids; |
| | | // getUser(userId).then((response) => { |
| | | // this.form = response.data; |
| | | // this.postOptions = response.posts; |
| | | // this.roleOptions = response.roles; |
| | | // this.$set(this.form, "postIds", response.postIds); |
| | | // this.$set(this.form, "roleIds", response.roleIds); |
| | | // this.addalteropen = true; |
| | | // this.form.password = ""; |
| | | // }); |
| | | }, |
| | | /** éç½®å¯ç æé®æä½ */ |
| | | handleResetPwd(row) { |
| | | this.$prompt('请è¾å
¥"' + row.userName + '"çæ°å¯ç ', "æç¤º", { |
| | | confirmButtonText: "ç¡®å®", |
| | | cancelButtonText: "åæ¶", |
| | | closeOnClickModal: false, |
| | | inputPattern: /^.{5,20}$/, |
| | | inputErrorMessage: "ç¨æ·å¯ç é¿åº¦å¿
é¡»ä»äº 5 å 20 ä¹é´", |
| | | }) |
| | | .then(({ value }) => { |
| | | resetUserPwd(row.userId, value).then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æåï¼æ°å¯ç æ¯ï¼" + value); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | |
| | | /** æäº¤æé® */ |
| | | submitForm: function () { |
| | | this.$refs["form"].validate((valid) => { |
| | | if (valid) { |
| | | if (this.form.userId != undefined) { |
| | | updateUser(this.form).then((response) => { |
| | | this.$modal.msgSuccess("ä¿®æ¹æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } else { |
| | | addUser(this.form).then((response) => { |
| | | this.$modal.msgSuccess("æ°å¢æå"); |
| | | this.open = false; |
| | | this.getList(); |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | /** å é¤æé®æä½ */ |
| | | handleDelete(row) { |
| | | const userIds = row.userId || this.ids; |
| | | this.$modal |
| | | .confirm('æ¯å¦ç¡®è®¤å é¤ç¨æ·ç¼å·ä¸º"' + userIds + '"çæ°æ®é¡¹ï¼') |
| | | .then(function () { |
| | | return delUser(userIds); |
| | | }) |
| | | .then(() => { |
| | | this.getList(); |
| | | this.$modal.msgSuccess("å 餿å"); |
| | | }) |
| | | .catch(() => {}); |
| | | }, |
| | | /** å¯¼åºæé®æä½ */ |
| | | handleExport() { |
| | | this.download( |
| | | "system/user/export", |
| | | { |
| | | ...this.topqueryParams, |
| | | }, |
| | | `user_${new Date().getTime()}.xlsx` |
| | | ); |
| | | }, |
| | | }, |
| | | }; |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | .el-button--primary.is-plain { |
| | | color: #ffffff; |
| | | background: #409eff; |
| | | border-color: #4fabe9; |
| | | } |
| | | .document { |
| | | width: 100px; |
| | | height: 50px; |
| | | } |
| | | .documentf { |
| | | display: flex; |
| | | justify-content: flex-end; |
| | | } |
| | | .download { |
| | | text-align: center; |
| | | .el-upload__tip { |
| | | font-size: 23px; |
| | | } |
| | | .el-upload__text { |
| | | font-size: 23px; |
| | | } |
| | | } |
| | | .uploading { |
| | | margin-top: 20px; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #ffffff; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | } |
| | | .el-tag + .el-tag { |
| | | margin-left: 10px; |
| | | } |
| | | .button-new-tag { |
| | | margin-left: 10px; |
| | | height: 32px; |
| | | line-height: 30px; |
| | | padding-top: 0; |
| | | padding-bottom: 0; |
| | | } |
| | | .input-new-tag { |
| | | width: 90px; |
| | | margin-left: 10px; |
| | | vertical-align: bottom; |
| | | } |
| | | .drexamine { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: center; |
| | | padding: 30px; |
| | | background: #daeaf5; |
| | | img { |
| | | width: 100px; |
| | | height: 100px; |
| | | } |
| | | } |
| | | .qrcode-dialo { |
| | | // text-align: center; |
| | | // display: flex; |
| | | margin: 20px; |
| | | padding: 30px; |
| | | background: #edf1f7; |
| | | border: 1px solid #dcdfe6; |
| | | -webkit-box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.12), |
| | | 0 0 6px 0 rgba(0, 0, 0, 0.04); |
| | | .topic-dev { |
| | | margin-bottom: 25px; |
| | | font-size: 20px !important; |
| | | .dev-text { |
| | | margin-bottom: 10px; |
| | | } |
| | | } |
| | | } |
| | | ::v-deep.el-radio-group { |
| | | span { |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | ::v-deep.el-checkbox-group { |
| | | span { |
| | | font-size: 24px; |
| | | } |
| | | } |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | import { Message } from 'element-ui' |
| | | // import { getToken } from '@/utils/authToken' // ä¸å端çååï¼websocket请æ±éè¦å¸¦ä¸tokenåæ° |
| | | let websock = null |
| | | let messageCallback = null |
| | | let errorCallback = null |
| | | let wsUrl = '' |
| | | let tryTime = 0 |
| | | |
| | | // æ¥æ¶wså端è¿åçæ°æ® |
| | | function websocketonmessage (e) { |
| | | console.log(e); |
| | | messageCallback(JSON.stringify(e.data)) |
| | | } |
| | | |
| | | /** |
| | | * åèµ·websocketè¿æ¥ |
| | | * @param {Object} agentData éè¦ååå°ä¼ éçåæ°æ°æ® |
| | | */ |
| | | function websocketSend (agentData) { |
| | | // å å»¶è¿æ¯ä¸ºäºå°½é让wsè¿æ¥ç¶æå为OPEN |
| | | setTimeout(() => { |
| | | // æ·»å ç¶æå¤æï¼å½ä¸ºOPENæ¶ï¼åéæ¶æ¯ |
| | | if (websock.readyState === websock.OPEN) { // websock.OPEN = 1 |
| | | // åç»åç«¯çæ°æ®éè¦å符串å |
| | | websock.send(JSON.stringify(agentData)) |
| | | console.log('è¿æ¥æå'); |
| | | } |
| | | if (websock.readyState === websock.CLOSED) { // websock.CLOSED = 3 |
| | | console.log('websock.readyState=3') |
| | | Message.error('wsè¿æ¥å¼å¸¸ï¼è¯·ç¨åéè¯c') |
| | | errorCallback() |
| | | } |
| | | }, 500) |
| | | } |
| | | |
| | | // å
³éwsè¿æ¥ |
| | | function websocketclose (e) { |
| | | // e.code === 1000 表示æ£å¸¸å
³éã æ 论为ä½ç®çèå建, è¯¥é¾æ¥é½å·²æå宿任å¡ã |
| | | // e.code !== 1000 è¡¨ç¤ºéæ£å¸¸å
³éã |
| | | if (e && e.code !== 1000) { |
| | | Message.error('wsè¿æ¥å¼å¸¸ï¼è¯·ç¨åéè¯b') |
| | | errorCallback() |
| | | // // 妿éè¦è®¾ç½®å¼å¸¸éè¿å坿¿æ¢ä¸ºä¸é¢ç代ç ï¼èªè¡è¿è¡æµè¯ |
| | | // if (tryTime < 10) { |
| | | // setTimeout(function() { |
| | | // websock = null |
| | | // tryTime++ |
| | | // initWebSocket() |
| | | // console.log(`第${tryTime}次éè¿`) |
| | | // }, 3 * 1000) |
| | | //} else { |
| | | // Message.error('éè¿å¤±è´¥ï¼è¯·ç¨åéè¯') |
| | | //} |
| | | } |
| | | } |
| | | // 建ç«wsè¿æ¥ |
| | | function websocketOpen (e) { |
| | | // console.log('wsè¿æ¥æå') |
| | | } |
| | | |
| | | // åå§åweosocket |
| | | function initWebSocket () { |
| | | if (typeof (WebSocket) === 'undefined') { |
| | | Message.error('æ¨çæµè§å¨ä¸æ¯æWebSocketï¼æ æ³è·åæ°æ®') |
| | | return false |
| | | } |
| | | |
| | | // const token = 'JWT=' + getToken() |
| | | // ws请æ±å®æ´å°å |
| | | // const requstWsUrl = wsUrl + '?' + token |
| | | const requstWsUrl = wsUrl |
| | | websock = new WebSocket(requstWsUrl) |
| | | |
| | | websock.onmessage = function (e) { |
| | | websocketonmessage(e) |
| | | } |
| | | websock.onopen = function () { |
| | | websocketOpen() |
| | | } |
| | | websock.onerror = function () { |
| | | Message.error('wsè¿æ¥å¼å¸¸ï¼è¯·ç¨åéè¯a') |
| | | errorCallback() |
| | | } |
| | | websock.onclose = function (e) { |
| | | // websocketclose(e) |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * åèµ·websocket请æ±å½æ° |
| | | * @param {string} url wsè¿æ¥å°å |
| | | * @param {Object} agentData ä¼ ç»åå°çåæ° |
| | | * @param {function} successCallback æ¥æ¶å°wsæ°æ®ï¼å¯¹æ°æ®è¿è¡å¤ççåè°å½æ° |
| | | * @param {function} errCallback wsè¿æ¥é误çåè°å½æ° |
| | | */ |
| | | export function sendWebsocket (url, agentData, successCallback, errCallback) { |
| | | wsUrl = url |
| | | initWebSocket() |
| | | messageCallback = successCallback |
| | | errorCallback = errCallback |
| | | websocketSend(agentData) |
| | | } |
| | | |
| | | /** |
| | | * å
³éwebsocket彿° |
| | | */ |
| | | export function closeWebsocket () { |
| | | if (websock) { |
| | | websock.close() // å
³éwebsocket |
| | | websock.onclose() // å
³éwebsocket |
| | | } |
| | | } |
| | | |