diff --git a/package.json b/package.json index d1f66739..a027b85f 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "less": "^3.9.0", "less-loader": "^4.1.0", "lodash": "^4.17.21", - "mathjs": "^11.1.0", "mini-css-extract-plugin": "0.11.3", "moment": "^2.29.1", "optimize-css-assets-webpack-plugin": "5.0.4", diff --git a/src/components/UseCouponAddEdit/index copy 2.jsx b/src/components/UseCouponAddEdit/index copy 2.jsx deleted file mode 100644 index be3afd47..00000000 --- a/src/components/UseCouponAddEdit/index copy 2.jsx +++ /dev/null @@ -1,435 +0,0 @@ -import React, { forwardRef, useImperativeHandle, useRef } from "react"; -import { useSetState } from "ahooks"; -import { FixedSizeList } from "react-window"; -import { - Card, - DateRangePicker, - Button, - LayoutRow as Row, - LayoutCol as Col, - LayoutGrid as Grids, - Select, -} from "zent"; -import moment from "moment"; - -import Ipt from "@/components/input/main"; -import Form from "@/components/form/main"; -import FormItem from "@/components/form-item/main"; -import Grid from "@/components/gird/main.js"; - -import "./style.less"; - -const tableColumn = [ - { - title: "商品编号", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "商品名称", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "官方价", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "合同单价", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "库存数量", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "批次号", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "总预算", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "有效时间段", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "创建时间", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "类型", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "上游平台", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, - { - title: "操作", - name: "key_code", - prop: "key_code", - type: "normal", - width: "auto", - }, -]; - -const rules = { - name: [{ type: "required", message: "请输入批次名称" }], -}; - -const UseCouponAddEdit = forwardRef((props, ref) => { - /** - * type 入口类型 0优惠券新增 1计划、key批次 (是否显示两个字段) - */ - const { type = 0 } = props; - const [state, setState] = useSetState({ - setup1_title: "基本信息", - setup2_title: "发放规则", - setup3_title: "商品范围", - disabled: false, - model: { - name: "", - date_time: "", - }, - tableData: [], - tableHeight: 500, - page: 1, - dataCount: 0, - rankoptions: [], - rank: [], - newGoodsBtnLoading: false, - newGoldLoading: false, - lodgingTable: true, - plan_OPTIONS: [ - { - key: "1", - text: `plan 1`, - }, - ], - key_OPTIONS: [ - { - key: "1", - text: `key 1`, - }, - ], - }); - - useImperativeHandle(ref, () => ({ - submit: submit, - })); - - const form_el = useRef(null); - const table_el = useRef(null); - - const submit = () => { - let el = form_el.current.validator(); - console.log("el =>", el); - }; - - const onReturn = () => {}; - const onChangeCombinedDate = () => {}; - const onDisabledRange = (date, type) => { - let disabled = false; - if (type == "end") { - disabled = moment(date.getTime()).add(1, "days") <= new Date().getTime(); - } - if (type == "start") { - disabled = date.getTime() <= new Date().getTime(); - } - return disabled; - }; - const onPageChange = () => {}; - const onCountChange = () => {}; - const selectionFun = () => {}; - const onRankChange = () => {}; - const addProduct = () => {}; - const renderOptionList = (options, renderOption) => { - return ( - - {({ index, style }) => ( -
{renderOption(options[index], index)}
- )} -
- ); - }; - const plan_key_formEl = () => { - return ( - <> - - - - - ); - }; - return ( -
-
- - {/* 是否显示两个字段 */} - {type === 1 ? plan_key_formEl() : null} - - - { - setState({ model: { name: e } }); - }} - onClearItem={() => { - setState({ model: { name: "" } }); - }} - value={state.model.name} - placeholder={"请输入"} - labelWidth={"0px"} - maxLength={20} - height={"36px"} - countShow={true} - width={"520px"} - alignment={"left"} - /> - - - - { - onChangeCombinedDate(e); - }} - disabledDate={onDisabledRange} - /> - - - - - - -

- 面额 * -

- - -
- - { - setState({ model: { name: e } }); - }} - onClearItem={() => { - setState({ model: { name: "" } }); - }} - value={state.model.name} - placeholder={"请输入"} - labelWidth={"0px"} - maxLength={20} - height={"36px"} - countShow={false} - width={"130px"} - alignment={"left"} - /> -
- - - -
- - { - setState({ model: { name: e } }); - }} - onClearItem={() => { - setState({ model: { name: "" } }); - }} - value={state.model.name} - placeholder={"请输入"} - labelWidth={"0px"} - maxLength={20} - height={"36px"} - countShow={false} - width={"130px"} - alignment={"left"} - unit="元" - /> -
- -
-
- - - { - setState({ model: { name: e } }); - }} - onClearItem={() => { - setState({ model: { name: "" } }); - }} - value={state.model.name} - placeholder={"请输入"} - labelWidth={"0px"} - maxLength={20} - height={"36px"} - countShow={false} - width={"520px"} - alignment={"left"} - unit="个" - /> - - - - { - setState({ model: { name: e } }); - }} - onClearItem={() => { - setState({ model: { name: "" } }); - }} - value={state.model.name} - placeholder={"请输入"} - labelWidth={"0px"} - maxLength={20} - height={"36px"} - countShow={false} - width={"520px"} - alignment={"left"} - unit="元" - /> - -
- - -
-