diff --git a/.env.development b/.env.development index 3c0276d..a745ea4 100644 --- a/.env.development +++ b/.env.development @@ -4,8 +4,8 @@ ENV = 'development' # 许镇-本地服地址 VUE_APP_BASE_API = 'http://192.168.99.63:14000' -# VUE_APP_BASE_API = 'http://192.168.99.86:12010' -#VUE_APP_BASE_API = 'http://27.19.205.234:17070' +# VUE_APP_BASE_API = 'https://wechatapi.aiyxlib.com' +VUE_APP_WECHAT_URL = 'https://wechatapi.aiyxlib.com' # 是否启用 babel-plugin-dynamic-import-node插件 diff --git a/package.json b/package.json index 04cd0a5..773c2ec 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,8 @@ "@tinymce/tinymce-vue": "^3.0.1", "@vue-office/docx": "^1.6.0", "@vue-office/excel": "^1.6.5", + "@wangeditor/editor": "^5.1.23", + "@wangeditor/editor-for-vue": "^1.0.2", "axios": "^0.21.1", "chokidar": "^3.5.3", "clipboard": "2.0.4", diff --git a/src/api/weixin/index.js b/src/api/weixin/index.js index bfba8af..d933cbb 100644 --- a/src/api/weixin/index.js +++ b/src/api/weixin/index.js @@ -40,9 +40,19 @@ export function FetchCancelResumeActivity(data) { }) } +// 删除活动 +export function FetchDeleteActivity(data) { + return request({ + url: 'api/weixin/deleteActivity', + method: 'post', + data + }) +} + export default { FetchReplyReaderMessage, add, edit, - FetchCancelResumeActivity + FetchCancelResumeActivity, + FetchDeleteActivity } diff --git a/src/assets/iconfonts/light/iconfont.css b/src/assets/iconfonts/light/iconfont.css index f8a9b7d..5eacff6 100644 --- a/src/assets/iconfonts/light/iconfont.css +++ b/src/assets/iconfonts/light/iconfont.css @@ -1,8 +1,8 @@ @font-face { font-family: "iconfont"; /* Project id 3966148 */ - src: url('iconfont.woff2?t=1760517327121') format('woff2'), - url('iconfont.woff?t=1760517327121') format('woff'), - url('iconfont.ttf?t=1760517327121') format('truetype'); + src: url('iconfont.woff2?t=1786692606445') format('woff2'), + url('iconfont.woff?t=1786692606445') format('woff'), + url('iconfont.ttf?t=1786692606445') format('truetype'); } .iconfont { @@ -13,6 +13,82 @@ -moz-osx-font-smoothing: grayscale; } +.icon-shanchu-:before { + content: "\e6aa"; +} + +.icon-huifu1:before { + content: "\e6ab"; +} + +.icon-tjg:before { + content: "\e6ac"; +} + +.icon-gb:before { + content: "\e6ad"; +} + +.icon-Group:before { + content: "\e6ae"; +} + +.icon-xiajia:before { + content: "\e7aa"; +} + +.icon-cangku:before { + content: "\e927"; +} + +.icon-baojingjilu:before { + content: "\e6a8"; +} + +.icon-yitiji:before { + content: "\e6a2"; +} + +.icon-kufangguanli:before { + content: "\e6a3"; +} + +.icon-renlianshibiejiqi:before { + content: "\e759"; +} + +.icon-wangluoshexiangtou:before { + content: "\e754"; +} + +.icon-Dkufang:before { + content: "\e6a4"; +} + +.icon-rfidduxieqi:before { + content: "\e879"; +} + +.icon-shouchipandianyi:before { + content: "\e6a5"; +} + +.icon-zhinengyitiji:before { + content: "\e6a6"; +} + +.icon-a-3D-xidingtanceqi:before { + content: "\e6b7"; +} + +.icon-saomiao:before { + content: "\e6a7"; +} + +.icon-mimachakan:before { + content: "\e6a1"; +} + .icon-d:before { content: "\e6a0"; } diff --git a/src/assets/iconfonts/light/iconfont.js b/src/assets/iconfonts/light/iconfont.js index 578f0a9..048339c 100644 --- a/src/assets/iconfonts/light/iconfont.js +++ b/src/assets/iconfonts/light/iconfont.js @@ -1 +1 @@ -window._iconfont_svg_string_3966148='',(l=>{var c=(a=(a=document.getElementsByTagName("script"))[a.length-1]).getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var h,i,o,t,z,v=function(c,a){a.parentNode.insertBefore(c,a)};if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}h=function(){var c,a=document.createElement("div");a.innerHTML=l._iconfont_svg_string_3966148,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(c=document.body).firstChild?v(a,c.firstChild):c.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,t=l.document,z=!1,p(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,s())})}function s(){z||(z=!0,o())}function p(){try{t.documentElement.doScroll("left")}catch(c){return void setTimeout(p,50)}s()}})(window); \ No newline at end of file +window._iconfont_svg_string_3966148='',(l=>{var c=(a=(a=document.getElementsByTagName("script"))[a.length-1]).getAttribute("data-injectcss"),a=a.getAttribute("data-disable-injectsvg");if(!a){var h,i,o,t,z,v=function(c,a){a.parentNode.insertBefore(c,a)};if(c&&!l.__iconfont__svg__cssinject__){l.__iconfont__svg__cssinject__=!0;try{document.write("")}catch(c){console&&console.log(c)}}h=function(){var c,a=document.createElement("div");a.innerHTML=l._iconfont_svg_string_3966148,(a=a.getElementsByTagName("svg")[0])&&(a.setAttribute("aria-hidden","true"),a.style.position="absolute",a.style.width=0,a.style.height=0,a.style.overflow="hidden",a=a,(c=document.body).firstChild?v(a,c.firstChild):c.appendChild(a))},document.addEventListener?~["complete","loaded","interactive"].indexOf(document.readyState)?setTimeout(h,0):(i=function(){document.removeEventListener("DOMContentLoaded",i,!1),h()},document.addEventListener("DOMContentLoaded",i,!1)):document.attachEvent&&(o=h,t=l.document,z=!1,p(),t.onreadystatechange=function(){"complete"==t.readyState&&(t.onreadystatechange=null,s())})}function s(){z||(z=!0,o())}function p(){try{t.documentElement.doScroll("left")}catch(c){return void setTimeout(p,50)}s()}})(window); \ No newline at end of file diff --git a/src/assets/iconfonts/light/iconfont.json b/src/assets/iconfonts/light/iconfont.json index 8f0061f..1c5910b 100644 --- a/src/assets/iconfonts/light/iconfont.json +++ b/src/assets/iconfonts/light/iconfont.json @@ -5,6 +5,139 @@ "css_prefix_text": "icon-", "description": "", "glyphs": [ + { + "icon_id": "1817720", + "name": "删除-3", + "font_class": "shanchu-", + "unicode": "e6aa", + "unicode_decimal": 59050 + }, + { + "icon_id": "1817721", + "name": "恢复", + "font_class": "huifu1", + "unicode": "e6ab", + "unicode_decimal": 59051 + }, + { + "icon_id": "1817730", + "name": "tjg", + "font_class": "tjg", + "unicode": "e6ac", + "unicode_decimal": 59052 + }, + { + "icon_id": "1817776", + "name": "gb", + "font_class": "gb", + "unicode": "e6ad", + "unicode_decimal": 59053 + }, + { + "icon_id": "1817794", + "name": "Group 2", + "font_class": "Group", + "unicode": "e6ae", + "unicode_decimal": 59054 + }, + { + "icon_id": "10599880", + "name": "icon-xiajiashenhe", + "font_class": "xiajia", + "unicode": "e7aa", + "unicode_decimal": 59306 + }, + { + "icon_id": "44433330", + "name": "仓库", + "font_class": "cangku", + "unicode": "e927", + "unicode_decimal": 59687 + }, + { + "icon_id": "30256923", + "name": "报警记录", + "font_class": "baojingjilu", + "unicode": "e6a8", + "unicode_decimal": 59048 + }, + { + "icon_id": "79099", + "name": "一体机", + "font_class": "yitiji", + "unicode": "e6a2", + "unicode_decimal": 59042 + }, + { + "icon_id": "6296998", + "name": "库房管理", + "font_class": "kufangguanli", + "unicode": "e6a3", + "unicode_decimal": 59043 + }, + { + "icon_id": "8434614", + "name": "人脸识别机器", + "font_class": "renlianshibiejiqi", + "unicode": "e759", + "unicode_decimal": 59225 + }, + { + "icon_id": "9437011", + "name": "网络摄像头", + "font_class": "wangluoshexiangtou", + "unicode": "e754", + "unicode_decimal": 59220 + }, + { + "icon_id": "11661938", + "name": "3D库房", + "font_class": "Dkufang", + "unicode": "e6a4", + "unicode_decimal": 59044 + }, + { + "icon_id": "19373677", + "name": "rfid读写器", + "font_class": "rfidduxieqi", + "unicode": "e879", + "unicode_decimal": 59513 + }, + { + "icon_id": "31422233", + "name": "手持盘点仪", + "font_class": "shouchipandianyi", + "unicode": "e6a5", + "unicode_decimal": 59045 + }, + { + "icon_id": "36973886", + "name": "智能一体机", + "font_class": "zhinengyitiji", + "unicode": "e6a6", + "unicode_decimal": 59046 + }, + { + "icon_id": "40950858", + "name": "3D-吸顶探测器", + "font_class": "a-3D-xidingtanceqi", + "unicode": "e6b7", + "unicode_decimal": 59063 + }, + { + "icon_id": "43488473", + "name": "吸顶式盘点设备", + "font_class": "saomiao", + "unicode": "e6a7", + "unicode_decimal": 59047 + }, + { + "icon_id": "26584955", + "name": "密码查看", + "font_class": "mimachakan", + "unicode": "e6a1", + "unicode_decimal": 59041 + }, { "icon_id": "13302910", "name": "3d", diff --git a/src/assets/iconfonts/light/iconfont.ttf b/src/assets/iconfonts/light/iconfont.ttf index f452133..013e42d 100644 Binary files a/src/assets/iconfonts/light/iconfont.ttf and b/src/assets/iconfonts/light/iconfont.ttf differ diff --git a/src/assets/iconfonts/light/iconfont.woff b/src/assets/iconfonts/light/iconfont.woff index 92d2fb0..31304b1 100644 Binary files a/src/assets/iconfonts/light/iconfont.woff and b/src/assets/iconfonts/light/iconfont.woff differ diff --git a/src/assets/iconfonts/light/iconfont.woff2 b/src/assets/iconfonts/light/iconfont.woff2 index 5e25cc3..cf5ab2a 100644 Binary files a/src/assets/iconfonts/light/iconfont.woff2 and b/src/assets/iconfonts/light/iconfont.woff2 differ diff --git a/src/components/wangEditor/index.vue b/src/components/wangEditor/index.vue new file mode 100644 index 0000000..5a3ebad --- /dev/null +++ b/src/components/wangEditor/index.vue @@ -0,0 +1,174 @@ + + + + + + + diff --git a/src/views/weChatMiniProgram/activity.vue b/src/views/weChatMiniProgram/activity.vue index d670695..2a016fd 100644 --- a/src/views/weChatMiniProgram/activity.vue +++ b/src/views/weChatMiniProgram/activity.vue @@ -2,13 +2,22 @@
+ - - @@ -161,43 +169,59 @@ {{ scope.row.activityPeople || '不限制' }} - + - + - @@ -210,21 +234,23 @@ import crudWeChat from '@/api/weixin/index' import '@riophae/vue-treeselect/dist/vue-treeselect.css' import CRUD, { presenter, header, form, crud } from '@crud/crud' import crudOperation from '@crud/CRUD.operation' +import rrOperation from '@crud/RR.operation' import pagination from '@crud/Pagination' import { mapGetters } from 'vuex' -import QuillEditor from '@/components/quillEditor/index.vue' +import WangEditor from '@/components/wangEditor/index.vue' import { getToken } from '@/utils/auth' +import DateRangePicker from '@/components/DateRangePicker' import ActivityDetail from './module/activityDetail.vue' -const defaultForm = { id: null, title: null, startTime: null, endTime: null, activityPeople: null, numberLimit: 1, activityLocation: null, coverImage: null } +const defaultForm = { id: null, libcode: null, title: null, startTime: null, endTime: null, activityPeople: null, numberLimit: 1, activityLocation: null, coverImage: null } export default { name: 'Activity', - components: { crudOperation, pagination, QuillEditor, ActivityDetail }, + components: { crudOperation, rrOperation, pagination, DateRangePicker, WangEditor, ActivityDetail }, cruds() { return CRUD({ title: '活动', url: 'api/weixin/initActivityInfo', crudMethod: { ...crudWeChat }, optShow: { add: true, - edit: true, + edit: false, del: false, download: false, group: false, @@ -235,7 +261,14 @@ export default { mixins: [presenter(), header(), form(defaultForm), crud()], data() { return { + blurryTime: null, permission: { add: [], edit: [], del: [] }, + statusOptions: [ + { key: 0, display_name: '未开始' }, + { key: 1, display_name: '进行中' }, + { key: 2, display_name: '已结束' }, + { key: -1, display_name: '已取消' } + ], imageUrl: require('@/assets/images/system/default-img.jpg'), editorRef: 'test', editorContent: '', @@ -312,17 +345,37 @@ export default { ]), uploadHeaders() { return { Authorization: getToken() } + }, + imgHttpsUrl() { + if (process.env.NODE_ENV === 'production') { + return (window.g && window.g.ApiUrl) || '' + } else { + return process.env.VUE_APP_WECHAT_URL + } } }, methods: { [CRUD.HOOK.beforeRefresh]() { this.crud.params.libcode = this.user.fonds.fondsNo + if (this.blurryTime) { + this.crud.query.startTime = this.blurryTime[0] + this.crud.query.endTime = this.blurryTime[1] + } else { + this.crud.query.startTime = null + this.crud.query.endTime = null + } + if (this.query.status != null) { + this.crud.params.status = [this.query.status] + } else { + this.crud.params.status = [0, 1, 2, -1] + } }, // 新增与编辑前做的操作 [CRUD.HOOK.afterToCU](crud, form) { }, // 新增前 [CRUD.HOOK.beforeToAdd]() { + this.editorContent = '' }, // 初始化编辑时候 [CRUD.HOOK.beforeToEdit](crud, form) { @@ -340,9 +393,11 @@ export default { crud.form.activityPeople = 0 } delete crud.form.numberLimit + crud.form.libcode = this.user.fonds.fondsNo console.log('crud.form', crud.form) return true }, + validateNumber() { this.$refs.form.validateField('activityPeople') }, @@ -415,6 +470,22 @@ export default { } }).catch(() => {}) }, + handleRepublish(row) { + // 拷贝原有行数据 + const copyRow = { ...row } + // 清空时间 + copyRow.startTime = null + copyRow.endTime = null + // 关键:删掉id,crud识别为新增 + delete copyRow.id + + // 调用toAdd打开新增弹窗,把复制的数据塞到form + this.crud.toAdd() + Object.assign(this.form, copyRow) + + // 编辑器赋值 + this.editorContent = copyRow.activityContent || '' + }, showCancelDialog(row) { this.cancelForm.title = row.title this.cancelForm.reason = '' @@ -438,27 +509,56 @@ export default { } }) }, - toDelete(datas) { - this.$confirm('此操作将删除当前所选活动你是否还要继续?', '提示', { + // 单条删除 + singleDelete(row) { + this.$confirm(`确定删除活动【${row.title}】?`, '删除提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(async() => { + const res = await crudWeChat.FetchDeleteActivity({ id: row.id }) + if (res.code !== 500) { + this.$message({ message: '删除成功', type: 'success', offset: 8 }) + this.crud.refresh() + } else { + this.$message({ message: res.message || '删除失败', type: 'error', offset: 8 }) + } + }).catch(() => {}) + }, + // 批量删除 + async toDelete(datas) { + // 过滤:只能 未开始 && 实约人数=0 + const validList = datas.filter(item => { + return item.status === '未开始' && Number(item.gridName || 0) === 0 + }) + const invalidCount = datas.length - validList.length + if (validList.length === 0) { + this.$message({ message: '选中的数据没有可删除项,仅可删除未开始且无人参与的活动', type: 'warning', offset: 8 }) + return + } + if (invalidCount > 0) { + this.$message({ message: `共选中${datas.length}条,其中${invalidCount}条不符合删除条件已跳过`, type: 'warning', offset: 8 }) + } + this.$confirm(`确认删除选中${validList.length}条符合条件的活动?`, '批量删除提示', { confirmButtonText: '继续', cancelButtonText: '取消', - type: 'warning', - dangerouslyUseHTMLString: true - }).then(() => { + type: 'warning' + }).then(async() => { this.crud.delAllLoading = true - const ids = [] - datas.forEach(val => { - ids.push(val.id) - }) - // crudCollBook.del(ids).then(() => { - // this.$message({ message: '删除成功', type: 'success', offset: 8 }) - // this.crud.delAllLoading = false - // this.crud.refresh() - // }).catch(err => { - // this.crud.delAllLoading = false - // console.log(err) - // }) + try { + // 接口只支持单条传id,则循环调用;若后端支持ids数组,这里可改传 {ids:[...]} + for (const item of validList) { + await crudWeChat.FetchDeleteActivity({ id: item.id }) + } + this.$message({ message: '批量删除完成', type: 'success', offset: 8 }) + this.crud.refresh() + } catch (e) { + this.$message({ message: '部分删除失败', type: 'error', offset: 8 }) + } finally { + this.crud.delAllLoading = false + } }).catch(() => { + this.crud.delAllLoading = false }) }, clickRowHandler(row) { @@ -472,6 +572,7 @@ export default { this.detailActivity = row this.detailVisible = true } + } } @@ -497,9 +598,6 @@ export default { } } } - .ql-container{ - height: 480px !important; - } .dialog-footer{ margin-top: 10px; } @@ -516,7 +614,6 @@ export default { height: 150px; display: block; object-fit: cover; - // border: 1px solid #e6e8ed; border-radius: 4px; } .upload-preview-placeholder{ @@ -526,7 +623,6 @@ export default { align-items: center; justify-content: center; border-radius: 4px; - // background-color: #fafafa; overflow: hidden; .placeholder-img{ width: 100%; @@ -576,4 +672,68 @@ export default { padding: 0 0 20px 0; } } +::v-deep .w-e-text-container{ + height: 480px !important; + overflow: hidden; + overflow-y: auto; +} +.op-btn-wrap { + display: flex; + justify-content: flex-start; + align-items: center; + gap: 4px; + .el-button { + padding: 6px !important; + margin: 0 !important; + .iconfont::before{ + margin: 0 !important; + } + } + + ::v-deep{ + .btn-cancel{ + background-color: #f65163; + color: #fff; + border-color: #f65163; + &:hover{ + background-color: #f65163; + } + .iconfont{ + font-size: 14px; + } + } + .btn-edit{ + background-color: #0348f3; + color: #fff; + border-color: #0348f3; + &:hover{ + background-color: #0348f3; + } + } + .btn-restore{ + background-color: #12C47A; + color: #fff; + border-color: #12C47A; + &:hover{ + background-color: #12C47A; + } + } + .btn-republish{ + background-color: #FF8329; + color: #fff; + border-color: #FF8329; + &:hover{ + background-color: #FF8329; + } + } + .btn-del-row{ + background-color:#909399; + color:#fff; + border-color:#909399; + &:hover{ + background-color:#73767a; + } + } + } +} diff --git a/src/views/weChatMiniProgram/activityLog.vue b/src/views/weChatMiniProgram/activityLog.vue index 3bbcc89..831d0b4 100644 --- a/src/views/weChatMiniProgram/activityLog.vue +++ b/src/views/weChatMiniProgram/activityLog.vue @@ -8,7 +8,7 @@ - +
@@ -37,24 +37,22 @@ --> - + - - - - - + + + - + @@ -78,7 +76,7 @@ export default { name: 'ActivityLog', components: { rrOperation, pagination }, cruds() { - return CRUD({ title: '活动预约', url: 'api/screenSetting/initScreenBookRecommend2', crudMethod: { ...crudWeChat }, + return CRUD({ title: '活动预约', url: 'api/weixin/mySignActivityInfo', crudMethod: { ...crudWeChat }, optShow: { add: false, edit: false, @@ -93,8 +91,10 @@ export default { data() { return { statusOptions: [ - { key: 1, display_name: '进行中' }, - { key: 0, display_name: '已取消' } + { key: 1, display_name: '已预约' }, + { key: 2, display_name: '进行中' }, + { key: 3, display_name: '已完成' }, + { key: -1, display_name: '已取消' } ], permission: { add: [], edit: [], del: [] } } @@ -108,28 +108,6 @@ export default { methods: { [CRUD.HOOK.beforeRefresh]() { this.crud.params.libcode = this.user.fonds.fondsNo - const mockData = [ - { - id: 1, - name: '张三', - contact: '13800000000', - title: '读书分享会', - number: 4, - status: 1, - create_time: '2026-01-10 10:00:00' - }, - { - id: 2, - name: '李四', - contact: '13800000001', - title: '新书发布会', - number: 1, - status: 0, - create_time: '2026-01-12 14:30:00' - } - ] - this.crud.data = mockData - this.crud.loading = false }, // 新增与编辑前做的操作 [CRUD.HOOK.afterToCU](crud, form) { diff --git a/src/views/weChatMiniProgram/module/activityDetail.vue b/src/views/weChatMiniProgram/module/activityDetail.vue index 5675ab9..7c8f434 100644 --- a/src/views/weChatMiniProgram/module/activityDetail.vue +++ b/src/views/weChatMiniProgram/module/activityDetail.vue @@ -1,7 +1,7 @@