浏览代码

会议内容富文本

wangwei 3 年之前
父节点
当前提交
5bb7f72c37

+ 1 - 0
package.json

@@ -46,6 +46,7 @@
     "pinia": "2.0.0-alpha.13",
     "qrcode": "^1.4.4",
     "sortablejs": "^1.13.0",
+    "tinymce": "^5.10.0",
     "vue": "3.0.11",
     "vue-i18n": "9.1.6",
     "vue-router": "^4.0.8",

+ 0 - 4
src/components/Form/src/components/MultipleTreeSelect.vue

@@ -22,11 +22,7 @@
     },
     setup() {
       const value = ref<string[]>([]);
-      console.log(value);
-      console.log('++++++++++++++++++++++++++');
       watch(value, () => {
-        console.log('------------------------');
-        console.log(value);
         console.log('select', value.value);
       });
       return {

+ 48 - 0
src/views/department/department/customCom/EditInput.vue

@@ -0,0 +1,48 @@
+<template>
+  <!-- <BasicTable @register="registerTable" /> -->
+  <div class="wrap">
+    <div class="content">
+      <Input :placeholder="placeholder" disabled v-model:value="value" />
+      <a-button
+        class="mr-2 add-btn"
+        color="success"
+        :disabled="disabled"
+        @click="openAddPop(placeholder)"
+      >
+        添加
+      </a-button>
+    </div>
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent } from 'vue';
+  import { Input } from 'ant-design-vue';
+  import Popup from './popup.vue';
+
+  const props = {
+    value: { type: Object, default: '' },
+    placeholder: { type: String, default: '' },
+  };
+
+  export default defineComponent({
+    name: 'CustomInput',
+    components: { Input, Popup },
+    props,
+    emits: ['change'],
+    setup(props, { emit }) {
+
+      return {
+
+      };
+    },
+  });
+</script>
+<style scoped>
+  .content {
+    display: flex;
+  }
+
+  .add-btn {
+    margin-left: 2px;
+  }
+</style>

+ 9 - 2
src/views/event/activity/data.ts

@@ -2,6 +2,8 @@ import { FormProps, BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Form/index';
 import { adapt } from '/@/utils/adapt';
 import moment from 'moment';
+import { Tinymce } from '/@/components/Tinymce/index';
+import { h } from 'vue';
 
 const adaptWidth = adapt();
 
@@ -341,8 +343,13 @@ export const schemas: FormSchema[] = [
     colProps: {
       span: adaptWidth.elContainer,
     },
-    componentProps: {
-      placeholder: '活动内容',
+    render: ({ model, field }) => {
+      return h(Tinymce, {
+        value: model[field],
+        onChange: (value: string) => {
+          model[field] = value;
+        },
+      });
     },
   },
   {

+ 10 - 3
src/views/event/meeting/data.ts

@@ -2,6 +2,8 @@ import { FormProps, BasicColumn } from '/@/components/Table';
 import { FormSchema } from '/@/components/Form/index';
 import { adapt } from '/@/utils/adapt';
 import moment from 'moment';
+import { Tinymce } from '/@/components/Tinymce/index';
+import { h } from 'vue';
 
 const adaptWidth = adapt();
 
@@ -335,14 +337,19 @@ export const schemas: FormSchema[] = [
   },
   {
     field: 'content',
-    component: 'InputTextArea',
+    component: 'Input',
     label: '会议内容',
     labelWidth: adaptWidth.labelWidth,
     colProps: {
       span: adaptWidth.elContainer,
     },
-    componentProps: {
-      placeholder: '会议内容',
+    render: ({ model, field }) => {
+      return h(Tinymce, {
+        value: model[field],
+        onChange: (value: string) => {
+          model[field] = value;
+        },
+      });
     },
   },
   {

+ 2 - 2
src/views/general/config/customComponents/ChooseModal.vue

@@ -11,7 +11,7 @@
       ref="tableRef"
       rowKey="id"
       @register="registerTable"
-      :rowSelection="{ type: type === 'images' ? 'checkbox' : 'radio' }"
+      :rowSelection="{ type: type === 'images' || type === 'files' ? 'checkbox' : 'radio' }"
     >
       <template #action="{ record, column }">
         <TableAction :actions="createActions(record, column)" />
@@ -64,7 +64,7 @@
           emit('checked', rows);
           closeModal();
         } else {
-          error('请先选择图片');
+          error('请先选择文件!');
         }
       }
       onUpdated(() => {

+ 171 - 0
src/views/general/config/customComponents/UploadFile.vue

@@ -0,0 +1,171 @@
+<template>
+  <div>
+    <div style="display: flex">
+      <Input class="upload-input" :value="fileUrls" disabled />
+      <BasicUpload
+        :maxSize="20"
+        :maxNumber="10"
+        @change="handleChange"
+        :api="uploadApi"
+        class="my-3"
+      />
+      <a-button
+        @click="openChooseModal"
+        style="position: relative; top: 12px; margin: 0 5px"
+        type="danger"
+        preIcon="ic:sharp-view-list"
+        :iconSize="16"
+      >
+        选择
+      </a-button>
+      <span class="tip-span" v-if="tipShow">{{ tip }}</span>
+    </div>
+
+    <div class="file-list" v-if="file_list.length">
+      <div v-for="(item, index) in file_list" :key="index">
+        <div class="file-item" v-if="item !== ''">
+          <div class="file-wrap"> <a-image width="70px" :src="imgUrlPrefix + item" /></div>
+          <div class="dele-file" @click="deleteFile(item, index)">
+            <Icon icon="ri:delete-bin-5-fill" />
+          </div>
+        </div>
+      </div>
+    </div>
+    <ChooseModal :type="type" @register="chooseModalRegister" @checked="checked" />
+  </div>
+</template>
+<script lang="ts">
+  import { defineComponent, watch, reactive, toRefs } from 'vue';
+  import { BasicUpload } from '/@/components/Upload';
+  // import { useMessage } from '/@/hooks/web/useMessage';
+  import { uploadApi } from '/@/api/sys/upload';
+  import ChooseModal from './ChooseModal.vue';
+  import { useGlobSetting } from '/@/hooks/setting';
+  import { useModal } from '/@/components/Modal';
+  import { Image, Input } from 'ant-design-vue';
+  import Icon from '/@/components/Icon';
+
+  const props = {
+    value: { type: String, default: '' },
+    tip: { type: String, default: '' },
+    type: { type: String, default: '' },
+    errMsg: { type: String, default: '' },
+    rules: { type: Array, default: [] },
+  };
+  interface PropsType {
+    value: string;
+    tip: string;
+    type: string;
+    errMsg: string;
+    rules: [];
+  }
+  export default defineComponent({
+    components: { BasicUpload, ChooseModal, aImage: Image, Input, Icon },
+    props,
+    emits: ['change'],
+    setup(props, { emit }) {
+      // const { createMessage } = useMessage();
+      const { imgUrlPrefix } = useGlobSetting();
+      const [chooseModalRegister, { openModal }] = useModal();
+      function openChooseModal() {
+        openModal(true);
+      }
+      const state = reactive({
+        fileUrls: props.value,
+        file_list: [] as string[],
+        tipShow: false,
+      });
+      state.file_list = props.value.split(',');
+      function deleteFile(url, index) {
+        console.log(`url`, url);
+        const arr = state.fileUrls.split(',');
+        arr.splice(index, 1);
+        state.fileUrls = arr.toString();
+        emit('change', state.fileUrls);
+      }
+      function checked(files) {
+        if (props.type === 'image') {
+          state.fileUrls = files[0].url;
+        } else {
+          let urls: string[] = [];
+          files.map((item) => {
+            urls.push(item.url);
+          });
+          state.fileUrls += ',' + urls.toString();
+        }
+        emit('change', state.fileUrls);
+      }
+
+      watch(props, (props: PropsType) => {
+        state.file_list = props.value.split(',');
+      });
+
+      return {
+        handleChange: (list: string[]) => {
+          if (props.type === 'file') {
+            state.fileUrls = list[0];
+          } else {
+            state.fileUrls = list.toString();
+          }
+          emit('change', state.fileUrls);
+        },
+        checked,
+        imgUrlPrefix,
+        openChooseModal,
+        deleteFile,
+        uploadApi,
+        chooseModalRegister,
+        openModal,
+        ...toRefs(props),
+        ...toRefs(state),
+      };
+    },
+  });
+</script>
+<style scoped>
+  .upload-input {
+    position: relative;
+    top: 11px;
+    width: 45%;
+    height: 34px;
+    margin-right: 5px;
+  }
+
+  .file-list {
+    display: flex;
+    flex-wrap: wrap;
+    width: 70%;
+  }
+
+  .file-item {
+    width: 120px;
+    margin: 0 5px;
+    text-align: center;
+  }
+
+  .file-wrap {
+    display: flex;
+    align-items: center;
+    justify-content: space-around;
+    width: 100%;
+    height: 80px;
+    border: 1px solid #ddd;
+    border-radius: 2px;
+  }
+
+  .dele-file {
+    height: 20px;
+    margin: 8px 0;
+    color: #fff;
+    background: #e74c3c;
+    border-radius: 2px;
+  }
+
+  .tip-span {
+    position: relative;
+    top: 11px;
+    font-size: 13px;
+    line-height: 250%;
+    color: gray;
+  }
+</style>

+ 0 - 3
src/views/member/member/customCom/CustomInput.vue

@@ -44,7 +44,6 @@
         disabled: false,
         type: '',
       });
-      console.log(`props.type?????`, props.type);
       const [register, { openModal: openPopup }] = useModal();
       // 初始化
       function init() {
@@ -55,7 +54,6 @@
             state.placeholder = '添加相关单位';
           }
           if (props.value.name) {
-            console.log(`props.value.name`, props.value.name);
             state.value = props.value.name;
           } else {
             state.value = props.value;
@@ -79,7 +77,6 @@
           } else {
             state.disabled = false;
           }
-          console.log(`state`, state);
           if (!state.disabled) {
             emit('change', '');
           }

+ 1 - 8
src/views/member/member/customCom/person/index.vue

@@ -50,7 +50,6 @@
           size: false,
         },
         beforeFetch: beforeFetch,
-        afterFetch: afterFetch,
         formConfig: getFormConfig(),
         maxHeight: 190,
         showIndexColumn: false,
@@ -95,10 +94,6 @@
         delete params.page;
         delete params.pageSize;
       }
-      function afterFetch(result) {
-        console.log(`result`, result);
-        // tableData.result = result;
-      }
 
       function handleAdd() {
         // 开启弹窗
@@ -115,9 +110,7 @@
       async function saveData(params: any) {
         const data = params.data;
         const closeModel = params.closeModal;
-        console.log(`data`, data);
-        await addPerson(data).then((res) => {
-          console.log(res);
+        await addPerson(data).then(() => {
           getTableAction().reload();
           closeModel();
           success('创建成功!');

+ 1 - 9
src/views/member/member/customCom/unit/index.vue

@@ -50,7 +50,6 @@
           size: false,
         },
         beforeFetch: beforeFetch,
-        afterFetch: afterFetch,
         formConfig: getFormConfig(),
         maxHeight: 190,
         showIndexColumn: false,
@@ -97,11 +96,6 @@
         delete params.pageSize;
       }
 
-      function afterFetch(result) {
-        console.log(`result`, result);
-        // tableData.result = result;
-      }
-
       function handleAdd() {
         // 开启弹窗
         openPopup(true, { family: [] });
@@ -118,9 +112,7 @@
       async function saveData(params: any) {
         const data = params.data;
         const closeModel = params.closeModal;
-        console.log(`data`, data);
-        await addUnit(data).then((res) => {
-          console.log(res);
+        await addUnit(data).then(() => {
           getTableAction().reload();
           closeModel();
           success('创建成功!');

+ 0 - 1
src/views/member/member/customCom/unit/popup.vue

@@ -57,7 +57,6 @@
       async function confirm() {
         try {
           const data = await validate();
-          console.log(`确定`, data);
           if (role.id) {
             data.id = role.id;
           } else {

+ 12 - 1
src/views/money/bill/data.ts

@@ -8,7 +8,10 @@ import CustomUpload from './customCom/CustomUpload.vue';
 import YearPicker from './customCom/YearPicker.vue';
 import moment from 'moment';
 import { getYearFee } from '/@/api/sys/money';
+import { useMessage } from '/@/hooks/web/useMessage';
 
+const { createMessage } = useMessage();
+const { error } = createMessage;
 const adaptWidth = adapt();
 
 export const columns: BasicColumn[] = [
@@ -32,7 +35,7 @@ export const columns: BasicColumn[] = [
     customRender({ record }) {
       const inOut = record.type;
       let color = 'red';
-      let text = '未定义';
+      let text = '会费';
       switch (inOut) {
         case 0:
           text = '会费';
@@ -297,6 +300,10 @@ export const schemas: FormSchema[] = [
         value: model.account,
         placeholder: '添加账户',
         onChange(value) {
+          if (model.type === 3 && model.inaccount && value.id === model.inaccount.id) {
+            error('交易账户不能是流入账户!');
+            return;
+          }
           model[field] = value;
         },
       });
@@ -316,6 +323,10 @@ export const schemas: FormSchema[] = [
         value: model.inaccount,
         placeholder: '添加账户',
         onChange(value) {
+          if (model.type === 3 && model.account && value.id === model.account.id) {
+            error('交易账户不能是流入账户!');
+            return;
+          }
           model[field] = value;
         },
       });

+ 4 - 2
src/views/money/bill/popup.vue

@@ -94,7 +94,10 @@
       async function confirm() {
         try {
           const data = await validate();
-          console.log(`确定`, data);
+          if (data.type === 3 && data.account.id === data.inaccount.id) {
+            error('交易账户和流入账户不能是同一个!');
+            return;
+          }
           data.id = role.id;
           data.accountId = data.account.id;
           data.typeId = data.typename.id;
@@ -115,7 +118,6 @@
           const popupData = { closeModal, data };
           emit('saveData', popupData);
         } catch (err: any) {
-          console.log(`err`, err);
           error(err.errorFields[0].errors[0]);
         }
       }

+ 5 - 0
yarn.lock

@@ -9841,6 +9841,11 @@ tinycolor2@^1.4.2:
   resolved "https://registry.yarnpkg.com/tinycolor2/-/tinycolor2-1.4.2.tgz#3f6a4d1071ad07676d7fa472e1fac40a719d8803"
   integrity sha512-vJhccZPs965sV/L2sU4oRQVAos0pQXwsvTLkWYdqJ+a8Q5kPFzJTuOFwy7UniPli44NKQGAglksjvOcpo95aZA==
 
+tinymce@^5.10.0:
+  version "5.10.0"
+  resolved "https://registry.yarnpkg.com/tinymce/-/tinymce-5.10.0.tgz#5f88b40c2b26dc72b126f7d04944014dcb1ace05"
+  integrity sha512-SaqBK8GtTKYSsTfhKdN0+NrZRgmVWO+j3fvgzLjt0t/g0osNzRH5os8icm2Rv5HvaeTd4TpxetUuLE+R9yg/yg==
+
 tmp@^0.0.33:
   version "0.0.33"
   resolved "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9"