From 86d004ebe505aae018ab74091bff67162bcd2de8 Mon Sep 17 00:00:00 2001 From: qushaowei <qushaowei@163.com> Date: 星期三, 08 十一月 2023 14:57:51 +0800 Subject: [PATCH] 增加班组 --- .env.development | 4 src/main.js | 14 yarn.lock | 8 src/views/eam/modules/team/TeamModal.vue | 60 ++++++ package.json | 3 src/views/eam/TeamList.vue | 261 +++++++++++++++++++++++++++++ .env.production | 3 src/views/eam/modules/team/TeamForm.vue | 170 ++++++++++++++++++ 8 files changed, 503 insertions(+), 20 deletions(-) diff --git a/.env.development b/.env.development index 0b5a810..b33a296 100644 --- a/.env.development +++ b/.env.development @@ -1,5 +1,5 @@ NODE_ENV=development -#VUE_APP_API_BASE_URL=http://192.168.0.95:9999 -VUE_APP_API_BASE_URL=http://127.0.0.1:8080 +VUE_APP_API_BASE_URL=http://127.0.0.1:8099 +# VUE_APP_API_BASE_URL=http://195.0.1.10:8099 VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/.env.production b/.env.production index 73066c0..2a09222 100644 --- a/.env.production +++ b/.env.production @@ -1,4 +1,5 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://127.0.0.1:8080 +# VUE_APP_API_BASE_URL=http://195.0.1.10:8099 +VUE_APP_API_BASE_URL=http://127.0.0.1:8099 VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview1p \ No newline at end of file diff --git a/package.json b/package.json index de242b3..1c8fad1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,6 @@ "dependencies": { "@antv/data-set": "^0.11.4", "@jeecg/antd-online-mini": "3.0.0-RC", - "@jiaminghi/data-view": "^2.10.0", "@tinymce/tinymce-vue": "2.1.0", "@toast-ui/editor": "^2.1.2", "ali-oss": "^6.17.1", @@ -127,4 +126,4 @@ "last 2 versions", "not ie <= 8" ] -} +} \ No newline at end of file diff --git a/src/main.js b/src/main.js index d6820f1..8fe3532 100644 --- a/src/main.js +++ b/src/main.js @@ -58,19 +58,19 @@ // }); //娉ㄥ叆鍏ㄥ眬灞炴��$message -import {message,notification } from 'ant-design-vue' +import { message, notification } from 'ant-design-vue' Vue.prototype.$message = message Vue.prototype.$notification = notification message.config({ }) notification.config({ - bottom:'20px', - right:'100px' + bottom: '20px', + right: '100px' }) // 灏嗚嚜鍔ㄦ敞鍐屾墍鏈夌粍浠朵负鍏ㄥ眬缁勪欢 -import dataV from '@jiaminghi/data-view' -Vue.use(dataV) +// import dataV from '@jiaminghi/data-view' +// Vue.use(dataV) import VueDragResize from "vue-drag-resize" Vue.component('vue-drag-resize', VueDragResize) @@ -102,7 +102,7 @@ beforeCreate() { Vue.prototype.$bus = new Vue() }, - mounted () { + mounted() { store.commit('SET_SIDEBAR_TYPE', Vue.ls.get(SIDEBAR_TYPE, true)) store.commit('TOGGLE_THEME', Vue.ls.get(DEFAULT_THEME, config.navTheme)) store.commit('TOGGLE_LAYOUT_MODE', Vue.ls.get(DEFAULT_LAYOUT_MODE, config.layout)) @@ -113,7 +113,7 @@ store.commit('TOGGLE_WEAK', Vue.ls.get(DEFAULT_COLOR_WEAK, config.colorWeak)) store.commit('TOGGLE_COLOR', Vue.ls.get(DEFAULT_COLOR, config.primaryColor)) store.commit('SET_TOKEN', Vue.ls.get(ACCESS_TOKEN)) - store.commit('SET_MULTI_PAGE',Vue.ls.get(DEFAULT_MULTI_PAGE,config.multipage)) + store.commit('SET_MULTI_PAGE', Vue.ls.get(DEFAULT_MULTI_PAGE, config.multipage)) }, render: h => h(App) }).$mount('#app') diff --git a/src/views/eam/TeamList.vue b/src/views/eam/TeamList.vue new file mode 100644 index 0000000..d3b3e95 --- /dev/null +++ b/src/views/eam/TeamList.vue @@ -0,0 +1,261 @@ +<template> + <a-card + title="鐝粍" + :bordered="false" + > + <!-- 鏌ヨ鍖哄煙 --> + <div class="table-page-search-wrapper"> + <a-form + layout="inline" + @keyup.enter.native="searchQuery" + > + <a-row :gutter="24"> + </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('mom_base_team')" + >瀵煎嚭</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> --> + <!-- 楂樼骇鏌ヨ鍖哄煙 --> + <!-- <j-super-query + :fieldList="superFieldList" + ref="superQueryModal" + @handleSuperQuery="handleSuperQuery" + ></j-super-query> --> + <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" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" + class="j-table-force-nowrap" + @change="handleTableChange" + > + + <template + slot="htmlSlot" + slot-scope="text" + > + <div v-html="text"></div> + </template> + <template + slot="imgSlot" + slot-scope="text,record" + > + <span + v-if="!text" + style="font-size: 12px;font-style: italic;" + >鏃犲浘鐗�</span> + <img + v-else + :src="getImgView(text)" + :preview="record.id" + 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="downloadFile(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 @click="handleDetail(record)">璇︽儏</a> + </a-menu-item> + <a-menu-item> + <a-popconfirm + title="纭畾鍒犻櫎鍚�?" + @confirm="() => handleDelete(record.id)" + > + <a>鍒犻櫎</a> + </a-popconfirm> + </a-menu-item> + </a-menu> + </a-dropdown> + </span> + + </a-table> + </div> + + <team-modal + ref="modalForm" + @ok="modalFormOk" + ></team-modal> + </a-card> +</template> + +<script> + +import '@/assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import TeamModal from './modules/team/TeamModal' + +export default { + name: 'TeamList', + mixins: [JeecgListMixin, mixinDevice], + components: { + TeamModal + }, + data() { + return { + description: 'mom_base_team绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '#', + dataIndex: '', + key: 'rowIndex', + width: 60, + align: "center", + customRender: function (t, r, index) { + return parseInt(index) + 1; + } + }, + { + title: '閮ㄩ棬', + align: "center", + dataIndex: 'departId_dictText' + }, + { + title: '缂栫爜', + align: "center", + dataIndex: 'num' + }, + { + title: '鍚嶇О', + align: "center", + dataIndex: 'name' + }, + { + title: '澶囨敞', + align: "center", + dataIndex: 'remark' + }, + + { + title: '鎿嶄綔', + dataIndex: 'action', + align: "center", + fixed: "right", + width: 147, + scopedSlots: { customRender: 'action' } + } + ], + url: { + list: "/base/team/list", + delete: "/base/team/delete", + deleteBatch: "/base/team/deleteBatch", + exportXlsUrl: "/base/team/exportXls", + importExcelUrl: "/base/team/importExcel", + + }, + dictOptions: {}, + superFieldList: [], + } + }, + created() { + this.getSuperFieldList(); + }, + computed: { + importExcelUrl: function () { + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig() { + }, + getSuperFieldList() { + let fieldList = []; + fieldList.push({ type: 'string', value: 'num', text: 'num', dictCode: '' }) + fieldList.push({ type: 'string', value: 'name', text: 'name', dictCode: '' }) + fieldList.push({ type: 'string', value: 'remark', text: 'remark', dictCode: '' }) + fieldList.push({ type: 'string', value: 'status', text: 'status', dictCode: '' }) + fieldList.push({ type: 'string', value: 'departId', text: 'departId', dictCode: '' }) + this.superFieldList = fieldList + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/eam/modules/team/TeamForm.vue b/src/views/eam/modules/team/TeamForm.vue new file mode 100644 index 0000000..b2a0a3c --- /dev/null +++ b/src/views/eam/modules/team/TeamForm.vue @@ -0,0 +1,170 @@ +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form-model + ref="form" + :model="model" + :rules="validatorRules" + slot="detail" + > + <a-row> + <a-col :span="24"> + <a-form-model-item + label="閮ㄩ棬" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="departId" + > + <j-dict-select-tag + type="list" + v-model="model.departId" + dictCode="sys_depart,depart_name,id, del_flag!='1'" + placeholder="璇烽�夋嫨閮ㄩ棬" + /> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item + label="鐝粍缂栫爜" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="num" + > + <a-input + v-model="model.num" + placeholder="璇疯緭鍏ョ彮缁勭紪鐮�" + ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item + label="鐝粍鍚嶇О" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="name" + > + <a-input + v-model="model.name" + placeholder="璇疯緭鍏ョ彮缁勫悕绉�" + ></a-input> + </a-form-model-item> + </a-col> + <a-col :span="24"> + <a-form-model-item + label="澶囨敞" + :labelCol="labelCol" + :wrapperCol="wrapperCol" + prop="remark" + > + <a-input + v-model="model.remark" + placeholder="璇疯緭鍏ュ娉�" + ></a-input> + </a-form-model-item> + </a-col> + + </a-row> + </a-form-model> + </j-form-container> + </a-spin> +</template> + +<script> + +import { httpAction, getAction } from '@/api/manage' +import { validateDuplicateValue } from '@/utils/util' + +export default { + name: 'TeamForm', + components: { + }, + props: { + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data() { + return { + model: { + }, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + departId: [ + { required: true, message: '璇烽�夋嫨閮ㄩ棬!' }, + + ], + num: [ + { required: true, message: '璇疯緭鍏ョ彮缁勭紪鐮�!' }, + + ], + name: [ + { required: true, message: '璇疯緭鍏ョ彮缁勫悕绉�!' }, + ], + }, + url: { + add: "/base/team/add", + edit: "/base/team/edit", + queryById: "/base/team/queryById" + } + } + }, + computed: { + formDisabled() { + return this.disabled + }, + }, + created() { + //澶囦唤model鍘熷鍊� + this.modelDefault = JSON.parse(JSON.stringify(this.model)); + }, + methods: { + add() { + this.edit(this.modelDefault); + }, + edit(record) { + this.model = Object.assign({}, record); + this.visible = true; + }, + submitForm() { + const that = this; + // 瑙﹀彂琛ㄥ崟楠岃瘉 + this.$refs.form.validate(valid => { + if (valid) { + that.confirmLoading = true; + let httpurl = ''; + let method = ''; + if (!this.model.id) { + httpurl += this.url.add; + method = 'post'; + } else { + httpurl += this.url.edit; + method = 'put'; + } + httpAction(httpurl, this.model, method).then((res) => { + if (res.success) { + that.$message.success(res.message); + that.$emit('ok'); + } else { + that.$message.warning(res.message); + } + }).finally(() => { + that.confirmLoading = false; + }) + } + + }) + }, + } +} +</script> \ No newline at end of file diff --git a/src/views/eam/modules/team/TeamModal.vue b/src/views/eam/modules/team/TeamModal.vue new file mode 100644 index 0000000..c6740b5 --- /dev/null +++ b/src/views/eam/modules/team/TeamModal.vue @@ -0,0 +1,60 @@ +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <team-form ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></team-form> + </j-modal> +</template> + +<script> + + import TeamForm from './TeamForm' + export default { + name: 'TeamModal', + components: { + TeamForm + }, + data () { + return { + title:'', + width:800, + visible: false, + disableSubmit: false + } + }, + methods: { + add () { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.add(); + }) + }, + edit (record) { + this.visible=true + this.$nextTick(()=>{ + this.$refs.realForm.edit(record); + }) + }, + close () { + this.$emit('close'); + this.visible = false; + }, + handleOk () { + this.$refs.realForm.submitForm(); + }, + submitCallback(){ + this.$emit('ok'); + this.visible = false; + }, + handleCancel () { + this.close() + } + } + } +</script> \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 0d150f7..8f0fe43 100644 --- a/yarn.lock +++ b/yarn.lock @@ -930,14 +930,6 @@ resolved "https://registry.npmmirror.com/@jiaminghi/color/-/color-1.1.3.tgz#a2336750d1266155ffe80375c58c26fdec495611" integrity sha512-ZY3hdorgODk4OSTbxyXBPxAxHPIVf9rPlKJyK1C1db46a50J0reFKpAvfZG8zMG3lvM60IR7Qawgcu4ZDO3+Hg== -"@jiaminghi/data-view@^2.10.0": - version "2.10.0" - resolved "https://registry.npmmirror.com/@jiaminghi/data-view/-/data-view-2.10.0.tgz#2146d8fc71b9f24be808238ca050ddb7a4c8949f" - integrity sha512-Cud2MTiMcqc5k2KWabR/svuVQmXHANqURo+yj40370/LdI/gyUJ6LG203hWXEnT1nMCeiv/SLVmxv3PXLScCeA== - dependencies: - "@babel/runtime" "^7.5.5" - "@jiaminghi/charts" "*" - "@jiaminghi/transition@*": version "1.1.11" resolved "https://registry.npmmirror.com/@jiaminghi/transition/-/transition-1.1.11.tgz#576d8af092434b34201eba5eaecc79dd33c8ad8c" -- Gitblit v1.9.3