From 04d6189c7848cee67aaf8fd62b90eb9d9313a0d0 Mon Sep 17 00:00:00 2001 From: lyh <925863403@qq.com> Date: 星期四, 16 一月 2025 09:29:24 +0800 Subject: [PATCH] 流程配置管理页面 --- src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal.vue | 65 ++++++ src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserForm.vue | 198 +++++++++++++++++++ src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue | 91 +++++++++ src/views/dnc/base/AssignApproveUserList.vue | 185 ++++++++++++++++++ src/views/dnc/base/NcDeviceCharactersList.vue | 2 5 files changed, 540 insertions(+), 1 deletions(-) diff --git a/src/views/dnc/base/AssignApproveUserList.vue b/src/views/dnc/base/AssignApproveUserList.vue new file mode 100644 index 0000000..ea632f6 --- /dev/null +++ b/src/views/dnc/base/AssignApproveUserList.vue @@ -0,0 +1,185 @@ +<!-- + Description: 娴佺▼閰嶇疆绠$悊椤甸潰 List + Author: 浣滆�� liuyh + Date: 2025-01-15 +--> +<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.actName"></a-input> + </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> + <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">閲嶇疆</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> + </div> + + <!-- table鍖哄煙-begin --> + <div> + + <a-table + ref="table" + size="middle" + :scroll="{x:true}" + bordered + rowKey="id" + :columns="columns" + :dataSource="dataSource" + :pagination="ipagination" + :loading="loading" + 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"> + <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="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> + + + <AssignApproveUserModal ref="modalForm" @ok="modalFormOk"></AssignApproveUserModal> + + </a-card> +</template> + +<script> + +import '@assets/less/TableExpand.less' +import { mixinDevice } from '@/utils/mixin' +import { JeecgListMixin } from '@/mixins/JeecgListMixin' +import JDictSelectTag from '@comp/dict/JDictSelectTag.vue' +import AssignApproveUserModal from './modules/AssignApproveUser/AssignApproveUserModal__Style#Drawer.vue' + +export default { + name: 'AssignApproveUser', + mixins:[JeecgListMixin, mixinDevice], + components: { + JDictSelectTag, + AssignApproveUserModal + }, + data () { + return { + description: '娴佺▼閰嶇疆绠$悊椤甸潰', + // 琛ㄥご + columns: [ + { + title: '搴忓彿', + dataIndex: '', + key:'rowIndex', + width:200, + align:"center", + customRender:function (t,r,index) { + return parseInt(index)+1; + } + }, + { + title: '娴佺▼鍚嶇О', + align: "center", + dataIndex: 'actName', + width: 200, + }, + { + title: '鎵�灞為儴闂�', + align: "center", + dataIndex: 'departId_dictText', + width: 220, + }, + { + title: '瀹℃壒浜�', + align: "center", + dataIndex: 'approveUsers_dictText', + width: 250, + }, + { + title: '鎿嶄綔鏃堕棿', + align: "center", + dataIndex: 'createTime', + width:300 + }, + { + title: '鎿嶄綔', + dataIndex: 'action', + scopedSlots: { customRender: 'action' }, + align: 'center', + width: 200, + fixed: 'right' + } + ], + url: { + list: "/nc/definition/find/page", + delete: "/nc/definition/delete", + }, + dictOptions:{}, + } + }, + created() { + }, + computed: { + importExcelUrl: function(){ + return `${window._CONFIG['domianURL']}/${this.url.importExcelUrl}`; + }, + }, + methods: { + initDictConfig(){ + } + } +} +</script> +<style scoped> +@import '~@assets/less/common.less'; +</style> \ No newline at end of file diff --git a/src/views/dnc/base/NcDeviceCharactersList.vue b/src/views/dnc/base/NcDeviceCharactersList.vue index 9cb34fd..94a3dc2 100644 --- a/src/views/dnc/base/NcDeviceCharactersList.vue +++ b/src/views/dnc/base/NcDeviceCharactersList.vue @@ -143,7 +143,7 @@ // 琛ㄥご columns: [ { - title: '#', + title: '搴忓彿', dataIndex: '', key:'rowIndex', width:200, diff --git a/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserForm.vue b/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserForm.vue new file mode 100644 index 0000000..6d09688 --- /dev/null +++ b/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserForm.vue @@ -0,0 +1,198 @@ +<!-- + Description: 娴佺▼閰嶇疆绠$悊椤甸潰 Form + Author: 浣滆�� liuyh + Date: 2025-01-15 +--> +<template> + <a-spin :spinning="confirmLoading"> + <j-form-container :disabled="formDisabled"> + <a-form :form="form" slot="detail"> + <a-row> + <a-col :span="24"> + <a-form-item label="娴佺▼鍚嶇О" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <a-input :disabled="formDisabled" v-decorator="['actName', validatorRules.actName]" placeholder="璇疯緭鍏ユ祦绋嬪悕绉�"></a-input> + </a-form-item> + </a-col> + <a-col :span="24"> + <a-form-item label="鎵�灞為儴闂�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-dict-select-tag :disabled="formDisabled" type="list" v-decorator="['departId']" :trigger-change="true" dictCode="sys_department,depart_name,depart_id" placeholder="璇烽�夋嫨鎵�灞為儴闂�"/> + </a-form-item> + </a-col> + <a-col :span="24"> + <a-form-item label="瀹℃壒浜�" :labelCol="labelCol" :wrapperCol="wrapperCol"> + <j-select-multi-user valueKey="id" displayKey="realname" v-decorator="['approveUsers']" placeholder="璇烽�夋嫨瀹℃壒浜�"/> + {{ getFormFieldValue('approveUsers') }} + </a-form-item> + </a-col> + <a-col v-if="showFlowSubmitButton" :span="24" style="text-align: center"> + <a-button @click="submitForm">鎻� 浜�</a-button> + </a-col> + </a-row> + </a-form> + </j-form-container> + </a-spin> +</template> + +<script> + + import { httpAction, getAction } from '@/api/manage' + import pick from 'lodash.pick' + import JFormContainer from '@/components/jeecg/JFormContainer' + import JDictSelectTag from "@/components/dict/JDictSelectTag" + + export default { + name: 'AssignApproveUserForm', + components: { + JFormContainer, + JDictSelectTag, + }, + props: { + //娴佺▼琛ㄥ崟data + formData: { + type: Object, + default: ()=>{}, + required: false + }, + //琛ㄥ崟妯″紡锛歵rue娴佺▼琛ㄥ崟 false鏅�氳〃鍗� + formBpm: { + type: Boolean, + default: false, + required: false + }, + //琛ㄥ崟绂佺敤 + disabled: { + type: Boolean, + default: false, + required: false + } + }, + data () { + return { + form: this.$form.createForm(this), + users:"", + model: {}, + labelCol: { + xs: { span: 24 }, + sm: { span: 5 }, + }, + wrapperCol: { + xs: { span: 24 }, + sm: { span: 16 }, + }, + confirmLoading: false, + validatorRules: { + actName: { + rules: [ + { required: true, message: '璇疯緭鍏ユ祦绋嬪悕绉�!'}, + ] + }, + departId: { + rules: [ + { required: true, message: '璇烽�夋嫨閮ㄩ棬鍒嗙粍!'}, + ] + }, + approveUsers: { + rules: [ + { required: true, message: '璇烽�夋嫨瀹℃壒浜�!'}, + ] + }, + characters: { + rules: [ + { required: true, message: '璇疯緭鍏ョ壒娈婂瓧绗�!'}, + ] + }, + }, + url: { + add: "/nc/definition/add", + edit: "/nc/definition/edit", + // queryById: "/zhshj/wglltwh/query/by/id" + }, + userOptions:[] + } + }, + computed: { + formDisabled(){ + if(this.formBpm===true){ + if(this.formData.disabled===false){ + return false + } + return true + } + return this.disabled + }, + showFlowSubmitButton(){ + if(this.formBpm===true){ + if(this.formData.disabled===false){ + return true + } + } + return false + } + }, + created () { + //濡傛灉鏄祦绋嬩腑琛ㄥ崟锛屽垯闇�瑕佸姞杞芥祦绋嬭〃鍗昫ata + this.showFlowData(); + }, + 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,'actName','departId','approveUsers')) + }) + }, + getFormFieldValue(field){ + return this.form.getFieldValue(field) + }, + //娓叉煋娴佺▼琛ㄥ崟鏁版嵁 + showFlowData(){ + if(this.formBpm === true){ + let params = {id:this.formData.dataId}; + getAction(this.url.queryById,params).then((res)=>{ + if(res.success){ + this.edit (res.result); + } + }); + } + }, + submitForm () { + 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; + }) + } + + }) + }, + popupCallback(row){ + this.form.setFieldsValue(pick(row,'actName','departId','approveUsers')) + }, + } + } +</script> \ No newline at end of file diff --git a/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal.vue b/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal.vue new file mode 100644 index 0000000..77c620a --- /dev/null +++ b/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal.vue @@ -0,0 +1,65 @@ +<!-- + Description: 娴佺▼閰嶇疆绠$悊椤甸潰 Modal + Author: 浣滆�� liuyh + Date: 2025-01-15 +--> +<template> + <j-modal + :title="title" + :width="width" + :visible="visible" + switchFullscreen + @ok="handleOk" + :okButtonProps="{ class:{'jee-hidden': disableSubmit} }" + @cancel="handleCancel" + cancelText="鍏抽棴"> + <AssignApproveUserForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit"></AssignApproveUserForm> + </j-modal> +</template> + +<script> + + import AssignApproveUserForm from './AssignApproveUserForm.vue' + export default { + name: 'AssignApproveUserModal', + components: { + AssignApproveUserForm + }, + 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/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal__Style\043Drawer.vue" "b/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal__Style\043Drawer.vue" new file mode 100644 index 0000000..d65feb5 --- /dev/null +++ "b/src/views/dnc/base/modules/AssignApproveUser/AssignApproveUserModal__Style\043Drawer.vue" @@ -0,0 +1,91 @@ +<!-- + Description: 娴佺▼閰嶇疆绠$悊椤甸潰 Modal-Drawer + Author: 浣滆�� liuyh + Date: 2025-01-15 +--> +<template> + <a-drawer + :title="title" + :width="width" + placement="right" + :closable="false" + @close="close" + destroyOnClose + :visible="visible"> + <AssignApproveUserForm ref="realForm" @ok="submitCallback" :disabled="disableSubmit" normal></AssignApproveUserForm> + <div class="drawer-footer"> + <a-button @click="handleCancel" style="margin-bottom: 0;">鍏抽棴</a-button> + <a-button v-if="!disableSubmit" @click="handleOk" type="primary" style="margin-bottom: 0;">鎻愪氦</a-button> + </div> + </a-drawer> +</template> + +<script> + + + +import AssignApproveUserForm from './AssignApproveUserForm.vue' + +export default { + name: 'AssignApproveUserModal', + components: { + AssignApproveUserForm, + }, + 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; + }, + submitCallback() { + this.$emit('ok'); + this.visible = false; + }, + handleOk() { + this.$refs.realForm.submitForm(); + }, + handleCancel() { + this.close() + } + } +} +</script> + +<style lang="less" scoped> +/** Button鎸夐挳闂磋窛 */ +.ant-btn { + margin-left: 30px; + margin-bottom: 30px; + float: right; +} +.drawer-footer{ + position: absolute; + bottom: -8px; + width: 100%; + border-top: 1px solid #e8e8e8; + padding: 10px 16px; + text-align: right; + left: 0; + background: #fff; + border-radius: 0 0 2px 2px; +} +</style> \ No newline at end of file -- Gitblit v1.9.3