提交 1f83b57d 编写于 作者: 刘英杰's avatar 刘英杰

20241224 优化保存

上级 3de1f72a
流水线 #32224 已通过 ,包含阶段
in 1 minute 和 1 second
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="shortcut icon" href=favicon.ico><title>自习室占座预约系统</title><link href=css/chunk-vendors.cc1990b1.css rel=stylesheet><link href=css/app.de53c9b8.css rel=stylesheet></head><body><script src=https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js></script><script src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=IZXBZ-OTAWV-XU7PV-5FAAL-F6VXH-7XBQP"></script><script charset=utf-8 src="https://map.qq.com/api/js?v=2.exp&key=ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W&libraries=drawing,geometry,place,convertor,visualization"></script><script src=/a/manager/identify/identify.js></script><noscript><strong>请开启 JavaScript 功能来使用 自习室占座预约系统。</strong></noscript><div id=app></div><script src=js/chunk-vendors.0e2a893c.js></script><script src=js/app.32cec4f6.js></script></body></html>
\ No newline at end of file
<!DOCTYPE html><html><head><meta charset=utf-8><meta http-equiv=X-UA-Compatible content="IE=edge"><meta name=viewport content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=0"><link rel="shortcut icon" href=favicon.ico><title>自习室占座预约系统</title><link href=css/chunk-vendors.cc1990b1.css rel=stylesheet><link href=css/app.de53c9b8.css rel=stylesheet></head><body><script src=https://mapapi.qq.com/web/mapComponents/geoLocation/v/geolocation.min.js></script><script src="https://map.qq.com/api/gljs?v=1.exp&libraries=service&key=IZXBZ-OTAWV-XU7PV-5FAAL-F6VXH-7XBQP"></script><script charset=utf-8 src="https://map.qq.com/api/js?v=2.exp&key=ZNMBZ-NYOEO-WNMWL-SJF4C-MWKQT-KJB7W&libraries=drawing,geometry,place,convertor,visualization"></script><script src=/a/manager/identify/identify.js></script><noscript><strong>请开启 JavaScript 功能来使用 自习室占座预约系统。</strong></noscript><div id=app></div><script src=js/chunk-vendors.0e2a893c.js></script><script src=js/app.77ac8b9c.js></script></body></html>
\ No newline at end of file
因为 它太大了无法显示 源差异 。您可以改为 查看blob。
此差异已折叠。
此差异已折叠。
......@@ -9,8 +9,14 @@
@onSubmit="search"
@onReset="reset"></SearchCondForm> -->
<Button type="primary" class="ivu-ml-8" @click="add"><Icon type="md-add"/>新增</Button>
<Button type="primary" class="ivu-ml-8" @click="add('teacher')">
<Icon type="md-add"/>
新增教师
</Button>
<Button type="primary" class="ivu-ml-8" @click="add('student')">
<Icon type="md-add"/>
新增学生
</Button>
<!-- 数据table -->
<CTable
:tableColumns="tableColumns.filter(a => a.show)"
......@@ -30,7 +36,7 @@
</template>
</CTable>
<!-- 新增修改Modal -->
<!-- 新增修改Modal-分配教师用户权限 -->
<CEditModal
ref="ceditmodal"
v-model="editModalshow"
......@@ -42,51 +48,53 @@
@getPeopleList="getPeopleList"
@onSubmit="modalSubmit">
</CEditModal>
</Card>
</div>
</template>
<script>
import CTable from '@/components/CTable.vue'
import CEditModal from '@/components/CEditModal.vue'
import SearchCondForm from '@/components/SearchCondForm.vue'
import { cloneDeep } from 'lodash'
import * as api from '@/api/controller/index.js'
import * as hooks from '@/hook/index'
export default {
import CTable from '@/components/CTable.vue'
import CEditModal from '@/components/CEditModal.vue'
import SearchCondForm from '@/components/SearchCondForm.vue'
import {cloneDeep} from 'lodash'
import * as api from '@/api/controller/index.js'
import * as hooks from '@/hook/index'
export default {
components: {
CTable,
CEditModal,
SearchCondForm,
},
data(){
data() {
return {
// 搜索项
searchCondList: [
{ id: 'name', name: '类型名称', type: 'input', show: true, optList: [] },
{id: 'name', name: '类型名称', type: 'input', show: true, optList: []},
],
// 搜索条件
params:{
params: {
page_index: 1,
page_size: 10,
},
tableColumns:[
{ type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left' },
{ key: 'card', title: '卡号', align: 'center', minWidth: 150, show: true },
{ key: 'name', title: '名称', align: 'center', minWidth: 150, show: true },
{ key: 'role_name', title: '角色', align: 'center', minWidth: 150, show: true },
{ key: 'place_id', title: '场地id', align: 'center', minWidth: 150, show: false },
tableColumns: [
{type: 'index', title: '序号', align: 'center', width: 80, show: true, fixed: 'left'},
{key: 'card', title: '卡号', align: 'center', minWidth: 150, show: true},
{key: 'name', title: '名称', align: 'center', minWidth: 150, show: true},
{key: 'role_name', title: '角色', align: 'center', minWidth: 150, show: true},
{key: 'place_id', title: '场地id', align: 'center', minWidth: 150, show: false},
// { key: 'is_enable', title: '启用', align: 'center', minWidth: 150, show: true },
{ slot: 'generalSwitch', title: '启用', align: 'center', minWidth: 80, show: true },
{ slot: 'action', title: '操作', align: 'center', minWidth: 150, show: true, fixed: 'right' },
{slot: 'generalSwitch', title: '启用', align: 'center', minWidth: 80, show: true},
{slot: 'action', title: '操作', align: 'center', minWidth: 150, show: true, fixed: 'right'},
],
tableLoading: false,
tableData:[],
tableData: [],
tableSize: 'default',
tableFullscreen: false,
dataCount: 0,
......@@ -96,10 +104,10 @@ export default {
editModalLoading: false,
// 新增编辑表单项
formItem: [
{ id: 'cardName', name: '用戶', type: 'select', disabled: false, require: false, optList: [] },
{ id: 'role_id', name: '角色', type: 'select', disabled: false, require: false, optList: [] },
{id: 'cardName', name: '用戶', type: 'select', disabled: false, require: false, optList: []},
{id: 'role_id', name: '角色', type: 'select', disabled: false, require: false, optList: []},
// { id: 'place_id', name: '场地', type: 'multipleselect', disabled: false, require: false, optList: [] },
{ id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: [] },
{id: 'is_enable', name: '启用', type: 'switch', disabled: false, require: false, optList: []},
],
defaultFormData: {
"role_id": "",
......@@ -110,6 +118,11 @@ export default {
"is_del": 0,
},
addTeacherOrStudentFlag:1, //新增教师或学生 0=>学生。 1=>教师
// 角色
roleList: [],
......@@ -122,8 +135,9 @@ export default {
return this.tableData.slice(start, end)
},
},
created(){},
mounted(){
created() {
},
mounted() {
// 获取角色
this.asc.getApiCommonGetRoleSelect().then(res => {
......@@ -140,16 +154,16 @@ export default {
this.getData()
},
methods: {
getPeopleList(keyword=''){
console.log("🚀🚀🚀,",keyword)
getPeopleList(keyword = '') {
console.log("🚀🚀🚀,", keyword)
// 获取用戶信息
api.getApiCommonGetPersonByCondiction({user_type: 1,keyword:keyword}).then(res => {
api.getApiCommonGetPersonByCondiction({user_type: Number(this.addTeacherOrStudentFlag), keyword: keyword}).then(res => {
let arr = res.response.map(a => {
return {
...a,
label: a.name+ '-'+a.card,
value:a.name+ '-'+a.card,
label: a.name + '-' + a.card,
value: a.name + '-' + a.card,
}
})
this.formItem[this.formItem.findIndex(a => a.id === 'cardName')].optList = arr
......@@ -174,7 +188,7 @@ export default {
this.onPageChange(1)
},
// 查询列表
getData(){
getData() {
this.tableLoading = true
this.asc.getApiRoleGetRolePowerList().then(res => {
// console.log('查询数据', res)
......@@ -187,35 +201,47 @@ export default {
// 改变开关
switchChange(val, row, index) {
//用户启用/禁用
hooks.myEncapsulationFunction(()=>{
return this.asc.getApiRoleRolePowerEnable({id:row.id, is_enable:val}).then(res => {
if (res.code === 1 ) this.getData()
hooks.myEncapsulationFunction(() => {
return this.asc.getApiRoleRolePowerEnable({id: row.id, is_enable: val}).then(res => {
if (res.code === 1) this.getData()
return res
})
})
},
// 新增
add(){
add(key) {
const strategy = {
'teacher':()=>{
this.addTeacherOrStudentFlag = 1
this.getPeopleList()
},
'student':()=>{
this.addTeacherOrStudentFlag = 0
this.getPeopleList()
}
}
strategy[key]()
this.editModalshow = true
this.formItem.find(a => a.id === 'cardName').disabled = false
this.$refs.ceditmodal.modalInit('add', this.defaultFormData, '新增用户权限')
},
// 编辑
async rowEdit(row){
async rowEdit(row) {
// console.log('编辑行', row)
this.editModalshow = true
this.editModalLoading = true
await new Promise((resolve, reject)=>{
this.asc.getApiCommonGetPersonByCondiction({user_type: 1,keyword:row.card}).then(res => {
await new Promise((resolve, reject) => {
this.asc.getApiCommonGetPersonByCondiction({user_type: row.is_tea, keyword: row.card}).then(res => {
// console.log('场地', res)
let arr = res.response.map(a => {
return {
...a,
label: a.name+ '-'+a.card,
value:a.name+ '-'+a.card,
label: a.name + '-' + a.card,
value: a.name + '-' + a.card,
// value:a.name+','+a.card,
}
})
......@@ -230,7 +256,7 @@ export default {
if (obj.place_id) {
obj.place_id = obj.place_id.split(',')
}
obj.cardName = obj.name+ '-'+obj.card
obj.cardName = obj.name + '-' + obj.card
this.$refs.ceditmodal.modalInit('edit', obj)
......@@ -272,7 +298,7 @@ export default {
// 删除
rowDelete(row) {
// console.log('删除', row);
this.asc.getApiRoleRolePowerDel({id:row.id, is_del:1}).then(res => {
this.asc.getApiRoleRolePowerDel({id: row.id, is_del: 1}).then(res => {
// console.log('删除行后', res)
if (res.code == 1) {
this.$Message.success(res.msg)
......@@ -289,12 +315,12 @@ export default {
// this.getData()
},
// 更改每页条数
onPageSizeChange(val){
onPageSizeChange(val) {
this.params.page_size = val
if (this.params.page_index == 1) {
this.onPageChange(1)
}
},
}
}
}
</script>
Markdown 格式
0% or
您添加了 0 人 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册 或