¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-card :bordered="false"> |
| | | <!-- æ¥è¯¢åºå --> |
| | | <div class="table-page-search-wrapper"> |
| | | <a-form layout="inline" @keyup.enter.native="searchQuery"> |
| | | <a-row :gutter="24"> |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <a-form-item label="åæ°åç§°"> |
| | | <a-input placeholder="请è¾å
¥åæ°åç§°" v-model="queryParam.settingName"/> |
| | | </a-form-item> |
| | | </a-col> |
| | | |
| | | <a-col :xl="6" :lg="7" :md="8" :sm="24"> |
| | | <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons"> |
| | | <a-button type="primary" @click="searchQuery" icon="search">æ¥è¯¢</a-button> |
| | | </span> |
| | | </a-col> |
| | | </a-row> |
| | | </a-form> |
| | | </div> |
| | | <!-- æ¥è¯¢åºå-END --> |
| | | |
| | | <!-- æä½æé®åºå --> |
| | | <!-- <div class="table-operator"> |
| | | <a-button @click="handleAdd" type="primary" icon="plus">æ°å¢</a-button> |
| | | <a-button type="primary" icon="download" @click="handleExportXls('ç³»ç»åæ°è¡¨')">导åº</a-button> |
| | | <a-upload name="file" :showUploadList="false" :multiple="false" :headers="tokenHeader" :action="importExcelUrl" @change="handleImportExcel"> |
| | | <a-button type="primary" icon="import">导å
¥</a-button> |
| | | </a-upload> |
| | | <a-dropdown v-if="selectedRowKeys.length > 0"> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item key="1" @click="batchDel"><a-icon type="delete"/>å é¤</a-menu-item> |
| | | </a-menu> |
| | | <a-button style="margin-left: 8px"> æ¹éæä½ <a-icon type="down" /></a-button> |
| | | </a-dropdown> |
| | | </div> --> |
| | | |
| | | <!-- tableåºå-begin --> |
| | | <div> |
| | | <!-- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;"> |
| | | <i class="anticon anticon-info-circle ant-alert-icon"></i> 已鿩 <a style="font-weight: 600">{{ selectedRowKeys.length }}</a>项 |
| | | <a style="margin-left: 24px" @click="onClearSelected">æ¸
空</a> |
| | | </div> --> |
| | | |
| | | <a-table |
| | | ref="table" |
| | | size="middle" |
| | | bordered |
| | | rowKey="id" |
| | | :columns="columns" |
| | | :dataSource="dataSource" |
| | | :pagination="ipagination" |
| | | :loading="loading" |
| | | class="j-table-force-nowrap" |
| | | @change="handleTableChange"> |
| | | <span slot="rowIndex" slot-scope="text, record, index"> |
| | | {{(ipagination.current-1)*ipagination.pageSize+index+1}} |
| | | </span> |
| | | <template slot="htmlSlot" slot-scope="text"> |
| | | <div v-html="text"></div> |
| | | </template> |
| | | <template slot="imgSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ å¾ç</span> |
| | | <img v-else :src="getImgView(text)" height="25px" alt="" style="max-width:80px;font-size: 12px;font-style: italic;"/> |
| | | </template> |
| | | <template slot="fileSlot" slot-scope="text"> |
| | | <span v-if="!text" style="font-size: 12px;font-style: italic;">æ æä»¶</span> |
| | | <a-button |
| | | v-else |
| | | :ghost="true" |
| | | type="primary" |
| | | icon="download" |
| | | size="small" |
| | | @click="uploadFile(text)"> |
| | | ä¸è½½ |
| | | </a-button> |
| | | </template> |
| | | |
| | | <span slot="action" slot-scope="text, record"> |
| | | <a @click="handleEdit(record)">ç¼è¾</a> |
| | | |
| | | <!-- <a-divider type="vertical" /> |
| | | <a-dropdown> |
| | | <a class="ant-dropdown-link">æ´å¤ <a-icon type="down" /></a> |
| | | <a-menu slot="overlay"> |
| | | <a-menu-item> |
| | | <a-popconfirm title="ç¡®å®å é¤å?" @confirm="() => handleDelete(record.id)"> |
| | | <a>å é¤</a> |
| | | </a-popconfirm> |
| | | </a-menu-item> |
| | | </a-menu> |
| | | </a-dropdown> --> |
| | | <template> |
| | | <!-- <div v-if="record.settingValue=='OPEN'"> |
| | | <a-switch @click="edit(record)" checked-children="å¼" un-checked-children="å
³" default-checked /> |
| | | </div> |
| | | <div v-else> |
| | | <a-switch @click="edit(record)" checked-children="å¼" un-checked-children="å
³" /> |
| | | </div> --> |
| | | </template> |
| | | </span> |
| | | |
| | | <!-- å符串è¶
é¿æªåçç¥å·æ¾ç¤º--> |
| | | <span slot="settingValue" slot-scope="text"> |
| | | <j-ellipsis :value="text"/> |
| | | </span> |
| | | </a-table> |
| | | </div> |
| | | |
| | | <sysParams-modal ref="modalForm" @ok="modalFormOk"></sysParams-modal> |
| | | </a-card> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import '@/assets/less/TableExpand.less' |
| | | import { mixinDevice } from '@/utils/mixin' |
| | | import { JeecgListMixin } from '@/mixins/JeecgListMixin' |
| | | import SysParamsModal from './modules/SysParamsModal' |
| | | import JDictSelectTag from '../../components/dict/JDictSelectTag.vue' |
| | | |
| | | export default { |
| | | name: "SysParamsList", |
| | | mixins:[JeecgListMixin, mixinDevice], |
| | | components: { |
| | | JDictSelectTag, |
| | | SysParamsModal, |
| | | }, |
| | | data () { |
| | | return { |
| | | description: 'ç³»ç»åæ°è¡¨ç®¡ç页é¢', |
| | | // 表头 |
| | | columns: [ |
| | | { |
| | | title: '#', |
| | | dataIndex: '', |
| | | key:'rowIndex', |
| | | width:60, |
| | | align:"center", |
| | | scopedSlots: { customRender: 'rowIndex' } |
| | | }, |
| | | { |
| | | title:'åæ°åç§°', |
| | | align:"center", |
| | | dataIndex: 'settingName' |
| | | }, |
| | | { |
| | | title:'åæ°é®', |
| | | align:"center", |
| | | dataIndex: 'settingKey' |
| | | }, |
| | | { |
| | | title:'åæ°å¼', |
| | | align:"center", |
| | | dataIndex: 'settingValue', |
| | | key: 'settingValue', |
| | | scopedSlots: { customRender: 'settingValue' } |
| | | }, |
| | | { |
| | | title:'夿³¨', |
| | | align:"center", |
| | | dataIndex: 'remark' |
| | | }, |
| | | { |
| | | title: 'æä½', |
| | | dataIndex: 'action', |
| | | align:"center", |
| | | // fixed:"right", |
| | | width:147, |
| | | scopedSlots: { customRender: 'action' } |
| | | } |
| | | ], |
| | | url: { |
| | | list: "/system/sysParams/list", |
| | | delete: "/system/sysParams/delete", |
| | | deleteBatch: "/system/sysParams/deleteBatch", |
| | | exportXlsUrl: "/system/sysParams/exportXls", |
| | | importExcelUrl: "system/sysParams/importExcel", |
| | | edit: "/system/sysParams/edit", |
| | | }, |
| | | dictOptions:{}, |
| | | } |
| | | }, |
| | | computed: { |
| | | importExcelUrl: function(){ |
| | | return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; |
| | | }, |
| | | }, |
| | | methods: { |
| | | initDictConfig(){ |
| | | }, |
| | | edit(sysParams) { |
| | | if(sysParams.settingValue == "CLOSE"){ |
| | | sysParams.settingValue = "OPEN"; |
| | | }else{ |
| | | sysParams.settingValue = "CLOSE"; |
| | | } |
| | | const that = this; |
| | | httpAction("/system/sysParams/edit",sysParams,'put').then((res)=>{ |
| | | if(res.success){ |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | }) |
| | | }, |
| | | } |
| | | } |
| | | </script> |
| | | <style scoped> |
| | | @import '~@assets/less/common.less'; |
| | | </style> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <j-modal |
| | | :title="title" |
| | | :width="width" |
| | | :visible="visible" |
| | | :confirmLoading="confirmLoading" |
| | | switchFullscreen |
| | | @ok="handleOk" |
| | | @cancel="handleCancel" |
| | | cancelText="å
³é"> |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-form-item label="åæ°é®" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input disabled v-decorator="['settingKey']" placeholder="请è¾å
¥åæ°é®"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="åæ°å¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['settingValue']" placeholder="请è¾å
¥åæ°å¼"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-textarea disabled v-decorator="['remark']" rows="4" placeholder="请è¾å
¥å¤æ³¨"/> |
| | | </a-form-item> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | </j-modal> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | |
| | | export default { |
| | | name: "SysParamsModal", |
| | | components: { |
| | | }, |
| | | data () { |
| | | return { |
| | | form: this.$form.createForm(this), |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/system/sysParams/add", |
| | | edit: "/system/sysParams/edit", |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit({}); |
| | | }, |
| | | edit (record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model,'settingKey','settingValue','remark')) |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | console.log("表åæäº¤æ°æ®",formData) |
| | | httpAction(httpurl,formData,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | popupCallback(row){ |
| | | this.form.setFieldsValue(pick(row,'settingKey','settingValue','remark')) |
| | | }, |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <a-drawer |
| | | :title="title" |
| | | :width="width" |
| | | placement="right" |
| | | :closable="false" |
| | | @close="close" |
| | | :visible="visible"> |
| | | |
| | | <a-spin :spinning="confirmLoading"> |
| | | <a-form :form="form"> |
| | | |
| | | <a-form-item label="åæ°é®" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['settingKey']" placeholder="请è¾å
¥åæ°é®"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="åæ°å¼" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['settingValue']" placeholder="请è¾å
¥åæ°å¼"></a-input> |
| | | </a-form-item> |
| | | <a-form-item label="夿³¨" :labelCol="labelCol" :wrapperCol="wrapperCol"> |
| | | <a-input v-decorator="['remark']" placeholder="请è¾å
¥å¤æ³¨"></a-input> |
| | | </a-form-item> |
| | | |
| | | </a-form> |
| | | </a-spin> |
| | | <a-button type="primary" @click="handleOk">ç¡®å®</a-button> |
| | | <a-button type="primary" @click="handleCancel">åæ¶</a-button> |
| | | </a-drawer> |
| | | </template> |
| | | |
| | | <script> |
| | | |
| | | import { httpAction } from '@/api/manage' |
| | | import pick from 'lodash.pick' |
| | | import { validateDuplicateValue } from '@/utils/util' |
| | | |
| | | export default { |
| | | name: "SysParamsModal", |
| | | components: { |
| | | }, |
| | | data () { |
| | | return { |
| | | form: this.$form.createForm(this), |
| | | title:"æä½", |
| | | width:800, |
| | | visible: false, |
| | | model: {}, |
| | | labelCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 5 }, |
| | | }, |
| | | wrapperCol: { |
| | | xs: { span: 24 }, |
| | | sm: { span: 16 }, |
| | | }, |
| | | confirmLoading: false, |
| | | validatorRules: { |
| | | }, |
| | | url: { |
| | | add: "/system/sysParams/add", |
| | | edit: "/system/sysParams/edit", |
| | | } |
| | | } |
| | | }, |
| | | created () { |
| | | }, |
| | | methods: { |
| | | add () { |
| | | this.edit({}); |
| | | }, |
| | | edit (record) { |
| | | this.form.resetFields(); |
| | | this.model = Object.assign({}, record); |
| | | this.visible = true; |
| | | this.$nextTick(() => { |
| | | this.form.setFieldsValue(pick(this.model,'settingKey','settingValue','remark')) |
| | | }) |
| | | }, |
| | | close () { |
| | | this.$emit('close'); |
| | | this.visible = false; |
| | | }, |
| | | handleOk () { |
| | | const that = this; |
| | | // 触å表åéªè¯ |
| | | this.form.validateFields((err, values) => { |
| | | if (!err) { |
| | | that.confirmLoading = true; |
| | | let httpurl = ''; |
| | | let method = ''; |
| | | if(!this.model.id){ |
| | | httpurl+=this.url.add; |
| | | method = 'post'; |
| | | }else{ |
| | | httpurl+=this.url.edit; |
| | | method = 'put'; |
| | | } |
| | | let formData = Object.assign(this.model, values); |
| | | console.log("表åæäº¤æ°æ®",formData) |
| | | httpAction(httpurl,formData,method).then((res)=>{ |
| | | if(res.success){ |
| | | that.$message.success(res.message); |
| | | that.$emit('ok'); |
| | | }else{ |
| | | that.$message.warning(res.message); |
| | | } |
| | | }).finally(() => { |
| | | that.confirmLoading = false; |
| | | that.close(); |
| | | }) |
| | | } |
| | | |
| | | }) |
| | | }, |
| | | handleCancel () { |
| | | this.close() |
| | | }, |
| | | popupCallback(row){ |
| | | this.form.setFieldsValue(pick(row,'settingKey','settingValue','remark')) |
| | | } |
| | | |
| | | } |
| | | } |
| | | </script> |
| | | |
| | | <style lang="less" scoped> |
| | | /** Buttonæé®é´è· */ |
| | | .ant-btn { |
| | | margin-left: 30px; |
| | | margin-bottom: 30px; |
| | | float: right; |
| | | } |
| | | </style> |